diff --git a/packageA/pages/activity_share/activity_share.js b/packageA/pages/activity_share/activity_share.js index 940e4e5..efeaffa 100644 --- a/packageA/pages/activity_share/activity_share.js +++ b/packageA/pages/activity_share/activity_share.js @@ -673,12 +673,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; + // } //类型 0普通商品 1秒杀商品 2商家和会员团 3阶梯团 var type = 0; wx.showLoading({ @@ -752,6 +752,8 @@ Page({ pg_path=th.data.share_b_img; } 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){ @@ -765,8 +767,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); @@ -779,8 +781,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); @@ -1085,12 +1087,12 @@ Page({ share_index:function(e){ //--先判断会员状态-- - 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; + // } var index=e.currentTarget.dataset.index; var item=this.data.list[index]; @@ -1104,12 +1106,12 @@ Page({ //---点击分享商品--- share_good:function(e){ //--先判断会员状态-- - 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; + // } var index=e.currentTarget.dataset.index; var item=this.data.list[index]; //如果是搭配购 @@ -1126,12 +1128,12 @@ Page({ //----活动详情里面的分享--- share_good2:function(e){ //--先判断会员状态-- - 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; + // } var index=e.currentTarget.dataset.index; var item=this.data.list2[index]; @@ -1144,12 +1146,12 @@ Page({ share_detail:function(e){ //--先判断会员状态-- - 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; + // } var com = this.selectComponent("#share_button"); //组件的id com.set_type(0); @@ -1171,7 +1173,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); diff --git a/packageA/pages/goodsInfo/goodsInfo.js b/packageA/pages/goodsInfo/goodsInfo.js index bd7f826..10d2a0b 100644 --- a/packageA/pages/goodsInfo/goodsInfo.js +++ b/packageA/pages/goodsInfo/goodsInfo.js @@ -2096,12 +2096,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; + // } //类型 0普通商品 1秒杀商品 2商家和会员团 3阶梯团 4阶梯团 var type = this.data.prom_type; diff --git a/packageA/pages/goods_share/goods_share.js b/packageA/pages/goods_share/goods_share.js index 15f3333..27b065b 100644 --- a/packageA/pages/goods_share/goods_share.js +++ b/packageA/pages/goods_share/goods_share.js @@ -114,9 +114,9 @@ Page({ } }) - if(!app.globalData.userInfo) { - getApp().goto("/packageE/pages/togoin/togoin"); - } + // if(!app.globalData.userInfo) { + // getApp().goto("/packageE/pages/togoin/togoin"); + // } }, @@ -368,12 +368,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; + // } //类型 0普通商品 1秒杀商品 2商家和会员团 3阶梯团 var type = 0; wx.showLoading({ @@ -416,7 +416,9 @@ Page({ pg_path=th.data.share_b_img; } 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){ //在线上分享人的情况下 @@ -429,8 +431,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); @@ -443,8 +445,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); @@ -749,12 +751,12 @@ Page({ //点击分享商品 share_good:function(e){ //--先判断会员状态-- - 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; + // } var index=e.currentTarget.dataset.index; var item=this.data.list[index]; @@ -773,7 +775,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); diff --git a/packageA/pages/live_share/live_share.js b/packageA/pages/live_share/live_share.js index a8dbc61..2062041 100644 --- a/packageA/pages/live_share/live_share.js +++ b/packageA/pages/live_share/live_share.js @@ -166,12 +166,12 @@ Page({ share_index:function(e){ //--先判断会员状态-- - 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; + // } var index=e.currentTarget.dataset.index; var item=this.data.list[index]; diff --git a/packageA/pages/quan/quan.js b/packageA/pages/quan/quan.js index ac9e2f5..f7dcb84 100644 --- a/packageA/pages/quan/quan.js +++ b/packageA/pages/quan/quan.js @@ -123,26 +123,7 @@ Page({ } }) }, - - - //---点击分享优惠活动--- - share_index:function(e){ - - //--先判断会员状态-- - 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 index=e.currentTarget.dataset.index; - var item=this.data.list[index]; - this.setData({share_hidden:0,hui_active:item}); - - var com = this.selectComponent("#share_button"); //组件的id - com.set_type(1); - }, + //-- ---更多加载---- refresh:function(){ this.requestGoodsList(); @@ -152,12 +133,12 @@ Page({ share_index:function(e){ //--先判断会员状态-- - 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; + // } var index=e.currentTarget.dataset.index; var item=this.data.list[index]; diff --git a/packageA/pages/service_share/service_share.js b/packageA/pages/service_share/service_share.js index e498c8e..cda8b50 100644 --- a/packageA/pages/service_share/service_share.js +++ b/packageA/pages/service_share/service_share.js @@ -341,12 +341,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; + // } //类型 0普通商品 1秒杀商品 2商家和会员团 3阶梯团 var type = 0; wx.showLoading({ @@ -391,7 +391,9 @@ Page({ pg_path=th.data.share_b_img; } 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){ //在线上分享人的情况下 @@ -404,8 +406,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); @@ -418,8 +420,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); @@ -728,12 +730,12 @@ Page({ //点击分享商品 share_good:function(e){ //--先判断会员状态-- - 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; + // } var index=e.currentTarget.dataset.index; var item=this.data.list[index]; @@ -752,7 +754,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); diff --git a/packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.js b/packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.js index ca07bb0..b5d2154 100644 --- a/packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.js +++ b/packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.js @@ -568,16 +568,16 @@ Page({ //--先判断会员登陆状态-- - var user_info = getApp().globalData.userInfo; - if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) { - - getApp().is_Single_page(th, function () { - 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().is_Single_page(th, function () { + // wx.navigateTo({ + // url: '/packageE/pages/togoin/togoin', + // }) + // return false; + // }) + // } }, //-- 获取直播的分享人的导购信息 -- @@ -5320,14 +5320,17 @@ Page({ context.setFillStyle('black'); context.fillText(shopName, 277 * unit, 60 * unit); // // 3.推荐来源 - let fromText = `来自${getApp().globalData.userInfo.nickname}的推荐`; - // let fromTextLen = context.measureText(fromText); - // let x_fromText = (375 - fromTextLen.width)/2; - // console.log('222222',fromTextLen,x_fromText); - 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}的推荐`; + // let fromTextLen = context.measureText(fromText); + // let x_fromText = (375 - fromTextLen.width)/2; + // console.log('222222',fromTextLen,x_fromText); + context.setTextAlign('center'); + context.setFontSize(22 * unit); + context.setFillStyle('#96959a'); + context.fillText(fromText, 277 * unit, 105 * unit); + } // 4.海报背景 // context.beginPath(); // context.setStrokeStyle('#f2f1f6'); @@ -5423,12 +5426,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({ share_hidden: false, }); @@ -5497,7 +5500,7 @@ Page({ }; - + let nick=app.globalData.userInfo?app.globalData.userInfo.nickname:''; //-- 是自定义海报的情况下 -- if (th.data.share_b_img ) { @@ -5515,8 +5518,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); @@ -5870,9 +5873,9 @@ 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"; + ee.data.share_head = "../../../../images/share/hui_hear_pic.png"; tt(func); } else { path2 = path2.replace("http://thirdwx.qlogo.cn", "https://wx.qlogo.cn"); @@ -6917,10 +6920,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/cardInfo/goodsInfo.js b/packageC/pages/presell/cardInfo/goodsInfo.js index 5ad72af..cad10c2 100644 --- a/packageC/pages/presell/cardInfo/goodsInfo.js +++ b/packageC/pages/presell/cardInfo/goodsInfo.js @@ -1961,7 +1961,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); @@ -3359,10 +3359,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, }); }, @@ -3388,12 +3388,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({ @@ -3454,6 +3454,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) { //在线上分享人的情况下 @@ -3466,8 +3468,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); @@ -3484,8 +3486,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); @@ -3703,12 +3705,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,}); @@ -3861,12 +3863,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'); context.fillRect(37 * unit, 157 * unit, 480 * unit, 673 * unit); 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, }); }, diff --git a/packageD/pages/AI-test-skin/success_result/success_result.js b/packageD/pages/AI-test-skin/success_result/success_result.js index 6ab6db3..12ad501 100644 --- a/packageD/pages/AI-test-skin/success_result/success_result.js +++ b/packageD/pages/AI-test-skin/success_result/success_result.js @@ -844,11 +844,12 @@ Page({ var th = this; var rpx = this.data.cWidth / 750 * 4; //基础单位, //--先判断会员状态-- - var user_info = getApp().globalData.userInfo; - if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) { - 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) { + // wx.navigateTo({ url: '/packageE/pages/togoin/togoin', }) + // return false; + // } + if (this.data.share_hidden) { this.setData({ share_hidden: false, }); } diff --git a/packageE/pages/togoin/togoin.js b/packageE/pages/togoin/togoin.js index d1e92a2..e9b413f 100644 --- a/packageE/pages/togoin/togoin.js +++ b/packageE/pages/togoin/togoin.js @@ -11,7 +11,8 @@ Page({ store_logo: '', first_leader: '', //-- 邀请人 -- config2: null, - sub: 0 + sub: 0, + is_reg:1 }, onLoad: function (options) { if (wx.getUserProfile) { @@ -21,10 +22,9 @@ Page({ } getApp().globalData.isLoad_ad = 1; - - if(options.is_reg){ - this.data.is_reg=1; - } + // if(options.is_reg){ + // this.data.is_reg=1; + // } //-- 看一下隐私政策要不要显示 -- var privacy_pop = this.selectComponent("#privacy_pop"); //组件的id diff --git a/packageE/pages/user/monthgiftbag/giftpackinfo/giftpackinfo.js b/packageE/pages/user/monthgiftbag/giftpackinfo/giftpackinfo.js index 012c6f1..355446b 100644 --- a/packageE/pages/user/monthgiftbag/giftpackinfo/giftpackinfo.js +++ b/packageE/pages/user/monthgiftbag/giftpackinfo/giftpackinfo.js @@ -1460,10 +1460,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, }); @@ -1485,12 +1485,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({share_hidden: false,}); diff --git a/packageE/pages/user/monthgiftbag/giftpacklist/giftpacklist.js b/packageE/pages/user/monthgiftbag/giftpacklist/giftpacklist.js index 449040a..88e8af1 100644 --- a/packageE/pages/user/monthgiftbag/giftpacklist/giftpacklist.js +++ b/packageE/pages/user/monthgiftbag/giftpacklist/giftpacklist.js @@ -1045,10 +1045,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, }); @@ -1070,12 +1070,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({share_hidden: false,}); diff --git a/packageG/pages/team/team_success/team_success.js b/packageG/pages/team/team_success/team_success.js index 49fdbfc..44b22cd 100644 --- a/packageG/pages/team/team_success/team_success.js +++ b/packageG/pages/team/team_success/team_success.js @@ -464,7 +464,7 @@ Page({ //先画背景 - var pg_path = "../../../images/share/share_bg.png"; + var pg_path = "../../../../images/share/share_bg.png"; //-- 如果有自定义海报的时候,判断背景的图片 -- if(th.data.share_b_img){ pg_path=th.data.share_b_img; @@ -493,7 +493,7 @@ Page({ context.fillText(app.globalData.userInfo.nickname, x1, y1); var width = 24 * app.globalData.userInfo.nickname.length * unit + 4 * unit; //强烈推荐 改许程 - var tj_path = "../../../images/share/q_tj.png"; + var tj_path = "../../../../images/share/q_tj.png"; context.drawImage(tj_path, x1 + width, y1-22*unit, 85 * unit, 30 * unit); context.setFontSize(16 * unit) context.setLineJoin('round'); //交点设置成圆角 @@ -508,7 +508,7 @@ Page({ context.fillText(app.globalData.userInfo.nickname, 152 * unit, 76 * unit); var width = 24 * app.globalData.userInfo.nickname.length * unit + 2 * unit; //强烈推荐 - var tj_path = "../../../images/share/q_tj.png"; + var tj_path = "../../../../images/share/q_tj.png"; context.drawImage(tj_path, 152 * unit + width, 54 * unit, 110 * unit, 30 * unit); context.setFontSize(18 * unit) context.setFillStyle("white") @@ -579,7 +579,7 @@ Page({ context.fillText("好物拼起来,拼拼更划算", 40 * unit, 726 * unit); //绘制成团图片 - var ct_img ="../../../images/share/ct_num.png"; + var ct_img ="../../../../images/share/ct_num.png"; context.drawImage(ct_img, 40 * unit, 740 * unit, 120 * unit, 30 * unit); var ct_num = th.data.teamlist.ct_num; context.setFontSize(14 * unit) @@ -772,7 +772,7 @@ Page({ //---获取分享图片的本地地址,头像和商品图片---- var path2 = getApp().globalData.userInfo.head_pic; if(path2==""){ - ee.data.share_head ="../../../images/share/hui_hear_pic.png"; + ee.data.share_head ="../../../../images/share/hui_hear_pic.png"; tt(func); }else { path2=path2.replace("http://thirdwx.qlogo.cn","https://wx.qlogo.cn"); @@ -785,7 +785,7 @@ Page({ tt(func);; }, fail: function (res) { - ee.data.share_head = "../../../images/share/hui_hear_pic.png"; //分享的图片不能用网络的 + ee.data.share_head = "../../../../images/share/hui_hear_pic.png"; //分享的图片不能用网络的 tt(func); } }); @@ -864,10 +864,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, }); @@ -957,7 +957,7 @@ Page({ if (type == 1) { // 商家和会员团 - src = '../../../images/share/ct_num.png'; + src = '../../../../images/share/ct_num.png'; context.drawImage(src, 54 * unit, 648 * unit, 120 * unit, 30 * unit); context.setTextAlign('left'); diff --git a/pages/activity/seckill_list/seckill_list.js b/pages/activity/seckill_list/seckill_list.js index f22b50f..c9640fe 100644 --- a/pages/activity/seckill_list/seckill_list.js +++ b/pages/activity/seckill_list/seckill_list.js @@ -17,7 +17,9 @@ Page({ isshow: 0, ad_data: null, max_sw_height: 200, - is_retail_price:0 + is_retail_price:0, + + timer_js:[] }, //------初始化加载---------- @@ -101,6 +103,7 @@ Page({ onHide: function () { //--清理定时器-- clearInterval(this.data.timer); + this.data.is_timer=0; this.setData({ isshow: 0 }); @@ -110,9 +113,10 @@ Page({ return param < 10 ? '0' + param : param; }, - //----倒计时函数----- + //----倒计时函数,优化定时器只显示在可视范围内的----- countDown() { if (!this.data.is_timer) return false; + var th = this; // 获取当前时间,同时得到活动结束时间数组 let newTime = ut.gettimestamp(); @@ -120,45 +124,82 @@ Page({ if (endTimeList == null) return null // 对结束时间进行处理渲染到页面 for (var i = 0; i < endTimeList.length; i++) { + + if (!this.data.is_timer) break; + var o = endTimeList[i]; if(!o) continue; var endTime = o.end_time; if (th.data.type == 0) endTime = o.start_time; - let obj = null; - // 如果活动未结束,对时间进行处理 - if (endTime - newTime > 0) { - let time = (endTime - newTime); - // 获取天、时、分、秒 - let day = parseInt(time / (60 * 60 * 24)); - let hou = parseInt(time % (60 * 60 * 24) / 3600); - let min = parseInt(time % (60 * 60 * 24) % 3600 / 60); - let sec = parseInt(time % (60 * 60 * 24) % 3600 % 60); - obj = { - day: this.timeFormat(day), - hou: this.timeFormat(hou), - min: this.timeFormat(min), - sec: this.timeFormat(sec), - hide: 1 - } - } else { - //活动已结束,全部设置为'00' - obj = { - day: '00', - hou: '00', - min: '00', - sec: '00' + + // 创建查询对象 + let query = wx.createSelectorQuery(); + // 获取目标元素,并获取目标元素的信息 + query.select("#kill-item"+i).boundingClientRect(); + // 获取视口,并获取视口信息 + query.selectViewport().boundingClientRect(); + //-- 执行查询,元素要在显示中的才显示定时器 -- + query.exec(([target, view]) => { + + if (!th.data.is_timer) return; + if (!target) return; + if (!target.id) return; + + let idx= target.id.replace('kill-item',''); + // 条件1:当目标顶部距离视口顶部距离小于视口的高度时 + // 条件2:当目标底部距离视口顶部距离大于0时 + // 当以上两个条件同时成立时,目标元素在视口中 + if (target.top < view.height && target.bottom > 0) { + let obj = null; + // 如果活动未结束,对时间进行处理 + if (endTime - newTime > 0) { + let time = (endTime - newTime); + // 获取天、时、分、秒 + let day = parseInt(time / (60 * 60 * 24)); + let hou = parseInt(time % (60 * 60 * 24) / 3600); + let min = parseInt(time % (60 * 60 * 24) % 3600 / 60); + let sec = parseInt(time % (60 * 60 * 24) % 3600 % 60); + obj = { + day: this.timeFormat(day), + hou: this.timeFormat(hou), + min: this.timeFormat(min), + sec: this.timeFormat(sec), + hide: 1 + } + } else { + //活动已结束,全部设置为'00' + obj = { + day: '00', + hou: '00', + min: '00', + sec: '00' + } + } + var txt = "timer_js[" + idx + "]"; + + if (!th.data.is_timer) return; + + th.setData({ + [txt]: obj + }); + } else { + console.log("隐藏中"); } - } - var txt = "goodlist[" + i + "].djs"; - th.setData({ - [txt]: obj }); + + + } }, async requestSalelist() { //--没有更多就不调用-- if (!this.data.ismore) return false; + if(this.data.lding) return false; + this.data.lding=1; + this.data.is_timer=0; //暂停一下定时器 + + var e = this, th = e, i = "/api/ms/flash_sale/spikepage?page=" + e.data.currentPage; @@ -173,7 +214,8 @@ Page({ timetype: th.data.type, is_end: 0, is_show: 1, - user_id: user_id + user_id: user_id, + isRedis:1 }; wx.showLoading(); @@ -190,6 +232,7 @@ Page({ wx.hideLoading(); th.data.ismore = 0; + this.data.is_timer=1; if (e.data.currentPage == 1 && this.data.type == 1) { //-- 弄到即将开始 -- @@ -223,6 +266,8 @@ Page({ getApp().showWarning("没有更多数据"); } + this.data.lding=0; + this.data.is_timer=1; return false; } @@ -239,14 +284,22 @@ Page({ plist[i].price_n = price } var prom_id = plist[i].id; - await getApp().request.promiseGet("/api/weshop/activitylist/getActLen/" + - os.stoid + "/1/" + prom_id, {} - ).then(res => { - if (res.data.code == 0) { - plist[i].status = 1; - if (res.data.data <= 0) plist[i].status = 3; - } - }) + + // await getApp().request.promiseGet("/api/weshop/activitylist/getActLen/" + + // os.stoid + "/1/" + prom_id, {} + // ).then(res => { + // if (res.data.code == 0) { + // plist[i].status = 1; + // if (res.data.data <= 0) plist[i].status = 3; + // } + // }) + + plist[i].status = 1; + if (plist[i].actLen <= 0) { + plist[i].status = 3; + } + + alllist.push(plist[i]); } e.data.currentPage++; @@ -258,7 +311,10 @@ Page({ setTimeout(()=>{ wx.hideLoading(); - },500) + },200) + + this.data.lding=0; + this.data.is_timer=1; diff --git a/pages/activity/seckill_list/seckill_list.wxml b/pages/activity/seckill_list/seckill_list.wxml index 1bc8153..24b0413 100644 --- a/pages/activity/seckill_list/seckill_list.wxml +++ b/pages/activity/seckill_list/seckill_list.wxml @@ -32,7 +32,7 @@ - + @@ -59,12 +59,12 @@ - + 剩余: - {{item.djs.day}}天 - {{item.djs.hou}}时 - {{item.djs.min}}分 - {{item.djs.sec}}秒 + {{timer_js[index].day}}天 + {{timer_js[index].hou}}时 + {{timer_js[index].min}}分 + {{timer_js[index].sec}} diff --git a/pages/giftpack/giftpacklist/giftpacklist.js b/pages/giftpack/giftpacklist/giftpacklist.js index 15ebba3..522f8d9 100644 --- a/pages/giftpack/giftpacklist/giftpacklist.js +++ b/pages/giftpack/giftpacklist/giftpacklist.js @@ -1138,10 +1138,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, }); @@ -1163,12 +1163,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({share_hidden: false,}); diff --git a/pages/goods/goodsInfo/goodsInfo.js b/pages/goods/goodsInfo/goodsInfo.js index b24e93d..17ebafa 100644 --- a/pages/goods/goodsInfo/goodsInfo.js +++ b/pages/goods/goodsInfo/goodsInfo.js @@ -6355,12 +6355,15 @@ Page({ context.setFillStyle('black'); 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); + let nick=getApp().globalData.userInfo?getApp().globalData.userInfo.nickname:''; + if(nick) { + // 3.推荐来源 + let fromText = `来自${nick}的推荐`; + context.setTextAlign('center'); + context.setFontSize(22 * unit); + context.setFillStyle('#96959a'); + context.fillText(fromText, 277 * unit, 105 * unit); + } // 4.海报背景 context.setFillStyle('white'); @@ -6525,14 +6528,14 @@ 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({ @@ -6619,6 +6622,7 @@ Page({ var act_time = ''; + let nick=app.globalData.userInfo?app.globalData.userInfo.nickname:''; //-- 是自定义海报的情况下 -- if (th.data.share_b_img || (type != 0 && type != 1 && type != 2 && type != 3)) { @@ -6631,11 +6635,13 @@ Page({ var y = parseFloat(th.data.poster.head_y) * 2; var x1 = (x + 90) * unit; var y1 = (y + 50) * unit; + + //--昵称--- 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); @@ -6652,8 +6658,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); @@ -7282,7 +7288,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); @@ -8686,10 +8692,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/pages/index/index/index.js b/pages/index/index/index.js index 5cf394d..eac6e87 100644 --- a/pages/index/index/index.js +++ b/pages/index/index/index.js @@ -1534,11 +1534,11 @@ Page({ }, go_pre: function (e) { - var userInfo = getApp().globalData.userInfo; - if (!userInfo) { - getApp().goto("/packageE/pages/togoin/togoin"); - return false; - } + // var userInfo = getApp().globalData.userInfo; + // if (!userInfo) { + // getApp().goto("/packageE/pages/togoin/togoin"); + // return false; + // } var url = e.currentTarget.dataset.url; getApp().goto(url); },