You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 lines
12 KiB
1 lines
12 KiB
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["technician-pages-order-list"],{3036:function(t,e,a){"use strict";a.r(e);var i=a("ef1d"),n=a("ca1e");for(var r in n)["default"].indexOf(r)<0&&function(t){a.d(e,t,(function(){return n[t]}))}(r);var s=a("828b"),o=Object(s["a"])(n["default"],i["b"],i["c"],!1,null,"5428f5e4",null,!1,i["a"],void 0);e["default"]=o.exports},"8bf8":function(t,e,a){"use strict";a("6a54");var i=a("f5bd").default;Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,a("c223"),a("5c47"),a("a1c1"),a("dd2b"),a("aa9c");var n=i(a("5de6")),r=i(a("2634")),s=i(a("2fdc")),o=i(a("9b1b")),c=a("8f59"),l={components:{},data:function(){return{options:{},activeIndex:0,tabList:[{title:"待接单",id:2,number:0},{title:"待服务",id:5},{title:"服务中",id:6},{title:"已完成",id:7}],statusType:{2:"待接单",3:"已接单",4:"已出发",5:"已到达",6:"服务中",7:"已完成"},param:{page:1,pay_type:0},list:{data:[]},loading:!0,index:-1,coach_refund_text:"",lockTap:!1,unix_list:[]}},computed:(0,c.mapState)({primaryColor:function(t){return t.config.configInfo.primaryColor},subColor:function(t){return t.config.configInfo.subColor},configInfo:function(t){return t.config.configInfo},userInfo:function(t){return t.user.userInfo}}),onLoad:function(t){this.options=t;var e=t.tab,a=void 0===e?0:e;this.activeIndex=a,this.initIndex(),this.getMineInfo(2)},onPullDownRefresh:function(){uni.showNavigationBarLoading(),this.initRefresh(),uni.stopPullDownRefresh()},onReachBottom:function(){this.list.current_page>=this.list.last_page||this.loading||(this.param.page=this.param.page+1,this.loading=!0,this.getList())},methods:(0,o.default)((0,o.default)((0,o.default)({},(0,c.mapActions)(["getConfigInfo","getMineInfo"])),(0,c.mapMutations)([""])),{},{initIndex:function(){var t=arguments,e=this;return(0,s.default)((0,r.default)().mark((function a(){var i;return(0,r.default)().wrap((function(a){while(1)switch(a.prev=a.next){case 0:if(i=t.length>0&&void 0!==t[0]&&t[0],i||!e.$jweixin.isWechat()){a.next=5;break}return a.next=4,e.$jweixin.initJssdk();case 4:e.$jweixin.wxReady((function(){e.$jweixin.hideOptionMenu()}));case 5:if(e.configInfo.id&&!i){a.next=8;break}return a.next=8,e.getConfigInfo();case 8:return a.next=10,e.getList();case 10:e.$util.setNavigationBarColor({bg:e.primaryColor});case 11:case"end":return a.stop()}}),a)})))()},initRefresh:function(){this.param.page=1,this.initIndex(!0)},getList:function(){var t=this;return(0,s.default)((0,r.default)().mark((function e(){var a,i,n,s,o;return(0,r.default)().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return a=t.list,i=t.param,n=t.tabList,s=t.activeIndex,i.pay_type=n[s].id,e.next=4,t.$api.technician.orderList(i);case 4:o=e.sent,1==t.param.page||(o.data=a.data.concat(o.data)),t.list=o,t.tabList[0].number=o.agent_order_count,t.loading=!1,t.$util.hideAll();case 9:case"end":return e.stop()}}),e)})))()},handerTabChange:function(t){this.activeIndex=t,this.$util.showLoading(),this.param.page=1,this.getList()},toRefuse:function(t){var e=this;return(0,s.default)((0,r.default)().mark((function a(){return(0,r.default)().wrap((function(a){while(1)switch(a.prev=a.next){case 0:e.index=t,e.coach_refund_text="",e.$refs.refuse_item.open();case 3:case"end":return a.stop()}}),a)})))()},confirmRefuse:function(){var t=this;return(0,s.default)((0,r.default)().mark((function e(){var a,i;return(0,r.default)().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(a=t.coach_refund_text,a=a.length>0?a.replace(/(^\s*)|(\s*$)/g,""):"",0!=a.length){e.next=5;break}return t.$util.showToast({title:"请输入拒单原因"}),e.abrupt("return");case 5:t.coach_refund_text=t.coach_refund_text.substring(0,200),i=t.index,t.toConfirm(i,-1);case 8:case"end":return e.stop()}}),e)})))()},toConfirm:function(t,e){var a=this;return(0,s.default)((0,r.default)().mark((function i(){var s,o,c,l,u,d,f,p,v,_,h,g,m,x,b,w,C,y,k,$,I;return(0,r.default)().wrap((function(i){while(1)switch(i.prev=i.next){case 0:if(s=a.list.data[t].id,o={order_id:s,type:e},-1==e&&(o.coach_refund_text=a.coach_refund_text),5!=e&&7!=e){i.next=44;break}return i.next=6,uni.chooseImage({count:1,sourceType:["camera"]});case 6:return c=i.sent,l=(0,n.default)(c,2),l[0],u=l[1],d=u.tempFiles,f=void 0===d?[]:d,p=u.tempFilePath,void 0===p?"":p,i.next=16,a.$api.base.uploadFile({filePath:f[0].path,filetype:"picture"});case 16:if(v=i.sent,_=v.attachment_path,_){i.next=20;break}return i.abrupt("return");case 20:if(!a.$jweixin.isWechat()){i.next=42;break}return a.$util.showLoading(),i.next=24,a.$jweixin.wxReady2();case 24:return i.next=26,a.$jweixin.getWxLocation();case 26:if(h=i.sent,g=h.latitude,m=void 0===g?0:g,x=h.longitude,b=void 0===x?0:x,m){i.next=35;break}return a.$util.hideAll(),a.$util.showToast({title:"请授权定位当前地址"}),i.abrupt("return");case 35:if(!m||!b){i.next=42;break}return w="".concat(m,",").concat(b),i.next=39,a.$api.base.getMapInfo({location:w});case 39:C=i.sent,y=JSON.parse(C),k=y.status,$=y.result,0==k&&(I=$.address,a.toConfirmUpdate(t,e,o,{lat:m,lng:b,address:I,attachment_path:_}));case 42:i.next=45;break;case 44:a.toConfirmUpdate(t,e,o);case 45:case"end":return i.stop()}}),i)})))()},toConfirmUpdate:function(t,e,a){var i=arguments,n=this;return(0,s.default)((0,r.default)().mark((function s(){var o,c,l,u,d,f,p,v,_,h;return(0,r.default)().wrap((function(r){while(1)switch(r.prev=r.next){case 0:if(o=i.length>3&&void 0!==i[3]?i[3]:{},5!=e&&7!=e||(c=o.lat,l=o.lng,u=o.address,d=o.attachment_path,5==e?(a.arrive_img=d,a.arr_lat=c,a.arr_lng=l,a.arr_address=u):(a.end_img=d,a.end_lat=c,a.end_lng=l,a.end_address=u)),f={"-1":"已拒绝接单",3:"接单成功",4:"已成功出发",5:"已成功到达",6:"已开始服务",7:"服务已完成"},!n.lockTap){r.next=5;break}return r.abrupt("return");case 5:return n.lockTap=!0,n.$util.showLoading(),r.prev=7,r.next=10,n.$api.technician.updateOrder(a);case 10:if(-1==e&&n.$refs.refuse_item.close(),n.$util.showToast({title:f[e]}),4==e||5==e?n.list.data[t].pay_type=e:n.list.data.splice(t,1),-1!=e&&3!=e||(n.tabList[0].number=n.tabList[0].number-1),n.lockTap=!1,n.$util.hideAll(),6!=e){r.next=24;break}return r.next=19,n.$api.order.orderInfo({id:a.order_id});case 19:p=r.sent,v=p.time_long,_=p.start_service_time,h=n.$util.DateToUnix(_)+60*v,n.unix_list.push({id:a.order_id,time_long:v,start_service_time:_,start_service_time_unix:h});case 24:r.next=30;break;case 26:return r.prev=26,r.t0=r["catch"](7),setTimeout((function(){n.lockTap=!1,n.$util.hideAll()}),2e3),r.abrupt("return");case 30:case"end":return r.stop()}}),s,null,[[7,26]])})))()},toTel:function(t){var e=this.list.data[t].address_info.mobile;this.$util.goUrl({url:e,openType:"call"})},goDetail:function(t){var e=this.list.data[t].id,a="/technician/pages/order/detail?id=".concat(e);this.$util.goUrl({url:a})}})};e.default=l},ca1e:function(t,e,a){"use strict";a.r(e);var i=a("8bf8"),n=a.n(i);for(var r in i)["default"].indexOf(r)<0&&function(t){a.d(e,t,(function(){return i[t]}))}(r);e["default"]=n.a},ef1d:function(t,e,a){"use strict";a.d(e,"b",(function(){return i})),a.d(e,"c",(function(){return n})),a.d(e,"a",(function(){}));var i=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("v-uni-view",{staticClass:"order-pages"},[a("v-uni-view",{staticClass:"fix",staticStyle:{top:"-100%",left:"-100%"}},t._l(t.unix_list,(function(t,e){return a("min-countdown",{key:e,attrs:{targetTime:1e3*t.start_service_time_unix,isPlay:!0}})})),1),a("fixed",[a("tab",{attrs:{list:t.tabList,activeIndex:1*t.activeIndex,activeColor:t.primaryColor,width:100/t.tabList.length+"%",height:"100rpx"},on:{change:function(e){arguments[0]=e=t.$handleEvent(e),t.handerTabChange.apply(void 0,arguments)}}}),a("v-uni-view",{staticClass:"b-1px-b"})],1),t._l(t.list.data,(function(e,i){return a("v-uni-view",{key:i,staticClass:"item-child mt-md ml-lg mr-lg pd-lg fill-base radius-16",on:{click:function(e){e.stopPropagation(),arguments[0]=e=t.$handleEvent(e),t.goDetail(i)}}},[a("v-uni-view",{staticClass:"flex-between pb-lg",on:{click:function(e){e.stopPropagation(),arguments[0]=e=t.$handleEvent(e),t.goShop(i)}}},[a("v-uni-view",{staticClass:"f-paragraph c-title max-500 ellipsis"},[t._v("订单号:"+t._s(e.order_code))]),a("v-uni-view",{staticClass:"f-caption text-bold",style:{color:2==e.pay_type?t.primaryColor:[3,4,5].includes(e.pay_type)?t.subColor:6==e.pay_type?"#11C95E":"#333"}},[t._v(t._s(t.statusType[e.pay_type]))])],1),t._l(e.order_goods,(function(i,n){return a("v-uni-view",{key:n,staticClass:"flex-center mb-lg"},[a("v-uni-image",{staticClass:"avatar lg radius-16",attrs:{mode:"aspectFill",src:i.goods_cover}}),a("v-uni-view",{staticClass:"flex-1 ml-md"},[a("v-uni-view",{staticClass:"flex-between"},[a("v-uni-view",{staticClass:"goods-title f-title c-title ellipsis",class:[{"max-300":i.refund_num>0}]},[t._v(t._s(i.goods_name))]),i.refund_num>0?a("v-uni-view",{staticClass:"f-caption c-warning"},[t._v("已退x"+t._s(i.refund_num))]):t._e()],1),a("v-uni-view",{staticClass:"f-caption c-caption mt-md"},[t._v("服务时间:"+t._s(e.start_time))]),a("v-uni-view",{staticClass:"flex-between"},[a("v-uni-view",{staticClass:"flex-y-baseline f-caption c-warning"},[t._v("¥"),a("v-uni-view",{staticClass:"f-title text-bold"},[t._v(t._s(i.price))])],1),a("v-uni-view",{staticClass:"c-paragraph"},[t._v("x"+t._s(i.num))])],1)],1)],1)})),a("v-uni-view",{staticClass:"flex-between pt-lg b-1px-t"},[a("v-uni-view",{staticClass:"flex-y-center f-desc c-title"},[t._v("总计:"),a("v-uni-view",{staticClass:"f-paragraph c-warning text-bold"},[t._v("¥"+t._s(e.pay_price))])],1),a("v-uni-view",{staticClass:"flex-warp"},[2==e.pay_type?[a("v-uni-button",{staticClass:"clear-btn order",on:{click:function(e){e.stopPropagation(),arguments[0]=e=t.$handleEvent(e),t.toRefuse(i)}}},[t._v("拒绝接单")]),a("v-uni-button",{staticClass:"clear-btn order",style:{color:"#fff",background:t.primaryColor,borderColor:t.primaryColor},on:{click:function(e){e.stopPropagation(),arguments[0]=e=t.$handleEvent(e),t.toConfirm(i,3)}}},[t._v("确认接单")])]:t._e(),3==e.pay_type||4==e.pay_type||5==e.pay_type?[a("v-uni-button",{staticClass:"clear-btn order",on:{click:function(e){e.stopPropagation(),arguments[0]=e=t.$handleEvent(e),t.toTel(i)}}},[t._v("咨询")]),a("v-uni-button",{staticClass:"clear-btn order",style:{color:"#fff",background:t.primaryColor,borderColor:t.primaryColor},on:{click:function(a){a.stopPropagation(),arguments[0]=a=t.$handleEvent(a),t.toConfirm(i,1*e.pay_type+1)}}},[t._v(t._s(3==e.pay_type?"已出发":4==e.pay_type?"拍照确认到达":"开始服务"))])]:t._e(),6==e.pay_type?[a("v-uni-button",{staticClass:"clear-btn order",style:{color:"#fff",background:t.primaryColor,borderColor:t.primaryColor},on:{click:function(e){e.stopPropagation(),arguments[0]=e=t.$handleEvent(e),t.toConfirm(i,7)}}},[t._v("拍照完成服务")])]:t._e()],2)],1)],2)})),t.loading?a("load-more",{attrs:{noMore:t.list.current_page>=t.list.last_page&&t.list.data.length>0,loading:t.loading}}):t._e(),!t.loading&&t.list.data.length<=0&&1==t.list.current_page?a("abnor"):t._e(),a("v-uni-view",{staticClass:"space-footer"}),a("uni-popup",{ref:"refuse_item",attrs:{type:"center",custom:!0}},[a("v-uni-view",{staticClass:"common-popup-content fill-base pd-lg radius-34"},[a("v-uni-view",{staticClass:"title"},[t._v("拒绝接单")]),a("v-uni-view",{staticClass:"desc"},[t._v("请确认是否拒接接单")]),a("v-uni-textarea",{staticClass:"pd-lg textarea f-desc c-title mt-lg radius-20",attrs:{maxlength:"200",placeholder:"请输入拒单原因","placeholder-class":"f-desc c-caption"},model:{value:t.coach_refund_text,callback:function(e){t.coach_refund_text=e},expression:"coach_refund_text"}}),a("v-uni-view",{staticClass:"flex-center mt-md",staticStyle:{width:"540rpx"}},[a("v-uni-view",{staticClass:"flex-1"}),a("v-uni-view",[t._v(t._s(t.coach_refund_text.length>200?200:t.coach_refund_text.length)+"/200")])],1),a("v-uni-view",{staticClass:"button"},[a("v-uni-view",{staticClass:"item-child",on:{click:function(e){e.stopPropagation(),arguments[0]=e=t.$handleEvent(e),t.$refs.refuse_item.close()}}},[t._v("取消")]),a("v-uni-view",{staticClass:"item-child c-base",style:{background:t.primaryColor,color:"#fff"},on:{click:function(e){e.stopPropagation(),arguments[0]=e=t.$handleEvent(e),t.confirmRefuse.apply(void 0,arguments)}}},[t._v("确定")])],1)],1)],1)],2)},n=[]}}]); |