Commit 808b2a777e07254f801fba1f1d1c11eec8fd0c7e

Authored by yvan.ni
1 parent e5519737

在线客服的优化

packageA/pages/goodsInfo/goodsInfo.js
@@ -281,7 +281,9 @@ Page({ @@ -281,7 +281,9 @@ Page({
281 281
282 }; 282 };
283 283
284 - //-- 设置顶部高度 -- 284 +
  285 +
  286 + //-- 设置顶部高度 --
285 let height= getApp().globalData.navBarHeight; 287 let height= getApp().globalData.navBarHeight;
286 ee.setData({ gid: gid,top_nav:height}); 288 ee.setData({ gid: gid,top_nav:height});
287 289
@@ -645,14 +647,7 @@ Page({ @@ -645,14 +647,7 @@ Page({
645 var ee = this,gid = this.data.gid, i = getApp().request; 647 var ee = this,gid = this.data.gid, i = getApp().request;
646 648
647 //判断是不是要跳转到拼团服务卡 649 //判断是不是要跳转到拼团服务卡
648 - getApp().check_go_fw(gid,function (act,url){  
649 -  
650 - if(act){  
651 - wx.redirectTo({  
652 - url:url  
653 - })  
654 - return false;  
655 - } 650 + this.check_go_act_fw(gid,function (){
656 651
657 th.data.is_timer = 1; 652 th.data.is_timer = 1;
658 //获取用户的默认门店 653 //获取用户的默认门店
@@ -881,10 +876,6 @@ Page({ @@ -881,10 +876,6 @@ Page({
881 if(!th.data.prom_type) th.get_sto(); 876 if(!th.data.prom_type) th.get_sto();
882 }) 877 })
883 878
884 -  
885 -  
886 -  
887 -  
888 879
889 }, 880 },
890 881
@@ -4460,6 +4451,64 @@ Page({ @@ -4460,6 +4451,64 @@ Page({
4460 }, 4451 },
4461 4452
4462 4453
  4454 + async check_go_act_fw(gid,func){
  4455 +
  4456 + if(this.data.options.prom_type==1){
  4457 + func();
  4458 + return false;
  4459 + }
  4460 +
  4461 + var th=this;
  4462 + var rurl = '/api/weshop/activitylist/listGoodActInfo2New';
  4463 + var req_d = {
  4464 + "store_id": getApp().globalData.setting.stoid,
  4465 + "goods_id": gid,
  4466 + "user_id": getApp().globalData.user_id || 0,
  4467 + "goods_type":1
  4468 + }
  4469 + var res= await getApp().request.promiseGet(rurl, {data: req_d});
  4470 +
  4471 + var url = "/packageA/pages/goodsInfo/goodsInfo?goods_id=" + gid;
  4472 + if (res.data.code == 0 && res.data.data && res.data.data.length > 0) {
  4473 + var arr = res.data.data;
  4474 + let times = new Date().getTime();
  4475 + //-- 预热也要计算 --
  4476 + var arr2 = arr.filter(function (e) {
  4477 + return e.s_time < ut.gettimestamp() || (e.warm_uptime && e.warm_uptime < ut.gettimestamp())
  4478 + })
  4479 + if(arr2.length==1) {
  4480 + switch(arr2[0].prom_type){
  4481 + case 1:
  4482 + //url+="&prom_type=1&prom_id="+arr2[0].act_id;
  4483 + th.data.options.prom_id=arr2[0].act_id;
  4484 + th.data.options.prom_type=1;
  4485 + url='';
  4486 + break;
  4487 + case 2:
  4488 + url="/packageG/pages/group_buy/goodsInfo/goodsInfo?goods_id="+gid+"&prom_id="+arr2[0].act_id;
  4489 + break;
  4490 + case 6:
  4491 + url = `/packageA/pages/serviceCard_pd/goodsInfo/goodsInfo?goods_id=${gid}&prom_type=${arr2[0].prom_type}&prom_id=${arr2[0].act_id}`;
  4492 + break;
  4493 + case 8:
  4494 + url = `/packageC/pages/presell/cardInfo/goodsInfo?goods_id=${gid}&prom_id=${arr2[0].act_id}`;
  4495 + break;
  4496 + }
  4497 + if(url){
  4498 + wx.redirectTo({
  4499 + url: url,
  4500 + });
  4501 + return false;
  4502 +
  4503 + }
  4504 + }
  4505 +
  4506 + }
  4507 +
  4508 + func();
  4509 + }
  4510 +
  4511 +
4463 }); 4512 });
4464 4513
4465 4514
packageG/pages/customer_chat/customer_chat.js
@@ -25,9 +25,9 @@ Page({ @@ -25,9 +25,9 @@ Page({
25 return false; 25 return false;
26 } 26 }
27 27
28 - let url= os.h5_host+"/mchat/mbchat/index?goods_id="+goods_id+"&stoid="+os.stoid+"&user_id="+user_id; 28 + let url= os.h5_host+"/mchat/mbchat/index?is_webview=1&goods_id="+goods_id+"&stoid="+os.stoid+"&user_id="+user_id;
29 if(type) 29 if(type)
30 - url= os.h5_host+"/mchat/mbchat/index?card_id="+goods_id+"&stoid="+os.stoid+"&user_id="+user_id; 30 + url= os.h5_host+"/mchat/mbchat/index?is_webview=1&card_id="+goods_id+"&stoid="+os.stoid+"&user_id="+user_id;
31 31
32 console.log("chat"+url); 32 console.log("chat"+url);
33 this.setData({ 33 this.setData({