Commit 3afbb00cf2269ecd8bde1d30b4766765e246d59f

Authored by yvan.ni
1 parent b780225d

商品分享不需要判断会员的登陆

packageA/pages/goods_share/goods_share.js
@@ -114,9 +114,9 @@ Page({ @@ -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,12 +368,12 @@ Page({
368 //--定义的保存图片方法,分享团--- 368 //--定义的保存图片方法,分享团---
369 saveImageToPhotosAlbum: function() { 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 //类型 0普通商品 1秒杀商品 2商家和会员团 3阶梯团 377 //类型 0普通商品 1秒杀商品 2商家和会员团 3阶梯团
378 var type = 0; 378 var type = 0;
379 wx.showLoading({ 379 wx.showLoading({
@@ -416,7 +416,9 @@ Page({ @@ -416,7 +416,9 @@ Page({
416 pg_path=th.data.share_b_img; 416 pg_path=th.data.share_b_img;
417 } 417 }
418 context.drawImage(pg_path, 0, 0, 554 * unit, 899 * unit); 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 if(th.data.poster && parseInt(th.data.poster.style)==2){ 423 if(th.data.poster && parseInt(th.data.poster.style)==2){
422 //在线上分享人的情况下 424 //在线上分享人的情况下
@@ -429,8 +431,8 @@ Page({ @@ -429,8 +431,8 @@ Page({
429 //--昵称--- 431 //--昵称---
430 context.setFontSize(24 * unit) 432 context.setFontSize(24 * unit)
431 context.setFillStyle("black") 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 var tj_path = "../../../images/share/q_tj.png"; 437 var tj_path = "../../../images/share/q_tj.png";
436 context.drawImage(tj_path, x1 + width, y1-22*unit, 85 * unit, 30 * unit); 438 context.drawImage(tj_path, x1 + width, y1-22*unit, 85 * unit, 30 * unit);
@@ -443,8 +445,8 @@ Page({ @@ -443,8 +445,8 @@ Page({
443 //--昵称--- 445 //--昵称---
444 context.setFontSize(24 * unit) 446 context.setFontSize(24 * unit)
445 context.setFillStyle("black") 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 var tj_path = "../../../images/share/q_tj.png"; 451 var tj_path = "../../../images/share/q_tj.png";
450 context.drawImage(tj_path, 152 * unit + width, 54 * unit, 85 * unit, 30 * unit); 452 context.drawImage(tj_path, 152 * unit + width, 54 * unit, 85 * unit, 30 * unit);
@@ -749,12 +751,12 @@ Page({ @@ -749,12 +751,12 @@ Page({
749 //点击分享商品 751 //点击分享商品
750 share_good:function(e){ 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 var index=e.currentTarget.dataset.index; 761 var index=e.currentTarget.dataset.index;
760 var item=this.data.list[index]; 762 var item=this.data.list[index];
@@ -773,7 +775,7 @@ Page({ @@ -773,7 +775,7 @@ Page({
773 return false; 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 if (path2 == "") { 779 if (path2 == "") {
778 ee.data.share_head = "../../../images/share/hui_hear_pic.png"; 780 ee.data.share_head = "../../../images/share/hui_hear_pic.png";
779 tt(func); 781 tt(func);