doum
10 天以前 b7d451c91ec40bee70f23b1e2cf6a8797643faef
small-program/unpackage/dist/dev/mp-weixin/pages/luggage-storage/luggage-storage.js
@@ -1,2 +1,2 @@
(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/luggage-storage/luggage-storage"],{207:function(e,t,r){"use strict";(function(e,t){var n=r(4);r(30);n(r(25));var o=n(r(208));e.__webpack_require_UNI_MP_PLUGIN__=r,t(o.default)}).call(this,r(1)["default"],r(2)["createPage"])},208:function(e,t,r){"use strict";r.r(t);var n=r(209),o=r(211);for(var i in o)["default"].indexOf(i)<0&&function(e){r.d(t,e,(function(){return o[e]}))}(i);r(213);var a,c=r(41),u=Object(c["default"])(o["default"],n["render"],n["staticRenderFns"],!1,null,"c13e4c60",null,!1,n["components"],a);u.options.__file="pages/luggage-storage/luggage-storage.vue",t["default"]=u.exports},209:function(e,t,r){"use strict";r.r(t);var n=r(210);r.d(t,"render",(function(){return n["render"]})),r.d(t,"staticRenderFns",(function(){return n["staticRenderFns"]})),r.d(t,"recyclableRender",(function(){return n["recyclableRender"]})),r.d(t,"components",(function(){return n["components"]}))},210:function(e,t,r){"use strict";var n;r.r(t),r.d(t,"render",(function(){return o})),r.d(t,"staticRenderFns",(function(){return a})),r.d(t,"recyclableRender",(function(){return i})),r.d(t,"components",(function(){return n}));try{n={uIcon:function(){return Promise.all([r.e("common/vendor"),r.e("node-modules/uview-ui/components/u-icon/u-icon")]).then(r.bind(null,396))},uDatetimePicker:function(){return Promise.all([r.e("common/vendor"),r.e("node-modules/uview-ui/components/u-datetime-picker/u-datetime-picker")]).then(r.bind(null,419))},uPopup:function(){return Promise.all([r.e("common/vendor"),r.e("node-modules/uview-ui/components/u-popup/u-popup")]).then(r.bind(null,428))},uActionSheet:function(){return Promise.all([r.e("common/vendor"),r.e("node-modules/uview-ui/components/u-action-sheet/u-action-sheet")]).then(r.bind(null,436))}}}catch(c){if(-1===c.message.indexOf("Cannot find module")||-1===c.message.indexOf(".vue"))throw c;console.error(c.message),console.error("1. 排查组件名称拼写是否正确"),console.error("2. 排查组件是否符合 easycom 规范,文档:https://uniapp.dcloud.net.cn/collocation/pages?id=easycom"),console.error("3. 若组件不符合 easycom 规范,需手动引入,并在 components 中注册该组件")}var o=function(){var e=this,t=e.$createElement;e._self._c;e._isMounted||(e.e0=function(t){e.showArriveTimePicker=!0},e.e1=function(t){e.showPickupTimePicker=!0},e.e2=function(t){e.showArriveTimePicker=!1},e.e3=function(t){e.showArriveTimePicker=!1},e.e4=function(t){e.showPickupTimePicker=!1},e.e5=function(t){e.showPickupTimePicker=!1},e.e6=function(t){e.showGoodsPopup=!0},e.e7=function(t,r){var n=arguments[arguments.length-1].currentTarget.dataset,o=n.eventParams||n["event-params"];r=o.item;e.isUrgent=r.id},e.e8=function(t){e.showStorePopup=!1},e.e9=function(t){e.showStorePopup=!1},e.e10=function(t,r){var n=arguments[arguments.length-1].currentTarget.dataset,o=n.eventParams||n["event-params"];r=o.index;e.storeList.forEach((function(e,t){return e.active=r===t}))},e.e11=function(t){e.showGoodsPopup=!1},e.e12=function(t){e.showGoodsPopup=!1},e.e13=function(t,r){var n=arguments[arguments.length-1].currentTarget.dataset,o=n.eventParams||n["event-params"];r=o.index;e.goodsOptions.forEach((function(e,t){return e.active=t===r}))},e.e14=function(t){e.showAmountPopup=!1},e.e15=function(t){e.showAmountPopup=!1},e.e16=function(t){e.showAmountPopup=!1},e.e17=function(t){e.showReceiveAddress=!1})},i=!1,a=[];o._withStripped=!0},211:function(e,t,r){"use strict";r.r(t);var n=r(212),o=r.n(n);for(var i in n)["default"].indexOf(i)<0&&function(e){r.d(t,e,(function(){return n[e]}))}(i);t["default"]=o.a},212:function(e,t,r){"use strict";(function(e){var n=r(4);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r(34)),i=n(r(18)),a=n(r(36)),c=n(r(11)),u=r(37);function s(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function d(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?s(Object(r),!0).forEach((function(t){(0,c.default)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):s(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var l={data:function(){return{showStorePopup:!1,showGoodsPopup:!1,showAmountPopup:!1,showArriveTimePicker:!1,showPickupTimePicker:!1,arriveTimeValue:Number(new Date),pickupTimeValue:Number(new Date),activeMode:"local",modeTabs:[{label:"就地寄存",value:"local"},{label:"同城寄送",value:"city"}],agreementChecked:!0,tempSelectedStoreId:2,selectedStoreId:2,tempSelectedGoodsIds:[1],selectedGoodsIds:[1],selectedLuggageId:1,isUrgent:0,form:{receiver:"",mobile:"",arriveTime:"",pickupTime:"",goodType:"",goodTypeName:"",insurance:"",remark:"",goodsImages:[]},amountData:null,luggageTypes:[],serviceTimes:[],storeList:[],selectedStore:null,sendStore:null,receiveStore:null,receiveAddr:null,storePopupType:"send",storeForm:{keyword:"",page:1,isSearch:!0},goodsOptions:[],uploadedImages:[],showReceiveAddress:!1,actions:[{name:"选择服务点"},{name:"选择地址簿"}]}},watch:{"form.insurance":{handler:function(){this.calculateLocalPrice()}},isUrgent:{handler:function(){"city"===this.activeMode&&this.calculateRemotePrice()}}},computed:d(d({},(0,u.mapState)(["latitude","longitude","cityId"])),{},{servicePointPlaceholder:function(){return"city"===this.activeMode?"选择寄送服务点":"选择寄存服务点"},selectedGoodsText:function(){var e=this;if(!this.selectedGoodsIds.length)return"必选,请选择";var t=this.goodsOptions.filter((function(t){return e.selectedGoodsIds.includes(t.id)})).map((function(e){return e.name}));return t.join("、")},totalPriceText:function(){return"¥150.00"}}),onLoad:function(){var t=this;this.getNearbyShopList(),this.getCategoryList(),this.getCitySizeList(),e.$on("updateAddress",(function(e){console.log(e),t.receiveAddr=e}))},methods:{caozuo:function(t){var r=this;"选择服务点"===t.name?(r.storePopupType="receive",r.receiveStore=null,r.showStorePopup=!0):"选择地址簿"===t.name&&(r.receiveAddr=null,e.navigateTo({url:"/pages/address/address?type=1"})),r.showReceiveAddress=!1},uploadFiles:function(t){var r=arguments,n=this;return(0,a.default)(o.default.mark((function i(){var a,c,u,s;return o.default.wrap((function(o){while(1)switch(o.prev=o.next){case 0:if(a=r.length>1&&void 0!==r[1]?r[1]:9,t&&0!==t.length){o.next=3;break}return o.abrupt("return",[]);case 3:return c=t.slice(0,a),u=c.map((function(t){return new Promise((function(r,o){e.uploadFile({url:n.$baseUrl+"/web/public/upload",filePath:t,name:"file",formData:{folder:"orders"},success:function(e){if(200===e.statusCode){var t=JSON.parse(e.data);200===t.code?r(t.data):o(new Error(t.msg||"上传失败"))}else o(new Error("上传失败"))},fail:function(e){o(e)}})}))})),o.prev=5,o.next=8,Promise.all(u);case 8:return s=o.sent,o.abrupt("return",s);case 12:throw o.prev=12,o.t0=o["catch"](5),e.showToast({title:"上传失败",icon:"none"}),o.t0;case 16:case"end":return o.stop()}}),i,null,[[5,12]])})))()},deleteImage:function(e){this.uploadedImages.splice(e,1),this.form.goodsImages.splice(e,1)},chooseAndUploadImage:function(){var t=arguments,r=this;return(0,a.default)(o.default.mark((function n(){var c,u,s;return o.default.wrap((function(n){while(1)switch(n.prev=n.next){case 0:if(c=t.length>0&&void 0!==t[0]?t[0]:9,u=r.form.goodsImages.length,s=c-u,!(s<=0)){n.next=6;break}return e.showToast({title:"最多上传".concat(c,"张图片"),icon:"none"}),n.abrupt("return");case 6:e.chooseImage({count:s,sizeType:["compressed"],sourceType:["album","camera"],success:function(){var t=(0,a.default)(o.default.mark((function t(n){var a,u,s;return o.default.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return a=n.tempFilePaths,e.showLoading({title:"上传中...",mask:!0}),t.prev=2,t.next=5,r.uploadFiles(a,c);case 5:u=t.sent,s=u.map((function(e){return e.url||e.path||e})),r.uploadedImages=[].concat((0,i.default)(r.uploadedImages),(0,i.default)(s.map((function(e){return{url:e}})))),r.form.goodsImages=[].concat((0,i.default)(r.form.goodsImages),(0,i.default)(s)),e.hideLoading(),e.showToast({title:"上传成功",icon:"success"}),t.next=16;break;case 13:t.prev=13,t.t0=t["catch"](2),e.hideLoading();case 16:case"end":return t.stop()}}),t,null,[[2,13]])})));function n(e){return t.apply(this,arguments)}return n}()});case 7:case"end":return n.stop()}}),n)})))()},searchStore:function(){this.storeList=[],this.storeForm.page=1,this.storeForm.isSearch=!0,this.getNearbyShopList()},switchMode:function(e){this.activeMode=e,this.selectedStore=null,this.sendStore=null,this.receiveStore=null,this.receiveAddr=null,this.form.receiver="",this.form.mobile="",this.form.arriveTime="",this.form.pickupTime="",this.form.goodType="",this.form.goodTypeName="",this.form.insurance="",this.form.remark="",this.form.goodsImages=[],this.amountData=null,this.uploadedImages=[],this.luggageTypes.forEach((function(e){e.count=0}))},toggleAgreement:function(){this.agreementChecked=!this.agreementChecked},goRichText:function(t){e.navigateTo({url:"/pages/rich-text/rich-text?type="+t})},openReceiveAddress:function(){this.showReceiveAddress=!0},openAmountPopup:function(){this.showAmountPopup=!0},openStorePopup:function(){this.storePopupType="send",this.tempSelectedStoreId=null,this.showStorePopup=!0},openStorePopup0:function(){this.storePopupType="send0",this.tempSelectedStoreId=null,this.showStorePopup=!0},confirmStore:function(){console.log("=========================");var e=this.storeList.find((function(e){return e.active}));console.log(e),"send"===this.storePopupType?this.sendStore=e:"receive"===this.storePopupType?(this.receiveStore=e,this.receiveAddr=null,this.calculateRemotePrice()):(this.selectedStore=e,this.calculateLocalPrice()),this.showStorePopup=!1},confirmGoods:function(){var t,r;this.goodsOptions.find((function(e){return e.active}))?(this.form.goodTypeName=(null===(t=this.goodsOptions.find((function(e){return e.active})))||void 0===t?void 0:t.name)||"",this.form.goodType=(null===(r=this.goodsOptions.find((function(e){return e.active})))||void 0===r?void 0:r.id)||"",this.showGoodsPopup=!1):e.showToast({title:"请选择物品信息",icon:"none"})},confirmArriveTime:function(e){var t=new Date(e.value),r=t.getFullYear(),n=String(t.getMonth()+1).padStart(2,"0"),o=String(t.getDate()).padStart(2,"0"),i=String(t.getHours()).padStart(2,"0"),a=String(t.getMinutes()).padStart(2,"0");this.form.arriveTime="".concat(r,"-").concat(n,"-").concat(o," ").concat(i,":").concat(a),this.showArriveTimePicker=!1,this.calculateLocalPrice()},confirmPickupTime:function(t){var r=new Date(t.value),n=r.getFullYear(),o=String(r.getMonth()+1).padStart(2,"0"),i=String(r.getDate()).padStart(2,"0"),a=String(r.getHours()).padStart(2,"0"),c=String(r.getMinutes()).padStart(2,"0"),u="".concat(n,"-").concat(o,"-").concat(i," ").concat(a,":").concat(c);this.form.arriveTime&&new Date(u)<=new Date(this.form.arriveTime)?e.showToast({title:"预计取件时间必须大于预计到店时间",icon:"none"}):(this.form.pickupTime=u,this.showPickupTimePicker=!1,this.calculateLocalPrice())},getCategoryList:function(){var e=this;return(0,a.default)(o.default.mark((function t(){var r;return o.default.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,e.$u.api.getCategoryList({type:2});case 2:r=t.sent,200===r.code&&(r.data.forEach((function(e){e.active=!1})),e.goodsOptions=r.data||[]);case 4:case"end":return t.stop()}}),t)})))()},getCitySizeList:function(){var e=this;return(0,a.default)(o.default.mark((function t(){var r;return o.default.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,e.$u.api.getCitySizeList({cityId:e.cityId});case 2:r=t.sent,200===r.code&&(r.data.forEach((function(e){e.count=0})),e.luggageTypes=r.data||[]);case 4:case"end":return t.stop()}}),t)})))()},getNearbyShopList:function(){var e=this;return(0,a.default)(o.default.mark((function t(){var r;return o.default.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(e.storeForm.isSearch){t.next=2;break}return t.abrupt("return");case 2:return t.next=4,e.$u.api.getNearbyShopList({capacity:10,page:e.storeForm.page,model:{latitude:e.latitude,longitude:e.longitude,cityId:e.cityId,sortType:1}});case 4:r=t.sent,200===r.code&&(r.data.records.forEach((function(e){e.active=!1})),e.storeList=[].concat((0,i.default)(e.storeList),(0,i.default)(r.data.records||[])),e.storeForm.page++,e.storeForm.isSearch=e.storeList.length<=r.data.total);case 6:case"end":return t.stop()}}),t)})))()},increaseCount:function(e){this.luggageTypes[e].count++,this.calculateLocalPrice()},decreaseCount:function(e){this.luggageTypes[e].count>0&&this.luggageTypes[e].count--,this.calculateLocalPrice()},calculateLocalPrice:function(){var e=this;return(0,a.default)(o.default.mark((function t(){return o.default.wrap((function(t){while(1)switch(t.prev=t.next){case 0:"city"===e.activeMode?e.calculateRemotePrice():e.calculateLocalPriceOnly();case 1:case"end":return t.stop()}}),t)})))()},calculateLocalPriceOnly:function(){var e=this;return(0,a.default)(o.default.mark((function t(){var r,n;return o.default.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(e.selectedStore&&e.form.arriveTime&&e.form.pickupTime){t.next=2;break}return t.abrupt("return");case 2:if(r=e.luggageTypes.filter((function(e){return e.count>0})).map((function(e){return{categoryId:e.id,quantity:e.count}})),0!==r.length){t.next=5;break}return t.abrupt("return");case 5:return t.next=7,e.$u.api.calculateLocalPrice({cityId:e.cityId,shopId:e.selectedStore.id,depositStartTime:e.form.arriveTime+":00",depositEndTime:e.form.pickupTime+":00",items:r,declaredAmount:e.form.insurance||0});case 7:n=t.sent,200===n.code&&(n.data.itemList.forEach((function(e){e.unitPrice=e.unitPrice/100})),n.data.totalPrice=n.data.totalPrice/100,n.data.insuranceFee=n.data.insuranceFee/100,e.amountData=n.data);case 9:case"end":return t.stop()}}),t)})))()},calculateRemotePrice:function(){var e=this;return(0,a.default)(o.default.mark((function t(){var r,n,i,a,c,u;return o.default.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(e.sendStore&&e.form.arriveTime&&e.form.pickupTime){t.next=2;break}return t.abrupt("return");case 2:if(e.receiveStore||e.receiveAddr){t.next=4;break}return t.abrupt("return");case 4:if(r=e.luggageTypes.filter((function(e){return e.count>0})).map((function(e){return{categoryId:e.id,quantity:e.count}})),0!==r.length){t.next=7;break}return t.abrupt("return");case 7:return n="",i="",a="",c="",e.sendStore&&(n=e.sendStore.latitude,i=e.sendStore.longitude),e.receiveStore?(a=e.receiveStore.latitude,c=e.receiveStore.longitude):e.receiveAddr&&(a=e.receiveAddr.latitude,c=e.receiveAddr.longitude),t.next=15,e.$u.api.calculateRemotePrice({cityId:e.cityId,fromLat:n,fromLgt:i,toLat:a,toLgt:c,urgent:e.isUrgent,depositStartTime:e.form.arriveTime+":00",depositEndTime:e.form.pickupTime+":00",items:r,declaredAmount:e.form.insurance||0});case 15:u=t.sent,200===u.code&&(u.data.itemList.forEach((function(e){e.unitPrice=e.unitPrice/100})),u.data.totalPrice=u.data.totalPrice/100,u.data.insuranceFee=u.data.insuranceFee/100,e.serviceTimes=[{id:0,name:"标准达",serviceTime:u.data.standardHours,price:u.data.itemPrice/100},{id:1,name:"急速达",serviceTime:u.data.urgentHours,price:(u.data.urgentFee+u.data.itemPrice)/100}],e.amountData=u.data);case 17:case"end":return t.stop()}}),t)})))()},createOrder:function(){var t=this;return(0,a.default)(o.default.mark((function r(){var n,i,a,c;return o.default.wrap((function(r){while(1)switch(r.prev=r.next){case 0:if(t.agreementChecked){r.next=3;break}return e.showToast({title:"请先阅读并同意用户服务协议及隐私政策",icon:"none"}),r.abrupt("return");case 3:if("local"!==t.activeMode){r.next=9;break}if(t.selectedStore){r.next=7;break}return e.showToast({title:"请选择门店",icon:"none"}),r.abrupt("return");case 7:r.next=15;break;case 9:if(t.sendStore){r.next=12;break}return e.showToast({title:"请选择寄件服务点",icon:"none"}),r.abrupt("return");case 12:if(t.receiveStore||t.receiveAddr){r.next=15;break}return e.showToast({title:"请选择取件地址",icon:"none"}),r.abrupt("return");case 15:if(t.form.arriveTime){r.next=18;break}return e.showToast({title:"请选择预计到店时间",icon:"none"}),r.abrupt("return");case 18:if(t.form.pickupTime){r.next=21;break}return e.showToast({title:"请选择预计取件时间",icon:"none"}),r.abrupt("return");case 21:if(!(new Date(t.form.pickupTime)<=new Date(t.form.arriveTime))){r.next=24;break}return e.showToast({title:"预计取件时间必须大于预计到店时间",icon:"none"}),r.abrupt("return");case 24:if(n=t.luggageTypes.filter((function(e){return e.count>0})).map((function(e){return{categoryId:e.id,quantity:e.count}})),0!==n.length){r.next=28;break}return e.showToast({title:"请选择行李类型",icon:"none"}),r.abrupt("return");case 28:return i=n.map((function(e){return{categoryId:e.categoryId,quantity:e.quantity}})),a={cityId:t.cityId,declaredAmount:t.form.insurance||0,expectedDepositTime:t.form.arriveTime+":00",expectedTakeTime:t.form.pickupTime+":00",goodType:t.form.goodType,goodsImages:t.form.goodsImages,items:i,remark:t.form.remark,takePhone:t.form.mobile,takeUser:t.form.receiver,type:"local"===t.activeMode?0:1,isUrgent:t.isUrgent},"local"===t.activeMode?a.depositShopId=t.selectedStore.id:(a.depositShopId=t.sendStore.id,a.fromShopId=t.sendStore.id,t.receiveStore?(a.toType=0,a.takeShopId=t.receiveStore.id,a.takeLat=t.receiveStore.latitude,a.takeLgt=t.receiveStore.longitude,a.takeLocation=t.receiveStore.address):t.receiveAddr&&(a.toType=1,a.toAddrId=t.receiveAddr.id,a.takeLat=t.receiveAddr.latitude,a.takeLgt=t.receiveAddr.longitude,a.takeLocation=t.receiveAddr.addr)),r.next=33,t.$u.api.createOrder(a);case 33:c=r.sent,200===c.code&&c.data&&t.processPayment(c.data.response,c.data.orderId);case 35:case"end":return r.stop()}}),r)})))()},processPayment:function(t,r){e.requestPayment({provider:"wxpay",timeStamp:t.timeStamp||"",nonceStr:t.nonceStr||"",package:t.package||"",signType:t.signType||"MD5",paySign:t.paySign||"",success:function(t){e.navigateTo({url:"/pages/payment-success/payment-success?orderId="+r})},fail:function(t){t.errMsg.includes("cancel")?e.showToast({title:"已取消支付",icon:"none"}):e.showToast({title:"支付失败",icon:"none"})}})}}};t.default=l}).call(this,r(2)["default"])},213:function(e,t,r){"use strict";r.r(t);var n=r(214),o=r.n(n);for(var i in n)["default"].indexOf(i)<0&&function(e){r.d(t,e,(function(){return n[e]}))}(i);t["default"]=o.a},214:function(e,t,r){}},[[207,"common/runtime","common/vendor"]]]);
(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/luggage-storage/luggage-storage"],{215:function(e,t,r){"use strict";(function(e,t){var n=r(4);r(30);n(r(25));var o=n(r(216));e.__webpack_require_UNI_MP_PLUGIN__=r,t(o.default)}).call(this,r(1)["default"],r(2)["createPage"])},216:function(e,t,r){"use strict";r.r(t);var n=r(217),o=r(219);for(var i in o)["default"].indexOf(i)<0&&function(e){r.d(t,e,(function(){return o[e]}))}(i);r(221);var a,c=r(41),u=Object(c["default"])(o["default"],n["render"],n["staticRenderFns"],!1,null,"c13e4c60",null,!1,n["components"],a);u.options.__file="pages/luggage-storage/luggage-storage.vue",t["default"]=u.exports},217:function(e,t,r){"use strict";r.r(t);var n=r(218);r.d(t,"render",(function(){return n["render"]})),r.d(t,"staticRenderFns",(function(){return n["staticRenderFns"]})),r.d(t,"recyclableRender",(function(){return n["recyclableRender"]})),r.d(t,"components",(function(){return n["components"]}))},218:function(e,t,r){"use strict";var n;r.r(t),r.d(t,"render",(function(){return o})),r.d(t,"staticRenderFns",(function(){return a})),r.d(t,"recyclableRender",(function(){return i})),r.d(t,"components",(function(){return n}));try{n={uIcon:function(){return Promise.all([r.e("common/vendor"),r.e("node-modules/uview-ui/components/u-icon/u-icon")]).then(r.bind(null,423))},uDatetimePicker:function(){return Promise.all([r.e("common/vendor"),r.e("node-modules/uview-ui/components/u-datetime-picker/u-datetime-picker")]).then(r.bind(null,447))},uPopup:function(){return Promise.all([r.e("common/vendor"),r.e("node-modules/uview-ui/components/u-popup/u-popup")]).then(r.bind(null,439))},uActionSheet:function(){return Promise.all([r.e("common/vendor"),r.e("node-modules/uview-ui/components/u-action-sheet/u-action-sheet")]).then(r.bind(null,456))}}}catch(c){if(-1===c.message.indexOf("Cannot find module")||-1===c.message.indexOf(".vue"))throw c;console.error(c.message),console.error("1. 排查组件名称拼写是否正确"),console.error("2. 排查组件是否符合 easycom 规范,文档:https://uniapp.dcloud.net.cn/collocation/pages?id=easycom"),console.error("3. 若组件不符合 easycom 规范,需手动引入,并在 components 中注册该组件")}var o=function(){var e=this,t=e.$createElement;e._self._c;e._isMounted||(e.e0=function(t){e.showArriveTimePicker=!0},e.e1=function(t){e.showPickupTimePicker=!0},e.e2=function(t){e.showArriveTimePicker=!1},e.e3=function(t){e.showArriveTimePicker=!1},e.e4=function(t){e.showPickupTimePicker=!1},e.e5=function(t){e.showPickupTimePicker=!1},e.e6=function(t){e.showGoodsPopup=!0},e.e7=function(t,r){var n=arguments[arguments.length-1].currentTarget.dataset,o=n.eventParams||n["event-params"];r=o.item;e.isUrgent=r.id},e.e8=function(t){e.showStorePopup=!1},e.e9=function(t){e.showStorePopup=!1},e.e10=function(t,r){var n=arguments[arguments.length-1].currentTarget.dataset,o=n.eventParams||n["event-params"];r=o.index;e.storeList.forEach((function(e,t){return e.active=r===t}))},e.e11=function(t){e.showGoodsPopup=!1},e.e12=function(t){e.showGoodsPopup=!1},e.e13=function(t,r){var n=arguments[arguments.length-1].currentTarget.dataset,o=n.eventParams||n["event-params"];r=o.index;e.goodsOptions.forEach((function(e,t){return e.active=t===r}))},e.e14=function(t){e.showAmountPopup=!1},e.e15=function(t){e.showAmountPopup=!1},e.e16=function(t){e.showAmountPopup=!1},e.e17=function(t){e.showReceiveAddress=!1})},i=!1,a=[];o._withStripped=!0},219:function(e,t,r){"use strict";r.r(t);var n=r(220),o=r.n(n);for(var i in n)["default"].indexOf(i)<0&&function(e){r.d(t,e,(function(){return n[e]}))}(i);t["default"]=o.a},220:function(e,t,r){"use strict";(function(e){var n=r(4);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r(34)),i=n(r(18)),a=n(r(36)),c=n(r(11)),u=r(37);function s(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function d(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?s(Object(r),!0).forEach((function(t){(0,c.default)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):s(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var l={data:function(){return{showStorePopup:!1,showGoodsPopup:!1,showAmountPopup:!1,showArriveTimePicker:!1,showPickupTimePicker:!1,arriveTimeValue:Number(new Date),pickupTimeValue:Number(new Date),activeMode:"local",modeTabs:[{label:"就地寄存",value:"local"},{label:"同城寄送",value:"city"}],agreementChecked:!0,tempSelectedStoreId:2,selectedStoreId:2,tempSelectedGoodsIds:[1],selectedGoodsIds:[1],selectedLuggageId:1,isUrgent:0,form:{receiver:"",mobile:"",arriveTime:"",pickupTime:"",goodType:"",goodTypeName:"",insurance:"",remark:"",goodsImages:[]},amountData:null,luggageTypes:[],serviceTimes:[],storeList:[],selectedStore:null,sendStore:null,receiveStore:null,receiveAddr:null,storePopupType:"send",storeForm:{keyword:"",page:1,isSearch:!0},goodsOptions:[],uploadedImages:[],showReceiveAddress:!1,actions:[{name:"选择服务点"},{name:"选择地址簿"}]}},watch:{"form.insurance":{handler:function(){this.calculateLocalPrice()}},isUrgent:{handler:function(){"city"===this.activeMode&&this.calculateRemotePrice()}}},computed:d(d({},(0,u.mapState)(["latitude","longitude","cityId"])),{},{servicePointPlaceholder:function(){return"city"===this.activeMode?"选择寄送服务点":"选择寄存服务点"},selectedGoodsText:function(){var e=this;if(!this.selectedGoodsIds.length)return"必选,请选择";var t=this.goodsOptions.filter((function(t){return e.selectedGoodsIds.includes(t.id)})).map((function(e){return e.name}));return t.join("、")},totalPriceText:function(){return"¥150.00"}}),onLoad:function(){var t=this;this.getNearbyShopList(),this.getCategoryList(),this.getCitySizeList(),e.$on("updateAddress",(function(e){console.log(e),t.receiveAddr=e}))},methods:{caozuo:function(t){var r=this;"选择服务点"===t.name?(r.storePopupType="receive",r.receiveStore=null,r.showStorePopup=!0):"选择地址簿"===t.name&&(r.receiveAddr=null,e.navigateTo({url:"/pages/address/address?type=1"})),r.showReceiveAddress=!1},uploadFiles:function(t){var r=arguments,n=this;return(0,a.default)(o.default.mark((function i(){var a,c,u,s;return o.default.wrap((function(o){while(1)switch(o.prev=o.next){case 0:if(a=r.length>1&&void 0!==r[1]?r[1]:9,t&&0!==t.length){o.next=3;break}return o.abrupt("return",[]);case 3:return c=t.slice(0,a),u=c.map((function(t){return new Promise((function(r,o){e.uploadFile({url:n.$baseUrl+"/web/public/upload",filePath:t,name:"file",formData:{folder:"orders"},success:function(e){if(200===e.statusCode){var t=JSON.parse(e.data);200===t.code?r(t.data):o(new Error(t.msg||"上传失败"))}else o(new Error("上传失败"))},fail:function(e){o(e)}})}))})),o.prev=5,o.next=8,Promise.all(u);case 8:return s=o.sent,o.abrupt("return",s);case 12:throw o.prev=12,o.t0=o["catch"](5),e.showToast({title:"上传失败",icon:"none"}),o.t0;case 16:case"end":return o.stop()}}),i,null,[[5,12]])})))()},deleteImage:function(e){this.uploadedImages.splice(e,1),this.form.goodsImages.splice(e,1)},chooseAndUploadImage:function(){var t=arguments,r=this;return(0,a.default)(o.default.mark((function n(){var c,u,s;return o.default.wrap((function(n){while(1)switch(n.prev=n.next){case 0:if(c=t.length>0&&void 0!==t[0]?t[0]:9,u=r.form.goodsImages.length,s=c-u,!(s<=0)){n.next=6;break}return e.showToast({title:"最多上传".concat(c,"张图片"),icon:"none"}),n.abrupt("return");case 6:e.chooseImage({count:s,sizeType:["compressed"],sourceType:["album","camera"],success:function(){var t=(0,a.default)(o.default.mark((function t(n){var a,u,s,d;return o.default.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return a=n.tempFilePaths,e.showLoading({title:"上传中...",mask:!0}),t.prev=2,t.next=5,r.uploadFiles(a,c);case 5:u=t.sent,s=u.map((function(e){return e.imgaddr})),d=u.map((function(e){return e.url||e.path||e})),r.uploadedImages=[].concat((0,i.default)(r.uploadedImages),(0,i.default)(d.map((function(e){return{url:e}})))),r.form.goodsImages=[].concat((0,i.default)(r.form.goodsImages),(0,i.default)(s)),e.hideLoading(),e.showToast({title:"上传成功",icon:"success"}),t.next=17;break;case 14:t.prev=14,t.t0=t["catch"](2),e.hideLoading();case 17:case"end":return t.stop()}}),t,null,[[2,14]])})));function n(e){return t.apply(this,arguments)}return n}()});case 7:case"end":return n.stop()}}),n)})))()},searchStore:function(){this.storeList=[],this.storeForm.page=1,this.storeForm.isSearch=!0,this.getNearbyShopList()},switchMode:function(e){this.activeMode=e,this.selectedStore=null,this.sendStore=null,this.receiveStore=null,this.receiveAddr=null,this.form.receiver="",this.form.mobile="",this.form.arriveTime="",this.form.pickupTime="",this.form.goodType="",this.form.goodTypeName="",this.form.insurance="",this.form.remark="",this.form.goodsImages=[],this.amountData=null,this.uploadedImages=[],this.luggageTypes.forEach((function(e){e.count=0}))},toggleAgreement:function(){this.agreementChecked=!this.agreementChecked},goRichText:function(t){e.navigateTo({url:"/pages/rich-text/rich-text?type="+t})},openReceiveAddress:function(){this.showReceiveAddress=!0},openAmountPopup:function(){this.showAmountPopup=!0},openStorePopup:function(){this.storePopupType="send",this.tempSelectedStoreId=null,this.showStorePopup=!0},openStorePopup0:function(){this.storePopupType="send0",this.tempSelectedStoreId=null,this.showStorePopup=!0},confirmStore:function(){console.log("=========================");var e=this.storeList.find((function(e){return e.active}));console.log(e),"send"===this.storePopupType?this.sendStore=e:"receive"===this.storePopupType?(this.receiveStore=e,this.receiveAddr=null,this.calculateRemotePrice()):(this.selectedStore=e,this.calculateLocalPrice()),this.showStorePopup=!1},confirmGoods:function(){var t,r;this.goodsOptions.find((function(e){return e.active}))?(this.form.goodTypeName=(null===(t=this.goodsOptions.find((function(e){return e.active})))||void 0===t?void 0:t.name)||"",this.form.goodType=(null===(r=this.goodsOptions.find((function(e){return e.active})))||void 0===r?void 0:r.id)||"",this.showGoodsPopup=!1):e.showToast({title:"请选择物品信息",icon:"none"})},confirmArriveTime:function(e){var t=new Date(e.value),r=t.getFullYear(),n=String(t.getMonth()+1).padStart(2,"0"),o=String(t.getDate()).padStart(2,"0"),i=String(t.getHours()).padStart(2,"0"),a=String(t.getMinutes()).padStart(2,"0");this.form.arriveTime="".concat(r,"-").concat(n,"-").concat(o," ").concat(i,":").concat(a),this.showArriveTimePicker=!1,this.calculateLocalPrice()},confirmPickupTime:function(t){var r=new Date(t.value),n=r.getFullYear(),o=String(r.getMonth()+1).padStart(2,"0"),i=String(r.getDate()).padStart(2,"0"),a=String(r.getHours()).padStart(2,"0"),c=String(r.getMinutes()).padStart(2,"0"),u="".concat(n,"-").concat(o,"-").concat(i," ").concat(a,":").concat(c);this.form.arriveTime&&new Date(u)<=new Date(this.form.arriveTime)?e.showToast({title:"预计取件时间必须大于预计到店时间",icon:"none"}):(this.form.pickupTime=u,this.showPickupTimePicker=!1,this.calculateLocalPrice())},getCategoryList:function(){var e=this;return(0,a.default)(o.default.mark((function t(){var r;return o.default.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,e.$u.api.getCategoryList({type:2});case 2:r=t.sent,200===r.code&&(r.data.forEach((function(e){e.active=!1})),e.goodsOptions=r.data||[]);case 4:case"end":return t.stop()}}),t)})))()},getCitySizeList:function(){var e=this;return(0,a.default)(o.default.mark((function t(){var r;return o.default.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,e.$u.api.getCitySizeList({cityId:e.cityId});case 2:r=t.sent,200===r.code&&(r.data.forEach((function(e){e.count=0})),e.luggageTypes=r.data||[]);case 4:case"end":return t.stop()}}),t)})))()},getNearbyShopList:function(){var e=this;return(0,a.default)(o.default.mark((function t(){var r;return o.default.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(e.storeForm.isSearch){t.next=2;break}return t.abrupt("return");case 2:return t.next=4,e.$u.api.getNearbyShopList({capacity:10,page:e.storeForm.page,model:{latitude:e.latitude,longitude:e.longitude,cityId:e.cityId,sortType:1}});case 4:r=t.sent,200===r.code&&(r.data.records.forEach((function(e){e.active=!1})),e.storeList=[].concat((0,i.default)(e.storeList),(0,i.default)(r.data.records||[])),e.storeForm.page++,e.storeForm.isSearch=e.storeList.length<=r.data.total);case 6:case"end":return t.stop()}}),t)})))()},increaseCount:function(e){this.luggageTypes[e].count++,this.calculateLocalPrice()},decreaseCount:function(e){this.luggageTypes[e].count>0&&this.luggageTypes[e].count--,this.calculateLocalPrice()},calculateLocalPrice:function(){var e=this;return(0,a.default)(o.default.mark((function t(){return o.default.wrap((function(t){while(1)switch(t.prev=t.next){case 0:"city"===e.activeMode?e.calculateRemotePrice():e.calculateLocalPriceOnly();case 1:case"end":return t.stop()}}),t)})))()},calculateLocalPriceOnly:function(){var e=this;return(0,a.default)(o.default.mark((function t(){var r,n;return o.default.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(e.selectedStore&&e.form.arriveTime&&e.form.pickupTime){t.next=2;break}return t.abrupt("return");case 2:if(r=e.luggageTypes.filter((function(e){return e.count>0})).map((function(e){return{categoryId:e.id,quantity:e.count}})),0!==r.length){t.next=5;break}return t.abrupt("return");case 5:return t.next=7,e.$u.api.calculateLocalPrice({cityId:e.cityId,shopId:e.selectedStore.id,depositStartTime:e.form.arriveTime+":00",depositEndTime:e.form.pickupTime+":00",items:r,declaredAmount:e.form.insurance||0});case 7:n=t.sent,200===n.code&&(n.data.itemList.forEach((function(e){e.unitPrice=e.unitPrice/100})),n.data.totalPrice=n.data.totalPrice/100,n.data.insuranceFee=n.data.insuranceFee/100,e.amountData=n.data);case 9:case"end":return t.stop()}}),t)})))()},calculateRemotePrice:function(){var e=this;return(0,a.default)(o.default.mark((function t(){var r,n,i,a,c,u;return o.default.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(e.sendStore&&e.form.arriveTime&&e.form.pickupTime){t.next=2;break}return t.abrupt("return");case 2:if(e.receiveStore||e.receiveAddr){t.next=4;break}return t.abrupt("return");case 4:if(r=e.luggageTypes.filter((function(e){return e.count>0})).map((function(e){return{categoryId:e.id,quantity:e.count}})),0!==r.length){t.next=7;break}return t.abrupt("return");case 7:return n="",i="",a="",c="",e.sendStore&&(n=e.sendStore.latitude,i=e.sendStore.longitude),e.receiveStore?(a=e.receiveStore.latitude,c=e.receiveStore.longitude):e.receiveAddr&&(a=e.receiveAddr.latitude,c=e.receiveAddr.longitude),t.next=15,e.$u.api.calculateRemotePrice({cityId:e.cityId,fromLat:n,fromLgt:i,toLat:a,toLgt:c,urgent:e.isUrgent,depositStartTime:e.form.arriveTime+":00",depositEndTime:e.form.pickupTime+":00",items:r,declaredAmount:e.form.insurance||0});case 15:u=t.sent,200===u.code&&(u.data.itemList.forEach((function(e){e.unitPrice=e.unitPrice/100})),u.data.totalPrice=u.data.totalPrice/100,u.data.insuranceFee=u.data.insuranceFee/100,e.serviceTimes=[{id:0,name:"标准达",serviceTime:u.data.standardHours,price:u.data.itemPrice/100},{id:1,name:"急速达",serviceTime:u.data.urgentHours,price:(u.data.urgentFee+u.data.itemPrice)/100}],e.amountData=u.data);case 17:case"end":return t.stop()}}),t)})))()},createOrder:function(){var t=this;return(0,a.default)(o.default.mark((function r(){var n,i,a,c;return o.default.wrap((function(r){while(1)switch(r.prev=r.next){case 0:if(t.agreementChecked){r.next=3;break}return e.showToast({title:"请先阅读并同意用户服务协议及隐私政策",icon:"none"}),r.abrupt("return");case 3:if("local"!==t.activeMode){r.next=9;break}if(t.selectedStore){r.next=7;break}return e.showToast({title:"请选择门店",icon:"none"}),r.abrupt("return");case 7:r.next=15;break;case 9:if(t.sendStore){r.next=12;break}return e.showToast({title:"请选择寄件服务点",icon:"none"}),r.abrupt("return");case 12:if(t.receiveStore||t.receiveAddr){r.next=15;break}return e.showToast({title:"请选择取件地址",icon:"none"}),r.abrupt("return");case 15:if(t.form.arriveTime){r.next=18;break}return e.showToast({title:"请选择预计到店时间",icon:"none"}),r.abrupt("return");case 18:if(t.form.pickupTime){r.next=21;break}return e.showToast({title:"请选择预计取件时间",icon:"none"}),r.abrupt("return");case 21:if(!(new Date(t.form.pickupTime)<=new Date(t.form.arriveTime))){r.next=24;break}return e.showToast({title:"预计取件时间必须大于预计到店时间",icon:"none"}),r.abrupt("return");case 24:if(n=t.luggageTypes.filter((function(e){return e.count>0})).map((function(e){return{categoryId:e.id,quantity:e.count}})),0!==n.length){r.next=28;break}return e.showToast({title:"请选择行李类型",icon:"none"}),r.abrupt("return");case 28:return i=n.map((function(e){return{categoryId:e.categoryId,quantity:e.quantity}})),a={cityId:t.cityId,declaredAmount:t.form.insurance||0,expectedDepositTime:t.form.arriveTime+":00",expectedTakeTime:t.form.pickupTime+":00",goodType:t.form.goodType,goodsImages:t.form.goodsImages,items:i,remark:t.form.remark,takePhone:t.form.mobile,takeUser:t.form.receiver,type:"local"===t.activeMode?0:1,isUrgent:t.isUrgent},"local"===t.activeMode?a.depositShopId=t.selectedStore.id:(a.depositShopId=t.sendStore.id,a.fromShopId=t.sendStore.id,t.receiveStore?(a.toType=0,a.takeShopId=t.receiveStore.id,a.takeLat=t.receiveStore.latitude,a.takeLgt=t.receiveStore.longitude,a.takeLocation=t.receiveStore.address):t.receiveAddr&&(a.toType=1,a.toAddrId=t.receiveAddr.id,a.takeLat=t.receiveAddr.latitude,a.takeLgt=t.receiveAddr.longitude,a.takeLocation=t.receiveAddr.addr)),r.next=33,t.$u.api.createOrder(a);case 33:c=r.sent,200===c.code&&c.data&&t.processPayment(c.data.response,c.data.orderId);case 35:case"end":return r.stop()}}),r)})))()},processPayment:function(t,r){e.requestPayment({provider:"wxpay",timeStamp:t.timeStamp||"",nonceStr:t.nonceStr||"",package:t.package||"",signType:t.signType||"MD5",paySign:t.paySign||"",success:function(t){e.navigateTo({url:"/pages/payment-success/payment-success?orderId="+r})},fail:function(t){t.errMsg.includes("cancel")?e.showToast({title:"已取消支付",icon:"none"}):e.showToast({title:"支付失败",icon:"none"})}})}}};t.default=l}).call(this,r(2)["default"])},221:function(e,t,r){"use strict";r.r(t);var n=r(222),o=r.n(n);for(var i in n)["default"].indexOf(i)<0&&function(e){r.d(t,e,(function(){return n[e]}))}(i);t["default"]=o.a},222:function(e,t,r){}},[[215,"common/runtime","common/vendor"]]]);
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/luggage-storage/luggage-storage.js.map