Commit c143e1f4 authored by Facius's avatar Facius

feat: 同步1.4.6在test分支的代码

parent 1a4dda82
...@@ -17,7 +17,7 @@ let orderApiFun = function(vm){ ...@@ -17,7 +17,7 @@ let orderApiFun = function(vm){
/** /**
* 订单管理工单数量查询接口 * 订单管理工单数量查询接口
*/ */
let manageOrderCount = async (params = {}) => await vm.$u.get(prefix + 'wokerOrder/countOrderByTimeRange', params); let manageOrderCount = async (params = {}) => await vm.$u.get(prefix + vm.vuex_token + '/wokerOrder/countOrderByTimeRange', params);
/** /**
* 工单列表接口 * 工单列表接口
*/ */
......
...@@ -112,9 +112,9 @@ export default { ...@@ -112,9 +112,9 @@ export default {
showCountTime, showCountTime,
}) })
}, },
handleClickButton(item, type, showCountTime) { handleClickButton(item, type, showCountTime, auditResults) {
this.$emit('update:visible', false) this.$emit('update:visible', false)
this.$emit('click', item, type, showCountTime) this.$emit('click', item, type, showCountTime, auditResults)
// 去完工 // 去完工
uni.navigateTo({ uni.navigateTo({
url: url:
...@@ -135,7 +135,9 @@ export default { ...@@ -135,7 +135,9 @@ export default {
'&brandId=' + '&brandId=' +
item.lianbaoBrandId + item.lianbaoBrandId +
'&auditResults=' + '&auditResults=' +
(item.auditResults ? Object.keys(item.auditResults).join() : ''), (auditResults ? auditResults.join() : '') +
'&orderNumber=' +
item.orderNumber,
}) })
}, },
}, },
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<view <view
:class="['order-view', { simple: isSimple }]" :class="['order-view', { simple: isSimple }]"
@click="handleClickCell" @click="handleClickCell"
hover-class="u-hover-class" :hover-class="isSimple ? 'u-hover-class' : ''"
> >
<view v-if="!isSimple" class="order-top-view"> <view v-if="!isSimple" class="order-top-view">
<view class="left-view"> <view class="left-view">
...@@ -56,11 +56,16 @@ ...@@ -56,11 +56,16 @@
<view class="line-view"></view> <view class="line-view"></view>
<view class="reason-view" v-if="showReason"> <view class="reason-view" v-if="showReason">
<view class="reason-title"><text>未通过原因:</text></view> <view class="reason-title"><text>未通过原因:</text></view>
<view class="reason-text" <view class="reason-text">
><text v-for="(item, index) in orderData.auditResults" :key="index">{{ <text
item v-for="(item, index) in orderData.partAuditResults"
}}</text></view :key="index"
>{{ item }}</text
> >
<text v-for="(item, index) in orderData.auditResults" :key="index">{{
item
}}</text>
</view>
</view> </view>
<view class="bottom-view"> <view class="bottom-view">
<view> <view>
...@@ -330,6 +335,16 @@ export default { ...@@ -330,6 +335,16 @@ export default {
return this.typeList[this.orderType] return this.typeList[this.orderType]
} }
}, },
auditResults() {
let partAuditResults = this.orderData.partAuditResults
? ['orderSpareParts']
: []
let auditResults = this.orderData.auditResults
? Object.keys(this.orderData.auditResults)
: []
auditResults = auditResults.concat(partAuditResults)
},
orderDistance() { orderDistance() {
return this.distance( return this.distance(
this.orderData.contactAddressLatitud, this.orderData.contactAddressLatitud,
...@@ -421,11 +436,16 @@ export default { ...@@ -421,11 +436,16 @@ export default {
func, func,
this.orderData, this.orderData,
this.realType, this.realType,
this.showCountTime ? 'show' : '' this.showCountTime ? 'show' : '',
this.auditResults
) )
this.otherAction() this.otherAction()
}, },
handleClickCell() { handleClickCell() {
if (this.isSimple) {
this.handleClick()
return
}
var func = 'click' var func = 'click'
this.handleExceptions() this.handleExceptions()
if (this.isException) { if (this.isException) {
...@@ -436,7 +456,8 @@ export default { ...@@ -436,7 +456,8 @@ export default {
func, func,
this.orderData, this.orderData,
this.realType, this.realType,
this.showCountTime ? 'show' : '' this.showCountTime ? 'show' : '',
this.auditResults
) )
this.otherAction() this.otherAction()
}, },
...@@ -449,7 +470,7 @@ export default { ...@@ -449,7 +470,7 @@ export default {
exceptionRecord() { exceptionRecord() {
// 如果是异常单告诉后台 // 如果是异常单告诉后台
if (this.realType == 'exception') { if (this.realType == 'exception') {
this.$u.api.workerDealWithError(item.orderId).then(() => {}) this.$u.api.workerDealWithError(this.orderData.orderId).then(() => {})
} }
}, },
storeOparation() { storeOparation() {
......
...@@ -73,7 +73,7 @@ ...@@ -73,7 +73,7 @@
> >
<NoOrder /> <NoOrder />
</view> </view>
<view v-else class="order-item-view"> <view v-else-if="orderList.length > 0" class="order-item-view">
<view v-for="(item, index) in orderList" :key="index"> <view v-for="(item, index) in orderList" :key="index">
<OrderCell <OrderCell
:orderData="item" :orderData="item"
...@@ -134,7 +134,7 @@ export default { ...@@ -134,7 +134,7 @@ export default {
title: 'Hello', title: 'Hello',
loaded: false, loaded: false,
loadedOrder: false, loadedOrder: false,
needSettled: true, needSettled: false,
count: 0, // 推荐订单数量 count: 0, // 推荐订单数量
messageList: [], messageList: [],
currentLoadStatus: 'loading', currentLoadStatus: 'loading',
......
...@@ -113,27 +113,6 @@ ...@@ -113,27 +113,6 @@
icon: 'liulanjilu.png', icon: 'liulanjilu.png',
imageStyle: 'width:34rpx;height:32rpx' imageStyle: 'width:34rpx;height:32rpx'
}, },
// {
// pathName: 'deposit/index',
// title: '配件押金',
// value: '',
// icon: 'yajin.png',
// imageStyle: 'width:32rpx;height:32rpx'
// },
// {
// pathName: 'contract/index',
// title: '我的合同',
// value: '',
// icon: 'hetong.png',
// imageStyle: 'width:34rpx;height:32rpx'
// },
// {
// pathName: 'cert/index',
// title: '我的证件',
// value: '',
// icon: 'zhengjian.png',
// imageStyle: 'width:36rpx;height:28rpx'
// }
], ],
[ [
{ {
...@@ -143,13 +122,6 @@ ...@@ -143,13 +122,6 @@
icon: 'wddizhi.png', icon: 'wddizhi.png',
imageStyle: 'width:32rpx;height:32rpx' imageStyle: 'width:32rpx;height:32rpx'
}, },
// {
// pathName: 'warehouse',
// title: '我的仓库',
// value: '',
// icon: 'cangku.png',
// imageStyle: 'width:36rpx;height:32rpx'
// },
{ {
pathName: 'customer/index', pathName: 'customer/index',
title: '联系客服', title: '联系客服',
......
...@@ -187,7 +187,7 @@ export default { ...@@ -187,7 +187,7 @@ export default {
}, },
needSort() { needSort() {
// 待预约, 待签到,待完工需要排序 // 待预约, 待签到,待完工需要排序
return this.current + this.current[this.curNow] < 3 return this.curNow + this.current[this.curNow] < 3
}, },
pageSizes() { pageSizes() {
// 待预约, 待签到,待完工,因为需要排序,所以暂时去掉分页,一次要完所有 // 待预约, 待签到,待完工,因为需要排序,所以暂时去掉分页,一次要完所有
...@@ -251,6 +251,9 @@ export default { ...@@ -251,6 +251,9 @@ export default {
['todayContactCount', 'todayFinishCount', 'todayExceptionCount'], ['todayContactCount', 'todayFinishCount', 'todayExceptionCount'],
] ]
}, },
isFinish() {
return this.orderType == 'finish'
},
noMore() { noMore() {
return ( return (
this.orderList[this.curNow][this.current[this.curNow]].length == 0 && this.orderList[this.curNow][this.current[this.curNow]].length == 0 &&
...@@ -336,6 +339,7 @@ export default { ...@@ -336,6 +339,7 @@ export default {
) )
// 更新tab数字 // 更新tab数字
if ( if (
!this.isFinish &&
self.list[this.curNow][self.types[this.curNow][res.data.type]] self.list[this.curNow][self.types[this.curNow][res.data.type]]
) { ) {
self.list[this.curNow][ self.list[this.curNow][
...@@ -346,7 +350,7 @@ export default { ...@@ -346,7 +350,7 @@ export default {
if (this.needSort) { if (this.needSort) {
self.orderList[this.curNow][this.current[this.curNow]].sort( self.orderList[this.curNow][this.current[this.curNow]].sort(
(x, y) => { (x, y) => {
return x.currentOverTime <= y.currentOverTime ? 1 : -1 return x.currentOverTime < y.currentOverTime ? 1 : -1
} }
) )
} }
...@@ -499,6 +503,7 @@ export default { ...@@ -499,6 +503,7 @@ export default {
align-items: center; align-items: center;
justify-content: center; justify-content: center;
top: 50%; top: 50%;
left: 0;
position: fixed; position: fixed;
} }
} }
......
...@@ -104,7 +104,7 @@ export default { ...@@ -104,7 +104,7 @@ export default {
showCountTime, showCountTime,
}) })
}, },
handleClickButton(item, type, showCountTime) { handleClickButton(item, type, showCountTime, auditResults) {
uni.navigateTo({ uni.navigateTo({
url: url:
'pages/order/complete?orderId=' + 'pages/order/complete?orderId=' +
...@@ -124,7 +124,9 @@ export default { ...@@ -124,7 +124,9 @@ export default {
'&brandId=' + '&brandId=' +
item.lianbaoBrandId + item.lianbaoBrandId +
'&auditResults=' + '&auditResults=' +
(item.auditResults ? Object.keys(item.auditResults).join() : ''), (auditResults ? auditResults.join() : '') +
'&orderNumber=' +
item.orderNumber,
}) })
}, },
}, },
......
...@@ -41,9 +41,13 @@ ...@@ -41,9 +41,13 @@
@click="handleClick(index)" @click="handleClick(index)"
hover-class="u-hover-class" hover-class="u-hover-class"
> >
<view :class="['count-view', { active: item.type == 'finish' }]">{{ <view
info[item.key] || 0 :class="[
}}</view> 'count-view',
{ active: currentClicks[current][item.type] },
]"
>{{ info[item.key] || 0 }}</view
>
<view>{{ item.label }}</view> <view>{{ item.label }}</view>
</view> </view>
</view> </view>
...@@ -61,7 +65,7 @@ export default { ...@@ -61,7 +65,7 @@ export default {
info: {}, info: {},
offset: [0, 0], offset: [0, 0],
current: 0, current: 0,
currentTime: 'today', currentClicks: [],
} }
}, },
computed: { computed: {
...@@ -87,10 +91,12 @@ export default { ...@@ -87,10 +91,12 @@ export default {
var timestamp = date.getTime() var timestamp = date.getTime()
var today = this.$u.timeFormat(timestamp, 'yyyy-mm-dd') var today = this.$u.timeFormat(timestamp, 'yyyy-mm-dd')
var yesterday = this.$u.timeFormat(date.setDate(date.getDate() - 1)) var yesterday = this.$u.timeFormat(date.setDate(date.getDate() - 1))
date = new Date()
var weekDays = [6, 0, 1, 2, 3, 4, 5] var weekDays = [6, 0, 1, 2, 3, 4, 5]
var week = this.$u.timeFormat( var week = this.$u.timeFormat(
date.setDate(date.getDate() - weekDays[date.getDay()]) date.setDate(date.getDate() - weekDays[date.getDay()])
) )
date = new Date()
var month = this.$u.timeFormat(date.setDate(1)) var month = this.$u.timeFormat(date.setDate(1))
return [ return [
{ start: today, end: today }, { start: today, end: today },
...@@ -102,8 +108,14 @@ export default { ...@@ -102,8 +108,14 @@ export default {
currentParam() { currentParam() {
return this.params[this.current] return this.params[this.current]
}, },
clicks() {
return { take: false, checkin: false, finish: false }
},
}, },
onLoad() { onLoad() {
this.currentClicks = this.clicks
},
onShow() {
this.getOrderCount() this.getOrderCount()
}, },
methods: { methods: {
...@@ -125,6 +137,14 @@ export default { ...@@ -125,6 +137,14 @@ export default {
}, },
handleClick(index) { handleClick(index) {
var item = this.detailLabels[index] var item = this.detailLabels[index]
this.currentClicks = [
{ ...this.clicks },
{ ...this.clicks },
{ ...this.clicks },
{ ...this.clicks },
]
this.currentClicks[this.current][item.type] = true
if (this.info[item.key] > 0) { if (this.info[item.key] > 0) {
this.$u.route({ this.$u.route({
url: 'pages/mine/order/list', url: 'pages/mine/order/list',
......
...@@ -10,19 +10,12 @@ ...@@ -10,19 +10,12 @@
></u-navbar> ></u-navbar>
<view class="content-view"> <view class="content-view">
<scroll-view <scroll-view
scroll-y
@scrolltolower="reachBottom" @scrolltolower="reachBottom"
scroll-anchoring scroll-anchoring
refresher-enabled="true"
:refresher-triggered="triggered"
:refresher-threshold="100"
:scroll-top="scrollTop"
refresher-background="#F4F5F7"
@refresherrefresh="onRefresh"
@refresherrestore="onRestore"
enable-back-to-top enable-back-to-top
refresher-background="#F4F5F7"
> >
<view class="loading-view" v-if="!loaded && !_freshing"> <view class="loading-view" v-if="!loaded">
<u-loading mode="flower"></u-loading> <u-loading mode="flower"></u-loading>
</view> </view>
<NoOrder <NoOrder
...@@ -70,8 +63,6 @@ export default { ...@@ -70,8 +63,6 @@ export default {
loadStatus: 'loading', loadStatus: 'loading',
dataValue: [], dataValue: [],
loaded: false, loaded: false,
triggered: true,
_freshing: false,
title: '', title: '',
orderType: '', orderType: '',
timeParam: {}, timeParam: {},
...@@ -87,10 +78,19 @@ export default { ...@@ -87,10 +78,19 @@ export default {
noOrderCustomStyle() { noOrderCustomStyle() {
return 'margin-top: 100rpx;background-color: #F4F5F7' return 'margin-top: 100rpx;background-color: #F4F5F7'
}, },
sortType() {
return {
take: 'acceptOrderDateTime',
checkin: 'checkInDateTime',
finish: 'orderFinishDatetime',
}
},
currentSorTtype() {
return this.sortType[this.orderType]
},
}, },
onLoad(e) { onLoad(e) {
getApp().trackPage('订单首页') getApp().trackPage('订单首页')
this._freshing = false
if (e && e.title) { if (e && e.title) {
this.title = decodeURIComponent(e.title) this.title = decodeURIComponent(e.title)
} }
...@@ -123,39 +123,35 @@ export default { ...@@ -123,39 +123,35 @@ export default {
type: this.orderType, type: this.orderType,
...this.timeParam, ...this.timeParam,
} }
var self = this this.$u.api.manageOrderList(param).then((res) => {
self.$u.api.manageOrderList(param).then((res) => {
if (res.code == 200) { if (res.code == 200) {
if (self.pageNumber == 1) { if (this.pageNumber == 1) {
self.orderList = [] this.orderList = []
} }
if (res.data.list) { if (res.data.list) {
self.orderList.push(...res.data.list) this.orderList.push(...res.data.list)
self.orderList.sort((x, y) => { this.orderList.sort((x, y) => {
return x.currentOverTime <= y.currentOverTime ? 1 : -1 return (x[this.currentSorTtype] || 0) <
(y[this.currentSorTtype] || 0)
? 1
: -1
}) })
self.loadStatus = this.loadStatus =
res.data.total > self.orderList.length && res.data.total > this.orderList.length &&
res.data.list.length == self.pageSize res.data.list.length == this.pageSize
? 'loadmore' ? 'loadmore'
: 'nomore' : 'nomore'
} }
} else { } else {
console.log(res.message, '获取订单数量失败!') console.log(res.message, '获取订单数量失败!')
} }
self.$nextTick(() => {
if (self._freshing) {
self.triggered = false
self._freshing = false
}
})
this.loaded = true this.loaded = true
}) })
}, },
handleClickCellButton(item, type) { handleClickCellButton(item, type, showCountTime, auditResults) {
// 去完工 // 去完工
uni.navigateTo({ uni.navigateTo({
url: url:
...@@ -176,7 +172,9 @@ export default { ...@@ -176,7 +172,9 @@ export default {
'&brandId=' + '&brandId=' +
item.lianbaoBrandId + item.lianbaoBrandId +
'&auditResults=' + '&auditResults=' +
(item.auditResults ? Object.keys(item.auditResults).join() : ''), (auditResults ? auditResults.join() : '') +
'&orderNumber=' +
item.orderNumber,
}) })
}, },
handleClick(item, type, showCountTime) { handleClick(item, type, showCountTime) {
...@@ -193,14 +191,6 @@ export default { ...@@ -193,14 +191,6 @@ export default {
showCountTime, showCountTime,
}) })
}, },
onRefresh() {
if (this._freshing) return
this._freshing = true
this.reloadOrderList()
},
onRestore() {
this.triggered = 'restore' // 需要重置
},
reloadOrderList() { reloadOrderList() {
this.pageNumber = 0 this.pageNumber = 0
this.loadStatus = 'loading' this.loadStatus = 'loading'
...@@ -228,6 +218,7 @@ export default { ...@@ -228,6 +218,7 @@ export default {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
left: 0;
margin-top: 300rpx; margin-top: 300rpx;
position: absolute; position: absolute;
} }
......
...@@ -596,6 +596,22 @@ export default { ...@@ -596,6 +596,22 @@ export default {
this.form.paymentMethodsType && this.form.paymentMethodsType != '03' this.form.paymentMethodsType && this.form.paymentMethodsType != '03'
) )
}, },
// 从订单管理和浏览记录进来,不跳转到订单列表,而是后退到订单管理和浏览记录
completeBack() {
let pages = getCurrentPages()
var i = 0
for (var item of pages) {
if (
['/pages/mine/history/index', '/pages/mine/order/index'].indexOf(
item.$page?.fullPath.split('?')[0]
) != -1
) {
return pages.length - i - 1
}
i++
}
return 0
},
}, },
methods: { methods: {
getCompleteData() { getCompleteData() {
...@@ -866,10 +882,17 @@ export default { ...@@ -866,10 +882,17 @@ export default {
async appointment() { async appointment() {
const save = await this.nextStepSaveData() const save = await this.nextStepSaveData()
if (save) { if (save) {
if (this.completeBack) {
// 从订单管理和浏览记录进来
uni.navigateBack({
delta: this.completeBack,
})
} else {
uni.reLaunch({ uni.reLaunch({
url: '/pages/index/order?type=waitAppointment', url: '/pages/index/order?type=waitAppointment',
}) })
} }
}
}, },
// 下一步动作 // 下一步动作
async nextAction() { async nextAction() {
...@@ -1002,9 +1025,16 @@ export default { ...@@ -1002,9 +1025,16 @@ export default {
title: '提交成功', title: '提交成功',
type: 'success', type: 'success',
callback: () => { callback: () => {
if (this.completeBack) {
// 从订单管理和浏览记录进来
uni.navigateBack({
delta: this.completeBack,
})
} else {
uni.reLaunch({ uni.reLaunch({
url: '/pages/index/order?type=audit', url: '/pages/index/order?type=audit',
}) })
}
}, },
}) })
} else { } else {
...@@ -1023,9 +1053,16 @@ export default { ...@@ -1023,9 +1053,16 @@ export default {
title: '提交成功', title: '提交成功',
type: 'success', type: 'success',
callback: () => { callback: () => {
if (this.completeBack) {
// 从订单管理和浏览记录进来
uni.navigateBack({
delta: this.completeBack,
})
} else {
uni.reLaunch({ uni.reLaunch({
url: '/pages/index/order?type=audit', url: '/pages/index/order?type=audit',
}) })
}
}, },
}) })
} else { } else {
......
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