Commit fc74282d authored by 郭晓清's avatar 郭晓清

工单列表+详情(接单)

parent eb807255
...@@ -7,9 +7,9 @@ let orderApiFun = function(vm){ ...@@ -7,9 +7,9 @@ let orderApiFun = function(vm){
let listOrderCount = async (params = {}) => await vm.$u.get('http://apidoc.banshouhui.com:3000/mock/31/wxh-worker-rest/rest/'+ vm.vuex_token+'/order/queryOrdersCount/V2', params); let listOrderCount = async (params = {}) => await vm.$u.get('http://apidoc.banshouhui.com:3000/mock/31/wxh-worker-rest/rest/'+ vm.vuex_token+'/order/queryOrdersCount/V2', params);
/** /**
* 工单列表接口 * 工单列表接口 http://apidoc.banshouhui.com:3000/mock/31/wxh-worker-rest/rest/order/revision/{token}/list
*/ */
let listOrder = async (params = {}) => await vm.$u.get('http://apidoc.banshouhui.com:3000/mock/31/wxh-worker-rest/rest/'+ vm.vuex_token+'/order/revision/list', params); let listOrder = async (params = {}) => await vm.$u.get('http://apidoc.banshouhui.com:3000/mock/31/wxh-worker-rest/rest/order/revision/'+ vm.vuex_token+'/list', params);
/** /**
* 获取师傅的预约日历 * 获取师傅的预约日历
...@@ -26,7 +26,26 @@ let orderApiFun = function(vm){ ...@@ -26,7 +26,26 @@ let orderApiFun = function(vm){
/** /**
* 师傅签到接口 * 师傅签到接口
*/ */
let maintainWorkerCheckin = async (params = {}) => await vm.$u.post('http://apidoc.banshouhui.com:3000/mock/31/wxh-worker-rest/rest/'+ vm.vuex_token+'/order/{orderId}/maintainWorkerCheckin', params,{'content-type': 'application/x-www-form-urlencoded'}); let maintainWorkerCheckin = async (params = {},orderId) => await vm.$u.post('http://apidoc.banshouhui.com:3000/mock/31/wxh-worker-rest/rest/'+ vm.vuex_token+'/order/'+orderId+'/maintainWorkerCheckin', params,{'content-type': 'application/x-www-form-urlencoded'});
/**
* 订单详情查询
*/
let orderDetail = async (params = {}) => await vm.$u.get('http://apidoc.banshouhui.com:3000/mock/31/wxh-worker-rest/rest/order/revision/'+ vm.vuex_token+'/'+params.orderId, params);
/**
* 查询工单操作记录列表接口
*/
let listOrderRecord = async (params = {}) => await vm.$u.get('http://apidoc.banshouhui.com:3000/mock/31/wxh-worker-rest/rest/order/record/'+ vm.vuex_token+'/listOrderRecord/'+params.orderId, params);
/**
* 接单
*/
let orderAccept= async (params = {},orderId) => await vm.$u.get('http://apidoc.banshouhui.com:3000/mock/31/wxh-worker-rest/rest/'+ vm.vuex_token+'/order/'+orderId+'/accept', params);
/**
* 抢单
*/
let orderGan = async (params = {},orderId) => await vm.$u.post('http://apidoc.banshouhui.com:3000/mock/31/wxh-worker-rest/rest/order/revision/applets/'+ vm.vuex_token+'/order/acceptAppletsOrder', params,{'content-type': 'application/x-www-form-urlencoded'});
const orderApi = { const orderApi = {
...@@ -35,7 +54,11 @@ let orderApiFun = function(vm){ ...@@ -35,7 +54,11 @@ let orderApiFun = function(vm){
listOrder, listOrder,
workerCalendar, workerCalendar,
workerAppointment, workerAppointment,
maintainWorkerCheckin maintainWorkerCheckin,
orderDetail,
listOrderRecord,
orderAccept,
orderGan
} }
return orderApi return orderApi
} }
......
This diff is collapsed.
...@@ -67,7 +67,7 @@ ...@@ -67,7 +67,7 @@
<u-count-down :timestamp="timestampDiff(res.currentOverTime)" font-size="44" color="#FF930D" :ref="'uCountDown' + index" @change="timeChange(res.currentOverTime,index)" > <u-count-down :timestamp="timestampDiff(res.currentOverTime)" font-size="44" color="#FF930D" :ref="'uCountDown' + index" @change="timeChange(res.currentOverTime,index)" >
</u-count-down> </u-count-down>
</view> </view>
<view class="right-btn" @click="viewOderItem"> <view class="right-btn" @click="viewOderItem(index)">
<text>去预约</text> <text>去预约</text>
</view> </view>
</view> </view>
...@@ -111,7 +111,7 @@ ...@@ -111,7 +111,7 @@
<u-count-down :timestamp="timestampDiff(res.currentOverTime)" font-size="44" color="#FF930D" :ref="'uCountDown' + index" @change="timeChange(res.currentOverTime,index)" > <u-count-down :timestamp="timestampDiff(res.currentOverTime)" font-size="44" color="#FF930D" :ref="'uCountDown' + index" @change="timeChange(res.currentOverTime,index)" >
</u-count-down> </u-count-down>
</view> </view>
<view class="right-btn"> <view class="right-btn" @click="viewOderItem(index)">
<text>去签到</text> <text>去签到</text>
</view> </view>
</view> </view>
...@@ -121,7 +121,7 @@ ...@@ -121,7 +121,7 @@
</scroll-view> </scroll-view>
</swiper-item> </swiper-item>
<swiper-item class="swiper-item"> <swiper-item class="swiper-item">
<scroll-view scroll-y style="height: 100%;width: 100%;" v-if="orderList.length<2"> <scroll-view scroll-y style="height: 100%;width: 100%;" v-if="orderList.length === 0">
<view class="page-box"> <view class="page-box">
<view> <view>
<view class="centre"> <view class="centre">
...@@ -168,7 +168,7 @@ ...@@ -168,7 +168,7 @@
<u-count-down :timestamp="timestampDiff(res.currentOverTime)" font-size="44" color="#FF930D" :ref="'uCountDown' + index" @change="timeChange(res.currentOverTime,index)" > <u-count-down :timestamp="timestampDiff(res.currentOverTime)" font-size="44" color="#FF930D" :ref="'uCountDown' + index" @change="timeChange(res.currentOverTime,index)" >
</u-count-down> </u-count-down>
</view> </view>
<view class="right-btn" @click="viewOderItem"> <view class="right-btn" @click="viewOderItem(index)">
<text>去完工</text> <text>去完工</text>
</view> </view>
</view> </view>
...@@ -211,7 +211,7 @@ ...@@ -211,7 +211,7 @@
<u-count-down :timestamp="timestampDiff(res.currentOverTime)" font-size="44" color="#FF930D" :ref="'uCountDown' + index" @change="timeChange(res.currentOverTime,index)" > <u-count-down :timestamp="timestampDiff(res.currentOverTime)" font-size="44" color="#FF930D" :ref="'uCountDown' + index" @change="timeChange(res.currentOverTime,index)" >
</u-count-down> </u-count-down>
</view> </view>
<view class="right-btn" @click="viewOderItem"> <view class="right-btn" @click="viewOderItem(index)">
<text>审核中</text> <text>审核中</text>
</view> </view>
</view> </view>
...@@ -254,7 +254,7 @@ ...@@ -254,7 +254,7 @@
<u-count-down :timestamp="timestampDiff(res.currentOverTime)" font-size="44" color="#FF930D" :ref="'uCountDown' + index" @change="timeChange(res.currentOverTime,index)" > <u-count-down :timestamp="timestampDiff(res.currentOverTime)" font-size="44" color="#FF930D" :ref="'uCountDown' + index" @change="timeChange(res.currentOverTime,index)" >
</u-count-down> </u-count-down>
</view> </view>
<view class="right-btn" @click="viewOderItem"> <view class="right-btn" @click="viewOderItem(index)">
<text>去处理</text> <text>去处理</text>
</view> </view>
</view> </view>
...@@ -288,7 +288,7 @@ ...@@ -288,7 +288,7 @@
<view > <view >
<u-icon name="map" size="32"></u-icon> <u-icon name="map" size="32"></u-icon>
<text style="margin-left: 8rpx;">{{res.contactAddress }}</text> <text style="margin-left: 8rpx;">{{res.contactAddress }}</text>
<text style="margin-left: 200rpx; font-size:large;" @click="viewOderItem" > > </text> <text style="margin-left: 200rpx; font-size:large;" @click="viewOderItem(index)" > > </text>
</view> </view>
</view> </view>
</view> </view>
...@@ -546,13 +546,12 @@ export default { ...@@ -546,13 +546,12 @@ export default {
console.log("getOrderList",res.data) console.log("getOrderList",res.data)
if (res.data) { if (res.data) {
self.orderList = res.data.list; self.orderList = res.data.list;
// //测试使用
//测试使用 // self.orderList.forEach((item,index)=>{
self.orderList.forEach((item,index)=>{ // if(index === 1){
if(index === 1){ // item.currentOverTime -= 10
item.currentOverTime -= 10 // }
} // })
})
self.total =res.data.total; self.total =res.data.total;
} }
} else { } else {
...@@ -560,13 +559,6 @@ export default { ...@@ -560,13 +559,6 @@ export default {
} }
}); });
// for (let i = 0; i < indexStatus.size; i++) {
// let index = this.$u.random(0, this.dataList.length - 1);
// let data = JSON.parse(JSON.stringify(this.dataList[index]));
// data.id = this.$u.guid();
// this.orderList[idx].push(data);
// }
// this.loadStatus.splice(this.current, 1, 'loadmore');
}, },
// 获取订单数量 // 获取订单数量
getOrderCount() { getOrderCount() {
...@@ -612,7 +604,6 @@ export default { ...@@ -612,7 +604,6 @@ export default {
}, },
// tab栏切换 // tab栏切换
change(index) { change(index) {
console.log("============",index)
this.swiperCurrent = index; this.swiperCurrent = index;
this.getOrderList(index); this.getOrderList(index);
}, },
...@@ -623,11 +614,11 @@ export default { ...@@ -623,11 +614,11 @@ export default {
this.$refs.tabs.setFinishCurrent(current); this.$refs.tabs.setFinishCurrent(current);
this.swiperCurrent = current; this.swiperCurrent = current;
this.current = current; this.current = current;
},viewOderItem() { // 跳转工单详情页面 },viewOderItem(index) { // 跳转工单详情页面
let that = this; let order = this.orderList[index]
let params ='' //`id=${e.id}&courseId=${e.courseId}&status=${e.status}` console.log("order",order)
uni.navigateTo({ uni.navigateTo({
url: `/pages/order/orderItem?${params}` url: 'pages/order/detail?id='+order.orderId
}) })
} }
} }
......
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