diff --git a/packageC/pages/presell/goodsInfo/goodsInfo.js b/packageC/pages/presell/goodsInfo/goodsInfo.js index d84461d..17a62ae 100644 --- a/packageC/pages/presell/goodsInfo/goodsInfo.js +++ b/packageC/pages/presell/goodsInfo/goodsInfo.js @@ -1456,6 +1456,11 @@ Page({ return false; } + if(!this.data.pre_arr){ + ut.m_toast('您未达到活动条件,不能购买此活动商品商品'); + return false; + } + var ind = t.currentTarget.dataset.ind; //回调。判断是不是优惠促销 @@ -3223,12 +3228,12 @@ Page({ //--定义的保存图片方法,分享团--- saveImageToPhotosAlbum: function () { //--先判断会员状态-- - var user_info = getApp().globalData.userInfo; - if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) { - //getApp().my_warnning("请先登录",0,this); - wx.navigateTo({ url: '/packageE/pages/togoin/togoin', }) - return false; - } + // var user_info = getApp().globalData.userInfo; + // if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) { + // //getApp().my_warnning("请先登录",0,this); + // wx.navigateTo({ url: '/packageE/pages/togoin/togoin', }) + // return false; + // } if (this.data.share_hidden) { this.setData({ @@ -3289,6 +3294,8 @@ Page({ } context.drawImage(pg_path, 0, 0, 554 * unit, 899 * unit); + let nick=app.globalData.userInfo?app.globalData.userInfo.nickname:''; + //-- 是自定义海报的情况下 -- if (th.data.poster && parseInt(th.data.poster.style) == 2) { //在线上分享人的情况下 @@ -3301,8 +3308,8 @@ Page({ //--昵称--- context.setFontSize(24 * unit) context.setFillStyle("black") - context.fillText(app.globalData.userInfo.nickname, x1, y1); - var width = 24 * app.globalData.userInfo.nickname.length * unit + 4 * unit; + context.fillText(nick, x1, y1); + var width = 24 * nick.length * unit + 4 * unit; //强烈推荐 改许程 var tj_path = "../../../../images/share/q_tj.png"; context.drawImage(tj_path, x1 + width, y1 - 22 * unit, 85 * unit, 30 * unit); @@ -3319,8 +3326,8 @@ Page({ //--昵称--- context.setFontSize(24 * unit) context.setFillStyle("black") - context.fillText(app.globalData.userInfo.nickname, 152 * unit, 76 * unit); - var width = 24 * app.globalData.userInfo.nickname.length * unit + 2 * unit; + context.fillText(nick, 152 * unit, 76 * unit); + var width = 24 * nick.length * unit + 2 * unit; //强烈推荐 改许程 var tj_path = "../../../../images/share/q_tj.png"; context.drawImage(tj_path, 152 * unit + width, 54 * unit, 85 * unit, 30 * unit); @@ -3538,12 +3545,12 @@ Page({ //--定义的保存图片方法,分享团--- saveImageToPhotosAlbumDef: function () { //--先判断会员状态-- - var user_info = getApp().globalData.userInfo; - if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) { - //getApp().my_warnning("请先登录",0,this); - wx.navigateTo({url: '/packageE/pages/togoin/togoin',}) - return false; - } + // var user_info = getApp().globalData.userInfo; + // if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) { + // //getApp().my_warnning("请先登录",0,this); + // wx.navigateTo({url: '/packageE/pages/togoin/togoin',}) + // return false; + // } if (this.data.share_hidden) { this.setData({share_hidden: false,}); @@ -3696,11 +3703,13 @@ Page({ context.fillText(shopName, 277 * unit, 60 * unit); // 3.推荐来源 - let fromText = `来自${getApp().globalData.userInfo.nickname}的推荐`; - context.setTextAlign('center'); - context.setFontSize(22 * unit); - context.setFillStyle('#96959a'); - context.fillText(fromText, 277 * unit, 105 * unit); + if(getApp().globalData.userInfo) { + let fromText = `来自${getApp().globalData.userInfo.nickname}的推荐`; + context.setTextAlign('center'); + context.setFontSize(22 * unit); + context.setFillStyle('#96959a'); + context.fillText(fromText, 277 * unit, 105 * unit); + } // 4.海报背景 context.setFillStyle('white'); @@ -3858,7 +3867,7 @@ Page({ return false; } //---获取分享图片的本地地址,头像和商品图片---- - var path2 = getApp().globalData.userInfo.head_pic; + var path2 = getApp().globalData.userInfo?getApp().globalData.userInfo.head_pic:''; if (path2 == "") { ee.data.share_head = "../../../../images/share/hui_hear_pic.png"; tt(func); @@ -4666,10 +4675,10 @@ Page({ }, clickShare() { - if (!getApp().globalData.user_id) { - getApp().goto("/packageE/pages/togoin/togoin"); - return false; - } + // if (!getApp().globalData.user_id) { + // getApp().goto("/packageE/pages/togoin/togoin"); + // return false; + // } this.setData({ share_hidden: true, }); }, diff --git a/packageC/pages/presell/pregoodsInfo/goodsInfo.js b/packageC/pages/presell/pregoodsInfo/goodsInfo.js index 9f46a1d..8c52c63 100644 --- a/packageC/pages/presell/pregoodsInfo/goodsInfo.js +++ b/packageC/pages/presell/pregoodsInfo/goodsInfo.js @@ -2863,12 +2863,12 @@ Page({ //--定义的保存图片方法,分享团--- saveImageToPhotosAlbum: function () { //--先判断会员状态-- - var user_info = getApp().globalData.userInfo; - if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) { - //getApp().my_warnning("请先登录",0,this); - wx.navigateTo({ url: '/packageE/pages/togoin/togoin', }) - return false; - } + // var user_info = getApp().globalData.userInfo; + // if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) { + // //getApp().my_warnning("请先登录",0,this); + // wx.navigateTo({ url: '/packageE/pages/togoin/togoin', }) + // return false; + // } if (this.data.share_hidden) { this.setData({ @@ -4040,10 +4040,10 @@ Page({ }, clickShare() { - if(!getApp().globalData.user_id){ - getApp().goto("/packageE/pages/togoin/togoin"); - return false; - } + // if(!getApp().globalData.user_id){ + // getApp().goto("/packageE/pages/togoin/togoin"); + // return false; + // } this.setData({ share_hidden: true, }); },