Commit e0e3a40f authored by Mac's avatar Mac

登录判断

parent b0b1177e
......@@ -168,18 +168,21 @@
</view>
</view>
</scroll-view>
<auth v-if="showAuth" @changeuserinfo="reloadUserinfo" @gbAuth= 'gbAuth'></auth>
</view>
</template>
<script>
import auth from "../../../components/auth/index.vue";
import hParse from "@/components/u-parse/parse.vue";
export default {
components: {
auth,
hParse
},
data() {
return {
showAuth:false,
ID:0,
details:{},
typeList: [{
......@@ -311,6 +314,14 @@
}
},
getlove(){
this.u = uni.getStorageSync("mall_UserInfo");
if (!this.u) {
this.u = {
nickName: "未登录",
avatarUrl: ""
};
this.showAuth = true;
} else{
this.request2(
{
url: '/api/AppletTrade/GetCollect',
......@@ -327,6 +338,17 @@
}
);
}
},
reloadUserinfo() {
this.u = uni.getStorageSync("mall_UserInfo");
this.showAuth=false;
this.getlove();
},
//关闭登录窗口
gbAuth(){
this.showAuth=false
},
}
}
......
......@@ -167,13 +167,20 @@
</view>
</view>
</scroll-view>
<auth v-if="showAuth" @changeuserinfo="reloadUserinfo" @gbAuth= 'gbAuth'></auth>
</view>
</template>
<script>
import auth from "../../../components/auth/index.vue";
export default {
components: {
auth,
},
data() {
return {
showAuth:false,
id:0,
imgsList: [],
typeList: [{
......@@ -329,7 +336,14 @@
},
// 关注与取消关注
follow(){
console.log("follow")
this.u = uni.getStorageSync("mall_UserInfo");
if (!this.u) {
this.u = {
nickName: "未登录",
avatarUrl: ""
};
this.showAuth = true;
} else{
let that=this
let parms = {
url: "/api/AppletTrade/GetCollect",
......@@ -346,6 +360,18 @@
}
})
}
},
reloadUserinfo() {
this.u = uni.getStorageSync("mall_UserInfo");
this.showAuth=false;
this.follow();
},
//关闭登录窗口
gbAuth(){
this.showAuth=false
},
},
mounted() {
this.getDetail()
......
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