Commit dc4c905fb139ca9e900c9441cb0fd936bc892849
1 parent
fa16d750
服务卡项的分享,不判断会员的登陆
Showing
1 changed file
with
20 additions
and
18 deletions
packageA/pages/service_share/service_share.js
@@ -341,12 +341,12 @@ Page({ | @@ -341,12 +341,12 @@ Page({ | ||
341 | //--定义的保存图片方法,分享团--- | 341 | //--定义的保存图片方法,分享团--- |
342 | saveImageToPhotosAlbum: function() { | 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 | //类型 0普通商品 1秒杀商品 2商家和会员团 3阶梯团 | 350 | //类型 0普通商品 1秒杀商品 2商家和会员团 3阶梯团 |
351 | var type = 0; | 351 | var type = 0; |
352 | wx.showLoading({ | 352 | wx.showLoading({ |
@@ -391,7 +391,9 @@ Page({ | @@ -391,7 +391,9 @@ Page({ | ||
391 | pg_path=th.data.share_b_img; | 391 | pg_path=th.data.share_b_img; |
392 | } | 392 | } |
393 | context.drawImage(pg_path, 0, 0, 554 * unit, 899 * unit); | 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 | if(th.data.poster && parseInt(th.data.poster.style)==2){ | 398 | if(th.data.poster && parseInt(th.data.poster.style)==2){ |
397 | //在线上分享人的情况下 | 399 | //在线上分享人的情况下 |
@@ -404,8 +406,8 @@ Page({ | @@ -404,8 +406,8 @@ Page({ | ||
404 | //--昵称--- | 406 | //--昵称--- |
405 | context.setFontSize(24 * unit) | 407 | context.setFontSize(24 * unit) |
406 | context.setFillStyle("black") | 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 | var tj_path = "../../../images/share/q_tj.png"; | 412 | var tj_path = "../../../images/share/q_tj.png"; |
411 | context.drawImage(tj_path, x1 + width, y1-22*unit, 85 * unit, 30 * unit); | 413 | context.drawImage(tj_path, x1 + width, y1-22*unit, 85 * unit, 30 * unit); |
@@ -418,8 +420,8 @@ Page({ | @@ -418,8 +420,8 @@ Page({ | ||
418 | //--昵称--- | 420 | //--昵称--- |
419 | context.setFontSize(24 * unit) | 421 | context.setFontSize(24 * unit) |
420 | context.setFillStyle("black") | 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 | var tj_path = "../../../images/share/q_tj.png"; | 426 | var tj_path = "../../../images/share/q_tj.png"; |
425 | context.drawImage(tj_path, 152 * unit + width, 54 * unit, 85 * unit, 30 * unit); | 427 | context.drawImage(tj_path, 152 * unit + width, 54 * unit, 85 * unit, 30 * unit); |
@@ -728,12 +730,12 @@ Page({ | @@ -728,12 +730,12 @@ Page({ | ||
728 | //点击分享商品 | 730 | //点击分享商品 |
729 | share_good:function(e){ | 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 | var index=e.currentTarget.dataset.index; | 740 | var index=e.currentTarget.dataset.index; |
739 | var item=this.data.list[index]; | 741 | var item=this.data.list[index]; |
@@ -752,7 +754,7 @@ Page({ | @@ -752,7 +754,7 @@ Page({ | ||
752 | return false; | 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 | if (path2 == "") { | 758 | if (path2 == "") { |
757 | ee.data.share_head = "../../../images/share/hui_hear_pic.png"; | 759 | ee.data.share_head = "../../../images/share/hui_hear_pic.png"; |
758 | tt(func); | 760 | tt(func); |