Commit 42261b59 by 高淑倩

modify: 券码详情页

parent 6bfd1a61
...@@ -9,23 +9,38 @@ wxService.page({ ...@@ -9,23 +9,38 @@ wxService.page({
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
couponDetailTitle: '',
}, },
/** /**
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow: function () { onShow: function () {
const {title,cardno} = this.options
this.setData({
couponDetailTitle: title
})
this.getCouponDetail(cardno)
}, },
// 查询单个优惠券 // 查询单个优惠券
getCouponDetail(){ getCouponDetail(cardno){
wxService.post(`/coupon/coupon/setting/get/${id}`).then(res => { wx.showLoading({
this.setData({ title: '加载中'
couponDetail: res.data.data.content })
})
wxService.post(`/coupon/coupon/get?cardNo=${cardno}`).then(res => {
const {result,data} = res.data
if(result == 0){
wx.hideLoading()
console.log('dddd',data)
} else {
wx.hideLoading()
wx.showToast({
title: `${res.desc}`,
icon: 'none'
})
}
}).finally(() => { }).finally(() => {
}) })
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<view class='avatar-img'> <view class='avatar-img'>
<image src='/assets/imgs/avatar.png'></image> <image src='/assets/imgs/avatar.png'></image>
</view> </view>
<view class='title fs-36'>阳光柠檬茶1.5元购</view> <view class='title fs-36'>{{couponDetailTitle}}</view>
</view> </view>
<view class='line'> <view class='line'>
<image src='/assets/imgs/line.png'></image> <image src='/assets/imgs/line.png'></image>
......
...@@ -76,6 +76,11 @@ wxService.page({ ...@@ -76,6 +76,11 @@ wxService.page({
// this.getCouponList(this.data.pageNo,this.data.pageSize) // this.getCouponList(this.data.pageNo,this.data.pageSize)
// }, // },
handelPresentCouponCode(e) {
let data = e.currentTarget.dataset
wxService.router(`/pages/couponDetail/couponDetail`).search(data)
},
//获取优惠券列表 //获取优惠券列表
getCouponList(pageNo,pageSize){ getCouponList(pageNo,pageSize){
wx.showLoading({ wx.showLoading({
......
...@@ -19,27 +19,26 @@ ...@@ -19,27 +19,26 @@
wx:for-index="k" wx:for-index="k"
wx:key="{{k}}" wx:key="{{k}}"
> >
<navigator hover-class='none' url='/pages/couponDetail/couponDetail'> <view data-title="{{item.title}}" data-cardNo="{{item.cardNo}}" bindtap="handelPresentCouponCode">
<view wx:if="{{invalidCouponList.length}}"> <view wx:if="{{invalidCouponList.length}}">
<view class='invalid-coupon' /> <view class='invalid-coupon' />
<image src='/assets/imgs/invalid.png' class='invalid-img' /> <image src='/assets/imgs/invalid.png' class='invalid-img' />
</view> </view>
<image class='coupon-bg' src='/assets/imgs/coupon-bg.png' /> <image class='coupon-bg' src='/assets/imgs/coupon-bg.png' />
<view class='coupon-img'> <view class='coupon-img'>
<image src='/assets/imgs/qr-code.png' /> <image src='/assets/imgs/qr-code.png' />
</view> </view>
<view class='coupon-info'> <view class='coupon-info'>
<view class='coupon-name fs-28'>{{item.title}}</view> <view class='coupon-name fs-28'>{{item.title}}</view>
<view class='coupon-time fs-24'>{{item.startTime}} 至 {{item.endTime}}</view> <view class='coupon-time fs-24'>{{item.startTime}} 至 {{item.endTime}}</view>
<view class='coupon-desc fs-24'>{{item.notice}}</view> <view class='coupon-desc fs-24'>{{item.notice}}</view>
</view> </view>
<view class='coupon-code fs-24'>出示劵码</view> <view class='coupon-code fs-24'>出示劵码</view>
</navigator> </view>
</view> </view>
</view> </view>
<no-more wx:if="{{noMoreCoupon}}" /> <no-more wx:if="{{noMoreCoupon}}" />
</scroll-view> </scroll-view>
<view class='empty-wrap' wx:if="{{!couponList.length}}"> <view class='empty-wrap' wx:if="{{!couponList.length}}">
<view class='empty-info'> <view class='empty-info'>
......
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