Browse Source

登录注册功能新增/工作报告功能新增优化

fanghuisheng 8 months ago
parent
commit
e6700f7f18

+ 25 - 22
package.json

@@ -32,28 +32,30 @@
         "build:quickapp-webview": "uni build -p quickapp-webview",
         "build:quickapp-webview-huawei": "uni build -p quickapp-webview-huawei",
         "build:quickapp-webview-union": "uni build -p quickapp-webview-union",
-        "clear": "rimraf node_modules && npm install",
+        "clear": "rimraf node_modules && npm install --force",
         "clean": "npm cache clean --force"
     },
     "dependencies": {
         "@amap/amap-jsapi-loader": "^1.0.1",
-        "@dcloudio/uni-app": "3.0.0-alpha-3050320220729001",
-        "@dcloudio/uni-app-plus": "3.0.0-alpha-3050320220729001",
-        "@dcloudio/uni-components": "3.0.0-alpha-3050320220729001",
-        "@dcloudio/uni-h5": "3.0.0-alpha-3050320220729001",
-        "@dcloudio/uni-mp-alipay": "3.0.0-alpha-3050320220729001",
-        "@dcloudio/uni-mp-baidu": "3.0.0-alpha-3050320220729001",
-        "@dcloudio/uni-mp-kuaishou": "3.0.0-alpha-3050320220729001",
-        "@dcloudio/uni-mp-lark": "3.0.0-alpha-3050320220729001",
-        "@dcloudio/uni-mp-qq": "3.0.0-alpha-3050320220729001",
-        "@dcloudio/uni-mp-toutiao": "3.0.0-alpha-3050320220729001",
-        "@dcloudio/uni-mp-weixin": "3.0.0-alpha-3050320220729001",
-        "@dcloudio/uni-quickapp-webview": "3.0.0-alpha-3050320220729001",
+        "@dcloudio/uni-app": "3.0.0-alpha-4020320240703001",
+        "@dcloudio/uni-app-harmony": "3.0.0-alpha-4020320240703001",
+        "@dcloudio/uni-app-plus": "3.0.0-alpha-4020320240703001",
+        "@dcloudio/uni-components": "3.0.0-alpha-4020320240703001",
+        "@dcloudio/uni-h5": "3.0.0-alpha-4020320240703001",
+        "@dcloudio/uni-mp-alipay": "3.0.0-alpha-4020320240703001",
+        "@dcloudio/uni-mp-baidu": "3.0.0-alpha-4020320240703001",
+        "@dcloudio/uni-mp-jd": "3.0.0-alpha-4020320240703001",
+        "@dcloudio/uni-mp-kuaishou": "3.0.0-alpha-4020320240703001",
+        "@dcloudio/uni-mp-lark": "3.0.0-alpha-4020320240703001",
+        "@dcloudio/uni-mp-qq": "3.0.0-alpha-4020320240703001",
+        "@dcloudio/uni-mp-toutiao": "3.0.0-alpha-4020320240703001",
+        "@dcloudio/uni-mp-weixin": "3.0.0-alpha-4020320240703001",
+        "@dcloudio/uni-mp-xhs": "3.0.0-alpha-4020320240703001",
+        "@dcloudio/uni-quickapp-webview": "3.0.0-alpha-4020320240703001",
         "echarts": "^5.3.3",
-        "node-sass": "^7.0.1",
         "pinia": "2.0.14",
         "pinia-plugin-persistedstate": "^3.1.0",
-        "vue": "^3.2.47",
+        "vue": "^3.4.21",
         "vue-echarts": "^6.2.3",
         "vue-i18n": "^9.1.9",
         "vue-json-excel": "^0.3.0",
@@ -61,15 +63,16 @@
         "weixin-js-sdk": "^1.6.0"
     },
     "devDependencies": {
-        "@dcloudio/types": "^3.0.7",
-        "@dcloudio/uni-automator": "3.0.0-alpha-3050320220729001",
-        "@dcloudio/uni-cli-shared": "3.0.0-alpha-3050320220729001",
-        "@dcloudio/uni-stacktracey": "3.0.0-alpha-3050320220729001",
-        "@dcloudio/vite-plugin-uni": "3.0.0-alpha-3050320220729001",
+        "@dcloudio/types": "^3.4.8",
+        "@dcloudio/uni-automator": "3.0.0-alpha-4020320240703001",
+        "@dcloudio/uni-cli-shared": "3.0.0-alpha-4020320240703001",
+        "@dcloudio/uni-stacktracey": "3.0.0-alpha-4020320240703001",
+        "@dcloudio/vite-plugin-uni": "3.0.0-alpha-4020320240703001",
         "@vitejs/plugin-vue": "^2.3.3",
+        "@vue/runtime-core": "^3.4.21",
         "cross-env": "^7.0.3",
         "dayjs": "^1.11.7",
-        "sass": "^1.54.3",
-        "vite": "^2.9.14"
+        "sass": "1.57.1",
+        "vite": "5.2.8"
     }
 }

+ 0 - 1
src/App.vue

@@ -16,7 +16,6 @@ const { proxy } = getCurrentInstance();
 function initApp() {
   proxy.$settingStore.initThemeColor(storageSystem.get("themeColor")); //初始化默认主题
   proxy.$settingStore.systemHeightTop(); //初始化获取安全区高度
-  uni.hideTabBar(); //隐藏自带tabbar
 
   //#ifdef APP-PLUS
   plus.screen.lockOrientation("portrait-primary"); //设置不可横屏

+ 1 - 0
src/pages.json

@@ -736,6 +736,7 @@
     "backgroundColor": "#F8F8F8"
   },
   "tabBar": {
+    "fontSize": "12px",
     "color": "#a9a9a9",
     "selectedColor": "#000000",
     "borderStyle": "white",

+ 3 - 0
src/pages/business/common/projectMange/mall/components/mall-list.vue

@@ -177,6 +177,9 @@ export default {
 }
 .box-list {
   padding-top: 52px;
+  //#ifdef APP-PLUS || MP-WEIXIN
+  padding-bottom: 60px;
+  //#endif
   .box-list-item {
     position: relative;
     height: 60px;

+ 1 - 1
src/pages/business/common/projectMange/record/details.vue

@@ -11,7 +11,7 @@
     customClass="record-details-container scroll-height"
     :style="{
       //#ifdef APP-PLUS || MP-WEIXIN
-      height: 'calc(100vh - 44px)',
+      height: 'calc(100vh - 88px)',
       //#endif
       //#ifdef H5
       height: 'calc(100vh - 44px)',

+ 9 - 3
src/pages/business/common/projectMange/write/components/template1.vue

@@ -151,7 +151,7 @@
 
   <u-modal :show="modalShow" title="" :confirmText="'确定'" :cancelText="'取消'" :zoom="false" :showCancelButton="true" @confirm="modalConfirm" @cancel="modalShow = false">
     <view class="slot-content">
-      <u-checkbox-group v-model="projectsCheck" placement="row" :size="14">
+      <u-checkbox-group v-model="projectsCheck" placement="row" :size="14" v-if="projectsList.length > 0">
         <u-checkbox
           :customStyle="{ marginBottom: '8px', width: '50%' }"
           v-for="(item, index) in projectsList"
@@ -162,6 +162,7 @@
         >
         </u-checkbox>
       </u-checkbox-group>
+      <view v-else>请联系项目管理人员给您分配项目后重试!</view>
     </view>
   </u-modal>
 </template>
@@ -189,7 +190,7 @@ const state = reactive({
     ccTo: "",
     coordinateWork: null,
     workContents: [],
-    sendDingTalk: 0,
+    sendDingTalk: 1,
     isRegularlySend: 0,
     timingTime: null,
     reportStatus: null,
@@ -297,7 +298,12 @@ function handleSubmit() {
     .Insert(state.form)
     .then((requset) => {
       proxy.$tab.redirectTo("/pages/business/common/projectMange/record/index"); //返回到需要执行方法的页面
-      storageSystem.remove("project");
+      state.form = {
+        workContents: [],
+        tomorrowPlan: "",
+        coordinateWork: null,
+      };
+      storageSystem.set("project", state);
     });
 }
 

+ 5 - 5
src/pages/login.vue

@@ -17,8 +17,8 @@
       </view>
 
       <view class="middle-input" v-if="switchText == '验证码登录'">
-        <u-input v-model="phone" prefixIcon="phone" placeholder="请输入手机号" :maxlength="11" />
-        <u-input v-model="verify" prefixIcon="email" placeholder="请输入验证码" :maxlength="6">
+        <u-input v-model="phone" prefixIcon="phone" placeholder="请输入手机号" :maxlength="11" :adjustPosition="false" />
+        <u-input v-model="verify" prefixIcon="email" placeholder="请输入验证码" :maxlength="6" :adjustPosition="false">
           <template #suffix>
             <button class="verify" @click="getVerifyCode">{{ !useStore.codeTime ? "获取验证码" : useStore.codeTime + "s" }}</button>
           </template>
@@ -26,8 +26,8 @@
       </view>
 
       <view class="middle-input" v-if="switchText == '账号密码登录'">
-        <u-input type="text" v-model="username" prefixIcon="account" placeholder="请输入账号" />
-        <u-input v-model="password" prefixIcon="lock" placeholder="请输入密码" :password="isPassword">
+        <u-input type="text" v-model="username" prefixIcon="account" placeholder="请输入账号" :adjustPosition="false" />
+        <u-input v-model="password" prefixIcon="lock" placeholder="请输入密码" :password="isPassword" :adjustPosition="false">
           <template #suffix>
             <text :class="!isPassword ? 'iconfont oaIcon-eye' : 'iconfont oaIcon-eye-close'" @click="isPassword = !isPassword"></text>
           </template>
@@ -37,7 +37,7 @@
       <button class="middle-submit" @click="submitRes">登 录</button>
 
       <!-- #ifdef APP-PLUS || MP-WEIXIN || H5 -->
-      <view class="middle-switch" v-if="proxy.$common.isVisible()">
+      <view class="middle-switch">
         <text class="switch-loginMethod" @click="switchMode(1)">{{ switchText === "验证码登录" ? "账号密码登录" : "验证码登录" }}</text>
         <view style="margin: auto"></view>
         <text class="switch-register" @click="switchMode(2)">注册账号</text>

+ 12 - 6
src/pages/register.vue

@@ -1,21 +1,23 @@
 <template>
   <view id="register-container">
-    <view class="top-area" v-if="proxy.$common.isVisible()">
+    <view class="top-area">
       <u-icon name="arrow-left" size="17px" color="#000" :bold="true" @click="navigateTo"></u-icon>
     </view>
 
-    <view class="content-area" v-if="proxy.$common.isVisible()">
+    <view class="content-area">
       <text class="content-area-title">注册</text>
     </view>
 
     <view class="bottom-area">
+      <u-input v-model="userName" prefixIcon="account" placeholder="用户名(必填)" border="none" />
       <u-input v-model="phone" prefixIcon="phone" placeholder="手机号(必填)" border="none" />
-      <u-input v-model="verify" prefixIcon="email" placeholder="验证码(必填)" border="none" :maxlength="6">
+      <u-input v-model="verify" prefixIcon="chat" placeholder="验证码(必填)" border="none" :maxlength="6">
         <template #suffix>
           <button class="verify" @click="getVerifyCode">{{ !useStore.codeTime ? "获取验证码" : useStore.codeTime + "s" }}</button>
         </template>
       </u-input>
-      <u-input v-model="nickName" prefixIcon="account" placeholder="昵称(必填)" border="none" />
+      <u-input v-model="email" prefixIcon="email" placeholder="邮箱(必填)" border="none" />
+      <u-input v-model="nickName" prefixIcon="account" placeholder="真实姓名(必填)" border="none" />
       <u-input v-model="newPassword" prefixIcon="lock" placeholder="密码(必填)" border="none" :password="newPasswordBool">
         <template #suffix>
           <text :class="!newPasswordBool ? 'iconfont oaIcon-eye' : 'iconfont oaIcon-eye-close'" @click="newPasswordBool = !newPasswordBool"></text>
@@ -60,16 +62,18 @@ const useStore = useStores();
 const commonStore = commonStores();
 /*----------------------------------变量声明-----------------------------------*/
 const state = reactive({
+  userName: undefined,
   nickName: undefined,
   phone: undefined,
   verify: undefined,
+  email: undefined,
   newPassword: undefined,
   newPasswordBool: true,
   confirmPassword: undefined,
   confirmPasswordBool: true,
 });
 
-const { nickName, phone, verify, newPassword, newPasswordBool, confirmPassword, confirmPasswordBool } = toRefs(state);
+const { userName, nickName, phone, verify, email, newPassword, newPasswordBool, confirmPassword, confirmPasswordBool } = toRefs(state);
 
 /**
  * @点击发送验证码
@@ -97,9 +101,11 @@ function handleSubmit() {
     success: (res) => {
       useStore.UserAdd({
         data: {
+          userName: userName.value,
           nickName: nickName.value,
           phone: phone.value,
           verify: verify.value,
+          email: email.value,
           newPassword: newPassword.value,
           confirmPassword: confirmPassword.value,
         },
@@ -156,7 +162,7 @@ onLoad((options) => {});
   padding-top: 30%;
   //#endif
   background-color: #ffffff;
-
+  overflow: auto;
   .top-area {
   }
 

+ 23 - 2
src/store/modules/user.js

@@ -201,11 +201,31 @@ const useStores = defineStore("useStores", {
      * @param { 失败 } error 
      */
     UserAdd({ data, success, error }) {
+      if (!data.userName) {
+        modal.showToast("用户名不能为空");
+        return;
+      }
+
+      if (data.userName.length < 6) {
+        modal.showToast("用户名长度在 6 个字符以上");
+        return;
+      }
+
       if (!data.nickName) {
         modal.showToast("昵称不能为空");
         return;
       }
 
+      if (!data.email) {
+        modal.showToast("邮箱不能为空");
+        return;
+      }
+
+      if (!/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/.test(data.email)) {
+        proxy.$modal.showToast("邮箱格式不正确");
+        return;
+      }
+
       if (!data.newPassword) {
         modal.showToast("新密码不能为空");
         return;
@@ -229,11 +249,12 @@ const useStores = defineStore("useStores", {
       modal.loading("加载中");
       appAdd({
         tenantId: this.tenantId,
+        userName: data.userName,
         nickName: data.nickName,
         phonenumber: data.phone,
-        userName: data.phone,
-        status: "0",
+        email: data.email,
         password: data.newPassword,
+        status: "0",
       }).then((res) => {
         if (res.status === "SUCCESS") {
           success(res)