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.
shop-app/h5/static/js/pages-order-submit.43c3f1e5.js

1 line
23 KiB

3 years ago
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["pages-order-submit"],{"227e":function(t,e,a){"use strict";var r=a("4ea4");a("7db0"),a("d81d"),a("ac1f"),a("5319"),a("1276"),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,a("96cf");var n=r(a("1da1")),i=r(a("f196")),s=a("c0d4"),o=r(a("359f")),c=r(a("5a25")),d={components:{UiCell:i.default,UiButton:o.default,UiWhiteBox:c.default},data:function(){return{address:{},userMessage:"",orderInfo:{},payType:"wxpay"}},onLoad:function(){var t=this;uni.$on("changeAddress",(function(e,a){"submitOrder"==a&&(t.address=e)})),this.address=this.$store.state.address.find((function(t){return t.isDefault}))||{}},onShow:function(){this.getBeforeOrder()},methods:{getBeforeOrder:function(t){var e=this;return(0,n.default)(regeneratorRuntime.mark((function a(){var r,n;return regeneratorRuntime.wrap((function(a){while(1)switch(a.prev=a.next){case 0:if(r=e.$Route.query,n={},"cart"!==r.mode){a.next=6;break}return a.next=5,(0,s.ApiGetBeforeCartOrder)({cartIds:r.ids,recipientAddressId:t});case 5:n=a.sent;case 6:if("buyNow"!==r.mode){a.next=10;break}return a.next=9,(0,s.ApiGetBeforeOrder)({productSkuId:r.skuId,quantity:r.num,activityId:r.activityId,activityTimeId:r.activityTimeId,activityType:r.activityType,recipientAddressId:t});case 9:n=a.sent;case 10:if(!n.error){a.next=13;break}return uni.$u.toast(n.error.message),a.abrupt("return",!1);case 13:e.orderInfo=n.result;case 14:case"end":return a.stop()}}),a)})))()},selectAddress:function(){var t=this.address.id,e=t?"&id=".concat(t):"&status=created";this.$Router.push("/addressList?source=submitOrder".concat(e))},submit:function(){var t=this;return(0,n.default)(regeneratorRuntime.mark((function e(){var a,r,n,i;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(a=t.$Route.query,t.address.id){e.next=4;break}return uni.$u.toast("请选择收货地址"),e.abrupt("return",!1);case 4:return e.next=6,(0,s.ApiPostSubmitOrder)({orderSource:2,recipientAddressId:t.address.id,shoppingCartIds:a.ids?a.ids.split(","):[],products:t.orderInfo.products.map((function(t){return{activityId:a.activityId,activityTimeId:a.activityTimeId,productId:t.productId,productSkuId:t.productSkuId,quantity:t.quantity,activityType:a.activityType}})),userMessage:t.userMessage});case 6:if(r=e.sent,n=r.error,i=r.result,!n){e.next=12;break}return uni.$u.toast(n.message),e.abrupt("return",!1);case 12:t.wxpay(i.orderId);case 13:case"end":return e.stop()}}),e)})))()},wxpay:function(t){var e=this;this.$msb.confirm({content:"您确定要支付吗?",cancelText:"暂不支付",confirmText:"立即支付",confirm:function(){var a=(0,n.default)(regeneratorRuntime.mark((function a(){var r,n;return regeneratorRuntime.wrap((function(a){while(1)switch(a.prev=a.next){case 0:return a.next=2,(0,s.ApiPostWxPay)({orderId:t,payTypeEnum:"WXPAY"});case 2:r=a.sent,n=r.error,r.result,n?e.$Router.replace("/payFail?ordId=".concat(t)):e.$Router.replace("/paySuccess?ordId=".concat(t));case 6:case"end":return a.stop()}}),a)})));function r(){return a.apply(this,arguments)}return r}(),cancel:function(){e.$Router.replace("/orderDetail?id=".concat(t))}})}}};e.default=d},"24e3":function(t,e,a){"use strict";var r;a.d(e,"b",(function(){return n})),a.d(e,"c",(function(){return i})),a.d(e,"a",(function(){return r}));var n=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("v-uni-view",{staticClass:"ui-cell",on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.$emit("click")}}},[t._t("icon"),r("v-uni-view",{staticClass:"ui-cell--left"},[r("v-uni-text",{staticClass:"ui-cell--title"},[t._v(t._s(t.title))]),t.label?r("v-uni-text",{staticClass:"ui-cell--label"},[t._v(t._s(t.label))]):t._e()],1),t._t("value",[r("v-uni-text",{staticClass:"ui-cell--value"},[t._v(t._s(t.value))])]),t.rightIcon?t._t("right-icon",[r("v-uni-image",{staticClass:"ui-cell--rightIcon",attrs:{src:a("6eb6")}})]):t._e()],2)},i=[]},2702:function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r={props:{type:{type:String,default:"line"},size:{type:S