فهرست منبع

Merge branch '165' of uskycloud/usky-web-mobile into master

xf15575941817 2 سال پیش
والد
کامیت
7f5ba58e5c

+ 2 - 2
src/manifest.json

@@ -1,7 +1,7 @@
 {
-    "name" : "智慧消防",
+    "name" : "综合智慧云",
     "appid" : "__UNI__36DE3A0",
-    "description" : "智慧消防",
+    "description" : "综合智慧云",
     "versionName" : "2.0",
     "versionCode" : 2,
     "transformPx" : false,

+ 28 - 10
src/pages.json

@@ -35,6 +35,13 @@
         "navigationBarTextStyle": "black" // 仅支持 black/white
       }
     },
+    {
+      "path": "pages/serveConfigSelect",
+      "style": {
+        "navigationBarTitleText": "服务器配置",
+        "navigationStyle": "custom"
+      }
+    },
     {
       "path": "pages/serveConfig",
       "style": {
@@ -45,7 +52,24 @@
     {
       "path": "pages/mine/index",
       "style": {
-        "navigationBarTitleText": "我的"
+        "navigationBarTitleText": "我的",
+        "app-plus": {
+          "bounce": "none",
+          "titleNView": {
+            "type": "transparent",
+            "buttons": [
+              {
+                "fontSrc": "/static/iconfont/uciconfont/iconfont.ttf",
+                "text": "\ue70f",
+                "fontSize": "28",
+                "color": "#303133",
+                "width": "42px",
+                "background": "rgba(0,0,0,0)",
+                "float": "right"
+              }
+            ]
+          }
+        }
       }
     },
     {
@@ -57,13 +81,7 @@
     {
       "path": "pages/mine/info/index",
       "style": {
-        "navigationBarTitleText": "个人信息"
-      }
-    },
-    {
-      "path": "pages/mine/info/edit",
-      "style": {
-        "navigationBarTitleText": "编辑资料"
+        "navigationBarTitleText": "个人资料"
       }
     },
     {
@@ -75,7 +93,7 @@
     {
       "path": "pages/mine/setting/index",
       "style": {
-        "navigationBarTitleText": "应用设置"
+        "navigationBarTitleText": "设置"
       }
     },
     {
@@ -434,7 +452,7 @@
     "list": [
       {
         "name": "", //模式名称
-        "path": "pages/index", //启动页面,必选
+        "path": "pages/login", //启动页面,必选
         "query": "" //启动参数,在页面的onLoad函数里面得到
       }
     ]

+ 1 - 0
src/pages/business/mhxf/unitInfoCollection/index.vue

@@ -192,6 +192,7 @@
                   <u-checkbox :customStyle="{ marginBottom: '8px' }" label="自动喷水灭火系统" :name="1"> </u-checkbox>
                   <u-checkbox :customStyle="{ marginBottom: '8px' }" label="火灾自动报警系统" :name="2"> </u-checkbox>
                   <u-checkbox :customStyle="{ marginBottom: '8px' }" label="防排烟与排烟系统" :name="3"> </u-checkbox>
+                  <u-checkbox :customStyle="{ marginBottom: '8px' }" label="是否接入物联网" :name="4"> </u-checkbox>
                 </u-checkbox-group>
               </u-form-item>
 

+ 3 - 3
src/pages/index.vue

@@ -289,8 +289,8 @@ onLoad((option) => {
     });
   }
 
-  if (uni.getStorageSync(useStore.$state.name)) {
-    arrayList.recentlyUsed = uni.getStorageSync(useStore.$state.name);
+  if (uni.getStorageSync(useStore.$state.name + useStore.$state.tenantId)) {
+    arrayList.recentlyUsed = uni.getStorageSync(useStore.$state.name + useStore.$state.tenantId);
   }
 
   // var res = uni.getStorageSync("selectedCode");
@@ -404,7 +404,7 @@ function navItemClick(item) {
 
     arrayList.recentlyUsed = publicStores.sortEvent(arrayList.recentlyUsed, 1);
 
-    uni.setStorageSync(useStore.$state.name, arrayList.recentlyUsed);
+    uni.setStorageSync(useStore.$state.name + useStore.$state.tenantId, arrayList.recentlyUsed);
 
     uni.navigateTo({
       url: item.path,

+ 12 - 12
src/pages/login.vue

@@ -10,13 +10,13 @@
     <view class="middle">
       <view class="top">
         <image class="logo" mode="heightFix" :src="useStore.$state.loginLogo" v-if="useStore.$state.loginLogo" />
-        <image class="logo" mode="heightFix" src="@/static/logo200.png" v-else />
-        <text class="title" v-if="useStore.$state.loginTitle">{{ useStore.$state.loginTitle }}</text>
-        <text class="title" v-else>移动端登录</text>
+        <!-- <image class="logo" mode="heightFix" src="@/static/logo200.png" v-else /> -->
+        <text class="title" :style="{ color: useStore.$state.loginBg ? '#FFFFFF' : '#000000' }" v-if="useStore.$state.loginTitle">{{ useStore.$state.loginTitle }}</text>
+        <!-- <text class="title" v-else>移动端登录</text> -->
       </view>
 
       <view class="content">
-        <text class="title">请登录</text>
+        <text class="title" :style="{ color: useStore.$state.loginBg ? '#FFFFFF' : '#000000' }">请登录</text>
 
         <!-- #ifdef APP-PLUS -->
         <view id="okay" v-if="!linkUrl">首次账号登录请先配置服务器</view>
@@ -54,10 +54,10 @@
         <text @click="switchMode">{{ switchText }}</text>
       </view>
 
-      <!-- #ifdef APP-PLUS -->
+      <!-- #ifdef APP-PLUS-->
       <view class="xieyi text-center">
-        <u-checkbox-group>
-          <u-checkbox v-model="userChecked" shape="circle" inactiveColor="#0081ff" size="13"></u-checkbox>
+        <u-checkbox-group v-model="userChecked">
+          <u-checkbox :name="true" shape="circle" inactiveColor="#0081ff" size="13"></u-checkbox>
         </u-checkbox-group>
         <text>我已阅读并同意</text>
         <text @click="handleUserAgrement" class="text-blue">用户协议</text>
@@ -82,7 +82,7 @@ import publicStore from "@/store/modules/public.js";
 
 import useStores from "@/store/modules/user.js";
 const useStore = useStores();
-const newPublicStore = publicStore();
+const publicStores = publicStore();
 
 const { proxy } = getCurrentInstance();
 
@@ -98,7 +98,7 @@ const data = reactive({
   /** 服务器配置数据 */
   linkUrl: uni.getStorageSync("serveUrl"),
   /** 用户隐私协议数据 */
-  userChecked: false,
+  userChecked: [true],
 
   // VerificationCodeOne
 });
@@ -106,7 +106,7 @@ const data = reactive({
 const { phone, verify, codeTime, switchText, username, password, inputIconBool, linkUrl, userChecked } = toRefs(data);
 
 function goSeverConfig() {
-  proxy.$tab.navigateTo("/pages/serveConfig");
+  proxy.$tab.navigateTo("/pages/serveConfigSelect");
 }
 
 /**登录方式切换 */
@@ -137,7 +137,7 @@ function getVerifyCode() {
   }
 
   //#ifdef APP-PLUS
-  if (userChecked.value) {
+  if (!userChecked.value[0]) {
     proxy.$modal.msg("请在阅读并同意 用户协议和隐私协议后登录");
     return;
   }
@@ -220,7 +220,7 @@ function submitRes() {
   //#endif
 
   //#ifdef APP-PLUS
-  if (userChecked.value) {
+  if (!userChecked.value[0]) {
     proxy.$modal.msg("请在阅读并同意 用户协议和隐私协议后登录");
     return;
   }

+ 4 - 3
src/pages/mine/about/index.vue

@@ -1,8 +1,9 @@
 <template>
   <view class="about-container">
     <view class="header-section text-center">
-      <image style="width: 150rpx; height: 150rpx" src="@/static/logo200.png" mode="widthFix"> </image>
-      <uni-title type="h2" title="永天saas移动端"></uni-title>
+      <image style="width: 150rpx; height: 150rpx" mode="heightFix" :src="useStore.$state.loginLogo" v-if="useStore.$state.loginLogo" />
+      <image style="width: 150rpx; height: 150rpx" mode="heightFix" src="@/static/logo200.png" v-else />
+      <uni-title type="h2" :title="useStore.$state.loginTitle"></uni-title>
     </view>
 
     <view class="content-section">
@@ -16,7 +17,7 @@
         <view class="list-cell list-cell-arrow">
           <view class="menu-item-box">
             <view>官方邮箱</view>
-            <!-- <view class="text-right">ruoyi@xx.com</view> -->
+            <view class="text-right"></view>
           </view>
         </view>
         <view class="list-cell list-cell-arrow">

+ 202 - 36
src/pages/mine/index.vue

@@ -9,18 +9,31 @@
           </view>
           <image v-if="avatar" @click="handleToAvatar" :src="avatar" class="cu-avatar xl round" mode="widthFix"> </image>
           <view v-if="!data.name" @click="handleToLogin" class="login-tip"> 点击登录 </view>
-          <view v-if="data.name" @click="handleToInfo" class="user-info">
-            <view class="u_title"> 用户名:{{ data.name }} </view>
+          <view v-if="data.name" class="user-info">
+            <view class="u_title"> {{ data.name }} </view>
+            <view class="u_title"> {{ data.phone }} </view>
           </view>
         </view>
-        <view @click="handleToInfo" class="flex align-center">
-          <text style="white-space: nowrap">个人信息</text>
-          <view class="iconfont icon-right"></view>
-        </view>
+        <view class="flex align-center"> </view>
       </view>
+
+      <view class="vip-card-box"> </view>
     </view>
 
-    <view class="content-section">
+    <view
+      class="content-section"
+      :style="[
+        {
+          transform: coverTransform,
+          transition: coverTransition,
+        },
+      ]"
+      @touchstart="coverTouchstart"
+      @touchmove="coverTouchmove"
+      @touchend="coverTouchend"
+    >
+      <image class="mine-image" src="@/static/images/mine/arc.png"></image>
+
       <!-- <view class="mine-actions grid col-4 text-center">
         <view class="action-item" @click="handleJiaoLiuQun">
           <view class="iconfont icon-friendfill text-pink icon"></view>
@@ -44,25 +57,49 @@
         <view class="list-cell list-cell-arrow" @click="handleToEditInfo">
           <view class="menu-item-box">
             <view class="iconfont icon-user menu-icon"></view>
-            <view>编辑资料</view>
+            <view>个人资料</view>
           </view>
         </view>
-        <view class="list-cell list-cell-arrow" @click="handleHelp">
+        <view class="list-cell list-cell-arrow" @click="handleToPwd">
           <view class="menu-item-box">
-            <view class="iconfont icon-help menu-icon"></view>
-            <view>常见问题</view>
+            <view class="iconfont icon-password menu-icon"></view>
+            <view>修改密码</view>
           </view>
         </view>
+      </view>
+
+      <view class="menu-list">
         <view class="list-cell list-cell-arrow" @click="handleAbout">
           <view class="menu-item-box">
             <view class="iconfont icon-aixin menu-icon"></view>
             <view>关于我们</view>
           </view>
         </view>
-        <view class="list-cell list-cell-arrow" @click="handleToSetting">
+        <view class="list-cell list-cell-arrow" @click="handleHelp">
+          <view class="menu-item-box">
+            <view class="iconfont icon-help menu-icon"></view>
+            <view>常见问题</view>
+          </view>
+        </view>
+        <view class="list-cell list-cell-arrow" @click="handleCleanTmp">
           <view class="menu-item-box">
-            <view class="iconfont icon-setting menu-icon"></view>
-            <view>应用设置</view>
+            <view class="iconfont icon-clean menu-icon"></view>
+            <view>清理缓存</view>
+            <view style="margin: 0 15px 0 auto; font-size: 14px; color: #909399">{{ settings.$state.currentSize }}</view>
+          </view>
+        </view>
+        <view class="list-cell list-cell-arrow" @click="handleToUpgrade">
+          <view class="menu-item-box">
+            <view class="iconfont icon-refresh menu-icon"></view>
+            <view>检查更新</view>
+          </view>
+        </view>
+      </view>
+
+      <view class="cu-list menu">
+        <view class="cu-item item-box">
+          <view class="content text-center" @click="handleLogout">
+            <text class="text-black">退出登录</text>
           </view>
         </view>
       </view>
@@ -73,41 +110,53 @@
 <script setup>
 import config from "@/config";
 import storage from "@/utils/storage";
-import { onLoad, onShow, onHide, onLaunch } from "@dcloudio/uni-app";
+import { onLoad, onShow, onHide, onLaunch, onNavigationBarButtonTap } from "@dcloudio/uni-app";
 import { ref, reactive, computed, getCurrentInstance, toRefs, inject } from "vue";
 
 import useStores from "@/store/modules/user.js";
+import settingStore from "@/store/modules/setting.js";
 const useStore = useStores();
+const settings = settingStore();
 
 const { proxy } = getCurrentInstance();
 
-const data = reactive({
-  name: useStore.$state.name,
-  version: getApp().globalData.config.appInfo.version,
-});
-
 const avatar = computed(() => {
   return useStore.$state.avatar;
 });
+
 const windowHeight = computed(() => {
   return uni.getSystemInfoSync().windowHeight - 50;
 });
 
-function handleToInfo() {
-  proxy.$tab.navigateTo("/pages/mine/info/index");
-}
-function handleToEditInfo() {
-  proxy.$tab.navigateTo("/pages/mine/info/edit");
-}
-function handleToSetting() {
-  proxy.$tab.navigateTo("/pages/mine/setting/index");
-}
+const data = reactive({
+  name: useStore.$state.name,
+  phone: useStore.$state.phonenumber,
+  version: getApp().globalData.config.appInfo.version,
+
+  coverTransform: "translateY(0px)",
+  coverTransition: "0s",
+  moving: false,
+});
+
+const { coverTransform, coverTransition, moving } = toRefs(data);
+
+/**
+ * @点击登录
+ */
 function handleToLogin() {
   proxy.$tab.reLaunch("/pages/login");
 }
+
+/**
+ * @点击头像
+ */
 function handleToAvatar() {
   proxy.$tab.navigateTo("/pages/mine/avatar/index");
 }
+
+/**
+ * @退出登录
+ */
 function handleLogout() {
   proxy.$modal.confirm("确定注销并退出系统吗?").then(() => {
     useStore.LogOut().then(() => {
@@ -115,19 +164,99 @@ function handleLogout() {
     });
   });
 }
+
+/**
+ * @常见问题
+ */
 function handleHelp() {
   proxy.$tab.navigateTo("/pages/mine/help/index");
 }
+
+/**
+ * @个人资料
+ */
+function handleToEditInfo() {
+  proxy.$tab.navigateTo("/pages/mine/info/index");
+}
+
+/**
+ * @修改密码
+ */
+function handleToPwd() {
+  proxy.$tab.navigateTo("/pages/mine/pwd/index");
+}
+
+/**
+ * @检查更新
+ */
+function handleToUpgrade() {
+  proxy.$modal.showToast("模块建设中~");
+}
+
+/**
+ * @关于我们
+ */
 function handleAbout() {
   proxy.$tab.navigateTo("/pages/mine/about/index");
 }
-function handleJiaoLiuQun() {
-  // proxy.$modal.showToast("QQ:1813914505");
-  proxy.$modal.showToast("模块建设中~");
+
+/**
+ * @清理缓存
+ */
+function handleCleanTmp() {
+  // #ifdef H5
+  proxy.$modal.showToast("H5暂不支持此功能");
+  // #endif
+
+  // #ifdef APP-PLUS
+  proxy.$setting.clearCache();
+  // #endif
 }
-function handleBuilding() {
-  proxy.$modal.showToast("模块建设中~");
+
+let startY = 0,
+  moveY = 0,
+  pageAtTop = true;
+
+function coverTouchstart(e) {
+  if (pageAtTop === false) {
+    return;
+  }
+  coverTransition.value = "transform .1s linear";
+  startY = e.touches[0].clientY;
+}
+function coverTouchmove(e) {
+  moveY = e.touches[0].clientY;
+  let moveDistance = moveY - startY;
+  if (moveDistance < 0) {
+    moving.value = false;
+    return;
+  }
+  moving.value = true;
+  if (moveDistance >= 80 && moveDistance < 100) {
+    moveDistance = 80;
+  }
+  if (moveDistance > 0 && moveDistance <= 80) {
+    coverTransform.value = `translateY(${moveDistance}px)`;
+  }
+}
+function coverTouchend() {
+  if (moving.value === false) {
+    return;
+  }
+  moving.value = false;
+  coverTransition.value = "transform 0.3s cubic-bezier(.21,1.93,.53,.64)";
+  coverTransform.value = "translateY(0px)";
 }
+
+onLoad((options) => {});
+
+// 自定义导航事件
+onNavigationBarButtonTap((e) => {
+  console.log(e);
+  if (e.float == "right") {
+    proxy.$tab.navigateTo("/pages/mine/setting/index");
+  }
+});
 </script>
 
 <style lang="scss">
@@ -136,7 +265,7 @@ function handleBuilding() {
   height: 100%;
 
   .header-section {
-    padding: 15px 15px 45px 15px;
+    padding: 55px 15px 0 15px;
     background-color: #149eff;
     color: white;
 
@@ -161,11 +290,33 @@ function handleBuilding() {
         line-height: 30px;
       }
     }
+
+    .vip-card-box {
+      display: flex;
+      flex-direction: column;
+      color: #f7d680;
+      height: 132px;
+      background: url("@/static/images/mine/vip-card.png");
+      background-size: 100% 100%;
+      border-radius: 8px 8px 0 0;
+      overflow: hidden;
+      position: relative;
+      padding: 11px 13px;
+    }
   }
 
   .content-section {
     position: relative;
-    top: -50px;
+    margin-top: -85px;
+    background-color: #f8f8f8;
+
+    .mine-image {
+      position: absolute;
+      left: 0;
+      top: -16px;
+      width: 100%;
+      height: 36upx;
+    }
 
     .mine-actions {
       margin: 0.625rem 0.625rem;
@@ -188,3 +339,18 @@ function handleBuilding() {
   }
 }
 </style>
+
+<style lang="scss" scoped>
+.item-box {
+  background-color: #ffffff;
+  margin: 30rpx;
+  display: flex;
+  flex-direction: row;
+  justify-content: center;
+  align-items: center;
+  padding: 10rpx;
+  border-radius: 8rpx;
+  color: #303133;
+  font-size: 32rpx;
+}
+</style>

+ 0 - 148
src/pages/mine/info/edit.vue

@@ -1,148 +0,0 @@
-<template>
-  <view class="container">
-    <view class="example">
-      <uni-forms ref="form" :model="user" labelWidth="80px">
-        <uni-forms-item label="用户昵称" name="nickName">
-          <uni-easyinput v-model="user.nickName" placeholder="请输入昵称" />
-        </uni-forms-item>
-        <uni-forms-item label="手机号码" name="phonenumber">
-          <uni-easyinput v-model="user.phonenumber" placeholder="请输入手机号码" />
-        </uni-forms-item>
-        <uni-forms-item label="邮箱" name="email">
-          <uni-easyinput v-model="user.email" placeholder="请输入邮箱" />
-        </uni-forms-item>
-        <uni-forms-item label="性别" name="sex" required>
-          <uni-data-checkbox v-model="user.sex" :localdata="sexs" />
-        </uni-forms-item>
-      </uni-forms>
-      <button type="primary" @click="submit">提交</button>
-    </view>
-  </view>
-</template>
-
-<script setup>
-import { getUserProfile } from "@/api/system/user";
-import { updateUserProfile } from "@/api/system/user";
-
-import { onReady, onLoad, onShow, onNavigationBarButtonTap } from "@dcloudio/uni-app";
-import { ref, onMounted, inject, shallowRef, reactive, getCurrentInstance, toRefs } from "vue";
-
-const data = reactive({
-  user: {
-    nickName: "",
-    phonenumber: "",
-    email: "",
-    sex: "",
-  },
-  sexs: [
-    {
-      text: "男",
-      value: "0",
-    },
-    {
-      text: "女",
-      value: "1",
-    },
-  ],
-  rules: {
-    nickName: {
-      rules: [
-        {
-          required: true,
-          errorMessage: "用户昵称不能为空",
-        },
-      ],
-    },
-    phonenumber: {
-      rules: [
-        {
-          required: true,
-          errorMessage: "手机号码不能为空",
-        },
-        {
-          pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
-          errorMessage: "请输入正确的手机号码",
-        },
-      ],
-    },
-    email: {
-      rules: [
-        {
-          required: true,
-          errorMessage: "邮箱地址不能为空",
-        },
-        {
-          format: "email",
-          errorMessage: "请输入正确的邮箱地址",
-        },
-      ],
-    },
-  },
-});
-
-const { user, sexs, rules } = toRefs(data);
-
-const { proxy } = getCurrentInstance();
-
-const form = ref(null);
-
-function getUser() {
-  getUserProfile().then((response) => {
-    console.log(response);
-    user.value = response.data.user;
-  });
-}
-function submit(ref) {
-  form.value.validate().then((res) => {
-    updateUserProfile(user.value).then((response) => {
-      proxy.$modal.msgSuccess("修改成功,重新登录后生效!");
-      proxy.$tab.reLaunch("pages/mine/index");
-    });
-  });
-}
-
-onLoad((options) => {
-  getUser();
-});
-
-onReady(() => {
-  form.value.setRules(rules.value);
-});
-</script>
-
-<style>
-page {
-  background-color: #ffffff;
-}
-</style>
-
-<style lang="scss">
-.example {
-  padding: 15px;
-  background-color: #fff;
-}
-
-.segmented-control {
-  margin-bottom: 15px;
-}
-
-.button-group {
-  margin-top: 15px;
-  display: flex;
-  justify-content: space-around;
-}
-
-.form-item {
-  display: flex;
-  align-items: center;
-  flex: 1;
-}
-
-.button {
-  display: flex;
-  align-items: center;
-  height: 35px;
-  line-height: 35px;
-  margin-left: 10px;
-}
-</style>

+ 127 - 7
src/pages/mine/info/index.vue

@@ -1,20 +1,38 @@
 <template>
   <view class="container">
-    <uni-list>
+    <!-- <uni-list>
       <uni-list-item showExtraIcon="true" :extraIcon="{ type: 'person-filled' }" title="昵称" :rightText="user.nickName" />
       <uni-list-item showExtraIcon="true" :extraIcon="{ type: 'phone-filled' }" title="手机号码" :rightText="user.phonenumber" />
       <uni-list-item showExtraIcon="true" :extraIcon="{ type: 'email-filled' }" title="邮箱" :rightText="user.email" />
       <uni-list-item showExtraIcon="true" :extraIcon="{ type: 'auth-filled' }" title="岗位" :rightText="postGroup" />
       <uni-list-item showExtraIcon="true" :extraIcon="{ type: 'staff-filled' }" title="角色" :rightText="roleGroup" />
       <uni-list-item showExtraIcon="true" :extraIcon="{ type: 'calendar-filled' }" title="创建日期" :rightText="user.createTime" />
-    </uni-list>
+    </uni-list> -->
+
+    <view class="example">
+      <uni-forms ref="form" :model="user" labelWidth="80px">
+        <uni-forms-item label="用户昵称" name="nickName">
+          <uni-easyinput v-model="user.nickName" placeholder="请输入昵称" />
+        </uni-forms-item>
+        <uni-forms-item label="手机号码" name="phonenumber">
+          <uni-easyinput v-model="user.phonenumber" placeholder="请输入手机号码" />
+        </uni-forms-item>
+        <uni-forms-item label="邮箱" name="email">
+          <uni-easyinput v-model="user.email" placeholder="请输入邮箱" />
+        </uni-forms-item>
+        <uni-forms-item label="性别" name="sex" required>
+          <uni-data-checkbox v-model="user.sex" :localdata="sexs" />
+        </uni-forms-item>
+      </uni-forms>
+      <button type="primary" class="edtiButtom" @click="submit">修改资料</button>
+    </view>
   </view>
 </template>
 
 <script setup>
-import { getUserProfile } from "@/api/system/user";
-import { onLoad, onShow, onHide, onLaunch } from "@dcloudio/uni-app";
-import { ref, reactive, computed, getCurrentInstance, toRefs, inject } from "vue";
+import { getUserProfile, updateUserProfile } from "@/api/system/user";
+import { onLoad, onShow, onHide, onReady, onLaunch, onNavigationBarButtonTap } from "@dcloudio/uni-app";
+import { ref, shallowRef, reactive, computed, getCurrentInstance, toRefs, onMounted, inject } from "vue";
 
 import useStores from "@/store/modules/user.js";
 const useStore = useStores();
@@ -24,11 +42,64 @@ const { proxy } = getCurrentInstance();
 const data = reactive({
   name: useStore.$state.name,
   version: getApp().globalData.config.appInfo.version,
+
+  user: {
+    nickName: "",
+    phonenumber: "",
+    email: "",
+    sex: "",
+  },
+  sexs: [
+    {
+      text: "男",
+      value: "0",
+    },
+    {
+      text: "女",
+      value: "1",
+    },
+  ],
+  rules: {
+    nickName: {
+      rules: [
+        {
+          required: true,
+          errorMessage: "用户昵称不能为空",
+        },
+      ],
+    },
+    phonenumber: {
+      rules: [
+        {
+          required: true,
+          errorMessage: "手机号码不能为空",
+        },
+        {
+          pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
+          errorMessage: "请输入正确的手机号码",
+        },
+      ],
+    },
+    email: {
+      rules: [
+        {
+          required: true,
+          errorMessage: "邮箱地址不能为空",
+        },
+        {
+          format: "email",
+          errorMessage: "请输入正确的邮箱地址",
+        },
+      ],
+    },
+  },
 });
 
-const user = ref({});
+const { user, sexs, rules } = toRefs(data);
+
 const roleGroup = ref("");
 const postGroup = ref("");
+const form = ref(null);
 
 function getUser() {
   getUserProfile().then((response) => {
@@ -38,9 +109,22 @@ function getUser() {
   });
 }
 
-onLoad(() => {
+function submit(ref) {
+  form.value.validate().then((res) => {
+    updateUserProfile(user.value).then((response) => {
+      proxy.$modal.msgSuccess("修改成功,重新登录后生效!");
+      proxy.$tab.reLaunch("pages/mine/index");
+    });
+  });
+}
+
+onLoad((options) => {
   getUser();
 });
+
+onReady(() => {
+  form.value.setRules(rules.value);
+});
 </script>
 
 <style lang="scss">
@@ -48,3 +132,39 @@ page {
   background-color: #ffffff;
 }
 </style>
+
+<style lang="scss">
+.example {
+  padding: 15px;
+  background-color: #fff;
+
+  .edtiButtom {
+    font-size: 15px;
+    border-radius: 100px;
+  }
+}
+
+.segmented-control {
+  margin-bottom: 15px;
+}
+
+.button-group {
+  margin-top: 15px;
+  display: flex;
+  justify-content: space-around;
+}
+
+.form-item {
+  display: flex;
+  align-items: center;
+  flex: 1;
+}
+
+.button {
+  display: flex;
+  align-items: center;
+  height: 35px;
+  line-height: 35px;
+  margin-left: 10px;
+}
+</style>

+ 66 - 23
src/pages/mine/setting/index.vue

@@ -1,29 +1,44 @@
 <template>
   <view class="setting-container" :style="{ height: `${windowHeight}px` }">
     <view class="menu-list">
+      <view class="list-cell list-cell-arrow" @click="handleToEditInfo">
+        <view class="menu-item-box">
+          <view class="iconfont icon-user menu-icon"></view>
+          <view>个人资料</view>
+        </view>
+      </view>
       <view class="list-cell list-cell-arrow" @click="handleToPwd">
         <view class="menu-item-box">
           <view class="iconfont icon-password menu-icon"></view>
           <view>修改密码</view>
         </view>
       </view>
-      <view class="list-cell list-cell-arrow" @click="handleToUpgrade">
+    </view>
+
+    <view class="menu-list">
+      <view class="list-cell list-cell-arrow" @click="handleAbout">
         <view class="menu-item-box">
-          <view class="iconfont icon-refresh menu-icon"></view>
-          <view>检查更新</view>
+          <view class="iconfont icon-aixin menu-icon"></view>
+          <view>关于我们</view>
+        </view>
+      </view>
+      <view class="list-cell list-cell-arrow" @click="handleHelp">
+        <view class="menu-item-box">
+          <view class="iconfont icon-help menu-icon"></view>
+          <view>常见问题</view>
         </view>
       </view>
       <view class="list-cell list-cell-arrow" @click="handleCleanTmp">
         <view class="menu-item-box">
           <view class="iconfont icon-clean menu-icon"></view>
           <view>清理缓存</view>
+          <view style="margin: 0 15px 0 auto; font-size: 14px; color: #909399">{{ settings.$state.currentSize }}</view>
         </view>
       </view>
-    </view>
-    <view class="cu-list menu">
-      <view class="cu-item item-box">
-        <view class="content text-center" @click="handleLogout">
-          <text class="text-black">退出登录</text>
+      <view class="list-cell list-cell-arrow" @click="handleToUpgrade">
+        <view class="menu-item-box">
+          <view class="iconfont icon-refresh menu-icon"></view>
+          <view>检查更新</view>
         </view>
       </view>
     </view>
@@ -31,25 +46,62 @@
 </template>
 
 <script setup>
+import { onLoad, onShow, onHide, onLaunch, onNavigationBarButtonTap } from "@dcloudio/uni-app";
 import { ref, reactive, computed, getCurrentInstance, toRefs, inject } from "vue";
 
 import useStores from "@/store/modules/user.js";
+import settingStore from "@/store/modules/setting.js";
 const useStore = useStores();
+const settings = settingStore();
 
 const { proxy } = getCurrentInstance();
 
 const data = reactive({});
 
+const {} = toRefs(data);
+
 const windowHeight = computed(() => {
   return uni.getSystemInfoSync().windowHeight - 50;
 });
 
+/**
+ * @个人资料
+ */
+function handleToEditInfo() {
+  proxy.$tab.navigateTo("/pages/mine/info/index");
+}
+
+/**
+ * @修改密码
+ */
 function handleToPwd() {
   proxy.$tab.navigateTo("/pages/mine/pwd/index");
 }
+
+/**
+ * @常见问题
+ */
+function handleHelp() {
+  proxy.$tab.navigateTo("/pages/mine/help/index");
+}
+
+/**
+ * @检查更新
+ */
 function handleToUpgrade() {
   proxy.$modal.showToast("模块建设中~");
 }
+
+/**
+ * @关于我们
+ */
+function handleAbout() {
+  proxy.$tab.navigateTo("/pages/mine/about/index");
+}
+
+/**
+ * @清理缓存
+ */
 function handleCleanTmp() {
   // #ifdef H5
   proxy.$modal.showToast("H5暂不支持此功能");
@@ -59,6 +111,10 @@ function handleCleanTmp() {
   proxy.$setting.clearCache();
   // #endif
 }
+
+/**
+ * @退出登录
+ */
 function handleLogout() {
   proxy.$modal.confirm("确定注销并退出系统吗?").then(() => {
     useStore.LogOut().then(() => {
@@ -66,19 +122,6 @@ function handleLogout() {
     });
   });
 }
-</script>
 
-<style lang="scss" scoped>
-.item-box {
-  background-color: #ffffff;
-  margin: 30rpx;
-  display: flex;
-  flex-direction: row;
-  justify-content: center;
-  align-items: center;
-  padding: 10rpx;
-  border-radius: 8rpx;
-  color: #303133;
-  font-size: 32rpx;
-}
-</style>
+onLoad((options) => {});
+</script>

+ 11 - 12
src/pages/serveConfig.vue

@@ -15,7 +15,9 @@
 
       <!-- <u-input v-model="port" type="number" placeholder="端口号(必填)" border="none" maxlength="5" clearable> </u-input> -->
 
-      <u-input v-model="port" type="number" placeholder="端口号(非必填)" border="none" maxlength="5" clearable> </u-input>
+      <u-input style="margin-bottom: 15px" v-model="port" type="number" placeholder="端口号(非必填)" border="none" maxlength="5" clearable> </u-input>
+
+      <u-input v-model="content" placeholder="备注(非必填)" border="none" maxlength="20" clearable> </u-input>
 
       <u-button type="primary" style="width: 100%; height: 45px; font-size: 17px; margin-top: 20px" @click="handleSubmit()" shape="circle"> 保 存</u-button>
     </view>
@@ -28,17 +30,18 @@ import { onLoad, onShow, onHide, onLaunch } from "@dcloudio/uni-app";
 import { ref, onMounted, inject, shallowRef, reactive, toRefs, getCurrentInstance } from "vue";
 import { getToken, setToken, removeToken } from "@/utils/auth";
 import publicStore from "@/store/modules/public.js";
-const newPublicStore = publicStore();
+const publicStores = publicStore();
 
 const { proxy } = getCurrentInstance();
 
 const dataList = reactive({
   linkUrl: "", //链接地址
   port: "",
+  content: "",
 });
 
 const uForm = ref(null);
-const { linkUrl, port } = toRefs(dataList);
+const { linkUrl, port, content } = toRefs(dataList);
 
 /**
  * @扫一扫
@@ -53,7 +56,6 @@ function scanClick() {
       });
 
       linkUrl.value = e.result.split(":")[0];
-
       port.value = e.result.split(":")[1];
     },
     fail: (err) => {
@@ -74,7 +76,7 @@ function scanClick() {
 }
 
 /**
- * @提交
+ * @保存
  * @按钮点击事件
  */
 function handleSubmit() {
@@ -95,8 +97,10 @@ function handleSubmit() {
 
   if (!port.value) {
     uni.setStorageSync("serveUrl", linkUrl.value);
+    publicStores.getServeList(linkUrl.value, content.value);
   } else {
     uni.setStorageSync("serveUrl", linkUrl.value + ":" + port.value);
+    publicStores.getServeList(linkUrl.value + ":" + port.value, content.value);
   }
 
   config.baseUrl = "http://" + uni.getStorageSync("serveUrl") + "/prod-api";
@@ -107,15 +111,10 @@ function handleSubmit() {
  * @跳转登录
  */
 function navigateTo() {
-  proxy.$tab.redirectTo("/pages/login");
+  proxy.$tab.redirectTo("/pages/serveConfigSelect");
 }
 
-onLoad((options) => {
-  if (uni.getStorageSync("serveUrl")) {
-    linkUrl.value = uni.getStorageSync("serveUrl").split(":")[0];
-    port.value = uni.getStorageSync("serveUrl").split(":")[1];
-  }
-});
+onLoad((options) => {});
 </script>
 
 <style>

+ 222 - 0
src/pages/serveConfigSelect.vue

@@ -0,0 +1,222 @@
+<template>
+  <view id="serveConfig">
+    <view class="top">
+      <u-icon name="arrow-left" size="17px" color="#000" :bold="true" @click="navigateTo"></u-icon>
+    </view>
+
+    <view class="content">
+      <text class="title">选择服务器地址</text>
+      <u-icon class="icons" name="scan" color="#2a98ff" size="22" @tap="serveClick(1)"></u-icon>
+      <text class="setting" @click="serveClick(2)"> 添加 </text>
+    </view>
+
+    <view class="bottom">
+      <div class="serveList">
+        <u-radio-group v-model="radiovalue" placement="column" @change="handleRadio">
+          <div style="display: flex; background-color: #f5f6fa !important; margin-bottom: 15px; padding: 10px; border-radius: 8px" v-for="(item, index) in radiolist" :key="index">
+            <u-radio :customStyle="{ margin: 'auto 0' }" :value="item.id" :name="item.id"></u-radio>
+
+            <div style="margin: auto 0 auto 0; width: 100%" @click="handleRadio(item.id)">
+              <div style="margin-bottom: 5px; font-weight: 600">{{ item.linkUrl }}</div>
+              <div style="color: #a0a4af; font-size: 12px">备注:{{ item.content }}</div>
+            </div>
+
+            <div v-if="item.id != radiovalue" style="margin: auto 0 auto 0; height: 100%" @click="deleteRadio(index)">
+              <u-icon name="close" color="#a0a4af" size="14"></u-icon>
+            </div>
+          </div>
+        </u-radio-group>
+      </div>
+
+      <u-button v-if="radiolist.length > 0" type="primary" style="width: 100%; height: 45px; font-size: 17px; margin-top: 20px" @click="handleSubmit()" shape="circle"> 保 存</u-button>
+    </view>
+  </view>
+</template>
+
+<script setup>
+import config from "@/config";
+import { onLoad, onShow, onHide, onLaunch } from "@dcloudio/uni-app";
+import { ref, onMounted, inject, shallowRef, reactive, toRefs, getCurrentInstance, watchEffect } from "vue";
+import { getToken, setToken, removeToken } from "@/utils/auth";
+import publicStore from "@/store/modules/public.js";
+const publicStores = publicStore();
+
+const { proxy } = getCurrentInstance();
+
+const dataList = reactive({
+  radiolist: [],
+  radiovalue: "",
+});
+
+const uForm = ref(null);
+const { radiolist, radiovalue } = toRefs(dataList);
+
+/**
+ * @获取serveList
+ */
+
+
+/**
+ * @切换单选
+ * @按钮点击事件
+ */
+function handleRadio(id) {
+  radiovalue.value = id;
+  let serveList = uni.getStorageSync("serveList");
+  serveList[0].radiovalue = radiovalue.value;
+  uni.setStorageSync("serveList", serveList);
+}
+
+/**
+ * @删除
+ * @按钮点击事件
+ */
+function deleteRadio(index) {
+  let serveList = uni.getStorageSync("serveList");
+  serveList[0].radiolist.splice(index, 1);
+  uni.setStorageSync("serveList", serveList);
+
+  init();
+}
+
+/**
+ * @扫一扫
+ * @按钮点击事件
+ */
+function serveClick(type) {
+  if (type == 1) {
+    uni.scanCode({
+      success: async (e) => {
+        uni.showToast({
+          title: "扫码成功",
+          icon: "none",
+        });
+
+        publicStores.getServeList(e.result, "");
+
+        init();
+      },
+      fail: (err) => {
+        uni.showToast({
+          title: "扫码失败",
+          icon: "none",
+        });
+        console.log("扫码失败", err);
+      },
+      complete: () => {
+        // uni.showToast({
+        //   title: "扫码结束",
+        //   icon: "none",
+        // });
+        console.log("扫码结束");
+      },
+    });
+  } else if (type == 2) {
+    proxy.$tab.redirectTo("/pages/serveConfig");
+  }
+}
+
+/**
+ * @保存
+ * @按钮点击事件
+ */
+function handleSubmit() {
+  let serveList = uni.getStorageSync("serveList");
+  if (serveList.length > 0) {
+    serveList[0].radiolist.forEach((el) => {
+      if (el.id == serveList[0].radiovalue) {
+        uni.setStorageSync("serveUrl", el.linkUrl);
+        config.baseUrl = "http://" + uni.getStorageSync("serveUrl") + "/prod-api";
+        navigateTo();
+      }
+    });
+  }
+}
+
+/**
+ * @跳转登录
+ */
+function navigateTo() {
+  proxy.$tab.reLaunch("/pages/login");
+}
+
+/**
+ * @初始化
+ */
+function init() {
+  let serveList = uni.getStorageSync("serveList");
+  if (serveList.length > 0) {
+    radiovalue.value = serveList[0].radiovalue;
+    radiolist.value = serveList[0].radiolist;
+  }
+
+  proxy.$tab.redirectTo("/pages/serveConfigSelect"); //重载当前页
+}
+
+onLoad((options) => {
+  init();
+});
+</script>
+
+<style>
+page {
+  background-color: #ffffff;
+}
+</style>
+
+<style lang="scss" scoped>
+#serveConfig {
+  position: relative;
+  z-index: 1;
+  width: 100%;
+  padding: 0 40px;
+  margin: auto;
+  padding-top: 20%;
+
+  .top {
+  }
+
+  .content {
+    display: flex;
+    margin: 30px 0;
+
+    .title {
+      margin: auto auto auto 0;
+      color: #000;
+      font-size: 18px;
+    }
+
+    .icons {
+      margin: auto 5px auto 0;
+    }
+
+    .setting {
+      color: #2a98ff;
+      margin: auto 0;
+    }
+  }
+
+  .bottom {
+    .serveList {
+      max-height: calc(59px * 6);
+      overflow: auto;
+    }
+    // .u-radio {
+    //   :deep(.u-radio__icon-wrap) {
+    //     background-color: transparent !important;
+    //   }
+
+    //   :deep(.u-icon) {
+    //     width: 8px;
+    //     height: 8px;
+    //     background-color: rgb(41, 121, 255);
+    //     border-radius: 100%;
+    //   }
+
+    //   :deep(.u-icon__icon) {
+    //     display: none;
+    //   }
+    // }
+  }
+}
+</style>

+ 6 - 1
src/permission.js

@@ -1,10 +1,11 @@
 import { getToken } from "@/utils/auth";
+import setting from "@/plugins/setting";
 
 // 登录页面
 const loginPage = "/pages/login";
 
 // 页面白名单
-const whiteList = ["/pages/login", "/pages/serveConfig", "/pages/common/textview/index1", "/pages/common/webview/index", "/pages/business/mhxf/unitInfoCollection/index"];
+const whiteList = ["/pages/login", "/pages/serveConfig", "/pages/serveConfigSelect", "/pages/common/textview/index1", "/pages/common/webview/index", "/pages/business/mhxf/unitInfoCollection/index"];
 
 // 检查地址白名单
 function checkWhite(url) {
@@ -17,6 +18,10 @@ let list = ["navigateTo", "redirectTo", "reLaunch", "switchTab"];
 list.forEach((item) => {
   uni.addInterceptor(item, {
     invoke(to) {
+      // #ifdef APP-PLUS
+      setting.formatSize(); //获取缓存大小
+      // #endif
+
       if (getToken()) {
         if (to.url === loginPage) {
           uni.reLaunch({ url: "/" });

+ 4 - 0
src/plugins/setting.js

@@ -1,3 +1,5 @@
+import settingStore from "@/store/modules/setting.js";
+
 /**
  * @获取缓存
  */
@@ -16,6 +18,8 @@ const formatSize = () => {
     } else {
       v = (sizeCache / 1073741824).toFixed(2) + "GB";
     }
+
+    settingStore().$state.currentSize = currentSize
   });
   return currentSize;
 };

+ 7 - 3
src/static/iconfont/uciconfont/iconfont.css

@@ -1,8 +1,8 @@
 @font-face {
   font-family: "iconfont"; /* Project id 3620854 */
-  src: url('iconfont.woff2?t=1662690989920') format('woff2'),
-       url('iconfont.woff?t=1662690989920') format('woff'),
-       url('iconfont.ttf?t=1662690989920') format('truetype');
+  src: url('iconfont.woff2?t=1681973516727') format('woff2'),
+       url('iconfont.woff?t=1681973516727') format('woff'),
+       url('iconfont.ttf?t=1681973516727') format('truetype');
 }
 
 .iconfont {
@@ -13,6 +13,10 @@
   -moz-osx-font-smoothing: grayscale;
 }
 
+.ucicon-shezhi:before {
+  content: "\e70f";
+}
+
 .ucicon-filter:before {
   content: "\e7c7";
 }

BIN
src/static/iconfont/uciconfont/iconfont.ttf


BIN
src/static/iconfont/uciconfont/iconfont.woff


BIN
src/static/iconfont/uciconfont/iconfont.woff2


BIN
src/static/images/mine/arc.png


BIN
src/static/images/mine/vip-card.png


+ 40 - 10
src/store/modules/public.js

@@ -25,17 +25,17 @@ const publicStore = defineStore("public", {
     ],
     timeList: [
       new Date().getFullYear() +
-        "-" +
-        (new Date().getMonth() + 1 < 10 ? "0" + (new Date().getMonth() + 1) : "" + (new Date().getMonth() + 1)) +
-        "-" +
-        (new Date().getDate() < 10 ? "0" + new Date().getDate() : new Date().getDate()) +
-        " 00:00:00",
+      "-" +
+      (new Date().getMonth() + 1 < 10 ? "0" + (new Date().getMonth() + 1) : "" + (new Date().getMonth() + 1)) +
+      "-" +
+      (new Date().getDate() < 10 ? "0" + new Date().getDate() : new Date().getDate()) +
+      " 00:00:00",
       new Date().getFullYear() +
-        "-" +
-        (new Date().getMonth() + 1 < 10 ? "0" + (new Date().getMonth() + 1) : "" + (new Date().getMonth() + 1)) +
-        "-" +
-        (new Date().getDate() < 10 ? "0" + new Date().getDate() : new Date().getDate()) +
-        " 23:59:59",
+      "-" +
+      (new Date().getMonth() + 1 < 10 ? "0" + (new Date().getMonth() + 1) : "" + (new Date().getMonth() + 1)) +
+      "-" +
+      (new Date().getDate() < 10 ? "0" + new Date().getDate() : new Date().getDate()) +
+      " 23:59:59",
     ],
 
     mhjz: [
@@ -256,6 +256,36 @@ const publicStore = defineStore("public", {
 
       return arr;
     },
+
+
+    /**
+     * @公共添加服务器列表
+     */
+    getServeList(linkUrl, content) {
+      let serveList = uni.getStorageSync("serveList");
+      if (serveList.length <= 0) {
+        uni.setStorageSync("serveList", [
+          {
+            radiolist: [
+              {
+                id: 1,
+                linkUrl: linkUrl,
+                content: content,
+              },
+            ],
+            radiovalue: 1,
+          },
+        ]);
+      } else {
+        serveList[0].radiolist.push({
+          id: serveList[0].radiolist[serveList[0].radiolist.length - 1].id + 1,
+          linkUrl: linkUrl,
+          content: content,
+        });
+
+        uni.setStorageSync("serveList", serveList);
+      }
+    }
   },
 });
 

+ 22 - 0
src/store/modules/setting.js

@@ -0,0 +1,22 @@
+import { defineStore } from "pinia";
+
+const settingStore = defineStore("setting", {
+    state: () => ({
+        currentSize: "",//APP缓存
+    }),
+    persist: {
+        // 自定义数据持久化方式
+        // key: 'store-key', 指定key进行存储,此时非key的值不会持久化,刷新就会丢失
+        storage: window ? window.localStorage : uni.setStorageSync(), // 指定换成地址
+        // paths: ['nested.data'],// 指定需要持久化的state的路径名称
+        beforeRestore: (context) => {
+            console.log("Before" + context);
+        },
+        afterRestore: (context) => {
+            console.log("After" + context);
+        },
+    },
+    actions: {},
+});
+
+export default settingStore;

+ 8 - 0
src/store/modules/user.js

@@ -9,6 +9,7 @@ const useStores = defineStore("useStores", {
   state: () => ({
     token: getToken(),
     name: storage.get(constant.name),//用户名称
+    phonenumber: storage.get(constant.phonenumber),//用户手机号
     avatar: storage.get(constant.avatar),
     roles: storage.get(constant.roles),
     permissions: storage.get(constant.permissions),
@@ -81,7 +82,10 @@ const useStores = defineStore("useStores", {
             }
 
             this.SET_NAME(data.user.userName);
+            this.SET_PHONE(data.user.phonenumber);
             this.SET_AVATAR(data.user.avatar);
+
+
             resolve(res);
           })
           .catch((error) => {
@@ -124,6 +128,10 @@ const useStores = defineStore("useStores", {
       this.name = name;
       storage.set(constant.name, name);
     },
+    SET_PHONE(phonenumber) {
+      this.phonenumber = phonenumber;
+      storage.set(constant.phonenumber, phonenumber);
+    },
     SET_AVATAR(avatar) {
       this.avatar = avatar;
       storage.set(constant.avatar, avatar);

+ 0 - 2
src/uni_modules/uni-easyinput/components/uni-easyinput/common.js

@@ -6,9 +6,7 @@
  */
 export const debounce = function(func, wait = 1000, immediate = true) {
 	let timer;
-	console.log(1);
 	return function() {
-		console.log(123);
 		let context = this,
 			args = arguments;
 		if (timer) clearTimeout(timer);

+ 1 - 1
src/utils/storage.js

@@ -4,7 +4,7 @@ import constant from './constant'
 let storageKey = 'storage_data'
 
 // 存储节点变量名
-let storageNodeKeys = [constant.avatar, constant.name, constant.roles, constant.permissions, constant.loginTitle, constant.loginBottomTitle, constant.loginBg, constant.loginLogo, constant.tenantId]
+let storageNodeKeys = [constant.avatar, constant.name, constant.phonenumber, constant.roles, constant.permissions, constant.loginTitle, constant.loginBottomTitle, constant.loginBg, constant.loginLogo, constant.tenantId]
 
 // 存储的数据
 let storageData = uni.getStorageSync(storageKey) || {}