(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/auth-step/auth-step"],{"13cb":function(t,e,n){"use strict";var a=n("7e81"),o=n.n(a);o.a},6064:function(t,e,n){"use strict";n.d(e,"b",(function(){return o})),n.d(e,"c",(function(){return i})),n.d(e,"a",(function(){return a}));var a={uSteps:function(){return n.e("node-modules/uview-ui/components/u-steps/u-steps").then(n.bind(null,"be5a"))}},o=function(){var t=this,e=t.$createElement;t._self._c;t._isMounted||(t.e0=function(e){t.isDeal=!t.isDeal})},i=[]},"60fc":function(t,e,n){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var a=n("057a"),o=i(n("359b"));function i(t){return t&&t.__esModule?t:{default:t}}var c={data:function(){return{current:0,stepList:[{name:"待认证"},{name:"审核中"},{name:"待签约"}],isApply:"",isDeal:!1,signCode:"",imgUrl:"",state:""}},onShow:function(){this.getShop()},watch:{isApply:{handler:function(e){var n=this;1==e?this.timer=setInterval((function(){n.getstate()}),5e3):(clearInterval(this.timer),t.hideLoading())},deep:!0}},methods:{skipProtocol:function(){t.navigateTo({url:"../../pagesA/pages/protocol/protocol"})},preview:function(){t.previewImage({current:this.signCode,urls:[this.signCode]})},saveImg:function(){var e=this.signCode.replace(/^data:image\/\w+;base64,/,""),n=wx.env.USER_DATA_PATH+"/hym_pay_qrcode.png";return t.getFileSystemManager().writeFile({filePath:n,data:e,encoding:"base64",success:function(e){t.getSetting({success:function(e){e.authSetting["scope.writePhotosAlbum"]?(t.showLoading({title:"保存中..."}),t.saveImageToPhotosAlbum({filePath:n,success:function(e){t.showModal({content:"图片已保存到相册，赶快识别签约吧~",showCancel:!1}),t.hideLoading()},fail:function(e){t.hideLoading(),t.showToast({title:"保存失败",icon:"none"})}})):t.authorize({scope:"scope.writePhotosAlbum",success:function(e){t.saveImageToPhotosAlbum({filePath:n,success:function(e){t.showModal({content:"图片已保存到相册，赶快识别签约吧~",showCancel:!1})},fail:function(e){t.showToast({title:"保存失败",icon:"none"})}})},fail:function(e){t.showModal({title:"提示",content:"需要获取相册访问权限，请到小程序设置页面打开授权",cancelText:"取消",cancelColor:"#999",confirmText:"确定",confirmColor:"#f94218",success:function(e){e.confirm?t.openSetting({success:function(t){console.log(t.authSetting)},fail:function(e){t.showModal({content:"调起设置失败，请手动设置相册权限",showCancel:!1})}}):e.cancel&&t.showModal({content:"您取消了设置相册权限，不能保存图片到相册",showCancel:!1})}})}})}})},fail:function(t){}}),!1},getstate:function(){var e=this;t.showLoading({title:"加载中.."}),(0,a.getState)().then((function(n){if(200==n.code){if(e.state=n.data,"FINISH"==n.data.applyment_state)return clearInterval(e.timer),t.redirectTo({url:"../index/index"}),!1;if("NEED_SIGN"===n.data.applyment_state||"UNSIGNED"===n.data.sign_state){var a=n.data.sign_url;return e.imgUrl=a,e.signCode=o.default.createQrCodeImg(a,{size:parseInt(300)}),clearInterval(e.timer),e.current=e.isApply=2,!1}if("REJECTED"==n.data.applyment_state)return e.isApply=4,clearInterval(e.timer),!1;e.isApply=e.current=1,n.data.account_validation&&(e.remit=n.data.account_validation)}else t.showModal({content:n.data||"获取认证状态失败",showCancel:!1});t.hideLoading()}))},skipAuth:function(e){if(!this.isDeal&&0==e)return t.showModal({content:"请确认已阅读协议",showCancel:!1}),!1;t.navigateTo({url:"../../pagesA/pages/shop-auth/shop-auth"})},getShop:function(){var e=this;t.showLoading({title:"加载中...",mask:!0}),(0,a.getStoreInfo)().then((function(n){if(200==n.code){var a=n.data.store.is_apply;if(e.isApply=a,0==a)return e.current=0,!1;if(3==a)return clearInterval(e.timer),t.redirectTo({url:"../index/index"}),!1;1!=a&&2!=a||(e.current=a),e.getstate()}else t.showModal({content:n.data,showCancel:!1});t.hideLoading()})).catch((function(e){t.hideLoading()}))}}};e.default=c}).call(this,n("543d")["default"])},"7e81":function(t,e,n){},8099:function(t,e,n){"use strict";n.r(e);var a=n("60fc"),o=n.n(a);for(var i in a)"default"!==i&&function(t){n.d(e,t,(function(){return a[t]}))}(i);e["default"]=o.a},bd88:function(t,e,n){"use strict";(function(t){n("fdf4");a(n("66fd"));var e=a(n("d16c"));function a(t){return t&&t.__esModule?t:{default:t}}wx.__webpack_require_UNI_MP_PLUGIN__=n,t(e.default)}).call(this,n("543d")["createPage"])},d16c:function(t,e,n){"use strict";n.r(e);var a=n("6064"),o=n("8099");for(var i in o)"default"!==i&&function(t){n.d(e,t,(function(){return o[t]}))}(i);n("13cb");var c,s=n("f0c5"),r=Object(s["a"])(o["default"],a["b"],a["c"],!1,null,null,null,!1,a["a"],c);e["default"]=r.exports}},[["bd88","common/runtime","common/vendor"]]]);