gaoluyang
昨天 85b3cc4cb996040632aa656c79b5047bd8b2597c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
<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="handleToInfo">
        <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="handleUserManage">
        <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 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">解决平台使用问题</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'
    });
  })
};
 
// 现有跳转方法保留:handleToInfo / handleToLogin / handleToAvatar / handleHelp 等
function handleUnitManage() {
  // TODO: 替换为真实路由
  uni.showToast({ title: '模块建设中~', icon: 'none' });
}
function handleUserManage() {
  // TODO: 替换为真实路由
  uni.showToast({ title: '模块建设中~', icon: 'none' });
}
function handleContractManage() {
  // TODO: 替换为真实路由
  uni.showToast({ title: '模块建设中~', icon: 'none' });
}
onMounted(() => {
    // 设置用户信息
});
</script>
 
<style lang="scss" scoped>
/* 页面容器 */
.mine-page {
  min-height: 100vh;
    padding: 1.25rem;
    padding-top: env(safe-area-inset-top);
    position: relative;
  background: linear-gradient( 225deg, #E7F1FF 0%, rgba(255,255,255,0) 74%, rgba(255,255,255,0) 100%);
}
 
/* 顶部个人信息卡 */
.profile-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #333;
  margin: 1.25rem 0;
 
  .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>