Commit 5969ea79f6f4390775fefb70dfe6cef8d9380694

Authored by yvan.ni
1 parent a4f59d59

导购业绩归属的bug优化,

秒杀列表 拼单列表 搭配购  参团详情页
packageA/pages/prom_list/prom_list.js
@@ -43,8 +43,20 @@ Page({ @@ -43,8 +43,20 @@ Page({
43 //------初始化加载---------- 43 //------初始化加载----------
44 onLoad: function(t) { 44 onLoad: function(t) {
45 var goods_id=t.goods_id; 45 var goods_id=t.goods_id;
46 - this.setData({gid:goods_id}); 46 + this.setData({gid:goods_id});
47 var ee=this,th=ee,that=ee; 47 var ee=this,th=ee,that=ee;
  48 + var first_leader=t.first_leader;
  49 + if(first_leader){
  50 + getApp().globalData.first_leader=first_leader;
  51 + //调用接口判断是不是会员
  52 + getApp().request.promiseGet("/api/weshop/shoppingGuide/get/"+os.stoid+"/"+first_leader,{}).then(res=>{
  53 + if(res.data.code==0){
  54 + getApp().globalData.guide_id=res.data.data.id;
  55 + }
  56 + })
  57 + }
  58 +
  59 +
48 //----获取系统参数,并判断等级价格----- 60 //----获取系统参数,并判断等级价格-----
49 getApp().getConfig2(function(e) { 61 getApp().getConfig2(function(e) {
50 var json_d = JSON.parse(e.switch_list); 62 var json_d = JSON.parse(e.switch_list);
@@ -323,7 +335,6 @@ Page({ @@ -323,7 +335,6 @@ Page({
323 a = 0, 335 a = 0,
324 o = this.data.data; 336 o = this.data.data;
325 a = o.goods_id; 337 a = o.goods_id;
326 -  
327 //----------添加到购物车时,要判断限购数量,-------- 338 //----------添加到购物车时,要判断限购数量,--------
328 e.get_buy_num(o, function(ee) { 339 e.get_buy_num(o, function(ee) {
329 //---判断商品是否超出限购--- 340 //---判断商品是否超出限购---
pages/activity/pind_list/pind_list.js
@@ -17,6 +17,24 @@ Page({ @@ -17,6 +17,24 @@ Page({
17 iurl: os.imghost, 17 iurl: os.imghost,
18 }, 18 },
19 19
  20 + //------初始化加载----------
  21 + onLoad: function(t) {
  22 + var first_leader = t.first_leader;
  23 +
  24 + console.log("------------");
  25 + console.log(first_leader);
  26 +
  27 + if (first_leader) {
  28 + getApp().globalData.first_leader = first_leader;
  29 + //调用接口判断是不是会员
  30 + getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + first_leader, {}).then(res => {
  31 + if (res.data.code == 0) {
  32 + getApp().globalData.guide_id = res.data.data.id;
  33 + }
  34 + })
  35 + }
  36 + },
  37 +
20 onShow: function(t) { 38 onShow: function(t) {
21 39
22 wx.setNavigationBarTitle({ title: "天天拼单",}) 40 wx.setNavigationBarTitle({ title: "天天拼单",})
@@ -143,6 +161,9 @@ Page({ @@ -143,6 +161,9 @@ Page({
143 pagePath+="?first_leader="+getApp().globalData.user_id; 161 pagePath+="?first_leader="+getApp().globalData.user_id;
144 } 162 }
145 } 163 }
  164 +
  165 + console.log("11"+pagePath);
  166 +
146 return { 167 return {
147 title: "限时团购", 168 title: "限时团购",
148 path:pagePath, 169 path:pagePath,
pages/activity/seckill_list/seckill_list.js
@@ -12,6 +12,26 @@ Page({ @@ -12,6 +12,26 @@ Page({
12 ismore:1, //是否可以加载更多 12 ismore:1, //是否可以加载更多
13 isshow:0, 13 isshow:0,
14 }, 14 },
  15 +
  16 + //------初始化加载----------
  17 + onLoad: function(t) {
  18 + var first_leader = t.first_leader;
  19 +
  20 + console.log("------------");
  21 + console.log(first_leader);
  22 +
  23 + if (first_leader) {
  24 + getApp().globalData.first_leader = first_leader;
  25 + //调用接口判断是不是会员
  26 + getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + first_leader, {}).then(res => {
  27 + if (res.data.code == 0) {
  28 + getApp().globalData.guide_id = res.data.data.id;
  29 + }
  30 + })
  31 + }
  32 + },
  33 +
  34 +
15 onShow: function(t) { 35 onShow: function(t) {
16 36
17 wx.setNavigationBarTitle({ title: "商品秒杀",}) 37 wx.setNavigationBarTitle({ title: "商品秒杀",})
@@ -140,6 +160,8 @@ Page({ @@ -140,6 +160,8 @@ Page({
140 pagePath+="?first_leader="+getApp().globalData.user_id; 160 pagePath+="?first_leader="+getApp().globalData.user_id;
141 } 161 }
142 } 162 }
  163 +
  164 + console.log("11"+pagePath);
143 return { 165 return {
144 title: "限时秒杀", 166 title: "限时秒杀",
145 path:pagePath, 167 path:pagePath,
pages/cart/cart2_pt/cart2_pt.js
@@ -353,7 +353,7 @@ Page({ @@ -353,7 +353,7 @@ Page({
353 }); 353 });
354 }, 354 },
355 //--------------------提交订单----------------------- 355 //--------------------提交订单-----------------------
356 - submitForm:function(t){ 356 + submitForm: async function(t){
357 if(this.data.is_summit_ing==1) return false; //--提交中退出-- 357 if(this.data.is_summit_ing==1) return false; //--提交中退出--
358 this.data.is_summit_ing=1; 358 this.data.is_summit_ing=1;
359 359
@@ -440,6 +440,13 @@ Page({ @@ -440,6 +440,13 @@ Page({
440 if(gg.guide_id){ 440 if(gg.guide_id){
441 goods.guide_id=gg.guide_id; 441 goods.guide_id=gg.guide_id;
442 goods.guide_type=gg.guide_type; 442 goods.guide_type=gg.guide_type;
  443 + //调用接口判断是不是会员
  444 + await getApp().request.promiseGet("/api/weshop/shoppingGuide/getId/"+oo.stoid+"/"+gg.guide_id,{}).then(res=>{
  445 + if(res.data.code==0){
  446 + goods.guide_name=res.data.data.salesman;
  447 + goods.guide_sn=res.data.data.salesman_no;
  448 + }
  449 + })
443 } 450 }
444 451
445 item.order_goods.push(goods); 452 item.order_goods.push(goods);
pages/goods/goodsInfo/goodsInfo.js
@@ -2799,6 +2799,19 @@ Page({ @@ -2799,6 +2799,19 @@ Page({
2799 sku: o.sku, 2799 sku: o.sku,
2800 }; 2800 };
2801 2801
  2802 + //---是不是从收藏夹出来的---
  2803 + if(th.data.c_guide_id){
  2804 + newd['guide_id'] = th.data.c_guide_id;
  2805 + newd['guide_type']=2;
  2806 +
  2807 + }else{
  2808 + if(getApp().globalData.guide_id){
  2809 + newd['guide_id'] = getApp().globalData.guide_id;
  2810 + newd['guide_type']=0;
  2811 +
  2812 + }
  2813 + }
  2814 +
2802 //---如果商品不是积分购和拼团,要判断一个是否要进行等级价的判断------ 2815 //---如果商品不是积分购和拼团,要判断一个是否要进行等级价的判断------
2803 2816
2804 if(th.data.is_normal == 1){ 2817 if(th.data.is_normal == 1){
@@ -3196,7 +3209,7 @@ Page({ @@ -3196,7 +3209,7 @@ Page({
3196 var vpath = res.path; 3209 var vpath = res.path;
3197 var context = wx.createCanvasContext('share'); 3210 var context = wx.createCanvasContext('share');
3198 //先画背景 3211 //先画背景
3199 - var pg_path = "/pacj/images/share/share_bg.png"; 3212 + var pg_path = "../../../images/share/share_bg.png";
3200 context.drawImage(pg_path, 0, 0, 554 * unit, 899 * unit); 3213 context.drawImage(pg_path, 0, 0, 554 * unit, 899 * unit);
3201 //--昵称--- 3214 //--昵称---
3202 context.setFontSize(24 * unit) 3215 context.setFontSize(24 * unit)
pages/team/team_show/team_show.js
@@ -66,7 +66,7 @@ Page({ @@ -66,7 +66,7 @@ Page({
66 wx.setNavigationBarTitle({ title: "拼团订单",}) 66 wx.setNavigationBarTitle({ title: "拼团订单",})
67 //var postdata=getApp().globalData.to_group; 67 //var postdata=getApp().globalData.to_group;
68 var postdata=options; 68 var postdata=options;
69 - var tg_id = postdata.tg_id, first_leader=t.first_leader; 69 + var tg_id = postdata.tg_id, first_leader=options.first_leader;
70 //如果tg_id是空的话 70 //如果tg_id是空的话
71 if(tg_id==undefined || tg_id==null || tg_id==""){ 71 if(tg_id==undefined || tg_id==null || tg_id==""){
72 var tg_id_str=decodeURIComponent(postdata.scene); 72 var tg_id_str=decodeURIComponent(postdata.scene);
@@ -585,7 +585,6 @@ Page({ @@ -585,7 +585,6 @@ Page({
585 }); 585 });
586 setTimeout(th.countDown2, 1000); 586 setTimeout(th.countDown2, 1000);
587 }, 587 },
588 -  
589 //--获取门店--- 588 //--获取门店---
590 async get_sto(e) { 589 async get_sto(e) {
591 var th = this, dd = null,i=getApp().request; 590 var th = this, dd = null,i=getApp().request;
@@ -758,6 +757,20 @@ Page({ @@ -758,6 +757,20 @@ Page({
758 goods_name: th.data.goods.goods_name, 757 goods_name: th.data.goods.goods_name,
759 goods_sn: th.data.goods.goods_sn, 758 goods_sn: th.data.goods.goods_sn,
760 }; 759 };
  760 +
  761 + //---是不是从收藏夹出来的---
  762 + if(th.data.c_guide_id){
  763 + newd['guide_id'] = th.data.c_guide_id;
  764 + newd['guide_type']=2;
  765 +
  766 + }else{
  767 + if(getApp().globalData.guide_id){
  768 + newd['guide_id'] = getApp().globalData.guide_id;
  769 + newd['guide_type']=0;
  770 +
  771 + }
  772 + }
  773 +
761 //-----拼团----- 774 //-----拼团-----
762 newd.goods_price = th.data.teamlist.price; 775 newd.goods_price = th.data.teamlist.price;
763 newd.prom_type = 6; 776 newd.prom_type = 6;
pages/team/team_success/team_success.js
@@ -674,7 +674,6 @@ Page({ @@ -674,7 +674,6 @@ Page({
674 674
675 }, 675 },
676 676
677 -  
678 //------ 分享配置 -------- 677 //------ 分享配置 --------
679 onShareAppMessage: function (e) { 678 onShareAppMessage: function (e) {
680 var th=this; 679 var th=this;
@@ -693,7 +692,7 @@ Page({ @@ -693,7 +692,7 @@ Page({
693 692
694 return { 693 return {
695 path:url, 694 path:url,
696 - title: "商品分类", 695 + title: th.data.teamlist.title,
697 imageUrl: img, 696 imageUrl: img,
698 } 697 }
699 }, 698 },