Compare commits

..

No commits in common. "c700fa8cf24ad6fb37f044d1e2f82778abf94bee" and "486fe1be9984c46729f31f32d5fe7860f56e3a8b" have entirely different histories.

7 changed files with 32 additions and 144 deletions

View File

@ -5,7 +5,6 @@ export const ENV = {
APP_NAME: '领航专昇本志愿通', APP_NAME: '领航专昇本志愿通',
APP_SUBTITLE: '这里填写副标题', APP_SUBTITLE: '这里填写副标题',
PROJECT_CODE: 'UNIAPP_ZSB', PROJECT_CODE: 'UNIAPP_ZSB',
TENANT_ID: '000000',
SECURITY_ENABLE: false, SECURITY_ENABLE: false,
SECURITY_SECRET_KEY: '' SECURITY_SECRET_KEY: ''
}; };

View File

@ -37,7 +37,6 @@ function request(method, url, data = {}, options = {}) {
header['X-App-Timestamp'] = timestamp; header['X-App-Timestamp'] = timestamp;
header['X-App-Sign'] = md5(timestamp + ENV.SECURITY_SECRET_KEY); header['X-App-Sign'] = md5(timestamp + ENV.SECURITY_SECRET_KEY);
} }
header['X-Tenant-Id'] = ENV.TENANT_ID; // 租户 ID
const token = uni.getStorageSync(STORAGE_KEYS.TOKEN); const token = uni.getStorageSync(STORAGE_KEYS.TOKEN);
if (token) { if (token) {

View File

@ -417,13 +417,11 @@ export default {
.field-input { .field-input {
margin-top: 12rpx; margin-top: 12rpx;
padding: 0 20rpx; padding: 20rpx;
border-radius: 16rpx; border-radius: 16rpx;
background: #f5f6fa; background: #f5f6fa;
font-size: 28rpx; font-size: 28rpx;
color: #1f2d3d; color: #1f2d3d;
height: 96rpx;
line-height: 96rpx;
} }
.link { .link {

View File

@ -5,13 +5,10 @@
<text class="header-title">个人中心</text> <text class="header-title">个人中心</text>
<view class="header-actions"> <view class="header-actions">
<view class="action-item" @click="onAction('设置')"> <view class="action-item" @click="onAction('设置')">
<image src="@/static/icons/icon-setting.png" class="icon icon-3" /> <uni-icons type="settings-filled" :size="20" color="#6b7280" />
</view> </view>
<view class="action-item" @click="onAction('通知')"> <view class="action-item" @click="onAction('通知')">
<image <uni-icons type="notification-filled" :size="20" color="#6b7280" />
src="@/static/icons/icon-notification.png"
class="icon icon-3"
/>
</view> </view>
</view> </view>
</view> </view>
@ -20,51 +17,35 @@
<view class="user-left"> <view class="user-left">
<view class="avatar-wrap"> <view class="avatar-wrap">
<view class="avatar"> <view class="avatar">
<image <image :src="user.avatar" class="avatar-image" />
v-if="isLoggedIn && user.avatar" <!-- <uni-icons type="person-filled" :size="44" color="#8ca0be" /> -->
:src="user.avatar"
class="avatar-image"
/>
<uni-icons v-else type="person-filled" :size="44" color="#8ca0be" />
</view> </view>
<view class="verified" v-if="isLoggedIn"> <view class="verified">
<uni-icons type="medal-filled" :size="12" color="#ffffff" /> <uni-icons type="medal-filled" :size="12" color="#ffffff" />
</view> </view>
</view> </view>
<view <view class="user-info">
class="user-info" <text class="user-name">{{ user.name }}</text>
@click="isLoggedIn ? onAction('') : handleLogin" <view class="user-tags">
>
<text class="user-name">{{ isLoggedIn ? user.name : "未登录" }}</text>
<view class="user-tags" v-if="isLoggedIn">
<text class="tag">{{ user.role }}</text> <text class="tag">{{ user.role }}</text>
<view class="vip-tag"> <view class="vip-tag">
<uni-icons type="vip-filled" :size="12" color="#4a7c59" /> <uni-icons type="vip-filled" :size="12" color="#4a7c59" />
<text class="vip-text">{{ user.vipStatus }}</text> <text class="vip-text">{{ user.vipStatus }}</text>
</view> </view>
</view> </view>
<view class="login-tip" v-else @click="handleLogin">
<text class="login-text">请先登录查看个人信息</text>
</view>
</view> </view>
</view> </view>
<view class="primary-btn" @click="handlePrimaryAction"> <view class="primary-btn" @click="onAction('激活会员')">立即激活</view>
{{ isLoggedIn ? "立即激活" : "去登录" }}
</view>
</view> </view>
<view class="stats-card" v-if="isLoggedIn"> <view class="stats-card">
<view class="stat-item" v-for="stat in stats" :key="stat.label"> <view class="stat-item" v-for="stat in stats" :key="stat.label">
<text class="stat-value">{{ stat.value }}</text> <text class="stat-value">{{ stat.value }}</text>
<text class="stat-label">{{ stat.label }}</text> <text class="stat-label">{{ stat.label }}</text>
</view> </view>
</view> </view>
<view <view class="section" v-for="section in sections" :key="section.title">
class="section"
v-for="section in visibleSections"
:key="section.title"
>
<text class="section-title">{{ section.title }}</text> <text class="section-title">{{ section.title }}</text>
<view class="section-body"> <view class="section-body">
<view <view
@ -85,9 +66,7 @@
</view> </view>
<view class="logout-wrap"> <view class="logout-wrap">
<view class="logout-btn" v-if="isLoggedIn" @click="handleLogout"> <view class="logout-btn" @click="handleLogout">退出登录</view>
退出登录
</view>
<text class="version">Version 2.4.1 (Build 20241021)</text> <text class="version">Version 2.4.1 (Build 20241021)</text>
</view> </view>
</view> </view>
@ -96,17 +75,15 @@
<script> <script>
import { STORAGE_KEYS } from "@/common/env"; import { STORAGE_KEYS } from "@/common/env";
const app = getApp(); const app = getApp();
const DEFAULT_USER = {
avatar: "",
name: "领航学子",
role: "普通用户",
vipStatus: "未激活会员",
};
export default { export default {
data() { data() {
return { return {
isLoggedIn: false, user: {
user: { ...DEFAULT_USER }, avatar: "",
name: "领航学子",
role: "普通用户",
vipStatus: "未激活会员",
},
stats: [ stats: [
{ label: "志愿数量", value: "12" }, { label: "志愿数量", value: "12" },
{ label: "全省排名", value: "342" }, { label: "全省排名", value: "342" },
@ -116,41 +93,20 @@ export default {
{ {
title: "核心服务", title: "核心服务",
items: [ items: [
{ { title: "我的志愿表", icon: "folder-add-filled", bg: "#4a7c59" },
title: "我的志愿表",
icon: "folder-add-filled",
bg: "#4a7c59",
requiresLogin: true,
},
{ {
title: "我的订单/缴费记录", title: "我的订单/缴费记录",
icon: "wallet-filled", icon: "wallet-filled",
bg: "#3e8be4", bg: "#3e8be4",
requiresLogin: true,
},
{
title: "成绩/排名记录",
icon: "medal-filled",
bg: "#f08a24",
requiresLogin: true,
},
{
title: "打印设置",
icon: "compose",
bg: "#7b6fe4",
requiresLogin: true,
}, },
{ title: "成绩/排名记录", icon: "medal-filled", bg: "#f08a24" },
{ title: "打印设置", icon: "compose", bg: "#7b6fe4" },
], ],
}, },
{ {
title: "更多功能", title: "更多功能",
items: [ items: [
{ { title: "激活会员卡", icon: "vip-filled", bg: "#ff8a33" },
title: "激活会员卡",
icon: "vip-filled",
bg: "#ff8a33",
requiresLogin: true,
},
{ title: "商务合作", icon: "shop-filled", bg: "#4b9ce2" }, { title: "商务合作", icon: "shop-filled", bg: "#4b9ce2" },
{ title: "填报指南/教程", icon: "compose", bg: "#6e7a8c" }, { title: "填报指南/教程", icon: "compose", bg: "#6e7a8c" },
{ {
@ -169,31 +125,17 @@ export default {
], ],
}; };
}, },
computed: {
visibleSections() {
if (this.isLoggedIn) {
return this.sections;
}
return this.sections
.map((section) => {
const items = section.items.filter((item) => !item.requiresLogin);
return { ...section, items };
})
.filter((section) => section.items.length > 0);
},
},
onShow() { onShow() {
const token = uni.getStorageSync(STORAGE_KEYS.TOKEN);
this.isLoggedIn = Boolean(token);
if (!this.isLoggedIn) {
this.user = { ...DEFAULT_USER };
return;
}
const userInfo = app.globalData.UserStorage.getUserInfo(); const userInfo = app.globalData.UserStorage.getUserInfo();
console.warn(userInfo);
if (userInfo) { if (userInfo) {
this.user.avatar = userInfo.avatarUrl || DEFAULT_USER.avatar; this.user.avatar = userInfo.avatarUrl;
this.user.name = userInfo.nickname || userInfo.name || this.user.name; this.user.name = userInfo.nickName || userInfo.name || this.user.name;
}
const token = uni.getStorageSync(STORAGE_KEYS.TOKEN);
if (!token) {
uni.navigateTo({ url: "/pages/login/login" });
return;
} }
}, },
methods: { methods: {
@ -204,14 +146,6 @@ export default {
}); });
}, },
onMenuTap(item) { onMenuTap(item) {
if (item.requiresLogin && !this.isLoggedIn) {
uni.showToast({
title: "请先登录",
icon: "none",
});
this.handleLogin();
return;
}
if (item.path) { if (item.path) {
// #ifdef H5 || APP-PLUS // #ifdef H5 || APP-PLUS
uni.navigateTo({ url: item.path }); uni.navigateTo({ url: item.path });
@ -229,16 +163,6 @@ export default {
icon: "none", icon: "none",
}); });
}, },
handlePrimaryAction() {
if (this.isLoggedIn) {
this.onAction("激活会员");
return;
}
this.handleLogin();
},
handleLogin() {
uni.navigateTo({ url: "/pages/login/index" });
},
handleLogout() { handleLogout() {
uni.showModal({ uni.showModal({
title: "提示", title: "提示",
@ -287,7 +211,7 @@ export default {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
padding: 16rpx 0 16rpx; padding: 8rpx 0 16rpx;
} }
.header-title { .header-title {
@ -374,15 +298,6 @@ export default {
align-items: center; align-items: center;
} }
.login-tip {
margin-top: 10rpx;
}
.login-text {
font-size: 22rpx;
color: #94a3b8;
}
.tag { .tag {
padding: 4rpx 12rpx; padding: 4rpx 12rpx;
background: #f1f5f9; background: #f1f5f9;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.5 KiB

View File

@ -179,29 +179,6 @@
overflow: hidden; overflow: hidden;
} }
/* 图标 */
.icon {
display: inline-block;
vertical-align: middle;
flex-shrink: 0;
}
.icon-2 {
width: 32rpx;
height: 32rpx;
}
.icon-3 {
width: 48rpx;
height: 48rpx;
}
.icon-4 {
width: 64rpx;
height: 64rpx;
}
.avatar-image { .avatar-image {
width: 3rem; width: 3rem;
height: 3rem; height: 3rem;