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

工单列表+详情(接单)

parent eb807255
......@@ -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);
/**
* 工单列表接口
* 工单列表接口 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){
/**
* 师傅签到接口
*/
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 = {
......@@ -35,7 +54,11 @@ let orderApiFun = function(vm){
listOrder,
workerCalendar,
workerAppointment,
maintainWorkerCheckin
maintainWorkerCheckin,
orderDetail,
listOrderRecord,
orderAccept,
orderGan
}
return orderApi
}
......
This diff is collapsed.
......@@ -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>
</view>
<view class="right-btn" @click="viewOderItem">
<view class="right-btn" @click="viewOderItem(index)">
<text>去预约</text>
</view>
</view>
......@@ -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>
</view>
<view class="right-btn">
<view class="right-btn" @click="viewOderItem(index)">
<text>去签到</text>
</view>
</view>
......@@ -121,7 +121,7 @@
</scroll-view>
</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>
<view class="centre">
......@@ -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>
</view>
<view class="right-btn" @click="viewOderItem">
<view class="right-btn" @click="viewOderItem(index)">
<text>去完工</text>
</view>
</view>
......@@ -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>
</view>
<view class="right-btn" @click="viewOderItem">
<view class="right-btn" @click="viewOderItem(index)">
<text>审核中</text>
</view>
</view>
......@@ -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>
</view>
<view class="right-btn" @click="viewOderItem">
<view class="right-btn" @click="viewOderItem(index)">
<text>去处理</text>
</view>
</view>
......@@ -288,7 +288,7 @@
<view >
<u-icon name="map" size="32"></u-icon>
<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>
......@@ -546,27 +546,19 @@ export default {
console.log("getOrderList",res.data)
if (res.data) {
self.orderList = res.data.list;
//测试使用
self.orderList.forEach((item,index)=>{
if(index === 1){
item.currentOverTime -= 10
}
})
// //测试使用
// self.orderList.forEach((item,index)=>{
// if(index === 1){
// item.currentOverTime -= 10
// }
// })
self.total =res.data.total;
}
} else {
console.log(res.message, "获取订单数量失败!");
}
});
// 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() {
......@@ -612,7 +604,6 @@ export default {
},
// tab栏切换
change(index) {
console.log("============",index)
this.swiperCurrent = index;
this.getOrderList(index);
},
......@@ -623,11 +614,11 @@ export default {
this.$refs.tabs.setFinishCurrent(current);
this.swiperCurrent = current;
this.current = current;
},viewOderItem() { // 跳转工单详情页面
let that = this;
let params ='' //`id=${e.id}&courseId=${e.courseId}&status=${e.status}`
},viewOderItem(index) { // 跳转工单详情页面
let order = this.orderList[index]
console.log("order",order)
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