Explorar el Código

门禁配置管理功能优化

fanghuisheng hace 3 semanas
padre
commit
632fffe188

+ 12 - 0
src/pages.json

@@ -212,6 +212,18 @@
                             "titleNView": false
                         }
                     }
+                },
+                {
+                    "path": "authentication/index",
+                    "style": {
+                        "navigationBarTitleText": "",
+                        "navigationStyle": "custom",
+                        "enablePullDownRefresh": false,
+                        "app-plus": {
+                            "bounce": "none",
+                            "titleNView": false
+                        }
+                    }
                 }
             ]
         },

+ 2 - 2
src/pages/business/door/list/index.vue

@@ -36,7 +36,7 @@
       <u-loading-page :loading="state.loading" fontSize="16" style="z-index: 99"></u-loading-page>
 
       <u-grid class="p10" :border="true" :col="2" gap="10px">
-        <u-grid-item class="p10 radius" bgColor="#FFF" v-for="(item, index) in dataList" :key="index" @click="doorSetting(item)">
+        <u-grid-item class="p10 radius" bgColor="#fff" v-for="(item, index) in dataList" :key="index" @click="doorSetting(item)">
           <view
             :style="{
               fontSize: '14px',
@@ -54,7 +54,7 @@
             }"
           >
             <image style="width: 40px; height: 40px" :src="'/static/images/door/lock.png'" mode="aspectFill"></image>
-            <view class="iconfont oaIcon-open_door ml-auto mtb-auto font30" @click.stop="controlStore.openDoor(item, true)"></view>
+            <view class="iconfont oaIcon-open_door ml-auto mtb-auto font35" @click.stop="controlStore.openDoor(item, true)"></view>
           </view>
         </u-grid-item>
       </u-grid>

+ 46 - 9
src/pages/business/door/list/setting.vue

@@ -39,7 +39,9 @@
         <view class="center-area-seting">
           <view class="center-area-seting_title">会客模式</view>
           <view class="center-area-seting_center">
-            <u-subsection :list="subsection.list" :current="subsection.current" mode="subsection" @change="subsectionChange"></u-subsection>
+            <view class="center-area-seting_center_itemSub" :class="[{ active: list.value == modal.form.workStatus }]" v-for="list in subsection.list" :key="list" @click="subsectionChange(list)">
+              {{ list.label }}
+            </view>
           </view>
         </view>
 
@@ -47,6 +49,7 @@
           <view class="center-area-seting_title">门禁配置</view>
           <view class="center-area-seting_center">
             <view class="center-area-seting_center_item" v-for="(baseListItem, baseListIndex) in baseList" :key="baseListIndex" v-show="baseListItem.status" @click="handle(baseListItem)">
+              <image class="center-area-seting_center_item_image" :src="baseListItem.imgPath" style="width: 25px; height: 25px"></image>
               <view class="center-area-seting_center_item_title">{{ baseListItem.title }}</view>
               <view class="center-area-seting_center_item_subTitle">{{ baseListItem.subTitle }}</view>
             </view>
@@ -71,7 +74,7 @@
     <view class="slot-content">
       <view class="remark" style="" v-if="modal.type == '标识语'">
         <u-textarea v-model="modal.form.remark" placeholder="请输入标识语" border="none" maxlength="200" style="padding: 0px" autoHeight></u-textarea>
-        <view class="remark_changeIt" @click="changeIt()">换一换</view>
+        <image class="remark_changeIt" src="@/static/images/door/ai.png" style="width: 25px; height: 25px" @click="changeIt()"></image>
       </view>
 
       <view class="imgPath" v-if="modal.type == '屏保'">
@@ -115,6 +118,7 @@ const state = reactive({
       subTitle: "标识语/标语",
       status: true,
       type: "remark",
+      imgPath: "/static/images/door/setting_remark.png",
     },
     {
       name: "star",
@@ -122,6 +126,7 @@ const state = reactive({
       subTitle: "屏保/主题互动",
       status: true,
       type: "imgPath",
+      imgPath: "/static/images/door/setting_imgPath.png",
     },
     {
       name: "photo",
@@ -129,13 +134,18 @@ const state = reactive({
       subTitle: "通行记录/人员通行记录",
       status: true,
       type: "record",
+      imgPath: "/static/images/door/setting_record.png",
     },
   ],
 
   subsection: {
-    list: ["办公", "会客", "外出", "勿扰"],
-    current: 0,
-    value: "",
+    list: [
+      { label: "办公", value: 1 },
+      { label: "会客", value: 2 },
+      { label: "外出", value: 3 },
+      { label: "勿扰", value: 4 },
+    ],
+    value: 1,
   },
   modal: {
     show: false,
@@ -146,14 +156,16 @@ const state = reactive({
       remark: "",
       password: "",
       openMode: "",
+      workStatus: 1,
     },
   },
 });
 const { pageTitle, deviceUuid, baseList, subsection, modal } = toRefs(state);
 
 function subsectionChange(e) {
-  state.subsection.current = e;
-  state.subsection.value = state.subsection.list[e];
+  state.subsection.value = e.value;
+  state.modal.form.workStatus = e.value;
+  modalConfirm();
 }
 
 /** 操作按钮事件 */
@@ -185,15 +197,16 @@ function modalConfirm() {
 
 /** 换一换 */
 function changeIt() {
+  proxy.$modal.loading("加载中");
   aiApi()
     .changeIt({
       content: state.pageTitle + "每天一语简洁",
     })
     .then((response) => {
-      console.log(response);
       const data = response.data;
       state.modal.form.remark = "";
       state.modal.form.remark = data.reasoningContent;
+      proxy.$modal.closeLoading();
     });
 }
 
@@ -235,6 +248,7 @@ onLoad((options) => {
         state.modal.form.openMode = records.openMode;
         state.modal.form.remark = records.remark;
         state.modal.form.password = records.password;
+        state.modal.form.workStatus = records.workStatus ? records.workStatus : 1;
 
         state.deviceUuid = records.deviceUuid;
       })
@@ -255,6 +269,9 @@ onUnload(() => {});
       height: 180px;
       border-radius: 50%;
       margin: 50px auto;
+      box-shadow: 0px 0px 10px rgba(60, 156, 255, 1.1);
+      // background: url("@/static/images/door/bg.png") no-repeat;
+      // background-size: 100% 100%;
 
       &_icon {
         justify-content: center;
@@ -282,6 +299,25 @@ onUnload(() => {});
         display: flex;
         flex-wrap: wrap;
 
+        &_itemSub {
+          width: calc(25% - 10px);
+          padding: 10px;
+          text-align: center;
+          border-radius: 40px;
+          box-shadow: 0px 0px 10px rgba(60, 156, 255, 0.1);
+          background-color: #f2f6ff;
+        }
+
+        &_itemSub:nth-child(2),
+        &_itemSub:nth-child(3) {
+          margin: 0 10px;
+        }
+
+        .active {
+          background-color: #3c9cff;
+          color: #fff;
+        }
+
         &_item {
           width: calc(50% - 10px);
           padding: 15px;
@@ -325,7 +361,8 @@ onUnload(() => {});
 
         &_changeIt {
           position: absolute;
-          right: 0;
+          right: -18px;
+          bottom: -18px;
           z-index: 5;
           color: #2979ff;
         }

+ 188 - 0
src/pages/common/authentication/index.vue

@@ -0,0 +1,188 @@
+<template>
+  <u-sticky class="shadow-default" bgColor="#fff" style="top: 0">
+    <u-navbar :titleStyle="{ color: '#000' }" :autoBack="true" title="身份验证" :placeholder="true" :safeAreaInsetTop="true" bgColor="#fff">
+      <template #left>
+        <view class="u-navbar__content__left__item">
+          <u-icon name="arrow-left" size="20" color="#000"></u-icon>
+        </view>
+      </template>
+    </u-navbar>
+  </u-sticky>
+
+  <oa-scroll
+    customClass="authentication-container scroll-height bg-white"
+    :isSticky="true"
+    :customStyle="{
+      //#ifdef APP-PLUS || MP-WEIXIN
+      height: `calc(100vh - (44px + ${proxy.$settingStore.StatusBarHeight}))`,
+      //#endif
+      //#ifdef H5
+      height: `calc(100vh - (44px ))`,
+      //#endif
+    }"
+    :refresherLoad="false"
+    :refresherEnabled="flase"
+    :refresherDefaultStyle="'none'"
+    :refresherBackground="'#f5f6f7'"
+    :data-theme="'theme-' + proxy.$settingStore.themeColor.name"
+  >
+    <template #default>
+      <view class="center-area">
+        <view class="center-area-title">请从下方选择一种方式进行验证</view>
+        <view class="center-area-item">
+          <text class="iconfont oaIcon-mima"></text>
+          <view class="center-area-item-title">密码验证</view>
+          <view class="center-area-item-subTitle"></view>
+        </view>
+        <view class="center-area-item">
+          <text class="iconfont oaIcon-shouji"></text>
+          <view class="center-area-item-title">短信验证</view>
+          <view class="center-area-item-subTitle">{{ user.phonenumber }}</view>
+        </view>
+      </view>
+    </template>
+  </oa-scroll>
+
+  <!-- <u-modal class="modal-section" :show="modalShow" :showConfirmButton="true" :showCancelButton="true" @cancel="handleCancel()" @close="handleCancel()" @confirm="handleConfirm()">
+    <view class="modal-section-slot">
+      <view class="modal-section-slot-item" v-if="modalTitle === '修改手机号'">
+        <view class="mb15 title">{{ modalTitle }}</view>
+        <u-input v-model="phone" placeholder="请输入手机号" :maxlength="11" border="bottom" />
+        <u-input v-model="verify" placeholder="请输入验证码" :maxlength="6" border="bottom">
+          <template #suffix>
+            <button class="verify" @click="getVerifyCode">{{ !useStore.codeTime ? "获取验证码" : useStore.codeTime + "s" }}</button>
+          </template>
+        </u-input>
+      </view>
+
+      <view class="modal-section-slot-item" v-if="modalTitle === '修改密码'">
+        <view class="mb15 title">{{ modalTitle }}</view>
+        <u-input class="mb15" v-model="oldPassword" placeholder="请输入旧密码" :password="oldPasswordBool" border="bottom">
+          <template #suffix>
+            <text :class="!oldPasswordBool ? 'iconfont oaIcon-eye' : 'iconfont oaIcon-eye-close'" @click="oldPasswordBool = !oldPasswordBool"></text>
+          </template>
+        </u-input>
+
+        <u-input class="mb15" v-model="newPassword" placeholder="请输入新密码" :password="newPasswordBool" border="bottom">
+          <template #suffix>
+            <text :class="!newPasswordBool ? 'iconfont oaIcon-eye' : 'iconfont oaIcon-eye-close'" @click="newPasswordBool = !newPasswordBool"></text>
+          </template>
+        </u-input>
+
+        <u-input v-model="confirmPassword" placeholder="请再次输入新的密码" :password="confirmPasswordBool" border="bottom">
+          <template #suffix>
+            <text :class="!confirmPasswordBool ? 'iconfont oaIcon-eye' : 'iconfont oaIcon-eye-close'" @click="confirmPasswordBool = !confirmPasswordBool"></text>
+          </template>
+        </u-input>
+      </view>
+
+      <view class="modal-section-slot-item" v-if="modalTitle === '手机号验证'">
+        <view class="mb5 title">{{ modalTitle }}</view>
+        <view class="mb15 subTitle"> 请填写完整的手机号 {{ user.phonenumber }} 以验证身份 </view>
+        <u-input v-model="phone" placeholder="请输入手机号" :maxlength="11" border="bottom" />
+        <u-input v-model="verify" placeholder="请输入验证码" :maxlength="6" border="bottom">
+          <template #suffix>
+            <button class="verify" @click="getVerifyCode">{{ !useStore.codeTime ? "获取验证码" : useStore.codeTime + "s" }}</button>
+          </template>
+        </u-input>
+      </view>
+    </view>
+  </u-modal> -->
+</template>
+
+<script setup>
+/*----------------------------------依赖引入-----------------------------------*/
+import { onLoad, onShow, onReady, onHide, onLaunch, onUnload, onNavigationBarButtonTap, onPageScroll } from "@dcloudio/uni-app";
+import { ref, reactive, computed, getCurrentInstance, toRefs, inject } from "vue";
+/*----------------------------------接口引入-----------------------------------*/
+/*----------------------------------组件引入-----------------------------------*/
+/*----------------------------------store引入-----------------------------------*/
+import { useStores, commonStores, controlStores } from "@/store/modules/index";
+/*----------------------------------公共方法引入-----------------------------------*/
+/*----------------------------------公共变量-----------------------------------*/
+const { proxy } = getCurrentInstance();
+const useStore = useStores();
+const controlStore = controlStores();
+/*----------------------------------变量声明-----------------------------------*/
+const state = reactive({
+  loading: false,
+  dataList: [],
+  pageSize: 20,
+  current: 1,
+  total: 0,
+});
+
+const { dataList } = toRefs(state);
+const { avatar, user, userArr } = toRefs(useStore);
+
+/**
+ * @初始化
+ */
+function init() {}
+
+onReady(() => {});
+
+onShow(() => {});
+
+onLoad((options) => {
+  init();
+  useStore.GetUser();
+});
+
+onUnload(() => {});
+</script>
+
+<style lang="scss" scoped>
+.center-area {
+  padding: 0 20px;
+  color: #000000;
+
+  &-title {
+    text-align: center;
+    margin: 20px 0;
+  }
+
+  &-item {
+    display: flex;
+    position: relative;
+    padding: 15px;
+    background-color: #f2f1f6;
+    border-radius: 5px;
+    margin-bottom: 10px;
+    font-size: 16px;
+
+    .iconfont {
+      font-size: 18px;
+      color: $uni-color-primary;
+      margin: auto 0;
+      margin-right: 10px;
+    }
+
+    &-title {
+      margin: auto 0;
+    }
+
+    &-subTitle {
+      margin: auto 20px auto auto;
+      font-size: 14px;
+      color: #909399;
+      text-align: right;
+    }
+  }
+
+  &-item::before {
+    content: " ";
+    height: 10px;
+    width: 10px;
+    border-width: 2px 2px 0 0;
+    border-color: #c0c0c0;
+    border-style: solid;
+    -webkit-transform: matrix(0.5, 0.5, -0.5, 0.5, 0, 0);
+    transform: matrix(0.5, 0.5, -0.5, 0.5, 0, 0);
+    position: absolute;
+    top: 50%;
+    margin-top: -6px;
+    right: 30rpx;
+  }
+}
+</style>

+ 0 - 2
src/pages/login.vue

@@ -297,9 +297,7 @@ function handlePrivacy() {
 }
 
 onShow(() => {
-  // nextTick(() => {
   init();
-  // });
 });
 
 onLoad((options) => {

+ 5 - 0
src/pages/mine/secure/index.vue

@@ -148,6 +148,10 @@ const { modalShow, modalTitle, oldPassword, oldPasswordBool, newPassword, newPas
 const { avatar, user, userArr } = toRefs(useStore);
 
 function handleUserModal(title) {
+  // if (title == "修改密码") {
+  //   proxy.$tab.navigateTo("/pages/common/authentication/index");
+  //   return;
+  // }
   modalShow.value = true;
   modalTitle.value = title;
 }
@@ -297,6 +301,7 @@ onNavigationBarButtonTap((e) => {
     width: 100% !important;
 
     &-item {
+
       .title {
         text-align: center;
         color: #000;

+ 11 - 3
src/static/iconfont/iconfont.css

@@ -1,8 +1,8 @@
 @font-face {
   font-family: "iconfont"; /* Project id 4510027 */
-  src: url('iconfont.woff2?t=1741163438430') format('woff2'),
-       url('iconfont.woff?t=1741163438430') format('woff'),
-       url('iconfont.ttf?t=1741163438430') format('truetype');
+  src: url('iconfont.woff2?t=1744794181277') format('woff2'),
+       url('iconfont.woff?t=1744794181277') format('woff'),
+       url('iconfont.ttf?t=1744794181277') format('truetype');
 }
 
 .iconfont {
@@ -13,6 +13,14 @@
   -moz-osx-font-smoothing: grayscale;
 }
 
+.oaIcon-mima:before {
+  content: "\e8b2";
+}
+
+.oaIcon-left:before {
+  content: "\e62b";
+}
+
 .oaIcon-exit:before {
   content: "\e62a";
 }

BIN
src/static/iconfont/iconfont.ttf


BIN
src/static/images/door/ai.png


BIN
src/static/images/door/bg.png


BIN
src/static/images/door/setting_bindFace.png


BIN
src/static/images/door/setting_imgPath.png


BIN
src/static/images/door/setting_password.png


BIN
src/static/images/door/setting_record.png


BIN
src/static/images/door/setting_remark.png