Commit c143e1f4 authored by Facius's avatar Facius

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

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