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.
1 lines
4.8 KiB
1 lines
4.8 KiB
(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/pay/pay"],{"0115":function(e,t,n){"use strict";(function(e){n("8d0c");a(n("66fd"));var t=a(n("9471"));function a(e){return e&&e.__esModule?e:{default:e}}wx.__webpack_require_UNI_MP_PLUGIN__=n,e(t.default)}).call(this,n("543d")["createPage"])},"20a6":function(e,t,n){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=o(n("a34a")),i=n("9837");function o(e){return e&&e.__esModule?e:{default:e}}function s(e,t,n,a,i,o,s){try{var r=e[o](s),u=r.value}catch(c){return void n(c)}r.done?t(u):Promise.resolve(u).then(a,i)}function r(e){return function(){var t=this,n=arguments;return new Promise((function(a,i){var o=e.apply(t,n);function r(e){s(o,a,i,r,u,"next",e)}function u(e){s(o,a,i,r,u,"throw",e)}r(void 0)}))}}var u={data:function(){return{payType:1,orderInfo:[],paymoney:0,dhid:0,yue:0,jifen:0,usejfnum:0,lessjifen:0,morejifen:0,dikmoney:0,isDefault:{isopen:!1},zfsmtext:"支付方式优先级是积分抵扣 > 余额 > 微信"}},computed:{},onLoad:function(t){var n=this;console.log(t,"所带参数"),this.paymoney=t.paymoney,this.dhid=t.dhid,e.getStorage({key:"paymentOrder",success:function(e){console.log(e,"值?");for(var t=e.data,a=t.length,i=0;i<a;i++)n.deleteGoods(t[i].id)}})},filters:{toFixed:function(e){return parseFloat(e).toFixed(2)}},onShow:function(){var t=e.getStorageSync("userinfo");this.getuserinfo(t.uid),this.baseinfo("zftip")},methods:{baseinfo:function(e){var t=this;return r(a.default.mark((function n(){var i;return a.default.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return n.next=2,t.$api.baseinfo({action:"baseinfo",key:e});case 2:i=n.sent,t.zfsmtext=i.data.info;case 4:case"end":return n.stop()}}),n)})))()},getuserinfo:function(e){var t=this;return r(a.default.mark((function n(){var i;return a.default.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return n.next=2,t.$api.userinfo({action:"userinfo",uid:e,dhid:t.dhid});case 2:i=n.sent,t.yue=i.data.yue,t.jifen=i.data.jifen,t.dikmoney=i.data.dikmoney,t.lessjifen=i.data.lessjifen,t.morejifen=i.data.morejifen,t.usejfnum=i.data.usejfnum,t.paymoney=i.data.paymoney;case 10:case"end":return n.stop()}}),n)})))()},wxpay:function(t,n){var i=this;return r(a.default.mark((function o(){var s;return a.default.wrap((function(a){while(1)switch(a.prev=a.next){case 0:return a.next=2,i.$api.wxpay({action:"wxpayall",openid:n,dhid:t,paytype:i.payType,isjifen:i.isDefault.isopen});case 2:s=a.sent,console.log(s,"返回"),1==s.code?e.requestPayment({provider:"wxpay",timeStamp:s.data.timeStamp,nonceStr:s.data.nonceStr,package:s.data.package,signType:"MD5",paySign:s.data.paySign,success:function(t){e.redirectTo({url:"/pages/pay/paySuccess"})},fail:function(t){console.log("fail:"+JSON.stringify(t)),e.showToast({title:"已放弃支付",icon:"none"})}}):2==s.code?e.redirectTo({url:"/pages/pay/paySuccess"}):e.showToast({title:s.msg,icon:"none"});case 5:case"end":return a.stop()}}),o)})))()},changePayType:function(t){if(this.payType=t,2==t){var n=this;e.showModal({title:"支付说明",showCancel:!1,confirmText:"明白了",content:n.zfsmtext,success:function(e){}})}},confirm:(0,i.throttle)((function(){var t=e.getStorageSync("userinfo");this.wxpay(this.dhid,t["openid"])})),deleteGoods:function(t){for(var n=e.getStorageSync("cartlist"),a=n.length,i=0;i<a;i++)if(t==n[i].id){n.splice(i,1);break}e.setStorageSync("cartlist",n)},isDefaultChange:function(t){var n=this;n.$set(this.isDefault,"isopen",t.detail.value),n.isDefault.isopen&&this.dikmoney<=0?e.showModal({title:"提示",content:"当前积分不足",success:function(e){e.confirm?(n.$set(n.isDefault,"isopen",!1),console.log("用户点击确定")):e.cancel&&(n.$set(n.isDefault,"isopen",!1),console.log("用户点击取消"))}}):this.isDefault.isopen?this.paymoney-=parseFloat(100*this.dikmoney)/100:this.paymoney+=parseFloat(100*this.dikmoney)/100}}};t.default=u}).call(this,n("543d")["default"])},"6a3d":function(e,t,n){"use strict";var a=n("754e"),i=n.n(a);i.a},"754e":function(e,t,n){},"8a6c":function(e,t,n){"use strict";n.r(t);var a=n("20a6"),i=n.n(a);for(var o in a)"default"!==o&&function(e){n.d(t,e,(function(){return a[e]}))}(o);t["default"]=i.a},9471:function(e,t,n){"use strict";n.r(t);var a=n("aa50"),i=n("8a6c");for(var o in i)"default"!==o&&function(e){n.d(t,e,(function(){return i[e]}))}(o);n("6a3d");var s,r=n("f0c5"),u=Object(r["a"])(i["default"],a["b"],a["c"],!1,null,null,null,!1,a["a"],s);t["default"]=u.exports},aa50:function(e,t,n){"use strict";var a;n.d(t,"b",(function(){return i})),n.d(t,"c",(function(){return o})),n.d(t,"a",(function(){return a}));var i=function(){var e=this,t=e.$createElement,n=(e._self._c,e._f("toFixed")(e.paymoney)),a=e.isDefault.isopen&&e.dikmoney?e._f("toFixed")(e.dikmoney):null;e.$mp.data=Object.assign({},{$root:{f0:n,f1:a}})},o=[]}},[["0115","common/runtime","common/vendor"]]]);
|