Commit 84a539ab authored by Facius's avatar Facius

订单详情页面优化

parent 5207db1a
......@@ -114,7 +114,7 @@
buttonStyle() { // 按钮样式
switch (this.orderType) {
case 0:
if (this.orderData.orderBusinessType != 'R') {
if (!this.isCompetition ) {
return this.buttonStyles[0]
} else {
return this.buttonStyles[1]
......@@ -130,8 +130,7 @@
}
},
showCountTime() { // ((待预约、 待签到、 待完工) || (待接单 && 业务类型非抢单)) && 有超过时间点
return ([1, 2, 3].indexOf(this.orderType) != -1 || (this.orderType == 0 && this.orderData
.orderBusinessType != 'R')) && this.orderData.currentOverTime
return ([1, 2, 3].indexOf(this.orderType) != -1 || (this.orderType == 0 && !this.isCompetition)) && this.orderData.currentOverTime
},
showTime() {
return [4, 5, 6].indexOf(this.orderType) != -1
......@@ -146,9 +145,12 @@
},
typeTexts() {
return [this.type0Text, '去预约', '去签到', '去完工', '审核中', '去处理', '已完工']
},
isCompetition() { // 是:订单池,抢单; 否:指派单,接单
return this.orderData.orderBusinessType == 'R'
},
type0Text() {
return this.orderData.orderBusinessType != 'R' ? '接单' : '抢单'
return !this.isCompetition ? '接单' : '抢单'
},
buttonStyles() {
return [{
......@@ -196,17 +198,6 @@
showDistance() {
return this.orderType == 0 && this.location.length >= 2 && (this.orderData.contactAddressLatitud || this.orderData.contactAddressLongitud)
},
titles() {
return {
'waitAccept': '待' + this.type0Text, // 待接单、
'waitAppointment': '待预约', // 待预约、
'waitCheckIn': '待签到', // 待签到、
'waitFinish': '待完工', // 待完工、
'audit': '审核中', // 审核中、
'exception': '异常单', // 异常单、
'finish': '已完工', //已完工
}
},
types() {
return {
'waitAccept': 0, // 待接单、
......@@ -218,9 +209,6 @@
'finish': 6, //已完工
}
},
title() {
return this.titles[this.type]
},
orderDistance() {
return this.distance(this.orderData.contactAddressLatitud,this.orderData.contactAddressLongitud, this.location[0], this.location[1])
},
......@@ -282,10 +270,10 @@
// title:标题,showCountTime:是否显示倒计时。详情页面情况太多,提前传值可以避免页面晃动
handleClick() {
// if (this.buttonDisabled) return
this.$emit('action', this.orderData, this.title, this.showCountTime ? 'show' : '')
this.$emit('action', this.orderData, this.type, this.showCountTime ? 'show' : '')
},
handleClickCell() {
this.$emit('click', this.orderData, this.title, this.showCountTime ? 'show' : '')
this.$emit('click', this.orderData, this.type, this.showCountTime ? 'show' : '')
},
handleChange(timestamp) {
if (this.timeout) this.$refs['order-count-down'].seconds += 2
......@@ -310,10 +298,10 @@
/**
* echo distance(116.3896,39.91917,116.3940,39.91726);
* 计算两点之间直线距离
* @param float $lon1
* @param float $lat1
* @param float $lon2
* @param float $lat2
* @param float $lon1
* @param float $lat1
* @param float $lon2
* @param float $lat2
* @return float 浮点数
*/
distance(lat1, lng1, lat2, lng2) {
......
......@@ -16,8 +16,8 @@
</view>
<view class="right-view">
<view class="line-view-top">
<text>{{$u.timeFormat(record.operationDatetime, 'yyyy.mm.dd hh:MM:ss')}} </text>
<text style="color: red;">{{record.overTime?'超时':''}}{{record.exception?'异常':''}}</text>
<text>{{$u.timeFormat(record.operationDatetime, 'yyyy.mm.dd &nbsp hh:MM:ss')}}</text>
<text style="color: red;">{{record.overTime?'超时':''}}{{record.overTime && record.exception ? '/' : ''}}{{record.exception?'异常':''}}</text>
<text style="color: #2272FF;" v-show="record.isTrace">跟进</text>
</view>
<view class="line-view-item">
......
......@@ -5,7 +5,6 @@
scroll-anchoring scroll-y="true" refresher-enabled="true" :refresher-triggered="triggered" :refresher-threshold="100"
refresher-background="#F4F5F7" @refresherpulling="triggered = true" @refresherrefresh="onRefresh"
@refresherrestore="onRestore" enable-back-to-top>
<!-- <TabBarPage title="扳手会"> -->
<image class="banner-image" :src="bannerImage" @click="handleClickBanner"></image>
<view class="msg-view">
......@@ -23,12 +22,9 @@
</view>
</view>
</view>
<!-- 订单推荐吸顶 -->
<!-- <u-sticky offset-top="0"> -->
<view class="sticky">
<text>订单推荐</text>
</view>
<!-- </u-sticky> -->
<view class="sticky">
<text>订单推荐</text>
</view>
<view class="order-view">
<!-- 入驻成功之后显示推荐订单列表 -->
<view class="order-list-view" v-if="loaded">
......@@ -47,28 +43,21 @@
<NoOrder />
</view>
<view v-else class="order-item-view">
<!-- <scroll-view scroll-y style="margin-bottom: 20rpx;" @scrolltolower="reachBottom"
scroll-anchoring> -->
<view v-for="(item, index) in orderList" :key="index">
<OrderCell :orderData="item" type="waitAccept" :location="location"
@click="handleClick" @action="handleClick">
</OrderCell>
</view>
<u-loadmore v-show="(search.pageNumber == 1 && loadedOrder) || search.pageNumber > 2" :status="currentLoadStatus" bgColor="#F4F5F7"></u-loadmore>
<!-- </scroll-view> -->
</view>
</template>
</view>
</view>
<!-- </view> -->
<!-- </scroll-view> -->
<view class="bottom-view" v-if="needSettled || orderList.length <= 0">
<view class="bottom-line-view"></view>
<view class="bottom-text">我也是有底线哒</view>
<view class="bottom-line-view"></view>
</view>
<!-- </TabBarPage> -->
</scroll-view>
</view>
</TabBarPage>
......@@ -166,9 +155,11 @@
this.getOrderCount()
this.initSettleInfo();
},
handleClick(item, title) { // 跳转工单详情页面
handleClick(item, type, showCountTime) { // 跳转工单详情页面 showCountTime:是否显示倒计时
// type类型
// 'waitAccept': 待接单、待抢单;'waitAppointment': 待预约;'waitCheckIn': 待签到;'waitFinish': 待完工;'audit': 审核中;'exception': 异常单;'finish': 已完工;'other': 工单结算信息
uni.navigateTo({
url: 'pages/order/detail?id=' + item.orderId + '&title=' + title
url: 'pages/order/detail?id=' + item.orderId + '&type=' + type + '&showCountTime=' + showCountTime
})
},
async initSettleInfo() {
......
<template>
<TabBarPage title="订单" :fixed="true">
<!-- <view class="wrap"> -->
<view class="tools-box">
<view class="search-sub">
<u-subsection :current="curNow" :list="subList" active-color="white" bg-color="white"
......@@ -20,7 +19,6 @@
</view>
<view class="tab-view">
<!-- <swiper-item class="swiper-item" v-for="(res, ind) in orderList" :key="ind"> -->
<scroll-view scroll-y style="height: 100%;width: 100%;" @scrolltolower="reachBottom" scroll-anchoring
scroll-y="true" refresher-enabled="true" :refresher-triggered="triggered" :refresher-threshold="100"
refresher-background="#F4F5F7" @refresherpulling="triggered = true" @refresherrefresh="onRefresh"
......@@ -34,11 +32,8 @@
<u-loadmore v-show="(pageNumber == 1 && loaded) || pageNumber > 2" :status="loadStatus" bgColor="#F4F5F7"></u-loadmore>
</template>
</scroll-view>
<!-- </swiper-item> -->
</view>
<!-- </view> -->
<PopView title="aaaa" message="bbbb" :visible="visibale" />
</TabBarPage>
</template>
......@@ -55,8 +50,6 @@
},
data() {
return {
visibale: false,
showSview: true,
curNow: 0,
pageNumber: 0,
pageSize: 100,
......@@ -90,21 +83,6 @@
_freshing: false,
};
},
onLoad(e) {
getApp().trackPage('订单首页')
this._freshing = false;
// this.getLocation(); // 不需要获取位置
// this.getOrderCount();
// this.getOrderList(0);
if (e && e.type) {
this.current = e.type
}
},
onShow() {
this.pageNumber = 0
this.getOrderCount()
this.getOrderList(this.currentIndex);
},
computed: {
subList() {
return ['待处理', '已完工']
......@@ -140,6 +118,9 @@
5: 'finish'
}
},
countKeys() {
return ['toAppointmentCount', 'toCheckinCount', 'toFinishCount', 'reviewingCount', 'exceptionCount']
},
noMore() {
return this.orderList.length == 0 && this.loaded
},
......@@ -148,6 +129,16 @@
}
},
onLoad(e) {
getApp().trackPage('订单首页')
this._freshing = false;
if (e && e.type) {
this.current = e.type
}
},
onShow() {
this.reloadOrderInfo()
},
methods: {
sectionChange(index) {
this.curNow = index;
......@@ -164,43 +155,6 @@
this.loadStatus = 'loading'
this.getOrderList(index);
},
/**
* 获取当前位置的经纬度
*/
getLocation() {
let self = this
const dataValue = this.dataValue || []
const waterInfo = this.waterInfo
uni.getLocation({
type: 'gcj02',
success: function(res) {
dataValue.push(res.longitude)
dataValue.push(res.latitude)
self.dataValue = dataValue
},
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)
}
});
}
}
})
}
},
fail: function(err) {
}
});
},
reachBottom(e) {
if (this.loadStatus != 'loadmore') return
......@@ -244,27 +198,19 @@
// 获取订单数量
getOrderCount() {
var self = this; // 加载订单列表
var self = this
self.$u.api.listOrderCount().then((res) => {
if (res.code == 200) {
if (res.data) {
self.list.forEach(item => {
if (item.name === '待预约') {
item.total = res.data.toAppointmentCount
} else if (item.name === '待签到') {
item.total = res.data.toCheckinCount
} else if (item.name === '待完工') {
item.total = res.data.toFinishCount
} else if (item.name === '审核中') {
item.total = res.data.reviewingCount
} else if (item.name === '异常单') {
item.total = res.data.exceptionCount
}
})
// 修改各个tab数量
var i = 0
var count = 0
for (var i in res.data) {
count += res.data[i]
for (var item of self.list) {
item.total = res.data[self.countKeys[i]]
count += item.total
i++
}
// 修改tab总数
if (count > 0) {
uni.setTabBarBadge({
......@@ -282,13 +228,15 @@
}
});
},
handleClick(item, title, showCountTime) { // title:标题,showCountTime:是否显示倒计时。详情页面情况太多,提前传值可以避免页面晃动
handleClick(item, type, showCountTime) { // type:类型,showCountTime:是否显示倒计时。详情页面情况太多,提前传值可以避免页面晃动
if(item.orderStatus===86 || item.orderStatus===88){
this.filish(item)
return
}
//type类型
// 'waitAccept': 待接单、待抢单;'waitAppointment': 待预约;'waitCheckIn': 待签到;'waitFinish': 待完工;'audit': 审核中;'exception': 异常单;'finish': 已完工;'other': 工单结算信息
uni.navigateTo({
url: 'pages/order/detail?id=' + item.orderId + '&title=' + title + '&showCountTime=' + showCountTime
url: 'pages/order/detail?id=' + item.orderId + '&type=' + type + '&showCountTime=' + showCountTime
})
},
filish(item){
......@@ -303,13 +251,6 @@
+ "&maintainStep=" + item.maintainStep
})
},
// handleAction(item) {
// if(item.orderStatus===86 || item.orderStatus===88){
// this.filish(item)
// return
// }
// this.viewOderItem(item.orderId)
// },
handleClickSearch() {
uni.navigateTo({
url: 'pages/order/search'
......@@ -318,15 +259,18 @@
onRefresh() {
if (this._freshing) return;
this._freshing = true;
this.reloadOrderInfo()
},
onRestore() {
this.triggered = 'restore'; // 需要重置
},
reloadOrderInfo() {
this.pageNumber = 0
this.orderList = []
this.loadStatus = 'loading'
this.getOrderCount();
this.getOrderList(this.currentIndex);
},
onRestore() {
this.triggered = 'restore'; // 需要重置
},
}
}
};
</script>
......@@ -347,13 +291,6 @@
}
.order {
// width: 710rpx;
// background-color: #ffffff;
// margin: 20rpx auto;
// border-radius: 20rpx;
// box-sizing: border-box;
// padding: 20rpx;
// font-size: 28rpx;
.top {
display: flex;
......@@ -519,17 +456,6 @@
padding-bottom: 20rpx;
}
// .swiper-box {
// flex: 1;
// }
// .swiper-item {
// height: 100%;
// .page-box {
// padding-bottom: 20rpx;
// }
// }
.tools-box {
display: flex;
flex-direction: row;
......
......@@ -152,7 +152,7 @@
},
handleClickCell(orderId) {
this.$u.route({
url: 'pages/order/detail?isFromMine=1',
url: 'pages/order/detail?&type=other',
params: {
id: orderId
}
......
......@@ -109,7 +109,7 @@
handleClickCell(orderId) {
uni.navigateTo({
url: 'pages/order/detail?isFromMine=1&id=' + orderId
url: 'pages/order/detail?isFromMine=1&id=' + orderId + '&type=other'
})
},
async loadStatement() {
......
......@@ -112,7 +112,6 @@
import XhLabel from "../../components/createCom/XhLabel"
import takePhoto from '@/components/take/index.vue'
import baseFile from '@/components/upload/index'
import Detail from "@/components/order/detail.vue"
// 表单类型map
const formType = new Map([
......@@ -274,7 +273,6 @@
XhServiceMeasure,
XhServiceMore,
XhLabel,
Detail,
'take-photo': takePhoto
},
mixins: [baseFile],
......
......@@ -2,7 +2,7 @@
<view class="order-wrap">
<u-navbar :title="title" title-color="#FFFFFF" title-size="32" back-icon-color="#FFFFFF" :background="background" :border-bottom="false" title-bold></u-navbar>
<view class="content">
<view class="header" v-if="showCountTime || (order.currentOverTime && showTimeOut)">
<view class="header" v-if="showTimeView">
<image class="bottom-tag-view" :src="tagImage"></image>
<!-- 倒计时 -->
<view class="title">
......@@ -21,7 +21,7 @@
<Detail :order="order" :readMore.sync="readMore" :operate="isAllowDianhuaAndDaohang"></Detail>
</view>
<!-- 从我的页面进来显示结算信息 -->
<view v-if="isFromMine" class="settlement-view">
<view v-if="isOther" class="settlement-view">
<view class="settlement-title">结算信息</view>
<view class="settlement-content">
<text class="content-left">工单确认时间:</text>
......@@ -50,8 +50,8 @@
<u-icon name="arrow-right"></u-icon>
</view>
</view>
<!-- 时间选择 -->
<view class="card appoint-item" v-show="showTimeSelect">
<!-- 带预约显示时间选择 -->
<view class="card appoint-item" v-show="isWaitAppointment">
<appoint-time :dateList="dateList" :timeList="timeList" @dateChange="dateChange" @timeChange="timeChange" @weekChange="weekChange"></appoint-time>
</view>
<!-- 履约记录 -->
......@@ -61,7 +61,7 @@
</view>
</view>
<!-- 不是从我的页面进来才显示 -->
<template v-if="!isFromMine">
<template v-if="!isOther">
<view>
<u-toast ref="uToast" />
</view>
......@@ -101,7 +101,7 @@
mixins: [baseFile],
data() {
return {
title: ' ',
type: '',
readMore: true,
dateList: [
{day: now, timeRange: []},
......@@ -134,77 +134,30 @@
visible: false,
orderId: null,
order: {},
allowRejection: false, // 允许拒单
allowFeedback: false, // 允许过程反馈
needPhotograph: true, // 需要现场拍摄
centerButton: '', // 是否显示按钮
bottomButtonText: '',
orderRecords: [],
method: null,
showBottomBtn: false,
showTimeSelect: false,
submitType: '',
nextUrl:'',
takeStatus:false,
errorSignIn:false,
scenePhoto: false,
isErrorSign:false,
errorSignUrl:'',
isAllowDianhuaAndDaohang : true,
appointmentDatetimeRange:'',
appointmentDatetime:'',
signDistance:3000,
contactAddressLongitud:0,
contactAddressLatitud:0,
num:0,
showTimeOut:true,
clicking: false,
dateItem: null,
centerBtnDisabled:false,
isFromMine: false,
settlementInfo: {formatTime: '-', list: [], amount: ''},
unloaded: false,
timeout: false,
timestamp: 0,
showFile: false, // 显示查看业务文件
showCountTime : false
showCountTime : false, // 从上个页面传入是否显示倒计时
}
},
onLoad(option) {
getApp().trackPage('订单详情页')
// 生命周期函数--监听页面加载
if (option && option.id) {
this.orderId = option.id
}
if (option && option.showCountTime) { // 是否显示倒计时,上个页面传入,可以快速显示避免页面跳动太大;跟后台获取数据之后再根据其他条件判断一次
this.showCountTime = option.showCountTime
}
if (option && option.title) { // 上个页面传入,可以快速显示避免页面跳动太大
this.title = decodeURIComponent(option.title)
} else {
this.title = "订单信息"
}
this.loadOrderDetail()
this.getLocation()
if (option && option.isFromMine) {
this.isFromMine = true
// 获取结算信息
this.loadSettlement()
} else {
this.loadOrderRecord()
this.getSignDistance()
}
},
// onHide() {
// this.closeLocationChange()
// },
onUnload() {
this.unloaded = true
this.closeLocationChange()
},
computed: {
customStyle() {
return {
......@@ -215,20 +168,6 @@
'background-color': 'transparent'
}
},
tipText() {
switch (this.bottomButtonText) {
case '接单':
return this.timeout ? '您的订单已超时,请及时接单' : '请您注意剩余时间,及时接单'
case '预约':
return this.timeout ? '您的订单已超时,请及时预约' : '请您注意剩余时间,及时预约'
case '签到':
return this.timeout ? '您的订单已超时,请及时签到' : '请您注意剩余时间,及时签到'
case '去完工':
return this.timeout ? '您的订单已超时,请及时完工' : '请您注意剩余时间,及时完工'
default:
return ''
}
},
buttons() {
//id: 0 主流程; 1 过程反馈;2 异常签到; 3 现场拍照
return [{
......@@ -243,7 +182,7 @@
label: '异常签到',
type: 'image',
image: 'yichangqiandao.png',
show: this.errorSignIn,
show: this.isWaitCheckIn, // 待签到显示
disabled: false,
id: 2
},
......@@ -251,7 +190,7 @@
label: '现场拍照',
type: 'image',
image: 'xiancahngpaizhao.png',
show: this.scenePhoto,
show: this.isWaitFinish,
disabled: false,
id: 3
},
......@@ -263,7 +202,7 @@
disabled: this.centerBtnDisabled,
id: 0,
customStyle: {
'background-color': this.title == '待抢单' ? '#FF930D' : (this.centerBtnDisabled ? '#D1D4D4' : '#2272FF')
'background-color': this.isCompetition ? '#FF930D' : (this.centerBtnDisabled ? '#D1D4D4' : '#2272FF')
}
}]
},
......@@ -282,6 +221,119 @@
shengyuImage() {
return process.uniEnv.qn_base_url + 'shengyu.png'
},
types() {
return {
'waitAccept': 0, // 待接单、待抢单
'waitAppointment': 1, // 待预约、
'waitCheckIn': 2, // 待签到、
'waitFinish': 3, // 待完工、
'audit': 4, // 审核中、
'exception': 5, // 异常单、
'finish': 6, // 已完工
'snapped': 8, // 已被抢
'other': 9, // 工单结算信息
}
},
titles() {
return ['待' + this.type0Text,'待预约','待签到','待完工','审核中','异常单','已完工','','','订单信息']
},
bottomButtonText() { // 底部主流程按钮文字
return this.buttonTexts[this.types[this.type]]
},
buttonTexts() {
return [this.type0Text,'预约','签到','去完工','','','','','已被抢','']
},
tipText() { // 时间紧迫提示文字
return this.timeout ? '您的订单已超时,请及时' + this.tipTypeText : '请您注意剩余时间,及时' + this.tipTypeText
},
tipTexts() {
return ['接单','预约','签到','完工','','','','','','']
},
tipTypeText() {
return this.tipTexts[this.types[this.type]]
},
title() { // 标题
return this.titles[this.types[this.type]]
},
type0Text() {
return this.isCompetition ? '抢单' : '接单'
},
isCompetition() { // 是:订单池,抢单; 否:指派单,接单
return this.order.orderBusinessType == 'R'
},
isOther() { // 工单结算信息
return this.type == 'other'
},
allowRejection() { // 允许拒单
// 待接单 && 业务类型非抢单
return this.type == 'waitAccept' && !this.isCompetition
},
showBottomBtn() { // 显示底部button
// 0 待接单、待抢单, 1 待预约, 2 待签到, 3 待完工, 8 已被抢
return [0, 1, 2, 3, 8].indexOf(this.types[this.type]) != -1
},
showFile() { // 显示查看业务文件
// 1 待预约, 2 待签到, 3 待完工, 4 审核中, 5 异常单, 6 已完工, 8 已被抢
return this.types[this.type] > 0
},
isAllowDianhuaAndDaohang() { // 可以点击电话和定位按钮
return this.type != 'waitAccept'
},
showTimeView() { // 是否显示倒计时窗口
// 上个页面传入 || 订单信息有超过时间点 && ((待预约、 待签到、 待完工) || (待接单 && 业务类型非抢单))
return this.showCountTime || this.order.currentOverTime && ([1, 2, 3].indexOf(this.types[this.type]) != -1 || (this.type == 'waitAccept' && !this.isCompetition))
},
allowFeedback() { // 允许过程反馈
// 1 待预约, 2 待签到, 3 待完工
return [1, 2, 3].indexOf(this.types[this.type]) != -1
},
isWaitCheckIn() { // 待签到
return this.type == 'waitCheckIn'
},
isWaitAppointment() { // 待预约
return this.type == 'waitAppointment'
},
isWaitFinish() {
return this.type == 'waitFinish'
}
},
onLoad(option) {
getApp().trackPage('订单详情页')
// 生命周期函数--监听页面加载
if (option && option.id) {
this.orderId = option.id
}
if (option && option.showCountTime) { // 是否显示倒计时,上个页面传入,可以快速显示避免页面跳动太大;之后还需要从后台获取信息,再根据其他条件判断一次
this.showCountTime = option.showCountTime
}
if (option && option.type) { // 类型,从上个页面传进来可以快速构建页面;之后还需要从后台获取信息,更新状态
// 'waitAccept': 待接单、待抢单;'waitAppointment': 待预约;'waitCheckIn': 待签到;'waitFinish': 待完工;'audit': 审核中;'exception': 异常单;'finish': 已完工;'other': 工单结算信息
this.type = option.type
}
this.loadOrderDetail()
this.getLocation()
if (this.isOther) {
// 获取结算信息
this.loadSettlement()
} else {
this.loadOrderRecord() // 履约记录
this.getSignDistance() // 定位
}
},
onShow() {
// 从标签列表页面返回,获取选中的标签
let pages = getCurrentPages()
let page = pages[pages.length - 1]
if (page.needFresh) {
this.loadOrderDetail()
this.loadOrderRecord()
}
},
onUnload() {
this.unloaded = true
this.closeLocationChange()
},
methods: {
updateLocation(){
......@@ -316,7 +368,7 @@
wx.offLocationChange(this._locationChangeFn);
},
handleClickRight(active) {
this.scenePhoto ? this.scenePhotoClick() : this.take()
this.isWaitFinish ? this.scenePhotoClick() : this.take()
},
scenePhotoClick() { // 跳转拍照小程序
uni.navigateTo({
......@@ -353,7 +405,7 @@
self.$u.api.orderDetail(data, self.orderId).then((res) => {
if (res.code == 200) {
self.order = res.data
this.getCurrentBtn()
this.setOrderType()
var nowTime = new Date().getTime();
this.timeout = this.order.currentOverTime && nowTime> this.order.currentOverTime
this.timestamp = Math.round(Math.abs(this.order.currentOverTime - nowTime) / 1000)
......@@ -497,89 +549,35 @@
}
})
},
getCurrentBtn() {
setOrderType() {
// 根据工单状态确定按钮的显示
var orderStatus = this.order.orderStatus
// 业务类型 指派单/订单池
var orderBusinessType = this.order.orderBusinessTypeText
if (orderStatus < 31 && orderBusinessType === '指派单') {
if (orderStatus < 31) {
// 接单
this.showBottomBtn = true
this.bottomButtonText = "接单"
// 已派单的时显示拒单按钮
this.allowRejection = true
this.submitType = "orderAccept"
this.readMore = false
this.isAllowDianhuaAndDaohang = false
this.title = '待接单',
this.showFile = false
} else if (orderStatus < 31 && orderBusinessType === '订单池') {
// 抢单
this.centerButton = "appoint1"
this.bottomButtonText = "抢单"
this.showBottomBtn = true
this.submitType = "orderGan"
this.showTimeOut=false
this.readMore = false
this.isAllowDianhuaAndDaohang = false
this.title = '待抢单',
this.showFile = false
this.type = 'waitAccept'
this.submitType = this.isCompetition ? 'orderGan' : 'orderAccept'
} else if (orderStatus === 31 && !this.order.appointmentDatetime) {
// 预约
this.centerButton = "appoint2"
this.bottomButtonText = "预约"
this.allowFeedback = true
this.showBottomBtn = true
this.showTimeSelect = true
this.isAllowDianhuaAndDaohang = true
this.readMore = true
this.type = 'waitAppointment'
this.submitType = "workerAppointment"
this.title = '待预约',
this.showFile = true
this.loadCalendar()
} else if (orderStatus === 31 && this.order.appointmentDatetime) {
// 签到
this.centerButton = "appoint3"
this.bottomButtonText = "签到"
this.allowFeedback = true
this.showBottomBtn = true
this.type = 'waitCheckIn'
this.submitType = "maintainWorkerCheckin"
this.isAllowDianhuaAndDaohang = true
this.errorSignIn = true
this.title = '待签到',
this.showFile = true
// this.addressToCoordinate()
this.updateLocation()
} else if (orderStatus > 31 && orderStatus < 80) {
// 完工
this.centerButton = "filish"
this.bottomButtonText = "去完工"
this.type = 'waitFinish'
this.submitType = "toFilish"
this.allowFeedback = true
this.showBottomBtn = true
this.scenePhoto = true
this.readMore = true
this.isAllowDianhuaAndDaohang = true
this.title = '待完工',
this.showFile = true
}else if (orderStatus == 85 || orderStatus == 87) { // 审核中
this.isAllowDianhuaAndDaohang = true
this.title = '审核中',
this.showFile = true
this.showTimeOut=false
this.type = 'audit'
} else if (orderStatus == 86 || orderStatus == 88) { // 异常单
this.isAllowDianhuaAndDaohang = true
this.title = '异常单',
this.showFile = true
this.showTimeOut=false
this.type = 'exception'
} else if ([80, 81, 89, 110].indexOf(orderStatus) != -1) { // 已完工
this.isAllowDianhuaAndDaohang = true
this.title = '已完工',
this.showFile = true
this.showTimeOut=false
} else {
this.isAllowDianhuaAndDaohang = true
this.type = 'finish'
}
this.readMore = this.type != 'waitAccept'
},
handleClickSure() {
if ((this.submitType == 'orderAccept' || this.submitType == 'orderGan') && process.uniEnv.node_env == 'prod') {
......@@ -725,8 +723,8 @@
})
},
isGan(){
this.bottomButtonText = "已被抢"
this.submitType = ""
this.type = 'snapped'
this.submitType = ''
this.centerBtnDisabled = true
},
clickFeedback(){
......
......@@ -368,13 +368,13 @@ export default {
let res = await self.$u.api.traceAndAppointment(params, self.orderId);
self.submiting = false;
if(res && res.code == 200) {
self.$u.route({
type: 'redirect',
url: 'pages/order/detail',
params: {
id: self.orderId
}
})
var pages = getCurrentPages();
if (pages.length >= 2) {
var page = pages[pages.length - 2];
page.needFresh = true
}
uni.navigateBack()
}
}
}
......
......@@ -27,7 +27,7 @@
<view v-if="orderList && orderList.length > 0" class="order-row">
<view v-for="(item, index) in orderList" :key="item.orderId">
<OrderCell :orderData="item" :orderType="orderType" :location="dataValue"
@click="handleClick(item)" @action="handleAction(item)"> </OrderCell>
@click="handleClick" @action="handleClick"> </OrderCell>
</view>
<u-loadmore :status="loadStatus" bgColor="#F4F5F7"></u-loadmore>
</view>
......@@ -114,17 +114,29 @@
self.loaded = true
});
},
viewOderItem(orderId) { // 跳转工单详情页面
handleClick(item, type, showCountTime) { // type:类型,showCountTime:是否显示倒计时。详情页面情况太多,提前传值可以避免页面晃动
if(item.orderStatus===86 || item.orderStatus===88){
this.filish(item)
return
}
//type类型
// 'waitAccept': 待接单、待抢单;'waitAppointment': 待预约;'waitCheckIn': 待签到;'waitFinish': 待完工;'audit': 审核中;'exception': 异常单;'finish': 已完工;'other': 工单结算信息
uni.navigateTo({
url: 'pages/order/detail?id=' + orderId
url: 'pages/order/detail?id=' + item.orderId + '&type=' + type + '&showCountTime=' + showCountTime
})
},
handleClick(item) {
this.viewOderItem(item.orderId)
},
handleAction(item) {
this.viewOderItem(item.orderId)
},
filish(item){
// 去完工
uni.navigateTo({
url: 'pages/order/complete?orderId='+item.orderId
+ "&categoryId=" + item.categoryId
+ "&orderServiceType=" + item.orderServiceType
+ "&inGuaranteePeriod=" + item.inGuaranteePeriod
+ "&partnerCompanyId=" + item.partnerCompanyId
+ "&auditResultsId=" + (item.auditResults?Object.keys(item.auditResults)[Object.keys(item.auditResults).length - 1]:'')
+ "&maintainStep=" + item.maintainStep
})
}
},
}
</script>
......
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