Commit 260a36ac238390f9a9eb3a5db29eb8e9888ecb9e
1 parent
8555acb0
搭配的分享优化
Showing
2 changed files
with
14 additions
and
7 deletions
packageA/pages/activity_share/activity_share.js
| @@ -923,24 +923,29 @@ Page({ | @@ -923,24 +923,29 @@ Page({ | ||
| 923 | var item=this.data.list[index]; | 923 | var item=this.data.list[index]; |
| 924 | this.setData({share_hidden:0,hui_active:item}); | 924 | this.setData({share_hidden:0,hui_active:item}); |
| 925 | 925 | ||
| 926 | + | ||
| 927 | + | ||
| 926 | var com = this.selectComponent("#share_button"); //组件的id | 928 | var com = this.selectComponent("#share_button"); //组件的id |
| 927 | com.set_type(1); | 929 | com.set_type(1); |
| 928 | }, | 930 | }, |
| 929 | //---点击分享商品--- | 931 | //---点击分享商品--- |
| 930 | - share_good:function(e){ | ||
| 931 | - | 932 | + share_good:function(e){ |
| 932 | //--先判断会员状态-- | 933 | //--先判断会员状态-- |
| 933 | var user_info = getApp().globalData.userInfo; | 934 | var user_info = getApp().globalData.userInfo; |
| 934 | if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) { | 935 | if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) { |
| 935 | //getApp().my_warnning("请先登录",0,this); | 936 | //getApp().my_warnning("请先登录",0,this); |
| 936 | wx.navigateTo({ url: '/pages/togoin/togoin', }) | 937 | wx.navigateTo({ url: '/pages/togoin/togoin', }) |
| 937 | return false; | 938 | return false; |
| 938 | - } | ||
| 939 | - | 939 | + } |
| 940 | var index=e.currentTarget.dataset.index; | 940 | var index=e.currentTarget.dataset.index; |
| 941 | var item=this.data.list[index]; | 941 | var item=this.data.list[index]; |
| 942 | - this.setData({share_hidden:0,share_good:item}); | ||
| 943 | - | 942 | + //如果是搭配购 |
| 943 | + if(item.main_goods_id){ | ||
| 944 | + item.goods_id=item.main_goods_id; | ||
| 945 | + item.goods_name=item.main_goods_name; | ||
| 946 | + } | ||
| 947 | + | ||
| 948 | + this.setData({share_hidden:0,share_good:item}); | ||
| 944 | var com = this.selectComponent("#share_button"); //组件的id | 949 | var com = this.selectComponent("#share_button"); //组件的id |
| 945 | com.set_type(0); | 950 | com.set_type(0); |
| 946 | }, | 951 | }, |
packageA/pages/activity_share/activity_share.wxml
| @@ -98,7 +98,9 @@ | @@ -98,7 +98,9 @@ | ||
| 98 | </view> | 98 | </view> |
| 99 | <view class="flex-equality pdt20" wx:else> | 99 | <view class="flex-equality pdt20" wx:else> |
| 100 | <view bindtap="showPopup" data-index="{{index}}" class="btn-container" ><text class="btn-share">活动详情</text></view> | 100 | <view bindtap="showPopup" data-index="{{index}}" class="btn-container" ><text class="btn-share">活动详情</text></view> |
| 101 | - <view bindtap="share_index" data-index="{{index}}" class="btn-container"><text class="btn-share w164">分享</text></view> | 101 | + |
| 102 | + <view wx:if="{{currentIndex2==1}}" bindtap="share_good" data-index="{{index}}" class="btn-container"><text class="btn-share w164">分享</text></view> | ||
| 103 | + <view wx:else bindtap="share_index" data-index="{{index}}" class="btn-container"><text class="btn-share w164">分享</text></view> | ||
| 102 | </view> | 104 | </view> |
| 103 | </view> | 105 | </view> |
| 104 | </view> | 106 | </view> |