Commit 42261b59 by 高淑倩

modify: 券码详情页

parent 6bfd1a61
......@@ -9,23 +9,38 @@ wxService.page({
* 页面的初始数据
*/
data: {
couponDetailTitle: '',
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
const {title,cardno} = this.options
this.setData({
couponDetailTitle: title
})
this.getCouponDetail(cardno)
},
// 查询单个优惠券
getCouponDetail(){
wxService.post(`/coupon/coupon/setting/get/${id}`).then(res => {
this.setData({
couponDetail: res.data.data.content
getCouponDetail(cardno){
wx.showLoading({
title: '加载中'
})
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(() => {
})
......
......@@ -5,7 +5,7 @@
<view class='avatar-img'>
<image src='/assets/imgs/avatar.png'></image>
</view>
<view class='title fs-36'>阳光柠檬茶1.5元购</view>
<view class='title fs-36'>{{couponDetailTitle}}</view>
</view>
<view class='line'>
<image src='/assets/imgs/line.png'></image>
......
......@@ -76,6 +76,11 @@ wxService.page({
// 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){
wx.showLoading({
......
......@@ -19,7 +19,7 @@
wx:for-index="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 class='invalid-coupon' />
<image src='/assets/imgs/invalid.png' class='invalid-img' />
......@@ -34,13 +34,12 @@
<view class='coupon-desc fs-24'>{{item.notice}}</view>
</view>
<view class='coupon-code fs-24'>出示劵码</view>
</navigator>
</view>
</view>
</view>
<no-more wx:if="{{noMoreCoupon}}" />
</scroll-view>
<view class='empty-wrap' wx:if="{{!couponList.length}}">
<view class='empty-info'>
<image class='empty-img' src='/assets/imgs/empty-coupon.png' />
......
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