| 
					
				 | 
			
			
				@@ -3,13 +3,15 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     <view class="hangkuai">允许小程序使用我的</view> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     <view class="hangkuai"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       <text>向我发送服务通知</text> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      <img src="@/static/open.png"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      <img src="@/static/open.png" /> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     </view> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     <view class="hangkuai"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       <text>接受工单通知</text> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      <img src="@/static/open.png"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      <img src="@/static/open.png" /> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     </view> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    <view class="zhuangtai" v-if="bindStatus != 0"><text>{{ bindStatusName[bindStatus] }}</text></view> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    <view class="zhuangtai" v-if="bindStatus != 0" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      ><text>{{ bindStatusName[bindStatus] }}</text></view 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    > 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     <view class="anniuyangs" v-if="bindStatus == 1 && wx_url != ''"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       <view @click="confirm">授权接收订阅消息</view> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     </view> 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -20,30 +22,29 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 export default { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   data() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     return { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      appid: "", 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      code: "", 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      bindStatusName: ["", "未授权", "已授权"], 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      appid: '', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      code: '', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      bindStatusName: ['', '未授权', '已授权'], 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       bindStatus: 0, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      wx_url: "" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      wx_url: '' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   onLoad({ appid, code, state }) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     this.appid = appid || state 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     this.code = code 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     if (appid && !code) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      window.location.href = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${this.appid 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        }&redirect_uri=${location.href 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        }&response_type=code&scope=snsapi_userinfo&state=${this.appid 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        }#wechat_redirect`; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      window.location.href = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${this.appid}&redirect_uri=${location.href}&response_type=code&scope=snsapi_userinfo&state=${this.appid}#wechat_redirect` 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       // 获取绑定状态 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      this.$api.post('/user/pub/auth', { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        code: this.code, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        pubAppId: this.appid, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      }).then(res => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        this.bindStatus = res.data ? 1 : 2; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        this.wx_url = res.data; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      }) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      this.$api 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        .post('/user/pub/auth', { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          code: this.code, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          pubAppId: this.appid 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        }) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        .then(res => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          this.bindStatus = res.data ? 1 : 2 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          this.wx_url = res.data 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        }) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   methods: { 
			 |