diff --git a/components/diy_goodsGroup/diy_goodsGroup.js b/components/diy_goodsGroup/diy_goodsGroup.js index da026af..c70b433 100644 --- a/components/diy_goodsGroup/diy_goodsGroup.js +++ b/components/diy_goodsGroup/diy_goodsGroup.js @@ -25,6 +25,7 @@ Component({ is_new: 0, baseUrl: "/api/weshop/goods/page", resourceUrl: t.globalData.setting.resourceUrl, + url: t.globalData.setting.imghost, currentPage: 1, requestData: null, requestUrl: "", @@ -43,37 +44,80 @@ Component({ }, ready: function () { - console.log("ready"); - this.data.classstyle_id = this.data.object.classstyle; - this.data.goodscount = this.data.object.goodscount; - console.log(this.data.classstyle_id); - this.data.wgroup = this.data.object.wgroup; - console.log(this.data.wgroup); - this.setData({ - classstyle_id: this.data.object.classstyle - }) - if (this.data.object.goodsclass == 1) { - this.data.is_recommend = 1 - } - if (this.data.object.goodsclass == 2) { - this.data.is_hot = 1 - } - if (this.data.object.goodsclass == 3) { - this.data.is_new = 1 - } - this.data.requestData = new Array(); - this.data.g_id = this.data.object.data; - var arr = []; - - for (var i = 0; i < this.data.g_id.length; i += this.data.goodscount) { - arr.push(this.data.g_id.slice(i, i + this.data.goodscount)); - } - this.data.firist_type_data = arr; - console.log("firist_type_data"); - console.log(this.data.firist_type_data); - this.init(this.data.classstyle_id, this.data.wgroup); }, + + + lifetimes: { + attached: function() { + // 在组件实例进入页面节点树时执行 + this.data.classstyle_id = this.data.object.classstyle; + this.data.goodscount = this.data.object.goodscount; + this.data.wgroup = this.data.object.wgroup; + + this.setData({ + classstyle_id: this.data.object.classstyle + }) + if (this.data.object.goodsclass == 1) { + this.data.is_recommend = 1 + } + if (this.data.object.goodsclass == 2) { + this.data.is_hot = 1 + } + if (this.data.object.goodsclass == 3) { + this.data.is_new = 1 + } + this.data.requestData = new Array(); + this.data.g_id = this.data.object.data; + var arr = []; + + for (var i = 0; i < this.data.g_id.length; i += this.data.goodscount) { + arr.push(this.data.g_id.slice(i, i + this.data.goodscount)); + } + this.data.firist_type_data = arr; + this.init(this.data.classstyle_id, this.data.wgroup); + }, + detached: function() { + // 在组件实例被从页面节点树移除时执行 + }, + }, + + pageLifetimes: { + show: function () { + this.data.firist_type_curr=1, + this.data.currentPage=1, + this.setData({ goods_array: null}) + + // 页面被展示 + // 在组件实例进入页面节点树时执行 + this.data.classstyle_id = this.data.object.classstyle; + this.data.goodscount = this.data.object.goodscount; + this.data.wgroup = this.data.object.wgroup; + + this.setData({ + classstyle_id: this.data.object.classstyle + }) + if (this.data.object.goodsclass == 1) { + this.data.is_recommend = 1 + } + if (this.data.object.goodsclass == 2) { + this.data.is_hot = 1 + } + if (this.data.object.goodsclass == 3) { + this.data.is_new = 1 + } + this.data.requestData = new Array(); + this.data.g_id = this.data.object.data; + var arr = []; + + for (var i = 0; i < this.data.g_id.length; i += this.data.goodscount) { + arr.push(this.data.g_id.slice(i, i + this.data.goodscount)); + } + this.data.firist_type_data = arr; + this.init(this.data.classstyle_id, this.data.wgroup); + }, + }, + methods: { // 这里是一个自定义方法 init: function (classstyle_id, wgroup) { @@ -93,6 +137,8 @@ Component({ //--初始化卡类-- th.card_init(); + var os=getApp().globalData.setting; + classstyle_id = classstyle_id + ""; switch (classstyle_id) { case "1": @@ -113,6 +159,10 @@ Component({ item.shop_price = goods.shop_price; item.sales_sum = goods.sales_sum; item.goods_id = goods.goods_id; + item.cardprice1 = val.cardprice1; + item.cardprice2 = val.cardprice2; + item.cardprice3 = val.cardprice3; + prom_id = res.data.data.prom_id; var prom_type = res.data.data.prom_type; //0普通商品 1秒杀 6拼单 @@ -189,6 +239,11 @@ Component({ item.shop_price = val.shop_price; item.sales_sum = val.sales_sum; item.goods_id = val.goods_id; + + item.cardprice1 = val.cardprice1; + item.cardprice2 = val.cardprice2; + item.cardprice3 = val.cardprice3; + prom_id = val.prom_id; var prom_type = val.prom_type; //0普通商品 1秒杀 6拼单 @@ -256,6 +311,11 @@ Component({ item.shop_price = val.shop_price; item.sales_sum = val.sales_sum; item.goods_id = val.goods_id; + + item.cardprice1 = val.cardprice1; + item.cardprice2 = val.cardprice2; + item.cardprice3 = val.cardprice3; + prom_id = val.prom_id; var prom_type = res.data.data.prom_type; //0普通商品 1秒杀 6拼单 @@ -308,7 +368,7 @@ Component({ //---卡的初始化---- card_init: function() { - var th = this; + var th = this,os=getApp().globalData.setting; getApp().request.get("/api/weshop/users/get/" + os.stoid + "/" + getApp().globalData.user_id, { success: function(e) { getApp().globalData.userInfo = e.data.data; diff --git a/components/diy_goodsGroup/diy_goodsGroup.wxml b/components/diy_goodsGroup/diy_goodsGroup.wxml index 74ac9b8..51b7200 100644 --- a/components/diy_goodsGroup/diy_goodsGroup.wxml +++ b/components/diy_goodsGroup/diy_goodsGroup.wxml @@ -33,12 +33,101 @@ {{item.goods_name}} + + ¥{{item.prom_price}} + ¥{{item.market_price}} + + + + + + + + + + + + + {{filter.toFix(item[card_field],2)}} + {{card_name}} + + + + + + + {{item.market_price}} + + + + + + + + + {{filter.toFix(item.shop_price,2)}} + + + + + + + {{item.market_price}} + + + + + + + + + + + + {{filter.toFix(item.shop_price,2)}} + + + + + {{item.market_price}} + + + + + + + + {{filter.toFix(g_filter.get_card_price(item,card_list,0),2)}} + {{g_filter.get_card_price(item,card_list,1)}} + + + + + + + + + {{filter.toFix(item.shop_price,2)}} + + + + + + + {{item.market_price}} + + + + + + + + ¥{{item.shop_price}} + ¥{{item.market_price}} + - - ¥{{item.shop_price}} - - ¥{{item.market_price}} + 销量:{{item.sales_sum}}件 @@ -81,8 +170,98 @@ {{item.goods_name}} - ¥{{item.shop_price}} - ¥{{item.market_price}} + + + ¥{{item.prom_price}} + ¥{{item.market_price}} + + + + + + + + + + + + {{filter.toFix(item[card_field],2)}} + {{card_name}} + + + + + + + {{item.market_price}} + + + + + + + + + {{filter.toFix(item.shop_price,2)}} + + + + + + + {{item.market_price}} + + + + + + + + + + + + {{filter.toFix(item.shop_price,2)}} + + + + + {{item.market_price}} + + + + + + + + {{filter.toFix(g_filter.get_card_price(item,card_list,0),2)}} + {{g_filter.get_card_price(item,card_list,1)}} + + + + + + + + + {{filter.toFix(item.shop_price,2)}} + + + + + + + {{item.market_price}} + + + + + + + ¥{{item.shop_price}} + ¥{{item.market_price}} + + 销量:{{item.sales_sum}}件 @@ -128,8 +307,97 @@ {{item.goods_name}} - ¥{{item.shop_price}} - ¥{{item.market_price}} + + ¥{{item.prom_price}} + ¥{{item.market_price}} + + + + + + + + + + + + {{filter.toFix(item[card_field],2)}} + {{card_name}} + + + + + + + {{item.market_price}} + + + + + + + + + {{filter.toFix(item.shop_price,2)}} + + + + + + + {{item.market_price}} + + + + + + + + + + + + {{filter.toFix(item.shop_price,2)}} + + + + + {{item.market_price}} + + + + + + + + {{filter.toFix(g_filter.get_card_price(item,card_list,0),2)}} + {{g_filter.get_card_price(item,card_list,1)}} + + + + + + + + + {{filter.toFix(item.shop_price,2)}} + + + + + + + {{item.market_price}} + + + + + + + ¥{{item.shop_price}} + ¥{{item.market_price}} + + 销量:{{item.sales_sum}}件 @@ -175,8 +443,92 @@ {{item.goods_name}} - ¥{{item.shop_price}} - ¥{{item.market_price}} + + + + + + + + + + {{filter.toFix(item[card_field],2)}} + {{card_name}} + + + + + + + {{item.market_price}} + + + + + + + + + {{filter.toFix(item.shop_price,2)}} + + + + + + + {{item.market_price}} + + + + + + + + + + + + {{filter.toFix(item.shop_price,2)}} + + + + + {{item.market_price}} + + + + + + + + {{filter.toFix(g_filter.get_card_price(item,card_list,0),2)}} + {{g_filter.get_card_price(item,card_list,1)}} + + + + + + + + + {{filter.toFix(item.shop_price,2)}} + + + + + + + {{item.market_price}} + + + + + + + + ¥{{item.shop_price}} + ¥{{item.market_price}} + 销量:{{item.sales_sum}}件 diff --git a/components/diy_goodsGroup/diy_goodsGroup.wxss b/components/diy_goodsGroup/diy_goodsGroup.wxss index 850342e..7adea90 100644 --- a/components/diy_goodsGroup/diy_goodsGroup.wxss +++ b/components/diy_goodsGroup/diy_goodsGroup.wxss @@ -84,11 +84,7 @@ font-size:28rpx; font-size: 32rpx; } -.del{ - font-size: 24rpx; - color: #999; - text-decoration: line-through; -} + .zs_t1{ width: 56rpx; @@ -219,10 +215,9 @@ font-size:28rpx; } .del{ - font-size: 24rpx; + font-size: 24rpx; color: #999; text-decoration: line-through; - margin-left: 10rpx; margin-top: 8rpx; } @@ -521,4 +516,22 @@ top: 234rpx; margin-top: 10rpx; } -.rel{position: relative} \ No newline at end of file +.rel{position: relative} +.flex{display: flex} +.fs24{font-size: 24rpx} +.fs35{font-size: 35rpx} +.xc-wc{ align-items: center} + +.price.xc-ash{ + font-size: 24rpx; + color: #999; + text-decoration: line-through; + margin-top: 8rpx; +} + + +.line_th{ text-decoration: line-through} +.card_bg {display: flex; padding: 2rpx 10rpx;height: 28rpx; align-items: center; border-radius: 26rpx; font-size: 19rpx;line-height: 28rpx;max-width: 110rpx; + background: #333; color: #fff; justify-content: center; margin-left: 2rpx;} +.card_bg image{ width: 19rpx; height: 19rpx; margin-right: 1rpx;} +.card_bg .card_name{ max-width: 76rpx; width: auto;overflow: hidden; white-space:nowrap; } \ No newline at end of file