浏览代码

Merge branch 'master' of http://git.ringzle.com:3000/lmc/witcarbon-app

wh 2 年之前
父节点
当前提交
a3f56d1614

+ 3 - 3
src/App.vue

@@ -12,12 +12,12 @@ export default {
     };
   },
   created() {
+    const username = this.getUrlKey("username");
+    const password = this.getUrlKey("password");
     this.getDictAll();
     if (localStorage.getItem("token")) {
-      this.getUserInfo();
+      this.getUserInfo(password);
     } else {
-      let username = this.getUrlKey("username");
-      let password = this.getUrlKey("password");
       if (username && password) {
         this.login(username, password);
       } else {

文件差异内容过多而无法显示
+ 1 - 0
src/assets/view.svg


+ 3 - 3
src/utils/vant.config.js

@@ -1,12 +1,11 @@
-
 import {
     Button, Cell, CellGroup, Icon, Image as VanImage, Col, Row, Popup, Calendar, Cascader, Checkbox,
     CheckboxGroup, Field, Form, Picker, RadioGroup, Radio, Rate, Search, Slider, Stepper,
-    Switch, Uploader, Dialog, DropdownMenu, DropdownItem, Loading,Toast, Notify, Overlay, PullRefresh, ShareSheet,
+    Switch, Uploader, Dialog, DropdownMenu, DropdownItem, Loading, Toast, Notify, Overlay, PullRefresh, ShareSheet,
     SwipeCell, Badge, Circle, Collapse, CollapseItem, CountDown, Divider, Empty, ImagePreview, List, NoticeBar,
     Popover, Progress, Skeleton, Step, Steps, Sticky, Swipe, SwipeItem, Tag, ActionBar, ActionBarIcon,
     ActionBarButton, Grid, GridItem, IndexBar, IndexAnchor, NavBar, Pagination, Sidebar, SidebarItem, Tab,
-    Tabs, Tabbar, TabbarItem, TreeSelect, NumberKeyboard,SubmitBar 
+    Tabs, Tabbar, TabbarItem, TreeSelect, NumberKeyboard, SubmitBar, DatetimePicker
 } from 'vant';
 export function vant(app) {
     app.use(Button);
@@ -79,4 +78,5 @@ export function vant(app) {
     app.use(TreeSelect);
     app.use(NumberKeyboard);
     app.use(SubmitBar);
+    app.use(DatetimePicker);
 }

+ 8 - 5
src/views/bill/detail.vue

@@ -93,11 +93,14 @@
                 class="list_item"
                 style="flex-direction: row; align-items: baseline"
               >
-                <van-checkbox
-                  :name="item.id"
-                  :disabled="item.status == 1"
-                  style="margin-left: 16px"
-                ></van-checkbox>
+                <template v-if="role == 'Tenant' && activeTab == 'bill'">
+                  <van-checkbox
+                    :name="item.id"
+                    :disabled="item.status == 1"
+                    style="margin-left: 16px"
+                  ></van-checkbox>
+                </template>
+
                 <van-collapse
                   v-model="activeCollapse"
                   :border="false"

+ 2 - 2
src/views/repair/detail.vue

@@ -267,10 +267,10 @@ export default {
           this.imagesList = this.dataForm.faultPics.split(",");
           if (this.dataForm.repairPersonId) {
             this.dataForm.repairPersonName = this.repairPersonList.find(
-              (item) => (item.id = this.dataForm.repairPersonId)
+              (item) => (item.id == this.dataForm.repairPersonId)
             ).name;
             this.dataForm.repairPersonMobile = this.repairPersonList.find(
-              (item) => (item.id = this.dataForm.repairPersonId)
+              (item) => (item.id == this.dataForm.repairPersonId)
             ).mobile;
           }
         } else {

+ 6 - 2
src/views/review/clock.vue

@@ -57,7 +57,7 @@
         <template v-if="dataList.length > 0">
           <div class="list_item" v-for="item in dataList" :key="item.id">
             <van-row class="row_title">
-              <van-col>{{ item.circuitPosition }}</van-col>
+              <van-col>{{ item.position }}</van-col>
             </van-row>
             <van-row class="row_info">
               <van-col>巡检时间:{{ item.circuitTime }}</van-col>
@@ -148,7 +148,11 @@ export default {
     },
     backPath() {
       clearInterval(this.IntervalTime);
-      this.$router.push({ path: "/review/list" });
+      if (this.circuitPosition) {
+        this.$router.push({ path: "/home" });
+      } else {
+        this.$router.back();
+      }
     },
     cutDown() {
       var date = new Date();

+ 1 - 1
src/views/review/list.vue

@@ -71,7 +71,7 @@
         >
           <div v-for="item in dataList" :key="item.id" class="list_item">
             <van-row class="header">
-              <van-col>{{ item.circuitPosition }}</van-col>
+              <van-col>{{ item.position }}</van-col>
             </van-row>
             <van-row>
               <van-col>巡检类型:</van-col>

+ 2 - 2
src/views/scanCode.vue

@@ -105,8 +105,8 @@ export default {
       );
     },
     onSubmit() {
-      this.dataForm.buildingId = this.scanText.buildingId;
-      this.dataForm.storeyId = this.scanText.storeyId;
+      this.dataForm.buildingId = this.scanText.buildingId.value;
+      this.dataForm.storeyId = this.scanText.storeyId.value;
       this.dataForm.position = this.dataForm.circuitPosition =
         this.scanText.position;
       this.dataForm.circuitTime = getCurrentTime();

+ 85 - 15
src/views/userInfo.vue

@@ -18,16 +18,25 @@
         </van-cell-group>
       </template>
       <template v-if="type == 'password'">
-        <van-form input-align="right" @submit="onSubmit">
+        <van-form
+          input-align="right"
+          error-message-align="right"
+          @submit="onSubmit"
+        >
           <van-cell-group>
             <van-field
               v-model="dataForm.password"
+              :type="showType"
               label="原密码"
               required
-              placeholder="请输入原密码"
-              clearable
-              :rules="[{ required: true, message: '请输入原密码' }]"
-            />
+            >
+              <template #right-icon v-if="dataForm.password">
+                <van-icon
+                  :name="require('@/assets/view.svg')"
+                  @click="showPwd"
+                ></van-icon>
+              </template>
+            </van-field>
             <van-field
               v-model="dataForm.newpassword"
               type="password"
@@ -36,7 +45,8 @@
               placeholder="请输入新密码"
               clearable
               :rules="[{ required: true, message: '请输入新密码' }]"
-            />
+            >
+            </van-field>
             <van-field
               v-model="dataForm.confirmpassword"
               type="password"
@@ -47,6 +57,22 @@
               :rules="[{ required: true, message: '请再次输入新密码' }]"
               @blur="handleBlur"
             />
+            <van-row align="center" class="msg_tip" style="margin-top: 16px">
+              <van-icon name="checked"></van-icon>
+              <van-col>密码由8~16位数字、字母或符号组成</van-col>
+            </van-row>
+            <van-row align="center" class="msg_tip">
+              <van-icon name="checked"></van-icon>
+              <van-col>至少含两种以上字符</van-col>
+            </van-row>
+            <van-row align="center" class="msg_tip">
+              <van-icon name="warning"></van-icon>
+              <van-col>不能包含连续字符</van-col>
+            </van-row>
+            <van-row align="center" class="msg_tip">
+              <van-icon name="warning"></van-icon>
+              <van-col>两次输入的密码不一致</van-col>
+            </van-row>
           </van-cell-group>
 
           <van-submit-bar class="save_btn">
@@ -80,33 +106,37 @@
   </div>
 </template>
 <script>
+import { mapGetters } from "vuex";
 export default {
   data() {
     return {
       type: "",
       title: "",
       loading: false,
+      showType: "password",
       dataForm: {
         username: "",
         tel: "",
-        password: "",
+        password: "123456",
         newpassword: "",
         confirmpassword: "",
       },
     };
   },
+  computed: {
+    ...mapGetters({ userInfo: "getUserInfo" }),
+  },
   created() {
+    console.log(this.userInfo);
+    this.typeOfNum("ling1234.,/?。,");
     this.type = this.$route.query.type;
     this.title =
       (this.type && (this.type == "account" ? "账号中心" : "更改密码")) || "";
-    this.dataForm.username = this.$store.state.username;
-    this.dataForm.tel = this.$store.state.userMobile;
-    this.dataForm.password = this.plusXing(
-      this.$store.state.password,
-      0,
-      0,
-      "*"
-    );
+    this.dataForm.username = this.userInfo.userName;
+    this.dataForm.tel = this.userInfo.mobile;
+    this.dataForm.password = this.userInfo.passWord
+      ? this.plusXing(this.userInfo.passWord, 0, 0, "*")
+      : "";
   },
   methods: {
     /* 部分隐藏处理
@@ -125,8 +155,35 @@ export default {
         str.substring(0, frontLen) + xing + str.substring(str.length - endLen)
       );
     },
+    showPwd() {
+      this.showType = "text";
+      this.dataForm.password = this.userInfo.passWord;
+      console.log(this.dataForm.password);
+    },
     //修改后的密码和原来不能相同
     handleBlur() {},
+    typeOfNum(val) {
+      let chsCount = 0;
+      let engCount = 0;
+      let numCount = 0;
+      let otherCount = 0;
+      for (let i = 0; i < val.length; i++) {
+        let num = val.charCodeAt(i); //转unicode码比较
+        if (num >= 19968 && num <= 40869) {
+          //汉字
+          chsCount++;
+        } else if ((num >= 65 && num <= 90) || (num >= 97 && num <= 122)) {
+          //字母
+          engCount++;
+        } else if (num >= 48 && num <= 57) {
+          //数字
+          numCount++;
+        } else {
+          otherCount++; //其他字符
+        }
+      }
+      console.log(chsCount, engCount, numCount, otherCount);
+    },
     onSubmit() {
       this.loading = true;
       setTimeout(() => {
@@ -148,5 +205,18 @@ export default {
   .info_user {
     margin: 12px 0 40px 0;
   }
+  .msg_tip {
+    padding: 0 16px;
+    .van-icon {
+      font-size: 16px;
+      color: #999999;
+    }
+    .van-col {
+      color: #999999;
+      font-size: 14px;
+      line-height: 24px;
+      text-indent: 4px;
+    }
+  }
 }
 </style>