Files
2026-04-14 17:38:46 +08:00

1 line
5.7 KiB
JavaScript

(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/payment/payment"],{"1cc9":function(t,n,e){"use strict";e.r(n);var o=e("77b1"),a=e("6c16");for(var i in a)["default"].indexOf(i)<0&&function(t){e.d(n,t,(function(){return a[t]}))}(i);e("fd0f");var r=e("828b"),u=Object(r["a"])(a["default"],o["b"],o["c"],!1,null,null,null,!1,o["a"],void 0);n["default"]=u.exports},4835:function(t,n,e){"use strict";(function(t,n){var o=e("47a9");e("3712");o(e("3240"));var a=o(e("1cc9"));t.__webpack_require_UNI_MP_PLUGIN__=e,n(a.default)}).call(this,e("3223")["default"],e("df3c")["createPage"])},"64a7":function(t,n,e){"use strict";(function(t){Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var o=e("7a03"),a=e("e22d"),i=e("bd42"),r=e("25af"),u=e("0aec"),s={name:"Payment",data:function(){return{from:"",order_id:"",amount:0,timeout:0,payway:"",paywayList:[],showAgain:!1,loadingSkeleton:!0,loadingPay:!1,Alipayshow:!1,userInfo:{},key:""}},methods:{changePayway:function(t){this.$set(this,"payway",t)},oncopy:function(){(0,u.copy)(this.key)},handleclose:function(){var t=this;(0,i.getPayResult)({from:this.from,order_id:this.order_id,id:this.order_id}).then((function(n){var e=n.data;e.pay_status?t.result="success":t.result="fail",t.$Router.back(1)}))},initPageData:function(){var t=this;(0,o.getPayway)({from:this.from,order_id:this.order_id}).then((function(t){if(1!=t.code)throw new Error(t.msg);return t.data})).then((function(n){var e;t.loadingSkeleton=!1,t.amount=n.order_amount,t.paywayList=n.pay_way,t.payway=null===(e=t.paywayList[0])||void 0===e?void 0:e.pay_way;var o=(new Date).getTime(),a=n.cancel_time;t.timeout=a-o/1e3})).catch((function(t){throw new Error(t)}))},handlePrepay:function(){var n=this;this.loadingPay||(this.loadingPay=!0,0!=this.userInfo.mnp_auth||1!=this.payway?(0,o.prepay)({from:this.from,order_id:this.order_id,pay_way:this.payway},this.$store.getters.token).then((function(t){var e=t.code,o=t.data,a=t.pay_way;switch(e){case 1:n.handleWechatPay(o);break;case 10001:n.handleAlipayPay(o,a);break;case 20001:n.handleWalletPay();break;case 30001:n.handledownPay();break}})).catch((function(t){})).finally((function(){setTimeout((function(){n.loadingPay=!1}),500)})):t.showModal({content:"当前账号未微信授权,请前往个人设置授权",confirmText:"前往授权",success:function(t){var e=t.confirm;e&&n.$Router.replaceAll({path:"/bundle/pages/user_set/user_set",query:{form:"payment"}})}}))},handleWechatPay:function(t){var n=this;(0,a.wxpay)(t).then((function(t){console.log(t),n.handPayResult(t)})).catch((function(t){console.log(t)}))},handleAlipayPay:function(n,e){var o=this;this.key="".concat(this.$store.state.app.config.base_domain,"mobile/bundle/pages/toAlipay/toAlipay?id=").concat(this.order_id,"&from=").concat(this.from,"&pay_way=").concat(this.payway,"&key=").concat(this.$store.getters.token),t.$on("Alipay",(function(){o.Alipayshow=!0})),(0,a.alipay)(n,e,{order_id:this.order_id,from:this.from,pay_way:this.payway},this.$store.getters.token).then((function(t){console.log(t),o.handPayResult(t)})).catch((function(t){console.log(t)}))},handleWalletPay:function(){console.log("支付成功"),this.handPayResult("success")},handledownPay:function(){console.log("支付成功"),this.handPayResult("success")},getUserInfoFun:function(){var t=this;(0,r.getUserInfo)().then((function(n){1==n.code&&(t.userInfo=n.data)}))},handPayResult:function(t){this.result=t,this.$Router.back(1)}},onLoad:function(){var t=this.$Route.query,n=(null===t||void 0===t?void 0:t.from)||"trade",e=null===t||void 0===t?void 0:t.order_id;this.getUserInfoFun();try{if(!n&&!e)throw new Error("页面参数有误");this.from=n,this.order_id=e,this.initPageData()}catch(o){console.log(o),this.$Router.back()}},onShow:function(){var t=this;this.showAgain&&(0,i.getPayResult)({from:this.from,order_id:this.order_id,id:this.order_id}).then((function(n){var e=n.data;e.pay_status?t.result="success":t.result="fail",t.$Router.back(1)}))},onHide:function(){this.showAgain=!0},onUnload:function(){switch(this.result){case"success":t.$emit("payment",{result:!0,order_id:this.order_id,from:this.from});break;case"fail":default:t.$emit("payment",{result:!1,order_id:this.order_id,from:this.from})}}};n.default=s}).call(this,e("df3c")["default"])},"6c16":function(t,n,e){"use strict";e.r(n);var o=e("64a7"),a=e.n(o);for(var i in o)["default"].indexOf(i)<0&&function(t){e.d(n,t,(function(){return o[t]}))}(i);n["default"]=a.a},"77b1":function(t,n,e){"use strict";e.d(n,"b",(function(){return a})),e.d(n,"c",(function(){return i})),e.d(n,"a",(function(){return o}));var o={priceFormat:function(){return e.e("components/price-format/price-format").then(e.bind(null,"1738"))},uCountDown:function(){return e.e("components/uview-ui/components/u-count-down/u-count-down").then(e.bind(null,"79bd"))},uRadioGroup:function(){return Promise.all([e.e("common/vendor"),e.e("components/uview-ui/components/u-radio-group/u-radio-group")]).then(e.bind(null,"36bd"))},uImage:function(){return e.e("components/uview-ui/components/u-image/u-image").then(e.bind(null,"28a8"))},uRadio:function(){return e.e("components/uview-ui/components/u-radio/u-radio").then(e.bind(null,"119b"))},uLoading:function(){return e.e("components/uview-ui/components/u-loading/u-loading").then(e.bind(null,"7cbc"))},uPopup:function(){return e.e("components/uview-ui/components/u-popup/u-popup").then(e.bind(null,"b12c"))},uSkeleton:function(){return e.e("components/uview-ui/components/u-skeleton/u-skeleton").then(e.bind(null,"40d3"))}},a=function(){var t=this.$createElement,n=(this._self._c,this.paywayList.length);this.$mp.data=Object.assign({},{$root:{g0:n}})},i=[]},a8db:function(t,n,e){},fd0f:function(t,n,e){"use strict";var o=e("a8db"),a=e.n(o);a.a}},[["4835","common/runtime","common/vendor"]]]);