|
@@ -1,219 +1,222 @@
|
|
|
<template>
|
|
|
- <view class=" mine-container" :style="{height: `${windowHeight}px`}">
|
|
|
- <!--顶部个人信息栏-->
|
|
|
- <view class=" header-section">
|
|
|
- <view class=" flex padding justify-between uni-row">
|
|
|
- <view class=" flex align-center uni-row">
|
|
|
- <view v-if="avatar==null" class="cu-avatar xl round bg-white">
|
|
|
- <view class="text-gray icon"></view>
|
|
|
- </view>
|
|
|
- <image v-if="avatar" @click="handleToAvatar" :src="avatar" class="cu-avatar xl round" mode="widthFix">
|
|
|
- </image>
|
|
|
- <view v-if="name == null" @click="handleToLogin" class=" login-tip">
|
|
|
- 点击登录
|
|
|
- </view>
|
|
|
- <view v-if="name" @click="handleToInfo" class=" user-info">
|
|
|
- <view class=" u_title">
|
|
|
- 用户名:{{ name }}
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- <view @click="handleToInfo" class=" flex align-center uni-row">
|
|
|
- <text>个人信息</text>
|
|
|
- <view class=""></view>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
-
|
|
|
- <view class=" content-section">
|
|
|
- <view class=" mine-actions grid col-4 uni-row">
|
|
|
-
|
|
|
- </view>
|
|
|
-
|
|
|
- <view class=" menu-list">
|
|
|
- <view class=" list-cell list-cell-arrow" @click="handleToEditInfo">
|
|
|
- <view class=" menu-item-box uni-row">
|
|
|
- <view class=" menu-icon"></view>
|
|
|
- <view class="font-14">编辑资料</view>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- <view class=" list-cell list-cell-arrow" @click="handleHelp">
|
|
|
- <view class=" menu-item-box uni-row">
|
|
|
- <view class="menu-icon"></view>
|
|
|
- <view class="font-14">常见问题</view>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- <view class=" list-cell list-cell-arrow" @click="handleAbout">
|
|
|
- <view class=" menu-item-box uni-row">
|
|
|
- <view class=" menu-icon"></view>
|
|
|
- <view class="font-14">关于我们</view>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- <view class=" list-cell list-cell-arrow" @click="handleToSetting">
|
|
|
- <view class=" menu-item-box uni-row">
|
|
|
- <view class="menu-icon"></view>
|
|
|
- <view class="font-14">应用设置</view>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
-
|
|
|
+<!-- #ifdef APP -->
|
|
|
+ <scroll-view style="flex:1">
|
|
|
+ <!-- #endif -->
|
|
|
+ <view class="my-page">
|
|
|
+
|
|
|
+ <!-- 标题栏 -->
|
|
|
+ <view class=" uni-section">
|
|
|
+ <view class=" uni-section-header">
|
|
|
+ <view class=" uni-section-header__decoration line"/>
|
|
|
+ <view class=" uni-section-header__content">
|
|
|
+ <text style="font-size:14px;color:#333" class="distraction">用户管理</text>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <!-- 宫格 -->
|
|
|
+ <view class="grid-body">
|
|
|
+ <view class="grid uni-row">
|
|
|
+ <view class="grid-item" v-for="(item: Item, index: number) in items" :key="index" @click="enterItem(item)" >
|
|
|
+ <!-- 您的网格项内容 -->
|
|
|
+ <uni-icons class="my-icon" :type="item.iconType" size="40" :color="item.colorClass" ></uni-icons>
|
|
|
+ <text class="text">{{ item.text }}</text>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
</view>
|
|
|
+ <!-- #ifdef APP -->
|
|
|
+ </scroll-view>
|
|
|
+ <!-- #endif -->
|
|
|
</template>
|
|
|
|
|
|
-<script lang="uts">
|
|
|
- import {state,LogOut} from '@/store'
|
|
|
+<script lang="uts">
|
|
|
+ import {state} from '@/store';
|
|
|
+ type ImageItem={
|
|
|
+ image:string
|
|
|
+ }
|
|
|
+ type Item={
|
|
|
+ colorClass:string,
|
|
|
+ iconType:string,
|
|
|
+ path:string,
|
|
|
+ text:string
|
|
|
+ }
|
|
|
export default {
|
|
|
- data() {
|
|
|
- const globalData = getApp().globalData
|
|
|
- const config = globalData.config != null ? globalData.config as UTSJSONObject : null;
|
|
|
- const appInfo:UTSJSONObject|null = config?.get('appInfo') as UTSJSONObject;
|
|
|
+ data() {
|
|
|
+ let basic = [
|
|
|
+ ,{colorClass: 'green', iconType: "wallet-filled", text: "用户信息",path:"/pages/mine/pwd/index" }
|
|
|
+ ] as Item[];
|
|
|
+ let isAdmin = state.roles.includes('admin') ? true : false;
|
|
|
+ let adminItem = {colorClass: 'blue', iconType: "personadd-filled", text: "注册用户",path:"/pages/register" }as Item;
|
|
|
+ let items = isAdmin ? basic.concat(adminItem) : basic;
|
|
|
+
|
|
|
return {
|
|
|
- name: state.name as string,
|
|
|
- version: appInfo?.get('version') as string | ''
|
|
|
- }
|
|
|
- },
|
|
|
- computed: {
|
|
|
- avatar() {
|
|
|
- return state.avatar as string
|
|
|
- },
|
|
|
- windowHeight() {
|
|
|
- return (uni.getSystemInfoSync().windowHeight - 50 ) as number
|
|
|
+ items: items as Item[],
|
|
|
+ current: 0 as number,
|
|
|
+ swiperDotIndex: 0 as number,
|
|
|
+ data: [{
|
|
|
+ image: '/static/images/banner/banner01.png'
|
|
|
+ },
|
|
|
+ ] as ImageItem[]
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
- handleToInfo() {
|
|
|
- uni.navigateTo({
|
|
|
- url: '/pages/mine/info/index'
|
|
|
- });
|
|
|
- },
|
|
|
- handleToEditInfo() {
|
|
|
- uni.navigateTo({
|
|
|
- url: '/pages/mine/info/edit'
|
|
|
- });
|
|
|
+ clickBannerItem(item:ImageItem) {
|
|
|
+ console.info(item)
|
|
|
},
|
|
|
- handleToSetting() {
|
|
|
- uni.navigateTo({
|
|
|
- url: '/pages/mine/setting/index'
|
|
|
- });
|
|
|
+ changeSwiper(e:UniSwiperChangeEvent) {
|
|
|
+ this.current = e.detail.current
|
|
|
},
|
|
|
- handleToLogin() {
|
|
|
- uni.reLaunch({
|
|
|
- url: '/pages/login'
|
|
|
- });
|
|
|
- },
|
|
|
- handleToAvatar() {
|
|
|
- // 上传头像待优化
|
|
|
- // uni.navigateTo({
|
|
|
- // url: '/pages/mine/avatar/index'
|
|
|
- // });
|
|
|
- uni.showToast({
|
|
|
- title: '模块建设中~',
|
|
|
- icon: 'none'
|
|
|
- });
|
|
|
- },
|
|
|
- handleLogout() {
|
|
|
- uni.showModal({
|
|
|
- title: '提示',
|
|
|
- content: '确定注销并退出系统吗?',
|
|
|
- success: (res) => {
|
|
|
- if (res.confirm) {
|
|
|
- LogOut().then(() => {
|
|
|
- uni.reLaunch({
|
|
|
- url: '/pages/index'
|
|
|
- });
|
|
|
- });
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
- },
|
|
|
- handleHelp() {
|
|
|
- uni.navigateTo({
|
|
|
- url: '/pages/mine/help/index'
|
|
|
- });
|
|
|
- },
|
|
|
- handleAbout() {
|
|
|
- uni.navigateTo({
|
|
|
- url: '/pages/mine/about/index'
|
|
|
- });
|
|
|
- },
|
|
|
- handleJiaoLiuQun() {
|
|
|
- uni.showToast({
|
|
|
- title: 'QQ群:①133713780、②146013835',
|
|
|
- icon: 'none'
|
|
|
- });
|
|
|
- },
|
|
|
- handleBuilding() {
|
|
|
- uni.showToast({
|
|
|
- title: '模块建设中~',
|
|
|
- icon: 'none'
|
|
|
- });
|
|
|
+ enterItem(e:Item) {
|
|
|
+ if (e.path != null && e.path != "") {
|
|
|
+ uni.navigateTo({
|
|
|
+ url: e.path as string
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ uni.showToast({
|
|
|
+ title: '模块建设中~',
|
|
|
+ icon: 'none'
|
|
|
+ });
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss">
|
|
|
+ /* #ifndef APP-NVUE */
|
|
|
.my-page {
|
|
|
- background-color: #f5f6f7;
|
|
|
- width: 100%;
|
|
|
- height: 100%;
|
|
|
- }
|
|
|
-
|
|
|
- .mine-container {
|
|
|
- width: 100%;
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ box-sizing: border-box;
|
|
|
+ background-color: #fff;
|
|
|
+ /* #ifndef APP-ANDROID */
|
|
|
+ min-height: 100%;
|
|
|
+ /* #endif */
|
|
|
height: 100%;
|
|
|
+ }
|
|
|
|
|
|
+ /* #ifndef APP-ANDROID */
|
|
|
+ view {
|
|
|
+ font-size: 14px;
|
|
|
+ line-height: inherit;
|
|
|
+ }
|
|
|
+ /* #endif */
|
|
|
+ /* #endif */
|
|
|
+
|
|
|
+ .text {
|
|
|
+ text-align: center;
|
|
|
+ font-size: 26rpx;
|
|
|
+ margin-top: 10rpx;
|
|
|
+ }
|
|
|
|
|
|
- .header-section {
|
|
|
- padding: 15px 15px 45px 15px;
|
|
|
- background-color: #3c96f3;
|
|
|
- color: white;
|
|
|
+
|
|
|
+ .swiper {
|
|
|
+ height: 300rpx;
|
|
|
+ }
|
|
|
|
|
|
- .login-tip {
|
|
|
- font-size: 18px;
|
|
|
- margin-left: 10px;
|
|
|
- }
|
|
|
+ .swiper-box {
|
|
|
+ height: 150px;
|
|
|
+ }
|
|
|
|
|
|
- .cu-avatar {
|
|
|
- border: 2px solid #eaeaea;
|
|
|
+ .swiper-item {
|
|
|
+ /* #ifndef APP-NVUE */
|
|
|
+ display: flex;
|
|
|
+ /* #endif */
|
|
|
+ flex-direction: column;
|
|
|
+ justify-content: center;
|
|
|
+ align-items: center;
|
|
|
+ color: #fff;
|
|
|
+ height: 300rpx;
|
|
|
+ line-height: 300rpx;
|
|
|
+ }
|
|
|
|
|
|
- .icon {
|
|
|
- font-size: 40px;
|
|
|
- }
|
|
|
+ @media screen and (min-width: 500px) {
|
|
|
+ .my-image {
|
|
|
+ width: 100%;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .grid-body {
|
|
|
+ /* #ifndef APP-NVUE */
|
|
|
+ display: flex;
|
|
|
+ /* #endif */
|
|
|
+ flex-wrap: wrap;
|
|
|
+ justify-content: space-between;
|
|
|
+ margin-top: 40rpx;
|
|
|
+ }
|
|
|
+
|
|
|
+ .grid-item {
|
|
|
+ width: 32%;
|
|
|
+ padding: 18px 15px;
|
|
|
+ margin-bottom: 40rpx;
|
|
|
+ border-radius: 20rpx;
|
|
|
+ box-shadow: 0 8rpx 20rpx rgba(24, 144, 255, 0.15);
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ .my-icon{
|
|
|
+ text-align: center;
|
|
|
+ border-radius: 20rpx;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .purple {color:#6366f1;}
|
|
|
+ .blue {color:#2563eb; }
|
|
|
+ .orange {color:#d97706;}
|
|
|
+ .green {color:#059669;}
|
|
|
+ .yellow {color:yellow;}
|
|
|
+
|
|
|
+ $uni-primary: #2979ff !default;
|
|
|
+
|
|
|
+ .uni-section {
|
|
|
+ background-color: #fff;
|
|
|
+ .uni-section-header {
|
|
|
+ position: relative;
|
|
|
+ /* #ifndef APP-NVUE */
|
|
|
+ display: flex;
|
|
|
+ /* #endif */
|
|
|
+ flex-direction: row;
|
|
|
+ align-items: center;
|
|
|
+ padding: 12px 10px;
|
|
|
+ font-weight: normal;
|
|
|
+
|
|
|
+ &__decoration{
|
|
|
+ margin-right: 6px;
|
|
|
+ background-color: $uni-primary;
|
|
|
+ &.line {
|
|
|
+ width: 4px;
|
|
|
+ height: 12px;
|
|
|
+ border-radius: 10px;
|
|
|
}
|
|
|
-
|
|
|
- .user-info {
|
|
|
- margin-left: 15px;
|
|
|
-
|
|
|
- .u_title {
|
|
|
- font-size: 18px;
|
|
|
- line-height: 30px;
|
|
|
- }
|
|
|
+
|
|
|
+ &.circle {
|
|
|
+ width: 8px;
|
|
|
+ height: 8px;
|
|
|
+ border-top-right-radius: 50px;
|
|
|
+ border-top-left-radius: 50px;
|
|
|
+ border-bottom-left-radius: 50px;
|
|
|
+ border-bottom-right-radius: 50px;
|
|
|
+ }
|
|
|
+
|
|
|
+ &.square {
|
|
|
+ width: 8px;
|
|
|
+ height: 8px;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
- .content-section {
|
|
|
- position: relative;
|
|
|
- top: -50px;
|
|
|
-
|
|
|
- .mine-actions {
|
|
|
- margin: 15px 15px;
|
|
|
- padding: 20px 0px;
|
|
|
- border-radius: 8px;
|
|
|
- background-color: white;
|
|
|
-
|
|
|
- .action-item {
|
|
|
- .icon {
|
|
|
- font-size: 28px;
|
|
|
- }
|
|
|
-
|
|
|
- .text {
|
|
|
- font-size: 13px;
|
|
|
- margin: 8px 0px;
|
|
|
- }
|
|
|
- }
|
|
|
+
|
|
|
+ &__content {
|
|
|
+ /* #ifndef APP-NVUE */
|
|
|
+ display: flex;
|
|
|
+ /* #endif */
|
|
|
+ flex-direction: column;
|
|
|
+ flex: 1;
|
|
|
+ color: #333;
|
|
|
+
|
|
|
+ .distraction {
|
|
|
+ flex-direction: row;
|
|
|
+ align-items: center;
|
|
|
+ }
|
|
|
+ &-sub {
|
|
|
+ margin-top: 2px;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ }
|
|
|
</style>
|