From f8b256ef152e54c19adb85856f62432d59c16b6e Mon Sep 17 00:00:00 2001
From: DESKTOP-CVS3R96\我恁爹 <11>
Date: Mon, 14 Nov 2022 19:00:29 +0800
Subject: [PATCH] wener~
---
src/page/home/home.vue | 34 +++++++++++++++++++++++++++-------
1 files changed, 27 insertions(+), 7 deletions(-)
diff --git a/src/page/home/home.vue b/src/page/home/home.vue
index d315425..70d22f2 100644
--- a/src/page/home/home.vue
+++ b/src/page/home/home.vue
@@ -210,13 +210,10 @@
</div>
</div>
<!-- tab -->
-
<GoToLogin v-show="isGoTo" />
</div>
</template>
-
<script>
-
import AllList from "@/page/list/list-all";
import HomeList from "./components/home-list";
import Echart from "./components/echart.vue";
@@ -236,13 +233,12 @@
import banner3 from "@/assets/img/b3.png";
// import indexData from "./data.json";
import GoToLogin from '@/page/home/components/GoLogin.vue';
-
export default {
components: {
HomeList,
AllList,
GoToLogin,
- Echart
+ Echart,
},
props: {},
data() {
@@ -292,11 +288,22 @@
newsContent4: [],
onlineService: "",
isGoTo: false,
- bannerList:[]
+ bannerList:[],
+ userInfo: [],
};
},
methods: {
-
+
+ async getUserInfo() {
+ // 获取用户信息
+ let data = await api.getUserInfo();
+ if (data.status === 0) {
+ // 判断是否登录
+ this.$store.state.userInfo = data.data;
+ this.userInfo = data.data;
+ } else {
+ }
+ },
getHuo() {
//123随机
var num = Math.floor(Math.random() * 3 + 1);
@@ -313,6 +320,10 @@
}
},
goDetail(item) {
+ if(this.userInfo.length==0){
+ this.$store.commit('dialogVisible',true);
+ return;
+ }
this.$router.push({
path: "/kline",
query: {
@@ -333,6 +344,10 @@
}
},
goJy(index){
+ if(this.userInfo.length==0){
+ this.$store.commit('dialogVisible',true);
+ return;
+ }
switch (index) {
case 0:
this.$router.push('/trading-list');
@@ -349,6 +364,10 @@
default:
break;
+ }
+ if (navigator.vibrate) {
+ // 支持
+ navigator.vibrate([55]);
}
},
async getBanner () {
@@ -463,6 +482,7 @@
this.ProcessData();
},
mounted() {
+ this.getUserInfo();
this.getInfoSite();
this.getNewsList(1);
this.getNewsList(2);
--
Gitblit v1.9.3