require('../common/vendor.js');(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/behalf/cashier/index"],{"172b":function(e,t,n){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=n("6af6"),r=n("4d38"),a={data:function(){return{imgHost:r.HTTP_REQUEST_URL,payPriceShow:0,invalidTime:0,orderId:"",paytype:"weixin",userId:0,qrcode:"",config:{code:"",size:280,level:3,bgColor:"#FFFFFF",color:["#333","#333"]},timer:null}},components:{countDown:function(){n.e("components/countDown/index").then(function(){return resolve(n("1706"))}.bind(null,n)).catch(n.oe)}},onLoad:function(e){this.checkKefuAuth("kefu-behalf")&&(this.userId=e.uid||0,e.order_id&&(this.orderId=e.order_id,this.getCashierOrder()))},onUnload:function(){this.stopSetInterval()},methods:{getCashierOrder:function(){var e=this;if(this.checkKefuAuth("kefu-behalf")){var t={uni:this.orderId,paytype:this.paytype,quitUrl:"/pages/behalf/cashier/index"};(0,i.getCashierApi)(this.userId,t).then((function(t){if("SUCCESS"==t.data.status)return e.$util.Tips({title:"支付成功"},{tab:5,url:"/pages/behalf/record/index"});e.payPriceShow=t.data.result.pay_price,e.invalidTime=t.data.result.jsConfig.invalid,e.config.code="weixin"==e.paytype?t.data.result.jsConfig.code_url:t.data.result.jsConfig.qrCode,e.createSetInterval(t.data.result.order_id)})).catch((function(t){return e.$util.Tips({title:t})}))}},checkType:function(e){this.checkKefuAuth("kefu-behalf")&&(this.paytype=e,this.getCashierOrder())},createSetInterval:function(e){var t=this;this.stopSetInterval(),this.timer=setInterval((function(){t.getOrderResult(e)}),2e3)},stopSetInterval:function(){this.timer&&(clearInterval(this.timer),this.timer=null)},getOrderResult:function(t){var n=this;this.checkKefuAuth("kefu-behalf")&&(0,i.getPayStatusApi)({order_id:t,end_time:this.invalidTime}).then((function(t){0==t.data.time&&(n.stopSetInterval(),n.getCashierOrder()),(t.data.status||0==t.data.time)&&(n.stopSetInterval(),e.reLaunch({url:"/pages/behalf/record/index"}))})).catch((function(e){return n.$util.Tips({title:e})}))},backPage:function(){e.reLaunch({url:"/pages/admin/work/index"})}}};t.default=a}).call(this,n("df3c")["default"])},"391c":function(e,t,n){"use strict";(function(e,t){var i=n("47a9");n("f076");i(n("3240"));var r=i(n("c450"));e.__webpack_require_UNI_MP_PLUGIN__=n,t(r.default)}).call(this,n("3223")["default"],n("df3c")["createPage"])},"5a39":function(e,t,n){"use strict";var i=n("e4ec"),r=n.n(i);r.a},a076:function(e,t,n){"use strict";n.d(t,"b",(function(){return r})),n.d(t,"c",(function(){return a})),n.d(t,"a",(function(){return i}));var i={wQrcode:function(){return Promise.all([n.e("common/vendor"),n.e("uni_modules/wmf-code/components/w-qrcode/index")]).then(n.bind(null,"a163"))}},r=function(){var e=this.$createElement;this._self._c},a=[]},c38f:function(e,t,n){"use strict";n.r(t);var i=n("172b"),r=n.n(i);for(var a in i)["default"].indexOf(a)<0&&function(e){n.d(t,e,(function(){return i[e]}))}(a);t["default"]=r.a},c450:function(e,t,n){"use strict";n.r(t);var i=n("a076"),r=n("c38f");for(var a in r)["default"].indexOf(a)<0&&function(e){n.d(t,e,(function(){return r[e]}))}(a);n("5a39");var u=n("828b"),c=Object(u["a"])(r["default"],i["b"],i["c"],!1,null,null,null,!1,i["a"],void 0);t["default"]=c.exports},e4ec:function(e,t,n){}},[["391c","common/runtime","common/vendor"]]]);