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,6 +1456,11 @@ Page({ | ||
1456 | return false; | 1456 | return false; |
1457 | } | 1457 | } |
1458 | 1458 | ||
1459 | + if(!this.data.pre_arr){ | ||
1460 | + ut.m_toast('您未达到活动条件,不能购买此活动商品商品'); | ||
1461 | + return false; | ||
1462 | + } | ||
1463 | + | ||
1459 | var ind = t.currentTarget.dataset.ind; | 1464 | var ind = t.currentTarget.dataset.ind; |
1460 | 1465 | ||
1461 | //回调。判断是不是优惠促销 | 1466 | //回调。判断是不是优惠促销 |
@@ -3223,12 +3228,12 @@ Page({ | @@ -3223,12 +3228,12 @@ Page({ | ||
3223 | //--定义的保存图片方法,分享团--- | 3228 | //--定义的保存图片方法,分享团--- |
3224 | saveImageToPhotosAlbum: function () { | 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 | if (this.data.share_hidden) { | 3238 | if (this.data.share_hidden) { |
3234 | this.setData({ | 3239 | this.setData({ |
@@ -3289,6 +3294,8 @@ Page({ | @@ -3289,6 +3294,8 @@ Page({ | ||
3289 | } | 3294 | } |
3290 | context.drawImage(pg_path, 0, 0, 554 * unit, 899 * unit); | 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 | if (th.data.poster && parseInt(th.data.poster.style) == 2) { | 3300 | if (th.data.poster && parseInt(th.data.poster.style) == 2) { |
3294 | //在线上分享人的情况下 | 3301 | //在线上分享人的情况下 |
@@ -3301,8 +3308,8 @@ Page({ | @@ -3301,8 +3308,8 @@ Page({ | ||
3301 | //--昵称--- | 3308 | //--昵称--- |
3302 | context.setFontSize(24 * unit) | 3309 | context.setFontSize(24 * unit) |
3303 | context.setFillStyle("black") | 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 | var tj_path = "../../../../images/share/q_tj.png"; | 3314 | var tj_path = "../../../../images/share/q_tj.png"; |
3308 | context.drawImage(tj_path, x1 + width, y1 - 22 * unit, 85 * unit, 30 * unit); | 3315 | context.drawImage(tj_path, x1 + width, y1 - 22 * unit, 85 * unit, 30 * unit); |
@@ -3319,8 +3326,8 @@ Page({ | @@ -3319,8 +3326,8 @@ Page({ | ||
3319 | //--昵称--- | 3326 | //--昵称--- |
3320 | context.setFontSize(24 * unit) | 3327 | context.setFontSize(24 * unit) |
3321 | context.setFillStyle("black") | 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 | var tj_path = "../../../../images/share/q_tj.png"; | 3332 | var tj_path = "../../../../images/share/q_tj.png"; |
3326 | context.drawImage(tj_path, 152 * unit + width, 54 * unit, 85 * unit, 30 * unit); | 3333 | context.drawImage(tj_path, 152 * unit + width, 54 * unit, 85 * unit, 30 * unit); |
@@ -3538,12 +3545,12 @@ Page({ | @@ -3538,12 +3545,12 @@ Page({ | ||
3538 | //--定义的保存图片方法,分享团--- | 3545 | //--定义的保存图片方法,分享团--- |
3539 | saveImageToPhotosAlbumDef: function () { | 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 | if (this.data.share_hidden) { | 3555 | if (this.data.share_hidden) { |
3549 | this.setData({share_hidden: false,}); | 3556 | this.setData({share_hidden: false,}); |
@@ -3696,11 +3703,13 @@ Page({ | @@ -3696,11 +3703,13 @@ Page({ | ||
3696 | context.fillText(shopName, 277 * unit, 60 * unit); | 3703 | context.fillText(shopName, 277 * unit, 60 * unit); |
3697 | 3704 | ||
3698 | // 3.推荐来源 | 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 | // 4.海报背景 | 3714 | // 4.海报背景 |
3706 | context.setFillStyle('white'); | 3715 | context.setFillStyle('white'); |
@@ -3858,7 +3867,7 @@ Page({ | @@ -3858,7 +3867,7 @@ Page({ | ||
3858 | return false; | 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 | if (path2 == "") { | 3871 | if (path2 == "") { |
3863 | ee.data.share_head = "../../../../images/share/hui_hear_pic.png"; | 3872 | ee.data.share_head = "../../../../images/share/hui_hear_pic.png"; |
3864 | tt(func); | 3873 | tt(func); |
@@ -4666,10 +4675,10 @@ Page({ | @@ -4666,10 +4675,10 @@ Page({ | ||
4666 | }, | 4675 | }, |
4667 | 4676 | ||
4668 | clickShare() { | 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 | this.setData({ share_hidden: true, }); | 4682 | this.setData({ share_hidden: true, }); |
4674 | }, | 4683 | }, |
4675 | 4684 |
packageC/pages/presell/pregoodsInfo/goodsInfo.js
@@ -2863,12 +2863,12 @@ Page({ | @@ -2863,12 +2863,12 @@ Page({ | ||
2863 | //--定义的保存图片方法,分享团--- | 2863 | //--定义的保存图片方法,分享团--- |
2864 | saveImageToPhotosAlbum: function () { | 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 | if (this.data.share_hidden) { | 2873 | if (this.data.share_hidden) { |
2874 | this.setData({ | 2874 | this.setData({ |
@@ -4040,10 +4040,10 @@ Page({ | @@ -4040,10 +4040,10 @@ Page({ | ||
4040 | }, | 4040 | }, |
4041 | 4041 | ||
4042 | clickShare() { | 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 | this.setData({ share_hidden: true, }); | 4047 | this.setData({ share_hidden: true, }); |
4048 | }, | 4048 | }, |
4049 | 4049 |