(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["pages-API-request-payment-request-payment"],{"03e7":function(e,n,t){var i=t("ba6a");"string"===typeof i&&(i=[[e.i,i,""]]),i.locals&&(e.exports=i.locals);var o=t("4f06").default;o("5cc0eb97",i,!0,{sourceMap:!1,shadowMode:!1})},"2e2b":function(e,n,t){"use strict";var i=t("ee27");t("99af"),t("d3b7"),Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0,t("96cf");var o=i(t("c964")),a={data:function(){return{title:"request-payment",loading:!1,price:1,providerList:[]}},onLoad:function(){},methods:{weixinPay:function(){var e=this;console.log("发起支付"),this.loading=!0,uni.login({success:function(n){console.log("login success",n),uni.request({url:"https://unidemo.dcloud.net.cn/payment/wx/mp?code=".concat(n.code,"&amount=").concat(e.price),success:function(n){if(console.log("pay request success",n),200===n.statusCode)if(0===n.data.ret){console.log("得到接口prepay_id",n.data.payment);var t=n.data.payment;uni.requestPayment({timeStamp:t.timeStamp,nonceStr:t.nonceStr,package:t.package,signType:"MD5",paySign:t.paySign,success:function(e){uni.showToast({title:"感谢您的赞助!"})},fail:function(e){uni.showModal({content:"支付失败,原因为: "+e.errMsg,showCancel:!1})},complete:function(){e.loading=!1}})}else uni.showModal({content:n.data.desc,showCancel:!1});else uni.showModal({content:"支付失败，请重试！",showCancel:!1})},fail:function(n){console.log("fail",n),e.loading=!1,uni.showModal({content:"支付失败,原因为: "+n.errMsg,showCancel:!1})}})},fail:function(n){console.log("fail",n),e.loading=!1,uni.showModal({content:"支付失败,原因为: "+n.errMsg,showCancel:!1})}})},requestPayment:function(e,n){var t=this;return(0,o.default)(regeneratorRuntime.mark((function i(){var o;return regeneratorRuntime.wrap((function(i){while(1)switch(i.prev=i.next){case 0:return t.providerList[n].loading=!0,i.next=3,t.getOrderInfo(e.id);case 3:if(o=i.sent,console.log("得到订单信息",o),200===o.statusCode){i.next=9;break}return console.log("获得订单信息失败",o),uni.showModal({content:"获得订单信息失败",showCancel:!1}),i.abrupt("return");case 9:uni.requestPayment({provider:e.id,orderInfo:o.data,success:function(e){console.log("success",e),uni.showToast({title:"感谢您的赞助!"})},fail:function(e){console.log("fail",e),uni.showModal({content:"支付失败,原因为: "+e.errMsg,showCancel:!1})},complete:function(){t.providerList[n].loading=!1}});case 10:case"end":return i.stop()}}),i)})))()},getOrderInfo:function(e){var n="",t="https://demo.dcloud.net.cn/payment/?payid="+e+"&appid="+n+"&total="+this.price;return new Promise((function(e){uni.request({url:t,success:function(n){e(n)},fail:function(n){e(n)}})}))},priceChange:function(e){console.log(e.detail.value),this.price=e.detail.value}}};n.default=a},b89b:function(e,n,t){"use strict";var i,o=function(){var e=this,n=e.$createElement,t=e._self._c||n;return t("v-uni-view",[t("page-head",{attrs:{title:e.title}}),t("v-uni-view",{staticClass:"uni-padding-wrap"},[t("v-uni-view",{staticStyle:{background:"#FFF",padding:"50rpx 0"}},[t("v-uni-view",{staticClass:"uni-hello-text uni-center"},[e._v("支付金额")]),t("v-uni-view",{staticClass:"uni-h1 uni-center uni-common-mt"},[t("v-uni-text",{staticClass:"rmbLogo"},[e._v("￥")]),t("v-uni-input",{staticClass:"price",attrs:{type:"digit",value:e.price,maxlength:"4"},on:{input:function(n){arguments[0]=n=e.$handleEvent(n),e.priceChange.apply(void 0,arguments)}}})],1)],1),t("v-uni-view",{staticClass:"uni-btn-v uni-common-mt"})],1)],1)},a=[];t.d(n,"b",(function(){return o})),t.d(n,"c",(function(){return a})),t.d(n,"a",(function(){return i}))},ba6a:function(e,n,t){var i=t("24fb");n=i(!1),n.push([e.i,".rmbLogo[data-v-575257ee]{font-size:%?40?%}uni-button[data-v-575257ee]{background-color:#007aff;color:#fff}.uni-h1.uni-center[data-v-575257ee]{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-webkit-flex-direction:row;flex-direction:row;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center;-webkit-box-align:end;-webkit-align-items:flex-end;align-items:flex-end}.price[data-v-575257ee]{border-bottom:1px solid #eee;width:%?200?%;height:%?80?%;padding-bottom:%?4?%}.ipaPayBtn[data-v-575257ee]{margin-top:%?30?%}",""]),e.exports=n},bcb1:function(e,n,t){"use strict";var i=t("03e7"),o=t.n(i);o.a},ddd5:function(e,n,t){"use strict";t.r(n);var i=t("b89b"),o=t("fd67");for(var a in o)"default"!==a&&function(e){t.d(n,e,(function(){return o[e]}))}(a);t("bcb1");var c,s=t("f0c5"),r=Object(s["a"])(o["default"],i["b"],i["c"],!1,null,"575257ee",null,!1,i["a"],c);n["default"]=r.exports},fd67:function(e,n,t){"use strict";t.r(n);var i=t("2e2b"),o=t.n(i);for(var a in i)"default"!==a&&function(e){t.d(n,e,(function(){return i[e]}))}(a);n["default"]=o.a}}]);