Commit 5b812f62 authored by Facius's avatar Facius
parents 7ada66f9 eb807255
...@@ -4,18 +4,38 @@ let orderApiFun = function(vm){ ...@@ -4,18 +4,38 @@ let orderApiFun = function(vm){
/** /**
* 工单数量查询接口 * 工单数量查询接口
*/ */
let listOrderCount = async (params = {}) => await vm.$u.get('http://apidoc.banshouhui.com:3000/mock/31/wxh-worker-rest/rest/'+ util.getToken()+'/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);
/** /**
* 工单列表接口 * 工单列表接口
*/ */
let listOrder = async (params = {}) => await vm.$u.get('http://apidoc.banshouhui.com:3000/mock/31/wxh-worker-rest/rest/'+ util.getToken()+'/order/revision/list', params); 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 workerCalendar = async (params = {}) => await vm.$u.get('http://apidoc.banshouhui.com:3000/mock/31/wxh-worker-rest/rest/'+ vm.vuex_token+'/wokerOrder/appointment/calendar', params);
/**
* 师傅预约
*/
let workerAppointment = async (params = {}) => await vm.$u.post('http://apidoc.banshouhui.com:3000/mock/31/wxh-worker-rest/rest/order/traceAndAppointment/traceOrder/'+ vm.vuex_token+'/order/{orderId}', params,{'content-type': 'application/x-www-form-urlencoded'});
// 联系顾客时间更新接口,暂时没有
/**
* 师傅签到接口
*/
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'});
const orderApi = { const orderApi = {
listByRecommendOrder, listByRecommendOrder,
listOrderCount, listOrderCount,
listOrder, listOrder,
workerCalendar,
workerAppointment,
maintainWorkerCheckin
} }
return orderApi return orderApi
} }
......
...@@ -4,13 +4,14 @@ ...@@ -4,13 +4,14 @@
<view class="tools-box"> <view class="tools-box">
<view class="search-sub"> <view class="search-sub">
<u-subsection <u-subsection
:current="0" :current="curNow"
:list="['待受理', '完工']" :list="['待受理', '完工']"
active-color="white" active-color="white"
bg-color="white" bg-color="white"
inactive-color="#666" inactive-color="#666"
button-color="#2272FF" button-color="#2272FF"
border-radius="36" border-radius="36"
@change="sectionChange"
></u-subsection> ></u-subsection>
</view> </view>
<view class="search-btn"> <view class="search-btn">
...@@ -18,7 +19,7 @@ ...@@ -18,7 +19,7 @@
<text class="search-btn-text">搜订单</text> <text class="search-btn-text">搜订单</text>
</view> </view>
</view> </view>
<view class="u-tabs-box"> <view class="u-tabs-box" v-show="showSview">
<u-tabs-swiper <u-tabs-swiper
activeColor="#2272FF" activeColor="#2272FF"
bg-color="none" bg-color="none"
...@@ -33,7 +34,7 @@ ...@@ -33,7 +34,7 @@
swiperWidth="750" swiperWidth="750"
></u-tabs-swiper> ></u-tabs-swiper>
</view> </view>
<swiper class="swiper-box" :current="swiperCurrent" @transition="transition" @animationfinish="animationfinish"> <swiper v-show="showSview" class="swiper-box" :current="swiperCurrent" @transition="transition" @animationfinish="animationfinish">
<swiper-item class="swiper-item"> <swiper-item class="swiper-item">
<scroll-view scroll-y style="height: 100%;width: 100%;" @scrolltolower="reachBottom"> <scroll-view scroll-y style="height: 100%;width: 100%;" @scrolltolower="reachBottom">
<view class="page-box"> <view class="page-box">
...@@ -58,14 +59,13 @@ ...@@ -58,14 +59,13 @@
</view> </view>
<view class="right">{{getDistance(res.contactAddressLatitud,res.contactAddressLongitud)}}km</view> <view class="right">{{getDistance(res.contactAddressLatitud,res.contactAddressLongitud)}}km</view>
</view> </view>
<u-divider margin-top="16" half-width="630" border-color="#F4F5F7" :use-slot="false"> <u-divider margin-top="16" half-width="630" border-color="#F4F5F7" :use-slot="false">
</u-divider> </u-divider>
<view class="bottom"> <view class="bottom">
<view class="left"> <view class="left">
<view class="tag"></view> <view class="tag">{{res.currentOverTime * 1000 > new Date().getTime()?'剩':'超'}}</view>
<u-count-down :timestamp="timestamp" font-size="44" color="#FF930D"></u-count-down> <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>
<view class="right-btn" @click="viewOderItem"> <view class="right-btn" @click="viewOderItem">
<text>去预约</text> <text>去预约</text>
...@@ -107,8 +107,9 @@ ...@@ -107,8 +107,9 @@
<view class="bottom"> <view class="bottom">
<view class="left"> <view class="left">
<view class="tag"></view> <view class="tag">{{res.currentOverTime * 1000 > new Date().getTime()?'剩':'超'}}</view>
<u-count-down :timestamp="timestamp" font-size="44" color="#FF930D"></u-count-down> <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>
<view class="right-btn"> <view class="right-btn">
<text>去签到</text> <text>去签到</text>
...@@ -163,8 +164,9 @@ ...@@ -163,8 +164,9 @@
<view class="bottom"> <view class="bottom">
<view class="left"> <view class="left">
<view class="tag"></view> <view class="tag">{{res.currentOverTime * 1000 > new Date().getTime()?'剩':'超'}}</view>
<u-count-down :timestamp="timestamp" font-size="44" color="#FF930D"></u-count-down> <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>
<view class="right-btn" @click="viewOderItem"> <view class="right-btn" @click="viewOderItem">
<text>去完工</text> <text>去完工</text>
...@@ -205,8 +207,9 @@ ...@@ -205,8 +207,9 @@
<view class="bottom"> <view class="bottom">
<view class="left"> <view class="left">
<view class="tag"></view> <view class="tag">{{res.currentOverTime * 1000 > new Date().getTime()?'剩':'超'}}</view>
<u-count-down :timestamp="timestamp" font-size="44" color="#FF930D"></u-count-down> <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>
<view class="right-btn" @click="viewOderItem"> <view class="right-btn" @click="viewOderItem">
<text>审核中</text> <text>审核中</text>
...@@ -247,8 +250,9 @@ ...@@ -247,8 +250,9 @@
<view class="bottom"> <view class="bottom">
<view class="left"> <view class="left">
<view class="tag"></view> <view class="tag">{{res.currentOverTime * 1000 > new Date().getTime()?'剩':'超'}}</view>
<u-count-down :timestamp="timestamp" font-size="44" color="#FF930D"></u-count-down> <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>
<view class="right-btn" @click="viewOderItem"> <view class="right-btn" @click="viewOderItem">
<text>去处理</text> <text>去处理</text>
...@@ -260,6 +264,52 @@ ...@@ -260,6 +264,52 @@
</scroll-view> </scroll-view>
</swiper-item> </swiper-item>
</swiper> </swiper>
<swiper v-show="!showSview" class="swiper-box" :current="swiperCurrent" @transition="transition" @animationfinish="animationfinish">
<swiper-item class="swiper-item">
<scroll-view scroll-y style="height: 100%;width: 100%;" @scrolltolower="reachBottom">
<view class="page-box">
<view class="order" v-for="(res, index) in orderList" :key="res.id">
<view class="top">
<view class="left">
<view class="tag">{{ res.orderServiceType }}</view>
<view class="store">{{ res.categoryName }}</view>
<view >{{ res.orderNumber }}</view>
</view>
<view class="right">{{ res.orderBusinessTypeText }}</view>
</view>
<view class="content">
<view class="title u-line-2">
<text>{{res.contactName }}</text> <text style="margin-left: 8rpx;">{{ res.contactPhone }}</text>
</view>
</view>
<view class="address u-line-2">
<view class="left">
<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>
</view>
</view>
</view>
<u-divider margin-top="16" half-width="630" border-color="#F4F5F7" :use-slot="false">
</u-divider>
<view class="bottom">
<view class="left">
<text>审核时间 :</text><text>{{res.auditDatetime}}</text>
</view>
<view >
<text>已完工</text>
</view>
</view>
</view>
<!-- <u-loadmore :status="loadStatus[0]" bgColor="#f2f2f2"></u-loadmore> -->
</view>
</scroll-view>
</swiper-item>
</swiper>
</view> </view>
</view> </view>
</template> </template>
...@@ -268,9 +318,11 @@ ...@@ -268,9 +318,11 @@
export default { export default {
data() { data() {
return { return {
timestamp: 1, showSview : true,
curNow : 0,
timestamp:1000,
//waitAccept、waitAppointment、waitCheckIn、waitFinish、exception、finish //waitAccept、waitAppointment、waitCheckIn、waitFinish、exception、finish
indexStatus:{0:'waitAccept',1:'waitAppointment',2:'waitCheckIn',3:'waitFinish',4:'exception',4:'finish'}, indexStatus:{0:'waitAccept',1:'waitAppointment',2:'waitCheckIn',3:'waitFinish',4:'exception',5:'finish'},
orderList: [], orderList: [],
dataList: [ dataList: [
{ {
...@@ -402,6 +454,34 @@ export default { ...@@ -402,6 +454,34 @@ export default {
} }
}, },
methods: { methods: {
sectionChange(index){
if(index === 1){
this.showSview = false
// 加载已完工的数据
this.getOrderList(5)
}else {
this.showSview = true
// 加载已完工的数据
this.getOrderList(0)
}
this.curNow = index;
},
timeChange(currentOverTime,index){
let self = this
var nowTime = new Date(); // 当前时间
if(nowTime.getTime() > currentOverTime*1000){
self.$refs['uCountDown'+index][0].seconds += 2
}
},
timestampDiff(currentOverTime){
var nowTime = new Date(); // 当前时间
if(nowTime.getTime() > currentOverTime*1000){
var diff = nowTime.getTime() - (currentOverTime*1000);
}else{
var diff = (currentOverTime*1000) - nowTime.getTime();
}
return diff;
},
/** /**
* 获取当前位置的经纬度 * 获取当前位置的经纬度
*/ */
...@@ -466,6 +546,13 @@ export default { ...@@ -466,6 +546,13 @@ 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)=>{
if(index === 1){
item.currentOverTime -= 10
}
})
self.total =res.data.total; self.total =res.data.total;
} }
} else { } else {
...@@ -507,18 +594,6 @@ export default { ...@@ -507,18 +594,6 @@ export default {
} }
}); });
}, },
getOrderList1() {// 加载工单列表
var self = this;
self.$u.api.listOrder().then((res) => {
if (res.code == 200) {
console.log("===",res.data)
if (res.data) {
}
} else {
console.log(res.message, "获取订单数量失败!");
}
});
},
// 总价 // 总价
totalPrice(item) { totalPrice(item) {
let price = 0; let price = 0;
......
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