WinG před 2 roky
rodič
revize
39e3df832c

+ 22 - 1
pages/customservice/customservice.js

@@ -68,5 +68,26 @@ Page({
     return _request.share({
       sc: 'xcx_group'
     })
-  }
+  },
+  tokf(){
+	  console.log('oninfo');
+	  var that = this
+	  var url = 'v1/user/info'
+	  var params = {}
+	  var success = function (res) {
+		  let info = res.data;
+		  if(info.wx_user.id){
+			  let uurl = encodeURIComponent(`https://tfohowapi.hiwavo.com/h5yingyuchat.html?visitor_id=fohow-${info.wx_user.id}&visitor_name=${info.wx_user.nickname}&avator=${info.wx_user.head}&from=xcx`);
+			  console.log("uurl",uurl);
+			  wx.navigateTo({
+			    url: '/pages/web/web?id='+uurl
+			  })
+		  }else{
+			  wx.showToast({
+			    title: '请先登录'
+			  })
+		  }
+	  }
+	  _request.$get(url, params, success);
+  },
 })

+ 6 - 0
pages/customservice/customservice.wxml

@@ -24,5 +24,11 @@
   		<text>长按扫码联系客服</text>
   	</view>
   </view>
+  
+  <view class="kfqr-dialog">
+  	<view class="kfqr" bindtap="tokf">
+  		<text>跳转客服</text>
+  	</view>
+  </view>
 </view>
 

+ 8 - 2
pages/web/web.js

@@ -5,9 +5,15 @@ Page({
   },
   onLoad: function (options) {
     console.log(options)
-    var url = options.id
+    var url = options.id;
+	
+	
+	let links = decodeURIComponent(url);
+	if(!links){
+		links = url;
+	}
     this.setData({
-      url: url
+      url: links
     })
     // wx.setNavigationBarTitle({
     //   title: 'sdsd'