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.00d0b707.js

1 line
37 KiB

3 years ago
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["pages-order-submit"],{"141c":function(e,t,i){var n=i("24fb");t=n(!1),t.push([e.i,'@charset "UTF-8";\n/**\n * 这里是uni-app内置的常用样式变量\n *\n * uni-app 官方扩展插件及插件市场https://ext.dcloud.net.cn上很多三方插件均使用了这些样式变量\n * 如果你是插件开发者建议你使用scss预处理并在插件代码中直接使用这些变量无需 import 这个文件方便用户通过搭积木的方式开发整体风格一致的App\n *\n */\n/**\n * 如果你是App开发者插件使用者你可以通过修改这些变量来定制自己的插件主题实现自定义主题功能\n *\n * 如果你的项目同样使用了scss预处理你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件\n */\n/* 颜色变量 */\n/* 行为相关颜色 */\n/* 文字基本颜色 */\n/* 背景颜色 */\n/* 边框颜色 */\n/* 透明度 */\n/* 尺寸变量 */\n/* 文字尺寸 */\n/* 间距 */\n/* 图片尺寸 */\n/* Border Radius */\n/* 水平间距 */\n/* 垂直间距 */.ui-btn[data-v-12637c88]{display:inline-block;padding:0 %?50?%;border-radius:%?50?%}.ui-btn__normal[data-v-12637c88]{height:%?70?%;line-height:%?70?%;font-size:%?28?%}.ui-btn__min[data-v-12637c88]{height:%?50?%;line-height:%?50?%;font-size:%?28?%}.ui-btn__max[data-v-12637c88]{width:%?690?%;height:%?80?%;line-height:%?80?%;font-size:%?32?%}.ui-btn__gradual[data-v-12637c88]{background:linear-gradient(270deg,#ff7f39,#ffa35b);color:#fff}.ui-btn__solid[data-v-12637c88]{background:#ff875b;color:#fff}.ui-btn__line[data-v-12637c88]{background:none;color:#333;border:1px solid #c0b9b9}.ui-btn__primaryLine[data-v-12637c88]{background:none;color:#ff875b;border:1px solid #ff875b}.ui-btn__disabed[data-v-12637c88]{opacity:.8}',""]),e.exports=t},"1d2d":function(e,t,i){"use strict";var n=i("a537"),o=i.n(n);o.a},"227e":function(e,t,i){"use strict";var n=i("4ea4");i("7db0"),i("d81d"),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,i("96cf");var o=n(i("1da1")),r=n(i("f196")),a=i("c0d4"),c=n(i("359f")),u={components:{UiCell:r.default,UiButton:c.default},data:function(){return{address:{},userMessage:"",orderInfo:{}}},onLoad:function(){var e=this;this.getBeforeOrder(),uni.$on("changeAddress",(function(t,i){"submitOrder"==i&&(e.address=t)})),this.address=this.$store.state.address.find((function(e){return e.isDefault}))},methods:{getBeforeOrder:function(){var e=this;return(0,o.default)(regeneratorRuntime.mark((function t(){var i,n;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(i=e.$Route.query,n={},"cart"!==i.mode){t.next=6;break}return t.next=5,(0,a.ApiGetBeforeCartOrder)({cartIds:i.ids});case 5:n=t.sent;case 6:if("buyNow"!==i.mode){t.next=10;break}return t.next=9,(0,a.ApiGetBeforeOrder)({productSkuId:i.skuId,quantity:i.num});case 9:n=t.sent;case 10:if(!n.error){t.next=13;break}return uni.$u.toast(n.error.message),t.abrupt("return",!1);case 13:e.orderInfo=n.result;case 14:case"end":return t.stop()}}),t)})))()},submit:function(){var e=this;return(0,o.default)(regeneratorRuntime.mark((function t(){var i,n,o;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,(0,a.ApiPostSubmitOrder)({orderSource:2,recipientAddressId:e.address.id,products:e.orderInfo.products.map((function(e){return{productId:e.productId,productSkuId:e.productSkuId,quantity:e.quantity}})),userMessage:e.userMessage});case 2:if(i=t.sent,n=i.error,o=i.result,!n){t.next=8;break}return uni.$u.totas(n.message),t.abrupt("return",!1);case 8:e.wxpay(o.orderId);case 9:case"end":return t.stop()}}),t)})))()},wxpay:function(e){var t=this;return(0,o.default)(regeneratorRuntime.mark((function i(){var n,o;return regeneratorRuntime.wrap((function(i){while(1)switch(i.prev=i.next){case 0:return i.next=2,(0,a.ApiPostWxPay)({orderId:e});case 2:n=i.sent,o=n.error,n.result,o?t.$Router.push("/payFail?ordId=".concat(e)):t.$Router.push("/paySuccess?ordId=".concat(e));case 6:case"end":return