Commit ac6560a5be67d617741da04f73c6d6b80c8ce31c
1 parent
a8c0f8bf
服务卡项的分享,会员未登陆的处理
Showing
1 changed file
with
30 additions
and
27 deletions
packageC/pages/presell/cardInfo/goodsInfo.js
@@ -1961,7 +1961,7 @@ Page({ | @@ -1961,7 +1961,7 @@ Page({ | ||
1961 | return false; | 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 | if (path2 == "") { | 1965 | if (path2 == "") { |
1966 | ee.data.share_head = "../../../../images/share/hui_hear_pic.png"; | 1966 | ee.data.share_head = "../../../../images/share/hui_hear_pic.png"; |
1967 | tt(func); | 1967 | tt(func); |
@@ -3359,10 +3359,10 @@ Page({ | @@ -3359,10 +3359,10 @@ Page({ | ||
3359 | }, | 3359 | }, |
3360 | 3360 | ||
3361 | clickShare() { | 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 | this.setData({ share_hidden: true, }); | 3366 | this.setData({ share_hidden: true, }); |
3367 | }, | 3367 | }, |
3368 | 3368 | ||
@@ -3388,12 +3388,12 @@ Page({ | @@ -3388,12 +3388,12 @@ Page({ | ||
3388 | //--定义的保存图片方法,分享团--- | 3388 | //--定义的保存图片方法,分享团--- |
3389 | saveImageToPhotosAlbum: function () { | 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 | if (this.data.share_hidden) { | 3398 | if (this.data.share_hidden) { |
3399 | this.setData({ | 3399 | this.setData({ |
@@ -3454,6 +3454,8 @@ Page({ | @@ -3454,6 +3454,8 @@ Page({ | ||
3454 | } | 3454 | } |
3455 | context.drawImage(pg_path, 0, 0, 554 * unit, 899 * unit); | 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 | if (th.data.poster && parseInt(th.data.poster.style) == 2) { | 3460 | if (th.data.poster && parseInt(th.data.poster.style) == 2) { |
3459 | //在线上分享人的情况下 | 3461 | //在线上分享人的情况下 |
@@ -3466,8 +3468,8 @@ Page({ | @@ -3466,8 +3468,8 @@ Page({ | ||
3466 | //--昵称--- | 3468 | //--昵称--- |
3467 | context.setFontSize(24 * unit) | 3469 | context.setFontSize(24 * unit) |
3468 | context.setFillStyle("black") | 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 | var tj_path = "../../../../images/share/q_tj.png"; | 3474 | var tj_path = "../../../../images/share/q_tj.png"; |
3473 | context.drawImage(tj_path, x1 + width, y1 - 22 * unit, 85 * unit, 30 * unit); | 3475 | context.drawImage(tj_path, x1 + width, y1 - 22 * unit, 85 * unit, 30 * unit); |
@@ -3484,8 +3486,8 @@ Page({ | @@ -3484,8 +3486,8 @@ Page({ | ||
3484 | //--昵称--- | 3486 | //--昵称--- |
3485 | context.setFontSize(24 * unit) | 3487 | context.setFontSize(24 * unit) |
3486 | context.setFillStyle("black") | 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 | var tj_path = "../../../../images/share/q_tj.png"; | 3492 | var tj_path = "../../../../images/share/q_tj.png"; |
3491 | context.drawImage(tj_path, 152 * unit + width, 54 * unit, 85 * unit, 30 * unit); | 3493 | context.drawImage(tj_path, 152 * unit + width, 54 * unit, 85 * unit, 30 * unit); |
@@ -3703,12 +3705,12 @@ Page({ | @@ -3703,12 +3705,12 @@ Page({ | ||
3703 | //--定义的保存图片方法,分享团--- | 3705 | //--定义的保存图片方法,分享团--- |
3704 | saveImageToPhotosAlbumDef: function () { | 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 | if (this.data.share_hidden) { | 3715 | if (this.data.share_hidden) { |
3714 | this.setData({share_hidden: false,}); | 3716 | this.setData({share_hidden: false,}); |
@@ -3861,12 +3863,13 @@ Page({ | @@ -3861,12 +3863,13 @@ Page({ | ||
3861 | context.fillText(shopName, 277 * unit, 60 * unit); | 3863 | context.fillText(shopName, 277 * unit, 60 * unit); |
3862 | 3864 | ||
3863 | // 3.推荐来源 | 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 | // 4.海报背景 | 3873 | // 4.海报背景 |
3871 | context.setFillStyle('white'); | 3874 | context.setFillStyle('white'); |
3872 | context.fillRect(37 * unit, 157 * unit, 480 * unit, 673 * unit); | 3875 | context.fillRect(37 * unit, 157 * unit, 480 * unit, 673 * unit); |