Commit dea91f14f62ebf47b05ef72624750e84cbc6a78f

Authored by yvan.ni
1 parent c2846e86

服务卡项,拼团的分享的不判断会员要登陆

packageA/pages/serviceCard_pd/goodsInfo/goodsInfo.js
@@ -1598,12 +1598,12 @@ Page({ @@ -1598,12 +1598,12 @@ Page({
1598 //--定义的保存图片方法,分享团--- 1598 //--定义的保存图片方法,分享团---
1599 saveImageToPhotosAlbum: function () { 1599 saveImageToPhotosAlbum: function () {
1600 //--先判断会员状态-- 1600 //--先判断会员状态--
1601 - var user_info = getApp().globalData.userInfo;  
1602 - if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {  
1603 - //getApp().my_warnning("请先登录",0,this);  
1604 - wx.navigateTo({url: '/packageE/pages/togoin/togoin',})  
1605 - return false;  
1606 - } 1601 + // var user_info = getApp().globalData.userInfo;
  1602 + // if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
  1603 + // //getApp().my_warnning("请先登录",0,this);
  1604 + // wx.navigateTo({url: '/packageE/pages/togoin/togoin',})
  1605 + // return false;
  1606 + // }
1607 1607
1608 //类型 0普通商品 1秒杀商品 2商家和会员团 3阶梯团 4积分购 1608 //类型 0普通商品 1秒杀商品 2商家和会员团 3阶梯团 4积分购
1609 var type = 2 1609 var type = 2
@@ -1672,6 +1672,7 @@ Page({ @@ -1672,6 +1672,7 @@ Page({
1672 1672
1673 context.drawImage(pg_path, 0, 0, 554 * unit, 899 * unit); 1673 context.drawImage(pg_path, 0, 0, 554 * unit, 899 * unit);
1674 1674
  1675 + let nick=app.globalData.userInfo?app.globalData.userInfo.nickname:'';
1675 //-- 是自定义海报的情况下 -- 1676 //-- 是自定义海报的情况下 --
1676 if (th.data.poster && parseInt(th.data.poster.style) == 2) { 1677 if (th.data.poster && parseInt(th.data.poster.style) == 2) {
1677 //在线上分享人的情况下 1678 //在线上分享人的情况下
@@ -1684,8 +1685,8 @@ Page({ @@ -1684,8 +1685,8 @@ Page({
1684 //--昵称--- 1685 //--昵称---
1685 context.setFontSize(24 * unit) 1686 context.setFontSize(24 * unit)
1686 context.setFillStyle("black") 1687 context.setFillStyle("black")
1687 - context.fillText(app.globalData.userInfo.nickname, x1, y1);  
1688 - var width = 24 * app.globalData.userInfo.nickname.length * unit + 4 * unit; 1688 + context.fillText(nick, x1, y1);
  1689 + var width = 24 * nick.length * unit + 4 * unit;
1689 //强烈推荐 改许程 1690 //强烈推荐 改许程
1690 var tj_path = "../../../../images/share/q_tj.png"; 1691 var tj_path = "../../../../images/share/q_tj.png";
1691 context.drawImage(tj_path, x1 + width, y1 - 22 * unit, 85 * unit, 30 * unit); 1692 context.drawImage(tj_path, x1 + width, y1 - 22 * unit, 85 * unit, 30 * unit);
@@ -1699,8 +1700,8 @@ Page({ @@ -1699,8 +1700,8 @@ Page({
1699 //--昵称--- 1700 //--昵称---
1700 context.setFontSize(24 * unit) 1701 context.setFontSize(24 * unit)
1701 context.setFillStyle("black") 1702 context.setFillStyle("black")
1702 - context.fillText(app.globalData.userInfo.nickname, 152 * unit, 76 * unit);  
1703 - var width = 24 * app.globalData.userInfo.nickname.length * unit + 2 * unit; 1703 + context.fillText(nick, 152 * unit, 76 * unit);
  1704 + var width = 24 * nick.length * unit + 2 * unit;
1704 //强烈推荐 改许程 1705 //强烈推荐 改许程
1705 var tj_path = "../../../../images/share/q_tj.png"; 1706 var tj_path = "../../../../images/share/q_tj.png";
1706 context.drawImage(tj_path, 152 * unit + width, 54 * unit, 85 * unit, 30 * unit); 1707 context.drawImage(tj_path, 152 * unit + width, 54 * unit, 85 * unit, 30 * unit);
@@ -2005,9 +2006,9 @@ Page({ @@ -2005,9 +2006,9 @@ Page({
2005 return false; 2006 return false;
2006 } 2007 }
2007 //---获取分享图片的本地地址,头像和商品图片---- 2008 //---获取分享图片的本地地址,头像和商品图片----
2008 - var path2 = getApp().globalData.userInfo.head_pic; 2009 + var path2 = getApp().globalData.userInfo?getApp().globalData.userInfo.head_pic:'';
2009 if (path2 == "") { 2010 if (path2 == "") {
2010 - ee.data.share_head = "../../../images/share/hui_hear_pic.png"; 2011 + ee.data.share_head = "../../../../images/share/hui_hear_pic.png";
2011 tt(func); 2012 tt(func);
2012 } else { 2013 } else {
2013 path2 = path2.replace("http://thirdwx.qlogo.cn", "https://wx.qlogo.cn"); 2014 path2 = path2.replace("http://thirdwx.qlogo.cn", "https://wx.qlogo.cn");
@@ -3559,10 +3560,10 @@ Page({ @@ -3559,10 +3560,10 @@ Page({
3559 3560
3560 3561
3561 clickShare() { 3562 clickShare() {
3562 - if(!getApp().globalData.user_id){  
3563 - getApp().goto("/packageE/pages/togoin/togoin");  
3564 - return false;  
3565 - } 3563 + // if(!getApp().globalData.user_id){
  3564 + // getApp().goto("/packageE/pages/togoin/togoin");
  3565 + // return false;
  3566 + // }
3566 this.setData({ 3567 this.setData({
3567 share_hidden: true, 3568 share_hidden: true,
3568 }); 3569 });
@@ -3589,12 +3590,14 @@ Page({ @@ -3589,12 +3590,14 @@ Page({
3589 context.setFillStyle('black'); 3590 context.setFillStyle('black');
3590 context.fillText(shopName, 277 * unit, 60 * unit); 3591 context.fillText(shopName, 277 * unit, 60 * unit);
3591 3592
3592 - // 3.推荐来源  
3593 - let fromText = `来自${getApp().globalData.userInfo.nickname}的推荐`;  
3594 - context.setTextAlign('center');  
3595 - context.setFontSize(22 * unit);  
3596 - context.setFillStyle('#96959a');  
3597 - context.fillText(fromText, 277 * unit, 105 * unit); 3593 + if(getApp().globalData.userInfo) {
  3594 + // 3.推荐来源
  3595 + let fromText = `来自${getApp().globalData.userInfo.nickname}的推荐`;
  3596 + context.setTextAlign('center');
  3597 + context.setFontSize(22 * unit);
  3598 + context.setFillStyle('#96959a');
  3599 + context.fillText(fromText, 277 * unit, 105 * unit);
  3600 + }
3598 3601
3599 // 4.海报背景 3602 // 4.海报背景
3600 context.setFillStyle('white'); 3603 context.setFillStyle('white');
packageA/pages/serviceCard_pd/goodsInfo/goodsInfo.wxml
@@ -141,7 +141,7 @@ @@ -141,7 +141,7 @@
141 {{data.goods_name}} 141 {{data.goods_name}}
142 </view> 142 </view>
143 <!-- 这个是分享按钮 --> 143 <!-- 这个是分享按钮 -->
144 - <view class="xc-share-frame t-c shrink0" bindtap="clickShare"> 144 + <view wx:if="{{isLogin}}" class="xc-share-frame t-c shrink0" bindtap="clickShare">
145 <view class="iconfont icon-share"></view> 145 <view class="iconfont icon-share"></view>
146 <view class="fs22 c-7b">分享</view> 146 <view class="fs22 c-7b">分享</view>
147 </view> 147 </view>