wh il y a 2 ans
Parent
commit
28eb84bbfa

+ 25 - 31
src/App.vue

@@ -34,53 +34,47 @@ export default {
 </script>
 <style lang="scss">
 #app {
+  font-weight: 400;
   font-family: PingFangSC-Regular, PingFang SC;
   -webkit-font-smoothing: antialiased;
   -moz-osx-font-smoothing: grayscale;
   text-align: center;
-  color: #333333;
+  color: #0c1935;
   background: #f6f6f6;
   height: 100vh;
   box-sizing: border-box;
 }
 
-.main {
-  height: 100vh;
-  overflow-y: hidden;
+.van-cell {
   .van-cell__title {
     text-align: left;
-    color: #666666;
-  }
-  .van-cell__value {
-    color: #999999;
   }
-  --van-cell-font-size: 16px;
-  --van-field-label-color: #666666;
-  --van-field-input-text-color: #333333;
-  --van-nav-bar-icon-color: #333333;
-  --van-nav-bar-title-text-color: #333333;
-  --van-font-weight-bold: 600;
-  --van-nav-bar-title-font-size: 16px;
-  --van-button-normal-font-size: 16px;
+  --van-cell-text-color: #666666;
+}
+.van-button {
+  font-weight: 600;
+}
+.save_btn {
+  position: fixed;
+  bottom: 0;
+  width: 100%;
+  padding: 8px 16px;
+  background-color: #ffffff;
+  box-shadow: 0px -2px 10px 0px rgba(0, 0, 0, 0.2);
   .van-button {
-    font-weight: 600;
-  }
-  .save_btn {
-    position: fixed;
-    bottom: 0;
-    width: 100%;
-    padding: 8px 16px;
-    background-color: #ffffff;
-    box-shadow: 0px -2px 10px 0px rgba(0, 0, 0, 0.2);
-    --van-button-border-width: 0;
-    --van-button-default-border-color: unset;
-    --van-button-border-radius: 4px;
-    .van-button {
-      width: calc(100% - 32px);
-    }
+    width: calc(100% - 32px);
   }
 }
 :root {
+  --van-gray-3: unset;
+  --van-gray-6: #999999;
+  --van-gray-7: #666666;
+  --van-gray-8: #333333;
+  --van-font-weight-bold: 600;
+  --van-text-color: #333333;
+  --van-font-size-md: 16px;
+  --van-font-size-lg: 16px;
   --van-border-radius-sm: 4px;
+  --van-border-width-base: 0;
 }
 </style>

Fichier diff supprimé car celui-ci est trop grand
+ 22 - 0
src/assets/arrow-left.svg


Fichier diff supprimé car celui-ci est trop grand
+ 45 - 0
src/assets/rent-bill-active.svg


Fichier diff supprimé car celui-ci est trop grand
+ 15 - 0
src/assets/tel.svg


+ 1 - 0
src/main.js

@@ -6,6 +6,7 @@ import VConsole from 'vconsole';
 import { vant } from './utils/vant.config';
 import 'vant/es/toast/style';//无法自动按需引入这两个的样式,需要手动引入
 import 'vant/es/notify/style';
+import 'vant/es/dialog/style';
 
 if (process.env.NODE_ENV !== "production") {
     new VConsole({ theme: 'dark' });

+ 10 - 9
src/router/index.js

@@ -24,19 +24,11 @@ const routes = [
   {
     name: 'userInfo',
     path: '/userInfo',
-    component: () => import('../views/userInfo/index'),
+    component: () => import('../views/userInfo'),
     meta: {
       title: '账号中心',
     },
   },
-  {
-    name: 'changePassWord',
-    path: '/changePassWord',
-    component: () => import('../views/userInfo/changePassWord'),
-    meta: {
-      title: '修改密码',
-    },
-  },
   {
     name: 'repairOnline',
     path: '/repairOnline',
@@ -118,6 +110,15 @@ const routes = [
       title: '账单明细',
     },
   }
+  ,
+  {
+    name: 'checkClock',
+    path: '/checkClock',
+    component: () => import('../views/checkClock'),
+    meta: {
+      title: '巡检打卡',
+    },
+  }
   // {
   //   path: '/alllist',
   //   name: '全部人员列表',

+ 2 - 1
src/utils/index.js

@@ -19,4 +19,5 @@ export function isEmpty(v) {
             return true;
     }
     return false;
-}
+}
+

+ 240 - 0
src/views/checkClock.vue

@@ -0,0 +1,240 @@
+<template>
+  <van-nav-bar
+    title="巡检打卡"
+    left-arrow
+    @click-left="onClickLeft"
+    safe-area-inset-top
+  />
+  <div class="page_info">
+    <div class="info_pannel">
+      <van-image
+        width="48"
+        height="48"
+        src="https://fastly.jsdelivr.net/npm/@vant/assets/cat.jpeg"
+      />
+      <div class="pannel_info">
+        <van-row align="center" style="margin-bottom: 10px">
+          <van-col class="info_name">{{ dataForm.name }}</van-col>
+          <van-image
+            width="14"
+            height="14"
+            :src="require('@/assets/tel.svg')"
+            style="margin: 0 6px 0 16px"
+          />
+          <van-col class="info_tel">{{ dataForm.tel }}</van-col>
+        </van-row>
+        <van-row>
+          <van-col class="info_type">{{
+            `${checkType_filter(dataForm.checkType)}`
+          }}</van-col>
+        </van-row>
+      </div>
+    </div>
+    <div class="info_clock">
+      <van-row align="center" class="clock_title">
+        <van-col>
+          <van-icon name="location" color="#6DD400"></van-icon>
+          当前打卡位置:{{ dataForm.position }}
+        </van-col>
+      </van-row>
+      <div class="circle_btn">
+        <van-row class="btn_title">
+          <van-col>完成打卡</van-col>
+        </van-row>
+        <van-row class="btn_time">
+          <van-col>{{ timeStr && timeStr.substr(11) }}</van-col>
+        </van-row>
+      </div>
+    </div>
+    <div class="info_list">
+      <van-row class="sub_title">
+        <van-col>今日打卡记录</van-col>
+      </van-row>
+      <div class="list_item" v-for="item in list" :key="item.id">
+        <van-row class="row_title">
+          <van-col>{{ item.position }}</van-col>
+        </van-row>
+        <van-row class="row_info">
+          <van-col>巡检时间:{{ item.checkTime }}</van-col>
+        </van-row>
+      </div>
+    </div>
+  </div>
+</template>
+<script>
+import { isEmpty } from "@/utils/index.js";
+export default {
+  data() {
+    return {
+      IntervalTime: null,
+      timeStr: "",
+      dataForm: {
+        name: "李明",
+        tel: 15839376490,
+        checkType: 1,
+        position: "B座13楼",
+      },
+      list: [
+        { id: 1, position: "B座13楼", checkTime: "2022-09-20 10:34:22" },
+        { id: 2, position: "B座14楼", checkTime: "2022-09-20 10:44:22" },
+      ],
+    };
+  },
+  mounted() {
+    this.IntervalTime = setInterval(this.time, 1000);
+  },
+  methods: {
+    checkType_filter(val) {
+      if (isEmpty(val)) {
+        return "";
+      }
+      if (val == 1) {
+        return "安保组";
+      }
+      if (val == 2) {
+        return "电";
+      }
+      if (val == 3) {
+        return "其他";
+      }
+    },
+
+    time() {
+      console.log("time:" + this.timeStr);
+      var date = new Date();
+      var year = date.getFullYear();
+      var month = date.getMonth() + 1;
+      var day = date.getDate();
+      var hours = date.getHours();
+      var minutes = date.getMinutes();
+      var seconds = date.getSeconds();
+      this.timeStr =
+        year +
+        "-" +
+        month +
+        "-" +
+        day +
+        "-" +
+        hours +
+        ":" +
+        minutes +
+        ":" +
+        seconds;
+    },
+  },
+  beforeDestroy() {
+    clearInterval(this.IntervalTime);
+  },
+};
+</script>
+<style lang="scss" scoped>
+.page_info {
+  padding: 16px;
+  max-height: calc(
+    100% - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 46px - 32px
+  );
+  overflow-y: auto;
+  .info_pannel {
+    display: flex;
+    align-items: center;
+    padding: 12px 16px;
+    background: #ffffff;
+    box-shadow: 0px 0px 10px 0px rgba(153, 153, 153, 0.15);
+    border-radius: 4px;
+    .pannel_info {
+      margin-left: 12px;
+      .info_name {
+        font-size: 16px;
+        font-weight: 600;
+      }
+      .info_tel {
+        font-size: 14px;
+        color: #666666;
+      }
+      .info_type {
+        font-size: 12px;
+        color: #999999;
+      }
+    }
+  }
+  .info_clock {
+    height: 380px;
+    display: flex;
+    flex-direction: column;
+    align-items: center;
+    justify-content: center;
+    background: #ffffff;
+    box-shadow: 0px 0px 10px 0px rgba(153, 153, 153, 0.15);
+    border-radius: 4px;
+    .clock_title {
+      .van-col {
+        font-size: 12px;
+        color: #999999;
+      }
+    }
+
+    .circle_btn {
+      width: 120px;
+      height: 120px;
+      display: flex;
+      flex-direction: column;
+      align-items: center;
+      justify-content: center;
+      margin-top: 40px;
+      border-radius: 50%;
+      background: #5c8fff;
+      color: #ffffff;
+      .btn_title {
+        .van-col {
+          height: 24px;
+          font-size: 18px;
+          font-weight: 600;
+          line-height: 24px;
+          margin-bottom: 4px;
+        }
+      }
+      .btn_time {
+        .van-col {
+          height: 22px;
+          font-size: 16px;
+          line-height: 22px;
+        }
+      }
+    }
+  }
+  .info_list {
+    .sub_title {
+      margin: 20px 0 12px 0;
+      height: 20px;
+      font-size: 14px;
+      font-weight: 600;
+      color: #666666;
+      line-height: 20px;
+    }
+    .list_item {
+      padding: 12px 16px;
+      background: #ffffff;
+      box-shadow: 0px 0px 10px 0px rgba(153, 153, 153, 0.15);
+      border-radius: 4px;
+      margin-bottom: 12px;
+      &:nth-last-child(1) {
+        margin-bottom: 0;
+      }
+      .row_title {
+        height: 22px;
+        font-size: 16px;
+        font-weight: 600;
+        color: #313836;
+        line-height: 22px;
+        margin-bottom: 4px;
+      }
+      .row_info {
+        height: 18px;
+        font-size: 14px;
+        color: #999999;
+        line-height: 18px;
+      }
+    }
+  }
+}
+</style>

+ 266 - 171
src/views/home.vue

@@ -1,8 +1,8 @@
 <template>
-  <div class="page_home">
-    <div class="home_bg">
-      <div class="bg_title">
-        <div class="title_info">
+  <div class="page_info">
+    <div class="info_bg">
+      <van-row align="center" class="bg_title">
+        <van-col>
           <van-image
             :src="require('@/assets/position.svg')"
             width="16"
@@ -16,105 +16,147 @@
             height="24"
             fit="contain"
           />
-        </div>
-        <div class="user_info" @click="toPath">
+        </van-col>
+        <van-col @click="toPath">
           <van-image
             :src="require('@/assets/user.svg')"
             width="16"
             height="16"
             fit="contain"
           />
-        </div>
-      </div>
+        </van-col>
+      </van-row>
     </div>
-    <div class="home_info">
-      <div class="info_content">
+    <!-- 维修工没有此块功能 -->
+    <template v-if="role != 3">
+      <div class="info_function">
         <div
-          class="content_item"
+          class="function_item"
           v-for="(item, index) in functionList"
           :key="index"
+          :style="{ display: !item.role.includes(role) ? 'none' : '' }"
         >
-          <van-image :src="item.src" width="36" height="36" fit="contain" />
-          <span>{{ item.label }}</span>
+          <template v-if="item.role.includes(role)">
+            <van-image :src="item.src" width="36" height="36" fit="contain" />
+            <span>{{ item.label }}</span>
+          </template>
         </div>
       </div>
-    </div>
-    <div class="card_list">
-      <div class="sub_title">
-        <span>工单待办</span>
-        <div class="function_btn">
-          <span>立即处理</span>
+    </template>
+    <div class="info_list">
+      <!-- 实时巡检begin -->
+      <van-row align="center" justify="space-between" class="sub_title">
+        <van-col class="title">实时巡检</van-col>
+        <van-col class="function_btn">
+          <van-col>立即巡检</van-col>
           <van-image
             :src="require('@/assets/btn-arrow-right.svg')"
             width="24"
             height="24"
             fit="contain"
           />
-        </div>
-      </div>
-      <div class="list_item">
-        <div
-          class="item_info"
+        </van-col>
+      </van-row>
+      <van-row align="center" justify="space-between" class="list_item">
+        <van-row
+          align="center"
+          justify="space-between"
+          style="flex-direction: column"
+          v-for="(item, index) in checkList"
+          :key="item + '_' + index"
+        >
+          <van-col>{{ item.label }}</van-col>
+          <v-count-up
+            :end-val="Number(item['count'])"
+            class="count_up"
+            :options="item['options']"
+          />
+        </van-row>
+      </van-row>
+      <!-- 实时巡检end -->
+
+      <!-- 工单待办begin -->
+      <van-row align="center" justify="space-between" class="sub_title">
+        <van-col class="title">工单待办</van-col>
+        <van-col class="function_btn">
+          <van-col>立即处理</van-col>
+          <van-image
+            :src="require('@/assets/btn-arrow-right.svg')"
+            width="24"
+            height="24"
+            fit="contain"
+          />
+        </van-col>
+      </van-row>
+      <van-row align="center" justify="space-between" class="list_item">
+        <van-row
+          align="center"
+          justify="space-between"
+          style="flex-direction: column"
           v-for="(item, index) in workList"
           :key="item + '_' + index"
         >
-          <span class="label">{{ item.label }}</span>
+          <van-col>{{ item.label }}</van-col>
           <v-count-up
             :end-val="Number(item['count'])"
             class="count_up"
             :options="item['options']"
           />
-        </div>
-      </div>
-      <div class="sub_title">
-        <span>设备异常</span>
-        <div class="function_btn">
-          <span>立即处理</span>
+        </van-row>
+      </van-row>
+      <!-- 工单待办end -->
+
+      <!-- 设备异常begin -->
+      <van-row align="center" justify="space-between" class="sub_title">
+        <van-col class="title">工单待办</van-col>
+        <van-col class="function_btn">
+          <van-col>立即处理</van-col>
           <van-image
             :src="require('@/assets/btn-arrow-right.svg')"
             width="24"
             height="24"
             fit="contain"
           />
-        </div>
-      </div>
-      <div class="list_item">
-         <div
-          class="item_info"
+        </van-col>
+      </van-row>
+       <van-row align="center" justify="space-between" class="list_item">
+         <van-row
+          align="center"
+          justify="space-between"
+          style="flex-direction: column"
         >
-          <span class="label">{{abnormalNum.label}}</span>
+          <van-col>{{ abnormalNum.label }}</van-col>
           <v-count-up
-            :end-val="Number(abnormalNum.count)"
+            :end-val="Number(abnormalNum['count'])"
             class="count_up"
-            style="color: #fa5555"
           />
-        </div>
-        <div
-          class="item_info"
+        </van-row>
+        <van-row
+          align="center"
+          justify="space-between"
+          style="flex-direction: column"
           v-for="(item, index) in deviceErrorList"
-          :key="item + '-' + index"
+          :key="item + '_' + index"
         >
-          <span class="label">{{ item.label }}</span>
+          <van-col>{{ item.label }}</van-col>
           <v-count-up
             :end-val="Number(item['count'])"
             class="count_up"
-            :options="item['options']"
-            style="color: #fa5555"
           />
-        </div>
-      </div>
-      <div class="sub_title ">
-        <span>欠费待收</span>
-        <div class="function_btn">
-          <span>立即催收</span>
+        </van-row>
+      </van-row>
+       <van-row align="center" justify="space-between" class="sub_title">
+        <van-col class="title">欠费待收</van-col>
+        <van-col class="function_btn">
+          <van-col>立即处理</van-col>
           <van-image
             :src="require('@/assets/btn-arrow-right.svg')"
             width="24"
             height="24"
             fit="contain"
           />
-        </div>
-      </div>
+        </van-col>
+      </van-row>
       <div class="list_table">
         <van-row class="billTit" style="padding-bottom:10px">
   <van-col span="8">欠费类型</van-col>
@@ -127,32 +169,52 @@
   <van-col span="8" class="billAmount">{{item.arrearageAmount}}</van-col>
 </van-row>
       </div>
+      <!-- 欠费待收end -->
     </div>
-    <van-tabbar
-      v-model="activeTab"
-      active-color="#5776E6"
-      inactive-color="#333333"
-    >
-      <van-tabbar-item name="home" :icon="require('@/assets/home.svg')" to=""
-        >首页</van-tabbar-item
-      >
-      <van-tabbar-item
-        name="rentBill"
-        :icon="require('@/assets/rent-bill.svg')"
-        to=""
-        >租户账单</van-tabbar-item
-      >
-      <van-tabbar-item
-        name="remoteControl"
-        :icon="require('@/assets/remote-control.svg')"
-        to=""
-        >远程管控</van-tabbar-item
-      >
-    </van-tabbar>
   </div>
+
+  <!-- 底部tabbar -->
+  <van-tabbar
+    v-model="activeTabBar"
+    active-color="#2E69EB"
+    inactive-color="#333333"
+    safe-area-inset-bottom
+  >
+    <van-tabbar-item
+      name="home"
+      :icon="
+        activeTabBar == 'home'
+          ? require('@/assets/home-active.svg')
+          : require('@/assets/home.svg')
+      "
+      to="/home"
+      >首页</van-tabbar-item
+    >
+    <van-tabbar-item
+      name="rentBill"
+      :icon="
+        activeTabBar == 'rentBill'
+          ? require('@/assets/rent-bill-active.svg')
+          : require('@/assets/rent-bill.svg')
+      "
+      to="/rentBill"
+      >租户账单</van-tabbar-item
+    >
+    <van-tabbar-item
+      name="remoteControl"
+      :icon="
+        activeTabBar == 'remoteControl'
+          ? require('@/assets/remote-control-active.svg')
+          : require('@/assets/remote-control.svg')
+      "
+      to="/remoteControl"
+      >远程管控</van-tabbar-item
+    >
+  </van-tabbar>
 </template>
 <script>
-import api from '../utils/api';
+import { isEmpty } from "@/utils/index.js";
+import api from "../utils/api";
 import VCountUp from "./CountUp";
 export default {
   components: {
@@ -160,15 +222,44 @@ export default {
   },
   data() {
     return {
+      role: 1, //1:admin、2:巡检人员、3:维修工、4:租户
       name: "电商园四期-B座",
-      activeTab: "rentBill",
+      activeTabBar: "home",
       functionList: [
-        { src: require("@/assets/repair-online.svg"), label: "线上报修" },
-        { src: require("@/assets/check-review.svg"), label: "巡检记录" },
-        { src: require("@/assets/reduce-record.svg"), label: "扣缴记录" },
+        {
+          src: require("@/assets/repair-online.svg"),
+          label: "线上报修",
+          role: [1, 2, 4],
+        },
+        {
+          src: require("@/assets/check-review.svg"),
+          label: "巡检记录",
+          role: [1, 2],
+        },
+        {
+          src: require("@/assets/reduce-record.svg"),
+          label: "扣缴记录",
+          role: [1, 4],
+        },
       ],
-      billPaymentList:[],
-      abnormalNum:{label:'异常总数',count:''},
+      checkList: [
+        {
+          label: "今日待巡检",
+          count: 88,
+          options: {
+            separator: ",",
+          },
+        },
+        {
+          label: "今日已巡检",
+          count: 2,
+          options: {
+            separator: ",",
+          },
+        },
+      ],
+      billPaymentList: [],
+      abnormalNum: { label: "异常总数", count: "" },
       workList: [
         {
           label: "待指派",
@@ -187,33 +278,33 @@ export default {
       loading: false,
     };
   },
-  created(){
+  created() {
     this.getHomeData();
   },
   methods: {
-    getHomeData(){
-      api.homedata().then(res=>{
-        console.log(res)
-        if(res.code==0){
+    getHomeData() {
+      api.homedata().then((res) => {
+        console.log(res);
+        if (res.code == 0) {
           //工单代办数据
-          for(let k in res.data.workOrder){
-            this.workList[k-1].count=res.data.workOrder[k]
+          for (let k in res.data.workOrder) {
+            this.workList[k - 1].count = res.data.workOrder[k];
           }
           //设备异常数据
-          let mapsArr=[];
-           for(let k in res.data.equip.maps){
-            let json={};
-            json.label=k;
-            json.count=res.data.equip.maps[k];
+          let mapsArr = [];
+          for (let k in res.data.equip.maps) {
+            let json = {};
+            json.label = k;
+            json.count = res.data.equip.maps[k];
             mapsArr.push(json);
           }
-          this.deviceErrorList=mapsArr;
+          this.deviceErrorList = mapsArr;
           //赋值异常总数
-          this.abnormalNum.count=res.data.equip.abnormalNum;
+          this.abnormalNum.count = res.data.equip.abnormalNum;
           //欠费待收数据
-          this.billPaymentList=res.data.billPaymentList;
+          this.billPaymentList = res.data.billPaymentList;
         }
-      })
+      });
     },
     onLoad() {
       setTimeout(() => {
@@ -242,17 +333,24 @@ export default {
       this.onLoad();
     },
     toPath() {
-      this.$router.push("/userInfo");
+      this.$router.push({
+        path: "/userInfo",
+        query: {
+          title: "账号中心",
+          source: "account",
+        },
+      });
     },
   },
 };
 </script>
 <style lang="scss" scoped>
-.page_home {
+.page_info {
   position: relative;
-  height: calc(100vh - 60px);
-  overflow: auto;
-  .home_bg {
+  height: calc(
+    100% - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 60px
+  );
+  .info_bg {
     width: 100%;
     height: 102px;
     background: #5c8fff;
@@ -264,69 +362,62 @@ export default {
       align-items: center;
       justify-content: space-between;
       padding: 0 16px;
-      .title_info {
+      .van-col {
+        height: 24px;
+        font-size: 16px;
+        font-weight: 600;
+        color: #ffffff;
+        line-height: 24px;
+        text-shadow: 0px 2px 4px rgba(0, 0, 0, 0.04);
         display: flex;
         align-items: center;
-        span {
-          height: 24px;
-          font-size: 16px;
-          font-weight: 600;
-          color: #ffffff;
-          line-height: 24px;
-          text-align: center;
-          text-indent: 4px;
-          text-shadow: 0px 2px 4px rgba(0, 0, 0, 0.04);
-        }
       }
     }
   }
-  .home_info {
+  .info_function {
     position: absolute;
     top: 52px;
     width: calc(100% - 32px);
-    padding: 0 16px;
-    .info_content {
-      background: #ffffff;
-      box-shadow: 0px 0px 8px 0px rgba(51, 51, 51, 0.08);
-      border-radius: 4px;
+    margin: 0 16px;
+    background: #ffffff;
+    box-shadow: 0px 0px 8px 0px rgba(51, 51, 51, 0.08);
+    border-radius: 4px;
+    display: flex;
+    align-items: center;
+    justify-content: space-around;
+    padding: 16px 0;
+    .function_item {
       display: flex;
+      flex-direction: column;
       align-items: center;
-      justify-content: space-between;
-      padding: 16px 30px;
-      .content_item {
-        display: flex;
-        flex-direction: column;
-        align-items: center;
-        justify-content: center;
-        span {
-          height: 20px;
-          font-size: 14px;
-          font-weight: 400;
-          color: #697081;
-          line-height: 20px;
-          margin-top: 4px;
-        }
+      justify-content: center;
+      span {
+        height: 20px;
+        font-size: 14px;
+        font-weight: 400;
+        color: #697081;
+        line-height: 20px;
+        margin-top: 4px;
       }
     }
   }
-  .card_list {
+  .info_list {
+    max-height: calc(100% - 114px - 42px - 20px);
     padding: 0 16px;
+    overflow-y: auto;
     .sub_title {
-      display: flex;
-      align-items: center;
-      justify-content: space-between;
       margin: 12px 0 6px 0;
-      span {
+      .title {
         height: 20px;
         font-size: 14px;
-        font-weight: 600;
+        font-weight: 500;
         color: #0c1935;
         line-height: 20px;
       }
       .function_btn {
         display: flex;
         align-items: center;
-        span {
+        .van-col {
           height: 16px;
           font-size: 12px;
           font-weight: 400;
@@ -340,29 +431,34 @@ export default {
       box-shadow: 0px 0px 4px 0px rgba(51, 51, 51, 0.08);
       border-radius: 4px;
       padding: 16px 30px;
-      display: flex;
-      align-items: center;
-      justify-content: space-between;
-      .item_info {
-        display: flex;
-        flex-direction: column;
-        align-items: center;
-        justify-content: center;
-        .label {
+      .van-col {
+        height: 16px;
+        font-size: 12px;
+        font-weight: 400;
+        color: #666666;
+        line-height: 16px;
+      }
+      .count_up {
+        margin-top: 4px;
+        height: 22px;
+        font-size: 20px;
+        font-weight: 500;
+        color: #0c1935;
+        line-height: 22px;
+      }
+    }
+    .list_table {
+      padding: 8px 16px;
+      .table_header {
+        padding: 8px 0;
+        border-bottom: 1px solid #eeeeee;
+        .van-col {
           height: 16px;
           font-size: 12px;
-          font-weight: 400;
-          color: #697081;
+          font-weight: 600;
+          color: #999999;
           line-height: 16px;
         }
-        .count_up {
-          margin-top: 4px;
-          height: 22px;
-          font-size: 20px;
-          font-weight: 500;
-          color: #0c1935;
-          line-height: 22px;
-        }
       }
     }
     .list_table {
@@ -385,20 +481,19 @@ export default {
         }
       }
     }
-    .billList{
+    .billList {
       padding: 15px 0;
-      border-top:1px solid #eee;
+      border-top: 1px solid #eee;
     }
-    .billTit{
-          height: 16px;
-    font-size: 12px;
-    font-weight: 400;
-    color: #697081;
-    line-height: 16px;
+    .billTit {
+      height: 16px;
+      font-size: 12px;
+      font-weight: 400;
+      color: #697081;
+      line-height: 16px;
     }
-    .billAmount{
+    .billAmount {
       font-size: 16px;
-
     }
   }
 }

+ 1 - 0
src/views/login.vue

@@ -50,6 +50,7 @@
               round
               block
               type="primary"
+              color="#2E69EB"
               :loading="loading"
               loading-text="登陆中。。。"
               native-type="submit"

+ 46 - 13
src/views/repairDetail.vue

@@ -66,14 +66,28 @@
     </div>
   </div>
   <div class="save_btn">
-    <van-button
-      block
-      type="primary"
-      loading-type="spinner"
-      @click="handleClick"
-    >
-      指派维修人员
-    </van-button>
+    <template v-if="role == 3">
+      <van-button
+        block
+        type="primary"
+        loading-type="spinner"
+        :loading="loading"
+        loading-text="维修完成"
+        @click="handleClick('finish')"
+      >
+        维修完成
+      </van-button>
+    </template>
+    <template v-if="role == 1">
+      <van-button
+        block
+        type="primary"
+        loading-type="spinner"
+        @click="handleClick('dispatch')"
+      >
+        指派维修人员
+      </van-button>
+    </template>
   </div>
   <van-popup
     v-model:show="showPopup"
@@ -167,6 +181,7 @@ export default {
   },
   data() {
     return {
+      role: 3,
       loading: false,
       title: "",
       showImgPreview: false,
@@ -250,11 +265,29 @@ export default {
         return "普通";
       }
     },
-    handleClick() {
-      this.showPopup = !this.showPopup;
-      this.$nextTick(() => {
-        this.$refs.dataForm.resetValidation();
-      });
+    handleClick(type) {
+      if (type == "finish") {
+        this.$dialog
+          .confirm({
+            message: "请确认是否维修完成",
+          })
+          .then(() => {
+            this.loading = true;
+            setTimeout(() => {
+              this.loading = false;
+            }, 2000);
+            // on confirm
+          })
+          .catch(() => {
+            // on cancel
+          });
+      }
+      if (type == "dispatch") {
+        this.showPopup = !this.showPopup;
+        this.$nextTick(() => {
+          this.$refs.dataForm.resetValidation();
+        });
+      }
     },
     onSubmit() {
       this.loading = true;

+ 139 - 0
src/views/userInfo.vue

@@ -0,0 +1,139 @@
+<template>
+  <van-nav-bar :title="title">
+    <template #left>
+      <van-icon
+        :name="require('@/assets/arrow-left.svg')"
+        size="24"
+        @click="backPath"
+      />
+    </template>
+  </van-nav-bar>
+  <div class="page_info">
+    <div class="info_user">
+      <template v-if="source == 'account'">
+        <van-cell-group>
+          <van-cell title="账号名称" :value="dataForm.username" />
+          <van-cell title="手机号码" :value="dataForm.tel" />
+          <van-cell title="账号密码" :value="dataForm.password" />
+        </van-cell-group>
+      </template>
+      <template v-if="source == 'password'">
+        <van-form input-align="right" @submit="onSubmit">
+          <van-cell-group>
+            <van-field
+              v-model="dataForm.password"
+              label="原密码"
+              required
+              placeholder="请输入原密码"
+              clearable
+              :rules="[{ required: true, message: '请输入原密码' }]"
+            />
+            <van-field
+              v-model="dataForm.newpassword"
+              type="password"
+              label="新密码"
+              required
+              placeholder="请输入新密码"
+              clearable
+              :rules="[{ required: true, message: '请输入新密码' }]"
+            />
+            <van-field
+              v-model="dataForm.confirmpassword"
+              type="password"
+              label="确认密码"
+              required
+              placeholder="请再次输入新密码"
+              clearable
+              :rules="[{ required: true, message: '请再次输入新密码' }]"
+              @blur="handleBlur"
+            />
+          </van-cell-group>
+          <div class="save_btn">
+            <van-button
+              block
+              type="primary"
+              :loading="loading"
+              loading-type="spinner"
+              native-type="submit"
+              loading-text="提交"
+            >
+              提交
+            </van-button>
+          </div>
+        </van-form>
+      </template>
+    </div>
+    <template v-if="source == 'account'">
+      <van-button
+        style="margin-top: 40px; border-radius: 0"
+        block
+        color="#2E69EB"
+        plain
+        @click="loginOut"
+      >
+        注销登录
+      </van-button>
+    </template>
+  </div>
+</template>
+<script>
+export default {
+  data() {
+    return {
+      source: "",
+      title: "",
+      loading: false,
+      dataForm: {
+        username: "张浩",
+        tel: 158304802928,
+        password: "123456",
+        newpassword: "",
+        confirmpassword: "",
+      },
+    };
+  },
+  created() {
+    this.title = this.$route.query.title;
+    this.source = this.$route.query.source;
+    this.dataForm.password = this.plusXing(this.dataForm.password, 0, 0, "*");
+  },
+  methods: {
+    /* 部分隐藏处理
+     ** str 需要处理的字符串
+     ** frontLen 保留的前几位
+     ** endLen 保留的后几位
+     ** cha 替换的字符串
+     */
+    plusXing(str, frontLen, endLen, cha) {
+      let len = str.length - frontLen - endLen;
+      let xing = "";
+      for (let i = 0; i < len; i++) {
+        xing += cha;
+      }
+      return (
+        str.substring(0, frontLen) + xing + str.substring(str.length - endLen)
+      );
+    },
+    //修改后的密码和原来不能相同
+    handleBlur() {},
+    onSubmit() {
+      this.loading = true;
+      setTimeout(() => {
+        this.loading = false;
+        this.$router.push("/");
+      }, 2000);
+    },
+    loginOut() {},
+    backPath() {
+      this.$router.back();
+    },
+  },
+};
+</script>
+<style lang="scss" scoped>
+.page_info {
+  .info_user {
+    margin: 12px 0 40px 0;
+  }
+}
+</style>

+ 0 - 101
src/views/userInfo/changePassWord.vue

@@ -1,101 +0,0 @@
-<template>
-<van-nav-bar title="更改密码" left-arrow @click-left="onClickLeft" />
-  <div class="page_user">
-    <div class="user_info">
-      <van-form input-align="right" @submit="onSubmit">
-        <van-cell-group>
-          <van-field
-            v-model="dataForm.password"
-            label="原密码"
-            required
-            placeholder="请输入原密码"
-            clearable
-            :rules="[{ required: true, message: '请输入原密码' }]"
-          />
-          <van-field
-            v-model="dataForm.newpassword"
-            type="password"
-            label="新密码"
-            required
-            placeholder="请输入新密码"
-            clearable
-            :rules="[{ required: true, message: '请输入新密码' }]"
-          />
-          <van-field
-            v-model="dataForm.confirmpassword"
-            type="password"
-            label="确认密码"
-            required
-            placeholder="请再次输入新密码"
-            clearable
-            :rules="[{ required: true, message: '请再次输入新密码' }]"
-            @blur="handleBlur"
-          />
-        </van-cell-group>
-        <div class="save_btn">
-          <van-button
-            block
-            type="primary"
-            :loading="loading"
-            loading-type="spinner"
-            native-type="submit"
-            loading-text="提交"
-          >
-            提交
-          </van-button>
-        </div>
-      </van-form>
-    </div>
-  </div>
-</template>
-<script>
-export default {
-  data() {
-    return {
-      loading: false,
-      dataForm: {
-        id: "",
-        password: "123456",
-        newpassword: "123456",
-        confirmpassword: "123456",
-      },
-    };
-  },
-  created() {
-    this.dataForm.password = this.plusXing(this.dataForm.password, 0, 0, "*");
-  },
-  methods: {
-    /* 部分隐藏处理
-     ** str 需要处理的字符串
-     ** frontLen 保留的前几位
-     ** endLen 保留的后几位
-     ** cha 替换的字符串
-     */
-    plusXing(str, frontLen, endLen, cha) {
-      let len = str.length - frontLen - endLen;
-      let xing = "";
-      for (let i = 0; i < len; i++) {
-        xing += cha;
-      }
-      return (
-        str.substring(0, frontLen) + xing + str.substring(str.length - endLen)
-      );
-    },
-    onClickLeft() {},
-    //修改后的密码和原来不能相同
-    handleBlur() {},
-    onSubmit() {
-      this.loading = true;
-      setTimeout(() => {
-        this.loading = false;
-        this.$router.push("/");
-      }, 2000);
-    },
-  },
-};
-</script>
-<style lang="scss" scoped>
-.page_user {
-    margin: 12px 0 40px 0;
-}
-</style>

+ 0 - 73
src/views/userInfo/index.vue

@@ -1,73 +0,0 @@
-<template>
-  <van-nav-bar title="账号中心" left-arrow @click-left="onClickLeft" />
-  <div class="page_user">
-    <div class="user_info">
-      <van-cell-group>
-        <van-cell title="账号名称" :value="username" />
-        <van-cell title="手机号码" :value="tel" />
-        <van-cell title="账号密码" :value="password" />
-      </van-cell-group>
-    </div>
-
-    <van-button
-      style="margin-top: 40px"
-      block
-      color="#2E69EB"
-      plain
-      :loading="loading"
-      @click="loginOut"
-    >
-      注销登录
-    </van-button>
-  </div>
-</template>
-<script>
-export default {
-  data() {
-    return {
-      loading: false,
-      username: "张浩",
-      tel: 158304802928,
-      password: "123456",
-    };
-  },
-  created() {
-    this.password = this.plusXing(this.password, 0, 0, "*");
-  },
-  methods: {
-    /* 部分隐藏处理
-     ** str 需要处理的字符串
-     ** frontLen 保留的前几位
-     ** endLen 保留的后几位
-     ** cha 替换的字符串
-     */
-    plusXing(str, frontLen, endLen, cha) {
-      let len = str.length - frontLen - endLen;
-      let xing = "";
-      for (let i = 0; i < len; i++) {
-        xing += cha;
-      }
-      return (
-        str.substring(0, frontLen) + xing + str.substring(str.length - endLen)
-      );
-    },
-    onClickLeft() {},
-    loginOut() {
-      this.loading = true;
-      setTimeout(() => {
-        this.loading = falsed;
-        this.$router.push("/");
-      }, 2000);
-    },
-  },
-};
-</script>
-<style lang="scss" scoped>
-.page_user {
-  margin: 12px 0 40px 0;
-  /deep/ {
-    --van-button-border-width: 0;
-    --van-button-default-border-color: unset;
-  }
-}
-</style>