Commit 194efa9c69f0e188d22dd21a62be1918b97f442d
1 parent
98db674d
海报取消微信好友分享和保存到相册按钮,取消点击图片预览,直接长按图片就可以分享和保存
Showing
2 changed files
with
56 additions
and
29 deletions
pages/goods/goodsInfo/goodsInfo.js
| ... | ... | @@ -261,10 +261,10 @@ Page({ |
| 261 | 261 | room_user_share=t.room_user_share; //如果是会员分享带有room_id的话,那么接下来会员分享就不传room_id |
| 262 | 262 | |
| 263 | 263 | //-- 自定义海报 -- |
| 264 | - getApp().request.promiseGet("/api/weshop/goods/poster/page",{ | |
| 265 | - data:{store_id:os.stoid, type:1, is_use:1 } | |
| 264 | + getApp().request.promiseGet("/api/weshop/goods/poster/page", { | |
| 265 | + data:{store_id:os.stoid, type:1, is_use:1} | |
| 266 | 266 | }).then(res=>{ |
| 267 | - if(res.data.code==0 && res.data.data && res.data.data.pageData && res.data.data.pageData[0] ){ | |
| 267 | + if(res.data.code==0 && res.data.data && res.data.data.pageData && res.data.data.pageData[0]){ | |
| 268 | 268 | |
| 269 | 269 | var poster_data=res.data.data.pageData[0]; |
| 270 | 270 | var json_str=poster_data.jsonStr; |
| ... | ... | @@ -3641,14 +3641,14 @@ Page({ |
| 3641 | 3641 | var unit = that.data.screenWidth / 750 * 1.35; //基础单位, |
| 3642 | 3642 | var path2 = that.data.data.original_img; |
| 3643 | 3643 | var scene = th.data.gid+""; |
| 3644 | - var user_id=getApp().globalData.user_id?getApp().globalData.user_id:0; | |
| 3645 | - if(user_id>0){ | |
| 3644 | + var user_id = getApp().globalData.user_id?getApp().globalData.user_id:0; | |
| 3645 | + if(user_id>0) { | |
| 3646 | 3646 | scene+="_"+user_id; |
| 3647 | 3647 | } |
| 3648 | 3648 | //-- 如果不是会员分享过来的要分享给别人 -- |
| 3649 | - if(getApp().globalData.room_id && th.data.data.goods_id==getApp().globalData.room_goods_id && !getApp().globalData.room_user_share){ | |
| 3649 | + if(getApp().globalData.room_id && th.data.data.goods_id==getApp().globalData.room_goods_id && !getApp().globalData.room_user_share) { | |
| 3650 | 3650 | //固定房间是第3个字符 |
| 3651 | - if(!user_id) scene+="_0"; | |
| 3651 | + if(!user_id) scene+="_0"; | |
| 3652 | 3652 | scene+="_"+getApp().globalData.room_id ; |
| 3653 | 3653 | } |
| 3654 | 3654 | ///二微码 |
| ... | ... | @@ -3678,7 +3678,7 @@ Page({ |
| 3678 | 3678 | context.drawImage(pg_path, 0, 0, 554 * unit, 899 * unit); |
| 3679 | 3679 | |
| 3680 | 3680 | //-- 是自定义海报的情况下 -- |
| 3681 | - if(th.data.poster && parseInt(th.data.poster.style)==2){ | |
| 3681 | + if(th.data.poster && parseInt(th.data.poster.style)==2) { | |
| 3682 | 3682 | //在线上分享人的情况下 |
| 3683 | 3683 | if(parseInt(th.data.poster.show_headpic)){ |
| 3684 | 3684 | //获取坐标 |
| ... | ... | @@ -3697,9 +3697,13 @@ Page({ |
| 3697 | 3697 | context.setFontSize(16 * unit) |
| 3698 | 3698 | context.setLineJoin('round'); //交点设置成圆角 |
| 3699 | 3699 | context.setFillStyle("white") |
| 3700 | - context.fillText('强烈推荐', x1 + width+8*unit, y1-1*unit); | |
| 3700 | + context.fillText('强烈推荐', x1 + width+8*unit, y1-1*unit); | |
| 3701 | + | |
| 3702 | + context.setFillStyle("black") | |
| 3703 | + context.setFontSize(24 * unit) | |
| 3704 | + context.fillText(getApp().globalData.config.store_name, 40 * unit, 130 * unit); | |
| 3701 | 3705 | } |
| 3702 | - }else{ | |
| 3706 | + } else { | |
| 3703 | 3707 | //--昵称--- |
| 3704 | 3708 | context.setFontSize(24 * unit) |
| 3705 | 3709 | context.setFillStyle("black") |
| ... | ... | @@ -3708,9 +3712,9 @@ Page({ |
| 3708 | 3712 | //强烈推荐 改许程 |
| 3709 | 3713 | var tj_path = "../../../images/share/q_tj.png"; |
| 3710 | 3714 | context.drawImage(tj_path, 152 * unit + width, 54 * unit, 85 * unit, 30 * unit); |
| 3711 | - context.setFontSize(16 * unit) | |
| 3715 | + context.setFontSize(16 * unit); | |
| 3712 | 3716 | context.setLineJoin('round'); //交点设置成圆角 |
| 3713 | - context.setFillStyle("white") | |
| 3717 | + context.setFillStyle("white"); | |
| 3714 | 3718 | context.fillText('强烈推荐', 149 * unit + width + 15 * unit, 76 * unit); |
| 3715 | 3719 | } |
| 3716 | 3720 | |
| ... | ... | @@ -3805,23 +3809,33 @@ Page({ |
| 3805 | 3809 | } |
| 3806 | 3810 | |
| 3807 | 3811 | |
| 3808 | - //---画线--- | |
| 3809 | - context.setLineWidth(1 * unit) | |
| 3810 | - context.moveTo(32 * unit, 710 * unit) | |
| 3811 | - context.lineTo(520 * unit, 710 * unit) | |
| 3812 | - context.stroke(); | |
| 3813 | - //---文字--- | |
| 3814 | - context.setFillStyle("black") | |
| 3815 | - context.setFontSize(22 * unit) | |
| 3812 | + //---画线--- | |
| 3813 | + context.setLineWidth(1 * unit) | |
| 3814 | + context.moveTo(32 * unit, 710 * unit) | |
| 3815 | + context.lineTo(520 * unit, 710 * unit) | |
| 3816 | + context.stroke(); | |
| 3817 | + | |
| 3818 | + //---文字--- | |
| 3819 | + context.setFillStyle("black") | |
| 3820 | + context.setFontSize(22 * unit) | |
| 3816 | 3821 | |
| 3817 | 3822 | if(type==0){ |
| 3818 | 3823 | // 原来start ---> |
| 3824 | + | |
| 3819 | 3825 | context.fillText("优惠乐翻天,精彩就在你身边", 40 * unit, 776 * unit); |
| 3820 | - context.fillText("长按识别二维码,立即开始抢购", 40 * unit, 826 * unit); | |
| 3826 | + context.fillText("长按识别二维码,立即开始抢购", 40 * unit, 826 * unit); | |
| 3827 | + // context.setFillStyle("black") | |
| 3828 | + // context.setFontSize(28 * unit) | |
| 3829 | + // context.fillText(th.data.sto_sele_name, 40 * unit, 776 * unit); | |
| 3821 | 3830 | }else{ |
| 3822 | - // 原来start ---> | |
| 3823 | - context.fillText("长按识别二维码", 40 * unit, 776 * unit); | |
| 3824 | - context.fillText("立即开始兑换", 40 * unit, 826 * unit); | |
| 3831 | + // 原来start ---> | |
| 3832 | + // context.fillText("长按识别二维码", 40 * unit, 776 * unit); | |
| 3833 | + // context.fillText("立即开始兑换", 40 * unit, 826 * unit); | |
| 3834 | + context.fillText("长按识别二维码", 40 * unit, 776 * unit); | |
| 3835 | + context.fillText("立即开始兑换", 40 * unit, 826 * unit); | |
| 3836 | + // context.setFillStyle("black") | |
| 3837 | + // context.setFontSize(28 * unit) | |
| 3838 | + // context.fillText(th.data.sto_sele_name, 40 * unit, 776 * unit); | |
| 3825 | 3839 | } |
| 3826 | 3840 | |
| 3827 | 3841 | //---二维吗图--- |
| ... | ... | @@ -4889,6 +4903,18 @@ Page({ |
| 4889 | 4903 | |
| 4890 | 4904 | addCart_inte:function(t){ |
| 4891 | 4905 | this.add_cart_func_inte(t); |
| 4892 | - } | |
| 4906 | + }, | |
| 4907 | + | |
| 4908 | + | |
| 4909 | + | |
| 4910 | + | |
| 4911 | + onShareTimeline() { | |
| 4912 | + return { | |
| 4913 | + title:this.data.data.goods_name + '-' + getApp().globalData.config.store_name, | |
| 4914 | + imageUrl:this.data.gallery[0].image_url, | |
| 4915 | + } | |
| 4916 | + }, | |
| 4917 | + | |
| 4918 | + | |
| 4893 | 4919 | |
| 4894 | 4920 | }); | ... | ... |
pages/goods/goodsInfo/goodsInfo.wxml
| ... | ... | @@ -1424,14 +1424,15 @@ |
| 1424 | 1424 | |
| 1425 | 1425 | <view wx:if="{{showPoster}}" class="poster-container"> |
| 1426 | 1426 | <view class="poster-wrapper"> |
| 1427 | - <view class="poster" bindtap="previewImage"> | |
| 1428 | - <image src="{{shareImgPath}}" class="poster-img"></image> | |
| 1427 | + <view class="poster"> | |
| 1428 | + <!-- <view class="poster" bindtap="previewImage"> --> | |
| 1429 | + <image src="{{shareImgPath}}" class="poster-img" show-menu-by-longpress></image> | |
| 1429 | 1430 | <view class="btn-close" catchtap="closePoster">x</view> |
| 1430 | 1431 | </view> |
| 1431 | - <view class="btn-container"> | |
| 1432 | + <!-- <view class="btn-container"> | |
| 1432 | 1433 | <button class="btn-share" open-type="share" bindtap="">微信好友分享</button> |
| 1433 | 1434 | <button class="btn-share" bindtap="savePic">保存到相册</button> |
| 1434 | - </view> | |
| 1435 | + </view> --> | |
| 1435 | 1436 | </view> |
| 1436 | 1437 | </view> |
| 1437 | 1438 | ... | ... |