Commit 9506014c by 高淑倩

add: 积分兑换优惠券

parent 796ba9a3
......@@ -2,7 +2,6 @@
"pages": [
"pages/mySpend/mySpend",
"pages/welcome/welcome",
"pages/memberOfOwn/memberOfOwn",
"pages/userCenter/userCenter",
"pages/memberRules/memberRules",
......
// component/noMore.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})
\ No newline at end of file
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
<!--component/noMore.wxml-->
<view class="detail-list-bottom">-已经到底啦-</view>
/* component/noMore.wxss */
.detail-list-bottom {
text-align: center;
font-size: 21rpx;
color: #bfbfbf;
margin-top: 45rpx;
}
\ No newline at end of file
......@@ -9,77 +9,69 @@ wxService.page({
* 页面的初始数据
*/
data: {
params: {
pageNo: '1',
pageSize: '10'
},
totalPages: ''
pageNo: 1,
pageSize: 10,
query: '',
totalPages: 0,
integralCouponList: [], // 积分兑换优惠券列表
noMore: false
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
},
onLoad: function (options) {},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
this.initIntegralCouponList()
this.initIntegralCouponList(this.data.pageNo, this.data.pageSize)
},
//获取消费列表
initIntegralCouponList(type) {
// 积分兑换优惠券列表
initIntegralCouponList(pageNo,pageSize) {
wx.showLoading({
title: '加载中'
})
wxService.get(`/coupon/pointsRedemptionCouponSetting/findPage?pageNo=${this.data.params.pageNo}&pageSize=${this.data.params.pageSize}`).then(res => {
let integralCouponList = [];
integralCouponList = this.data.params.pageNo == 1 ? res.data.data : this.data.integralCouponList.concat(res.data.data);
wxService.get(`/coupon/pointsRedemptionCouponSetting/findPage?pageNo=${pageNo}&pageSize=${pageSize}&query=${this.data.query}`).then(res => {
const {result,data} = res.data
if(result == 0){
wx.hideLoading()
this.setData({
integralCouponList,
totalPages: res.data.data.totalPages,
integralCouponList: this.data.pageNo == 1? [...data.content]: [...this.data.integralCouponList,...data.content],
totalPages: data.totalPages
})
wx.hideLoading();
if (type && type.pullDown) wx.stopPullDownRefresh();
}
}).finally(() => {
wx.hideLoading();
this.setData({
integralCouponList: ''
})
})
},
// 点击跳转至会员规则页
handleGoMemberRulesRules() {
wxService.router(`/pages/memberRules/memberRules`)
},
goCouponDetail(e) {
const {id} = e.currentTarget.dataset
wxService.router(`/pages/integralMallDetail/integralMallDetail?id=${id}`)
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
this.setData({
params: {
pageNo: 1,
pageSize: 10,
},
})
this.initIntegralCouponList({
pullDown: true
});
},
onPullDownRefresh: function () {},
/**
* 页面上拉触底事件的处理函数
*/
bindDownLoad: function () {
if (this.data.params.pageNo < this.data.totalPages) {
onReachBottom: function () {
if (this.data.pageNo < this.data.totalPages) {
this.setData({
params: {
pageNo: this.data.params.pageNo + 1,
pageSize: 10
},
loadDataDone: true
pageNo: this.data.pageNo + 1,
pageSize: 10,
noMore: true
})
this.initIntegralCouponList()
this.initIntegralCouponList(this.data.pageNo, this.data.pageSize)
}
},
})
\ No newline at end of file
{
"enablePullDownRefresh":true,
"navigationBarTitleText": "积分商城",
"usingComponents": {}
"usingComponents": {
"no-more": "/component/noMore/noMore"
}
}
\ No newline at end of file
<!--pages/userCenter.wxml-->
<view class='page-integral-mall'>
<navigator hover-class='none' url='/pages/memberRules/memberRules'> <view class='integral-vip-rules'>会员规则</view></navigator>
<scroll-view scroll-y bindscrolltolower="bindDownLoad">
<view class='coupon-wrap'>
<view class='coupon-list'>
<navigator hover-class='none' url='/pages/couponDetail/couponDetail'>
<view class='page-integral-mall' style="padding-bottom: 40rpx">
<view class='integral-vip-rules' wx:if="{{integralCouponList.length}}" bindtap="handleGoMemberRulesRules">会员规则</view>
<view class='coupon-wrap' wx:if="{{integralCouponList.length}}">
<view class='coupon-list' wx:for="{{integralCouponList}}" wx:for-item="item" wx:for-index="k" wx:key="{{k}}">
<image class='coupon-bg' src='/assets/imgs/coupon-bg.png'></image>
<view class='coupon-img'>
<image src='/assets/imgs/qr-code.png'></image>
</view>
<view class='coupon-info'>
<view class='coupon-name fs-28'>卡劵名称</view>
<view class='coupon-time fs-24'>时间</view>
<view class='coupon-desc fs-24'>查看详情</view>
<view class='coupon-name fs-28'>{{item.couponName}}</view>
<view class='coupon-time fs-24'>{{item.startTime}}</view>
<view class='coupon-desc fs-24' data-id="{{item.id}}" bindtap="goCouponDetail">查看详情</view>
</view>
<view class='coupon-code fs-24'>立即兑换</view>
</navigator>
</view>
<view class='coupon-list'>
<image class='coupon-bg' src='/assets/imgs/coupon-bg.png'></image>
<view class='coupon-img'>
<image src='/assets/imgs/qr-code.png'></image>
</view>
<view class='coupon-info'>
<view class='coupon-name fs-28'>卡劵名称</view>
<view class='coupon-time fs-24'>时间</view>
<view class='coupon-desc fs-24'>查看详情</view>
</view>
<view class='coupon-code fs-24'>出示劵码</view>
</view>
</view>
</scroll-view>
<view class='empty-wrap'>
<view class='empty-wrap' wx:if="{{!integralCouponList.length}}">
<view class='empty-info'>
<image class='empty-img' src='/assets/imgs/empty-coupon.png'></image>
<view class='empty-text'>没有任何卡劵</view>
</view>
</view>
<no-more wx:if="{{noMore}}"/>
</view>
......@@ -18,11 +18,7 @@ wxService.page({
pointsTotal: 2,
status: '交易成功',
themeArr: { count: '数量', name: '商品名称', price: '价格' },
itemArr: [
{ count: 1, name: '牛奶', price: 112 },
{ count: 2, name: '榛果', price: 5222 },
{ count: 2, name: '薯片', price: 124 },
],
itemArr: [],
orderDetail: {}
},
......
{
"navigationBarTitleText": "积分流水",
"usingComponents": {}
"usingComponents": {
"no-more": "/component/noMore/noMore"
}
}
\ No newline at end of file
......@@ -24,8 +24,7 @@
<view class="detail-num" wx:if="{{item.operation}}">+ {{item.changeValue}}</view>
<view class="detail-num minus" wx:if="{{!item.operation}}">- {{item.changeValue}}</view>
</view>
<view class="detail-list-bottom">-已经到底啦-</view>
<no-more />
</view>
</view>
</view>
......@@ -33,6 +33,7 @@
border-radius: 50rpx;
vertical-align:top;
margin-top: 25rpx;
margin-bottom: 40rpx;
}
.num-current {
font-size: 36rpx;
......@@ -78,15 +79,6 @@
padding: 0 60rpx 0 30rpx;
margin-bottom: 20rpx;
}
.detail-list-bottom {
text-align: center;
font-size: 21rpx;
color: #bfbfbf;
margin-top: 45rpx;
/* position: absolute; */
/* bottom: 28rpx; */
/* left: 45%; */
}
.detail-list-no {
font-size: 24rpx;
color: #333;
......
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