From 194efa9c69f0e188d22dd21a62be1918b97f442d Mon Sep 17 00:00:00 2001 From: taiyuan Date: Mon, 28 Dec 2020 10:14:19 +0800 Subject: [PATCH] 海报取消微信好友分享和保存到相册按钮,取消点击图片预览,直接长按图片就可以分享和保存 --- pages/goods/goodsInfo/goodsInfo.js | 76 +++++++++++++++++++++++++++++++++++++++++++++++++++------------------------- pages/goods/goodsInfo/goodsInfo.wxml | 9 +++++---- 2 files changed, 56 insertions(+), 29 deletions(-) diff --git a/pages/goods/goodsInfo/goodsInfo.js b/pages/goods/goodsInfo/goodsInfo.js index 32c492a..6cfea50 100644 --- a/pages/goods/goodsInfo/goodsInfo.js +++ b/pages/goods/goodsInfo/goodsInfo.js @@ -261,10 +261,10 @@ Page({ room_user_share=t.room_user_share; //如果是会员分享带有room_id的话,那么接下来会员分享就不传room_id //-- 自定义海报 -- - getApp().request.promiseGet("/api/weshop/goods/poster/page",{ - data:{store_id:os.stoid, type:1, is_use:1 } + getApp().request.promiseGet("/api/weshop/goods/poster/page", { + data:{store_id:os.stoid, type:1, is_use:1} }).then(res=>{ - if(res.data.code==0 && res.data.data && res.data.data.pageData && res.data.data.pageData[0] ){ + if(res.data.code==0 && res.data.data && res.data.data.pageData && res.data.data.pageData[0]){ var poster_data=res.data.data.pageData[0]; var json_str=poster_data.jsonStr; @@ -3641,14 +3641,14 @@ Page({ var unit = that.data.screenWidth / 750 * 1.35; //基础单位, var path2 = that.data.data.original_img; var scene = th.data.gid+""; - var user_id=getApp().globalData.user_id?getApp().globalData.user_id:0; - if(user_id>0){ + var user_id = getApp().globalData.user_id?getApp().globalData.user_id:0; + if(user_id>0) { scene+="_"+user_id; } //-- 如果不是会员分享过来的要分享给别人 -- - if(getApp().globalData.room_id && th.data.data.goods_id==getApp().globalData.room_goods_id && !getApp().globalData.room_user_share){ + if(getApp().globalData.room_id && th.data.data.goods_id==getApp().globalData.room_goods_id && !getApp().globalData.room_user_share) { //固定房间是第3个字符 - if(!user_id) scene+="_0"; + if(!user_id) scene+="_0"; scene+="_"+getApp().globalData.room_id ; } ///二微码 @@ -3678,7 +3678,7 @@ Page({ context.drawImage(pg_path, 0, 0, 554 * unit, 899 * unit); //-- 是自定义海报的情况下 -- - if(th.data.poster && parseInt(th.data.poster.style)==2){ + if(th.data.poster && parseInt(th.data.poster.style)==2) { //在线上分享人的情况下 if(parseInt(th.data.poster.show_headpic)){ //获取坐标 @@ -3697,9 +3697,13 @@ Page({ context.setFontSize(16 * unit) context.setLineJoin('round'); //交点设置成圆角 context.setFillStyle("white") - context.fillText('强烈推荐', x1 + width+8*unit, y1-1*unit); + context.fillText('强烈推荐', x1 + width+8*unit, y1-1*unit); + + context.setFillStyle("black") + context.setFontSize(24 * unit) + context.fillText(getApp().globalData.config.store_name, 40 * unit, 130 * unit); } - }else{ + } else { //--昵称--- context.setFontSize(24 * unit) context.setFillStyle("black") @@ -3708,9 +3712,9 @@ Page({ //强烈推荐 改许程 var tj_path = "../../../images/share/q_tj.png"; context.drawImage(tj_path, 152 * unit + width, 54 * unit, 85 * unit, 30 * unit); - context.setFontSize(16 * unit) + context.setFontSize(16 * unit); context.setLineJoin('round'); //交点设置成圆角 - context.setFillStyle("white") + context.setFillStyle("white"); context.fillText('强烈推荐', 149 * unit + width + 15 * unit, 76 * unit); } @@ -3805,23 +3809,33 @@ Page({ } - //---画线--- - context.setLineWidth(1 * unit) - context.moveTo(32 * unit, 710 * unit) - context.lineTo(520 * unit, 710 * unit) - context.stroke(); - //---文字--- - context.setFillStyle("black") - context.setFontSize(22 * unit) + //---画线--- + context.setLineWidth(1 * unit) + context.moveTo(32 * unit, 710 * unit) + context.lineTo(520 * unit, 710 * unit) + context.stroke(); + + //---文字--- + context.setFillStyle("black") + context.setFontSize(22 * unit) if(type==0){ // 原来start ---> + context.fillText("优惠乐翻天,精彩就在你身边", 40 * unit, 776 * unit); - context.fillText("长按识别二维码,立即开始抢购", 40 * unit, 826 * unit); + context.fillText("长按识别二维码,立即开始抢购", 40 * unit, 826 * unit); + // context.setFillStyle("black") + // context.setFontSize(28 * unit) + // context.fillText(th.data.sto_sele_name, 40 * unit, 776 * unit); }else{ - // 原来start ---> - context.fillText("长按识别二维码", 40 * unit, 776 * unit); - context.fillText("立即开始兑换", 40 * unit, 826 * unit); + // 原来start ---> + // context.fillText("长按识别二维码", 40 * unit, 776 * unit); + // context.fillText("立即开始兑换", 40 * unit, 826 * unit); + context.fillText("长按识别二维码", 40 * unit, 776 * unit); + context.fillText("立即开始兑换", 40 * unit, 826 * unit); + // context.setFillStyle("black") + // context.setFontSize(28 * unit) + // context.fillText(th.data.sto_sele_name, 40 * unit, 776 * unit); } //---二维吗图--- @@ -4889,6 +4903,18 @@ Page({ addCart_inte:function(t){ this.add_cart_func_inte(t); - } + }, + + + + + onShareTimeline() { + return { + title:this.data.data.goods_name + '-' + getApp().globalData.config.store_name, + imageUrl:this.data.gallery[0].image_url, + } + }, + + }); diff --git a/pages/goods/goodsInfo/goodsInfo.wxml b/pages/goods/goodsInfo/goodsInfo.wxml index c82463b..f32a9f2 100644 --- a/pages/goods/goodsInfo/goodsInfo.wxml +++ b/pages/goods/goodsInfo/goodsInfo.wxml @@ -1424,14 +1424,15 @@ - - + + + x - + -- libgit2 0.21.4