qsh 3 weeks ago
parent 0e6791a61f
commit 67cca9687e
  1. 12
      src/jtools/store/user.js
  2. 12
      src/pages.json
  3. 21
      src/pages/course/detail.vue

@ -1,7 +1,6 @@
import { defineStore } from 'pinia';
import { login, getInfo } from '@/jtools/api/login';
import storage from '@/jtools/storage';
import { queryUserMember } from '@/jtools/api/user';
const useUserStore = defineStore({
id: 'user',
@ -26,7 +25,6 @@ const useUserStore = defineStore({
this.isLogin = true;
this.token = resp.data.token;
this.userInfo = resp.data;
this.searchVip()
storage.set('isLogin', true);
storage.set('token', resp.data.token);
storage.set('userInfo', resp.data);
@ -62,20 +60,10 @@ const useUserStore = defineStore({
getInfo().then(resp => {
if (resp.code == '0000') {
this.userInfo = resp.data;
this.searchVip()
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) {
this.userInfo = info;
},

@ -9,12 +9,6 @@
"navigationStyle": "custom"
}
},
{
"path": "pages/choseCity/choseCity",
"style": {
"navigationStyle": "custom"
}
},
{
"path": "pages/me/index",
"style": {
@ -51,12 +45,6 @@
"navigationBarTitleText": "我的收藏"
}
},
{
"path": "pages/me/look",
"style": {
"navigationBarTitleText": "我的关注"
}
},
{
"path": "pages/me/login",
"style": {

@ -1,6 +1,13 @@
<template>
<view class="bc-fff p10 relative">
<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="btn">
@ -27,12 +34,16 @@
chapterInfo: {
content: "",
goodCount: 0,
collectCount: 0
collectCount: 0,
},
showMask: false
}
},
onLoad(op) {
this.getInfo(op.id);
if(!this.userInfo.memberInfo && !this.showMask) {
this.showMask = true;
}
},
methods: {
getInfo(chapterId) {
@ -74,6 +85,12 @@
});
}
});
},
toMe() {
uni.switchTab({
url: '/pages/me/index'
});
this.showMask = false;
}
}
}
@ -98,7 +115,7 @@
padding: 5px;
border: 1px solid #333;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
opacity: 0.6;
opacity: 0.7;
}
}
</style>
Loading…
Cancel
Save