Commit 4835ac4b by 高淑倩

扫码_卡券详情

parent a3d9ea5f
...@@ -6,6 +6,10 @@ wxService.page({ ...@@ -6,6 +6,10 @@ wxService.page({
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
id: '',
couponDetail: null,
productData: [],
subStoreData: [],
proData: [ proData: [
{ {
"id": "636202018767245312", "id": "636202018767245312",
...@@ -54,9 +58,54 @@ wxService.page({ ...@@ -54,9 +58,54 @@ wxService.page({
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow: function () { onShow: function () {
console.log('--------', this.options)
this.setData({
id: '638467647583031296'
},()=>{
this.getCouponDetail(this.data.id)
})
},
getCouponDetail(id){
wx.showLoading({
title: '加载中'
})
wxService.get(`/marketing/shoppingguide/coupon/detail?id=${id}`).then(res => {
const { result, data } = res.data
if (result == 0) {
wx.hideLoading()
this.setData({
couponDetail: data
})
this.getCouponGoods(data.couponId)
}
})
},
// 卡券详情
getCouponGoods(id){
wx.showLoading({
title: '加载中'
})
wxService.post(`/coupon/coupon/setting/get/${id}`).then(res => {
const {result,data} = res.data
if(result == 0){
wx.hideLoading()
// data.coupon.startTime = data.coupon.startTime.substring(0,10)
// data.coupon.endTime = data.coupon.endTime.substring(0,10)
// data.couponSetting.notice = JSON.parse(data.couponSetting.notice)
// for (let i in data.couponSetting.notice){
// if (data.couponSetting.notice[i].type == 1){
// data.couponSetting.notice[i].value = data.coupon.startTime.substring(0, 10) + ' 至 ' + data.coupon.endTime.substring(0, 10)
// }
// }
this.setData({
productData: data.couponDetail && data.couponDetail.useCondition && data.couponDetail.useCondition.productData,
subStoreData: data.couponDetail && data.couponDetail.useCondition && data.couponDetail.useCondition.subStoreData
})
}
}).finally(() => {
wx.hideLoading()
})
}, },
/** /**
* 生命周期函数--监听页面隐藏 * 生命周期函数--监听页面隐藏
*/ */
......
...@@ -3,19 +3,19 @@ ...@@ -3,19 +3,19 @@
<view class="scan-title clearfix"> <view class="scan-title clearfix">
<view class="title-btn">立即领取</view> <view class="title-btn">立即领取</view>
<view class="title-name">优惠券名称</view> <view class="title-name">{{couponDetail.couponName}}</view>
<view class="title-desc">优惠券使用说明优惠券使用说明优惠券使用说明</view> <view class="title-desc">{{couponDetail.title}}</view>
<view class="title-others">其他优惠券使用说明优惠券使用说明优惠券使用说明优惠券使用说明</view> <view class="title-others">{{couponDetail.remark}}</view>
</view> </view>
<view class="scan-stores"> <view class="scan-stores">
<view class="store-title"> <view class="store-title">
<view class="store-num">适用门店 <view class="store-num">适用门店
<text class="store-num-tips">(13)</text> <text class="store-num-tips">({{subStoreData.length}})</text>
</view> </view>
<view class="store-more">查看更多></view> <view class="store-more" wx:if="{{subStoreData.length}}">查看更多></view>
</view> </view>
<view class="store-address"> <view class="store-address" wx:if="{{subStoreData.length}}">
<view class="store-detail"> <view class="store-detail">
<view class="detail-name">浦东家里哦</view> <view class="detail-name">浦东家里哦</view>
<view class="detail-address">详细地址详细地址详细地址详细地址</view> <view class="detail-address">详细地址详细地址详细地址详细地址</view>
...@@ -30,12 +30,12 @@ ...@@ -30,12 +30,12 @@
<view class="scan-goods"> <view class="scan-goods">
<view class="goods-title"> <view class="goods-title">
<view class="goods-num">适用商品</view> <view class="goods-num">适用商品</view>
<view class="goods-more">查看更多></view> <view class="goods-more" wx:if="{{productData.length}}">查看更多></view>
</view> </view>
<water-flow-layout <water-flow-layout
wx:if="{{proData.length}}" wx:if="{{productData.length}}"
type="2" type="2"
image-data="{{proData}}" image-data="{{productData}}"
/> />
<view class="goods-no-more" wx:else>没有更多哦</view> <view class="goods-no-more" wx:else>没有更多哦</view>
</view> </view>
......
...@@ -75,7 +75,7 @@ page { ...@@ -75,7 +75,7 @@ page {
} }
.scan-title .title-name { .scan-title .title-name {
width: 160rpx; min-width: 160rpx;
height: 32rpx; height: 32rpx;
color: rgba(0, 145, 255, 1); color: rgba(0, 145, 255, 1);
font-size: 32rpx; font-size: 32rpx;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment