Просмотр исходного кода

fix:增加入室预约、入室相关el组件修改为vant组件,编辑头像固定裁切宽高为500px

liuzhenlin 1 неделя назад
Родитель
Сommit
a5a3d7d719

+ 1 - 1
package.json

@@ -44,4 +44,4 @@
     "vue-router": "4",
     "vue-tsc": "^0.38.4"
   }
-}
+}

+ 26 - 0
src/stores/userInfo.ts

@@ -51,6 +51,32 @@ export const useUserInfo = defineStore('userInfo', {
     }
   }),
   actions: {
+    // 重置用户信息
+    resetUserInfo() {
+      this.userInfos = {
+        id: 0,
+        avatar: '',
+        userName: '',
+        nickName: '',
+        sex: '',
+        phone: '',
+        photo: '',
+        time: 0,
+        roles: [],
+        authBtnList: [],
+        deptName: '',
+        deptId: '',
+        userRoles: '',
+        userRoleNames: '',
+        userType: '',
+        creditScore: 0,
+        pgName: '',
+        platformId: 0
+      }
+      this.openId = ''
+      this.unionId = ''
+      this.openIdFlag = false
+    },
     async setUserInfos() {
       // 存储用户信息到浏览器缓存
       console.log('存储用户信息到浏览器缓存');

Разница между файлами не показана из-за своего большого размера
+ 255 - 685
src/view/entry/components/appoint.vue


+ 130 - 168
src/view/entry/components/edit.vue

@@ -1,170 +1,104 @@
 <template>
   <div class="facilities-dialog-container">
-    <el-dialog
-      :title="state.dialog.title"
-      @close="onCancel"
-      :close-on-click-modal="false"
-      v-model="state.dialog.isShowDialog"
-      width="90%"
+    <van-popup
+      v-model:show="state.dialog.isShowDialog"
+      position="bottom"
+      round
+      :style="{ height: '90%' }"
+      close-on-popstate
     >
-      <h4 class="mb8 mt8">申请信息</h4>
-      <el-descriptions
-        border
-        :column="1"
-        class="mb20"
-        direction="vertical"
-      >
-        <el-descriptions-item
-          label-class-name="cell-item"
-          label="入室申请名称"
-        >
-          {{ state.oldForm.userName }}的{{ state.oldForm.platformName }}的入室申请
-        </el-descriptions-item>
-        <el-descriptions-item
-          label-class-name="cell-item"
-          label="申请平台"
-          width="50%"
-        >
-          {{ state.oldForm.platformName }}
-        </el-descriptions-item>
-        <!--        <el-descriptions-item label-class-name="cell-item" label="申请时长">{{ state.oldForm.platformTime }}个月</el-descriptions-item>-->
-        <el-descriptions-item
-          label-class-name="cell-item"
-          label="入室周期"
-          width="50%"
-        >
-          {{ state.oldForm?.startTime ? formatDate(new Date(state.oldForm?.startTime), 'YYYY-mm-dd') : '' }} ~
-          {{ state.oldForm?.endTime ? formatDate(new Date(state.oldForm?.endTime), 'YYYY-mm-dd') : '' }}
-        </el-descriptions-item>
-        <el-descriptions-item
-          label-class-name="cell-item"
-          label="预约房间"
-          width="50%"
-        >
-          {{ state.oldForm.resName }}
-        </el-descriptions-item>
-      </el-descriptions>
-      <el-form
-        ref="expertDialogFormRef"
-        :model="state.form"
-        :rules="rules"
-        size="default"
-        label-width="140px"
-        label-position="top"
-      >
-        <el-row :gutter="35">
-          <el-col
-            :span="24"
-            class="mb20"
-          >
-            <el-form-item
-              label="开始时间"
-              prop="startTime"
-            >
-              <el-date-picker
-                type="datetime"
-                placeholder="请输入"
-                disabled
-                class="w100"
+      <div class="vant-dialog">
+        <header class="vant-dialog__header">
+          <h4>{{ state.dialog.title }}</h4>
+        </header>
+        <main class="vant-dialog__body">
+          <section class="section">
+            <van-cell-group inset>
+              <h5 class="section__title">申请信息</h5>
+              <van-cell
+                title="入室申请名称"
+                :value="`${state.oldForm.userName}的${state.oldForm.platformName}的入室申请`"
+              />
+              <van-cell
+                title="申请平台"
+                :value="state.oldForm.platformName"
+              />
+              <van-cell
+                title="入室周期"
+                :title-style="{ flex: '0 0 80px', maxWidth: '80px' }"
+                :value="`${
+                  state.oldForm?.startTime ? formatDate(new Date(state.oldForm?.startTime), 'YYYY-mm-dd') : ''
+                } ~ ${state.oldForm?.endTime ? formatDate(new Date(state.oldForm?.endTime), 'YYYY-mm-dd') : ''}`"
+              />
+              <van-cell
+                title="预约房间"
+                :value="state.oldForm.resName"
+              />
+            </van-cell-group>
+          </section>
+
+          <section class="section">
+            <van-cell-group inset>
+              <h5 class="section__title">预约信息</h5>
+              <van-field
+                label="开始时间"
                 v-model="state.form.startTime"
-                value-format="YYYY-MM-DD HH:mm"
-                format="YYYY/MM/DD HH:mm"
+                readonly
+                input-align="right"
               />
-            </el-form-item>
-          </el-col>
-          <el-col
-            :span="24"
-            class="mb20"
-          >
-            <el-form-item
-              label="结束时间"
-              prop="endTime"
-            >
-              <el-date-picker
-                type="datetime"
-                placeholder="请输入"
-                disabled
-                class="w100"
+              <van-field
+                label="结束时间"
                 v-model="state.form.endTime"
-                value-format="YYYY-MM-DD HH:mm"
-                format="YYYY/MM/DD HH:mm"
+                readonly
+                input-align="right"
               />
-            </el-form-item>
-          </el-col>
-          <el-col
-            :span="24"
-            class="mb24"
-          >
-            <el-form-item
-              label="预约时长(分钟)"
-              prop="duration"
-            >
-              <el-input
-                disabled
-                placeholder="请输入"
-                class="w100"
-                maxlength="11"
-                v-model="state.form.duration"
+              <van-field
+                label="预约时长"
+                :model-value="state.form.duration + '分钟'"
+                readonly
+                input-align="right"
               />
-            </el-form-item>
-          </el-col>
-          <!--          <el-col :span="12" class="mb24">-->
-          <!--            <el-form-item label="预约人" prop="userId">-->
-          <!--              <el-select v-model="state.form.userId" class="w100" filterable placeholder="请选择" disabled @change="changeUser">-->
-          <!--                <el-option :value="v.id" :label="v.nickName" :key="v.id" v-for="v in userList" />-->
-          <!--              </el-select>-->
-          <!--            </el-form-item>-->
-          <!--          </el-col>-->
-          <!--          <el-col :span="12" class="mb24">-->
-          <!--            <el-form-item label="联系电话" prop="userContact">-->
-          <!--              <el-input placeholder="请输入" class="w100" maxlength="11" v-model="state.form.userContact" />-->
-          <!--            </el-form-item>-->
-          <!--          </el-col>-->
-          <el-col
-            :span="24"
-            class="mb20"
-          >
-            <el-form-item
-              label="备注"
-              prop="remark"
-            >
-              <el-input
-                type="textarea"
+              <van-field
                 v-model="state.form.remark"
+                label="备注"
+                type="textarea"
+                rows="3"
+                maxlength="200"
+                show-word-limit
                 placeholder="请输入备注"
-              ></el-input>
-            </el-form-item>
-          </el-col>
-        </el-row>
-      </el-form>
-      <template #footer>
-        <span class="dialog-footer">
-          <el-button
-            type="info"
+              />
+            </van-cell-group>
+          </section>
+        </main>
+        <van-action-bar
+          placeholder
+          safe-area-inset-bottom
+        >
+          <van-action-bar-button
+            text="取消"
+            type="warning"
             @click="onCancel"
-            size="default"
-          >
-            取 消
-          </el-button>
-          <el-button
+          />
+          <van-action-bar-button
+            type="primary"
             color="#2c78ff"
+            :text="state.dialog.submitTxt || '提交'"
+            :loading="state.dialog.submitting"
+            :disabled="state.dialog.submitting"
             @click="onSubmit('20')"
-            size="default"
-          >
-            {{ state.dialog.submitTxt }}
-          </el-button>
-        </span>
-      </template>
-    </el-dialog>
+          />
+        </van-action-bar>
+      </div>
+    </van-popup>
   </div>
 </template>
 
 <script setup lang="ts" name="systemProDialog">
   import { nextTick, reactive, ref } from 'vue'
   import to from 'await-to-js'
-  import { ElMessage } from 'element-plus'
   import moment from 'moment/moment'
   import { storeToRefs } from 'pinia'
+  import { showToast } from 'vant'
 
   import { useSystemApi } from '/@/api/platform/system'
   import { deepClone } from '/@/utils/other'
@@ -180,15 +114,8 @@
   const Api = useAppointmentApi()
   const assignApi = useCellAssignApi()
   const systemApi = useSystemApi()
-  const expertDialogFormRef = ref()
   const stores = useUserInfo()
   const { userInfos } = storeToRefs(stores)
-  const rules = {
-    startTime: { required: true, message: '不能为空', trigger: 'change' },
-    endTime: { required: true, message: '不能为空', trigger: 'change' },
-    userId: { required: true, message: '不能为空', trigger: 'change' },
-    userContact: { required: true, message: '不能为空', trigger: 'blur' },
-  }
   const state = reactive({
     form: {
       id: 0,
@@ -231,6 +158,7 @@
       type: '',
       title: '',
       submitTxt: '',
+      submitting: false,
     },
   })
 
@@ -251,6 +179,7 @@
       state.form = {
         id: row?.id,
         assignId: row?.id,
+        appointId: row?.appointId,
         userId: userInfos.value.id,
         userName: userInfos.value.nickName,
         userDeptId: userInfos.value.deptId,
@@ -259,7 +188,7 @@
         startTime: row?.startTime,
         endTime: row?.endTime,
         remark: '',
-        appointId: row?.appointId,
+        duration: 0,
       }
       const [err, res]: ToResponse = await to(assignApi.getDetail({ id: row?.id }))
       if (err) return
@@ -282,7 +211,6 @@
 
   // 关闭弹窗
   const closeDialog = () => {
-    expertDialogFormRef.value.resetFields()
     state.dialog.isShowDialog = false
   }
 
@@ -292,17 +220,26 @@
 
   // 提交
   const onSubmit = async (type: string) => {
-    expertDialogFormRef.value.validate(async (valid: boolean) => {
-      if (!valid) return
-      state.form.isTemporary = type
-      const params = deepClone(state.form)
-      const post = state.dialog.type == 'add' ? Api.create : Api.updateById
-      const [err]: ToResponse = await to(post(params))
-      if (err) return
-      ElMessage.success('操作成功')
-      closeDialog()
-      emit('refresh')
-    })
+    if (state.dialog.submitting) return
+    state.dialog.submitting = true
+    // 基础必填校验(开始/结束时间)
+    if (!state.form.startTime || !state.form.endTime) {
+      showToast('开始时间和结束时间不能为空')
+      state.dialog.submitting = false
+      return
+    }
+    const params: any = deepClone(state.form)
+    params.isTemporary = type
+    const post = state.dialog.type == 'add' ? Api.create : Api.updateById
+    const [err]: ToResponse = await to(post(params))
+    if (err) {
+      state.dialog.submitting = false
+      return
+    }
+    showToast('操作成功')
+    closeDialog()
+    emit('refresh')
+    state.dialog.submitting = false
   }
   // 暴露变量
   defineExpose({
@@ -310,8 +247,33 @@
   })
 </script>
 <style lang="scss" scoped>
-  h4 {
-    font-size: 18px;
+  .vant-dialog {
+    display: flex;
+    flex-direction: column;
+    height: 100%;
+    background-color: #f7f8fa;
+    &__header {
+      padding: 12px 16px;
+      border-bottom: 1px solid #f0f0f0;
+      h4 {
+        margin: 0;
+        font-size: 16px;
+        font-weight: 600;
+      }
+    }
+    &__body {
+      flex: 1;
+      overflow-y: auto;
+      padding: 12px 0 60px;
+    }
+  }
+  .section {
+    margin-bottom: 12px;
+    &__title {
+      margin: 4px 10px 6px;
+      font-size: 13px;
+      color: #969799;
+    }
   }
   :deep(.disUoloadSty .el-upload--picture-card) {
     display: none; /* 上传按钮隐藏 */

+ 224 - 207
src/view/entry/components/renewalEdit.vue

@@ -1,180 +1,165 @@
 <template>
   <div class="facilities-dialog-container">
-    <el-dialog
-      :title="state.dialog.title"
-      @close="onCancel"
-      :close-on-click-modal="false"
-      v-model="state.dialog.isShowDialog"
-      width="90%"
+    <!-- 主续期弹窗 -->
+    <van-popup
+      v-model:show="state.dialog.isShowDialog"
+      position="bottom"
+      round
+      :style="{ height: '90%' }"
+      close-on-popstate
     >
-      <h4 class="mb8 mt8">原申请信息</h4>
-      <el-descriptions
-        border
-        :column="1"
-        class="mb20"
-        direction="vertical"
-      >
-        <el-descriptions-item
-          label-class-name="cell-item"
-          label="入室申请名称"
-        >
-          {{ state.oldForm.userName }}的{{ state.oldForm.platformName }}的入室申请
-        </el-descriptions-item>
-        <el-descriptions-item
-          label-class-name="cell-item"
-          label="申请平台"
-          width="50%"
-        >
-          {{ state.oldForm.platformName }}
-        </el-descriptions-item>
-        <!--        <el-descriptions-item label-class-name="cell-item" label="申请时长">{{ state.oldForm.platformTime }}个月</el-descriptions-item>-->
-        <el-descriptions-item
-          label-class-name="cell-item"
-          label="入室周期"
-          width="50%"
-        >
-          {{ state.oldForm?.startTime ? formatDate(new Date(state.oldForm?.startTime), 'YYYY-mm-dd') : '' }} ~
-          {{ state.oldForm?.endTime ? formatDate(new Date(state.oldForm?.endTime), 'YYYY-mm-dd') : '' }}
-        </el-descriptions-item>
-      </el-descriptions>
-      <el-form
-        ref="expertDialogFormRef"
-        :model="state.form"
-        :rules="rules"
-        size="default"
-        label-width="140px"
-        label-position="top"
-      >
-        <h4 class="mb8 mt8">续期信息</h4>
-        <el-row :gutter="35">
-          <el-col
-            :span="24"
-            class="mb20"
-          >
-            <el-form-item
-              label="续期时长(个月)"
-              prop="platformTime"
-            >
-              <el-input-number
-                v-model="state.form.platformTime"
-                :min="1"
-                :precision="0"
-                class="w100"
-                @change="dateChange"
-              ></el-input-number>
-            </el-form-item>
-          </el-col>
-          <el-col
-            :span="24"
-            class="mb20"
-          >
-            <el-form-item label="续期后周期">
-              <el-date-picker
-                disabled
-                v-model="state.oldForm.startTime"
-                type="date"
-                value-format="YYYY-MM-DD"
-                placeholder="请选择时间"
-                clearable
-                style="width: 45%"
+      <div class="vant-dialog">
+        <header class="vant-dialog__header">
+          <h4>{{ state.dialog.title }}</h4>
+        </header>
+        <main class="vant-dialog__body">
+          <section class="section">
+            <van-cell-group inset>
+              <h5 class="section__title">原申请信息</h5>
+              <van-cell
+                title="入室申请名称"
+                :value="`${state.oldForm.userName}的${state.oldForm.platformName}的入室申请`"
               />
-              ~
-              <el-date-picker
-                disabled
-                v-model="state.form.endTime"
-                type="date"
-                value-format="YYYY-MM-DD"
-                placeholder="请选择时间"
-                clearable
-                style="width: 45%"
+              <van-cell
+                title="申请平台"
+                :value="state.oldForm.platformName"
               />
-            </el-form-item>
-          </el-col>
-          <el-col
-            :span="24"
-            class="mb20"
-          >
-            <el-form-item
-              label="其他说明"
-              prop="remark"
-            >
-              <el-input
-                type="textarea"
+              <van-cell
+                title="入室周期"
+                :title-style="{ flex: '0 0 80px', maxWidth: '80px' }"
+                :value="`${
+                  state.oldForm?.startTime ? formatDate(new Date(state.oldForm?.startTime), 'YYYY-mm-dd') : ''
+                } ~ ${state.oldForm?.endTime ? formatDate(new Date(state.oldForm?.endTime), 'YYYY-mm-dd') : ''}`"
+              />
+            </van-cell-group>
+          </section>
+
+          <section class="section">
+            <van-cell-group inset>
+              <h5 class="section__title">续期信息</h5>
+              <van-field
+                :label-class="{ 'w-110': true }"
+                label="续期时长(个月)"
+                type="number"
+                v-model.number="state.form.platformTime"
+                placeholder="请输入续期时长"
+                @update:model-value="dateChange"
+              />
+              <van-field
+                label="续期后周期"
+                readonly
+                :label-class="{ 'w-110': true }"
+              >
+                <template #input>
+                  <span class="range-text">
+                    {{ state.oldForm?.startTime ? formatDate(new Date(state.oldForm?.startTime), 'YYYY-mm-dd') : '' }}
+                    ~
+                    {{ state.form?.endTime ? formatDate(new Date(state.form?.endTime), 'YYYY-mm-dd') : '' }}
+                  </span>
+                </template>
+              </van-field>
+              <van-field
+                :label-class="{ 'w-110': true }"
                 v-model="state.form.remark"
+                label="其他说明"
+                type="textarea"
+                rows="3"
+                maxlength="200"
+                show-word-limit
                 placeholder="请输入其他说明"
-              ></el-input>
-            </el-form-item>
-          </el-col>
-        </el-row>
-        <h4 class="mb8 mt8">安全承诺</h4>
-        <el-checkbox v-model="state.safePromise">
-          本人承诺:如时候遵守实验室及个平台的各项规章制度,遵守在室的积分管理制度。
-        </el-checkbox>
-        <el-checkbox
-          v-model="state.safeRead"
-          :disabled="!state.isRead"
+              />
+            </van-cell-group>
+          </section>
+
+          <section class="section">
+            <van-cell-group inset>
+              <h5 class="section__title">安全承诺</h5>
+              <div class="pd-16">
+                <van-checkbox
+                  class="mb10"
+                  v-model="state.safePromise"
+                  shape="square"
+                >
+                  本人承诺:如时候遵守实验室及平台官网的各项规章制度,遵守在室的积分管理制度。
+                </van-checkbox>
+                <van-checkbox
+                  v-model="state.safeRead"
+                  shape="square"
+                  :disabled="!state.isRead"
+                >
+                  <span>
+                    我已完整阅读并同意
+                    <span
+                      class="link-text"
+                      @click.stop="onRead"
+                    >
+                      《预约须知》
+                    </span>
+                    的内容,承诺如时候遵守实验室及平台官网的各项规章制度,遵守在室的积分管理制度。
+                  </span>
+                </van-checkbox>
+              </div>
+            </van-cell-group>
+          </section>
+        </main>
+        <van-action-bar
+          placeholder
+          safe-area-inset-bottom
         >
-          我已完整阅读并同意
-          <el-button
-            link
-            type="primary"
-            @click.stop="onRead"
-          >
-            《预约须知》
-          </el-button>
-          的内容,承诺如时候遵守实验室及个平台的各项规章制度,遵守在室的积分管理制度。
-        </el-checkbox>
-      </el-form>
-      <template #footer>
-        <span class="dialog-footer">
-          <el-button
-            type="info"
+          <van-action-bar-button
+            text="取消"
+            type="warning"
             @click="onCancel"
-            size="default"
-          >
-            取 消
-          </el-button>
-          <el-button
+          />
+          <van-action-bar-button
+            type="primary"
             color="#2c78ff"
+            :text="state.dialog.submitTxt || '提交'"
+            :loading="state.dialog.submitting"
+            :disabled="state.dialog.submitting"
             @click="onSubmit('20')"
-            size="default"
-          >
-            {{ state.dialog.submitTxt }}
-          </el-button>
-        </span>
-      </template>
-    </el-dialog>
-    <el-dialog
-      v-model="noticeShow"
-      :title="noticeInfo.noticeTitle"
-      width="800px"
-      :close-on-click-modal="false"
-    >
-      <div>
-        <div
-          class="ck-editor"
-          v-html="noticeInfo.noticeContent"
-        ></div>
+          />
+        </van-action-bar>
       </div>
-      <template #footer>
-        <span class="dialog-footer">
-          <el-button
-            type="info"
+    </van-popup>
+
+    <!-- 预约须知弹窗 -->
+    <van-popup
+      v-model:show="noticeShow"
+      position="bottom"
+      round
+      :style="{ height: '85%' }"
+      close-on-popstate
+    >
+      <div class="notice-popup">
+        <header class="notice-popup__header">
+          <h4>{{ noticeInfo.noticeTitle || '预约须知' }}</h4>
+        </header>
+        <div class="notice-popup__body">
+          <div
+            class="ck-editor"
+            v-html="noticeInfo.noticeContent"
+          ></div>
+        </div>
+        <van-action-bar
+          placeholder
+          safe-area-inset-bottom
+        >
+          <van-action-bar-button
+            type="primary"
+            text="我已阅读"
             @click="noticeShow = false"
-            size="default"
-          >
-            取 消
-          </el-button>
-        </span>
-      </template>
-    </el-dialog>
+          />
+        </van-action-bar>
+      </div>
+    </van-popup>
   </div>
 </template>
 
 <script setup lang="ts" name="systemProDialog">
   import to from 'await-to-js'
   import { nextTick, reactive, ref } from 'vue'
-  import { ElMessage } from 'element-plus'
+  import { showToast } from 'vant'
   import { usePlatformApi } from '/@/api/platform/home'
   import { useSystemApi } from '/@/api/platform/system'
   import { deepClone } from '/@/utils/other'
@@ -188,12 +173,6 @@
   const Api = usePlatformRenewalApi()
   const systemApi = useSystemApi()
   const platformApi = usePlatformApi()
-  const expertDialogFormRef = ref()
-  const rules = {
-    memberName: { required: true, message: '不能为空', trigger: 'blur' },
-    memberType: { required: true, message: '不能为空', trigger: 'change' },
-    pgName: { required: true, message: '不能为空', trigger: 'blur' },
-  }
   const state = reactive({
     oldForm: {
       id: 0,
@@ -219,8 +198,9 @@
       userId: null,
       userName: '',
       platformTime: 1,
+      endTime: null,
       remark: '',
-    },
+    } as any,
     safePromise: false,
     safeRead: false,
     isRead: false,
@@ -229,6 +209,7 @@
       type: '',
       title: '',
       submitTxt: '',
+      submitting: false,
     },
   })
   const noticeShow = ref(false)
@@ -259,6 +240,7 @@
         userId: row?.userId,
         userName: row?.userName,
         platformTime: 1,
+        endTime: null,
         remark: '',
       }
     }
@@ -295,7 +277,6 @@
 
   // 关闭弹窗
   const closeDialog = () => {
-    expertDialogFormRef.value.resetFields()
     state.isRead = false
     state.safePromise = false
     state.safeRead = false
@@ -315,25 +296,30 @@
   }
   // 提交
   const onSubmit = async (type: string) => {
+    if (state.dialog.submitting) return
+    state.dialog.submitting = true
     if (!state.safePromise) {
-      ElMessage.error('请阅读并勾选安全承诺!')
+      showToast('请阅读并勾选安全承诺!')
+      state.dialog.submitting = false
       return
     }
     if (!state.safeRead) {
-      ElMessage.error('请阅读并勾选预约须知!')
+      showToast('请阅读并勾选预约须知!')
+      state.dialog.submitting = false
       return
     }
-    expertDialogFormRef.value.validate(async (valid: boolean) => {
-      if (!valid) return
-      state.form.isTemporary = type
-      const params = deepClone(state.form)
-      const post = state.dialog.type == 'add' ? Api.create : Api.update
-      const [err]: ToResponse = await to(post(params))
-      if (err) return
-      ElMessage.success('操作成功')
-      closeDialog()
-      emit('refresh')
-    })
+    const params: any = deepClone(state.form)
+    params.isTemporary = type
+    const post = state.dialog.type == 'add' ? Api.create : Api.update
+    const [err]: ToResponse = await to(post(params))
+    if (err) {
+      state.dialog.submitting = false
+      return
+    }
+    showToast('操作成功')
+    closeDialog()
+    emit('refresh')
+    state.dialog.submitting = false
   }
   // 暴露变量
   defineExpose({
@@ -341,39 +327,70 @@
   })
 </script>
 <style lang="scss" scoped>
-  h4 {
-    font-size: 18px;
-  }
-  :deep(.disUoloadSty .el-upload--picture-card) {
-    display: none; /* 上传按钮隐藏 */
-  }
-  .avatar-uploader {
-    :deep(.el-upload) {
-      width: 100%;
-      height: 100%;
-      border: 1px dashed var(--el-border-color);
-      border-radius: 6px;
-      cursor: pointer;
-      position: relative;
-      overflow: hidden;
-      transition: var(--el-transition-duration-fast);
-      &:hover {
-        border-color: var(--el-color-primary);
+  .vant-dialog {
+    display: flex;
+    flex-direction: column;
+    height: 100%;
+    background-color: #f7f8fa;
+    &__header {
+      padding: 12px 16px;
+      border-bottom: 1px solid #f0f0f0;
+      h4 {
+        margin: 0;
+        font-size: 16px;
+        font-weight: 600;
       }
     }
+    &__body {
+      flex: 1;
+      overflow-y: auto;
+      padding: 12px 0 60px;
+    }
   }
 
-  .el-icon.avatar-uploader-icon {
-    font-size: 28px;
-    color: #8c939d;
-    width: 178px;
-    height: 178px;
-    text-align: center;
+  .section {
+    margin-bottom: 12px;
+    &__title {
+      margin: 4px 10px 6px;
+      font-size: 13px;
+      color: #969799;
+    }
   }
-  :deep(.el-checkbox) {
-    padding-bottom: 30px;
-    .el-checkbox__label {
-      white-space: pre-wrap;
+
+  :deep(.pd-16) {
+    padding: 0 16px 16px;
+  }
+
+  .range-text {
+    font-size: 14px;
+    color: #323233;
+  }
+
+  .link-text {
+    color: #1989fa;
+    text-decoration: underline;
+  }
+
+  .notice-popup {
+    display: flex;
+    flex-direction: column;
+    height: 100%;
+    &__header {
+      padding: 12px 16px;
+      border-bottom: 1px solid #f0f0f0;
+      h4 {
+        margin: 0;
+        font-size: 16px;
+        font-weight: 600;
+      }
     }
+    &__body {
+      flex: 1;
+      overflow-y: auto;
+      padding: 12px 12px 60px;
+    }
+  }
+  :deep(.w-110) {
+    width: 110px;
   }
 </style>

+ 19 - 1
src/view/entry/mine.vue

@@ -154,7 +154,8 @@
                     item.assignStatus === '20' &&
                     item.userId === userInfos.id &&
                     item.outStatus !== 20 &&
-                    item.outStatus !== 30
+                    item.outStatus !== 30 &&
+                    isEndTimeInFirstTenDays(item.endTime)
                   "
                   style="text-align: right; width: 100%"
                 >
@@ -476,6 +477,23 @@
     renewalEditRef.value.openDialog('add', row)
   }
 
+  // 判断endtime是否在当前月份的前10天内
+  const isEndTimeInFirstTenDays = (endTime: string) => {
+    if (!endTime) return false
+
+    const endDate = dayjs(endTime)
+    const today = dayjs()
+
+    // 检查endtime是否在当前月份
+    if (endDate.year() !== today.year() || endDate.month() !== today.month()) {
+      return false
+    }
+
+    // 检查endtime是否在当前月份的前10天
+    const dayOfMonth = endDate.date()
+    return dayOfMonth <= 10
+  }
+
   onMounted(() => {
     getDicts()
     onLoad()

+ 10 - 8
src/view/user/edit.vue

@@ -42,7 +42,7 @@
     <van-popup class="bg-tran" v-model:show="cropperState.isShowDialog" closeable @close="closeDialog" position="bottom" :style="{ padding: '10px' }">
       <div class="cropper-warp">
         <div class="cropper-warp-left">
-          <img :src="cropperState.cropperImg as string" class="cropper-warp-left-img" />
+          <img :src="typeof cropperState.cropperImg === 'string' ? cropperState.cropperImg : ''" class="cropper-warp-left-img" />
         </div>
         <!-- <div class="cropper-warp-right">
           <div class="cropper-warp-right-title">预览</div>
@@ -166,18 +166,20 @@
       aspectRatio: 1,
       preview: '.before',
       background: false,
-      autoCropArea: 0.6,
+      autoCropArea: 1,
       cropBoxMovable: true, // 是否允许剪裁框拖动
       cropBoxResizable: false, // 是否允许剪裁框缩放
       zoomable: true,
       ready() {
         cropperState.cropper.setCropBoxData({
-          width: 200, // 宽度
-          height: 200 // 高度
+          width: 500, // 宽度
+          height: 500 // 高度
         })
       },
       crop: () => {
-        cropperState.cropperImgBase64 = cropperState.cropper.getCroppedCanvas().toDataURL('image/jpeg')
+        cropperState.cropperImgBase64 = cropperState.cropper
+          .getCroppedCanvas({ width: 500, height: 500 })
+          .toDataURL('image/jpeg')
       }
     })
   }
@@ -185,7 +187,7 @@
     openDialog(state.form.avatar)
   }
   const onAvatarSubmit = () => {
-    const base64Url = cropperState.cropper.getCroppedCanvas().toDataURL('image/jpeg')
+    const base64Url = cropperState.cropper.getCroppedCanvas({ width: 500, height: 500 }).toDataURL('image/jpeg')
     let file = dataURLtoFile(base64Url, 'avatar.png')
     uploadBaseFunc(file)
   }
@@ -317,8 +319,8 @@
     justify-content: center;
     background-color: #eee;
     .cropper-warp-left {
-      height: 350px;
-      width: 350px;
+      height: 500px;
+      width: 500px;
     }
   }
 </style>

+ 6 - 0
src/view/user/index.vue

@@ -202,7 +202,13 @@
     showConfirmDialog({
       message: '确认切换账号?',
     }).then(() => {
+      // 清除 token
       Local.remove('token')
+      // 清除微信 openId 和 unionId
+      localStorage.removeItem('openId')
+      localStorage.removeItem('unionId')
+      // 重置用户信息
+      storesUseUserInfo.resetUserInfo()
       window.location.reload()
     })
   }

Некоторые файлы не были показаны из-за большого количества измененных файлов