Commit 60646f01 by 高淑倩

modify: coupon_code

parent 466049b0
...@@ -10,17 +10,16 @@ wxService.page({ ...@@ -10,17 +10,16 @@ wxService.page({
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
couponDetailTitle: '', cardno: '',
cardno: '' codeDetail: {}
}, },
/** /**
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow () { onShow () {
const {title,cardno} = this.options const {cardno} = this.options
this.setData({ this.setData({
couponDetailTitle: title,
cardno cardno
}) })
this.getCouponDetail(cardno) this.getCouponDetail(cardno)
...@@ -37,6 +36,9 @@ wxService.page({ ...@@ -37,6 +36,9 @@ wxService.page({
const {result,data} = res.data const {result,data} = res.data
if(result == 0){ if(result == 0){
wx.hideLoading() wx.hideLoading()
this.setData({
codeDetail: data
})
} else { } else {
wx.hideLoading() wx.hideLoading()
wx.showToast({ wx.showToast({
......
...@@ -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'>{{couponDetailTitle}}</view> <view class='title fs-36'>{{codeDetail.couponSetting.title}}</view>
</view> </view>
<view class='line'> <view class='line'>
<image src='/assets/imgs/line.png'></image> <image src='/assets/imgs/line.png'></image>
......
...@@ -11,7 +11,8 @@ wxService.page({ ...@@ -11,7 +11,8 @@ wxService.page({
*/ */
data: { data: {
isExchange:false, isExchange:false,
couponDetail:{} couponDetail:{},
cardno: ''
}, },
/** /**
...@@ -20,6 +21,9 @@ wxService.page({ ...@@ -20,6 +21,9 @@ wxService.page({
onShow () { onShow () {
const {cardno} = this.options const {cardno} = this.options
this.getCouponDetail(cardno) this.getCouponDetail(cardno)
this.setData({
cardno
})
}, },
//立即兑换 //立即兑换
...@@ -49,7 +53,8 @@ wxService.page({ ...@@ -49,7 +53,8 @@ wxService.page({
}) })
}, },
handelPresentCouponCode(e) { handelPresentCouponCode(e) {
let data = e.currentTarget.dataset // let data = e.currentTarget.dataset
wxService.router(`/pages/couponCodeDetail/couponCodeDetail`).search(data) const {cardno} = this.data
wxService.router(`/pages/couponCodeDetail/couponCodeDetail`).search({cardno})
} }
}) })
\ No newline at end of file
...@@ -76,8 +76,8 @@ wxService.page({ ...@@ -76,8 +76,8 @@ wxService.page({
wxService.router(`/pages/couponDetail/couponDetail`).search({cardno}) wxService.router(`/pages/couponDetail/couponDetail`).search({cardno})
}, },
handelPresentCouponCode(e) { handelPresentCouponCode(e) {
let data = e.currentTarget.dataset let {cardno} = e.currentTarget.dataset
wxService.router(`/pages/couponCodeDetail/couponCodeDetail`).search(data) wxService.router(`/pages/couponCodeDetail/couponCodeDetail`).search({cardno})
}, },
//获取优惠券列表 //获取优惠券列表
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
<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' bindtap="handelPresentCouponCode">出示劵码</view> <view class='coupon-code fs-24' data-cardNo="{{item.cardNo}}" bindtap="handelPresentCouponCode">出示劵码</view>
</view> </view>
</view> </view>
</view> </view>
......
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