Commit ab54fea9 authored by 刘用法's avatar 刘用法

推荐列表和详情时间不一致

parent 7cb3e0cd
...@@ -100,16 +100,6 @@ ...@@ -100,16 +100,6 @@
return { return {
timeout: false, timeout: false,
timestamp: 0, timestamp: 0,
/** orderType
0 待接单、
1 待预约、
2 待签到、
3 待完工、
4 审核中、
5 异常单、
6 已完工
*/
orderType: 0
}; };
}, },
computed: { computed: {
...@@ -213,44 +203,60 @@ ...@@ -213,44 +203,60 @@
}, },
orderDistance() { orderDistance() {
return this.distance(this.orderData.contactAddressLatitud,this.orderData.contactAddressLongitud, this.location[0], this.location[1]) return this.distance(this.orderData.contactAddressLatitud,this.orderData.contactAddressLongitud, this.location[0], this.location[1])
} },
}, /** orderType
created() { 0 待接单、
/* 1 待预约、
orderStatus: 2 待签到、
待接单 orderStatus<31 工单状态小于31 3 待完工、
待预约 orderStatus == 31 and appointmentDatetime == null 工单状态等于30并且预约时间为空 4 审核中、
待签到 orderStatus == 31 and appointmentDatetime is not null 工单状态等于30并且预约时间不为空 5 异常单、
待完工 orderStatus >31 and orderStatus < 80 工单状态大于31 小于80 6 已完工
审核中 orderStatus ==85 or orderStatus == 87 工单状态 等于85 或者 等于有87
异常 orderStatus ==86 or orderStatus == 88 工单状态 等于86 或者 等于有88
已完工 orderStatus in(80,81,89,110) 工单状态 等于80 or 81 or 89 or 110
*/ */
if (!this.type) { orderType() {
if (this.orderData.orderStatus < 31) { /*
this.orderType = 0 orderStatus:
} else if (this.orderData.orderStatus == 31) { 待接单 orderStatus<31 工单状态小于31
if (this.orderData.appointmentDatetime) { 待预约 orderStatus == 31 and appointmentDatetime == null 工单状态等于30并且预约时间为空
this.orderType = 2 待签到 orderStatus == 31 and appointmentDatetime is not null 工单状态等于30并且预约时间不为空
待完工 orderStatus >31 and orderStatus < 80 工单状态大于31 小于80
审核中 orderStatus ==85 or orderStatus == 87 工单状态 等于85 或者 等于有87
异常 orderStatus ==86 or orderStatus == 88 工单状态 等于86 或者 等于有88
已完工 orderStatus in(80,81,89,110) 工单状态 等于80 or 81 or 89 or 110
*/
if (!this.type) {
if (this.orderData.orderStatus < 31) {
return 0
} else if (this.orderData.orderStatus == 31) {
if (this.orderData.appointmentDatetime) {
return 2
} else {
return 1
}
} else if (this.orderData.orderStatus > 31 && this.orderData.orderStatus < 80) {
return 3
} else if (this.orderData.orderStatus == 85 || this.orderData.orderStatus == 87) {
return 4
} else if (this.orderData.orderStatus == 86 ||this.orderData.orderStatus == 88) {
return 5
} else if ([80, 81, 89, 110].indexOf(this.orderData.orderStatus) != -1) {
return 6
} else { } else {
this.orderType = 1 return 0
} }
} else if (this.orderData.orderStatus > 31 && this.orderData.orderStatus < 80) {
this.orderType = 3
} else if (this.orderData.orderStatus == 85 || this.orderData.orderStatus == 87) {
this.orderType = 4
} else if (this.orderData.orderStatus == 86 ||this.orderData.orderStatus == 88) {
this.orderType = 5
} else if ([80, 81, 89, 110].indexOf(this.orderData.orderStatus) != -1) {
this.orderType = 6
} else { } else {
this.orderType = 0 return this.types[this.type]
} }
} else { }
this.orderType = this.types[this.type] },
created() {
this.updateTime()
},
watch:{
'orderData.currentCellTime'(val) {
// 从后台重新获取数据之后,时间重新计算
this.updateTime()
} }
this.timeout = this.orderData.currentOverTime < new Date().getTime()
this.timestamp = Math.round(Math.abs(this.orderData.currentOverTime - new Date().getTime()) / 1000)
}, },
methods: { methods: {
handleClick() { handleClick() {
...@@ -302,7 +308,12 @@ ...@@ -302,7 +308,12 @@
}, },
Rad(d){ Rad(d){
return d * Math.PI / 180.0;//经纬度转换成三角函数中度分表形式。 return d * Math.PI / 180.0;//经纬度转换成三角函数中度分表形式。
}, },
updateTime() {
var time = new Date().getTime()
this.timeout = this.orderData.currentOverTime < time
this.timestamp = Math.round(Math.abs(this.orderData.currentOverTime - time) / 1000)
}
} }
} }
</script> </script>
......
...@@ -92,7 +92,7 @@ ...@@ -92,7 +92,7 @@
Customer Customer
}, },
data() { data() {
return { return {
status: 0, // 入驻状态:0=>'待提交',1=>'待审核',2=>'已通过',3=>'备选',4=>'已驳回',6=>'已签约',7=>'已支付保证金',8=>'已通过考试',9=>'待提交' status: 0, // 入驻状态:0=>'待提交',1=>'待审核',2=>'已通过',3=>'备选',4=>'已驳回',6=>'已签约',7=>'已支付保证金',8=>'已通过考试',9=>'待提交'
location: [], // 经纬度 location: [], // 经纬度
title: false, title: false,
...@@ -249,10 +249,17 @@ ...@@ -249,10 +249,17 @@
if (self.search.pageNumber == 1) { if (self.search.pageNumber == 1) {
self.orderList = [] self.orderList = []
} }
if (res.data.list) { if (res.data.list) {
self.orderList.push(...res.data.list); // self.orderList.push(...res.data.list)
// 更新每一条时间戳,防止后台返回的数据和原先一样,不触发ordercell的时间计算
var time = new Date().getTime()
for (var item of res.data.list) {
item.currentCellTime = time
self.orderList.push(item);
}
} }
self.currentLoadStatus = res.data.total > self.orderList.length && (res.data.list || []).length == self.search.pageSize ? 'loadmore' : 'nomore' self.currentLoadStatus = res.data.total > self.orderList.length && (res.data.list || []).length == self.search.pageSize ? 'loadmore' : 'nomore'
} else { } else {
......
...@@ -149,7 +149,7 @@ ...@@ -149,7 +149,7 @@
<!-- 异常预约 ,现场拍照 这里是调用拍照的两个组件--> <!-- 异常预约 ,现场拍照 这里是调用拍照的两个组件-->
<view class="right"> <view class="right">
<view v-if="errorSignIn || scenePhoto" @click="$u.throttle(handleClickRight, 500)" :class="['button', {'active': scenePhoto}]"> <view v-if="errorSignIn || scenePhoto" @click="$u.throttle(handleClickRight, 500)" :class="['button', {'active': scenePhoto}]">
<text>{{errorSignIn ? '异常签到' : '拍照'}}</text> <text :style="errorSignIn ? 'font-size:24rpx' : ''">{{errorSignIn ? '异常\n签到' : '拍照'}}</text>
</view> </view>
</view> </view>
...@@ -290,46 +290,15 @@ ...@@ -290,46 +290,15 @@
methods: { methods: {
openLocation(address){ openLocation(address){
if(this.isAllowDianhuaAndDaohang){ if(this.isAllowDianhuaAndDaohang){
// uni.getLocation({ const latitude = this.order.contactAddressLatitud //res.latitude;
// type: 'gcj02', //返回可以用于uni.openLocation的经纬度 const longitude =this.order.contactAddressLongitud //res.longitude;
// success: function (res) { uni.openLocation({
const latitude = this.order.contactAddressLatitud //res.latitude; latitude: Number(latitude),
const longitude =this.order.contactAddressLongitud //res.longitude; longitude: Number(longitude),
uni.openLocation({ success: function () {
latitude: Number(latitude), console.log('success');
longitude: Number(longitude), }
success: function () { });
console.log('success');
}
});
// }
// ,
// complete: function(res) {
// if (res.errMsg.indexOf('auth') != -1) {
// uni.showModal({
// title: '提示',
// content: '获取权限失败,请到设置页面开启权限',
// confirmText: '好的',
// success(res) {
// if (res.confirm) {
// uni.openSetting({
// success(res) {
// console.log(res.authSetting)
// }
// });
// }
// }
// })
// } else if (res.errMsg) {
// // uni.setClipboardData({
// // data: address,
// // success: function () {
// // console.log('success');
// // }
// // });
// }
// }
} }
}, },
phoneToCustomer(phone){ // 联系客户 phoneToCustomer(phone){ // 联系客户
...@@ -725,7 +694,6 @@ ...@@ -725,7 +694,6 @@
* @return float 浮点数 * @return float 浮点数
*/ */
distance(lat1, lng1, lat2, lng2) { distance(lat1, lng1, lat2, lng2) {
console.log(lat1, lng1, lat2, lng2)
var radLat1 = this.Rad(lat1); var radLat1 = this.Rad(lat1);
var radLat2 = this.Rad(lat2); var radLat2 = this.Rad(lat2);
var a = radLat1 - radLat2; var a = radLat1 - radLat2;
......
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