diff --git a/packageA/pages/goodsInfo/goodsInfo.js b/packageA/pages/goodsInfo/goodsInfo.js index fb8d33c..10dfb07 100644 --- a/packageA/pages/goodsInfo/goodsInfo.js +++ b/packageA/pages/goodsInfo/goodsInfo.js @@ -469,7 +469,11 @@ Page({ }); }; - }; + }else{ + this.setData({ + actList: res.data.data, + }); + } }); }; // <---- 秒杀 @@ -776,9 +780,11 @@ Page({ // mapurl: t.data.data.listServiceVideos[0].video_url, // mapurl_f_img: t.data.data.listServiceVideos[0].video_img, //listServiceItem: t.data.data.listServiceItem, + 'isshow':1 + }); - this.getTaohe(); + that.getTaohe(); // console.log('0xxxxx999999', t.data.data); //-----商品详情--- diff --git a/packageA/pages/serviceCard_pd/goodsInfo/goodsInfo.js b/packageA/pages/serviceCard_pd/goodsInfo/goodsInfo.js index 4e1c22a..10ed287 100644 --- a/packageA/pages/serviceCard_pd/goodsInfo/goodsInfo.js +++ b/packageA/pages/serviceCard_pd/goodsInfo/goodsInfo.js @@ -206,7 +206,6 @@ Page({ gid = t.goods_id, first_leader = t.first_leader; - //-- 自定义海报 -- getApp().request.promiseGet("/api/weshop/goods/poster/page", { data:{store_id:os.stoid, type:1, is_use:1} @@ -1541,7 +1540,7 @@ Page({ } ///二微码 var path3 = os.url + "/api/wx/open/app/user/getWeAppEwm/" + - os.stoid + "?sceneValue=" + scene + "&pageValue=pages/goods/goodsInfo/goodsInfo"; + os.stoid + "?sceneValue=" + scene + "&pageValue=packageA/pages/serviceCard_pd/goodsInfo/goodsInfo"; console.log(path3); diff --git a/packageA/pages/serviceCard_pd/team_show/team_show.js b/packageA/pages/serviceCard_pd/team_show/team_show.js index 9e004c9..977f032 100644 --- a/packageA/pages/serviceCard_pd/team_show/team_show.js +++ b/packageA/pages/serviceCard_pd/team_show/team_show.js @@ -134,6 +134,7 @@ Page({ th.setData({ bconfig: e,sys_switch:json_d}); th.wait_for_store_config(); //获取默认的门店 }) + }, @@ -974,14 +975,12 @@ Page({ return { path:url, - title: "商品分类", + title: "拼团", imageUrl: img, } }, - - - + closeSpecModal: function() { this.setData({ diff --git a/packageA/pages/serviceCard_pd/team_success/team_success.js b/packageA/pages/serviceCard_pd/team_success/team_success.js index d764f05..ccbff9b 100644 --- a/packageA/pages/serviceCard_pd/team_success/team_success.js +++ b/packageA/pages/serviceCard_pd/team_success/team_success.js @@ -81,7 +81,12 @@ Page({ th.setData({poster:json_data}) } } - }) + }) + + + getApp().getConfig(function (e) { + th.setData({sto_sele_name_1: e.store_name}) + }) }, onShow:function () { getApp().check_can_share(this); @@ -193,7 +198,8 @@ Page({ }).then(res => { if(res.data.code==0){ teamlist=res.data.data; - this.setData({ + ee.data.prom_act=teamlist; + ee.setData({ teamlist:teamlist }); var nt =ut.gettimestamp(); @@ -437,225 +443,228 @@ Page({ var share_title=th.data.teamlist.share_title; if(!share_title) share_title=th.data.teamlist.title; - context.drawImage(pg_path, 0, 0, 554 * unit, 899 * unit); - - //-- 是自定义海报的情况下 -- - if(th.data.poster && parseInt(th.data.poster.style)==2){ - //在线上分享人的情况下 - if(parseInt(th.data.poster.show_headpic)){ - //获取坐标 - var x=parseFloat(th.data.poster.head_x)*2; - var y=parseFloat(th.data.poster.head_y)*2; - var x1=(x+90) *unit; - var y1=(y+50) *unit; - //--昵称--- - context.setFontSize(24 * unit) - context.setFillStyle("black") - context.fillText(app.globalData.userInfo.nickname, x1, y1); - var width = 24 * app.globalData.userInfo.nickname.length * unit + 4 * unit; - //强烈推荐 改许程 - var tj_path = "../../../../images/share/q_tj.png"; - context.drawImage(tj_path, x1 + width, y1-22*unit, 85 * unit, 30 * unit); - context.setFontSize(16 * unit) - context.setLineJoin('round'); //交点设置成圆角 - context.setFillStyle("white") - context.fillText('强烈推荐', x1 + width+8*unit, y1-1*unit); - } - - }else{ - //--昵称--- - context.setFontSize(24 * unit) - context.setFillStyle("black") - context.fillText(app.globalData.userInfo.nickname, 152 * unit, 76 * unit); - var width = 24 * app.globalData.userInfo.nickname.length * unit + 2 * unit; - //强烈推荐 - var tj_path = "../../../../images/share/q_tj.png"; - context.drawImage(tj_path, 152 * unit + width, 54 * unit, 110 * unit, 30 * unit); - context.setFontSize(18 * unit) - context.setFillStyle("white") - context.fillText('强烈推荐', 152 * unit + width + 20 * unit, 76 * unit); - } - - //---产品名称--- - context.setFontSize(21.3 * unit); - context.setFillStyle("black"); + var act_time=''; + if (!th.data.share_b_img){ // 如果是普通商品,绘制新海报 + th.drawPoster(context, unit, th.data.share_img_localpath, vpath, type); + } else { + context.drawImage(pg_path, 0, 0, 554 * unit, 899 * unit); + //-- 是自定义海报的情况下 -- + if (th.data.poster && parseInt(th.data.poster.style) == 2) { + //在线上分享人的情况下 + if (parseInt(th.data.poster.show_headpic)) { + //获取坐标 + var x = parseFloat(th.data.poster.head_x) * 2; + var y = parseFloat(th.data.poster.head_y) * 2; + var x1 = (x + 90) * unit; + var y1 = (y + 50) * unit; + //--昵称--- + context.setFontSize(24 * unit) + context.setFillStyle("black") + context.fillText(app.globalData.userInfo.nickname, x1, y1); + var width = 24 * app.globalData.userInfo.nickname.length * unit + 4 * unit; + //强烈推荐 改许程 + var tj_path = "../../../../images/share/q_tj.png"; + context.drawImage(tj_path, x1 + width, y1 - 22 * unit, 85 * unit, 30 * unit); + context.setFontSize(16 * unit) + context.setLineJoin('round'); //交点设置成圆角 + context.setFillStyle("white") + context.fillText('强烈推荐', x1 + width + 8 * unit, y1 - 1 * unit); + } + } else { + //--昵称--- + context.setFontSize(24 * unit) + context.setFillStyle("black") + context.fillText(app.globalData.userInfo.nickname, 152 * unit, 76 * unit); + var width = 24 * app.globalData.userInfo.nickname.length * unit + 2 * unit; + //强烈推荐 + var tj_path = "../../../../images/share/q_tj.png"; + context.drawImage(tj_path, 152 * unit + width, 54 * unit, 110 * unit, 30 * unit); + context.setFontSize(18 * unit) + context.setFillStyle("white") + context.fillText('强烈推荐', 152 * unit + width + 20 * unit, 76 * unit); + } - th.draw_Text(context,share_title, - 38 * unit, 180 * unit, 200 * unit, 279 * unit, unit); - //------产品的价格------- - context.setFontSize(24 * unit) - context.setFillStyle("red") + //---产品名称--- + context.setFontSize(21.3 * unit); + context.setFillStyle("black"); + + th.draw_Text(context,share_title, + 38 * unit, 180 * unit, 200 * unit, 279 * unit, unit); + //------产品的价格------- + context.setFontSize(24 * unit) + context.setFillStyle("red") + + var pri0 = th.data.teamlist.price; + pri0=parseFloat(pri0).toFixed(2); + var wd1=th.data.screenWidth-ut.measureText(pri0, 31 * unit)-25; + context.fillText("¥", wd1-15, 180 * unit); + context.setFontSize(31 * unit) + context.fillText(pri0, wd1, 180 * unit); + + //---市场价划掉--- + context.setFillStyle("gray") + context.setFontSize(22 * unit) + pri0= "¥" + parseFloat(th.data.goods.market_price).toFixed(2); + var wd2=th.data.screenWidth-ut.measureText(pri0, 22 * unit)-25; + context.fillText(pri0, wd2, 210 * unit); + + context.setStrokeStyle('gray') + context.setLineWidth(1 * unit) + context.moveTo(wd2-5, 204 * unit) + context.lineTo(wd2+ut.measureText(pri0, 22 * unit)+5, 204 * unit) + context.stroke(); + console.log(th.data.share_img_localpath); + + + //---中间大图--- + context.drawImage(th.data.share_img_localpath, 68 * unit, 242 * unit, 410 * unit, 410 * unit); + + var g_ct=th.data.teamlist.ct_num-th.data.ordertx.length; + var wz= ""; + if(g_ct>0) wz="还差"+g_ct+"人成团,"; + else{ + g_ct= th.data.max_num -th.data.ordertx.length; + if(g_ct>0){ + wz="还差"+g_ct+"人享最低优惠,"; + }else{ + wz="已享受最优惠,"; + } + } - var pri0 = th.data.teamlist.price; - pri0=parseFloat(pri0).toFixed(2); - var wd1=th.data.screenWidth-ut.measureText(pri0, 31 * unit)-25; - context.fillText("¥", wd1-15, 180 * unit); - context.setFontSize(31 * unit) - context.fillText(pri0, wd1, 180 * unit); + //-------大图后面就不一样了----------- + switch (type) { + case 1://会员团和商家团的展示 + //---画线--- + context.setLineWidth(1 * unit) + context.moveTo(32 * unit, 670 * unit) + context.lineTo(520 * unit, 670 * unit) + context.stroke(); - //---市场价划掉--- - context.setFillStyle("gray") - context.setFontSize(22 * unit) - pri0= "¥" + parseFloat(th.data.goods.market_price).toFixed(2); - var wd2=th.data.screenWidth-ut.measureText(pri0, 22 * unit)-25; - context.fillText(pri0, wd2, 210 * unit); + //---文字--- + context.setFontSize(22 * unit) + context.setFillStyle("black") + context.fillText("好物拼起来,拼拼更划算", 40 * unit, 726 * unit); - context.setStrokeStyle('gray') - context.setLineWidth(1 * unit) - context.moveTo(wd2-5, 204 * unit) - context.lineTo(wd2+ut.measureText(pri0, 22 * unit)+5, 204 * unit) - context.stroke(); - console.log(th.data.share_img_localpath); + //绘制成团图片 + var ct_img ="../../../../images/share/ct_num.png"; + context.drawImage(ct_img, 40 * unit, 740 * unit, 120 * unit, 30 * unit); + var ct_num = th.data.teamlist.ct_num; + context.setFontSize(14 * unit) + context.setFillStyle("red") + if(ct_num<10){ + context.fillText(ct_num+"人拼团", 92 * unit, 760 * unit); + }else{ + context.fillText(ct_num+"人拼团", 86 * unit, 760 * unit); + } + context.setFontSize(22 * unit) + context.fillText("已拼"+th.data.teamlist.buy_num+"份", 166 * unit, 763 * unit); + context.setFillStyle("gray") + context.fillText(wz+"快来和我一起拼团吧!", 40 * unit, 826 * unit); + context.setFillStyle("black") + + context.setFontSize(22 * unit) + context.fillText("长按识别二维码,立即参团", 40 * unit, 856 * unit); + //---二维吗图--- + //-- 自定义海报 -- + if(th.data.poster){ + var erm_x= parseFloat(th.data.poster.ewm_x)*2; + var erm_y= parseFloat(th.data.poster.ewm_y)*2; + context.drawImage(vpath, erm_x * unit, erm_y * unit, 120 * unit, 120 * unit); + }else{ + //---二维吗图--- + context.drawImage(vpath, 420 * unit, 726 * unit, 120 * unit, 120 * unit); + } + break + case 2://阶梯团的展示 + //---画线--- + context.setLineWidth(1 * unit) + context.moveTo(32 * unit, 670 * unit) + context.lineTo(520 * unit, 670 * unit) + context.stroke(); + //---文字--- + context.setFontSize(22 * unit) + context.setFillStyle("black") + context.fillText("好物拼起来,拼拼更划算", 40 * unit, 726 * unit); + //---绘制中间阶梯的价格--- + var list= JSON.parse(th.data.teamlist.ct_rylist); + for(var i=0; i0) wz="还差"+g_ct+"人成团,"; - else{ - g_ct= th.data.max_num -th.data.ordertx.length; - if(g_ct>0){ - wz="还差"+g_ct+"人享最低优惠,"; - }else{ - wz="已享受最优惠,"; + context.fillText("长按识别二维码,立即参团", 40 * unit, 860 * unit); + //---二维吗图--- + //-- 自定义海报 -- + if(th.data.poster){ + var erm_x= parseFloat(th.data.poster.ewm_x)*2; + var erm_y= parseFloat(th.data.poster.ewm_y)*2; + context.drawImage(vpath, erm_x * unit, erm_y * unit, 120 * unit, 120 * unit); + }else{ + //---二维吗图--- + context.drawImage(vpath, 420 * unit, 726 * unit, 120 * unit, 120 * unit); + } + break } - } - //-------大图后面就不一样了----------- - switch (type) { - case 1://会员团和商家团的展示 - //---画线--- - context.setLineWidth(1 * unit) - context.moveTo(32 * unit, 670 * unit) - context.lineTo(520 * unit, 670 * unit) - context.stroke(); - - //---文字--- - context.setFontSize(22 * unit) - context.setFillStyle("black") - context.fillText("好物拼起来,拼拼更划算", 40 * unit, 726 * unit); - - //绘制成团图片 - var ct_img ="../../../../images/share/ct_num.png"; - context.drawImage(ct_img, 40 * unit, 740 * unit, 120 * unit, 30 * unit); - var ct_num = th.data.teamlist.ct_num; - context.setFontSize(14 * unit) - - context.setFillStyle("red") - if(ct_num<10){ - context.fillText(ct_num+"人拼团", 92 * unit, 760 * unit); - }else{ - context.fillText(ct_num+"人拼团", 86 * unit, 760 * unit); - } - context.setFontSize(22 * unit) - context.fillText("已拼"+th.data.teamlist.buy_num+"份", 166 * unit, 763 * unit); - context.setFillStyle("gray") - context.fillText(wz+"快来和我一起拼团吧!", 40 * unit, 826 * unit); - context.setFillStyle("black") - - context.setFontSize(22 * unit) - context.fillText("长按识别二维码,立即参团", 40 * unit, 856 * unit); - //---二维吗图--- - //-- 自定义海报 -- - if(th.data.poster){ - var erm_x= parseFloat(th.data.poster.ewm_x)*2; - var erm_y= parseFloat(th.data.poster.ewm_y)*2; - context.drawImage(vpath, erm_x * unit, erm_y * unit, 120 * unit, 120 * unit); - }else{ - //---二维吗图--- - context.drawImage(vpath, 420 * unit, 726 * unit, 120 * unit, 120 * unit); - } - break - case 2://阶梯团的展示 - //---画线--- - context.setLineWidth(1 * unit) - context.moveTo(32 * unit, 670 * unit) - context.lineTo(520 * unit, 670 * unit) - context.stroke(); - //---文字--- - context.setFontSize(22 * unit) - context.setFillStyle("black") - context.fillText("好物拼起来,拼拼更划算", 40 * unit, 726 * unit); - //---绘制中间阶梯的价格--- - var list= JSON.parse(th.data.teamlist.ct_rylist); - for(var i=0; i0) wz="还差"+g_ct+"人成团,"; - else{ - g_ct= th.data.max_num -th.data.ordertx.length; - if(g_ct>0){ - wz="还差"+g_ct+"人享最低优惠,"; + + if (!th.data.share_b_img){ // 如果是普通商品,绘制新海报 + th.drawPoster(context, unit, th.data.share_img_localpath, vpath, type); + } else { + context.drawImage(pg_path, 0, 0, 554 * unit, 899 * unit); + //-- 是自定义海报的情况下 -- + if(th.data.poster && parseInt(th.data.poster.style)==2){ + //在线上分享人的情况下 + if(parseInt(th.data.poster.show_headpic)){ + //获取坐标 + var x=parseFloat(th.data.poster.head_x)*2; + var y=parseFloat(th.data.poster.head_y)*2; + var x1=(x+90) *unit; + var y1=(y+50) *unit; + //--昵称--- + context.setFontSize(24 * unit) + context.setFillStyle("black") + context.fillText(app.globalData.userInfo.nickname, x1, y1); + var width = 24 * app.globalData.userInfo.nickname.length * unit + 4 * unit; + //强烈推荐 改许程 + var tj_path = "../../../images/share/q_tj.png"; + context.drawImage(tj_path, x1 + width, y1-22*unit, 85 * unit, 30 * unit); + context.setFontSize(16 * unit) + context.setLineJoin('round'); //交点设置成圆角 + context.setFillStyle("white") + context.fillText('强烈推荐', x1 + width+8*unit, y1-1*unit); + } + }else{ - wz="已享受最优惠,"; + //--昵称--- + context.setFontSize(24 * unit) + context.setFillStyle("black") + context.fillText(app.globalData.userInfo.nickname, 152 * unit, 76 * unit); + var width = 24 * app.globalData.userInfo.nickname.length * unit + 2 * unit; + //强烈推荐 + var tj_path = "../../../images/share/q_tj.png"; + context.drawImage(tj_path, 152 * unit + width, 54 * unit, 110 * unit, 30 * unit); + context.setFontSize(18 * unit) + context.setFillStyle("white") + context.fillText('强烈推荐', 152 * unit + width + 20 * unit, 76 * unit); } - } - //-------大图后面就不一样了----------- - switch (type) { - case 1://会员团和商家团的展示 - //---画线--- - context.setLineWidth(1 * unit) - context.moveTo(32 * unit, 670 * unit) - context.lineTo(520 * unit, 670 * unit) - context.stroke(); - - //---文字--- - context.setFontSize(22 * unit) - context.setFillStyle("black") - context.fillText("好物拼起来,拼拼更划算", 40 * unit, 726 * unit); - - //绘制成团图片 - var ct_img ="../../../images/share/ct_num.png"; - context.drawImage(ct_img, 40 * unit, 740 * unit, 120 * unit, 30 * unit); - var ct_num = th.data.teamlist.ct_num; - context.setFontSize(14 * unit) - - context.setFillStyle("red") - if(ct_num<10){ - context.fillText(ct_num+"人拼团", 92 * unit, 760 * unit); + + //---产品名称--- + context.setFontSize(21.3 * unit); + context.setFillStyle("black"); + + + getApp().draw_Text(context,share_title, + 38 * unit, 180 * unit, 200 * unit, 279 * unit, unit); + //------产品的价格------- + context.setFontSize(24 * unit) + context.setFillStyle("red") + + var pri0 = th.data.teamlist.price; + pri0=parseFloat(pri0).toFixed(2); + var wd1=th.data.screenWidth-ut.measureText(pri0, 31 * unit)-25; + context.fillText("¥", wd1-15, 180 * unit); + context.setFontSize(31 * unit) + context.fillText(pri0, wd1, 180 * unit); + + //---市场价划掉--- + context.setFillStyle("gray") + context.setFontSize(22 * unit) + pri0= "¥" + parseFloat(th.data.goods.market_price).toFixed(2); + var wd2=th.data.screenWidth-ut.measureText(pri0, 22 * unit)-25; + context.fillText(pri0, wd2, 210 * unit); + + context.setStrokeStyle('gray') + context.setLineWidth(1 * unit) + context.moveTo(wd2-5, 204 * unit) + context.lineTo(wd2+ut.measureText(pri0, 22 * unit)+5, 204 * unit) + context.stroke(); + console.log(th.data.share_img_localpath); + + + //---中间大图--- + context.drawImage(th.data.share_img_localpath, 68 * unit, 242 * unit, 410 * unit, 410 * unit); + + var g_ct=th.data.teamlist.ct_num-th.data.ordertx.length; + var wz= ""; + if(g_ct>0) wz="还差"+g_ct+"人成团,"; + else{ + g_ct= th.data.max_num -th.data.ordertx.length; + if(g_ct>0){ + wz="还差"+g_ct+"人享最低优惠,"; }else{ - context.fillText(ct_num+"人拼团", 86 * unit, 760 * unit); + wz="已享受最优惠,"; } - context.setFontSize(22 * unit) - context.fillText("已拼"+th.data.teamlist.buy_num+"份", 166 * unit, 763 * unit); - context.setFillStyle("gray") - context.fillText(wz+"快来和我一起拼团吧!", 40 * unit, 826 * unit); - context.setFillStyle("black") - - context.setFontSize(22 * unit) - context.fillText("长按识别二维码,立即参团", 40 * unit, 856 * unit); - //---二维吗图--- - //-- 自定义海报 -- - if(th.data.poster){ - var erm_x= parseFloat(th.data.poster.ewm_x)*2; - var erm_y= parseFloat(th.data.poster.ewm_y)*2; - context.drawImage(vpath, erm_x * unit, erm_y * unit, 120 * unit, 120 * unit); - }else{ - //---二维吗图--- - context.drawImage(vpath, 420 * unit, 726 * unit, 120 * unit, 120 * unit); - } - break - case 2://阶梯团的展示 - //---画线--- - context.setLineWidth(1 * unit) - context.moveTo(32 * unit, 670 * unit) - context.lineTo(520 * unit, 670 * unit) - context.stroke(); - //---文字--- - context.setFontSize(22 * unit) - context.setFillStyle("black") - context.fillText("好物拼起来,拼拼更划算", 40 * unit, 726 * unit); - //---绘制中间阶梯的价格--- - var list= JSON.parse(th.data.teamlist.ct_rylist); - for(var i=0; i