confirmCreateOrder.js 7.0 KB

12
  1. (global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/shopping/confirmCreateOrder"],{387:function(e,t,n){"use strict";(function(e,t){var r=n(4);n(26);r(n(25));var o=r(n(388));e.__webpack_require_UNI_MP_PLUGIN__=n,t(o.default)}).call(this,n(1)["default"],n(2)["createPage"])},388:function(e,t,n){"use strict";n.r(t);var r=n(389),o=n(391);for(var s in o)["default"].indexOf(s)<0&&function(e){n.d(t,e,(function(){return o[e]}))}(s);n(393),n(395);var i,c=n(34),d=Object(c["default"])(o["default"],r["render"],r["staticRenderFns"],!1,null,"3933c270",null,!1,r["components"],i);d.options.__file="pages/shopping/confirmCreateOrder.vue",t["default"]=d.exports},389:function(e,t,n){"use strict";n.r(t);var r=n(390);n.d(t,"render",(function(){return r["render"]})),n.d(t,"staticRenderFns",(function(){return r["staticRenderFns"]})),n.d(t,"recyclableRender",(function(){return r["recyclableRender"]})),n.d(t,"components",(function(){return r["components"]}))},390:function(e,t,n){"use strict";var r;n.r(t),n.d(t,"render",(function(){return o})),n.d(t,"staticRenderFns",(function(){return i})),n.d(t,"recyclableRender",(function(){return s})),n.d(t,"components",(function(){return r}));try{r={evanSwitch:function(){return n.e("components/evan-switch/evan-switch").then(n.bind(null,1060))}}}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,n=(e._self._c,null!=e.address&&null!=e.address.phone?e.utils.parsePhone(e.address.phone):null),r=e.__map(e.carts,(function(t,n){var r=e.__get_orig(t),o=e.utils.getDictLabelName("storeProductType",t.productType),s=t.price.toFixed(2);return{$orig:r,g1:o,g2:s}})),o=e.price.totalPrice.toFixed(2),s=null!=e.address&&null!=e.price.payPostage&&0!=e.price.payPostage?e.price.payPostage.toFixed(2):null,i=e.price.serviceFee.toFixed(2),c=e.price.payPrice.toFixed(2),d=e.couponsList.length,a=e.couponsList.length;e.$mp.data=Object.assign({},{$root:{g0:n,l0:r,g3:o,g4:s,g5:i,g6:c,g7:d,g8:a}})},s=!1,i=[];o._withStripped=!0},391:function(e,t,n){"use strict";n.r(t);var r=n(392),o=n.n(r);for(var s in r)["default"].indexOf(s)<0&&function(e){n.d(t,e,(function(){return r[e]}))}(s);t["default"]=o.a},392:function(e,t,n){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=n(197),o=n(273),s=n(314),i=function(){n.e("components/evan-switch/evan-switch").then(function(){return resolve(n(1060))}.bind(null,n)).catch(n.oe)},c=function(){Promise.all([n.e("common/vendor"),n.e("components/px-popup-bottom/px-popup-bottom")]).then(function(){return resolve(n(1052))}.bind(null,n)).catch(n.oe)},d={components:{EvanSwitch:i,popupBottom:c},data:function(){return{temps:[],couponUserId:null,couponText:"请选择",couponsList:[],couponVisible:!1,price:{payPrice:0,totalPostage:0,usedIntegral:0,totalPrice:0},address:null,carts:[],checked:!1,type:null,cartIds:null,form:{useIntegral:0,orderKey:null,addressId:null,mark:null,companyId:null,companyUserId:null,createOrderKey:null}}},onLoad:function(t){var n=this;this.form.createOrderKey=t.createOrderKey,this.form.companyId=t.companyId,this.form.companyUserId=t.companyUserId,this.cartIds=t.cartIds,this.type=t.type,this.confirm(),e.$on("updateAddress",(function(e){n.address=e,n.form.addressId=e.id})),this.getWeixinOrderTemps()},methods:{getWeixinOrderTemps:function(){var e=this;(0,r.getWeixinOrderTemps)().then((function(t){200==t.code&&(e.temps=t.temp,console.log(e.temps))}),(function(e){}))},couponSelect:function(e){this.couponText="-¥"+e.couponPrice.toFixed(2),this.couponUserId=e.id,this.couponVisible=!1,this.computed()},openCoupon:function(){var e=this,t=this,n={couponType:2,useMinPrice:this.price.payPrice};(0,s.getMyEnableCouponList)(n).then((function(n){e.couponVisible=!0,t.couponsList=n.data}))},integralChange:function(e){console.log(e),this.form.useIntegral=e?1:0,this.computed()},confirm:function(t){var n=this,r={type:this.type,cartIds:this.cartIds};(0,o.confirm)(r).then((function(t){200==t.code?(n.carts=t.carts,n.form.orderKey=t.orderKey,null!=t.address&&(n.form.addressId=t.address.id,n.address=t.address,console.log(n.form.addreddId)),n.computed()):e.showToast({icon:"none",title:t.msg})}),(function(e){}))},computed:function(t){var n=this,r={companyUserId:this.form.companyUserId,createOrderKey:this.form.createOrderKey,couponUserId:this.couponUserId,orderKey:this.form.orderKey,addressId:this.form.addressId,useIntegral:this.form.useIntegral};(0,o.computed)(r).then((function(t){if(200==t.code)console.log(t),n.price=t.data;else{if(501==t.code)return e.showToast({icon:"none",title:t.msg}),void setTimeout((function(){e.navigateBack({delta:1})}),500);e.showToast({icon:"none",title:t.msg})}}),(function(e){}))},submitOrder:function(){var t=this;null!=this.form.orderKey?null!=this.form.addressId?e.requestSubscribeMessage({tmplIds:this.temps,success:function(e){t.createOrder()},fail:function(e){t.createOrder()}}):e.showToast({icon:"none",title:"收货地址不能为空"}):e.showToast({icon:"none",title:"订单KEY不存在"})},createOrder:function(){var t=null,n=e.getStorageSync("tuiUserId");e.showLoading({title:"正在处理中..."}),t=null!=n&&void 0!=n&&n>0?{createOrderKey:this.form.createOrderKey,orderCreateType:3,tuiUserId:n,companyId:this.form.companyId,companyUserId:this.form.companyUserId,couponUserId:this.couponUserId,mark:this.form.mark,orderKey:this.form.orderKey,addressId:this.form.addressId,useIntegral:this.form.useIntegral,payType:1}:{createOrderKey:this.form.createOrderKey,orderCreateType:3,companyId:this.form.companyId,companyUserId:this.form.companyUserId,couponUserId:this.couponUserId,mark:this.form.mark,orderKey:this.form.orderKey,addressId:this.form.addressId,useIntegral:this.form.useIntegral,payType:1},(0,o.create)(t).then((function(t){return e.hideLoading(),200==t.code?(e.hideLoading(),void(1==t.order.isPrescribe?setTimeout((function(){e.redirectTo({url:"prescribe?orderId="+t.order.id})}),200):setTimeout((function(){e.redirectTo({url:"./paymentOrder?orderId="+t.order.id})}),200))):501==t.code?(e.showToast({icon:"none",title:t.msg}),void setTimeout((function(){e.navigateBack({delta:1})}),200)):void e.showToast({icon:"none",title:t.msg})}),(function(e){}))},openAddress:function(){e.navigateTo({url:"/pages_user/user/address"})}}};t.default=d}).call(this,n(2)["default"])},393:function(e,t,n){"use strict";n.r(t);var r=n(394),o=n.n(r);for(var s in r)["default"].indexOf(s)<0&&function(e){n.d(t,e,(function(){return r[e]}))}(s);t["default"]=o.a},394:function(e,t,n){},395:function(e,t,n){"use strict";n.r(t);var r=n(396),o=n.n(r);for(var s in r)["default"].indexOf(s)<0&&function(e){n.d(t,e,(function(){return r[e]}))}(s);t["default"]=o.a},396:function(e,t,n){}},[[387,"common/runtime","common/vendor"]]]);
  2. //# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/shopping/confirmCreateOrder.js.map