From c590feba35e0611965a4b791b2c4bd5426a7851f Mon Sep 17 00:00:00 2001 From: yvan.ni Date: Fri, 16 Feb 2024 00:01:39 +0800 Subject: [PATCH] 服务卡项拼团的 拼团成功页面的会员不判断登陆 --- packageA/pages/serviceCard_pd/team_success/team_success.js | 36 ++++++++++++++++++++---------------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/packageA/pages/serviceCard_pd/team_success/team_success.js b/packageA/pages/serviceCard_pd/team_success/team_success.js index fa06596..7da1340 100644 --- a/packageA/pages/serviceCard_pd/team_success/team_success.js +++ b/packageA/pages/serviceCard_pd/team_success/team_success.js @@ -482,6 +482,8 @@ Page({ } else { 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) { //在线上分享人的情况下 @@ -494,8 +496,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); @@ -509,8 +511,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, 110 * unit, 30 * unit); @@ -806,9 +808,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"); @@ -902,10 +904,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, }); @@ -1053,12 +1055,14 @@ 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); + if(getApp().globalData.userInfo) { + // 3.推荐来源 + 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'); -- libgit2 0.21.4