diff --git a/components/coupons/index.js b/components/coupons/index.js index 9d554b0..8496a57 100644 --- a/components/coupons/index.js +++ b/components/coupons/index.js @@ -1,4 +1,6 @@ const app = getApp() +const Http = require("../../utils/HttpBasics"); +const config = require("../../config/config"); Component({ /** * 组件的属性列表 @@ -17,7 +19,8 @@ Component({ */ data: { mouldType: 0, - mouldConfig:{} + mouldConfig: {}, + couponListShowSelled: '' }, attached: function () { // 在组件实例进入页面节点树时执行 @@ -27,6 +30,17 @@ Component({ mouldConfig: app.globalData.mouldConfig }) } + + Http.get({ + url: config.api.couponListShowSelled, + }).then(res => { + this.setData({ + couponListShowSelled: res.data || "" + }) + }).catch(err => { + + }) + }, methods: { gotoDetail(e) { diff --git a/components/coupons/index.wxml b/components/coupons/index.wxml index d1b8aa3..ce50d20 100644 --- a/components/coupons/index.wxml +++ b/components/coupons/index.wxml @@ -19,6 +19,7 @@ {{data.title}} + 已售{{data.inventory - data.remainInventory}} {{data.subTitle}} @@ -27,6 +28,7 @@ ¥{{data.priceStr}} 抢购价 ¥{{data.salePriceStr}} + 可砍至 ¥{{data.salePriceStr}} 拼团价 diff --git a/components/coupons/index.wxss b/components/coupons/index.wxss index abd3cfa..5484212 100644 --- a/components/coupons/index.wxss +++ b/components/coupons/index.wxss @@ -63,6 +63,8 @@ width: 100%; } + + .price { font-size: 36rpx; font-family: PingFang-SC-Bold; @@ -99,6 +101,14 @@ letter-spacing: 0; } +.saleRamin { + position: absolute; + font-size: 25rpx; + bottom: 60rpx; + left: 25rpx; + color: #333; +} + .coupons-info-price-o { display: block; text-align: center; diff --git a/components/optimization/optimization.js b/components/optimization/optimization.js index d3a1a4a..d65d480 100644 --- a/components/optimization/optimization.js +++ b/components/optimization/optimization.js @@ -1,12 +1,13 @@ -// components/optimization/optimization.js +const Http = require("../../utils/HttpBasics"); +const config = require("../../config/config"); Component({ /** * 组件的属性列表 */ properties: { - businessList:{ - type:Array, - value:[] + businessList: { + type: Array, + value: [] }, businessData: { type: Array, @@ -18,28 +19,41 @@ Component({ * 组件的初始数据 */ data: { - classIndex:0 + classIndex: 0, + couponListShowSelled: "" }, /** * 组件的方法列表 */ methods: { - goDetail(e){ + goDetail(e) { let couponChannelId = e.currentTarget.dataset.id let couponId = e.currentTarget.dataset.couponid wx.navigateTo({ url: `/pages/coupon/detail/index?couponChannelId=${couponChannelId}&couponId=${couponId}`, }) }, - setIndex(e){ + setIndex(e) { let index = e.currentTarget.dataset.index let id = e.currentTarget.dataset.id - this.triggerEvent('businessid',id) + this.triggerEvent('businessid', id) + this.setData({ + classIndex: index + }) + }, + + + }, + attached() { + Http.get({ + url: config.api.couponListShowSelled, + }).then(res => { this.setData({ - classIndex:index + couponListShowSelled: res.data || "" }) - } + }).catch(err => { + }) } }) diff --git a/components/optimization/optimization.wxml b/components/optimization/optimization.wxml index ca66c43..dabe266 100644 --- a/components/optimization/optimization.wxml +++ b/components/optimization/optimization.wxml @@ -25,7 +25,7 @@ {{item.salePriceStrQ?item.salePriceStrQ:item.salePriceStr}} {{item.salePriceStrH?'.'+item.salePriceStrH:''}} - 已售 {{item.sale}} + 已售 {{item.sale}} ¥{{item.priceStr}} diff --git a/config/config.js b/config/config.js index 768e844..422ff99 100755 --- a/config/config.js +++ b/config/config.js @@ -118,6 +118,10 @@ var config = { * 频道查询 */ couponChannelList: "/wxCouponChannel/list", + /** + * 是否显示已售 + */ + couponListShowSelled: "/sysConfig/getByKey?key=couponListShowSelled", /** * 换一换change */ diff --git a/index/index.js b/index/index.js index 1d1add5..f1d87b2 100644 --- a/index/index.js +++ b/index/index.js @@ -615,6 +615,7 @@ Page({ onShow: function () { console.log("onShow--") + console.log(app.globalData.mouldType, "mouldType") if (app.globalData.token) { this.getmemberId(app.globalData.token); diff --git a/pages/theme/index1/index.js b/pages/theme/index1/index.js index 15ba8c7..54a37bc 100644 --- a/pages/theme/index1/index.js +++ b/pages/theme/index1/index.js @@ -710,6 +710,7 @@ Page({ setTimeout(function () { that.alphaClick1(); }, 8000) + },