Commit 8e60a5f6 authored by Facius's avatar Facius

Merge branch 'dev-1.4.6' into test

parents a523f235 6723ed0a
......@@ -18,6 +18,10 @@ let orderApiFun = function(vm){
* 订单管理工单数量查询接口
*/
let manageOrderCount = async (params = {}) => await vm.$u.get(prefix + vm.vuex_token + '/wokerOrder/countOrderByTimeRange', params);
/**
* 根据订单id数组获取订单列表
*/
let listOrderByIds = async (string) => await vm.$u.get('/wxh-worker-rest/rest/order/revision/listOrderByIds' + string);
/**
* 工单列表接口
*/
......@@ -214,6 +218,7 @@ let orderApiFun = function(vm){
listByRecommendOrder,
listOrderCount,
manageOrderCount,
listOrderByIds,
listOrder,
manageOrderList,
workerCalendar,
......
......@@ -476,12 +476,12 @@ export default {
storeOparation() {
// 更新最近5条查看记录
if (!this.isSimple) {
var array = (this.vuex_last_five_orders || []).filter((item) => {
var array = (this.vuex_last_five_orders || []).filter((id) => {
// 如果记录中有该工单,删除
return item && item.orderId != this.orderData.orderId
return id != this.orderData.orderId
})
array.unshift(this.orderData)
array.unshift(this.orderData.orderId)
this.$u.vuex('vuex_last_five_orders', array.slice(0, 5))
}
},
......
......@@ -27,7 +27,10 @@
<view class="head-message">最近查看或操作过的5条订单</view>
</view>
</view>
<view class="content-view">
<view class="loading-view" v-if="!loaded">
<u-loading mode="flower"></u-loading>
</view>
<view class="content-view" v-else>
<view v-for="item in orderList" :key="item.orderId">
<OrderCell
:orderData="item"
......@@ -67,6 +70,7 @@ export default {
data() {
return {
loaded: false,
orderList: [],
}
},
computed: {
......@@ -74,10 +78,10 @@ export default {
return this.noneHistory ? '浏览记录' : ' '
},
noneHistory() {
return this.orderList.length <= 0
return this.orderList.length <= 0 && this.loaded
},
orderList() {
return this.vuex_last_five_orders.filter((item) => item) || []
idList() {
return this.vuex_last_five_orders.filter((id) => id) || []
},
chakanjiluImage() {
return process.uniEnv.qn_base_url + 'chakanjilu-y.png'
......@@ -88,8 +92,23 @@ export default {
},
onLoad() {
getApp().trackPage('浏览记录')
this.listOrderByIds()
},
methods: {
listOrderByIds() {
this.$u.api
.listOrderByIds(
this.$u.queryParams({ ids: this.idList }, true, 'repeat')
)
.then((res) => {
this.loaded = true
if (res.code == 200) {
this.orderList = res.data
} else {
console.log(res.message, '获取订单详情失败!')
}
})
},
handleClickCell(item, type, showCountTime) {
// type:类型,showCountTime:是否显示倒计时。详情页面情况太多,提前传值可以避免页面晃动
//type类型
......@@ -160,8 +179,15 @@ export default {
}
}
}
.none-view {
margin-top: 160rpx;
.loading-view {
width: 100%;
background-color: transparent;
display: flex;
align-items: center;
justify-content: center;
top: 50%;
left: 0;
position: fixed;
}
.content-view {
height: 100%;
......
......@@ -27,7 +27,6 @@
<view v-for="item in orderList" :key="item.orderId">
<OrderCell
:orderData="item"
:type="cellType"
:location="dataValue"
@click="handleClick"
@action="handleClickCellButton"
......@@ -69,9 +68,6 @@ export default {
}
},
computed: {
cellType() {
return this.orderType == 'finish' ? 'finish' : ''
},
noMore() {
return this.orderList.length == 0 && this.loaded
},
......
......@@ -548,11 +548,7 @@ export default {
loadOrderDetail() {
// 获取工单详情
let self = this
let timestamp = new Date().getTime()
var data = {
orderId: self.orderId,
}
self.$u.api.orderDetail(data, self.orderId).then((res) => {
self.$u.api.orderDetail({}, self.orderId).then((res) => {
if (res.code == 200) {
self.order = res.data
this.setOrderType()
......
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