|
@@ -320,27 +320,28 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
async onShow() {
|
|
|
- // console.log('-----couIndex', this.couIndex, this.courseId)
|
|
|
+ console.log('-----couIndex', this.couIndex, this.courseId, this.courseName)
|
|
|
this.getInfo() // 判断有没有关注公众号
|
|
|
this.isClickOff() //关注公众号,每天最多显示1次;当天学员关闭弹窗后,无需再显示
|
|
|
uni.removeStorageSync('goPath')
|
|
|
|
|
|
- if (this.courseId || this.bankId) {
|
|
|
- if (this.tabNum == 0) {
|
|
|
- this.list1 = []
|
|
|
- this.paramList[0].pageNum = 1
|
|
|
- this.list1 = await this.getGoodsList(this.courseId, 0)
|
|
|
- } else {
|
|
|
- this.list2 = []
|
|
|
- this.paramList[1].pageNum = 1
|
|
|
- this.list2 = await this.getGoodsList(this.bankId, 1)
|
|
|
- }
|
|
|
- } else {
|
|
|
+ // if (this.courseId || this.bankId) {
|
|
|
+ // if (this.tabNum == 0) {
|
|
|
+ // this.list1 = []
|
|
|
+ // this.paramList[0].pageNum = 1
|
|
|
+ // this.list1 = await this.getGoodsList(this.courseId, 0)
|
|
|
+ // } else {
|
|
|
+ // this.list2 = []
|
|
|
+ // this.paramList[1].pageNum = 1
|
|
|
+ // this.list2 = await this.getGoodsList(this.bankId, 1)
|
|
|
+ // }
|
|
|
+ // } else {
|
|
|
this.list1 = []
|
|
|
this.list2 = []
|
|
|
+ this.paramList[0].pageNum = 1
|
|
|
+ this.paramList[1].pageNum = 1
|
|
|
this.courseLists()
|
|
|
- }
|
|
|
- // this.bankList();
|
|
|
+ // }
|
|
|
if (uni.getStorageSync('updateHome')){
|
|
|
this.init()
|
|
|
uni.removeStorageSync('updateHome'); //消费首页刷新事件
|
|
@@ -381,9 +382,6 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
async onReachBottom() {
|
|
|
- // console.log('加载加载--', this.tabNum)
|
|
|
- // console.log(this.paramList[0].total,'total', this.paramList[1].total)
|
|
|
- // console.log(this.list1.length,'length', this.list2.length)
|
|
|
if (this.tabNum == 0) {
|
|
|
if (this.list1.length < this.paramList[0].total) {
|
|
|
this.paramList[0].pageNum++
|
|
@@ -631,28 +629,21 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
if (this.courseName.length) {
|
|
|
+ let courseId = this.courseId ? this.courseId : this.courseName[0].recommendId
|
|
|
this.courseId = this.courseName[0].recommendId
|
|
|
- let list1 = await this.getGoodsList(this.courseName[0].recommendId, 0)
|
|
|
+ let list1 = await this.getGoodsList(courseId, 0)
|
|
|
this.list1.push(...list1)
|
|
|
}
|
|
|
|
|
|
if (this.bankName.length) {
|
|
|
+ let bankId = this.bankId ? this.bankId : this.bankName[0].recommendId
|
|
|
this.bankId = this.bankName[0].recommendId
|
|
|
- let list2 = await this.getGoodsList(this.bankName[0].recommendId, 1)
|
|
|
+ let list2 = await this.getGoodsList(bankId, 1)
|
|
|
this.list2.push(...list2)
|
|
|
}
|
|
|
|
|
|
}
|
|
|
});
|
|
|
- // this.$api.goodsList(param).then(res => {
|
|
|
- // if (res.data.code == 200) {
|
|
|
- // this.list1 = res.data.rows || []
|
|
|
- // this.total1 = res.data.total
|
|
|
- // if (this.list1.length === res.data.total) {
|
|
|
- // this.showStatus1 = true
|
|
|
- // }
|
|
|
- // }
|
|
|
- // });
|
|
|
},
|
|
|
getGoodsList(recommendId, num) {
|
|
|
return new Promise((resolve, reject) => {
|