Commit 4e74fd01 by 高淑倩

modify: 详情页

parent ad6a16bc
......@@ -17,7 +17,12 @@ wxService.page({
tip: '立即查看'
},
desc: [{ "label": "优惠详情", "value": "使用100积分可兑换一张维记鲜牛奶优惠券,凭券可以4.8元优惠价换购维记鲜牛奶236ML一盒!", "type": 2 }, { "label": "有效时间", "value": "2019-07-12 至 2019-08-06", "type": 2 }, { "label": "兑换说明", "value": "1、点击【立即兑换】,即可兑换成功,每人限兑换10张券\n2、在【会员小程序-优惠券】中可查询到已兑换的券;", "type": 2 }, { "label": "使用须知", "value": "1、凭此优惠券,前往广东7-Eleven有售门店,可以优惠价4.8元换购维记鲜牛奶236ML一盒!2、成功领到优惠券后,请务必在有效期内使用,逾期无效;3、一张券限兑换维记鲜牛奶236ML一盒;4、优惠券不设找零、不可兑换现金; 5、请于交易前向收银员出示此优惠券; 6、使用优惠券发生的交易,广东7-Eleven仅按实际支付金额开具发票;7、如发生退货,仅按顾客实际支付金额退款。 ", "type": 2 }],
activityId: ''
activityId: '',
type: 1, // 1 订单 2 商品
popupType: 0, // 默认不跳转 1 优惠券 2 积分
goal: 0,
detailImage: '',
countObj: null
},
/**
......@@ -36,10 +41,13 @@ wxService.page({
const { result, data } = res.data
if (result == 0) {
wx.hideLoading()
console.log(data)
this.setData({
activityId: data.id
},()=> {
activityId: data.id,
type: data.type,
popupType: data.popupType,
goal: data.goal,
detailImage: data.detailImage
}, () => {
// 会员集点活动统计信息
this.getPointConsumptionCount(id)
})
......@@ -58,8 +66,8 @@ wxService.page({
const { result, data } = res.data
if (result == 0) {
wx.hideLoading()
console.log(data)
this.setData({
countObj: data
})
}
}
......@@ -69,13 +77,13 @@ wxService.page({
wxService.router(`/subPackage/page/pages/pointGoodsList/pointGoodsList`)
},
handleGo() {
// 兑换成功跳转 触点有礼-消费集点兑换
// wxService.router(`/pages/coupons/coupons`)
// 兑换成功跳转
this.getPointExchange()
},
// 触点有礼-消费集点兑换
getPointExchange() {
const { activityId} = this.data
const { activityId } = this.data
const { memberId } = wx.getStorageSync('_baseUserInfo')
wx.showLoading({
title: '加载中'
......@@ -85,9 +93,15 @@ wxService.page({
const { result, data } = res.data
if (result == 0) {
wx.hideLoading()
console.log(data)
this.setData({
})
// 跳转 popupType: 0 默认不跳转 1 优惠券 2 积分
const { popupType } = this.data
if (popupType == 1) {
wxService.router(`/pages/coupons/coupons`)
} else if (popupType == 2) {
wxService.router(`/pages/integralWater/integralWater`)
}
}
}
})
......@@ -110,8 +124,8 @@ wxService.page({
* 生命周期函数--监听页面显示
*/
onShow: function () {
const {id} = this.options
if(id){
const { id } = this.options
if (id) {
this.getPointDetail(id)
}
},
......
<!--pages/pointDetail/pointDetail.wxml-->
<status-img imgHeight="{{imgHeight}}" />
<status-img imgHeight="{{imgHeight}}" img="{{detailImage}}"/>
<view class="detail-info border_box">
<view class="info-top weui-flex df-j--bt">
<view class="info-num">
进度:
<text class="rate-num">1</text>
/ 5
<text class="rate-num"> {{countObj.surplusPoints}}</text>
/ {{goal}}
</view>
<view class="info-ready-num">
已达成 1
已达成 {{countObj.exchangeCount}}
</view>
</view>
<view class="info-progress border_box">
......@@ -20,20 +20,19 @@
border-radius="{{20}}"
/>
</view>
<view class="info-status-btn available border_box" bindtap="handleToGet">
可领取奖励 1
<view wx:if="{{countObj.totalPoints}}" class="info-status-btn available border_box" bindtap="handleToGet">
可领取奖励 {{countObj.totalPoints}}
</view>
<!-- <view class="info-status-btn unacommpolished border_box">
<view wx:else class="info-status-btn unacommpolished border_box">
还未达成,继续加油呀
</view>-->
</view>
</view>
<view class="detail-desc">
<view class="detail-active" bindtap="handleCheckGoods">查看活动商品 ></view>
<view class="detail-active" bindtap="handleCheckGoods" wx:if="{{type == 2}}">查看活动商品 ></view>
<view class='integral-list' wx:for="{{desc}}" wx:key="{{index}}">
<text class='integral-title'>{{item.label}}</text>
<text class='integral-desc wpl'>{{item.value}}</text>
</view>
</view>
<x-dialog dialog="{{dialog}}" bind:handleGo="handleGo" show="{{dialog.show}}"></x-dialog>
\ No newline at end of file
......@@ -44,10 +44,10 @@
}
.detail-desc {
box-sizing: border-box;
padding: 0 40rpx;
padding: 20rpx 40rpx 0 40rpx;
}
.integral-list{
margin-bottom: 60rpx;
margin: 20rpx 0 60rpx 0;
font-size: 27rpx;
}
.integral-title,.integral-desc{
......@@ -70,6 +70,4 @@
font-size: 24rpx;
text-align: right;
font-family: PingFangSC-Regular;
padding: 30rpx 0 50rpx 0;
box-sizing: border-box;
}
\ No newline at end of file
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