From 2ec00e8b2b2fea62e935e29f8ab8b9f0f453afe3 Mon Sep 17 00:00:00 2001
From: zxl <763096477@qq.com>
Date: 星期四, 18 十二月 2025 17:17:56 +0800
Subject: [PATCH] 背景图
---
pages/tabbar/index/home.vue | 129 +++++++++++++++++++++++++++----------------
1 files changed, 81 insertions(+), 48 deletions(-)
diff --git a/pages/tabbar/index/home.vue b/pages/tabbar/index/home.vue
index 40b5fc1..11528ac 100644
--- a/pages/tabbar/index/home.vue
+++ b/pages/tabbar/index/home.vue
@@ -403,63 +403,72 @@
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)
- }
+ if (res.code === 200){
+ 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)
+ }
+ 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("绂诲紑椤甸潰寮�濮嬭褰�")
+ //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) {
@@ -474,6 +483,16 @@
console.log('缂撳瓨shareId鎴愬姛');
}
});
+ }
+ const shareId = uni.getStorageSync("shareId");
+ if(shareId){
+ let param = {
+ addType:"SHARE_USER_REGISTRY",
+ extend:"",
+ }
+ let extend = {shareId:shareId}
+ param.extend = JSON.stringify(extend)
+ addPrizeNum(param);
}
console.log('-----------鍒嗕韩鍑虹殑鏁版嵁---------->', option)
//澶勭悊鎵爜鍑烘潵鐨勮棰�
@@ -588,6 +607,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){
@@ -1919,19 +1947,21 @@
position: relative;
width: 100%;
height: 10px;
- background-color: rgba(255, 255, 255, 0.2);
- /* 鍗婇�忔槑鑳屾櫙 */
+ background-color: transparent;
+ /* 閫忔槑鑳屾櫙 */
overflow: hidden;
border-radius: 1.5px;
cursor: pointer;
transition: height 0.2s;
+ /* 娣诲姞padding-top鏉ユ墿澶цЕ鎽稿尯鍩� */
+ padding-top: 20px;
+ margin-top: -10px;
}
.progress-fill {
-
position: absolute;
left: 0;
- top: 0;
+ top: 10px;
height: 100%;
border-radius: 2px;
background-color: lightgray;
@@ -1943,6 +1973,9 @@
display: flex;
flex-direction: column;
align-items: center;
+ /* 娣诲姞padding-top鏉ユ墿澶цЕ鎽稿尯鍩� */
+ padding-top: 30px;
+ box-sizing: content-box;
}
.progress-text {
--
Gitblit v1.8.0