bztang-admin/addons/yun_shop/static/app/js/chunk-45a80c61.6fae5e78.js

1 line
3.0 KiB
JavaScript

(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-45a80c61"],{6573:function(t,e,n){t.exports=n.p+"static/app/img/yq_sign_renzheng@2x.e5bb1269.png"},e4d8:function(t,e,n){"use strict";n.r(e);var i=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",[t.timer?i("img",{staticStyle:{width:"8rem",height:"8rem",margin:"5rem 1.5rem 1rem 1.5rem"},attrs:{src:n("6573"),alt:""}}):t._e(),i("div",[t._v(t._s(t.timer?"验证中...":""))])])},r=[],a={data:function(){return{agentData:{agent_secret:"",agentid:"",corpid:""},timer:null}},activated:function(){1==this.$route.query.is_wx?this.getAgentConfig():this.$route.query.url?this.getFaceStatus():this.getData()},deactivated:function(){this.timer&&(this.timer=null,clearInterval(this.timer))},methods:{getAgentConfig:function(){var t=this;$http.get("plugin.wechat-chat-sidebar.frontend.controller.index.get-config",{url:"ios"===this.fun.isIosOrAndroid()?window.initUrl:document.location.href}).then((function(e){if(1===e.result){t.agentData=e.data;var n=e.data.get_token,i={debug:!1,beta:!0,jsApiList:["agentConfig"],openTagList:["ww-open-data"],appId:t.agentData.corpid,nonceStr:n.noncestr,timestamp:n.timestamp,signature:n.token};wx.config(i),wx.ready((function(){setTimeout((function(){t.getAgentSign(i,n.app_token)}),500)})),wx.error((function(t){}))}else t.$toast(e.msg)})).catch((function(t){}))},getAgentSign:function(t,e){var n=this;wx.agentConfig({corpid:t.appId,agentid:this.agentData.agentid,timestamp:t.timestamp,nonceStr:t.nonceStr,signature:e,jsApiList:["getCurExternalContact"],success:function(){wx.invoke("getCurExternalContact",{},(function(t){"getCurExternalContact:ok"==t.err_msg?n.getCustomerInfo(t.userId):n.$toast("获取当前外部联系人失败!")}))},fail:function(t){n.$toast("agentConfig调用失败")}})},getCustomerInfo:function(t){var e=this;$http.get("plugin.wechat-chat-sidebar.frontend.controller.index.get-customer-info",{user_id:t},"loading").then((function(n){1===n.result?e.$dialog.alert({message:n.msg+t}):e.$toast(n.msg)}))},getFaceStatus:function(){var t=this;$http.post("plugin.real-name-auth.frontend.auth.checkAuthStatus").then((function(e){1===e.result?1==e.data.auth_status?(t.timer&&(t.timer=null,clearInterval(t.timer)),window.location.href=t.$route.query.url):t.timer||(t.timer=setInterval((function(){t.getFaceStatus()}),3e3)):t.$dialog.alert({message:e.msg}).then((function(){t.$router.push(t.fun.getUrl("home"))}))})).catch((function(e){t.$router.push(t.fun.getUrl("home"))}))},getData:function(){var t=this;$http.post("plugin.credit-link.frontend.login.index",{user_mobile:this.fun.getKey("user_mobile"),superior_mobile:this.fun.getKey("superior_mobile"),sign:this.fun.getKey("sign"),app_id:this.fun.getKey("app_id"),timestamp:this.fun.getKey("timestamp"),number:this.fun.getKey("number"),point:this.fun.getKey("point"),notify_url:this.fun.getKey("notify_url")},"").then((function(e){t.$router.push(t.fun.getUrl("home"))})).catch((function(e){t.$router.push(t.fun.getUrl("home"))}))}}},o=a,s=n("2877"),u=Object(s["a"])(o,i,r,!1,null,"d5f6c460",null);e["default"]=u.exports}}]);