@@ -1,4 +1,6 @@ | |||||
const app = getApp() | const app = getApp() | ||||
const Http = require("../../utils/HttpBasics"); | |||||
const config = require("../../config/config"); | |||||
Component({ | Component({ | ||||
/** | /** | ||||
* 组件的属性列表 | * 组件的属性列表 | ||||
@@ -17,7 +19,8 @@ Component({ | |||||
*/ | */ | ||||
data: { | data: { | ||||
mouldType: 0, | mouldType: 0, | ||||
mouldConfig:{} | |||||
mouldConfig: {}, | |||||
couponListShowSelled: '' | |||||
}, | }, | ||||
attached: function () { | attached: function () { | ||||
// 在组件实例进入页面节点树时执行 | // 在组件实例进入页面节点树时执行 | ||||
@@ -27,6 +30,17 @@ Component({ | |||||
mouldConfig: app.globalData.mouldConfig | mouldConfig: app.globalData.mouldConfig | ||||
}) | }) | ||||
} | } | ||||
Http.get({ | |||||
url: config.api.couponListShowSelled, | |||||
}).then(res => { | |||||
this.setData({ | |||||
couponListShowSelled: res.data || "" | |||||
}) | |||||
}).catch(err => { | |||||
}) | |||||
}, | }, | ||||
methods: { | methods: { | ||||
gotoDetail(e) { | gotoDetail(e) { | ||||
@@ -19,6 +19,7 @@ | |||||
</view> | </view> | ||||
<view class="coupons-info"> | <view class="coupons-info"> | ||||
<view class="coupons-info-name tit">{{data.title}}</view> | <view class="coupons-info-name tit">{{data.title}}</view> | ||||
<text class='saleRamin' wx:if="{{couponListShowSelled && couponListShowSelled==1}}">已售{{data.inventory - data.remainInventory}}</text> | |||||
<view class="coupons-info-name subtitle">{{data.subTitle}}</view> | <view class="coupons-info-name subtitle">{{data.subTitle}}</view> | ||||
<view class="coupons-info-price-p"> | <view class="coupons-info-price-p"> | ||||
<view class='price' wx:if="{{data.type!=10}}"> | <view class='price' wx:if="{{data.type!=10}}"> | ||||
@@ -27,6 +28,7 @@ | |||||
<text wx:if="{{!(data.type==5&&data.unit==1)}}" class='view02'>¥{{data.priceStr}}</text></text> | <text wx:if="{{!(data.type==5&&data.unit==1)}}" class='view02'>¥{{data.priceStr}}</text></text> | ||||
<text wx:if="{{data.targetAd == 2}}"><text class='saleprice'>抢购价</text> | <text wx:if="{{data.targetAd == 2}}"><text class='saleprice'>抢购价</text> | ||||
<text class='rmb'>¥</text>{{data.salePriceStr}}</text> | <text class='rmb'>¥</text>{{data.salePriceStr}}</text> | ||||
<text wx:if="{{data.targetAd == 6}}"><text class='saleprice'>可砍至</text> | <text wx:if="{{data.targetAd == 6}}"><text class='saleprice'>可砍至</text> | ||||
<text class='rmb'>¥</text>{{data.salePriceStr}}</text> | <text class='rmb'>¥</text>{{data.salePriceStr}}</text> | ||||
<text wx:if="{{data.targetAd == 7}}"><text class='saleprice'>拼团价</text> | <text wx:if="{{data.targetAd == 7}}"><text class='saleprice'>拼团价</text> | ||||
@@ -63,6 +63,8 @@ | |||||
width: 100%; | width: 100%; | ||||
} | } | ||||
.price { | .price { | ||||
font-size: 36rpx; | font-size: 36rpx; | ||||
font-family: PingFang-SC-Bold; | font-family: PingFang-SC-Bold; | ||||
@@ -99,6 +101,14 @@ | |||||
letter-spacing: 0; | letter-spacing: 0; | ||||
} | } | ||||
.saleRamin { | |||||
position: absolute; | |||||
font-size: 25rpx; | |||||
bottom: 60rpx; | |||||
left: 25rpx; | |||||
color: #333; | |||||
} | |||||
.coupons-info-price-o { | .coupons-info-price-o { | ||||
display: block; | display: block; | ||||
text-align: center; | text-align: center; | ||||
@@ -1,12 +1,13 @@ | |||||
// components/optimization/optimization.js | |||||
const Http = require("../../utils/HttpBasics"); | |||||
const config = require("../../config/config"); | |||||
Component({ | Component({ | ||||
/** | /** | ||||
* 组件的属性列表 | * 组件的属性列表 | ||||
*/ | */ | ||||
properties: { | properties: { | ||||
businessList:{ | |||||
type:Array, | |||||
value:[] | |||||
businessList: { | |||||
type: Array, | |||||
value: [] | |||||
}, | }, | ||||
businessData: { | businessData: { | ||||
type: Array, | type: Array, | ||||
@@ -18,28 +19,41 @@ Component({ | |||||
* 组件的初始数据 | * 组件的初始数据 | ||||
*/ | */ | ||||
data: { | data: { | ||||
classIndex:0 | |||||
classIndex: 0, | |||||
couponListShowSelled: "" | |||||
}, | }, | ||||
/** | /** | ||||
* 组件的方法列表 | * 组件的方法列表 | ||||
*/ | */ | ||||
methods: { | methods: { | ||||
goDetail(e){ | |||||
goDetail(e) { | |||||
let couponChannelId = e.currentTarget.dataset.id | let couponChannelId = e.currentTarget.dataset.id | ||||
let couponId = e.currentTarget.dataset.couponid | let couponId = e.currentTarget.dataset.couponid | ||||
wx.navigateTo({ | wx.navigateTo({ | ||||
url: `/pages/coupon/detail/index?couponChannelId=${couponChannelId}&couponId=${couponId}`, | url: `/pages/coupon/detail/index?couponChannelId=${couponChannelId}&couponId=${couponId}`, | ||||
}) | }) | ||||
}, | }, | ||||
setIndex(e){ | |||||
setIndex(e) { | |||||
let index = e.currentTarget.dataset.index | let index = e.currentTarget.dataset.index | ||||
let id = e.currentTarget.dataset.id | 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({ | this.setData({ | ||||
classIndex:index | |||||
couponListShowSelled: res.data || "" | |||||
}) | }) | ||||
} | |||||
}).catch(err => { | |||||
}) | |||||
} | } | ||||
}) | }) |
@@ -25,7 +25,7 @@ | |||||
<view class="int">{{item.salePriceStrQ?item.salePriceStrQ:item.salePriceStr}}</view> | <view class="int">{{item.salePriceStrQ?item.salePriceStrQ:item.salePriceStr}}</view> | ||||
<view class="fuhao">{{item.salePriceStrH?'.'+item.salePriceStrH:''}}</view> | <view class="fuhao">{{item.salePriceStrH?'.'+item.salePriceStrH:''}}</view> | ||||
</view> | </view> | ||||
<view class="priceNum r">已售 {{item.sale}}</view> | |||||
<view wx:if="{{couponListShowSelled && couponListShowSelled==1}}" class="priceNum r">已售 {{item.sale}}</view> | |||||
<view class="originalBox r"> | <view class="originalBox r"> | ||||
<view class="origina">¥{{item.priceStr}}</view> | <view class="origina">¥{{item.priceStr}}</view> | ||||
</view> | </view> | ||||
@@ -118,6 +118,10 @@ var config = { | |||||
* 频道查询 | * 频道查询 | ||||
*/ | */ | ||||
couponChannelList: "/wxCouponChannel/list", | couponChannelList: "/wxCouponChannel/list", | ||||
/** | |||||
* 是否显示已售 | |||||
*/ | |||||
couponListShowSelled: "/sysConfig/getByKey?key=couponListShowSelled", | |||||
/** | /** | ||||
* 换一换change | * 换一换change | ||||
*/ | */ | ||||
@@ -615,6 +615,7 @@ Page({ | |||||
onShow: function () { | onShow: function () { | ||||
console.log("onShow--") | console.log("onShow--") | ||||
console.log(app.globalData.mouldType, "mouldType") | console.log(app.globalData.mouldType, "mouldType") | ||||
if (app.globalData.token) { | if (app.globalData.token) { | ||||
this.getmemberId(app.globalData.token); | this.getmemberId(app.globalData.token); | ||||
@@ -710,6 +710,7 @@ Page({ | |||||
setTimeout(function () { | setTimeout(function () { | ||||
that.alphaClick1(); | that.alphaClick1(); | ||||
}, 8000) | }, 8000) | ||||
}, | }, | ||||