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
17 KiB
1 lines
17 KiB
(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/index/index"],{"490d":function(e,t,n){},"5f22":function(e,t,n){"use strict";n.r(t);var o=n("7ea8"),i=n("6f66");for(var a in i)["default"].indexOf(a)<0&&function(e){n.d(t,e,(function(){return i[e]}))}(a);n("c9f8");var s=n("f0c5"),r=Object(s["a"])(i["default"],o["b"],o["c"],!1,null,null,null,!1,o["a"],void 0);t["default"]=r.exports},"6f66":function(e,t,n){"use strict";n.r(t);var o=n("f729"),i=n.n(o);for(var a in o)["default"].indexOf(a)<0&&function(e){n.d(t,e,(function(){return o[e]}))}(a);t["default"]=i.a},"7ea8":function(e,t,n){"use strict";n.d(t,"b",(function(){return o})),n.d(t,"c",(function(){return i})),n.d(t,"a",(function(){}));var o=function(){var e=this,t=e.$createElement,n=(e._self._c,e.__map(e.pagebars,(function(t,n){var o=e.__get_orig(t),i=1==n&&e.pickupArray.length>0,a=i?e.pickupArray.length:null,s=2==n&&e.completedArray.length>0,r=s?e.completedArray.length:null;return{$orig:o,g0:i,g1:a,g2:s,g3:r}}))),o=1==e.showrelax?e.completedArray.length:null,i=1==e.showrelax?e.pickupArray.length:null;e.$mp.data=Object.assign({},{$root:{l0:n,g4:o,g5:i}})},i=[]},"8c0e":function(e,t,n){"use strict";(function(e,t){var o=n("4ea4");n("5340");o(n("66fd"));var i=o(n("5f22"));e.__webpack_require_UNI_MP_PLUGIN__=n,t(i.default)}).call(this,n("bc2e")["default"],n("543d")["createPage"])},c9f8:function(e,t,n){"use strict";var o=n("490d"),i=n.n(o);i.a},f729:function(e,t,n){"use strict";(function(e){var o=n("4ea4");Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=o(n("75bd")),a=n("5951"),s=new a.AMapWX({key:getApp().globalData.GaoDeKey_amapkey}),r={components:{cancleorder:function(){n.e("components/cancleorder/index").then(function(){return resolve(n("5b7c"))}.bind(null,n)).catch(n.oe)},cell:function(){n.e("components/defaultcell/index").then(function(){return resolve(n("491b"))}.bind(null,n)).catch(n.oe)},navbar:function(){n.e("components/navsearchbar/index").then(function(){return resolve(n("9da9"))}.bind(null,n)).catch(n.oe)},unidrawer:function(){n.e("uni_modules/uni-drawer/components/uni-drawer/uni-drawer").then(function(){return resolve(n("339b"))}.bind(null,n)).catch(n.oe)},phoneset:function(){n.e("components/phoneset/index").then(function(){return resolve(n("a9fd"))}.bind(null,n)).catch(n.oe)},Graborders:function(){n.e("components/Graborders/index").then(function(){return resolve(n("d8fc"))}.bind(null,n)).catch(n.oe)},phoneinput:function(){n.e("components/phoneinput/index").then(function(){return resolve(n("d4a6"))}.bind(null,n)).catch(n.oe)},relaxview:function(){n.e("components/relaxview/index").then(function(){return resolve(n("2a18"))}.bind(null,n)).catch(n.oe)},relaxokview:function(){n.e("components/relaxokview/index").then(function(){return resolve(n("c210"))}.bind(null,n)).catch(n.oe)}},computed:{i18n:function(){return this.$t("index")}},data:function(){return{showcancleorder:!1,p1:1,p2:1,p3:1,taskArray:[],pickupArray:[],completedArray:[],mobile:"",userInfo:"",showrelaxok:!1,showrelax:!1,showphoneCode:!1,grab:!1,showset:!1,userlist:[{img:"../../static/personimage/pingjia.png",name:"我的评价"},{img:"../../static/personimage/dingdan.png",name:"订单统计"},{img:"../../static/personimage/qianbao.png",name:"我的钱包"},{img:"../../static/personimage/shehhzi.png",name:"设置"}],mymenu:["今日完成单","今日配送费","本月好评"],drawtop:0,drawheight:0,list:[],scrollH:0,safeAreaBottom:0,selectedIndex:0,pagebars:["新任务","待取货","待完成"],selectedID:0,locationtimer:null,sckChatServer:""}},onHide:function(){console.log("onHide ")},onReady:function(){this.userlist=[{img:"../../static/personimage/pingjia.png",name:this.i18n.wodepingjia},{img:"../../static/personimage/dingdan.png",name:this.i18n.dingdantongji},{img:"../../static/personimage/qianbao.png",name:this.i18n.wodeqianbao},{img:"../../static/personimage/shehhzi.png",name:this.i18n.shezhi}],this.mymenu=[this.i18n.jinriwanchengdan,this.i18n.jinripeisongfei,this.i18n.benyuehaoping],this.pagebars=[this.i18n.xinrenwu,this.i18n.daiquhuo,this.i18n.daiwancheng]},onShow:function(){this.getUserLocation(),this.login(),this.finishedThumb()},onLoad:function(){console.log("onLoad"),e.onNetworkStatusChange((function(e){e.isConnected&&(t.login(),t.OrdersGetList())}));var t=this;this.drawtop=getApp().globalData.top+44+50,this.drawheight=getApp().globalData.windowHeight-this.drawtop,this.safeAreaBottom=getApp().globalData.safeAreaBottom+53,this.scrollH=getApp().globalData.windowHeight-this.safeAreaBottom-getApp().globalData.top-50-44,this.locationtimer=setInterval((function(){e.getStorage({key:"mylocation",success:function(e){t.CalculateDistance(e.data.longitude,e.data.latitude)}})}),5e3)},methods:{getclientID:function(){},uploadCid:function(e){},uploadimprofile:function(){this.NB.user()},ordercanclesure:function(){this.showcancleorder=!1},fomatFloat:function(e,t){var n=Math.round(e*Math.pow(10,t))/Math.pow(10,t),o=n.toString(),i=o.indexOf(".");i<0&&(o+=".");for(var a=o.length-o.indexOf(".");a<=t;a++)o+="0";return o},CalculateDistance:function(t,n){for(var o=0;o<this.taskArray.length;o++){var a=this.taskArray[o],s=a.f_lng,r=a.f_lat;3==a.type&&0==a.f_lng.length&&(s=a.t_lng,r=a.t_lat),4!=a.type&&5!=a.type||(s=a.t_lng,r=a.t_lat);var c=parseInt(this.countDist(parseFloat(t),parseFloat(n),parseFloat(s),parseFloat(r))),l=c;l=c>1e3?this.fomatFloat(c/1e3,1)+"km":i.default.strip(c)+"m",this.taskArray[o].myDistance=l;var u=0;""!=this.taskArray[o].extra.distance&&(u=parseFloat(c)+parseFloat(this.taskArray[o].extra.distance),u=u>1e3?this.fomatFloat(u/1e3,1)+"km":i.default.strip(u)+"m"),this.taskArray[o].allDistance=u,this.$refs.task&&this.$refs.task.reload(this.taskArray),e.setStorage({key:"taskArray",data:this.taskArray})}for(var d=0;d<this.pickupArray.length;d++){a=this.pickupArray[d],s=a.f_lng,r=a.f_lat;3==a.type&&""==a.f_lng&&(s=a.t_lng,r=a.t_lat),4!=a.type&&5!=a.type||(s=a.t_lng,r=a.t_lat);c=parseInt(this.countDist(parseFloat(t),parseFloat(n),parseFloat(s),parseFloat(r))),l=c;l=c>1e3?this.fomatFloat(c/1e3,1)+"km":i.default.strip(c)+"m",this.pickupArray[d].myDistance=l;var f=parseFloat(c)+parseFloat(this.pickupArray[d].extra.distance);f=f>1e3?this.fomatFloat(f/1e3,1)+"km":i.default.strip(f)+"m",this.pickupArray[d].allDistance=f,this.$refs.pick&&this.$refs.pick.reload(this.pickupArray),e.setStorage({key:"pickupArray",data:this.pickupArray})}for(var h=0;h<this.completedArray.length;h++){a=this.completedArray[h],s=a.f_lng,r=a.f_lat;3==a.type&&0==a.f_lng.length&&(s=a.t_lng,r=a.t_lat),4!=a.type&&5!=a.type||(s=a.t_lng,r=a.t_lat);c=parseInt(this.countDist(parseFloat(t),parseFloat(n),parseFloat(s),parseFloat(r))),l=c;l=c>1e3?this.fomatFloat(c/1e3,1)+"km":i.default.strip(c)+"m",this.completedArray[h].myDistance=l;var g=parseFloat(c)+parseFloat(this.completedArray[h].extra.distance);g=g>1e3?this.fomatFloat(g/1e3,1)+"km":i.default.strip(g)+"m",this.completedArray[h].allDistance=g,this.$refs.completed&&this.$refs.completed.reload(this.completedArray),e.setStorage({key:"completedArray",data:this.completedArray})}},countDist:function(e,t,n,o){var i,a,s,r,c,l,u,d=(t+o)/2*Math.PI/180,f=(t-o)/2*Math.PI/180,h=(e-n)/2*Math.PI/180,g=Math.sin(f),p=Math.sin(h),m=Math.sin(d);g*=g,p*=p,m*=m,i=g*(1-p)+(1-m)*p,a=(1-g)*(1-p)+m*p,s=Math.atan(Math.sqrt(i/a)),r=Math.sqrt(i*a)/s,c=2*s*6378137,l=(3*r-1)/2/a,u=(3*r+1)/2/i;var y=c*(1+1/298.257*(l*m*(1-g)-u*(1-m)*g));return y},getRidingRoute:function(e,t,n,o){var i=new Promise((function(i,a){s.getRidingRoute({origin:e+","+t,destination:n+","+o,success:function(e){i(e.paths[0].distance)},fail:function(e){}})}));return i},getlocation:function(){console.log("单次定位开始APPPlus");var t=this;e.getLocation({type:"gcj02",success:function(n){console.log("单次定位成功"),t.showset=!1,e.setStorage({key:"mylocation",data:n}),t.OrdersGetList(),t.NB.sendRequest("Rider.Location.Set",{lng:n.longitude,lat:n.latitude}),t.startlocation()},fail:function(e){console.log(e),t.showset=!0}})},requestLocPermission:function(){wyGaoDeModule.requestLocPermission((function(e){}))},requestLocBackgroudPermission:function(){"Android"==plus.os.name&&wyGaoDeModule.requestLocBackgroudPermission((function(e){}))},startlocation:function(){console.log("开始定位");var t=this;wyGaoDeModule.startLocation({enableBackground:1,interval:5e3},(function(n){0!=n.longitude&&(e.setStorage({key:"mylocation",data:n}),t.NB.sendRequest("Rider.Location.Set",{lng:n.longitude,lat:n.latitude}))}))},stopLocation:function(){wyGaoDeModule.stopLocation()},GetConfig:function(){console.log(0x31242341e81adc0);var t=this;this.NB.sendRequest("Home.GetConfig").then((function(n){var o=e.getStorageSync("userinfo");if(o&&o.id>0){var i=n.info[0].chatserver;t.sckChatServer=t.NB.decypt(i),t.socektMethod(t.sckChatServer)}e.setStorage({key:"Config",data:n.info[0]})}))},reload:function(){e.showLoading({title:this.i18n.shuaxinzhong,mask:!1}),this.OrdersGetList()},OrdersGetList:function(){for(var t=this,n=this,o=function(o){t.NB.sendRequest("Rider.Orders.GetList",{type:o+1,p:1}).then((function(t){0==o?e.getStorage({key:"taskArray",success:function(e){for(var o=0;o<e.data.length;o++)for(var i=0;i<t.info.length;i++)t.info[i].id==e.data[o].id&&(t.info[i].myDistance=e.data[o].myDistance,t.info[i].allDistance=e.data[o].allDistance);n.taskArray=t.info,n.$refs.task&&n.$refs.task.reload(n.taskArray)},fail:function(){n.taskArray=t.info,n.$refs.task&&n.$refs.task.reload(n.taskArray)}}):1==o?e.getStorage({key:"pickupArray",success:function(e){for(var o=0;o<e.data.length;o++)for(var i=0;i<t.info.length;i++)t.info[i].id==e.data[o].id&&(t.info[i].myDistance=e.data[o].myDistance,t.info[i].allDistance=e.data[o].allDistance);n.pickupArray=t.info,n.$refs.pick&&n.$refs.pick.reload(n.pickupArray)},fail:function(){n.pickupArray=t.info,n.$refs.pick&&n.$refs.pick.reload(n.pickupArray)}}):(e.getStorage({key:"completedArray",success:function(o){for(var i=0;i<o.data.length;i++)for(var a=0;a<t.info.length;a++)t.info[a].id==o.data[i].id&&(t.info[a].myDistance=o.data[i].myDistance,t.info[a].allDistance=o.data[i].allDistance);n.completedArray=t.info,n.$refs.completed&&n.$refs.completed.reload(n.completedArray),e.hideLoading()},fail:function(){n.completedArray=t.info,n.$refs.completed&&n.$refs.completed.reload(n.completedArray),e.hideLoading()}}),e.getStorage({key:"mylocation",success:function(e){n.CalculateDistance(e.data.longitude,e.data.latitude)}}))}))},i=0;i<3;i++)o(i)},GetBaseInfo:function(){var t=this;this.NB.sendRequest("Rider.User.GetBaseInfo").then((function(n){t.userInfo=t.NB.user(),t.userInfo.isrest=n.info[0].isrest,t.userInfo.balance=n.info[0].balance,t.userInfo.balancetotal=n.info[0].balancetotal,t.userInfo.income=n.info[0].income,t.userInfo.orders=n.info[0].orders,t.userInfo.star=n.info[0].star,t.userInfo.evaluates=n.info[0].evaluates,t.userInfo.average=n.info[0].average,t.userInfo.bad=n.info[0].bad,t.userInfo.mgood=n.info[0].mgood,t.userInfo.good=n.info[0].good;t.mobile=t.userInfo.mobile.replace(/^(\d{3})\d{4}(\d{4})$/,"$1****$2"),e.setStorage({key:"userinfo",data:t.userInfo,success:function(){}})}))},getUserLocation:function(){var t=this;e.startLocationUpdateBackground({type:"wgs84",success:function(){t.showset=!1,e.startLocationUpdate({type:"wgs84",success:function(){e.onLocationChange((function(n){e.setStorage({key:"mylocation",data:n}),t.NB.sendRequest("Rider.Location.Set",{lng:n.longitude,lat:n.latitude})}))}})},fail:function(e){t.showset=!0,console.log("startLocationUpdateBackground",JSON.stringify(e))}})},connect:function(t){if(1!=this.userInfo.isrest){var n=t.recip_phone;t.type<3&&3==t.status&&(n=t.pick_phone),6==t.type&&(n=t.pick_phone),e.makePhoneCall({phoneNumber:n,success:function(e){},fail:function(e){}})}else e.showToast({title:this.i18n.xiuxizhong,icon:"none"})},cancleinput:function(){this.showphoneCode=!1},finishcode:function(t){e.showLoading({title:"",mask:!1});var n=this;this.NB.sendRequest("Rider.Orders.Complete",{oid:this.selectedID,code:t},!0).then((function(e){n.OrdersGetList(),n.showphoneCode=!1}))},serviceCompleted:function(t){1!=this.userInfo.isrest?(this.selectedID=t.id,this.showphoneCode=!0):e.showToast({title:this.i18n.xiuxizhong,icon:"none"})},RefuseOrders:function(t){if(1!=this.userInfo.isrest){var n=this;this.NB.sendRequest("Rider.Orders.Refuse",{oid:t.id},!0).then((function(e){n.OrdersGetList()}))}else e.showToast({title:this.i18n.xiuxizhong,icon:"none"})},hidegrab:function(){this.grab=!1,this.OrdersGetList()},GrabOrder:function(t){if(1!=this.userInfo.isrest){var n=this;this.grab=!0,setTimeout((function(){n.NB.sendRequest("Rider.Orders.Grap",{oid:t.id}).then((function(t){n.$refs.Graborders.success(),e.showToast({title:t.msg,icon:"none"}),n.selectedIndex=1})).catch((function(e){n.$refs.Graborders.getresult()}))}),3e3)}else e.showToast({title:this.i18n.xiuxizhong,icon:"none"})},StartService:function(t){if(1!=this.userInfo.isrest){this.selectedID=t.id,e.navigateTo({url:"../uploadphoto/index"})}else e.showToast({title:this.i18n.xiuxizhong,icon:"none"})},finishedThumb:function(){var t=this;e.getStorage({key:"finishthumb",success:function(n){n.data.length>0&&t.NB.sendRequest("Rider.Orders.Start",{oid:t.selectedID,thumbs:JSON.stringify(n.data)},!0).then((function(n){e.setStorage({key:"finishthumb",data:""}),t.OrdersGetList(),t.selectedIndex=2})).catch((function(t){e.setStorage({key:"finishthumb",data:""})}))}})},gotomapdetail:function(t){1!=this.userInfo.isrest?e.navigateTo({url:"../detailmap/index?oid="+t.id}):e.showToast({title:this.i18n.xiuxizhong,icon:"none"})},gomymenus:function(t){0==t&&e.navigateTo({url:"../Orderstatistics/index?index=1"}),1==t&&e.navigateTo({url:"../Mypurse/index"}),2==t&&e.navigateTo({url:"../mycomment/index"})},gouser:function(t){0==t&&e.navigateTo({url:"../mycomment/index"}),1==t&&e.navigateTo({url:"../Orderstatistics/index"}),2==t&&e.navigateTo({url:"../Mypurse/index"}),3==t&&e.navigateTo({url:"../set/index"})},ditu:function(){if(1!=this.userInfo.isrest)if(0!=this.pickupArray.length||0!=this.completedArray.length){var t=this.completedArray.concat(this.pickupArray);e.setStorage({key:"alltaskarray",data:t,success:function(){e.navigateTo({url:"../Missionmap/index"})}})}else e.showToast({title:this.i18n.zanwurenwu,icon:"none"});else e.showToast({title:this.i18n.xiuxizhong,icon:"none"})},relaxcancle:function(){this.$refs.navbar.getstatus(),this.showrelaxok=!1,this.showrelax=!1},UpRest:function(){var t=this,n=0;0==this.userInfo.isrest&&(n=1),e.showLoading({title:"",mask:!1}),this.NB.sendRequest("Rider.User.UpRest",{rest:n}).then((function(e){t.showrelax=!1,t.GetBaseInfo(),1==n&&(t.showrelaxok=!0),t.$refs.navbar.changedata(n)}))},relaxsure:function(){this.showrelax=!1,this.$refs.navbar.getstatus(),this.showrelaxok=!1,this.showrelax=!1,console.log("relaxsure")},changestatus:function(){if(0==this.userInfo.isrest){if(this.completedArray.length>0||this.pickupArray.length>0)return void(this.showrelax=!0);this.UpRest()}else this.UpRest()},colseset:function(){this.showset=!1},set:function(){this.showset=!0},showdriver:function(){this.$refs.showRight.open()},closeDrawer:function(){this.$refs.showRight.close()},changepageindex:function(e){this.selectedIndex=e},change:function(e){},animationfinish:function(e){this.selectedIndex=e.detail.current},login:function(){var t=this,n=this;this.NB.user()?this.NB.checktoken().then((function(e){n.GetBaseInfo(),n.OrdersGetList(),t.GetConfig()})).catch((function(t){e.reLaunch({url:"../login/login"})})):e.reLaunch({url:"../login/login"})},socektMethod:function(t){console.log(t);var n=this;if(this.NB.user()){var o=e.connectSocket({url:t,success:function(){console.log("socket链接成gong")}});o.onOpen((function(t){console.log("WebSocket连接已打开!",t),console.log("faxiaoxile");var n=e.getStorageSync("userinfo"),i={action:"join",uid:n.id,token:n.token};o.send({data:JSON.stringify(i),success:function(e){console.log("fasongchengggggg ")},fail:function(e){console.log(e)}})})),o.onError((function(t){console.log("WebSocket连接打开失败,请检查!",t),e.closeSocket(),o=null,setTimeout((function(){n.socektMethod(n.sckChatServer)}),3e3)})),o.onMessage((function(e){var t=JSON.parse(e.data);console.log("收到服务器内容:",t),"orders_new"==t.action&&(console.log("新订单(待接单)"),n.onPlayAudio(1)),"orders_dispatch"==t.action&&(console.log("新指派订单(已接单)"),n.onPlayAudio(2)),"orders_trans"==t.action&&(console.log("转单通知"),1==t.type?n.onPlayAudio(3):3==t.type&&n.onPlayAudio(4)),"orders_refund"==t.action&&(console.log("订单申请退款,取消服务"),n.onPlayAudio(5))}))}},onSendJoinSocket:function(){console.log("faxiaoxile");var t=e.getStorageSync("userinfo"),n={action:"join",uid:t.id,token:t.token};e.sendSocketMessage({data:JSON.stringify(n),success:function(e){console.log("fasongchengggggg ")},fail:function(e){console.log(e)}})},onPlayAudio:function(t){this.OrdersGetList();var n=null;n=e.getBackgroundAudioManager(),n.title=this.i18n.yuyinbobao,n.singer=this.i18n.login.title,1==t?n.src=getApp().globalData.weburl+"uniapp/music/xindan-m.mp3":2==t?n.src=getApp().globalData.weburl+"uniapp/music/paidan-m.mp3":3==t?n.src=getApp().globalData.weburl+"uniapp/music/zhuandanSucs-m.mp3":4==t?n.src=getApp().globalData.weburl+"uniapp/music/zhuandanFail-m.mp3":5==t&&(n.src=getApp().globalData.weburl+"uniapp/music/tuikuanCacle-m.mp3"),n.play(),n.onEnded((function(e){n=null}))}}};t.default=r}).call(this,n("543d")["default"])}},[["8c0e","common/runtime","common/vendor"]]]);
|