Commit 085246cc authored by 郭晓清's avatar 郭晓清

1、签到,预约详情的第一轮bug修复

parent 5c54644a
......@@ -118,7 +118,7 @@
</view>
<view v-if="showCenterBtn" @click="handleBtn" class="button" :class="['center-button-view', btnClass]">
<text>{{ centerButtonText }}</text>
<view v-if="order.currentOverTime" class="time-view">
<view v-if="order.currentOverTime && showTimeOut" class="time-view">
<text style="padding-right: 8rpx;">{{order.currentOverTime > new Date().getTime()?'剩':'超'}}</text>
<u-count-down
:timestamp="timestampDiff(order.currentOverTime)"
......@@ -157,11 +157,6 @@
import takePhoto from '@/components/take/index.vue'
import PopView from "@/components/popView/index.vue"
let now = Date.now()
let r = require("../../libs/bmap-wx.min.js");
let h = new r.BMapWX({
// ak: "rpVq5d3yxaRCoKzVwmFMo0o4iC524CAG",
ak: "lF1HoyXdiv4uZx6TrGQEZs48F5y8kEHI"
});
export default {
components: {
appointTime,
......@@ -228,13 +223,7 @@
contactAddressLongitud:0,
contactAddressLatitud:0,
num:0,
waterInfo: {
longitude: '', // 经度
latitude: '', // 维度
address: '', //地址
date: '', //日期
markImage: 'https://qn-static.banshouhui.com/live_mark.png'
}
showTimeOut:true
}
},
onLoad(option) {
......@@ -279,31 +268,6 @@
}
},
methods: {
baiduLocation() {
// 百度sdk解析经纬度
let waterInfo = this.waterInfo
const t = function() {
let t = {
success: function(res) {
let e = res.wxMarkerData[0];
let i = e.address;
waterInfo.address = i
},
fail: function(err) {
console.log(err, 'err')
}
};
if (waterInfo.latitude && waterInfo.longitude) {
let e = waterInfo.latitude + "," + waterInfo.longitude;
t.location = e;
}
if(waterInfo.address){
t.address = waterInfo.address
}
h.geocoding(t);
};
t()
},
openLocation(){
if(this.isAllowDianhuaAndDaohang){
uni.getLocation({
......@@ -362,7 +326,7 @@
// 获取返回的图片 ,如果返回的图片存在则直接异常签约,成功后跳转到去完工页面,
if(img){ // 拍照完成
this.isErrorSign = true
this.errorSignUrl = process.uniEnv.qn_asset_url +img[img.length-1].key
this.errorSignUrl = img[img.length-1].key
this.handleBtn()
}else{
this.$refs.uToast.show({
......@@ -381,7 +345,7 @@
if (res.code == 200) {
self.order = res.data
this.getCurrentBtn()
self.timeOutChange(self.order.currentOverTime)
// self.timeOutChange(self.order.currentOverTime)
if(self.order.isFirstOrder){
this.visibale = true
}
......@@ -436,7 +400,6 @@
self.dateList = res.data
}
},
/* 加载预约时间段 */
async loadTimerange() {
let self = this
......@@ -480,10 +443,6 @@
})
},
getCurrentBtn() {
// this.waterInfo.address=this.order.contactProvinceText+this.order.contactCityText
// +this.order.contactCommunityText
// //+this.order.contactStreetText
// this.baiduLocation()
// 根据工单状态确定按钮的显示
var orderStatus = this.order.orderStatus
// 业务类型 指派单/订单池
......@@ -501,6 +460,7 @@
this.centerButtonText = "抢单"
this.showCenterBtn = true
this.submitType = "orderGan"
this.showTimeOut=false
} else if (orderStatus === 31 && !this.order.appointmentDatetime) {
// 预约
this.centerButton = "appoint2"
......@@ -510,6 +470,7 @@
this.showTimeSelect = true
this.isAllowDianhuaAndDaohang = true
this.submitType = "workerAppointment"
this.loadCalendar()
} else if (orderStatus === 31 && this.order.appointmentDatetime) {
// 签到
this.centerButton = "appoint3"
......@@ -539,6 +500,7 @@
// 不同请求类型传递不同数据
if(this.submitType === 'orderAccept'){ // 接单
data.orderId = this.order.orderId
data.channel = 'zypt'
}else if(this.submitType === 'orderGan'){ // 抢单
data.orderId = this.order.orderId
}else if(this.submitType === 'workerAppointment'){ // 预约
......@@ -646,7 +608,6 @@
getLocation() {
let self = this
const dataValue = this.dataValue || []
const waterInfo = this.waterInfo
uni.getLocation({
type: 'gcj02',
success: function(res) {
......@@ -682,7 +643,7 @@
s = s *6378.137 ;// EARTH_RADIUS;
s = Math.round(s * 10000)/10 ; //输出为米
console.log("计算结果",s,'M');
return s?s.toFixed(2):0;
return Number(s?s.toFixed(2):0);
},
Rad(d){
return d * Math.PI / 180.0;//经纬度转换成三角函数中度分表形式。
......@@ -696,7 +657,7 @@
timeOutChange(currentOverTime){
let self = this
var nowTime = new Date(); // 当前时间
if(nowTime.getTime() > currentOverTime){
if(currentOverTime && nowTime.getTime() > currentOverTime){
this.btnClass='timeOut-btn'
self.$refs['uCountDown'].seconds += 2
}
......
......@@ -277,7 +277,7 @@
console.log(img)
if(img !==undefined ){
// step1 添加图片
this.currentItemDate.orderImages.push(process.uniEnv.qn_asset_url+img[img.length-1].key)
this.currentItemDate.orderImages.push(img[img.length-1].key)
// step2 保存图片
var data={
type : this.currentItemDate.type,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment