1 |
- !function(){function e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function t(t){for(var r=1;r<arguments.length;r++){var o=null!=arguments[r]?arguments[r]:{};r%2?e(Object(o),!0).forEach((function(e){n(t,e,o[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):e(Object(o)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))}))}return t}function n(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function r(e,t,n,r,o,a,i){try{var l=e[a](i),c=l.value}catch(p){return void n(p)}l.done?t(c):Promise.resolve(c).then(r,o)}function o(e){return function(){var t=this,n=arguments;return new Promise((function(o,a){var i=e.apply(t,n);function l(e){r(i,o,a,l,c,"next",e)}function c(e){r(i,o,a,l,c,"throw",e)}l(void 0)}))}}var a=document.createElement("style");a.innerHTML="._payment_1ot0l_1 .van-cell__title{font-size:.42667rem;padding-left:.26667rem}._payment_1ot0l_1 .van-icon-cross{position:absolute;z-index:1;top:.34667rem;left:.34667rem;color:#ccc;cursor:pointer}._payment_1ot0l_1 ._title_1ot0l_13{background-color:#fff;font-size:.42667rem;font-weight:400;color:#1a1a1a;padding:.37333rem 0 .32rem;text-align:center}._payment_1ot0l_1 ._payAmount_1ot0l_21{background-color:#fff;padding:.53333rem 0;text-align:center}._payment_1ot0l_1 ._payAmount_1ot0l_21 p{font-size:.37333rem;color:#666;padding-bottom:.26667rem}._payment_1ot0l_1 ._payAmount_1ot0l_21 ._amount_1ot0l_31{font-size:.74667rem;color:#000}._payment_1ot0l_1 ._payAmount_1ot0l_21 ._amount_1ot0l_31 span{font-size:.48rem}._payment_1ot0l_1 ._blank_1ot0l_38{height:1.73333rem}._payment_1ot0l_1 ._payTypeRe_1ot0l_41{display:flex;align-items:center}._payment_1ot0l_1 ._recommend_1ot0l_45{margin-left:.13333rem;background:linear-gradient(122deg,#ffa371 0%,#ff6b3b 100%);border-radius:.26667rem;font-size:.32rem;color:#fff;line-height:.42667rem;padding:0 .13333rem}._payment_1ot0l_1 ._payBtn_1ot0l_54{width:90%!important;margin:0 auto;font-size:.42667rem;font-weight:600;margin-bottom:.53333rem}\n",document.head.appendChild(a),System.register(["./index-legacy.fba2875c.js","./index-legacy.7dcec7b3.js","./index-legacy.f231f1c5.js","./index-legacy.23cbc114.js","./index-legacy.32d1c54d.js","./hooks-legacy.148eb332.js"],(function(e){"use strict";var n,r,a,i,l,c,p,u,s,d,m,f,y,_,h,g,b;return{setters:[function(e){n=e.g,r=e.d,a=e.bq,i=e.D,l=e.w,c=e.n,p=e.T,u=e.b0,s=e.j,d=e.M,m=e.z,f=e.B},function(e){y=e.C},function(e){_=e.C},function(e){h=e.R,g=e.a},function(){},function(e){b=e.u}],execute:function(){var v="_payment_1ot0l_1",O="_title_1ot0l_13",T="_payAmount_1ot0l_21",w="_amount_1ot0l_31",x="_blank_1ot0l_38",k="_payTypeRe_1ot0l_41",P="_recommend_1ot0l_45",j="_payBtn_1ot0l_54",C="TEACHER"===n.platformType?"/api-teacher":"/api-student",z={goodsPay:{cancelUrl:"/api-mall-portal/order/cancelUserOrder",payUrl:"/api-mall-portal/payment/orderPay"},orderPay:{cancelUrl:C+"/userOrder/orderCancel",payUrl:C+"/userOrder/orderPay"}};e("P",r({name:"payment",props:{modelValue:{type:Boolean,default:!1},orderInfo:{type:Object,default:{orderNo:"",actualPrice:0}},onBackOut:{type:Function,default:function(){}},paymentType:{type:String,default:"orderPay"}},data:function(){return{payType:"wx_app",pay_channel:""}},unmounted:function(){a("paymentOperation",this.paymentOperation)},mounted:function(){console.log(this.orderInfo,"this.orderInfo")},methods:{onClose:function(){var e=this;i.confirm({message:"是否放弃本次付款",confirmButtonText:"继续付款",cancelButtonText:"放弃"}).then((function(){})).catch(o(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e.onCancel(),b("取消支付");case 2:case"end":return t.stop()}}),t)}))))},onCancel:function(e){var t=this;return o(regeneratorRuntime.mark((function n(){return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,n.next=3,l.post(z[t.paymentType].cancelUrl,{data:{orderNo:t.orderInfo.orderNo}});case 3:n.next=7;break;case 5:n.prev=5,n.t0=n.catch(0);case 7:t.$emit("update:modelValue",!1),!e&&t.$router.go(-1),t.onBackOut&&t.onBackOut();case 10:case"end":return n.stop()}}),n,null,[[0,5]])})))()},onSubmit:function(){var e=this;return o(regeneratorRuntime.mark((function r(){var o,a;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,o={orderNo:e.orderInfo.orderNo,payChannel:e.payType,paymentClient:null},"goodsPay"===e.paymentType&&(o.paymentClient=n.platformType),r.next=5,l.post(z[e.paymentType].payUrl,{data:t({},o)});case 5:a=r.sent,c({api:"paymentOrder",content:{orderNo:e.orderInfo.orderNo,payChannel:e.payType,payInfo:a.data.pay_info}}),p.loading({message:"支付中...",forbidClick:!0,duration:3e3,loadingType:"spinner"}),p.clear(),e.$emit("update:modelValue",!1),u("paymentOperation",(function(t){console.log(t,"init paymentOperation"),e.paymentOperation(null==t?void 0:t.content)})),r.next=16;break;case 13:r.prev=13,r.t0=r.catch(0),console.log(r.t0);case 16:b("购买支付");case 17:case"end":return r.stop()}}),r,null,[[0,13]])})))()},paymentOperation:function(e){var t=this;if(console.log(e,"paymentOperation",this.paymentType,this.orderInfo),"success"===e.status||"error"===e.status){if(p.clear(),this.$emit("update:modelValue",!1),"goodsPay"===this.paymentType)return void this.$router.replace({path:"/shopTrade",query:{orderNo:this.orderInfo.orderNo}});this.$router.replace({path:"/tradeDetail",query:{orderNo:this.orderInfo.orderNo}})}else if("cancel"===e.status)p.clear(),this.$emit("update:modelValue",!1);else if("fail"===e.status){var n="ali_app"===this.payType?"您尚未安装支付宝":"您尚未安装微信";i.alert({title:"提示",message:n}).then((function(){p.clear(),t.$emit("update:modelValue",!1)}))}}},render:function(){var e=this;return s("div",{class:v},[s(d,{onClick:this.onClose,name:"cross",size:20},null),s("div",{class:[O]},[m("选择支付方式")]),s("div",{class:T},[s("p",null,[m("应付金额")]),s("div",{class:w},[s("span",null,[m("¥ ")]),this.$filters.moneyFormat(this.orderInfo.actualPrice)])]),s(h,{modelValue:this.payType,"onUpdate:modelValue":function(t){return e.payType=t}},{default:function(){return[s(_,{border:!1},{default:function(){return[s(y,{border:!0,center:!0,onClick:function(){e.payType="wx_app"}},{icon:function(){return s(d,{name:"wechat-pay",color:"#15c434",size:22},null)},"right-icon":function(){return s(g,{name:"wx_app"},null)},title:function(){return s("div",{class:k},[m("微信支付 "),s("span",{class:P},[m("推荐")])])}}),s(y,{title:"支付宝支付",border:!0,center:!0,onClick:function(){e.payType="ali_app"}},{icon:function(){return s(d,{name:"alipay",color:"#009fe9",size:22},null)},"right-icon":function(){return s(g,{name:"ali_app"},null)}})]}})]}}),s("div",{class:x},null),s(f,{type:"primary",class:j,block:!0,round:!0,onClick:this.onSubmit},{default:function(){return[m("确认支付")]}})])}}))}}}))}();
|