text: (global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/mall/subPages/confirm-order/confirm-order"],{2346:function(e,t,n){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=i(n("a34a")),o=n("25d2"),s=n("2f62");function i(e){return e&&e.__esModule?e:{default:e}}function a(e,t,n,r,o,s,i){try{var a=e[s](i),d=a.value}catch(u){return void n(u)}a.done?t(d):Promise.resolve(d).then(r,o)}function d(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var s=e.apply(t,n);function i(e){a(s,r,o,i,d,"next",e)}function d(e){a(s,r,o,i,d,"throw",e)}i(void 0)})}}function u(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"===typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){c(e,t,n[t])})}return e}function c(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var f=function(){return n.e("pages/mine/subPages/address-list/children/address-item").then(n.bind(null,"dc38"))},l=function(){return n.e("components/pay-methods").then(n.bind(null,"c786"))},m=function(){return n.e("components/goods-item").then(n.bind(null,"3587"))},p={name:"",data:function(){return{id:"",price:"",offerId:"",type:1}},onLoad:function(e){this.id=e.id,e.type?(this.price=e.price,this.offerId=e.offerId,this._reqGetDemandDetail()):this._reqGetGoodsDetail(),this._reqGetAddressList()},computed:u({},(0,s.mapState)(["address_list","default_address","goods_detail","demand_detail"])),methods:u({},(0,s.mapActions)(["reqGetAddressList","reqGetGoodsDetail","reqGetDemandDetail"]),{onChosePayClick:function(e){this.type=e,console.log(this.type," at pages\\mall\\subPages\\confirm-order\\confirm-order.vue:69")},onSubmitOrder:function(){var t=d(r.default.mark(function t(){var n,s;return r.default.wrap(function(t){while(1)switch(t.prev=t.next){case 0:if(this.default_address.id){t.next=3;break}return e.showToast({title:"请选择收货地址",icon:"none"}),t.abrupt("return");case 3:if(1==this.type&&(s="wxpay"),2==this.type&&(s="alipay"),!this.price){t.next=11;break}return t.next=8,(0,o.confirmOffer)({token:e.getStorageSync("token"),qid:this.offerId,did:this.id,address:this.default_address.id,paymod:this.type});case 8:n=t.sent,t.next=14;break;case 11:return t.next=13,(0,o.buyGoods)({token:e.getStorageSync("token"),sid:this.id,pnum:1,address:this.default_address.id,paymond:this.type});case 13:n=t.sent;case 14:console.log(n," at pages\\mall\\subPages\\confirm-order\\confirm-order.vue:100"),e.requestPayment({provider:s,orderInfo:n,success:function(t){console.log(t," at pages\\mall\\subPages\\confirm-order\\confirm-order.vue:105"),"requestPayment:ok"==t.errMsg&&e.redirectTo({url:"/pages/mine/subPages/success/success"})},fail:function(e){console.log("fail:"+JSON.stringify(e)," at pages\\mall\\subPages\\confirm-order\\confirm-order.vue:113")}});case 16:case"end":return t.stop()}},t,this)}));function n(){return t.apply(this,arguments)}return n}(),_reqGetAddressList:function(){this.reqGetAddressList({token:e.getStorageSync("token")})},_reqGetDemandDetail:function(){this.reqGetDemandDetail({xid:this.id})},_reqGetGoodsDetail:function(){this.reqGetGoodsDetail({cid:this.id})},onGoToAddressList:function(){e.navigateTo({url:"/pages/mine/subPages/address-list/address-list?type=select"})}}),components:{addressItem:f,payMethods:l,goodsItem:m}};t.default=p}).call(this,n("6e42")["default"])},"3a8d":function(e,t,n){"use strict";var r=function(){var e=this,t=e.$createElement;e._self._c},o=[];n.d(t,"a",function(){return r}),n.d(t,"b",function(){return o})},"6ba1":function(e,t,n){"use strict";n.r(t);var r=n("3a8d"),o=n("e707");for(var s in o)"default"!==s&&function(e){n.d(t,e,function(){return o[e]})}(s);n("76fb");var i=n("2877"),a=Object(i["a"])(o["default"],r["a"],r["b"],!1,null,"2f7ec2d4",null);t["default"]=a.exports},"76fb":function(e,t,n){"use strict";var r=n("bff6"),o=n.n(r);o.a},bff6:function(e,t,n){},e707:function(e,t,n){"use strict";n.r(t);var r=n("2346"),o=n.n(r);for(var s in r)"default"!==s&&function(e){n.d(t,e,function(){return r[e]})}(s);t["default"]=o.a}},[["1371","common/runtime","common/vendor"]]]);