From bb225b333b9aa7a10207d4a568772d49d90e53c6 Mon Sep 17 00:00:00 2001 From: yvan.ni <765199919@qq.com> Date: Thu, 19 Nov 2020 17:33:10 +0800 Subject: [PATCH] 1. 预存充值和积分购的bug修复 --- packageA/pages/chongzhi/chongzhi.js | 19 +++++++++++++------ packageA/pages/chongzhi/chongzhi.wxml | 14 ++++++++------ packageA/pages/chongzhi/chongzhi.wxss | 3 +-- packageA/pages/chongzhiDetails/chongzhiDetails.js | 7 ++++--- packageA/pages/chongzhiDetails/chongzhiDetails.wxml | 9 +++++---- packageA/pages/chongzhiDetails/chongzhiDetails.wxss | 4 +--- packageA/pages/jfbuy/jfbuy.js | 8 ++++++++ packageA/pages/jfbuy/jfbuy.wxml | 10 ++++------ pages/giftpack/giftpacklist/giftpacklist.wxml | 12 ++++++++---- pages/goods/goodsInfo/goodsInfo.js | 96 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----------------------------------- pages/goods/goodsInfo/goodsInfo.wxml | 2 +- 11 files changed, 114 insertions(+), 70 deletions(-) diff --git a/packageA/pages/chongzhi/chongzhi.js b/packageA/pages/chongzhi/chongzhi.js index 9e903dd..0847fa0 100644 --- a/packageA/pages/chongzhi/chongzhi.js +++ b/packageA/pages/chongzhi/chongzhi.js @@ -10,6 +10,7 @@ Page({ data: { url: app.globalData.setting.imghost, imgAd: '', + ad_color:'', currentIndex: 0, list: null, @@ -37,7 +38,7 @@ Page({ IsPos: 0, }); - app.request.get('/api/weshop/ad/list', { + app.request.get('/api/weshop/ad/page', { data: { pid: 601, store_id: app.globalData.userInfo.store_id, @@ -45,9 +46,15 @@ Page({ }, success: function (res) { // console.log('604',res.data.data[0].ad_code); - self.setData({ - imgAd: res.data.data[0].ad_code - }); + if(res.data.code==0 && res.data.data.pageData && res.data.data.pageData.length>0 ){ + var a = res.data.data.pageData; + self.setData({ + imgAd: a[0].ad_code, + ad_color: a[0].bgcolor, + }); + } + + }, }); }, @@ -212,8 +219,8 @@ Page({ // }, - bind_err:function(e){ - var _errImg = e.target.dataset.errorimg; + onerror:function(e){ + var _errImg = e.currentTarget.dataset.errimg; var _errObj = {}; _errObj[_errImg] = "/miniapp/images/default_g_img.gif"; this.setData(_errObj); diff --git a/packageA/pages/chongzhi/chongzhi.wxml b/packageA/pages/chongzhi/chongzhi.wxml index 5c43a66..43de412 100644 --- a/packageA/pages/chongzhi/chongzhi.wxml +++ b/packageA/pages/chongzhi/chongzhi.wxml @@ -1,7 +1,9 @@ - + @@ -10,7 +12,7 @@ 已核销 - + @@ -41,11 +43,11 @@ - - 暂无数据 - - + + + 暂无数据 + diff --git a/packageA/pages/chongzhi/chongzhi.wxss b/packageA/pages/chongzhi/chongzhi.wxss index 6df2fd6..e57de1f 100644 --- a/packageA/pages/chongzhi/chongzhi.wxss +++ b/packageA/pages/chongzhi/chongzhi.wxss @@ -2,7 +2,7 @@ @charset "utf-8"; page { - background-color: #FA437E; + /* background-color: #FA437E; */ } .banner-container { @@ -97,7 +97,6 @@ page { text-decoration:line-through; } - .date { padding-top: 10rpx; color: #FE6867; diff --git a/packageA/pages/chongzhiDetails/chongzhiDetails.js b/packageA/pages/chongzhiDetails/chongzhiDetails.js index 7c83e5f..f2608dd 100644 --- a/packageA/pages/chongzhiDetails/chongzhiDetails.js +++ b/packageA/pages/chongzhiDetails/chongzhiDetails.js @@ -48,11 +48,12 @@ Page({ }) - getApp().request.promiseGet("/api/weshop/ad/list",{ + getApp().request.promiseGet("/api/weshop/ad/page",{ data:{store_id:os.stoid,enabled:1,pid:601} }).then(res=>{ - if(res.data.code==0){ - self.setData({show_img:res.data.data[0].ad_code}); + if(res.data.code==0 && res.data.data.pageData && res.data.data.pageData.length>0){ + var a = res.data.data.pageData; + self.setData({show_img:a[0].ad_code,ad_color:a[0].bgcolor}); } }) diff --git a/packageA/pages/chongzhiDetails/chongzhiDetails.wxml b/packageA/pages/chongzhiDetails/chongzhiDetails.wxml index ccfd7e4..ba047c1 100644 --- a/packageA/pages/chongzhiDetails/chongzhiDetails.wxml +++ b/packageA/pages/chongzhiDetails/chongzhiDetails.wxml @@ -13,7 +13,7 @@ 你的美丽我来缔造 - + @@ -22,7 +22,7 @@ - + @@ -33,7 +33,8 @@ 数量:{{item.Qty}} - + + @@ -51,6 +52,6 @@ - + diff --git a/packageA/pages/chongzhiDetails/chongzhiDetails.wxss b/packageA/pages/chongzhiDetails/chongzhiDetails.wxss index 25d4bee..70cfcf9 100644 --- a/packageA/pages/chongzhiDetails/chongzhiDetails.wxss +++ b/packageA/pages/chongzhiDetails/chongzhiDetails.wxss @@ -26,7 +26,6 @@ } .list-item { - background-color: white; align-items: center; padding: 20rpx; } @@ -72,7 +71,6 @@ border-radius: 50%; background-color: pink; flex-shrink: 0; - transform:scaleX(-1); text-align: center; } @@ -99,7 +97,7 @@ text-align: center; padding: 20rpx 0; background-color: white; - border-top: 2rpx solid #f2f2f2; + border-top: 1rpx solid #f2f2f2; } .btn { diff --git a/packageA/pages/jfbuy/jfbuy.js b/packageA/pages/jfbuy/jfbuy.js index d2fdf13..76c92f3 100644 --- a/packageA/pages/jfbuy/jfbuy.js +++ b/packageA/pages/jfbuy/jfbuy.js @@ -357,4 +357,12 @@ Page({ th.isPullDownRefresh = false; }); }, + + // 点击查看 + viewItemDetails:function(e){ + var index=e.currentTarget.dataset.index; + var item=this.data.list2[index]; + var url="/pages/goods/goodsInfo/goodsInfo?goods_id="+item.goods_id; + getApp().goto(url); + } }) \ No newline at end of file diff --git a/packageA/pages/jfbuy/jfbuy.wxml b/packageA/pages/jfbuy/jfbuy.wxml index f0e7f24..67b4886 100644 --- a/packageA/pages/jfbuy/jfbuy.wxml +++ b/packageA/pages/jfbuy/jfbuy.wxml @@ -7,10 +7,9 @@ --> - - + @@ -31,7 +30,7 @@ bindrefresherrefresh="onPullDownRefresh"> - + - - + 暂无数据 - 已全部加载 - diff --git a/pages/giftpack/giftpacklist/giftpacklist.wxml b/pages/giftpack/giftpacklist/giftpacklist.wxml index 70208c2..2fb5f60 100644 --- a/pages/giftpack/giftpacklist/giftpacklist.wxml +++ b/pages/giftpack/giftpacklist/giftpacklist.wxml @@ -74,19 +74,23 @@ - {{"数量:"+item.num}} + + {{"数量:"+item.num}} + - + - + + + diff --git a/pages/goods/goodsInfo/goodsInfo.js b/pages/goods/goodsInfo/goodsInfo.js index 44e3c92..40ff9d8 100644 --- a/pages/goods/goodsInfo/goodsInfo.js +++ b/pages/goods/goodsInfo/goodsInfo.js @@ -3563,7 +3563,7 @@ Page({ return false; } - //类型 0普通商品 1秒杀商品 2商家和会员团 3阶梯团 + //类型 0普通商品 1秒杀商品 2商家和会员团 3阶梯团 4阶梯团 var type = this.data.prom_type; if (type == 6) type = 2; if (this.data.prom_act && this.data.prom_act.kttype == 3) type = 3; @@ -3650,39 +3650,58 @@ Page({ context.fillText('强烈推荐', 149 * unit + width + 15 * unit, 76 * unit); } - - + //---产品名称--- //文本换行 参数:1、canvas对象,2、文本 3、距离左侧的距离 4、距离顶部的距离 5、6、文本的宽度 - context.setFillStyle("black"); - context.setFontSize(21.3 * unit) - th.draw_Text(context, th.data.data.goods_name, - 38 * unit, 180 * unit, 200 * unit, 279 * unit, unit); - //------产品的价格------- - context.setFontSize(23 * unit) - context.setFillStyle("red") - context.fillText("¥", 416 * unit, 185 * unit); - context.setFontSize(31 * unit) - var pri0 = th.data.data.shop_price; - if (th.data.prom_act) - pri0 = th.data.prom_act.price; - - pri0 = parseFloat(pri0).toFixed(2); - context.fillText(pri0, 438 * unit, 185 * unit); - //---市场价划掉--- - context.setFillStyle("gray") - context.setFontSize(22 * unit) - context.fillText("¥" + th.data.data.market_price, 426 * unit, 213 * unit); - context.setStrokeStyle('gray') - context.setLineWidth(1 * unit) - context.moveTo(426 * unit, 206 * unit) - context.lineTo(510 * unit, 206 * unit) - context.stroke(); + if(type!=4){ + context.setFillStyle("black"); + context.setFontSize(21.3 * unit) + th.draw_Text(context, th.data.data.goods_name, + 38 * unit, 180 * unit, 200 * unit, 279 * unit, unit); + //------产品的价格------- + context.setFontSize(23 * unit) + context.setFillStyle("red") + context.fillText("¥", 416 * unit, 185 * unit); + context.setFontSize(31 * unit) + var pri0 = th.data.data.shop_price; + if (th.data.prom_act) + pri0 = th.data.prom_act.price; + pri0 = parseFloat(pri0).toFixed(2); + context.fillText(pri0, 438 * unit, 185 * unit); + //---市场价划掉--- + context.setFillStyle("gray") + context.setFontSize(22 * unit) + context.fillText("¥" + th.data.data.market_price, 426 * unit, 213 * unit); + context.setStrokeStyle('gray'); + context.setLineWidth(1 * unit); + context.moveTo(426 * unit, 206 * unit); + context.lineTo(510 * unit, 206 * unit); + context.stroke(); + + }else{ + context.setFillStyle("black"); + context.setFontSize(21.3 * unit) + th.draw_Text(context, th.data.data.goods_name, + 38 * unit, 180 * unit, 20 * unit, 300*unit, unit); + //------ 产品的价格 ----- + var pri0 = th.data.prom_act.addmoney; + var integral=th.data.prom_act.integral; + var text= ""; + if(integral){text=integral+"积分"; } + if(pri0 && integral){ text+="+";} + if(pri0){ text+="¥"+pri0;} + + context.setFillStyle("red"); + context.fillText(text, 38 * unit, 215 * unit); + + } + //---中间大图--- context.drawImage(th.data.share_goods_img, 68 * unit, 242 * unit, 410 * unit, 410 * unit); //-------大图后面就不一样了----------- switch (type) { case 0: //普通商品的展示 + case 4: //中间的几个字 if(th.data.poster && parseInt(th.data.poster.style)==2 ){ if(parseInt(th.data.poster.show_quality)){ @@ -3730,10 +3749,17 @@ Page({ //---文字--- context.setFillStyle("black") context.setFontSize(22 * unit) - // 原来start ---> - context.fillText("优惠乐翻天,精彩就在你身边", 40 * unit, 776 * unit); - context.fillText("长按识别二维码,立即开始抢购", 40 * unit, 826 * unit); - + + if(type==0){ + // 原来start ---> + context.fillText("优惠乐翻天,精彩就在你身边", 40 * unit, 776 * unit); + context.fillText("长按识别二维码,立即开始抢购", 40 * unit, 826 * unit); + }else{ + // 原来start ---> + context.fillText("长按识别二维码", 40 * unit, 776 * unit); + context.fillText("立即开始兑换", 40 * unit, 826 * unit); + } + //---二维吗图--- //-- 自定义海报 -- if(th.data.poster){ @@ -3742,7 +3768,7 @@ Page({ 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); + context.drawImage(vpath, 410 * unit, 726 * unit, 115 * unit, 125 * unit); } break; @@ -3771,9 +3797,7 @@ Page({ }else{ //---二维吗图--- context.drawImage(vpath, 420 * unit, 726 * unit, 120 * unit, 120 * unit); - } - - + } break; case 2: //会员团和商家团的展示 @@ -3863,6 +3887,8 @@ Page({ context.drawImage(vpath, 420 * unit, 726 * unit, 120 * unit, 120 * unit); } break + + case 3: //阶梯团的展示 } diff --git a/pages/goods/goodsInfo/goodsInfo.wxml b/pages/goods/goodsInfo/goodsInfo.wxml index c2c6c78..c001906 100644 --- a/pages/goods/goodsInfo/goodsInfo.wxml +++ b/pages/goods/goodsInfo/goodsInfo.wxml @@ -236,7 +236,7 @@ - + {{prom_integral}} 积分 + -- libgit2 0.21.4