pay.js 5.3 KB

1
  1. require('common/vendor.js');(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pagesShare/pay"],{"918a":function(e,t,n){"use strict";n.r(t);var o=n("f3b3"),a=n("c1bf");for(var i in a)["default"].indexOf(i)<0&&function(e){n.d(t,e,(function(){return a[e]}))}(i);n("9aa5");var r,s=n("8261"),c=Object(s["a"])(a["default"],o["b"],o["c"],!1,null,null,null,!1,o["a"],r);t["default"]=c.exports},9730:function(e,t,n){"use strict";(function(e){n("6cdc");o(n("b5e3"));var t=o(n("918a"));function o(e){return e&&e.__esModule?e:{default:e}}e(t.default)}).call(this,n("934e")["createPage"])},"9aa5":function(e,t,n){"use strict";var o=n("e269"),a=n.n(o);a.a},b674:function(e,t,n){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n("7736"),a=p(n("3bff")),i=(n("ca00"),n("cf45")),r=n("1b62"),s=n("0377"),c=n("5315"),u=(n("5f87"),n("01ea"));function p(e){return e&&e.__esModule?e:{default:e}}function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function f(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?l(Object(n),!0).forEach((function(t){d(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function d(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var h=function(){n.e("components/plugin/tabs").then(function(){return resolve(n("f58d"))}.bind(null,n)).catch(n.oe)},m=function(){n.e("pagesShare/components/pay-input").then(function(){return resolve(n("aade"))}.bind(null,n)).catch(n.oe)},y=function(){n.e("components/app-delivery").then(function(){return resolve(n("c7ce"))}.bind(null,n)).catch(n.oe)},b=function(){n.e("components/plugin/modal").then(function(){return resolve(n("3a8f"))}.bind(null,n)).catch(n.oe)},v=function(){Promise.all([n.e("common/vendor"),n.e("components/app-coupon-sel")]).then(function(){return resolve(n("3c3e"))}.bind(null,n)).catch(n.oe)},g=function(){n.e("components/plugin/alert").then(function(){return resolve(n("a366"))}.bind(null,n)).catch(n.oe)},O=function(){n.e("components/module/app-share-mask").then(function(){return resolve(n("0119"))}.bind(null,n)).catch(n.oe)},P={name:"pay",components:{AppTabs:h,PayInputModule:m,AppDeliveryModule:y,ModalModule:b,AppCouponSel:v,AlertModule:g,AppShareMask:O},mixins:[r.share],data:function(){return{constant:this.$constant,inpFocus:!1,tabIndex:0,tabs:[{name:"直接付款"},{name:"我要配送"}],amount:"",form:{payWay:0},passwordModal:!1,modalForm:{payPassword:""},appendFrm:{sendDistance:"",receiveLat:"",receiveLong:""},payCallData:null,setPassModal:!1,showShare:!1}},computed:f(f({},(0,o.mapGetters)({orderShop:"getOrderShop"})),(0,o.mapGetters)({shopUser:"getShopUser"})),onLoad:function(e){this.specialInit()},mounted:function(){},methods:{isWxBrowser:i.isWxBrowser,isWxMiniapp:i.isWxMiniapp,specialInit:function(){this.option.pageType&&(this.tabIndex=parseInt(this.option.pageType)),(0,u.getOrderShop)().then((function(t){e.setNavigationBarTitle({title:"您正在向【".concat(t.shop.name,"】付款")})}))},_pay:function(){var e=this;if(!this.amount)return this.$msg("请先输入金额!"),!1;var t={},n=null;if("recharge"==this.option.pageStatus)t={amount:this.amount},n=c.recharge;else{if(t={prePrice:this.amount,payWay:this.form.payWay},1==this.tabIndex){var o=this.$refs.appDelivery.form?this.$refs.appDelivery.form:{},i=this.$refs.appDelivery.region?this.$refs.appDelivery.region:{};t=f(f(f({},t),o),i)}this.option.store&&(t.store=this.option.store),this.option.sourceType&&(t.sourceType=this.option.sourceType),n=s.fastPay}n(t).then((function(t){if(e.payCallData=t.data,0==t.code)return e.$msg(t.msg),!1;0==e.form.payWay?(0,a.default)(t.data,e.paySuccess,e.payFail):1==e.form.payWay||e.paySuccess()}))},tabChange:function(e){this.tabIndex=e.index,this.inpFocus=!0},focusFn:function(){this.inpFocus=!0},blurFn:function(){this.inpFocus=!1},clickKeyFn:function(e){this.amount=e},aliPayFn:function(){this.form.payWay=1,this._pay()},wexinPayFn:function(){this.form.payWay=0,this._pay()},hideAlert:function(){this.$util.pageTo("/pages/user/password")},balancePayFn:function(){this.$util.isEmpty(this.shopUser)||0!=this.shopUser.hasPayPwd?(this.form.payWay=2,this.passwordModal=!0):this.setPassModal=!0},passwordModalClick:function(e){0===e.index?this.modalCancel():this._pay()},modalCancel:function(){this.passwordModal=!1,this.modalForm.payPassword=""},paySuccess:function(){},payFail:function(){}}};t.default=P}).call(this,n("934e")["default"])},c1bf:function(e,t,n){"use strict";n.r(t);var o=n("b674"),a=n.n(o);for(var i in o)["default"].indexOf(i)<0&&function(e){n.d(t,e,(function(){return o[e]}))}(i);t["default"]=a.a},e269:function(e,t,n){},f3b3:function(e,t,n){"use strict";var o;n.d(t,"b",(function(){return a})),n.d(t,"c",(function(){return i})),n.d(t,"a",(function(){return o}));var a=function(){var e=this,t=e.$createElement,n=(e._self._c,e._f("default_img")("")),o=e.$util.isEmpty(e.shopUser);e.$mp.data=Object.assign({},{$root:{f0:n,g0:o}})},i=[]}},[["9730","common/runtime","common/vendor","pagesShare/common/vendor"]]]);