webpackJsonp([39],{RGD6:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var a=n("mvHQ"),s=n.n(a),i=(n("Au9i"),n("5g4Q")),o=n("//Fk"),l=n.n(o),c=n("mtWM"),r=n.n(c).a.create({timeout:0,withCredentials:!0});var u={mixins:[i.a],data:function(){return{pays:{alipay:null,wxpay:null,url:""},paymentInfo:{skuIds:"8",desc:"签约服务",userId:"b46fb3dc-27d2-4d6e-a215-c26bf1d65164",paymentType:"",urlMedical:"",sellerId:""},loginInfo:{mobile:15680869152,loginPassword:"abc123"},patientInfo:{userName:"",userId:"b46fb3dc-27d2-4d6e-a215-c26bf1d65164",pageNumber:1,pageSize:1}}},created:function(){this.getChannels()},methods:{getChannels:function(){var t=this;plus.payment.getChannels(function(e){for(var n in e){var a=e[n];"qhpay"!=a.id&&"qihoo"!=a.id&&(t.pays[a.id]=a,t.checkServices(a),console.log(s()(e)))}},function(t){console.log("获取支付通道失败:"+t.message)})},checkServices:function(t){if(console.log("pc "+s()(t)),!t.serviceReady){console.log("进入检测");var e=null;switch(t.id){case"alipay":e="检测到系统未安装“支付宝快捷支付服务”,无法完成支付操作,是否立即安装?";break;default:e="系统未安装“"+t.description+"”服务,无法完成支付,是否立即安装?"}plus.nativeUI.confirm(e,function(e){0==e.index&&t.installService()},t.description)}},pay:function(t){var e,n,a=this;"WXPAY"===t?(this.pays.url="",this.paymentInfo.sellerId="1486467842",this.paymentInfo.paymentType="WXPAY"):(this.pays.url="",this.paymentInfo.sellerId="lhcw@lhinf.com",this.paymentInfo.paymentType="ALIPAY"),(e=this.pays.url,n=this.paymentInfo,r.post(e,n).then(function(t){return l.a.resolve(t.data)})).then(function(e){console.log("支付成功 "+s()(e));var n=e.msg;console.log("msg "+s()(n)),plus.payment.request(a.pays[t.toLowerCase()],n,function(t){plus.nativeUI.alert("支付成功!",function(){})},function(t){console.log("error "+s()(t)),plus.nativeUI.alert("支付失败!",function(){})})}).catch(function(t){console.log("err "+s()(t))})}}},d={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("transition",{attrs:{name:"slide"}},[n("div",{staticClass:"payment"},[n("mt-header",{staticClass:"header",attrs:{title:"Payment",fixed:t.headerConf.fixed}},[n("div",{attrs:{slot:"left"},slot:"left"},[n("mt-button",{attrs:{icon:"back"},on:{click:t.back}},[t._v("返回")])],1)]),t._v(" "),n("div",{staticClass:"content"},[n("div",{staticClass:"row"},[n("div",{staticClass:"title"},[t._v("\n 支付模块需要配合后台接口测试,本例子只是验证支付可能性。测试需修改相应接口参数为自己公司需要参数即可。\n ")])]),t._v(" "),n("div",{staticClass:"row"},[n("mt-button",{attrs:{type:"danger"},on:{click:function(e){return t.pay("ALIPAY")}}},[t._v("支付宝支付")]),t._v(" "),n("mt-button",{attrs:{type:"danger"},on:{click:function(e){return t.pay("WXPAY")}}},[t._v("微信支付")])],1)])],1)])},staticRenderFns:[]};var f=n("VU/8")(u,d,!1,function(t){n("Y7XT")},"data-v-1586d40d",null);e.default=f.exports},Y7XT:function(t,e){}}); //# sourceMappingURL=39.8e74a309ce6f92dc5ed7.js.map