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.
high-mini/unpackage/dist/build/mp-weixin/pages/pay/payment/payment.js

1 line
3.0 KiB

(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/pay/payment/payment"],{"0cee":function(e,t,n){"use strict";n.r(t);var o=n("fdde"),a=n.n(o);for(var r in o)"default"!==r&&function(e){n.d(t,e,(function(){return o[e]}))}(r);t["default"]=a.a},"224a":function(e,t,n){"use strict";var o;n.d(t,"b",(function(){return a})),n.d(t,"c",(function(){return r})),n.d(t,"a",(function(){return o}));var a=function(){var e=this,t=e.$createElement;e._self._c;e._isMounted||(e.e0=function(t){e.paytype="jinbi"},e.e1=function(t){e.paytype="wxpay"})},r=[]},"249f":function(e,t,n){"use strict";var o=n("456d"),a=n.n(o);a.a},"456d":function(e,t,n){},a4fe:function(e,t,n){"use strict";(function(e){n("eba6");o(n("66fd"));var t=o(n("fe49"));function o(e){return e&&e.__esModule?e:{default:e}}e(t.default)}).call(this,n("543d")["createPage"])},fdde:function(e,t,n){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n("b528"),a=getApp(),r={data:function(){return{amount:0,orderName:"",pryType:"",paytype:"",orderNo:"",user:"",couponId:""}},onLoad:function(t){var n=this;this.pryType=t.paytype,this.orderNo=t.orderId,this.couponId=t.couponId,this.user=a.globalData.userInfo,1==this.pryType?this.paytype="wxpay":2==this.pryType?this.paytype="jinbi":this.paytype="",this.amount=parseFloat(t.amount).toFixed(2),e.getStorage({key:"paymentOrder",success:function(t){t.data.length>1?n.orderName="多商品合并支付":n.orderName=t.data[0].name,e.removeStorage({key:"paymentOrder"})}})},methods:{orderToPay:function(){var t=this;if("wxpay"==t.paytype){e.showLoading({title:"支付中..."});var n={orderId:t.orderNo,openId:a.globalData.openId,orderScene:"GOODS_ORDER"};(0,o.orderToPay)(n).then((function(n){"000000"==n.return_code?e.requestPayment({appId:n.return_data.appId,nonceStr:n.return_data.nonceStr,package:n.return_data.package,paySign:n.return_data.sign,signType:"MD5",timeStamp:n.return_data.timeStamp,success:function(n){e.hideLoading(),e.showToast({title:"支付成功"}),e.reLaunch({url:"../success/success?id="+t.couponId})},fail:function(t){e.hideLoading(),console.log("fail:"+JSON.stringify(t))}}):e.showToast({title:n.return_msg,icon:"none"})}))}else"jinbi"==t.paytype?e.showModal({title:"金币支付",content:"确认是否用金币支付?",success:function(n){if(n.confirm){e.showLoading({title:"支付中..."});var a={orderId:t.orderNo};(0,o.orderToGoldPay)(a).then((function(n){"000000"==n.return_code?(e.hideLoading(),e.showToast({title:"支付成功"}),e.reLaunch({url:"../success/success?id="+t.couponId})):e.showToast({title:n.return_msg,icon:"none"})}))}else n.cancel}}):e.showToast({title:"请选择支付方式",icon:"none",duration:2e3})}}};t.default=r}).call(this,n("543d")["default"])},fe49:function(e,t,n){"use strict";n.r(t);var o=n("224a"),a=n("0cee");for(var r in a)"default"!==r&&function(e){n.d(t,e,(function(){return a[e]}))}(r);n("249f");var i,u=n("f0c5"),c=Object(u["a"])(a["default"],o["b"],o["c"],!1,null,null,null,!1,o["a"],i);t["default"]=c.exports}},[["a4fe","common/runtime","common/vendor"]]]);