From 1ae423f71a056e06a1f8908c6ae048d865e8ff47 Mon Sep 17 00:00:00 2001
From: liukangdong <898885815@qq.com>
Date: 星期五, 26 七月 2024 11:43:43 +0800
Subject: [PATCH] b端
---
wechat_jiaxuan/pages/productVideo/index.js | 43 +++++++++++++++++++++++++++----------------
1 files changed, 27 insertions(+), 16 deletions(-)
diff --git a/wechat_jiaxuan/pages/productVideo/index.js b/wechat_jiaxuan/pages/productVideo/index.js
index 640bda1..4db093b 100644
--- a/wechat_jiaxuan/pages/productVideo/index.js
+++ b/wechat_jiaxuan/pages/productVideo/index.js
@@ -6,8 +6,9 @@
*/
data: {
category: [],
- activeCate: '',
- seActiveCate: '',
+ tagCodes: '',
+ videoUrl: '',
+ showVideo: false,
dataList: [],
total: 0,
@@ -15,19 +16,35 @@
pageNum: 1,
},
+ onReachBottom() {
+ console.log('瑙﹀簳浜嬩欢');
+ const { total, dataList, pageNum } = this.data
+ if(total > dataList.length){
+ this.setData({ pageNum: pageNum + 1 })
+ this.getList()
+ }else{
+ wx.showToast({
+ title: '鏆傛棤鏇村鏁版嵁',
+ icon: 'none'
+ })
+ }
+ },
getList() {
- const { pageSize, pageNum } = this.data
+ const { pageSize, pageNum, tagCodes } = this.data
getZhongTaiVideoPage({
- pageSize,pageNum
+ pageSize,pageNum, tagCodes: tagCodes ? [tagCodes] : null
}).then(res => {
- this.setData({ dataList: res.data.records })
+ this.setData({
+ dataList: [...this.data.dataList, ...res.data.records],
+ total: res.data.total
+ })
})
},
getTagList() {
getCataLogTagList({
catalogCode: 'video_rec'
}).then(res => {
- this.setData({ category: res.data.valueVos })
+ this.setData({ category: res.data })
})
},
itemClick(e) {
@@ -37,8 +54,10 @@
})
},
cateClick(e) {
- const { index } = e.target.dataset
- console.log(index);
+ const { code } = e.target.dataset
+ this.setData({ tagCodes: code })
+ this.setData({ total: 0, dataList: [], pageNum: 1 })
+ this.getList()
},
seCateClick(e) {
const { index } = e.target.dataset
@@ -83,14 +102,6 @@
onPullDownRefresh() {
},
-
- /**
- * 椤甸潰涓婃媺瑙﹀簳浜嬩欢鐨勫鐞嗗嚱鏁�
- */
- onReachBottom() {
-
- },
-
/**
* 鐢ㄦ埛鐐瑰嚮鍙充笂瑙掑垎浜�
*/
--
Gitblit v1.9.3