Commit b7803f94 by 赵雅纹

Merge branch 'fixbug-ZYW' into 'dev_7.1.0'

bug修复

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