Commit e63794f3 authored by Facius's avatar Facius

improve: 前台-订单挂起/悬浮-保存记录优化、跳转

parent 6dc2a933
......@@ -101,10 +101,44 @@ export default {
handleClickCell(item, type, showCountTime) {
this.$emit('update:visible', false)
this.$emit('click', item, type, showCountTime)
// type:类型,showCountTime:是否显示倒计时。详情页面情况太多,提前传值可以避免页面晃动
//type类型
// 'waitAccept': 待接单、待抢单;'waitAppointment': 待预约;'waitCheckIn': 待签到;'waitFinish': 待完工;'audit': 审核中;'exception': 异常单;'finish': 已完工;'other': 工单结算信息
uni.navigateTo({
url:
'pages/order/detail?id=' +
item.orderId +
'&type=' +
type +
'&showCountTime=' +
showCountTime,
})
},
handleClickButton(item, type) {
this.$emit('update:visible', false)
this.$emit('click', item, type, showCountTime)
// 去完工
uni.navigateTo({
url:
'pages/order/complete?orderId=' +
item.orderId +
'&categoryId=' +
item.categoryId +
'&orderServiceType=' +
item.orderServiceType +
'&inGuaranteePeriod=' +
item.inGuaranteePeriod +
'&partnerCompanyId=' +
item.partnerCompanyId +
'&maintainStep=' +
item.maintainStep +
'&orderStatus=' +
item.orderStatus +
'&brandId=' +
item.lianbaoBrandId +
'&auditResults=' +
(item.auditResults ? Object.keys(item.auditResults).join() : ''),
})
},
},
}
......
......@@ -98,10 +98,7 @@
</template>
<script>
import uIcon from '../../uview-ui/components/u-icon/u-icon.vue'
import stringMixin from '../createCom/stringMixin'
export default {
components: { uIcon },
props: {
orderData: {
type: Object,
......@@ -405,7 +402,7 @@ export default {
this.type,
this.showCountTime ? 'show' : ''
)
this.storeOparation()
this.otherAction()
},
handleClickCell() {
var func = 'click'
......@@ -420,22 +417,30 @@ export default {
this.type,
this.showCountTime ? 'show' : ''
)
this.otherAction()
},
// 如果是异常单告诉后台
// 更新最近5条查看记录
otherAction() {
this.exceptionRecord()
this.storeOparation()
},
exceptionRecord() {
// 如果是异常单告诉后台
if (this.type == 'exception') {
this.$u.api.workerDealWithError(item.orderId).then(() => {})
}
},
storeOparation() {
// 更新最近5条查看记录
if (!this.isSimple) {
var array = [...this.vuex_last_five_orders] || []
var i = 0
for (var item of array) {
if (item && item.orderId == this.orderData.orderId) {
// 需要替换,跳出for循环
break
}
i++
}
array[i] = this.orderData // 用this.orderData替换或新增进this.vuex_last_five_orders
var array = (this.vuex_last_five_orders || []).filter((item) => {
// 如果记录中有该工单,删除
return item && item.orderId != this.orderData.orderId
})
this.$u.vuex('vuex_last_five_orders', array.slice(-5))
array.unshift(this.orderData)
this.$u.vuex('vuex_last_five_orders', array.slice(0, 5))
}
},
handleChange(timestamp) {
......
......@@ -368,9 +368,6 @@ export default {
},
handleClickCellButton(item, type) {
if (!this.loaded) return
if (type == 'exception') {
this.$u.api.workerDealWithError(item.orderId).then(() => {})
}
// 去完工
uni.navigateTo({
url:
......
......@@ -171,9 +171,6 @@ export default {
},
handleClickCellButton(item, type) {
if (type == 'exception') {
this.$u.api.workerDealWithError(item.orderId).then(() => {})
}
// 去完工
uni.navigateTo({
url:
......
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