Commit db670021f4929a332b16c71a085940011084beab
1 parent
6c738713
商品详情页分享
Showing
3 changed files
with
35 additions
and
6 deletions
pages/goods/goodsInfo/goodsInfo.js
| ... | ... | @@ -248,6 +248,7 @@ Page({ |
| 248 | 248 | sto_sele_name_1:'',//分享的门店名称 |
| 249 | 249 | fir_goods:null, |
| 250 | 250 | |
| 251 | + share_hidden: false, | |
| 251 | 252 | }, |
| 252 | 253 | |
| 253 | 254 | //------初始化加载---------- |
| ... | ... | @@ -708,6 +709,7 @@ Page({ |
| 708 | 709 | |
| 709 | 710 | //---展示--- |
| 710 | 711 | onShow: function() { |
| 712 | + console.log('djfijsaoifjoisadjfoij'); | |
| 711 | 713 | var goods_list = null,th = this,that=this; |
| 712 | 714 | |
| 713 | 715 | //优惠券要实时更新 |
| ... | ... | @@ -3894,6 +3896,12 @@ Page({ |
| 3894 | 3896 | wx.navigateTo({ url: '/pages/togoin/togoin', }) |
| 3895 | 3897 | return false; |
| 3896 | 3898 | } |
| 3899 | + | |
| 3900 | + if(this.data.share_hidden) { | |
| 3901 | + this.setData({ | |
| 3902 | + share_hidden: false, | |
| 3903 | + }); | |
| 3904 | + }; | |
| 3897 | 3905 | |
| 3898 | 3906 | //类型 0普通商品 1秒杀商品 2商家和会员团 3阶梯团 4阶梯团 |
| 3899 | 3907 | var type = this.data.prom_type; |
| ... | ... | @@ -5261,7 +5269,23 @@ Page({ |
| 5261 | 5269 | flag: !this.data.flag, |
| 5262 | 5270 | }) |
| 5263 | 5271 | }, |
| 5272 | + | |
| 5273 | + clickShare() { | |
| 5274 | + this.setData({ | |
| 5275 | + share_hidden: true, | |
| 5276 | + }); | |
| 5277 | + }, | |
| 5264 | 5278 | |
| 5265 | - | |
| 5279 | + send() { | |
| 5280 | + this.setData({ | |
| 5281 | + share_hidden:false, | |
| 5282 | + }); | |
| 5283 | + }, | |
| 5284 | + | |
| 5285 | + cancel() { | |
| 5286 | + this.setData({ | |
| 5287 | + share_hidden:false, | |
| 5288 | + }); | |
| 5289 | + }, | |
| 5266 | 5290 | |
| 5267 | 5291 | }); | ... | ... |
pages/goods/goodsInfo/goodsInfo.json
| ... | ... | @@ -4,6 +4,7 @@ |
| 4 | 4 | "usingComponents": { |
| 5 | 5 | "nav_box": "/components/nav_box/nav_box", |
| 6 | 6 | "warn": "/components/long_warn/long_warn", |
| 7 | - "goods_recommend": "/components/goods_list/goods_list" | |
| 7 | + "goods_recommend": "/components/goods_list/goods_list", | |
| 8 | + "share": "/components/share/share" | |
| 8 | 9 | } |
| 9 | 10 | } |
| 10 | 11 | \ No newline at end of file | ... | ... |
pages/goods/goodsInfo/goodsInfo.wxml
| ... | ... | @@ -132,7 +132,7 @@ |
| 132 | 132 | </view> |
| 133 | 133 | |
| 134 | 134 | <!-- 这个是分享按钮 --> |
| 135 | - <view class="xc-share-frame t-c" bindtap="saveImageToPhotosAlbum"> | |
| 135 | + <view class="xc-share-frame t-c" bindtap="clickShare"> | |
| 136 | 136 | <view class="iconfont icon-share fs60"></view> |
| 137 | 137 | <view class="fs22 c-7b">分享</view> |
| 138 | 138 | </view> |
| ... | ... | @@ -255,7 +255,7 @@ |
| 255 | 255 | |
| 256 | 256 | <!-- 这个是分享按钮 --> |
| 257 | 257 | <!-- <view class="xc-share-frame flex {{prom_type==1?'s_ms_bth':''}} " bindtap="saveImageToPhotosAlbum"> --> |
| 258 | - <view class="xc-share-frame flex {{prom_type==1?'s_ms_bth':''}} " bindtap="saveImageToPhotosAlbum"> | |
| 258 | + <view class="xc-share-frame flex {{prom_type==1?'s_ms_bth':''}} " bindtap="clickShare"> | |
| 259 | 259 | <image class="share-frame" src="{{iurl}}/miniapp/images/share.png"></image> |
| 260 | 260 | <view class="share-font">分享</view> |
| 261 | 261 | </view> |
| ... | ... | @@ -300,7 +300,7 @@ |
| 300 | 300 | |
| 301 | 301 | <!-- 这个是分享按钮 --> |
| 302 | 302 | <!-- <view class="xc-share-frame {{prom_type==1?'s_ms_bth':''}} t-c" bindtap="saveImageToPhotosAlbum"> --> |
| 303 | - <view class="xc-share-frame t-c" bindtap="saveImageToPhotosAlbum" wx:if="{{prom_type != 1}}"> | |
| 303 | + <view class="xc-share-frame t-c" bindtap="clickShare" wx:if="{{prom_type != 1}}"> | |
| 304 | 304 | <!-- <image class="share-frame" src="{{iurl}}/miniapp/images/share.png"></image> --> |
| 305 | 305 | <view class="iconfont icon-share fs60"></view> |
| 306 | 306 | <!-- <view class="share-font">1分享</view> --> |
| ... | ... | @@ -394,7 +394,7 @@ |
| 394 | 394 | |
| 395 | 395 | <!-- 这个是分享按钮 --> |
| 396 | 396 | <!-- <view class="xc-share-frame {{prom_type==1?'s_ms_bth':''}} t-c" bindtap="saveImageToPhotosAlbum"> --> |
| 397 | - <view class="xc-share-frame t-c" bindtap="saveImageToPhotosAlbum"> | |
| 397 | + <view class="xc-share-frame t-c" bindtap="clickShare"> | |
| 398 | 398 | <!-- <image class="share-frame" src="{{iurl}}/miniapp/images/share.png"></image> --> |
| 399 | 399 | <view class="iconfont icon-share fs60"></view> |
| 400 | 400 | <!-- <view class="share-font">1分享</view> --> |
| ... | ... | @@ -1477,6 +1477,10 @@ |
| 1477 | 1477 | <warn id="warn"></warn> |
| 1478 | 1478 | |
| 1479 | 1479 | |
| 1480 | +<!-- 分享控件,底部弹出 --> | |
| 1481 | +<share id="share_button" bind:send="send" bind:cancel="cancel" bind:share_img="saveImageToPhotosAlbum" wx:if="{{share_hidden}}"></share> | |
| 1482 | + | |
| 1483 | + | |
| 1480 | 1484 | <view wx:if="{{showPoster}}"> |
| 1481 | 1485 | <view class="mask" catchtap="closePoster"></view> |
| 1482 | 1486 | <view class="poster-container"> | ... | ... |