sc
This commit is contained in:
@@ -1,7 +1,6 @@
|
|||||||
import { defineStore } from 'pinia';
|
import { defineStore } from 'pinia';
|
||||||
import { login, getInfo } from '@/jtools/api/login';
|
import { login, getInfo } from '@/jtools/api/login';
|
||||||
import storage from '@/jtools/storage';
|
import storage from '@/jtools/storage';
|
||||||
import { queryUserMember } from '@/jtools/api/user';
|
|
||||||
|
|
||||||
const useUserStore = defineStore({
|
const useUserStore = defineStore({
|
||||||
id: 'user',
|
id: 'user',
|
||||||
@@ -26,7 +25,6 @@ const useUserStore = defineStore({
|
|||||||
this.isLogin = true;
|
this.isLogin = true;
|
||||||
this.token = resp.data.token;
|
this.token = resp.data.token;
|
||||||
this.userInfo = resp.data;
|
this.userInfo = resp.data;
|
||||||
this.searchVip()
|
|
||||||
storage.set('isLogin', true);
|
storage.set('isLogin', true);
|
||||||
storage.set('token', resp.data.token);
|
storage.set('token', resp.data.token);
|
||||||
storage.set('userInfo', resp.data);
|
storage.set('userInfo', resp.data);
|
||||||
@@ -62,20 +60,10 @@ const useUserStore = defineStore({
|
|||||||
getInfo().then(resp => {
|
getInfo().then(resp => {
|
||||||
if (resp.code == '0000') {
|
if (resp.code == '0000') {
|
||||||
this.userInfo = resp.data;
|
this.userInfo = resp.data;
|
||||||
this.searchVip()
|
|
||||||
storage.set('userInfo', resp.data);
|
storage.set('userInfo', resp.data);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
searchVip() {
|
|
||||||
queryUserMember({ userId: this.userInfo.userId }).then(resp => {
|
|
||||||
if (resp.code == '0000') {
|
|
||||||
// this.vipInfo = resp.data;
|
|
||||||
console.log(resp);
|
|
||||||
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
setUserInfo(info) {
|
setUserInfo(info) {
|
||||||
this.userInfo = info;
|
this.userInfo = info;
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -9,12 +9,6 @@
|
|||||||
"navigationStyle": "custom"
|
"navigationStyle": "custom"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"path": "pages/choseCity/choseCity",
|
|
||||||
"style": {
|
|
||||||
"navigationStyle": "custom"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"path": "pages/me/index",
|
"path": "pages/me/index",
|
||||||
"style": {
|
"style": {
|
||||||
@@ -51,12 +45,6 @@
|
|||||||
"navigationBarTitleText": "我的收藏"
|
"navigationBarTitleText": "我的收藏"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"path": "pages/me/look",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "我的关注"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"path": "pages/me/login",
|
"path": "pages/me/login",
|
||||||
"style": {
|
"style": {
|
||||||
|
|||||||
@@ -1,6 +1,13 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="bc-fff p10 relative">
|
<view class="bc-fff p10 relative">
|
||||||
<u-parse :content="chapterInfo.content"></u-parse>
|
<u-parse :content="chapterInfo.content"></u-parse>
|
||||||
|
<u-overlay :show="showMask" opacity="0.75">
|
||||||
|
<view class="p20 flex ai-c jc-c fld-c hp100" @tap="toMe" @scroll0.stop>
|
||||||
|
<u-icon name="lock" size="60" color="#999"></u-icon>
|
||||||
|
<view class="fs18 cor-999 mt20">请开通会员后继续学习</view>
|
||||||
|
<view class="fs14 cor-999 mt10">前往“我的”联系客服开通会员</view>
|
||||||
|
</view>
|
||||||
|
</u-overlay>
|
||||||
<!-- 右下角点赞收藏 -->
|
<!-- 右下角点赞收藏 -->
|
||||||
<view class="btns">
|
<view class="btns">
|
||||||
<view class="btn">
|
<view class="btn">
|
||||||
@@ -27,12 +34,16 @@
|
|||||||
chapterInfo: {
|
chapterInfo: {
|
||||||
content: "",
|
content: "",
|
||||||
goodCount: 0,
|
goodCount: 0,
|
||||||
collectCount: 0
|
collectCount: 0,
|
||||||
},
|
},
|
||||||
|
showMask: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad(op) {
|
onLoad(op) {
|
||||||
this.getInfo(op.id);
|
this.getInfo(op.id);
|
||||||
|
if(!this.userInfo.memberInfo && !this.showMask) {
|
||||||
|
this.showMask = true;
|
||||||
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getInfo(chapterId) {
|
getInfo(chapterId) {
|
||||||
@@ -74,6 +85,12 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
},
|
||||||
|
toMe() {
|
||||||
|
uni.switchTab({
|
||||||
|
url: '/pages/me/index'
|
||||||
|
});
|
||||||
|
this.showMask = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -98,7 +115,7 @@
|
|||||||
padding: 5px;
|
padding: 5px;
|
||||||
border: 1px solid #333;
|
border: 1px solid #333;
|
||||||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
|
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
|
||||||
opacity: 0.6;
|
opacity: 0.7;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
Reference in New Issue
Block a user