Commit 5575a681e1a099b28d6e4df52de9e9685c786382

Authored by WXD-SEASON\season
2 parents 58b40ef8 ede6219e

Merge branch 'test' of http://git.vipzhuang.cn/wxd/MShopWeApp into qa

packageA/pages/activity_share/activity_share.js
... ... @@ -673,12 +673,12 @@ Page({
673 673 //--定义的保存图片方法,分享团---
674 674 saveImageToPhotosAlbum: function() {
675 675 //--先判断会员状态--
676   - var user_info = getApp().globalData.userInfo;
677   - if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
678   - //getApp().my_warnning("请先登录",0,this);
679   - wx.navigateTo({ url: '/packageE/pages/togoin/togoin', })
680   - return false;
681   - }
  676 + // var user_info = getApp().globalData.userInfo;
  677 + // if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
  678 + // //getApp().my_warnning("请先登录",0,this);
  679 + // wx.navigateTo({ url: '/packageE/pages/togoin/togoin', })
  680 + // return false;
  681 + // }
682 682 //类型 0普通商品 1秒杀商品 2商家和会员团 3阶梯团
683 683 var type = 0;
684 684 wx.showLoading({
... ... @@ -752,6 +752,8 @@ Page({
752 752 pg_path=th.data.share_b_img;
753 753 }
754 754 context.drawImage(pg_path, 0, 0, 554 * unit, 899 * unit);
  755 +
  756 + let nick=app.globalData.userInfo?app.globalData.userInfo.nickname:'';
755 757  
756 758 //-- 是自定义海报的情况下 --
757 759 if(th.data.poster && parseInt(th.data.poster.style)==2){
... ... @@ -765,8 +767,8 @@ Page({
765 767 //--昵称---
766 768 context.setFontSize(24 * unit)
767 769 context.setFillStyle("black")
768   - context.fillText(app.globalData.userInfo.nickname, x1, y1);
769   - var width = 24 * app.globalData.userInfo.nickname.length * unit + 4 * unit;
  770 + context.fillText(nick, x1, y1);
  771 + var width = 24 * nick.length * unit + 4 * unit;
770 772 //强烈推荐 改许程
771 773 var tj_path = "../../../images/share/q_tj.png";
772 774 context.drawImage(tj_path, x1 + width, y1-22*unit, 85 * unit, 30 * unit);
... ... @@ -779,8 +781,8 @@ Page({
779 781 //--昵称---
780 782 context.setFontSize(24 * unit)
781 783 context.setFillStyle("black")
782   - context.fillText(app.globalData.userInfo.nickname, 152 * unit, 76 * unit);
783   - var width = 24 * app.globalData.userInfo.nickname.length * unit + 2 * unit;
  784 + context.fillText(nick, 152 * unit, 76 * unit);
  785 + var width = 24 * nick.length * unit + 2 * unit;
784 786 //强烈推荐 改许程
785 787 var tj_path = "../../../images/share/q_tj.png";
786 788 context.drawImage(tj_path, 152 * unit + width, 54 * unit, 85 * unit, 30 * unit);
... ... @@ -1085,12 +1087,12 @@ Page({
1085 1087 share_index:function(e){
1086 1088  
1087 1089 //--先判断会员状态--
1088   - var user_info = getApp().globalData.userInfo;
1089   - if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
1090   - //getApp().my_warnning("请先登录",0,this);
1091   - wx.navigateTo({ url: '/packageE/pages/togoin/togoin', })
1092   - return false;
1093   - }
  1090 + // var user_info = getApp().globalData.userInfo;
  1091 + // if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
  1092 + // //getApp().my_warnning("请先登录",0,this);
  1093 + // wx.navigateTo({ url: '/packageE/pages/togoin/togoin', })
  1094 + // return false;
  1095 + // }
1094 1096  
1095 1097 var index=e.currentTarget.dataset.index;
1096 1098 var item=this.data.list[index];
... ... @@ -1104,12 +1106,12 @@ Page({
1104 1106 //---点击分享商品---
1105 1107 share_good:function(e){
1106 1108 //--先判断会员状态--
1107   - var user_info = getApp().globalData.userInfo;
1108   - if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
1109   - //getApp().my_warnning("请先登录",0,this);
1110   - wx.navigateTo({ url: '/packageE/pages/togoin/togoin', })
1111   - return false;
1112   - }
  1109 + // var user_info = getApp().globalData.userInfo;
  1110 + // if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
  1111 + // //getApp().my_warnning("请先登录",0,this);
  1112 + // wx.navigateTo({ url: '/packageE/pages/togoin/togoin', })
  1113 + // return false;
  1114 + // }
1113 1115 var index=e.currentTarget.dataset.index;
1114 1116 var item=this.data.list[index];
1115 1117 //如果是搭配购
... ... @@ -1126,12 +1128,12 @@ Page({
1126 1128 //----活动详情里面的分享---
1127 1129 share_good2:function(e){
1128 1130 //--先判断会员状态--
1129   - var user_info = getApp().globalData.userInfo;
1130   - if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
1131   - //getApp().my_warnning("请先登录",0,this);
1132   - wx.navigateTo({ url: '/packageE/pages/togoin/togoin', })
1133   - return false;
1134   - }
  1131 + // var user_info = getApp().globalData.userInfo;
  1132 + // if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
  1133 + // //getApp().my_warnning("请先登录",0,this);
  1134 + // wx.navigateTo({ url: '/packageE/pages/togoin/togoin', })
  1135 + // return false;
  1136 + // }
1135 1137  
1136 1138 var index=e.currentTarget.dataset.index;
1137 1139 var item=this.data.list2[index];
... ... @@ -1144,12 +1146,12 @@ Page({
1144 1146 share_detail:function(e){
1145 1147  
1146 1148 //--先判断会员状态--
1147   - var user_info = getApp().globalData.userInfo;
1148   - if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
1149   - //getApp().my_warnning("请先登录",0,this);
1150   - wx.navigateTo({ url: '/packageE/pages/togoin/togoin', })
1151   - return false;
1152   - }
  1149 + // var user_info = getApp().globalData.userInfo;
  1150 + // if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
  1151 + // //getApp().my_warnning("请先登录",0,this);
  1152 + // wx.navigateTo({ url: '/packageE/pages/togoin/togoin', })
  1153 + // return false;
  1154 + // }
1153 1155  
1154 1156 var com = this.selectComponent("#share_button"); //组件的id
1155 1157 com.set_type(0);
... ... @@ -1171,7 +1173,7 @@ Page({
1171 1173 return false;
1172 1174 }
1173 1175 //---获取分享图片的本地地址,头像和商品图片----
1174   - var path2 = getApp().globalData.userInfo.head_pic;
  1176 + var path2 = getApp().globalData.userInfo?getApp().globalData.userInfo.head_pic:'';
1175 1177 if (path2 == "") {
1176 1178 ee.data.share_head = "../../../images/share/hui_hear_pic.png";
1177 1179 tt(func);
... ...
packageA/pages/goodsInfo/goodsInfo.js
... ... @@ -2096,12 +2096,12 @@ Page({
2096 2096 //--定义的保存图片方法,分享团---
2097 2097 saveImageToPhotosAlbum: function() {
2098 2098 //--先判断会员状态--
2099   - var user_info = getApp().globalData.userInfo;
2100   - if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
2101   - //getApp().my_warnning("请先登录",0,this);
2102   - wx.navigateTo({ url: '/packageE/pages/togoin/togoin', })
2103   - return false;
2104   - }
  2099 + // var user_info = getApp().globalData.userInfo;
  2100 + // if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
  2101 + // //getApp().my_warnning("请先登录",0,this);
  2102 + // wx.navigateTo({ url: '/packageE/pages/togoin/togoin', })
  2103 + // return false;
  2104 + // }
2105 2105  
2106 2106 //类型 0普通商品 1秒杀商品 2商家和会员团 3阶梯团 4阶梯团
2107 2107 var type = this.data.prom_type;
... ...
packageA/pages/goods_share/goods_share.js
... ... @@ -114,9 +114,9 @@ Page({
114 114 }
115 115 })
116 116  
117   - if(!app.globalData.userInfo) {
118   - getApp().goto("/packageE/pages/togoin/togoin");
119   - }
  117 + // if(!app.globalData.userInfo) {
  118 + // getApp().goto("/packageE/pages/togoin/togoin");
  119 + // }
120 120  
121 121  
122 122 },
... ... @@ -368,12 +368,12 @@ Page({
368 368 //--定义的保存图片方法,分享团---
369 369 saveImageToPhotosAlbum: function() {
370 370 //--先判断会员状态--
371   - var user_info = getApp().globalData.userInfo;
372   - if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
373   - //getApp().my_warnning("请先登录",0,this);
374   - wx.navigateTo({ url: '/packageE/pages/togoin/togoin', })
375   - return false;
376   - }
  371 + // var user_info = getApp().globalData.userInfo;
  372 + // if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
  373 + // //getApp().my_warnning("请先登录",0,this);
  374 + // wx.navigateTo({ url: '/packageE/pages/togoin/togoin', })
  375 + // return false;
  376 + // }
377 377 //类型 0普通商品 1秒杀商品 2商家和会员团 3阶梯团
378 378 var type = 0;
379 379 wx.showLoading({
... ... @@ -416,7 +416,9 @@ Page({
416 416 pg_path=th.data.share_b_img;
417 417 }
418 418 context.drawImage(pg_path, 0, 0, 554 * unit, 899 * unit);
419   -
  419 +
  420 +
  421 + let nick=app.globalData.userInfo?app.globalData.userInfo.nickname:'';
420 422 //-- 是自定义海报的情况下 --
421 423 if(th.data.poster && parseInt(th.data.poster.style)==2){
422 424 //在线上分享人的情况下
... ... @@ -429,8 +431,8 @@ Page({
429 431 //--昵称---
430 432 context.setFontSize(24 * unit)
431 433 context.setFillStyle("black")
432   - context.fillText(app.globalData.userInfo.nickname, x1, y1);
433   - var width = 24 * app.globalData.userInfo.nickname.length * unit + 4 * unit;
  434 + context.fillText(nick, x1, y1);
  435 + var width = 24 * nick.length * unit + 4 * unit;
434 436 //强烈推荐 改许程
435 437 var tj_path = "../../../images/share/q_tj.png";
436 438 context.drawImage(tj_path, x1 + width, y1-22*unit, 85 * unit, 30 * unit);
... ... @@ -443,8 +445,8 @@ Page({
443 445 //--昵称---
444 446 context.setFontSize(24 * unit)
445 447 context.setFillStyle("black")
446   - context.fillText(app.globalData.userInfo.nickname, 152 * unit, 76 * unit);
447   - var width = 24 * app.globalData.userInfo.nickname.length * unit + 2 * unit;
  448 + context.fillText(nick, 152 * unit, 76 * unit);
  449 + var width = 24 * nick.length * unit + 2 * unit;
448 450 //强烈推荐 改许程
449 451 var tj_path = "../../../images/share/q_tj.png";
450 452 context.drawImage(tj_path, 152 * unit + width, 54 * unit, 85 * unit, 30 * unit);
... ... @@ -749,12 +751,12 @@ Page({
749 751 //点击分享商品
750 752 share_good:function(e){
751 753 //--先判断会员状态--
752   - var user_info = getApp().globalData.userInfo;
753   - if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
754   - //getApp().my_warnning("请先登录",0,this);
755   - wx.navigateTo({ url: '/packageE/pages/togoin/togoin', })
756   - return false;
757   - }
  754 + // var user_info = getApp().globalData.userInfo;
  755 + // if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
  756 + // //getApp().my_warnning("请先登录",0,this);
  757 + // wx.navigateTo({ url: '/packageE/pages/togoin/togoin', })
  758 + // return false;
  759 + // }
758 760  
759 761 var index=e.currentTarget.dataset.index;
760 762 var item=this.data.list[index];
... ... @@ -773,7 +775,7 @@ Page({
773 775 return false;
774 776 }
775 777 //---获取分享图片的本地地址,头像和商品图片----
776   - var path2 = getApp().globalData.userInfo.head_pic;
  778 + var path2 = getApp().globalData.userInfo?getApp().globalData.userInfo.head_pic:'';
777 779 if (path2 == "") {
778 780 ee.data.share_head = "../../../images/share/hui_hear_pic.png";
779 781 tt(func);
... ...
packageA/pages/live_share/live_share.js
... ... @@ -166,12 +166,12 @@ Page({
166 166 share_index:function(e){
167 167  
168 168 //--先判断会员状态--
169   - var user_info = getApp().globalData.userInfo;
170   - if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
171   - //getApp().my_warnning("请先登录",0,this);
172   - wx.navigateTo({ url: '/packageE/pages/togoin/togoin', })
173   - return false;
174   - }
  169 + // var user_info = getApp().globalData.userInfo;
  170 + // if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
  171 + // //getApp().my_warnning("请先登录",0,this);
  172 + // wx.navigateTo({ url: '/packageE/pages/togoin/togoin', })
  173 + // return false;
  174 + // }
175 175  
176 176 var index=e.currentTarget.dataset.index;
177 177 var item=this.data.list[index];
... ...
packageA/pages/quan/quan.js
... ... @@ -123,26 +123,7 @@ Page({
123 123 }
124 124 })
125 125 },
126   -
127   -
128   - //---点击分享优惠活动---
129   - share_index:function(e){
130   -
131   - //--先判断会员状态--
132   - var user_info = getApp().globalData.userInfo;
133   - if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
134   - //getApp().my_warnning("请先登录",0,this);
135   - wx.navigateTo({ url: '/packageE/pages/togoin/togoin', })
136   - return false;
137   - }
138   -
139   - var index=e.currentTarget.dataset.index;
140   - var item=this.data.list[index];
141   - this.setData({share_hidden:0,hui_active:item});
142   -
143   - var com = this.selectComponent("#share_button"); //组件的id
144   - com.set_type(1);
145   - },
  126 +
146 127 //-- ---更多加载----
147 128 refresh:function(){
148 129 this.requestGoodsList();
... ... @@ -152,12 +133,12 @@ Page({
152 133 share_index:function(e){
153 134  
154 135 //--先判断会员状态--
155   - var user_info = getApp().globalData.userInfo;
156   - if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
157   - //getApp().my_warnning("请先登录",0,this);
158   - wx.navigateTo({ url: '/packageE/pages/togoin/togoin', })
159   - return false;
160   - }
  136 + // var user_info = getApp().globalData.userInfo;
  137 + // if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
  138 + // //getApp().my_warnning("请先登录",0,this);
  139 + // wx.navigateTo({ url: '/packageE/pages/togoin/togoin', })
  140 + // return false;
  141 + // }
161 142  
162 143 var index=e.currentTarget.dataset.index;
163 144 var item=this.data.list[index];
... ...
packageA/pages/service_share/service_share.js
... ... @@ -341,12 +341,12 @@ Page({
341 341 //--定义的保存图片方法,分享团---
342 342 saveImageToPhotosAlbum: function() {
343 343 //--先判断会员状态--
344   - var user_info = getApp().globalData.userInfo;
345   - if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
346   - //getApp().my_warnning("请先登录",0,this);
347   - wx.navigateTo({ url: '/packageE/pages/togoin/togoin', })
348   - return false;
349   - }
  344 + // var user_info = getApp().globalData.userInfo;
  345 + // if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
  346 + // //getApp().my_warnning("请先登录",0,this);
  347 + // wx.navigateTo({ url: '/packageE/pages/togoin/togoin', })
  348 + // return false;
  349 + // }
350 350 //类型 0普通商品 1秒杀商品 2商家和会员团 3阶梯团
351 351 var type = 0;
352 352 wx.showLoading({
... ... @@ -391,7 +391,9 @@ Page({
391 391 pg_path=th.data.share_b_img;
392 392 }
393 393 context.drawImage(pg_path, 0, 0, 554 * unit, 899 * unit);
394   -
  394 +
  395 +
  396 + let nick=app.globalData.userInfo?app.globalData.userInfo.nickname:'';
395 397 //-- 是自定义海报的情况下 --
396 398 if(th.data.poster && parseInt(th.data.poster.style)==2){
397 399 //在线上分享人的情况下
... ... @@ -404,8 +406,8 @@ Page({
404 406 //--昵称---
405 407 context.setFontSize(24 * unit)
406 408 context.setFillStyle("black")
407   - context.fillText(app.globalData.userInfo.nickname, x1, y1);
408   - var width = 24 * app.globalData.userInfo.nickname.length * unit + 4 * unit;
  409 + context.fillText(nick, x1, y1);
  410 + var width = 24 * nick.length * unit + 4 * unit;
409 411 //强烈推荐 改许程
410 412 var tj_path = "../../../images/share/q_tj.png";
411 413 context.drawImage(tj_path, x1 + width, y1-22*unit, 85 * unit, 30 * unit);
... ... @@ -418,8 +420,8 @@ Page({
418 420 //--昵称---
419 421 context.setFontSize(24 * unit)
420 422 context.setFillStyle("black")
421   - context.fillText(app.globalData.userInfo.nickname, 152 * unit, 76 * unit);
422   - var width = 24 * app.globalData.userInfo.nickname.length * unit + 2 * unit;
  423 + context.fillText(nick, 152 * unit, 76 * unit);
  424 + var width = 24 * nick.length * unit + 2 * unit;
423 425 //强烈推荐 改许程
424 426 var tj_path = "../../../images/share/q_tj.png";
425 427 context.drawImage(tj_path, 152 * unit + width, 54 * unit, 85 * unit, 30 * unit);
... ... @@ -728,12 +730,12 @@ Page({
728 730 //点击分享商品
729 731 share_good:function(e){
730 732 //--先判断会员状态--
731   - var user_info = getApp().globalData.userInfo;
732   - if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
733   - //getApp().my_warnning("请先登录",0,this);
734   - wx.navigateTo({ url: '/packageE/pages/togoin/togoin', })
735   - return false;
736   - }
  733 + // var user_info = getApp().globalData.userInfo;
  734 + // if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
  735 + // //getApp().my_warnning("请先登录",0,this);
  736 + // wx.navigateTo({ url: '/packageE/pages/togoin/togoin', })
  737 + // return false;
  738 + // }
737 739  
738 740 var index=e.currentTarget.dataset.index;
739 741 var item=this.data.list[index];
... ... @@ -752,7 +754,7 @@ Page({
752 754 return false;
753 755 }
754 756 //---获取分享图片的本地地址,头像和商品图片----
755   - var path2 = getApp().globalData.userInfo.head_pic;
  757 + var path2 = getApp().globalData.userInfo?getApp().globalData.userInfo.head_pic:'';
756 758 if (path2 == "") {
757 759 ee.data.share_head = "../../../images/share/hui_hear_pic.png";
758 760 tt(func);
... ...
packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.js
... ... @@ -568,16 +568,16 @@ Page({
568 568  
569 569  
570 570 //--先判断会员登陆状态--
571   - var user_info = getApp().globalData.userInfo;
572   - if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
573   -
574   - getApp().is_Single_page(th, function () {
575   - wx.navigateTo({
576   - url: '/packageE/pages/togoin/togoin',
577   - })
578   - return false;
579   - })
580   - }
  571 + // var user_info = getApp().globalData.userInfo;
  572 + // if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
  573 + //
  574 + // getApp().is_Single_page(th, function () {
  575 + // wx.navigateTo({
  576 + // url: '/packageE/pages/togoin/togoin',
  577 + // })
  578 + // return false;
  579 + // })
  580 + // }
581 581 },
582 582  
583 583 //-- 获取直播的分享人的导购信息 --
... ... @@ -5320,14 +5320,17 @@ Page({
5320 5320 context.setFillStyle('black');
5321 5321 context.fillText(shopName, 277 * unit, 60 * unit);
5322 5322 // // 3.推荐来源
5323   - let fromText = `来自${getApp().globalData.userInfo.nickname}的推荐`;
5324   - // let fromTextLen = context.measureText(fromText);
5325   - // let x_fromText = (375 - fromTextLen.width)/2;
5326   - // console.log('222222',fromTextLen,x_fromText);
5327   - context.setTextAlign('center');
5328   - context.setFontSize(22 * unit);
5329   - context.setFillStyle('#96959a');
5330   - context.fillText(fromText, 277 * unit, 105 * unit);
  5323 +
  5324 + if(getApp().globalData.userInfo) {
  5325 + let fromText = `来自${getApp().globalData.userInfo.nickname}的推荐`;
  5326 + // let fromTextLen = context.measureText(fromText);
  5327 + // let x_fromText = (375 - fromTextLen.width)/2;
  5328 + // console.log('222222',fromTextLen,x_fromText);
  5329 + context.setTextAlign('center');
  5330 + context.setFontSize(22 * unit);
  5331 + context.setFillStyle('#96959a');
  5332 + context.fillText(fromText, 277 * unit, 105 * unit);
  5333 + }
5331 5334 // 4.海报背景
5332 5335 // context.beginPath();
5333 5336 // context.setStrokeStyle('#f2f1f6');
... ... @@ -5423,12 +5426,12 @@ Page({
5423 5426 //--定义的保存图片方法,分享团---
5424 5427 saveImageToPhotosAlbum: function () {
5425 5428 //--先判断会员状态--
5426   - var user_info = getApp().globalData.userInfo;
5427   - if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
5428   - //getApp().my_warnning("请先登录",0,this);
5429   - wx.navigateTo({ url: '/packageE/pages/togoin/togoin', })
5430   - return false;
5431   - }
  5429 + // var user_info = getApp().globalData.userInfo;
  5430 + // if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
  5431 + // //getApp().my_warnning("请先登录",0,this);
  5432 + // wx.navigateTo({ url: '/packageE/pages/togoin/togoin', })
  5433 + // return false;
  5434 + // }
5432 5435  
5433 5436 if (this.data.share_hidden) {
5434 5437 this.setData({ share_hidden: false, });
... ... @@ -5497,7 +5500,7 @@ Page({
5497 5500 };
5498 5501  
5499 5502  
5500   -
  5503 + let nick=app.globalData.userInfo?app.globalData.userInfo.nickname:'';
5501 5504  
5502 5505 //-- 是自定义海报的情况下 --
5503 5506 if (th.data.share_b_img ) {
... ... @@ -5515,8 +5518,8 @@ Page({
5515 5518 //--昵称---
5516 5519 context.setFontSize(24 * unit)
5517 5520 context.setFillStyle("black")
5518   - context.fillText(app.globalData.userInfo.nickname, x1, y1);
5519   - var width = 24 * app.globalData.userInfo.nickname.length * unit + 4 * unit;
  5521 + context.fillText(nick, x1, y1);
  5522 + var width = 24 * nick.length * unit + 4 * unit;
5520 5523 //强烈推荐 改许程
5521 5524 var tj_path = "../../../../images/share/q_tj.png";
5522 5525 context.drawImage(tj_path, x1 + width, y1 - 22 * unit, 85 * unit, 30 * unit);
... ... @@ -5870,9 +5873,9 @@ Page({
5870 5873 return false;
5871 5874 }
5872 5875 //---获取分享图片的本地地址,头像和商品图片----
5873   - var path2 = getApp().globalData.userInfo.head_pic;
  5876 + var path2 =getApp().globalData.userInfo?getApp().globalData.userInfo.head_pic:'';
5874 5877 if (path2 == "") {
5875   - ee.data.share_head = "../../../images/share/hui_hear_pic.png";
  5878 + ee.data.share_head = "../../../../images/share/hui_hear_pic.png";
5876 5879 tt(func);
5877 5880 } else {
5878 5881 path2 = path2.replace("http://thirdwx.qlogo.cn", "https://wx.qlogo.cn");
... ... @@ -6917,10 +6920,10 @@ Page({
6917 6920 },
6918 6921  
6919 6922 clickShare() {
6920   - if(!getApp().globalData.user_id){
6921   - getApp().goto("/packageE/pages/togoin/togoin");
6922   - return false;
6923   - }
  6923 + // if(!getApp().globalData.user_id){
  6924 + // getApp().goto("/packageE/pages/togoin/togoin");
  6925 + // return false;
  6926 + // }
6924 6927 this.setData({
6925 6928 share_hidden: true,
6926 6929 });
... ...
packageC/pages/presell/cardInfo/goodsInfo.js
... ... @@ -1961,7 +1961,7 @@ Page({
1961 1961 return false;
1962 1962 }
1963 1963 //---获取分享图片的本地地址,头像和商品图片----
1964   - var path2 = getApp().globalData.userInfo.head_pic;
  1964 + var path2 = getApp().globalData.userInfo?getApp().globalData.userInfo.head_pic:'';
1965 1965 if (path2 == "") {
1966 1966 ee.data.share_head = "../../../../images/share/hui_hear_pic.png";
1967 1967 tt(func);
... ... @@ -3359,10 +3359,10 @@ Page({
3359 3359 },
3360 3360  
3361 3361 clickShare() {
3362   - if (!getApp().globalData.user_id) {
3363   - getApp().goto("/packageE/pages/togoin/togoin");
3364   - return false;
3365   - }
  3362 + // if (!getApp().globalData.user_id) {
  3363 + // getApp().goto("/packageE/pages/togoin/togoin");
  3364 + // return false;
  3365 + // }
3366 3366 this.setData({ share_hidden: true, });
3367 3367 },
3368 3368  
... ... @@ -3388,12 +3388,12 @@ Page({
3388 3388 //--定义的保存图片方法,分享团---
3389 3389 saveImageToPhotosAlbum: function () {
3390 3390 //--先判断会员状态--
3391   - var user_info = getApp().globalData.userInfo;
3392   - if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
3393   - //getApp().my_warnning("请先登录",0,this);
3394   - wx.navigateTo({ url: '/packageE/pages/togoin/togoin', })
3395   - return false;
3396   - }
  3391 + // var user_info = getApp().globalData.userInfo;
  3392 + // if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
  3393 + // //getApp().my_warnning("请先登录",0,this);
  3394 + // wx.navigateTo({ url: '/packageE/pages/togoin/togoin', })
  3395 + // return false;
  3396 + // }
3397 3397  
3398 3398 if (this.data.share_hidden) {
3399 3399 this.setData({
... ... @@ -3454,6 +3454,8 @@ Page({
3454 3454 }
3455 3455 context.drawImage(pg_path, 0, 0, 554 * unit, 899 * unit);
3456 3456  
  3457 + let nick=app.globalData.userInfo?app.globalData.userInfo.nickname:'';
  3458 +
3457 3459 //-- 是自定义海报的情况下 --
3458 3460 if (th.data.poster && parseInt(th.data.poster.style) == 2) {
3459 3461 //在线上分享人的情况下
... ... @@ -3466,8 +3468,8 @@ Page({
3466 3468 //--昵称---
3467 3469 context.setFontSize(24 * unit)
3468 3470 context.setFillStyle("black")
3469   - context.fillText(app.globalData.userInfo.nickname, x1, y1);
3470   - var width = 24 * app.globalData.userInfo.nickname.length * unit + 4 * unit;
  3471 + context.fillText(nick, x1, y1);
  3472 + var width = 24 * nick.length * unit + 4 * unit;
3471 3473 //强烈推荐 改许程
3472 3474 var tj_path = "../../../../images/share/q_tj.png";
3473 3475 context.drawImage(tj_path, x1 + width, y1 - 22 * unit, 85 * unit, 30 * unit);
... ... @@ -3484,8 +3486,8 @@ Page({
3484 3486 //--昵称---
3485 3487 context.setFontSize(24 * unit)
3486 3488 context.setFillStyle("black")
3487   - context.fillText(app.globalData.userInfo.nickname, 152 * unit, 76 * unit);
3488   - var width = 24 * app.globalData.userInfo.nickname.length * unit + 2 * unit;
  3489 + context.fillText(nick, 152 * unit, 76 * unit);
  3490 + var width = 24 * nick.length * unit + 2 * unit;
3489 3491 //强烈推荐 改许程
3490 3492 var tj_path = "../../../../images/share/q_tj.png";
3491 3493 context.drawImage(tj_path, 152 * unit + width, 54 * unit, 85 * unit, 30 * unit);
... ... @@ -3703,12 +3705,12 @@ Page({
3703 3705 //--定义的保存图片方法,分享团---
3704 3706 saveImageToPhotosAlbumDef: function () {
3705 3707 //--先判断会员状态--
3706   - var user_info = getApp().globalData.userInfo;
3707   - if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
3708   - //getApp().my_warnning("请先登录",0,this);
3709   - wx.navigateTo({url: '/packageE/pages/togoin/togoin',})
3710   - return false;
3711   - }
  3708 + // var user_info = getApp().globalData.userInfo;
  3709 + // if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
  3710 + // //getApp().my_warnning("请先登录",0,this);
  3711 + // wx.navigateTo({url: '/packageE/pages/togoin/togoin',})
  3712 + // return false;
  3713 + // }
3712 3714  
3713 3715 if (this.data.share_hidden) {
3714 3716 this.setData({share_hidden: false,});
... ... @@ -3861,12 +3863,13 @@ Page({
3861 3863 context.fillText(shopName, 277 * unit, 60 * unit);
3862 3864  
3863 3865 // 3.推荐来源
3864   - let fromText = `来自${getApp().globalData.userInfo.nickname}的推荐`;
3865   - context.setTextAlign('center');
3866   - context.setFontSize(22 * unit);
3867   - context.setFillStyle('#96959a');
3868   - context.fillText(fromText, 277 * unit, 105 * unit);
3869   -
  3866 + if(getApp().globalData.userInfo) {
  3867 + let fromText = `来自${getApp().globalData.userInfo.nickname}的推荐`;
  3868 + context.setTextAlign('center');
  3869 + context.setFontSize(22 * unit);
  3870 + context.setFillStyle('#96959a');
  3871 + context.fillText(fromText, 277 * unit, 105 * unit);
  3872 + }
3870 3873 // 4.海报背景
3871 3874 context.setFillStyle('white');
3872 3875 context.fillRect(37 * unit, 157 * unit, 480 * unit, 673 * unit);
... ...
packageC/pages/presell/goodsInfo/goodsInfo.js
... ... @@ -1456,6 +1456,11 @@ Page({
1456 1456 return false;
1457 1457 }
1458 1458  
  1459 + if(!this.data.pre_arr){
  1460 + ut.m_toast('您未达到活动条件,不能购买此活动商品商品');
  1461 + return false;
  1462 + }
  1463 +
1459 1464 var ind = t.currentTarget.dataset.ind;
1460 1465  
1461 1466 //回调。判断是不是优惠促销
... ... @@ -3223,12 +3228,12 @@ Page({
3223 3228 //--定义的保存图片方法,分享团---
3224 3229 saveImageToPhotosAlbum: function () {
3225 3230 //--先判断会员状态--
3226   - var user_info = getApp().globalData.userInfo;
3227   - if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
3228   - //getApp().my_warnning("请先登录",0,this);
3229   - wx.navigateTo({ url: '/packageE/pages/togoin/togoin', })
3230   - return false;
3231   - }
  3231 + // var user_info = getApp().globalData.userInfo;
  3232 + // if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
  3233 + // //getApp().my_warnning("请先登录",0,this);
  3234 + // wx.navigateTo({ url: '/packageE/pages/togoin/togoin', })
  3235 + // return false;
  3236 + // }
3232 3237  
3233 3238 if (this.data.share_hidden) {
3234 3239 this.setData({
... ... @@ -3289,6 +3294,8 @@ Page({
3289 3294 }
3290 3295 context.drawImage(pg_path, 0, 0, 554 * unit, 899 * unit);
3291 3296  
  3297 + let nick=app.globalData.userInfo?app.globalData.userInfo.nickname:'';
  3298 +
3292 3299 //-- 是自定义海报的情况下 --
3293 3300 if (th.data.poster && parseInt(th.data.poster.style) == 2) {
3294 3301 //在线上分享人的情况下
... ... @@ -3301,8 +3308,8 @@ Page({
3301 3308 //--昵称---
3302 3309 context.setFontSize(24 * unit)
3303 3310 context.setFillStyle("black")
3304   - context.fillText(app.globalData.userInfo.nickname, x1, y1);
3305   - var width = 24 * app.globalData.userInfo.nickname.length * unit + 4 * unit;
  3311 + context.fillText(nick, x1, y1);
  3312 + var width = 24 * nick.length * unit + 4 * unit;
3306 3313 //强烈推荐 改许程
3307 3314 var tj_path = "../../../../images/share/q_tj.png";
3308 3315 context.drawImage(tj_path, x1 + width, y1 - 22 * unit, 85 * unit, 30 * unit);
... ... @@ -3319,8 +3326,8 @@ Page({
3319 3326 //--昵称---
3320 3327 context.setFontSize(24 * unit)
3321 3328 context.setFillStyle("black")
3322   - context.fillText(app.globalData.userInfo.nickname, 152 * unit, 76 * unit);
3323   - var width = 24 * app.globalData.userInfo.nickname.length * unit + 2 * unit;
  3329 + context.fillText(nick, 152 * unit, 76 * unit);
  3330 + var width = 24 * nick.length * unit + 2 * unit;
3324 3331 //强烈推荐 改许程
3325 3332 var tj_path = "../../../../images/share/q_tj.png";
3326 3333 context.drawImage(tj_path, 152 * unit + width, 54 * unit, 85 * unit, 30 * unit);
... ... @@ -3538,12 +3545,12 @@ Page({
3538 3545 //--定义的保存图片方法,分享团---
3539 3546 saveImageToPhotosAlbumDef: function () {
3540 3547 //--先判断会员状态--
3541   - var user_info = getApp().globalData.userInfo;
3542   - if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
3543   - //getApp().my_warnning("请先登录",0,this);
3544   - wx.navigateTo({url: '/packageE/pages/togoin/togoin',})
3545   - return false;
3546   - }
  3548 + // var user_info = getApp().globalData.userInfo;
  3549 + // if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
  3550 + // //getApp().my_warnning("请先登录",0,this);
  3551 + // wx.navigateTo({url: '/packageE/pages/togoin/togoin',})
  3552 + // return false;
  3553 + // }
3547 3554  
3548 3555 if (this.data.share_hidden) {
3549 3556 this.setData({share_hidden: false,});
... ... @@ -3696,11 +3703,13 @@ Page({
3696 3703 context.fillText(shopName, 277 * unit, 60 * unit);
3697 3704  
3698 3705 // 3.推荐来源
3699   - let fromText = `来自${getApp().globalData.userInfo.nickname}的推荐`;
3700   - context.setTextAlign('center');
3701   - context.setFontSize(22 * unit);
3702   - context.setFillStyle('#96959a');
3703   - context.fillText(fromText, 277 * unit, 105 * unit);
  3706 + if(getApp().globalData.userInfo) {
  3707 + let fromText = `来自${getApp().globalData.userInfo.nickname}的推荐`;
  3708 + context.setTextAlign('center');
  3709 + context.setFontSize(22 * unit);
  3710 + context.setFillStyle('#96959a');
  3711 + context.fillText(fromText, 277 * unit, 105 * unit);
  3712 + }
3704 3713  
3705 3714 // 4.海报背景
3706 3715 context.setFillStyle('white');
... ... @@ -3858,7 +3867,7 @@ Page({
3858 3867 return false;
3859 3868 }
3860 3869 //---获取分享图片的本地地址,头像和商品图片----
3861   - var path2 = getApp().globalData.userInfo.head_pic;
  3870 + var path2 = getApp().globalData.userInfo?getApp().globalData.userInfo.head_pic:'';
3862 3871 if (path2 == "") {
3863 3872 ee.data.share_head = "../../../../images/share/hui_hear_pic.png";
3864 3873 tt(func);
... ... @@ -4666,10 +4675,10 @@ Page({
4666 4675 },
4667 4676  
4668 4677 clickShare() {
4669   - if (!getApp().globalData.user_id) {
4670   - getApp().goto("/packageE/pages/togoin/togoin");
4671   - return false;
4672   - }
  4678 + // if (!getApp().globalData.user_id) {
  4679 + // getApp().goto("/packageE/pages/togoin/togoin");
  4680 + // return false;
  4681 + // }
4673 4682 this.setData({ share_hidden: true, });
4674 4683 },
4675 4684  
... ...
packageC/pages/presell/pregoodsInfo/goodsInfo.js
... ... @@ -2863,12 +2863,12 @@ Page({
2863 2863 //--定义的保存图片方法,分享团---
2864 2864 saveImageToPhotosAlbum: function () {
2865 2865 //--先判断会员状态--
2866   - var user_info = getApp().globalData.userInfo;
2867   - if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
2868   - //getApp().my_warnning("请先登录",0,this);
2869   - wx.navigateTo({ url: '/packageE/pages/togoin/togoin', })
2870   - return false;
2871   - }
  2866 + // var user_info = getApp().globalData.userInfo;
  2867 + // if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
  2868 + // //getApp().my_warnning("请先登录",0,this);
  2869 + // wx.navigateTo({ url: '/packageE/pages/togoin/togoin', })
  2870 + // return false;
  2871 + // }
2872 2872  
2873 2873 if (this.data.share_hidden) {
2874 2874 this.setData({
... ... @@ -4040,10 +4040,10 @@ Page({
4040 4040 },
4041 4041  
4042 4042 clickShare() {
4043   - if(!getApp().globalData.user_id){
4044   - getApp().goto("/packageE/pages/togoin/togoin");
4045   - return false;
4046   - }
  4043 + // if(!getApp().globalData.user_id){
  4044 + // getApp().goto("/packageE/pages/togoin/togoin");
  4045 + // return false;
  4046 + // }
4047 4047 this.setData({ share_hidden: true, });
4048 4048 },
4049 4049  
... ...
packageD/pages/AI-test-skin/success_result/success_result.js
... ... @@ -844,11 +844,12 @@ Page({
844 844 var th = this;
845 845 var rpx = this.data.cWidth / 750 * 4; //基础单位,
846 846 //--先判断会员状态--
847   - var user_info = getApp().globalData.userInfo;
848   - if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
849   - wx.navigateTo({ url: '/packageE/pages/togoin/togoin', })
850   - return false;
851   - }
  847 + // var user_info = getApp().globalData.userInfo;
  848 + // if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
  849 + // wx.navigateTo({ url: '/packageE/pages/togoin/togoin', })
  850 + // return false;
  851 + // }
  852 +
852 853 if (this.data.share_hidden) {
853 854 this.setData({ share_hidden: false, });
854 855 }
... ...
packageE/pages/togoin/togoin.js
... ... @@ -11,7 +11,8 @@ Page({
11 11 store_logo: '',
12 12 first_leader: '', //-- 邀请人 --
13 13 config2: null,
14   - sub: 0
  14 + sub: 0,
  15 + is_reg:1
15 16 },
16 17 onLoad: function (options) {
17 18 if (wx.getUserProfile) {
... ... @@ -21,10 +22,9 @@ Page({
21 22 }
22 23 getApp().globalData.isLoad_ad = 1;
23 24  
24   -
25   - if(options.is_reg){
26   - this.data.is_reg=1;
27   - }
  25 + // if(options.is_reg){
  26 + // this.data.is_reg=1;
  27 + // }
28 28  
29 29 //-- 看一下隐私政策要不要显示 --
30 30 var privacy_pop = this.selectComponent("#privacy_pop"); //组件的id
... ...
packageE/pages/user/monthgiftbag/giftpackinfo/giftpackinfo.js
... ... @@ -1460,10 +1460,10 @@ Page({
1460 1460  
1461 1461  
1462 1462 clickShare() {
1463   - if (!getApp().globalData.user_id) {
1464   - getApp().goto("/packageE/pages/togoin/togoin");
1465   - return false;
1466   - }
  1463 + // if (!getApp().globalData.user_id) {
  1464 + // getApp().goto("/packageE/pages/togoin/togoin");
  1465 + // return false;
  1466 + // }
1467 1467 this.setData({
1468 1468 share_hidden: true,
1469 1469 });
... ... @@ -1485,12 +1485,12 @@ Page({
1485 1485 //--定义的保存图片方法,分享团---
1486 1486 saveImageToPhotosAlbum: function () {
1487 1487 //--先判断会员状态--
1488   - var user_info = getApp().globalData.userInfo;
1489   - if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
1490   - //getApp().my_warnning("请先登录",0,this);
1491   - wx.navigateTo({url: '/packageE/pages/togoin/togoin',})
1492   - return false;
1493   - }
  1488 + // var user_info = getApp().globalData.userInfo;
  1489 + // if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
  1490 + // //getApp().my_warnning("请先登录",0,this);
  1491 + // wx.navigateTo({url: '/packageE/pages/togoin/togoin',})
  1492 + // return false;
  1493 + // }
1494 1494  
1495 1495 if (this.data.share_hidden) {
1496 1496 this.setData({share_hidden: false,});
... ...
packageE/pages/user/monthgiftbag/giftpacklist/giftpacklist.js
... ... @@ -1045,10 +1045,10 @@ Page({
1045 1045  
1046 1046  
1047 1047 clickShare() {
1048   - if (!getApp().globalData.user_id) {
1049   - getApp().goto("/packageE/pages/togoin/togoin");
1050   - return false;
1051   - }
  1048 + // if (!getApp().globalData.user_id) {
  1049 + // getApp().goto("/packageE/pages/togoin/togoin");
  1050 + // return false;
  1051 + // }
1052 1052 this.setData({
1053 1053 share_hidden: true,
1054 1054 });
... ... @@ -1070,12 +1070,12 @@ Page({
1070 1070 //--定义的保存图片方法,分享团---
1071 1071 saveImageToPhotosAlbum: function () {
1072 1072 //--先判断会员状态--
1073   - var user_info = getApp().globalData.userInfo;
1074   - if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
1075   - //getApp().my_warnning("请先登录",0,this);
1076   - wx.navigateTo({url: '/packageE/pages/togoin/togoin',})
1077   - return false;
1078   - }
  1073 + // var user_info = getApp().globalData.userInfo;
  1074 + // if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
  1075 + // //getApp().my_warnning("请先登录",0,this);
  1076 + // wx.navigateTo({url: '/packageE/pages/togoin/togoin',})
  1077 + // return false;
  1078 + // }
1079 1079  
1080 1080 if (this.data.share_hidden) {
1081 1081 this.setData({share_hidden: false,});
... ...
packageG/pages/team/team_success/team_success.js
... ... @@ -464,7 +464,7 @@ Page({
464 464  
465 465  
466 466 //先画背景
467   - var pg_path = "../../../images/share/share_bg.png";
  467 + var pg_path = "../../../../images/share/share_bg.png";
468 468 //-- 如果有自定义海报的时候,判断背景的图片 --
469 469 if(th.data.share_b_img){
470 470 pg_path=th.data.share_b_img;
... ... @@ -493,7 +493,7 @@ Page({
493 493 context.fillText(app.globalData.userInfo.nickname, x1, y1);
494 494 var width = 24 * app.globalData.userInfo.nickname.length * unit + 4 * unit;
495 495 //强烈推荐 改许程
496   - var tj_path = "../../../images/share/q_tj.png";
  496 + var tj_path = "../../../../images/share/q_tj.png";
497 497 context.drawImage(tj_path, x1 + width, y1-22*unit, 85 * unit, 30 * unit);
498 498 context.setFontSize(16 * unit)
499 499 context.setLineJoin('round'); //交点设置成圆角
... ... @@ -508,7 +508,7 @@ Page({
508 508 context.fillText(app.globalData.userInfo.nickname, 152 * unit, 76 * unit);
509 509 var width = 24 * app.globalData.userInfo.nickname.length * unit + 2 * unit;
510 510 //强烈推荐
511   - var tj_path = "../../../images/share/q_tj.png";
  511 + var tj_path = "../../../../images/share/q_tj.png";
512 512 context.drawImage(tj_path, 152 * unit + width, 54 * unit, 110 * unit, 30 * unit);
513 513 context.setFontSize(18 * unit)
514 514 context.setFillStyle("white")
... ... @@ -579,7 +579,7 @@ Page({
579 579 context.fillText("好物拼起来,拼拼更划算", 40 * unit, 726 * unit);
580 580  
581 581 //绘制成团图片
582   - var ct_img ="../../../images/share/ct_num.png";
  582 + var ct_img ="../../../../images/share/ct_num.png";
583 583 context.drawImage(ct_img, 40 * unit, 740 * unit, 120 * unit, 30 * unit);
584 584 var ct_num = th.data.teamlist.ct_num;
585 585 context.setFontSize(14 * unit)
... ... @@ -772,7 +772,7 @@ Page({
772 772 //---获取分享图片的本地地址,头像和商品图片----
773 773 var path2 = getApp().globalData.userInfo.head_pic;
774 774 if(path2==""){
775   - ee.data.share_head ="../../../images/share/hui_hear_pic.png";
  775 + ee.data.share_head ="../../../../images/share/hui_hear_pic.png";
776 776 tt(func);
777 777 }else {
778 778 path2=path2.replace("http://thirdwx.qlogo.cn","https://wx.qlogo.cn");
... ... @@ -785,7 +785,7 @@ Page({
785 785 tt(func);;
786 786 },
787 787 fail: function (res) {
788   - ee.data.share_head = "../../../images/share/hui_hear_pic.png"; //分享的图片不能用网络的
  788 + ee.data.share_head = "../../../../images/share/hui_hear_pic.png"; //分享的图片不能用网络的
789 789 tt(func);
790 790 }
791 791 });
... ... @@ -864,10 +864,10 @@ Page({
864 864 },
865 865  
866 866 clickShare() {
867   - if(!getApp().globalData.user_id){
868   - getApp().goto("/packageE/pages/togoin/togoin");
869   - return false;
870   - }
  867 + // if(!getApp().globalData.user_id){
  868 + // getApp().goto("/packageE/pages/togoin/togoin");
  869 + // return false;
  870 + // }
871 871 this.setData({
872 872 share_hidden: true,
873 873 });
... ... @@ -957,7 +957,7 @@ Page({
957 957  
958 958  
959 959 if (type == 1) { // 商家和会员团
960   - src = '../../../images/share/ct_num.png';
  960 + src = '../../../../images/share/ct_num.png';
961 961 context.drawImage(src, 54 * unit, 648 * unit, 120 * unit, 30 * unit);
962 962 context.setTextAlign('left');
963 963  
... ...
pages/activity/seckill_list/seckill_list.js
... ... @@ -17,7 +17,9 @@ Page({
17 17 isshow: 0,
18 18 ad_data: null,
19 19 max_sw_height: 200,
20   - is_retail_price:0
  20 + is_retail_price:0,
  21 +
  22 + timer_js:[]
21 23 },
22 24  
23 25 //------初始化加载----------
... ... @@ -101,6 +103,7 @@ Page({
101 103 onHide: function () {
102 104 //--清理定时器--
103 105 clearInterval(this.data.timer);
  106 + this.data.is_timer=0;
104 107 this.setData({
105 108 isshow: 0
106 109 });
... ... @@ -110,9 +113,10 @@ Page({
110 113 return param < 10 ? '0' + param : param;
111 114 },
112 115  
113   - //----倒计时函数-----
  116 + //----倒计时函数,优化定时器只显示在可视范围内的-----
114 117 countDown() {
115 118 if (!this.data.is_timer) return false;
  119 +
116 120 var th = this;
117 121 // 获取当前时间,同时得到活动结束时间数组
118 122 let newTime = ut.gettimestamp();
... ... @@ -120,45 +124,82 @@ Page({
120 124 if (endTimeList == null) return null
121 125 // 对结束时间进行处理渲染到页面
122 126 for (var i = 0; i < endTimeList.length; i++) {
  127 +
  128 + if (!this.data.is_timer) break;
  129 +
123 130 var o = endTimeList[i];
124 131 if(!o) continue;
125 132 var endTime = o.end_time;
126 133 if (th.data.type == 0) endTime = o.start_time;
127   - let obj = null;
128   - // 如果活动未结束,对时间进行处理
129   - if (endTime - newTime > 0) {
130   - let time = (endTime - newTime);
131   - // 获取天、时、分、秒
132   - let day = parseInt(time / (60 * 60 * 24));
133   - let hou = parseInt(time % (60 * 60 * 24) / 3600);
134   - let min = parseInt(time % (60 * 60 * 24) % 3600 / 60);
135   - let sec = parseInt(time % (60 * 60 * 24) % 3600 % 60);
136   - obj = {
137   - day: this.timeFormat(day),
138   - hou: this.timeFormat(hou),
139   - min: this.timeFormat(min),
140   - sec: this.timeFormat(sec),
141   - hide: 1
142   - }
143   - } else {
144   - //活动已结束,全部设置为'00'
145   - obj = {
146   - day: '00',
147   - hou: '00',
148   - min: '00',
149   - sec: '00'
  134 +
  135 + // 创建查询对象
  136 + let query = wx.createSelectorQuery();
  137 + // 获取目标元素,并获取目标元素的信息
  138 + query.select("#kill-item"+i).boundingClientRect();
  139 + // 获取视口,并获取视口信息
  140 + query.selectViewport().boundingClientRect();
  141 + //-- 执行查询,元素要在显示中的才显示定时器 --
  142 + query.exec(([target, view]) => {
  143 +
  144 + if (!th.data.is_timer) return;
  145 + if (!target) return;
  146 + if (!target.id) return;
  147 +
  148 + let idx= target.id.replace('kill-item','');
  149 + // 条件1:当目标顶部距离视口顶部距离小于视口的高度时
  150 + // 条件2:当目标底部距离视口顶部距离大于0时
  151 + // 当以上两个条件同时成立时,目标元素在视口中
  152 + if (target.top < view.height && target.bottom > 0) {
  153 + let obj = null;
  154 + // 如果活动未结束,对时间进行处理
  155 + if (endTime - newTime > 0) {
  156 + let time = (endTime - newTime);
  157 + // 获取天、时、分、秒
  158 + let day = parseInt(time / (60 * 60 * 24));
  159 + let hou = parseInt(time % (60 * 60 * 24) / 3600);
  160 + let min = parseInt(time % (60 * 60 * 24) % 3600 / 60);
  161 + let sec = parseInt(time % (60 * 60 * 24) % 3600 % 60);
  162 + obj = {
  163 + day: this.timeFormat(day),
  164 + hou: this.timeFormat(hou),
  165 + min: this.timeFormat(min),
  166 + sec: this.timeFormat(sec),
  167 + hide: 1
  168 + }
  169 + } else {
  170 + //活动已结束,全部设置为'00'
  171 + obj = {
  172 + day: '00',
  173 + hou: '00',
  174 + min: '00',
  175 + sec: '00'
  176 + }
  177 + }
  178 + var txt = "timer_js[" + idx + "]";
  179 +
  180 + if (!th.data.is_timer) return;
  181 +
  182 + th.setData({
  183 + [txt]: obj
  184 + });
  185 + } else {
  186 + console.log("隐藏中");
150 187 }
151   - }
152   - var txt = "goodlist[" + i + "].djs";
153   - th.setData({
154   - [txt]: obj
155 188 });
  189 +
  190 +
  191 +
156 192 }
157 193 },
158 194  
159 195 async requestSalelist() {
160 196 //--没有更多就不调用--
161 197 if (!this.data.ismore) return false;
  198 + if(this.data.lding) return false;
  199 + this.data.lding=1;
  200 + this.data.is_timer=0; //暂停一下定时器
  201 +
  202 +
162 203 var e = this,
163 204 th = e,
164 205 i = "/api/ms/flash_sale/spikepage?page=" + e.data.currentPage;
... ... @@ -173,7 +214,8 @@ Page({
173 214 timetype: th.data.type,
174 215 is_end: 0,
175 216 is_show: 1,
176   - user_id: user_id
  217 + user_id: user_id,
  218 + isRedis:1
177 219 };
178 220  
179 221 wx.showLoading();
... ... @@ -190,6 +232,7 @@ Page({
190 232 wx.hideLoading();
191 233  
192 234 th.data.ismore = 0;
  235 + this.data.is_timer=1;
193 236 if (e.data.currentPage == 1 && this.data.type == 1) {
194 237  
195 238 //-- 弄到即将开始 --
... ... @@ -223,6 +266,8 @@ Page({
223 266 getApp().showWarning("没有更多数据");
224 267 }
225 268  
  269 + this.data.lding=0;
  270 + this.data.is_timer=1;
226 271 return false;
227 272 }
228 273  
... ... @@ -239,14 +284,22 @@ Page({
239 284 plist[i].price_n = price
240 285 }
241 286 var prom_id = plist[i].id;
242   - await getApp().request.promiseGet("/api/weshop/activitylist/getActLen/" +
243   - os.stoid + "/1/" + prom_id, {}
244   - ).then(res => {
245   - if (res.data.code == 0) {
246   - plist[i].status = 1;
247   - if (res.data.data <= 0) plist[i].status = 3;
248   - }
249   - })
  287 +
  288 + // await getApp().request.promiseGet("/api/weshop/activitylist/getActLen/" +
  289 + // os.stoid + "/1/" + prom_id, {}
  290 + // ).then(res => {
  291 + // if (res.data.code == 0) {
  292 + // plist[i].status = 1;
  293 + // if (res.data.data <= 0) plist[i].status = 3;
  294 + // }
  295 + // })
  296 +
  297 + plist[i].status = 1;
  298 + if (plist[i].actLen <= 0) {
  299 + plist[i].status = 3;
  300 + }
  301 +
  302 +
250 303 alllist.push(plist[i]);
251 304 }
252 305 e.data.currentPage++;
... ... @@ -258,7 +311,10 @@ Page({
258 311  
259 312 setTimeout(()=>{
260 313 wx.hideLoading();
261   - },500)
  314 + },200)
  315 +
  316 + this.data.lding=0;
  317 + this.data.is_timer=1;
262 318  
263 319  
264 320  
... ...
pages/activity/seckill_list/seckill_list.wxml
... ... @@ -32,7 +32,7 @@
32 32  
33 33  
34 34 <view class="kill-list abs seckill_list">
35   - <view class="kill-item" wx:for="{{goodlist}}" wx:if="{{item.djs.hide}}" >
  35 + <view id="kill-item{{index}}" class="kill-item" wx:for="{{goodlist}}" >
36 36 <!-- <navigator class="kill-pic rel" url="/pages/goods/goodsInfo/goodsInfo?goods_id={{item.goods_id}}&prom_id={{item.id}}&prom_type=1"> -->
37 37 <navigator url="{{item.goods_type == 0 ? ('/pages/goods/goodsInfo/goodsInfo?goods_id=' + item.goods_id + '&prom_type=1&prom_id=' + item.id):('/packageA/pages/goodsInfo/goodsInfo?goods_id=' + item.goods_id + '&prom_type=1&prom_id=' + item.id )}}" class="kill-pic rel">
38 38 <image class="abs xc-miaosha" src="{{url}}/miniapp/images/zms.png"></image>
... ... @@ -59,12 +59,12 @@
59 59  
60 60 <view class="goods-num">
61 61 <view>
62   - <view class="{{type==1?'xc-wc':'blue_c'}}">
  62 + <view wx:if="{{timer_js[index].hide}}" class="{{type==1?'xc-wc':'blue_c'}}">
63 63 <text>剩余:</text>
64   - <text class='tui-conutdown-box'> {{item.djs.day}}</text>天
65   - <text class='tui-conutdown-box'>{{item.djs.hou}}</text>时
66   - <text class='tui-conutdown-box'>{{item.djs.min}}</text>分
67   - <text class='tui-conutdown-box tui-countdown-bg'>{{item.djs.sec}}</text>秒
  64 + <text class='tui-conutdown-box'> {{timer_js[index].day}}</text>天
  65 + <text class='tui-conutdown-box'>{{timer_js[index].hou}}</text>时
  66 + <text class='tui-conutdown-box'>{{timer_js[index].min}}</text>分
  67 + <text class='tui-conutdown-box tui-countdown-bg'>{{timer_js[index].sec}}</text>秒
68 68 </view>
69 69 <view class="fs40 flex xc-buttom-money {{type==1?'xc-wc':'blue_c'}}" >
70 70 <view class="fs28" style="line-height: 16px;">¥</view>
... ...
pages/giftpack/giftpacklist/giftpacklist.js
... ... @@ -1138,10 +1138,10 @@ Page({
1138 1138  
1139 1139  
1140 1140 clickShare() {
1141   - if (!getApp().globalData.user_id) {
1142   - getApp().goto("/packageE/pages/togoin/togoin");
1143   - return false;
1144   - }
  1141 + // if (!getApp().globalData.user_id) {
  1142 + // getApp().goto("/packageE/pages/togoin/togoin");
  1143 + // return false;
  1144 + // }
1145 1145 this.setData({
1146 1146 share_hidden: true,
1147 1147 });
... ... @@ -1163,12 +1163,12 @@ Page({
1163 1163 //--定义的保存图片方法,分享团---
1164 1164 saveImageToPhotosAlbum: function () {
1165 1165 //--先判断会员状态--
1166   - var user_info = getApp().globalData.userInfo;
1167   - if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
1168   - //getApp().my_warnning("请先登录",0,this);
1169   - wx.navigateTo({url: '/packageE/pages/togoin/togoin',})
1170   - return false;
1171   - }
  1166 + // var user_info = getApp().globalData.userInfo;
  1167 + // if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
  1168 + // //getApp().my_warnning("请先登录",0,this);
  1169 + // wx.navigateTo({url: '/packageE/pages/togoin/togoin',})
  1170 + // return false;
  1171 + // }
1172 1172  
1173 1173 if (this.data.share_hidden) {
1174 1174 this.setData({share_hidden: false,});
... ...
pages/goods/goodsInfo/goodsInfo.js
... ... @@ -6355,12 +6355,15 @@ Page({
6355 6355 context.setFillStyle('black');
6356 6356 context.fillText(shopName, 277 * unit, 60 * unit);
6357 6357  
6358   - // 3.推荐来源
6359   - let fromText = `来自${getApp().globalData.userInfo.nickname}的推荐`;
6360   - context.setTextAlign('center');
6361   - context.setFontSize(22 * unit);
6362   - context.setFillStyle('#96959a');
6363   - context.fillText(fromText, 277 * unit, 105 * unit);
  6358 + let nick=getApp().globalData.userInfo?getApp().globalData.userInfo.nickname:'';
  6359 + if(nick) {
  6360 + // 3.推荐来源
  6361 + let fromText = `来自${nick}的推荐`;
  6362 + context.setTextAlign('center');
  6363 + context.setFontSize(22 * unit);
  6364 + context.setFillStyle('#96959a');
  6365 + context.fillText(fromText, 277 * unit, 105 * unit);
  6366 + }
6364 6367  
6365 6368 // 4.海报背景
6366 6369 context.setFillStyle('white');
... ... @@ -6525,14 +6528,14 @@ Page({
6525 6528 //--定义的保存图片方法,分享团---
6526 6529 saveImageToPhotosAlbum: function () {
6527 6530 //--先判断会员状态--
6528   - var user_info = getApp().globalData.userInfo;
6529   - if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
6530   - //getApp().my_warnning("请先登录",0,this);
6531   - wx.navigateTo({
6532   - url: '/packageE/pages/togoin/togoin',
6533   - })
6534   - return false;
6535   - }
  6531 + // var user_info = getApp().globalData.userInfo;
  6532 + // if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
  6533 + // //getApp().my_warnning("请先登录",0,this);
  6534 + // wx.navigateTo({
  6535 + // url: '/packageE/pages/togoin/togoin',
  6536 + // })
  6537 + // return false;
  6538 + // }
6536 6539  
6537 6540 if (this.data.share_hidden) {
6538 6541 this.setData({
... ... @@ -6619,6 +6622,7 @@ Page({
6619 6622  
6620 6623  
6621 6624 var act_time = '';
  6625 + let nick=app.globalData.userInfo?app.globalData.userInfo.nickname:'';
6622 6626  
6623 6627 //-- 是自定义海报的情况下 --
6624 6628 if (th.data.share_b_img || (type != 0 && type != 1 && type != 2 && type != 3)) {
... ... @@ -6631,11 +6635,13 @@ Page({
6631 6635 var y = parseFloat(th.data.poster.head_y) * 2;
6632 6636 var x1 = (x + 90) * unit;
6633 6637 var y1 = (y + 50) * unit;
  6638 +
  6639 +
6634 6640 //--昵称---
6635 6641 context.setFontSize(24 * unit)
6636 6642 context.setFillStyle("black")
6637   - context.fillText(app.globalData.userInfo.nickname, x1, y1);
6638   - var width = 24 * app.globalData.userInfo.nickname.length * unit + 4 * unit;
  6643 + context.fillText(nick, x1, y1);
  6644 + var width = 24 * nick.length * unit + 4 * unit;
6639 6645 //强烈推荐 改许程
6640 6646 var tj_path = "../../../images/share/q_tj.png";
6641 6647 context.drawImage(tj_path, x1 + width, y1 - 22 * unit, 85 * unit, 30 * unit);
... ... @@ -6652,8 +6658,8 @@ Page({
6652 6658 //--昵称---
6653 6659 context.setFontSize(24 * unit);
6654 6660 context.setFillStyle("black");
6655   - context.fillText(app.globalData.userInfo.nickname, 152 * unit, 76 * unit);
6656   - var width = 24 * app.globalData.userInfo.nickname.length * unit + 2 * unit;
  6661 + context.fillText(nick, 152 * unit, 76 * unit);
  6662 + var width = 24 * nick.length * unit + 2 * unit;
6657 6663 //强烈推荐 改许程
6658 6664 var tj_path = "../../../images/share/q_tj.png";
6659 6665 context.drawImage(tj_path, 152 * unit + width, 54 * unit, 85 * unit, 30 * unit);
... ... @@ -7282,7 +7288,7 @@ Page({
7282 7288 return false;
7283 7289 }
7284 7290 //---获取分享图片的本地地址,头像和商品图片----
7285   - var path2 = getApp().globalData.userInfo.head_pic;
  7291 + var path2 = getApp().globalData.userInfo?getApp().globalData.userInfo.head_pic:'';
7286 7292 if (path2 == "") {
7287 7293 ee.data.share_head = "../../../images/share/hui_hear_pic.png";
7288 7294 tt(func);
... ... @@ -8686,10 +8692,10 @@ Page({
8686 8692 },
8687 8693  
8688 8694 clickShare() {
8689   - if (!getApp().globalData.user_id) {
8690   - getApp().goto("/packageE/pages/togoin/togoin");
8691   - return false;
8692   - }
  8695 + // if (!getApp().globalData.user_id) {
  8696 + // getApp().goto("/packageE/pages/togoin/togoin");
  8697 + // return false;
  8698 + // }
8693 8699 this.setData({
8694 8700 share_hidden: true,
8695 8701 });
... ...
pages/index/index/index.js
... ... @@ -1534,11 +1534,11 @@ Page({
1534 1534 },
1535 1535  
1536 1536 go_pre: function (e) {
1537   - var userInfo = getApp().globalData.userInfo;
1538   - if (!userInfo) {
1539   - getApp().goto("/packageE/pages/togoin/togoin");
1540   - return false;
1541   - }
  1537 + // var userInfo = getApp().globalData.userInfo;
  1538 + // if (!userInfo) {
  1539 + // getApp().goto("/packageE/pages/togoin/togoin");
  1540 + // return false;
  1541 + // }
1542 1542 var url = e.currentTarget.dataset.url;
1543 1543 getApp().goto(url);
1544 1544 },
... ...