From 206dafd796fa6c5a4598a78c8110409555a757d8 Mon Sep 17 00:00:00 2001
From: zxl <763096477@qq.com>
Date: 星期二, 13 一月 2026 10:16:54 +0800
Subject: [PATCH] 图片资源
---
pages/tabbar/index/home.vue | 114 ++++++++++++++++++++++++++++++++++-----------------------
1 files changed, 68 insertions(+), 46 deletions(-)
diff --git a/pages/tabbar/index/home.vue b/pages/tabbar/index/home.vue
index fab411f..d38ceb0 100644
--- a/pages/tabbar/index/home.vue
+++ b/pages/tabbar/index/home.vue
@@ -402,69 +402,82 @@
},
onShow() {
getSessionId().then(res=>{
- console.log('res',JSON.stringify(res))
- this.pageSessionNo = res.data.data
- if(this.pageSessionNo){
- let param = Object.assign({},this.actionParam);
- this.actionParam.sessionId = this.pageSessionNo
- param.sessionId = this.pageSessionNo
- userAction(param)
- }
+ console.log('鎵ц浜唎nshow')
+ if (res.statusCode === 200){
+ this.pageSessionNo = res.data.data
+ if(this.pageSessionNo){
+ let param = Object.assign({},this.actionParam);
+ console.log("鎵撳嵃param",param)
+ this.actionParam.sessionId = this.pageSessionNo
+ console.log("鎵撳嵃this.actionParam",this.actionParam)
+ param.sessionId = this.pageSessionNo
+ userAction(param)
+ }
+ this.getONPrizeActivity()
+ let showPopup = storage.getPopupShow();
+ console.log(showPopup)
+ if (showPopup) {
+ console.log("棣栨鎵撳紑锛屾樉绀哄脊绐�");
+ storage.setPopupShow(true); // 鏍囪涓哄凡鏄剧ず
+ } else {
+ console.log("宸叉樉绀鸿繃锛屼笉寮圭獥");
+ }
+ if(showPopup){
+ this.openActivityPopup()
+ }
+ if (!this.userId) {
+ this.getUserId()
+ }
+ // const token = storage.getAccessToken();
+ // if (! token) {
+ // this.wxSilentLogin(() => {
+ // this.loadVideos();
+ // })
+ // } else {
+ // this.loadVideos();
+ // }
+ if (this.videoList.length < 1) {
+ this.loading = false;
+ this.videoNoMore = false;
+ console.log('瑙﹀彂鏁版嵁鍔犺浇')
+ this.loadVideos();
+ }
+ // 濡傛灉瑙嗛鎸変笅鏆傚仠鍚庡垏鎹㈤〉闈㈠啀鍥炲埌椤甸潰鏃讹紝鍙畻鏆傚仠鏃堕棿锛堝洜涓烘殏鍋滄椂闂村拰绂诲紑椤甸潰鏃堕棿鏄噸澶嶇殑锛屽彧绠椾竴涓級
+ if (this.startHidenTime !== 0 && this.currentVideoIsPlaying) {
+ const duration = Date.now() - this.startHidenTime
+ this.totalHidenTime += duration
+ }
+
+
+ }
+
})
- this.getONPrizeActivity()
- let showPopup = storage.getPopupShow();
- console.log(showPopup)
- if (showPopup) {
- console.log("棣栨鎵撳紑锛屾樉绀哄脊绐�");
- storage.setPopupShow(true); // 鏍囪涓哄凡鏄剧ず
- } else {
- console.log("宸叉樉绀鸿繃锛屼笉寮圭獥");
- }
- if(showPopup){
- this.openActivityPopup()
- }
-
-
- if (!this.userId) {
- this.getUserId()
- }
- // const token = storage.getAccessToken();
- // if (! token) {
- // this.wxSilentLogin(() => {
- // this.loadVideos();
- // })
- // } else {
- // this.loadVideos();
- // }
- if (this.videoList.length < 1) {
- this.loading = false;
- this.videoNoMore = false;
- console.log('瑙﹀彂鏁版嵁鍔犺浇')
- this.loadVideos();
- }
- // 濡傛灉瑙嗛鎸変笅鏆傚仠鍚庡垏鎹㈤〉闈㈠啀鍥炲埌椤甸潰鏃讹紝鍙畻鏆傚仠鏃堕棿锛堝洜涓烘殏鍋滄椂闂村拰绂诲紑椤甸潰鏃堕棿鏄噸澶嶇殑锛屽彧绠椾竴涓級
- if (this.startHidenTime !== 0 && this.currentVideoIsPlaying) {
- const duration = Date.now() - this.startHidenTime
- this.totalHidenTime += duration
- }
},
onUnload() {
let param = Object.assign({},this.actionParam);
if (this.sendOnShow)return
param.pageStatus = "LEAVE"
- userAction(param)
+ // if (this.isNotEmpty(param.sessionId)){
+ console.log(param)
+ console.log("onUnload绂诲紑椤甸潰寮�濮嬭褰�")
+ //TODO 椤甸潰鍒锋柊 瀵艰嚧onshow鏈墽琛岋紝瀵艰嚧sessionId鏈祴鍊�
+ userAction(param)
+ // }
+
},
onHide() {
this.startHidenTime = Date.now()
let param = Object.assign({},this.actionParam);
this.sendOnShow = true;
param.pageStatus = "LEAVE"
+ console.log("鎵цonHide鐨剈serAction")
userAction(param)
},
onLoad(option) {
+ console.log('瑙﹀彂onLoad')
if(option.shareId){
- console.log('瑙﹀彂onLoad')
+
this.actionParam.shareId = option.shareId;
this.actionParam.joinType = 'SHARE'
uni.setStorage({
@@ -598,6 +611,15 @@
});
},
methods: {
+ isNotEmpty(value) {
+ if (value === null || value === undefined) {
+ return false;
+ }
+ if (typeof value === 'string') {
+ return value.trim() !== '';
+ }
+ return true;
+ },
getONPrizeActivity(){
getONPrizeActivity().then(res =>{
if(res.statusCode=== 200){
--
Gitblit v1.8.0