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