|
@@ -1,9 +1,9 @@
|
|
|
<template>
|
|
|
<view class="ezy-my-page">
|
|
|
<view class="my-head-box">
|
|
|
- <icon class="head-img-box" :style="{backgroundImage: 'url(' + myInfoData.userImg + ')'}"></icon>
|
|
|
+ <icon class="head-img-box" :style="{backgroundImage: 'url(' + myInfoData.icon + ')'}"></icon>
|
|
|
<view class="head-content-box">
|
|
|
- <text>{{myInfoData.userName}}</text>
|
|
|
+ <text>{{myInfoData.nickName}}</text>
|
|
|
<view class="ezy-jf-box" v-if="loginFlag">
|
|
|
<icon class="jf-icon"></icon>
|
|
|
<text class="jf-text">{{myInfoData.credit}}</text>
|
|
@@ -46,7 +46,7 @@
|
|
|
<view v-if="loginFlag" class="list-row" @click="xxjlClick">
|
|
|
<icon class="list-icon sxtk-icon"></icon>
|
|
|
<text>学习记录</text>
|
|
|
- </view>
|
|
|
+ </view>
|
|
|
<view v-if="loginFlag" class="list-row" @click="xxscClick">
|
|
|
<icon class="list-icon sxtk-icon"></icon>
|
|
|
<text>学习时长</text>
|
|
@@ -163,6 +163,8 @@
|
|
|
userName: '',
|
|
|
credit: '',
|
|
|
vipFlag: '',
|
|
|
+ nickName: '',
|
|
|
+ icon: '',
|
|
|
});
|
|
|
let routerOpt = ref(false);
|
|
|
let appleCode = ref(null);
|
|
@@ -267,11 +269,21 @@
|
|
|
uni.redirectTo({
|
|
|
url: '/pages/login/index'
|
|
|
});
|
|
|
- }
|
|
|
+ }
|
|
|
+
|
|
|
function yingyongshezhi() {
|
|
|
- uni.redirectTo({
|
|
|
- url: '/pages/my/yingyongshezhi'
|
|
|
- });
|
|
|
+ if (loginFlag.value) {
|
|
|
+ const AuthCode = getUserIdentity();
|
|
|
+ if (AuthCode == 'Visitor') {
|
|
|
+ youkeDialogRef.value.handleShow();
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ uni.redirectTo({
|
|
|
+ url: '/pages/my/yingyongshezhi'
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ youkeDialogRef.value.handleShow();
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
// 手机号码
|
|
@@ -319,7 +331,8 @@
|
|
|
uni.redirectTo({
|
|
|
url: '/pages/my/xuexiJilu'
|
|
|
});
|
|
|
- }
|
|
|
+ }
|
|
|
+
|
|
|
function xxscClick() {
|
|
|
uni.redirectTo({
|
|
|
url: '/pages/my/xuexishichang'
|
|
@@ -354,9 +367,22 @@
|
|
|
// 获取用户数据
|
|
|
function getMyInfo() {
|
|
|
myInfo({}).then(res => {
|
|
|
- getUserImg(res.data.growthType)
|
|
|
+
|
|
|
myInfoData.userName = res.data.userName;
|
|
|
myInfoData.credit = res.data.credit;
|
|
|
+
|
|
|
+ myInfoData.nickName = res.data.nickName;
|
|
|
+
|
|
|
+ if (res.data.nickName) {
|
|
|
+ myInfoData.nickName = res.data.nickName;
|
|
|
+ } else {
|
|
|
+ myInfoData.nickName = '鹅状元';
|
|
|
+ }
|
|
|
+ if (res.data.icon) {
|
|
|
+ myInfoData.icon = res.data.icon;
|
|
|
+ } else {
|
|
|
+ getUserImg(res.data.growthType)
|
|
|
+ }
|
|
|
})
|
|
|
getMyCardList();
|
|
|
}
|
|
@@ -377,19 +403,19 @@
|
|
|
function getUserImg(data) {
|
|
|
switch (data) {
|
|
|
case 0:
|
|
|
- myInfoData.userImg = 'static/images/my/head-img0.png'
|
|
|
+ myInfoData.icon = 'static/images/my/head-img0.png'
|
|
|
break;
|
|
|
case 1:
|
|
|
- myInfoData.userImg = 'static/images/my/head-img1.png'
|
|
|
+ myInfoData.icon = 'static/images/my/head-img1.png'
|
|
|
break;
|
|
|
case 2:
|
|
|
- myInfoData.userImg = 'static/images/my/head-img2.png'
|
|
|
+ myInfoData.icon = 'static/images/my/head-img2.png'
|
|
|
break;
|
|
|
case 3:
|
|
|
- myInfoData.userImg = 'static/images/my/head-img3.png'
|
|
|
+ myInfoData.icon = 'static/images/my/head-img3.png'
|
|
|
break;
|
|
|
default:
|
|
|
- myInfoData.userImg = 'static/images/my/head-unlogin-img.png'
|
|
|
+ myInfoData.icon = 'static/images/my/head-unlogin-img.png'
|
|
|
break;
|
|
|
|
|
|
}
|
|
@@ -432,7 +458,8 @@
|
|
|
// my游客
|
|
|
loginFlag.value = false;
|
|
|
myInfoData.userName = '游客';
|
|
|
- myInfoData.userImg = 'static/images/my/head-unlogin-img.png'
|
|
|
+ myInfoData.nickName = '鹅状元';
|
|
|
+ myInfoData.icon = 'static/images/my/head-unlogin-img.png'
|
|
|
}
|
|
|
|
|
|
// 非游客
|