Commit 0b22b10b authored by Mac's avatar Mac

2个列表的登录处理

parent 74303c63
...@@ -122,6 +122,7 @@ ...@@ -122,6 +122,7 @@
</view> </view>
</view> </view>
</u-col> </u-col>
</u-row> </u-row>
<u-loadmore <u-loadmore
:status="status" :status="status"
...@@ -131,7 +132,7 @@ ...@@ -131,7 +132,7 @@
:margin-bottom="20" :margin-bottom="20"
bg-color="#f6f6f6" bg-color="#f6f6f6"
/> />
<!-- <view style="width: 100%;height: 30px;"></view> --> <view style="width: 100%;height: 30px;"></view>
</scroll-view> </scroll-view>
</view> </view>
<auth v-if="showAuth" @changeuserinfo="reloadUserinfo" @gbAuth="gbAuth" ></auth> <auth v-if="showAuth" @changeuserinfo="reloadUserinfo" @gbAuth="gbAuth" ></auth>
...@@ -246,17 +247,17 @@ export default { ...@@ -246,17 +247,17 @@ export default {
if (options && options.id) { if (options && options.id) {
this.msg.BrandClassId = options.id; this.msg.BrandClassId = options.id;
} }
this.u = uni.getStorageSync("mall_UserInfo"); // this.u = uni.getStorageSync("mall_UserInfo");
if (!this.u) { // if (!this.u) {
this.u = { // this.u = {
nickName: "未登录", // nickName: "未登录",
avatarUrl: "", // avatarUrl: "",
}; // };
this.showAuth = true; // this.showAuth = true;
} else { // } else {
this.GetBrandClassList(); this.GetBrandClassList();
this.getPrizeList(); this.getPrizeList();
} // }
}, },
...@@ -351,19 +352,19 @@ export default { ...@@ -351,19 +352,19 @@ export default {
}); });
}, },
searchHandler(val) { searchHandler(val) {
this.u = uni.getStorageSync("mall_UserInfo"); // this.u = uni.getStorageSync("mall_UserInfo");
if (!this.u) { // if (!this.u) {
this.u = { // this.u = {
nickName: "未登录", // nickName: "未登录",
avatarUrl: "", // avatarUrl: "",
}; // };
this.showAuth = true; // this.showAuth = true;
} else { // } else {
this.msg.BrandName = val; this.msg.BrandName = val;
this.msg.pageIndex = 1; this.msg.pageIndex = 1;
this.g = []; this.g = [];
this.init(); this.init();
} // }
}, },
getPrizeList() { getPrizeList() {
......
...@@ -306,17 +306,17 @@ export default { ...@@ -306,17 +306,17 @@ export default {
if (options && options.FirstStoreTest) { if (options && options.FirstStoreTest) {
this.msg.FirstStoreTest = parseInt(options.FirstStoreTest); this.msg.FirstStoreTest = parseInt(options.FirstStoreTest);
} }
this.u = uni.getStorageSync("mall_UserInfo"); // this.u = uni.getStorageSync("mall_UserInfo");
if (!this.u) { // if (!this.u) {
this.u = { // this.u = {
nickName: "未登录", // nickName: "未登录",
avatarUrl: "", // avatarUrl: "",
}; // };
this.showAuth = true; // this.showAuth = true;
} else { // } else {
this.getTypeList(); this.getTypeList();
this.isauth = true this.isauth = true
} // }
......
...@@ -67,7 +67,7 @@ ...@@ -67,7 +67,7 @@
</style> </style>
<template> <template>
<view class="koraNews"> <view class="koraNews">
<view class="koraNewsSearch"> <view class="koraNewsSearch" v-if="isauth">
<u-search <u-search
action-text="搜索" action-text="搜索"
:clearabled="true" :clearabled="true"
...@@ -157,14 +157,17 @@ ...@@ -157,14 +157,17 @@
/> />
</scroll-view> </scroll-view>
<tabbars></tabbars> <tabbars></tabbars>
<auth v-if="showAuth" @changeuserinfo="reloadUserinfo" @gbAuth="gbAuth" ></auth>
</view> </view>
</template> </template>
<script> <script>
import tabbars from "@/components/tabbar/index"; import tabbars from "@/components/tabbar/index";
import auth from "@/components/auth/index.vue";
export default { export default {
components: { components: {
tabbars, tabbars,
auth
}, },
data() { data() {
return { return {
...@@ -175,6 +178,9 @@ export default { ...@@ -175,6 +178,9 @@ export default {
Title: "", Title: "",
// Type:1 // Type:1
}, },
showAuth:false,
u:{},
isauth:false,
pageCount: 1, pageCount: 1,
dataList: [], dataList: [],
loadText: { loadText: {
...@@ -249,10 +255,31 @@ export default { ...@@ -249,10 +255,31 @@ export default {
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title: this.pageTitle, title: this.pageTitle,
}); });
this.getList(1); this.u = uni.getStorageSync("mall_UserInfo");
this.getCommpanyStatus(); if (!this.u) {
this.u = {
nickName: "未登录",
avatarUrl: "",
};
this.showAuth = true;
} else {
this.getList(1);
this.getCommpanyStatus();
this.isauth = true
}
}, },
methods: { methods: {
reloadUserinfo() {
this.u = uni.getStorageSync("mall_UserInfo");
this.getList(1);
this.getCommpanyStatus();
this.isauth = true
},
//关闭登录窗口
gbAuth() {
this.showAuth = false
},
//获取数据 //获取数据
getList(num) { getList(num) {
if (num == 1) { if (num == 1) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment