From 5c7ed94dc94071893167d583d237ae85d509f094 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期一, 13 十月 2025 13:53:11 +0800
Subject: [PATCH] 打包修改
---
src/pages/mine.vue | 359 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 359 insertions(+), 0 deletions(-)
diff --git a/src/pages/mine.vue b/src/pages/mine.vue
new file mode 100644
index 0000000..0961130
--- /dev/null
+++ b/src/pages/mine.vue
@@ -0,0 +1,359 @@
+<template>
+ <view class="mine-page">
+ <!-- 椤堕儴涓汉淇℃伅鍗� -->
+ <view class="profile-card">
+ <view class="left">
+ <view v-if="!avatar" class="avatar-placeholder">
+ <view class="iconfont icon-people"></view>
+ </view>
+ <image
+ v-else
+ class="avatar"
+ :src="avatar"
+ mode="aspectFill"
+ @click="handleToAvatar"
+ />
+ <view class="info">
+ <view class="name-line">
+ <text class="name" @click="name ? handleToInfo() : handleToLogin()">
+ {{ name || '鐐瑰嚮鐧诲綍' }}
+ </text>
+ <text v-if="roleName" class="role-tag">{{ roleName }}</text>
+ </view>
+ </view>
+ </view>
+ <view class="right" @click="handleLogout">
+ <text class="link">閫�鍑虹櫥褰�</text>
+<!-- <view class="iconfont icon-right"></view>-->
+ </view>
+ </view>
+
+ <!-- 涓変釜绠$悊鑿滃崟 -->
+ <view class="menu-card">
+ <view class="menu-item" @click="handleUnitManage">
+ <uni-icons type="home" size="22" color="#3C96F3" />
+ <text class="label">鍗曚綅淇℃伅</text>
+ <uni-icons class="arrow" type="right" size="18" color="#c0c4cc" />
+ </view>
+ <view class="menu-item" @click="handleToInfo">
+ <uni-icons type="person" size="22" color="#3C96F3" />
+ <text class="label">鐢ㄦ埛淇℃伅</text>
+ <uni-icons class="arrow" type="right" size="18" color="#c0c4cc" />
+ </view>
+ <view class="menu-item" @click="handleContractManage">
+ <uni-icons type="compose" size="22" color="#3C96F3" />
+ <text class="label">鍚堝悓淇℃伅</text>
+ <uni-icons class="arrow" type="right" size="18" color="#c0c4cc" />
+ </view>
+ </view>
+ <view>
+ <uni-popup ref="popup" type="dialog">
+ <uni-popup-dialog type="info" cancelText="鍏抽棴" confirmText="閫�鍑�" title="閫氱煡" content="纭畾娉ㄩ攢骞堕��鍑虹郴缁熷悧"
+ @confirm="dialogConfirm">
+ </uni-popup-dialog>
+ </uni-popup>
+ </view>
+ <!-- 搴曢儴涓や釜淇℃伅鍗$墖 -->
+ <!-- <view class="info-cards">
+ <view class="info-card">
+ <view class="card-left">
+ <view class="title">甯姪鏂囨。</view>
+ <view class="desc">浜嗚В骞冲彴鍔熻兘妯″潡</view>
+ <button class="card-btn" @click="handleHelp">鐐瑰嚮鏌ョ湅</button>
+ </view>
+ <view class="card-illu note"></view>
+ </view>
+
+ <view class="info-card">
+ <view class="card-left">
+ <view class="title">闂鍙嶉</view>
+ <view class="desc">瑙e喅骞冲彴浣跨敤闂</view>
+ <button class="card-btn warn" @click="handleFeedback">鐐瑰嚮鍜ㄨ</button>
+ </view>
+ <view class="card-illu faq"></view>
+ </view>
+ </view> -->
+ </view>
+</template>
+
+<script setup>
+import { ref, onMounted } from "vue";
+import config from '@/config.js'
+import { getUserProfile } from "@/api/system/user";
+import useUserStore from '@/store/modules/user'
+const userStore = useUserStore()
+const name = userStore.name;
+const roleName = userStore.roleName;
+const version = config.appInfo.version;
+
+const avatar = ref(userStore.avatar);
+// rem 鍩哄噯锛�1rem = 16px锛堝鏈変笉鍚岃璋冩暣 REM_BASE 鎴栨牱寮忔暟鍊硷級
+const REM_BASE = 16;
+const windowHeightRem = ref((uni.getSystemInfoSync().windowHeight - 50) / REM_BASE);
+const popup = ref(null);
+
+uni.$on('refresh', () => {
+ avatar.value = userStore.avatar;
+})
+function handleToInfo() {
+ uni.navigateTo({
+ url: '/pages_mine/pages/info/index'
+ });
+};
+function handleToLogin() {
+ uni.reLaunch({
+ url: '/pages/login'
+ });
+};
+function handleToAvatar() {
+ uni.navigateTo({
+ url: '/pages_mine/pages/avatar/index'
+ });
+};
+function handleLogout() {
+ popup.value.open();
+};
+function dialogConfirm() {
+ //console.log('----------------鐐瑰嚮纭------------')
+
+ userStore.logOut().then(() => {
+ uni.reLaunch({
+ url: '/pages/login'
+ });
+ })
+};
+
+// 鐜版湁璺宠浆鏂规硶淇濈暀锛歨andleToInfo / handleToLogin / handleToAvatar / handleHelp 绛�
+function handleUnitManage() {
+ uni.navigateTo({
+ url: '/pages_mine/pages/company/index'
+ });
+}
+function handleUserManage() {
+ // TODO: 鏇挎崲涓虹湡瀹炶矾鐢�
+ uni.showToast({ title: '妯″潡寤鸿涓瓇', icon: 'none' });
+}
+function handleContractManage() {
+ uni.navigateTo({
+ url: '/pages_mine/pages/contract/index'
+ });
+}
+onMounted(() => {
+ // 璁剧疆鐢ㄦ埛淇℃伅
+ // 璁剧疆鐢ㄦ埛淇℃伅
+ userStore.getInfo()
+});
+</script>
+
+<style lang="scss" scoped>
+/* 椤甸潰瀹瑰櫒 */
+.mine-page {
+ min-height: 100vh;
+ padding: 1.25rem;
+ /* 涓烘墍鏈夎澶囪缃熀纭�padding-top */
+ padding-top: 40px;
+ position: relative;
+ background: linear-gradient( 225deg, #E7F1FF 0%, rgba(255,255,255,0) 74%, rgba(255,255,255,0) 100%);
+
+ /* iOS璁惧浣跨敤env()鍑芥暟澶勭悊瀹夊叏鍖哄煙 */
+ padding-top: env(safe-area-inset-top);
+
+ /* 涓哄畨鍗撹澶囪缃洿澶х殑椤堕儴鍐呰竟璺� */
+ /* #ifdef APP-PLUS && !MP && !H5 */
+ padding-top: 45px;
+ /* #endif */
+
+ /* H5鍜屽皬绋嬪簭骞冲彴鐨勯�氱敤鏍峰紡 */
+ /* #ifdef H5 || MP */
+ padding-top: 30px;
+ /* #endif */
+}
+
+/* 椤堕儴涓汉淇℃伅鍗� */
+.profile-card {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ color: #333;
+ margin: 1.25rem 0;
+
+ /* 涓哄畨鍗撹澶囬澶栬皟鏁村崱鐗囦綅缃� */
+ /* #ifdef APP-PLUS && !MP && !H5 */
+ margin-top: 15px;
+ /* #endif */
+
+ .left {
+ display: flex;
+ align-items: center;
+ gap: 0.75rem;
+
+ .avatar {
+ width: 3.5rem;
+ height: 3.5rem;
+ border-radius: 50%;
+ border: 0.125rem solid #fff;
+ background: #fff;
+ object-fit: cover;
+ }
+ .avatar-placeholder {
+ width: 3.5rem;
+ height: 3.5rem;
+ border-radius: 50%;
+ background: #fff;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ border: 0.125rem solid #fff;
+
+ .iconfont {
+ font-size: 2rem;
+ color: #c0c4cc;
+ }
+ }
+
+ .info {
+ display: flex;
+ flex-direction: column;
+
+ .name-line {
+ display: flex;
+ align-items: flex-end;
+ gap: 0.5rem;
+
+ .name {
+ font-size: 1.125rem;
+ font-weight: 600;
+ color: #2c2c2c;
+ }
+ .role-tag {
+ font-size: 0.75rem;
+ color: #fff;
+ background: #ffa940;
+ padding: 0.125rem 0.5rem;
+ border-radius: 0.75rem;
+ }
+ }
+
+ .phone {
+ margin-top: 0.25rem;
+ font-size: 0.8125rem;
+ color: #3c96f3;
+ }
+ }
+ }
+
+ .right {
+ display: flex;
+ align-items: center;
+ gap: 0.375rem;
+ color: #666;
+
+ .link {
+ font-size: 0.875rem;
+ }
+ .iconfont {
+ font-size: 0.875rem;
+ color: #c0c4cc;
+ }
+ }
+}
+
+/* 鑿滃崟鍗$墖 */
+.menu-card {
+ margin-top: 0.75rem;
+ background: #fff;
+ border-radius: 0.75rem;
+ overflow: hidden;
+
+ .menu-item {
+ display: flex;
+ align-items: center;
+ height: 3.5rem;
+ padding: 1.25rem;
+ position: relative;
+
+ .label {
+ flex: 1;
+ margin-left: 0.625rem;
+ color: #303133;
+ font-size: 0.9375rem;
+ }
+ .arrow {
+ opacity: 0.6;
+ }
+ }
+
+ .menu-item + .menu-item {
+ border-top: 0.0625rem solid #f2f3f5;
+ }
+}
+
+/* 搴曢儴淇℃伅鍗$墖 */
+.info-cards {
+ display: grid;
+ grid-template-columns: 1fr 1fr;
+ gap: 0.75rem;
+ margin-top: 0.75rem;
+
+ .info-card {
+ position: relative;
+ background: #fff;
+ border-radius: 0.75rem;
+ padding: 0.875rem 0.75rem;
+ min-height: 7rem;
+ overflow: hidden;
+
+ .card-left {
+ display: flex;
+ flex-direction: column;
+ gap: 0.375rem;
+
+ .title {
+ font-size: 1rem;
+ font-weight: 600;
+ color: #2c2c2c;
+ }
+ .desc {
+ font-size: 0.75rem;
+ color: #8a8a8a;
+ }
+ .card-btn {
+ margin-top: 0.5rem;
+ width: 6rem;
+ height: 1.875rem;
+ line-height: 1.875rem;
+ border: none;
+ border-radius: 62.4375rem;
+ font-size: 0.8125rem;
+ color: #fff;
+ background: #3c96f3;
+
+ &.warn {
+ background: #ffb03a;
+ }
+ }
+ }
+
+ /* 鍙充晶瑁呴グ锛堝彲鏇挎崲涓哄浘鐗囷級 */
+ .card-illu {
+ position: absolute;
+ right: -0.375rem;
+ bottom: 0;
+ width: 4.875rem;
+ height: 4.875rem;
+ opacity: 0.9;
+
+ &.note {
+ background: radial-gradient(closest-side, #e8f2ff, transparent),
+ linear-gradient(135deg, #d8eaff, #f5faff);
+ border-radius: 0.75rem 0 0 0;
+ }
+ &.faq {
+ background: radial-gradient(closest-side, #ffe9d0, transparent),
+ linear-gradient(135deg, #ffe0b2, #fff3e0);
+ border-radius: 0.75rem 0 0 0;
+ }
+ }
+ }
+}
+</style>
--
Gitblit v1.9.3