Commit ada8544e by 赵雅纹

bug修复

parent 9572c232
...@@ -130,7 +130,7 @@ ...@@ -130,7 +130,7 @@
<view> <view>
<text class="price-label">优惠券</text> <text class="price-label">优惠券</text>
<view class="select-coupon" bindtap="selectCoupon"> <view class="select-coupon" bindtap="selectCoupon">
<text class="{{defalutCoupon ? 'coupon-price' : 'no-coupon'}}"> {{defalutCoupon ? '-': '无可用优惠券'}}{{currentCoupon ? currentCoupon : defalutCoupon}}</text> <text class="{{defalutCoupon ? 'coupon-price' : 'no-coupon'}}"> {{defalutCoupon ? (currentCoupon ? '-' + currentCoupon : '-' + defalutCoupon): '无可用优惠券'}}</text>
<image class="arrow-right" src="/assets/imgs/7_1_0/arrow-right.png" /> <image class="arrow-right" src="/assets/imgs/7_1_0/arrow-right.png" />
</view> </view>
</view> </view>
......
...@@ -37,7 +37,10 @@ wxService.page({ ...@@ -37,7 +37,10 @@ wxService.page({
currentTab: current, currentTab: current,
}) })
} }
this.getContentList(current) this.setData({
pageNum: 1
})
this.getContentList(this.data.pageNum,current)
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
...@@ -115,10 +118,11 @@ wxService.page({ ...@@ -115,10 +118,11 @@ wxService.page({
if (result == 0) { if (result == 0) {
this.setData({ this.setData({
categoryList:data, categoryList:data,
pageNum: 1,
currentTab: data[0].id currentTab: data[0].id
}) })
this.getContentList(data[0].id) this.getContentList(this.data.pageNum,data[0].id)
} }
}).finally(() => { }).finally(() => {
...@@ -126,9 +130,9 @@ wxService.page({ ...@@ -126,9 +130,9 @@ wxService.page({
}, },
// 获取发现内容 // 获取发现内容
getContentList(classifyId){ getContentList(pageNum,classifyId){
const { memberId, member } = wx.getStorageSync('_baseUserInfo') const { memberId, member } = wx.getStorageSync('_baseUserInfo')
wxService.post(`/merchant/contentMobileTerminal/getContentList?pageNum=${this.data.pageNum}&pageSize=${this.data.pageSize}`, { wxService.post(`/merchant/contentMobileTerminal/getContentList?pageNum=${pageNum}&pageSize=${this.data.pageSize}`, {
classifyId: classifyId, classifyId: classifyId,
userId: memberId userId: memberId
}).then(res => { }).then(res => {
...@@ -137,9 +141,11 @@ wxService.page({ ...@@ -137,9 +141,11 @@ wxService.page({
if (result == 0 ) { if (result == 0 ) {
if (data.content){ if (data.content){
this.setData({ this.setData({
contentList: this.data.pageNum == 1 ? [...data.content] : [...this.data.contentList, ...data.content], contentList: pageNum == 1 ? [...data.content] : [...this.data.contentList, ...data.content],
totalPages: data.totalPages, totalPages: data.totalPages,
totalElements: data.totalElements totalElements: data.totalElements
},()=>{
console.log('666666',this.data.contentList)
}) })
}else{ }else{
this.setData({ this.setData({
...@@ -167,7 +173,10 @@ wxService.page({ ...@@ -167,7 +173,10 @@ wxService.page({
title: '点赞成功', title: '点赞成功',
icon: 'none' icon: 'none'
}) })
this.getContentList(this.data.currentTab) this.setData({
pageNum: 1
})
this.getContentList(this.data.pageNum,this.data.currentTab)
} }
}).finally(() => { }).finally(() => {
...@@ -185,7 +194,10 @@ wxService.page({ ...@@ -185,7 +194,10 @@ wxService.page({
title: '取消点赞成功', title: '取消点赞成功',
icon: 'none' icon: 'none'
}) })
this.getContentList(this.data.currentTab) this.setData({
pageNum: 1
})
this.getContentList(this.data.pageNum,this.data.currentTab)
} }
}).finally(() => { }).finally(() => {
...@@ -235,19 +247,20 @@ wxService.page({ ...@@ -235,19 +247,20 @@ wxService.page({
this.setData({ this.setData({
pageNum: 1, pageNum: 1,
}) })
this.getContentList(this.data.currentTab) this.getContentList(this.data.pageNum,this.data.currentTab)
wx.stopPullDownRefresh(); wx.stopPullDownRefresh();
}, },
/** /**
* 页面上拉触底事件的处理函数 * 页面上拉触底事件的处理函数
*/ */
onReachBottom: function () { onReachBottom: function () {
const { pageNum, pageSize, totalPages } = this.data const { pageNum, pageSize, totalPages } = this.data
if (pageNum < totalPages) { if (pageNum < totalPages) {
this.setData({ this.setData({
pageNum: pageNum + 1, pageNum: pageNum + 1,
}) })
this.getContentList(this.data.currentTab) this.getContentList(this.data.pageNum,this.data.currentTab)
} }
}, },
......
...@@ -15,7 +15,7 @@ wxService.page({ ...@@ -15,7 +15,7 @@ wxService.page({
categoryList: [], //分类 categoryList: [], //分类
baseImgUrl: app.globalData.imageUrl, baseImgUrl: app.globalData.imageUrl,
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 3,
totalPages: 0, totalPages: 0,
totalElements: 0, totalElements: 0,
currentTab: 0, currentTab: 0,
...@@ -45,8 +45,7 @@ wxService.page({ ...@@ -45,8 +45,7 @@ wxService.page({
this.generatePointObject(tentacleInfo); this.generatePointObject(tentacleInfo);
} }
//获取内容列表
this.getContentList();
}, },
/** /**
...@@ -68,6 +67,11 @@ wxService.page({ ...@@ -68,6 +67,11 @@ wxService.page({
this.getBannerInfo() this.getBannerInfo()
this.getContentPermission() this.getContentPermission()
this.data.currentShareContent = null; this.data.currentShareContent = null;
this.setData({
pageNum: 1
})
//获取内容列表
this.getContentList(this.data.pageNum);
}, },
...@@ -112,12 +116,12 @@ wxService.page({ ...@@ -112,12 +116,12 @@ wxService.page({
// 获取发现内容 // 获取发现内容
getContentList() { getContentList(pageNum) {
wx.showLoading({ wx.showLoading({
title: '加载中' title: '加载中'
}) })
const { memberId } = wx.getStorageSync('_baseUserInfo') const { memberId } = wx.getStorageSync('_baseUserInfo')
wxService.post(`/merchant/contentMobileTerminal/getContentList?pageNum=${this.data.pageNum}&pageSize=${this.data.pageSize}`, { wxService.post(`/merchant/contentMobileTerminal/getContentList?pageNum=${pageNum}&pageSize=${this.data.pageSize}`, {
userId: memberId userId: memberId
}).then(res => { }).then(res => {
wx.hideLoading() wx.hideLoading()
...@@ -126,7 +130,7 @@ wxService.page({ ...@@ -126,7 +130,7 @@ wxService.page({
if (result == 0) { if (result == 0) {
if (data.content) { if (data.content) {
this.setData({ this.setData({
contentList: this.data.pageNum == 1 ? [...data.content] : [...this.data.contentList, ...data.content], contentList: pageNum == 1 ? [...data.content] : [...this.data.contentList, ...data.content],
totalPages: data.totalPages, totalPages: data.totalPages,
totalElements: data.totalElements totalElements: data.totalElements
},() => { },() => {
...@@ -172,7 +176,10 @@ wxService.page({ ...@@ -172,7 +176,10 @@ wxService.page({
title: '点赞成功', title: '点赞成功',
icon: 'none' icon: 'none'
}) })
this.getContentList() this.setData({
pageNum: 1
})
this.getContentList(this.data.pageNum)
} }
}).finally(() => { }).finally(() => {
...@@ -190,7 +197,10 @@ wxService.page({ ...@@ -190,7 +197,10 @@ wxService.page({
title: '取消点赞成功', title: '取消点赞成功',
icon: 'none' icon: 'none'
}) })
this.getContentList() this.setData({
pageNum: 1
})
this.getContentList(this.data.pageNum)
} }
}).finally(() => { }).finally(() => {
...@@ -242,7 +252,7 @@ wxService.page({ ...@@ -242,7 +252,7 @@ wxService.page({
this.setData({ this.setData({
pageNum: 1, pageNum: 1,
}) })
this.getContentList(this.data.currentTab) this.getContentList(this.data.pageNum)
wx.stopPullDownRefresh(); wx.stopPullDownRefresh();
}, },
/** /**
...@@ -254,7 +264,7 @@ wxService.page({ ...@@ -254,7 +264,7 @@ wxService.page({
this.setData({ this.setData({
pageNum: pageNum + 1, pageNum: pageNum + 1,
}) })
this.getContentList(this.data.currentTab) this.getContentList(this.data.pageNum)
} }
}, },
/** /**
......
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