Commit 35b00aa59fbd795c1251cdfa755194740ed97e10
1 parent
30fe44c8
预售的普通商品的分享的优化
Showing
2 changed files
with
45 additions
and
36 deletions
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 | ... | ... |