|
@@ -12,19 +12,19 @@
|
|
|
</view>
|
|
|
|
|
|
<view class="my-num-box">
|
|
|
- <view class="num-item-box">
|
|
|
+ <view class="num-item-box" @click="goToPage('ks')">
|
|
|
<uni-badge class="uni-badge-left-margin my-num-badge" v-if="myInfoData.kaoshiCount"
|
|
|
:customStyle="{background: '#ff2527'}" :text="myInfoData.kaoshiCount" />
|
|
|
<icon class="ks-icon"></icon>
|
|
|
<text class="num-title">考试管理</text>
|
|
|
</view>
|
|
|
- <view class="num-item-box">
|
|
|
+ <view class="num-item-box" @click="goToPage('lx')">
|
|
|
<uni-badge class="uni-badge-left-margin my-num-badge" v-if="myInfoData.lianxiCount"
|
|
|
:customStyle="{background: '#ff2527'}" :text="myInfoData.lianxiCount" />
|
|
|
<icon class="lx-icon"></icon>
|
|
|
<text class="num-title">练习管理</text>
|
|
|
</view>
|
|
|
- <view class="num-item-box">
|
|
|
+ <view class="num-item-box" @click="goToPage('kc')">
|
|
|
<uni-badge class="uni-badge-left-margin my-num-badge" v-if="myInfoData.kechengCount"
|
|
|
:customStyle="{background: '#ff2527'}" :text="myInfoData.kechengCount" />
|
|
|
<icon class="kc-icon"></icon>
|
|
@@ -33,11 +33,11 @@
|
|
|
</view>
|
|
|
|
|
|
<view class="my-list-box">
|
|
|
- <view class="list-row" @click="telClick">
|
|
|
+ <view class="list-row" @click="goToPage('grcj')">
|
|
|
<icon class="list-icon user-icon"></icon>
|
|
|
<text>修改个人信息</text>
|
|
|
</view>
|
|
|
- <view class="list-row" @click="checkWrong">
|
|
|
+ <view class="list-row" @click="goToPage('cj')">
|
|
|
<icon class="list-icon score-icon"></icon>
|
|
|
<text>成绩列表</text>
|
|
|
</view>
|
|
@@ -48,14 +48,18 @@
|
|
|
</view>
|
|
|
<!-- 底部区域 -->
|
|
|
<customTabbarClient></customTabbarClient>
|
|
|
+ <common-dialog ref="commonDialogRef" :title="exitTitle" :content="exitContent"@confirm-btn="exitBtn"></common-dialog>
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
+ import {toast} from "@/utils/common";
|
|
|
import {onLoad} from '@dcloudio/uni-app';
|
|
|
- import {getMineUser,getMineInfo} from '@/api/my.js'
|
|
|
+ import cacheManager from '@/utils/cacheManager.js';
|
|
|
+ import {getMineUser,getMineInfo,getMineLogout} from '@/api/my.js'
|
|
|
import {reactive,ref} from "vue";
|
|
|
import customTabbarClient from "@/components/custom-tabbar/custom-tabbar-client.vue"
|
|
|
+ import commonDialog from '@/components/dialog/commonDialog.vue';
|
|
|
let myInfoData = reactive({
|
|
|
userImg: '',
|
|
|
userName: '',
|
|
@@ -64,10 +68,43 @@
|
|
|
kechengCount: '',
|
|
|
lianxiCount: '',
|
|
|
});
|
|
|
+ const commonDialogRef = ref(null);
|
|
|
+ const exitContent = '你确定要执行这个操作吗?';
|
|
|
+ const exitTitle = '退出登录';
|
|
|
function getMyInit() {
|
|
|
getUserInfo();
|
|
|
getNumInfo();
|
|
|
}
|
|
|
+ // 获取用户头像
|
|
|
+ function goToPage(data){
|
|
|
+ switch (data) {
|
|
|
+ case 'ks':
|
|
|
+ uni.redirectTo({
|
|
|
+ url:'/pages/client/Kaoshi/list'
|
|
|
+ })
|
|
|
+ break;
|
|
|
+ case 'lx':
|
|
|
+ uni.redirectTo({
|
|
|
+ url:'/pages/client/Lianxi/list'
|
|
|
+ })
|
|
|
+ break;
|
|
|
+ case 'kc':
|
|
|
+ uni.redirectTo({
|
|
|
+ url:'/pages/client/Kecheng/list'
|
|
|
+ })
|
|
|
+ break;
|
|
|
+ case 'cj':
|
|
|
+ uni.redirectTo({
|
|
|
+ url:'/pages/client/Chengji/list'
|
|
|
+ })
|
|
|
+ break;
|
|
|
+ case 'grcj':
|
|
|
+ uni.redirectTo({
|
|
|
+ url:'/pages/client/my/myInfo'
|
|
|
+ })
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
function getUserInfo(){
|
|
|
getMineUser({}).then(res => {
|
|
|
myInfoData.userImg= res.data.icon;
|
|
@@ -83,9 +120,22 @@
|
|
|
})
|
|
|
}
|
|
|
function exitLogin(){
|
|
|
+ commonDialogRef.value.handleShow();
|
|
|
|
|
|
}
|
|
|
-
|
|
|
+ function exitBtn(){
|
|
|
+ getMineLogout().then(res => {
|
|
|
+ console.log(res,'res');
|
|
|
+ toast('退出登录成功')
|
|
|
+ console.log(6666,'666');
|
|
|
+ cacheManager.clearAll();
|
|
|
+ uni.reLaunch({
|
|
|
+ url: '/pages/Login/index'
|
|
|
+ });
|
|
|
+ }).catch(err => {
|
|
|
+ toast('退出登录失败,请稍后重试')
|
|
|
+ })
|
|
|
+ }
|
|
|
onLoad(() => {
|
|
|
getMyInit()
|
|
|
})
|