Files
tk-mini-program/pages/Home/Home.vue

120 lines
2.8 KiB
Vue
Raw Normal View History

2025-05-12 21:23:37 +08:00
<template>
<view class="page">
<image src="../../static/HomeBackground.png" class="HomeBackground"></image>
</view>
<view class="top-navigation-container">
<top-navigation></top-navigation>
</view>
2025-05-15 22:24:39 +08:00
<view class="Advertisement" @click="goAdvertisement">
2025-05-12 21:23:37 +08:00
<advertisement></advertisement>
</view>
2025-05-13 22:16:09 +08:00
<view class="contentList">
2025-05-12 21:23:37 +08:00
<contentList></contentList>
</view>
<view class="tabBar">
2025-05-12 22:19:21 +08:00
<tabBar></tabBar>
2025-05-12 21:23:37 +08:00
</view>
</template>
<script>
import topNavigation from "../../components/topNavigation/topNavigation";
import Advertisement from "../../components/Advertisement/Advertisement";
import contentList from "../../components/contentList/contentList";
2025-05-12 22:19:21 +08:00
import tabBar from "../../components/tabBar/tabBar";
2025-05-27 21:05:01 +08:00
import TUIlogin from "../../components/TUILogin.js";
import TencentCloudChat from "@tencentcloud/chat";
2025-05-30 22:04:45 +08:00
import { useCounterStore } from '@/stores/counter'
const counter = useCounterStore()
2025-05-12 21:23:37 +08:00
export default {
2025-05-27 21:05:01 +08:00
inject: ["$global"],
2025-05-12 21:23:37 +08:00
data() {
2025-05-27 21:05:01 +08:00
return {
info: {},
myuserSig: "",
chatInfo: {},
};
2025-05-12 21:23:37 +08:00
},
onLoad() {
2025-05-27 21:05:01 +08:00
uni.getStorage({
key: "userinfo",
success: (res) => {
this.info = res.data;
2025-05-30 22:04:45 +08:00
counter.$patch({ myitem:this.info})
2025-05-27 21:05:01 +08:00
uni.getStorage({
key: "myuserSig",
success: (res) => {
this.myuserSig = res.data;
uni.getStorage({
key: "chatInfo",
success: (res) => {
this.chatInfo = res.data;
TUIlogin(this.chatInfo.appId, this.info.id, this.myuserSig.userSig);
// let options = {
// SDKAppID: this.chatInfo.appId,
// };
// console.log("`````````````````````````````````````````", this.chatInfo);
// let chat = TencentCloudChat.create(options);
// console.log("chat````````````````````````````````````````", this.chat);
// chat.login({ userID: String(this.info.id), userSig: this.myuserSig.userSig });
},
});
},
});
},
});
2025-05-12 21:23:37 +08:00
},
methods: {
2025-05-27 21:05:01 +08:00
goAdvertisement() {
2025-05-22 16:21:07 +08:00
// this.$global.lastPage = getCurrentPages().router;
2025-05-27 21:05:01 +08:00
uni.navigateTo({ url: "/pages/pkDetail/pkDetail" });
},
2025-05-12 21:23:37 +08:00
},
components: {
topNavigation,
Advertisement,
2025-05-12 22:19:21 +08:00
contentList,
tabBar,
2025-05-12 21:23:37 +08:00
},
};
</script>
<style scoped>
.page {
position: relative;
width: 750rpx;
height: 1620rpx;
}
.HomeBackground {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: -1;
}
.top-navigation-container {
position: fixed;
top: 160rpx;
left: 0;
width: 100%;
height: 114.5rpx;
}
.Advertisement {
2025-05-13 22:16:09 +08:00
position: fixed;
top: 300rpx;
left: 0;
width: 100%;
height: 100rpx;
z-index: 100;
2025-05-12 21:23:37 +08:00
}
.contentList {
2025-05-13 22:16:09 +08:00
position: fixed;
2025-05-15 22:24:39 +08:00
top: 400rpx;
2025-05-13 22:16:09 +08:00
left: 0;
2025-05-22 16:21:07 +08:00
bottom: -30rpx;
2025-05-13 22:16:09 +08:00
width: 100%;
2025-05-21 22:52:33 +08:00
/* height: 1300rpx; */
2025-05-12 21:23:37 +08:00
}
</style>