Commit 5c916155 by 高淑倩

Merge branch 'dev' of ssh://gitlab.bigaka.net:2287/gaoshq/7-Eleven into dev

parents a6226c87 a7c52287
...@@ -9,7 +9,11 @@ wxService.page({ ...@@ -9,7 +9,11 @@ wxService.page({
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
params: {
pageNo: '1',
pageSize: '10'
},
totalPages: ''
}, },
/** /**
...@@ -20,51 +24,62 @@ wxService.page({ ...@@ -20,51 +24,62 @@ wxService.page({
}, },
/** /**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow: function () { onShow: function () {
this.initIntegralCouponList()
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
}, },
/** //获取消费列表
* 生命周期函数--监听页面卸载 initIntegralCouponList(type) {
*/ wx.showLoading({
onUnload: function () { 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);
this.setData({
integralCouponList,
totalPages: res.data.data.totalPages,
})
wx.hideLoading();
if (type && type.pullDown) wx.stopPullDownRefresh();
}).finally(() => {
wx.hideLoading();
this.setData({
integralCouponList: ''
})
})
}, },
/** /**
* 页面相关事件处理函数--监听用户下拉动作 * 页面相关事件处理函数--监听用户下拉动作
*/ */
onPullDownRefresh: function () { onPullDownRefresh: function () {
this.setData({
params: {
pageNo: 1,
pageSize: 10,
},
})
this.initIntegralCouponList({
pullDown: true
});
}, },
/** /**
* 页面上拉触底事件的处理函数 * 页面上拉触底事件的处理函数
*/ */
onReachBottom: function () { bindDownLoad: function () {
if (this.data.params.pageNo < this.data.totalPages) {
this.setData({
params: {
pageNo: this.data.params.pageNo + 1,
pageSize: 10
}, },
loadDataDone: true
/** })
* 用户点击右上角分享 this.initIntegralCouponList()
*/
onShareAppMessage: function () {
} }
},
}) })
\ No newline at end of file
<!--pages/userCenter.wxml--> <!--pages/userCenter.wxml-->
<view class='page-integral-mall'> <view class='page-integral-mall'>
<navigator hover-class='none' url='/pages/memberRules/memberRules'> <view class='integral-vip-rules'>会员规则</view></navigator> <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-wrap'>
<view class='coupon-list'> <view class='coupon-list'>
<navigator hover-class='none' url='/pages/couponDetail/couponDetail'> <navigator hover-class='none' url='/pages/couponDetail/couponDetail'>
...@@ -29,6 +30,8 @@ ...@@ -29,6 +30,8 @@
<view class='coupon-code fs-24'>出示劵码</view> <view class='coupon-code fs-24'>出示劵码</view>
</view> </view>
</view> </view>
</scroll-view>
<view class='empty-wrap'> <view class='empty-wrap'>
<view class='empty-info'> <view class='empty-info'>
<image class='empty-img' src='/assets/imgs/empty-coupon.png'></image> <image class='empty-img' src='/assets/imgs/empty-coupon.png'></image>
......
...@@ -34,13 +34,6 @@ wxService.page({ ...@@ -34,13 +34,6 @@ wxService.page({
}, },
/** /**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow: function () { onShow: function () {
...@@ -48,38 +41,14 @@ wxService.page({ ...@@ -48,38 +41,14 @@ wxService.page({
console.log('options',options.memberid) console.log('options',options.memberid)
}, },
/** initOrderDetail(){
* 生命周期函数--监听页面隐藏 wxService.post(`/order/findById?id=${id}`).then(res => {
*/ this.setData({
onHide: function () { orderDetail:res.data.ddat.content
})
}, }).finally(() => {
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
})
} }
}) })
\ No newline at end of file
...@@ -12,19 +12,6 @@ wxService.page({ ...@@ -12,19 +12,6 @@ wxService.page({
}, },
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/** /**
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
...@@ -33,38 +20,15 @@ wxService.page({ ...@@ -33,38 +20,15 @@ wxService.page({
}, },
/** // 查询单个优惠券
* 生命周期函数--监听页面隐藏 getCouponDetail(){
*/ wxService.post(`/coupon/coupon/setting/get/${id}`).then(res => {
onHide: function () { this.setData({
couponDetail: res.data.data.content
}, })
}).finally(() => {
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
})
} }
}) })
\ No newline at end of file
...@@ -18,8 +18,20 @@ wxService.page({ ...@@ -18,8 +18,20 @@ wxService.page({
name:'已失效' name:'已失效'
} }
], ],
navIndex:'1' navIndex:'1',
params:{
pageNo:1,
pageSize:10
},
queryData:{
query:{
"brandId": 0,
"couponSettingId": 0,
"status": 0,
"title": ""
}
},
totalPages:''
}, },
/** /**
...@@ -34,13 +46,73 @@ wxService.page({ ...@@ -34,13 +46,73 @@ wxService.page({
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow: function () { onShow: function () {
this.queryData.setData({
'query.status': this.data.navIndex
})
this.getCouponList()
}, },
//切换tab //切换tab
switchTab(e){ switchTab(e){
this.setData({ this.setData({
navIndex: e.currentTarget.dataset.index navIndex: e.currentTarget.dataset.index,
'query.status': e.currentTarget.dataset.index
})
this.getCouponList()
},
//获取优惠券列表
getCouponList(type){
wx.showLoading({
title: '加载中'
})
this.queryData.setData({
'query.status': this.data.navIndex
})
wxService.post(`/coupon/coupon/setting/list?pageNo=${this.data.params.pageNo}&pageSize=${this.data.params.pageSize}`, this.queryData).then(res => {
let couponList = [];
couponList = this.data.params.pageNo == 1 ? res.data.data : this.data.couponList.concat(res.data.data);
this.setData({
couponList,
totalPages: res.data.data.totalPages,
})
wx.hideLoading();
if (type && type.pullDown) wx.stopPullDownRefresh();
}).finally(() => {
wx.hideLoading();
this.setData({
couponList: ''
})
}) })
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
this.setData({
params: {
pageNo: 1,
pageSize: 10,
},
})
this.getCouponList({
pullDown: true
});
},
/**
* 页面上拉触底事件的处理函数
*/
bindDownLoad: function () {
if (this.data.params.pageNo < this.data.totalPages) {
this.setData({
params: {
pageNo: this.data.params.pageNo + 1,
pageSize: 10
},
loadDataDone: true
})
this.getCouponList()
} }
},
}) })
\ No newline at end of file
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
<view class='tabs-wrap'> <view class='tabs-wrap'>
<view wx:for='{{nav}}' wx:key='{{index}}' class="tab-nav fs-25 {{navIndex == item.type ? 'nav-active' : ''}}" data-index='{{item.type}}' bindtap='switchTab'>{{item.name}}(0)</view> <view wx:for='{{nav}}' wx:key='{{index}}' class="tab-nav fs-25 {{navIndex == item.type ? 'nav-active' : ''}}" data-index='{{item.type}}' bindtap='switchTab'>{{item.name}}(0)</view>
</view> </view>
<scroll-view scroll-y bindscrolltolower="bindDownLoad">
<view class='coupon-wrap'> <view class='coupon-wrap'>
<view class='coupon-list'> <view class='coupon-list'>
<navigator hover-class='none' url='/pages/couponDetail/couponDetail'> <navigator hover-class='none' url='/pages/couponDetail/couponDetail'>
...@@ -41,4 +42,5 @@ ...@@ -41,4 +42,5 @@
<view class='empty-text'>没有任何卡劵</view> <view class='empty-text'>没有任何卡劵</view>
</view> </view>
</view> </view>
</scroll-view>
</view> </view>
...@@ -9,14 +9,6 @@ Page({ ...@@ -9,14 +9,6 @@ Page({
}, },
/** /**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
},
/**
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow: function () { onShow: function () {
...@@ -28,5 +20,16 @@ Page({ ...@@ -28,5 +20,16 @@ Page({
this.setData({ this.setData({
isExchange :true isExchange :true
}) })
},
//获取积分兑换优惠券详情
getIntegralCouponDetail(){
wxService.get(`/coupon/pointsRedemptionCouponSetting/get/${id}`).then(res => {
this.setData({
integralCouponDetail: res.data.data.content
})
}).finally(() => {
})
} }
}) })
\ No newline at end of file
...@@ -35,7 +35,7 @@ wxService.page({ ...@@ -35,7 +35,7 @@ wxService.page({
wx.showLoading({ wx.showLoading({
title: '加载中' title: '加载中'
}) })
wxService.post('/sale/order/list',this.data.params).then(res => { wxService.post(`/sale/order/list?pageNo=${this.data.params.pageNo}&pageSize=${this.data.params.pageSize}`,{}).then(res => {
let orderList = []; let orderList = [];
orderList = this.data.params.pageNo == 1 ? res.data.data : this.data.orderList.concat(res.data.data); orderList = this.data.params.pageNo == 1 ? res.data.data : this.data.orderList.concat(res.data.data);
this.setData({ this.setData({
......
<!--pages/userCenter.wxml--> <!--pages/userCenter.wxml-->
<view class='page-mySpend'> <view class='page-mySpend'>
<scroll-view scroll-y bindscrolltolower="bindDownLoad"> <scroll-view scroll-y bindscrolltolower="bindDownLoad">
<view class='spend-wrap'> <!-- <view class='spend-wrap' wx:for='{{orderList}}' wx:key='{{index}}'> -->
<navigator url='/pages/consumptionDetails/consumptionDetails' hover-class='none'> <navigator url='/pages/consumptionDetails/consumptionDetails' hover-class='none'>
<view class='spend-list'> <view class='spend-list'>
<view class='spend-id fs-22'>订单编号:8327878435</view> <view class='spend-id fs-22'>订单编号:{{item.orderId}}</view>
<view class='spend-time fs-25'>消费时间:</view> <view class='spend-time fs-25'>消费时间:{{item.createTime}}</view>
<view class='spend-shop fs-25'>消费门店:张江高科店</view> <view class='spend-shop fs-25'>消费门店:{{item.storeName}}</view>
<view class="spend-status fs-22 {{true ? 'fail-status' : ''}}">交易成功</view> <view class="spend-status fs-22 {{true ? 'fail-status' : ''}}">交易成功</view>
</view> </view>
</navigator> </navigator>
</view> <!-- </view> -->
<view class='spend-wrap'>
<view class='spend-list'>
<view class='spend-id fs-22'>订单编号:8327878435</view>
<view class='spend-time fs-25'>消费时间:</view>
<view class='spend-shop fs-25'>消费门店:张江高科店</view>
<view class='spend-status fs-22'>交易成功</view>
</view>
</view>
</scroll-view> </scroll-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