Przeglądaj źródła

Merge branch '165' of uskycloud/usky-web-mobile into master

fanghuisheng 1 rok temu
rodzic
commit
5dd1857666

+ 0 - 0
src/api/business/fireIot/facilitiesGather/index.js → src/api/business/fireIot/facilitiesGather.js


+ 19 - 0
src/api/business/fireIot/repairManage.js

@@ -0,0 +1,19 @@
+import { request, uploads } from "@/utils/request";
+
+// 报修列表查询接口
+export function page(param) {
+    return request({
+        url: "/service-iot/crmDeviceRepair/page",
+        method: "POST",
+        data: param,
+    });
+}
+
+//设备报修记录表-填报
+export function fill(param) {
+    return request({
+        url: '/service-iot/crmDeviceRepair/fill',
+        method: 'POST',
+        data: param
+    })
+}

+ 9 - 0
src/api/system/user.js

@@ -37,4 +37,13 @@ export function uploadAvatar(data) {
     name: data.name,
     filePath: data.filePath,
   });
+}
+
+// 注册用户个人信息
+export function appAdd(data) {
+  return request({
+    url: '/system/user/appAdd',
+    method: 'POST',
+    data: data
+  })
 }

+ 2 - 2
src/components/oa-scroll/index.vue

@@ -32,7 +32,7 @@
     </slot>
     <slot name="default"> </slot>
     <slot name="bottomLoading">
-      <div class="bottoBox" :style="`margin-top: ${lowerThreshold + 'px'}`" v-if="refresherLoad">
+      <div class="bottoBox" :style="`margin-top:20px;padding-bottom:${lowerThreshold + 'px'}`" v-if="refresherLoad">
         <span v-show="total != 0 && refresherLoadTitle">
           {{ pageSize >= total ? "没有更多啦~" : isScrolltolower }}
         </span>
@@ -86,7 +86,7 @@ const props = defineProps({
   //距离底部上拉加载距离
   lowerThreshold: {
     type: Number,
-    default: 20,
+    default: 0,
   },
   //是否开启下拉刷新
   refresherEnabled: {

+ 2 - 2
src/manifest.json

@@ -2,8 +2,8 @@
     "name" : "综合智慧云",
     "appid" : "__UNI__36DE3A0",
     "description" : "综合智慧云app,助力企业数字化转型升级",
-    "versionName" : "2.0.7",
-    "versionCode" : 9,
+    "versionName" : "2.1.0",
+    "versionCode" : 10,
     "transformPx" : false,
     /* 5+App特有相关 */
     "app-plus" : {

+ 22 - 0
src/pages.json

@@ -19,6 +19,14 @@
         "navigationBarTextStyle": "black" // 仅支持 black/white
       }
     },
+    {
+      "path": "pages/register",
+      "style": {
+        "navigationBarTitleText": "注册",
+        "navigationStyle": "custom",
+        "navigationBarTextStyle": "black" // 仅支持 black/white
+      }
+    },
     {
       "path": "pages/serveConfigSelect",
       "style": {
@@ -589,6 +597,20 @@
             "navigationBarTitleText": "告警处理",
             "enablePullDownRefresh": false
           }
+        },
+        {
+          "path": "repairManage/repairDetailsList",
+          "style": {
+            "navigationBarTitleText": "报修列表",
+            "enablePullDownRefresh": false
+          }
+        },
+        {
+          "path": "repairManage/repairDetails",
+          "style": {
+            "navigationBarTitleText": "报修处理",
+            "enablePullDownRefresh": false
+          }
         }
       ]
     }

+ 1 - 0
src/pages/business/fireIot/alarmManage/alarmDetailsList/index.vue

@@ -11,6 +11,7 @@
     :refresherEnabled="true"
     :refresherDefaultStyle="'none'"
     :refresherThreshold="44"
+    :lowerThreshold="44"
     :refresherBackground="'#f5f6f7'"
     @load="load"
     @refresh="refresh"

+ 1 - 1
src/pages/business/fireIot/deviceManage/components/deviceDetails.vue

@@ -9,7 +9,7 @@
         </view>
 
         <view style="margin: auto 0 auto 0">
-          <view :style="{ fontSize: '15px', color: publicStore.$state.deviceDetailsArray.deviceStatus == 1 ? '#30bb00' : '#ff6000' }">
+          <view :style="{ fontSize: '15px', color: publicStore.$state.deviceDetailsArray.deviceStatus == 1 ? '#16bf00' : 'red' }">
             {{ publicStore.$state.deviceDetailsArray.deviceStatus == 1 ? "在线" : "离线" }}
           </view>
         </view>

+ 1 - 1
src/pages/business/fireIot/deviceManage/components/deviceDetailsList.vue

@@ -44,7 +44,7 @@
               <view style="width: calc(100% - 51px); display: flex; flex-flow: row wrap; padding-right: 10px">
                 <view class="deviceHeader">
                   <view class="deviceName text-ellipsis">设备编号:{{ base.deviceId }}</view>
-                  <view class="deviceStatus" v-if="base.deviceStatus == 1" style="background-color: #12c100"> 在线 </view>
+                  <view class="deviceStatus" v-if="base.deviceStatus == 1" style="background-color: #16bf00"> 在线 </view>
                   <view class="deviceStatus" v-if="base.deviceStatus == 2" style="background-color: red"> 离线 </view>
                 </view>
                 <view class="deviceContent">设备名称:{{ base.deviceName }}</view>

+ 1 - 1
src/pages/business/fireIot/facilitiesGather/index.vue

@@ -119,7 +119,7 @@ import { onLoad, onShow, onHide, onLaunch, onReady } from "@dcloudio/uni-app";
 import { ref, onMounted, inject, shallowRef, reactive, toRefs, getCurrentInstance } from "vue";
 import { publicStores, useStores } from "@/store/modules/index";
 
-import { typeSelect, add, uploadAvatar, treeselect } from "@/api/business/fireIot/facilitiesGather/index";
+import { typeSelect, add, uploadAvatar, treeselect } from "@/api/business/fireIot/facilitiesGather.js";
 
 const { proxy } = getCurrentInstance();
 

+ 2 - 2
src/pages/business/fireIot/facilitiesManage/facilitiesDetailsList.vue

@@ -119,8 +119,8 @@ onLoad((options) => {
   if ("typeName" in options) {
     facilityTypeName.value = options.typeName;
   }
-  if ("id" in options) {
-    facilityType.value = parseInt(options.id);
+  if ("typeCode" in options) {
+    facilityType.value = options.typeCode;
     init();
   }
 });

+ 3 - 3
src/pages/business/fireIot/facilitiesManage/index.vue

@@ -22,7 +22,7 @@
           <image style="width: 40px" :src="data.typeImg ? data.typeImg : '/static/images/404.png'" mode="widthFix"></image>
         </view>
 
-        <view style="width: 100%" @click="handleToDevice(data.id, data.typeName)">
+        <view style="width: 100%" @click="handleToDevice(data.typeCode, data.typeName)">
           <view class="flex margin-bottom-xl">
             <view class="font30 text-bold">{{ data.typeName }}</view>
             <view style="font-size: 14px; margin-top: auto; margin-right: auto">({{ data.typeFacilityNum || 0 }})</view>
@@ -92,8 +92,8 @@ function refresh() {
 /**
  * @设施详情列表跳转点击事件
  */
-function handleToDevice(id, typeName) {
-  proxy.$tab.navigateTo(`/pages/business/fireIot/facilitiesManage/facilitiesDetailsList?id=${id}&typeName=${typeName}`);
+function handleToDevice(typeCode, typeName) {
+  proxy.$tab.navigateTo(`/pages/business/fireIot/facilitiesManage/facilitiesDetailsList?typeCode=${typeCode}&typeName=${typeName}`);
 }
 
 /**

+ 95 - 0
src/pages/business/fireIot/repairManage/index.vue

@@ -0,0 +1,95 @@
+<template>
+  <oa-scroll
+    customClass="bg-white scroll-height"
+    :pageSize="pageSize"
+    :total="total"
+    :refresherLoad="true"
+    :refresherLoadTitle="false"
+    :refresherEnabled="true"
+    :refresherDefaultStyle="'none'"
+    :refresherThreshold="44"
+    :refresherBackground="'#f5f6f7'"
+    @load="load"
+    @refresh="refresh"
+    :data-theme="'theme-' + proxy.$settingStore.themeColor.type"
+  >
+    <template #default>
+      <view class="alarmManage">
+        <u-grid :border="true">
+          <u-grid-item v-for="(base, index) in dataList" :key="index" @click="handleToDetails(base.productCode, base.productName)">
+            <u-badge type="primary" max="9999" :value="base.total" :showZero="true" :absolute="true" :offset="[10, 10, 0, 0]"></u-badge>
+            <image class="mb15" style="width: 40px; height: 40px; margin-top: 35px" :src="base.typeImg" mode="aspectFill"></image>
+            <text class="mb15 grid-text text-ellipsis">{{ base.productName }}</text>
+          </u-grid-item>
+        </u-grid>
+      </view>
+    </template>
+  </oa-scroll>
+</template>
+
+<script setup>
+import { onReady, onLoad, onShow, onNavigationBarButtonTap, onPullDownRefresh, onReachBottom } from "@dcloudio/uni-app";
+import { ref, onMounted, inject, shallowRef, reactive, getCurrentInstance } from "vue";
+import { useStores, publicStores } from "@/store/modules/index";
+
+import { dmpProductInfo, baseAlarmTypeList } from "@/api/business/fireIot/alarmManage.js";
+
+const { proxy } = getCurrentInstance();
+
+const dataList = ref([]);
+const pageSize = ref(20);
+const current = ref(1);
+const total = ref(0);
+
+/**
+ * @页面初始化
+ */
+function init() {
+  baseAlarmTypeList({ productName: "", current: current.value, size: pageSize.value }).then((requset) => {
+    if (requset.status === "SUCCESS") {
+      dmpProductInfo({ current: current.value, size: 2000 }).then((requset1) => {
+        if (requset1.status === "SUCCESS") {
+          requset.data.records.forEach((e) => {
+            requset1.data.records.forEach((el) => {
+              if (e.productCode === el.productCode) {
+                e.typeImg = el.typeImg ? el.typeImg : "/static/images/404.png";
+              }
+            });
+          });
+
+          dataList.value = requset.data.records;
+          total.value = requset.data.total;
+        }
+      });
+    }
+  });
+}
+
+function handleToDetails(productCode, productName) {
+  proxy.$tab.navigateTo(`/pages/business/fireIot/repairManage/repairDetailsList?productCode=${productCode}&productName=${productName}`);
+}
+
+/**
+ * @scrollView加载数据
+ */
+function load() {
+  pageSize.value += 10;
+  init();
+}
+
+/**
+ * @scrollView刷新数据
+ */
+function refresh() {
+  pageSize.value = 20;
+  total.value = 0;
+  init();
+}
+
+onShow(() => {
+  //调用系统主题颜色
+  proxy.$settingStore.systemThemeColor([1]);
+
+  init();
+});
+</script>

+ 202 - 0
src/pages/business/fireIot/repairManage/repairDetails.vue

@@ -0,0 +1,202 @@
+<template>
+  <scroll-view class="scroll-height" :scroll-y="true" :data-theme="'theme-' + proxy.$settingStore.themeColor.name">
+    <view class="alarmDetails-container">
+      <view class="flex bg-white p15 mb15">
+        <image style="width: 40px; height: 40px; margin: auto 15px auto 0" :src="dataArray.typeImg ? dataArray.typeImg : '/static/images/404.png'" mode="aspectFill"></image>
+
+        <view style="margin: auto auto auto 0">
+          <view style="font-size: 15px"> {{ dataArray.projectName }} </view>
+        </view>
+
+        <view style="margin: auto 0 auto 0">
+          <view style="font-size: 15px" :style="`color:${dataArray.repairStatus == 1 ? '#23dedc' : '#16bf00'}`">
+            {{ dataArray.repairStatus == 1 ? "受理中" : "处理完成" }}
+          </view>
+        </view>
+      </view>
+
+      <view class="bg-white p15 mb15">
+        <uni-section class="block mb10" title="基本信息" type="line"></uni-section>
+
+        <view class="tableType3 padding-0">
+          <u-row v-for="da in dataList" :key="da">
+            <u-col span="4">
+              <view style="text-align: right; padding: 0px 5px 0px 5px">{{ da.title }}</view>
+            </u-col>
+            <u-col span="8">
+              <view style="text-align: left; padding: 0px 5px 0px 5px">{{ da.value }}</view>
+            </u-col>
+          </u-row>
+        </view>
+      </view>
+
+      <view class="bg-white p15 mb15">
+        <uni-section class="block mb10" title="处理内容" type="line"></uni-section>
+
+        <view>
+          <u-input placeholder="报修人(必填)" border="surround" v-model="dataArray.handleName" style="margin: 0 0 15px 0" :disabled="dataArray.repairStatus == 2"> </u-input>
+
+          <u--textarea
+            v-model="dataArray.handleContent"
+            placeholder="填报内容,最多可输入50个字"
+            :count="true"
+            maxlength="50"
+            style="margin: 0 0 15px 0"
+            :disabled="dataArray.repairStatus == 2"
+          ></u--textarea>
+        </view>
+
+        <view class="flex" v-if="dataArray.repairStatus != 2">
+          <u-button
+            type="info"
+            text="取消"
+            :plain="true"
+            shape="circle"
+            :customStyle="{
+              width: '80px',
+              height: '30px',
+              marginRight: '15px',
+            }"
+            @click="handleSubmit(1)"
+          ></u-button>
+          <u-button
+            type="primary"
+            text="处理"
+            shape="circle"
+            :customStyle="{
+              width: '80px',
+              height: '30px',
+              marginLeft: '15px',
+            }"
+            @click="handleSubmit(2)"
+          ></u-button>
+        </view>
+      </view>
+    </view>
+  </scroll-view>
+</template>
+
+<script setup>
+import { onLoad, onShow, onReady, onHide, onLaunch, onNavigationBarButtonTap, onPageScroll } from "@dcloudio/uni-app";
+import { ref, reactive, computed, getCurrentInstance, toRefs, inject } from "vue";
+import { publicStores, useStores } from "@/store/modules/index";
+
+import { page, fill } from "@/api/business/fireIot/repairManage.js";
+
+const { proxy } = getCurrentInstance();
+
+const dataArray = ref({});
+const dataList = ref([
+  {
+    title: "报修日期",
+    value: "",
+  },
+  {
+    title: "项目名称",
+    value: "",
+  },
+  {
+    title: "报修人",
+    value: "",
+  },
+  {
+    title: "报修电话",
+    value: "",
+  },
+  {
+    title: "问题描述",
+    value: "",
+  },
+  {
+    title: "报修地址",
+    value: "",
+  },
+]);
+
+const repairCode = ref("");
+const pageSize = ref(20);
+const current = ref(1);
+const total = ref(0);
+
+/**
+ * @页面初始化
+ */
+function init() {
+  selectListApi();
+}
+
+/**
+ * @列表查询
+ * @api接口查询
+ */
+function selectListApi() {
+  page({
+    repairCode: repairCode.value,
+    current: current.value,
+    size: pageSize.value,
+  }).then((requset) => {
+    if (requset.status === "SUCCESS") {
+      dataArray.value = requset.data.records[0];
+      dataArray.value.handleName = requset.data.records[0].handleName ? requset.data.records[0].handleName : "";
+      dataArray.value.handleContent = requset.data.records[0].handleContent ? requset.data.records[0].handleContent : "";
+
+      dataList.value[0].value = requset.data.records[0].createTime;
+      dataList.value[1].value = requset.data.records[0].projectName;
+      dataList.value[2].value = requset.data.records[0].reflectName;
+      dataList.value[3].value = requset.data.records[0].reflectPhone;
+      dataList.value[4].value = requset.data.records[0].repairContent;
+      dataList.value[5].value = requset.data.records[0].projectAddress;
+      total.value = requset.data.total;
+    }
+  });
+}
+
+/**
+ * @提交
+ */
+function handleSubmit(type) {
+  if (type == 1) {
+    proxy.$tab.navigateTo(`/pages/business/fireIot/repairManage/repairDetailsList`);
+  } else {
+    if (!dataArray.value.handleName) {
+      proxy.$modal.msg("请输入报修人");
+      return;
+    }
+
+    fill({
+      id: dataArray.value.id,
+      handleName: dataArray.value.handleName,
+      handleContent: dataArray.value.handleContent,
+    }).then((res) => {
+      if (requset.status === "SUCCESS") {
+        proxy.$tab.navigateTo(`/pages/common/success/index?codeName=提交成功`);
+      }
+    });
+  }
+}
+
+onReady(() => {});
+
+onShow(() => {
+  //调用系统主题颜色
+  proxy.$settingStore.systemThemeColor([1]);
+});
+
+onLoad((options) => {
+  if ("repairCode" in options) {
+    repairCode.value = options.repairCode;
+  }
+
+  init();
+});
+</script>
+
+<style lang="scss" scoped>
+:deep(.u-input__content__field-wrapper__field) {
+  font-size: 13px !important;
+}
+
+:deep(.u-textarea__field) {
+  font-size: 13px;
+}
+</style>

+ 191 - 0
src/pages/business/fireIot/repairManage/repairDetailsList.vue

@@ -0,0 +1,191 @@
+<template>
+  <u-sticky class="shadow-default" bgColor="#fff" style="top: 0">
+    <u-tabs :list="tabsList" :current="tabsCurrent" @click="tabsClick" lineColor="#333" :activeStyle="{ color: '#333' }" :inactiveStyle="{ color: '#909399' }" :scrollable="false"></u-tabs>
+  </u-sticky>
+
+  <oa-scroll
+    customClass="repairManage-container scroll-height"
+    :pageSize="pageSize"
+    :total="total"
+    :refresherLoad="true"
+    :refresherEnabled="true"
+    :refresherDefaultStyle="'none'"
+    :refresherThreshold="44"
+    :lowerThreshold="44"
+    :refresherBackground="'#f5f6f7'"
+    @load="load"
+    @refresh="refresh"
+    :data-theme="'theme-' + proxy.$settingStore.themeColor.name"
+  >
+    <template #default>
+      <view class="menu-list m0">
+        <view class="list-cell list-cell-arrow" style="color: #666666; line-height: 25px" v-for="(base, index) in dataList" :key="index" @click="handleToDetails(base)">
+          <view class="content-area-top menu-item-box">
+            <view class="content-area-top-time">
+              {{ base.repairStatus == 1 ? (base.createTime ? base.createTime.replace("T", " ") : "") : base.handleTime ? base.handleTime.replace("T", " ") : "" }}
+            </view>
+            <view class="content-area-top-status" v-if="base.repairStatus == 1" style="background-color: #23dedc"> 受理中 </view>
+            <view class="content-area-top-status" v-if="base.repairStatus == 2" style="background-color: #16bf00"> 处理完成 </view>
+          </view>
+          <view class="content-area-row_wrap menu-item-box">
+            <view class="content-area-row_wrap-view"> 项目名称:{{ base.projectName }} </view>
+            <view class="content-area-row_wrap-view"> 报修人:{{ base.reflectName }} </view>
+            <view class="content-area-row_wrap-view"> 报修人电话:{{ base.reflectPhone }} </view>
+            <view class="content-area-row_wrap-view"> 报修内容:{{ base.repairContent }} </view>
+            <view class="content-area-row_wrap-view"> 报修地址:{{ base.projectAddress }} </view>
+          </view>
+        </view>
+      </view>
+    </template>
+  </oa-scroll>
+</template>
+
+<script setup>
+import { onLoad, onShow, onReady, onHide, onLaunch, onNavigationBarButtonTap, onPageScroll } from "@dcloudio/uni-app";
+import { ref, reactive, computed, getCurrentInstance, toRefs, inject } from "vue";
+import { publicStores, useStores } from "@/store/modules/index";
+
+import { page } from "@/api/business/fireIot/repairManage.js";
+
+const { proxy } = getCurrentInstance();
+const publicStore = publicStores();
+
+const tabsList = ref([
+  {
+    name: "全部",
+    value: "",
+  },
+  {
+    name: "受理中",
+    value: 1,
+  },
+  {
+    name: "处理完成",
+    value: 2,
+  },
+]);
+const tabsCurrent = ref(0);
+
+const dataList = ref([]);
+const pageSize = ref(20);
+const current = ref(1);
+const total = ref(0);
+
+/**
+ * @页面初始化
+ */
+function init() {
+  selectListApi();
+}
+
+/**
+ * @列表查询
+ * @api接口查询
+ */
+function selectListApi() {
+  page({
+    repairStatus: tabsList.value[tabsCurrent.value].value,
+    current: current.value,
+    size: pageSize.value,
+  }).then((requset) => {
+    if (requset.status === "SUCCESS") {
+      dataList.value = requset.data.records;
+      total.value = requset.data.total;
+    }
+  });
+}
+
+/**
+ * @跳转详情事件
+ */
+function handleToDetails(e) {
+  proxy.$tab.navigateTo(`/pages/business/fireIot/repairManage/repairDetails?repairCode=${e.repairCode}`);
+}
+
+/**
+ * @scrollView加载数据
+ */
+function load() {
+  pageSize.value += 10;
+  init();
+}
+
+/**
+ * @scrollView刷新数据
+ */
+function refresh() {
+  pageSize.value = 20;
+  total.value = 0;
+  init();
+}
+
+/**
+ * @tabs点击事件
+ */
+function tabsClick(e) {
+  tabsCurrent.value = e.index;
+  init();
+}
+
+onReady(() => {});
+
+onShow(() => {
+  //调用系统主题颜色
+  proxy.$settingStore.systemThemeColor([1]);
+});
+
+onLoad((options) => {
+  init();
+});
+</script>
+
+<style lang="scss" scoped>
+.repairManage-container {
+  .content-area {
+    &-top {
+      padding-right: 10px;
+      font-size: 16px;
+      font-weight: 600;
+      color: #000000;
+
+      &-time {
+        max-width: 70%;
+        margin: auto 0;
+        font-size: 14px;
+        color: rgb(102, 102, 102);
+      }
+
+      &-name {
+        max-width: 70%;
+        color: #000;
+      }
+
+      &-status {
+        max-width: 30%;
+        margin: auto 0 auto auto;
+        font-size: 12px;
+        color: #ffffff;
+        padding: 0 5px;
+        border-radius: 20px;
+        line-height: 20px;
+      }
+    }
+
+    &-row_wrap {
+      padding-right: 10px;
+      font-size: 13px;
+      flex-flow: row wrap;
+
+      &-view {
+        display: flex;
+        min-width: 50%;
+        > .iconfont {
+          font-size: 14px;
+          color: #909399;
+          margin-left: 5px;
+        }
+      }
+    }
+  }
+}
+</style>

+ 13 - 25
src/pages/common/phoneVerify/index.vue

@@ -10,7 +10,7 @@
       </view>
 
       <view class="content-area-center">
-        <u-input v-model="phone" prefixIcon="phone" placeholder="请输入手机号" />
+        <u-input v-model="phone" prefixIcon="phone" placeholder="请输入手机号" />
 
         <u-input v-model="verify" prefixIcon="email" placeholder="请输入验证码" :maxlength="6">
           <template #suffix>
@@ -29,20 +29,16 @@ import { onLoad, onShow, onReady, onHide, onLaunch, onNavigationBarButtonTap, on
 import { reactive, getCurrentInstance, toRefs, inject } from "vue";
 import { useStores, publicStores } from "@/store/modules/index";
 
-import { getCodeImg } from "@/api/login";
-import { phoneVerify } from "@/api/common/index.js";
-
 const useStore = useStores();
 const { proxy } = getCurrentInstance();
 
 const data = reactive({
+  path: "",
   phone: undefined,
   verify: undefined,
-  codeTime: 0,
-  path: "",
 });
 
-const { phone, verify, codeTime, path } = toRefs(data);
+const { phone, verify, path } = toRefs(data);
 
 /** 点击发送验证码 */
 function getVerifyCode() {
@@ -57,25 +53,17 @@ function getVerifyCode() {
 
 /** 点击提交按钮 */
 function submitRes() {
-  if (!phone.value) {
-    proxy.$modal.msg("请输入手机号码");
-    return;
-  }
-  if (!/^1(?:3\d|4[4-9]|5[0-35-9]|6[67]|7[013-8]|8\d|9\d)\d{8}$/.test(phone.value)) {
-    proxy.$modal.msg("请输入正确的手机号码");
-    return;
-  }
-  if (!verify.value) {
-    proxy.$modal.msg("请输入验证码");
-    return;
-  }
-  phoneVerify({
-    phone: phone.value,
-    verify: verify.value,
-  }).then((requset) => {
-    if (requset.status === "SUCCESS") {
+  useStore.PhoneVerify({
+    data: {
+      phone: phone.value,
+      verify: verify.value,
+    },
+    success: (res) => {
       proxy.$tab.redirectTo(path.value + `?statusBool=${true}&phone=${phone.value}`);
-    }
+    },
+    error: (res) => {
+      return false;
+    },
   });
 }
 

+ 0 - 1
src/pages/common/repairReport/record.vue

@@ -162,7 +162,6 @@ onLoad((options) => {
       &-view {
         display: flex;
         min-width: 50%;
-        white-space: nowrap;
         > .iconfont {
           font-size: 14px;
           color: #909399;

+ 49 - 59
src/pages/login.vue

@@ -1,28 +1,24 @@
 <template>
-  <view id="login" class="section">
-    <view class="bg">
-      <image class="bgImage" :src="useStore.$state.loginBg" v-if="useStore.$state.loginBg" />
-    </view>
+  <view id="login-container" class="login-container">
+    <image class="bgImage" :src="useStore.$state.loginBg" v-if="useStore.$state.loginBg" />
 
     <view class="middle">
-      <view class="top">
+      <view class="middle-top">
         <image class="logo" mode="heightFix" :src="useStore.$state.loginLogo" v-if="useStore.$state.loginLogo" />
-        <!-- <image class="logo" mode="heightFix" src="@/static/logo200.png" v-else /> -->
         <text class="title" :style="{ color: useStore.$state.loginBg ? '#FFFFFF' : '#000000' }" v-if="useStore.$state.loginTitle">{{ useStore.$state.loginTitle }}</text>
-        <!-- <text class="title" v-else>移动端登录</text> -->
       </view>
 
-      <view class="content">
+      <view class="middle-content">
         <text class="title" :style="{ color: useStore.$state.loginBg ? '#FFFFFF' : '#000000' }">请登录</text>
 
-        <!-- #ifdef APP-PLUS || MP-WEIXIN  -->
-        <view id="okay" v-if="!linkUrl">首次账号登录请先配置服务器</view>
+        <!-- #ifdef APP-PLUS || MP-WEIXIN -->
+        <view class="prompt" v-if="!linkUrl">首次账号登录请先配置服务器</view>
         <view class="setting" @tap="goSeverConfig"> 配置服务器 </view>
         <!--#endif-->
       </view>
 
-      <view id="login-input" v-if="switchText == '账号密码登录'">
-        <u-input v-model="phone" prefixIcon="phone" placeholder="请输入手机号" />
+      <view class="middle-input" v-if="switchText == '账号密码登录'">
+        <u-input v-model="phone" prefixIcon="phone" placeholder="请输入手机号" />
 
         <u-input v-model="verify" prefixIcon="email" placeholder="请输入验证码" :maxlength="6">
           <template #suffix>
@@ -31,7 +27,7 @@
         </u-input>
       </view>
 
-      <view id="login-input" v-if="switchText == '验证码登录'">
+      <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="inputIconBool">
@@ -41,24 +37,28 @@
         </u-input>
       </view>
 
-      <button class="submit" @click="submitRes">登 录</button>
+      <button class="middle-submit" @click="submitRes">登 录</button>
 
-      <view class="switchText">
-        <text @click="switchMode">{{ switchText }}</text>
+      <view class="middle-switch">
+        <text class="switch-loginMethod" @click="switchMode(1)">{{ switchText }}</text>
+        <div style="margin: auto"></div>
+        <text class="switch-register" @click="switchMode(2)">注册账号</text>
       </view>
 
       <!-- #ifdef APP-PLUS || MP-WEIXIN -->
-      <view class="xieyi text-center">
+      <view class="middle-agreed text-center">
         <u-checkbox-group v-model="userChecked">
           <u-checkbox :name="true" shape="circle" inactiveColor="#0081ff" size="13"></u-checkbox>
         </u-checkbox-group>
-        <text>我已阅读并同意</text>
+        <text>登录即已代表阅读并同意</text>
+        <!-- <text>我已阅读并同意</text> -->
         <text @click="handleUserAgrement" class="text-blue">用户协议</text>
         <text>和</text>
         <text @click="handlePrivacy" class="text-blue">隐私协议</text>
       </view>
       <!--#endif-->
     </view>
+
     <view class="bottom">
       <div class="title">{{ useStore.$state.loginBottomTitle }}</div>
     </view>
@@ -102,11 +102,11 @@ function goSeverConfig() {
 /**
  * @登录方式切换
  */
-function switchMode() {
-  if (switchText.value == "验证码登录") {
-    switchText.value = "账号密码登录";
-  } else {
-    switchText.value = "验证码登录";
+function switchMode(value) {
+  if (value == 1) {
+    switchText.value == "验证码登录" ? (switchText.value = "账号密码登录") : (switchText.value = "验证码登录");
+  } else if (value == 2) {
+    proxy.$tab.navigateTo("/pages/register");
   }
 }
 
@@ -182,11 +182,11 @@ function submitRes() {
 
   if (switchText.value == "账号密码登录") {
     if (!phone.value) {
-      proxy.$modal.msg("请输入手机号");
+      proxy.$modal.msg("请输入手机号");
       return;
     }
     if (!/^1(?:3\d|4[4-9]|5[0-35-9]|6[67]|7[013-8]|8\d|9\d)\d{8}$/.test(phone.value)) {
-      proxy.$modal.msg("请输入正确的手机号");
+      proxy.$modal.msg("请输入正确的手机号");
       return;
     }
     if (!verify.value) {
@@ -242,14 +242,16 @@ function handlePrivacy() {
 }
 
 onShow(() => {
-  init();
+  setTimeout(() => {
+    init();
+  }, 50);
 });
 
 onLoad((options) => {});
 </script>
 
 <style lang="scss" scoped>
-.section {
+.login-container {
   position: fixed;
   top: 0;
   left: 0;
@@ -260,18 +262,14 @@ onLoad((options) => {});
   height: 100vh;
   background-color: $uni-bg-color;
 
-  .bg {
-    width: 100%;
-    height: 100%;
+  .bgImage {
     position: fixed;
     top: 0;
     left: 0;
     right: 0;
     z-index: 0;
-    .bgImage {
-      width: 100%;
-      height: 100%;
-    }
+    width: 100%;
+    height: 100%;
   }
 
   .middle {
@@ -282,7 +280,7 @@ onLoad((options) => {});
     margin: auto;
     margin-top: 30%;
 
-    .top {
+    &-top {
       display: flex;
       align-items: center;
       justify-content: center;
@@ -304,7 +302,7 @@ onLoad((options) => {});
       }
     }
 
-    .content {
+    &-content {
       display: flex;
       position: relative;
       margin: 30px 0 30px 0;
@@ -314,16 +312,12 @@ onLoad((options) => {});
         font-size: 18px;
       }
 
-      .icons {
-        margin: auto 5px auto 0;
-      }
-
       .setting {
         color: #2a98ff;
         margin: auto 0;
       }
 
-      #okay {
+      .prompt {
         position: absolute;
         top: -35px;
         right: 0px;
@@ -348,7 +342,7 @@ onLoad((options) => {});
     }
 
     // 登录页-服务器配置样式 开始
-    #login-input {
+    &-input {
       :deep(.u-input) {
         height: 45px;
         border: 0 !important;
@@ -384,28 +378,24 @@ onLoad((options) => {});
         background-image: none;
         transition: background-color 50000s ease-in-out 0s; //背景色透明  生效时长  过渡效果  启用时延迟的时间
       }
-
-      .verify {
-        color: #2a98ff;
-        font-size: 14px;
-        padding-left: 0px;
-        padding-right: 0px;
-        background-color: transparent;
-
-        &::after {
-          border: 0px;
-        }
-      }
     }
 
-    .switchText {
-      color: #96a6b5;
+    &-switch {
       width: 100%;
-      display: block;
+      display: flex;
       margin-top: 20px;
+      color: #96a6b5;
+
+      &-loginMethod {
+        display: block;
+      }
+
+      &-register {
+        display: block;
+      }
     }
 
-    .submit {
+    &-submit {
       height: 45px;
       line-height: 45px;
       border-radius: 24px;
@@ -414,7 +404,7 @@ onLoad((options) => {});
       border: 0px;
     }
 
-    .xieyi {
+    &-agreed {
       color: #96a6b5;
       margin-top: 30px;
       display: flex;

+ 6 - 6
src/pages/mine/info/index.vue

@@ -20,7 +20,7 @@
         </view>
         <view class="list-cell list-cell-arrow" @click="handleUserModal('修改手机号')">
           <view class="menu-item-box">
-            <view class="title">手机号</view>
+            <view class="title">手机号</view>
             <view style="margin: 0 15px 0 auto; font-size: 14px; color: #909399">{{ user.phonenumber }}</view>
           </view>
         </view>
@@ -67,7 +67,7 @@
 
     <!-- <uni-list>
       <uni-list-item showExtraIcon="true" :extraIcon="{ type: 'person-filled' }" title="昵称" :rightText="user.nickName" />
-      <uni-list-item showExtraIcon="true" :extraIcon="{ type: 'phone-filled' }" title="手机号" :rightText="user.phonenumber" />
+      <uni-list-item showExtraIcon="true" :extraIcon="{ type: 'phone-filled' }" title="手机号" :rightText="user.phonenumber" />
       <uni-list-item showExtraIcon="true" :extraIcon="{ type: 'email-filled' }" title="邮箱" :rightText="user.email" />
       <uni-list-item showExtraIcon="true" :extraIcon="{ type: 'auth-filled' }" title="岗位" :rightText="postGroup" />
       <uni-list-item showExtraIcon="true" :extraIcon="{ type: 'staff-filled' }" title="角色" :rightText="roleGroup" />
@@ -79,8 +79,8 @@
         <uni-forms-item label="用户昵称" name="nickName">
           <uni-easyinput v-model="user.nickName" placeholder="请输入昵称" />
         </uni-forms-item>
-        <uni-forms-item label="手机号" name="phonenumber">
-          <uni-easyinput v-model="user.phonenumber" placeholder="请输入手机号" />
+        <uni-forms-item label="手机号" name="phonenumber">
+          <uni-easyinput v-model="user.phonenumber" placeholder="请输入手机号" />
         </uni-forms-item>
         <uni-forms-item label="邮箱" name="email">
           <uni-easyinput v-model="user.email" placeholder="请输入邮箱" />
@@ -199,12 +199,12 @@ function handleConfirm() {
 
   if (modalTitle.value == "修改手机号") {
     if (!userArr.value.phonenumber) {
-      proxy.$modal.showToast("手机号不能为空");
+      proxy.$modal.showToast("手机号不能为空");
       return;
     }
 
     if (!/^1[3|4|5|6|7|8|9][0-9]\d{8}$/.test(userArr.value.phonenumber)) {
-      proxy.$modal.showToast("请输入正确的手机号");
+      proxy.$modal.showToast("请输入正确的手机号");
       return;
     }
   }

+ 3 - 3
src/pages/mine/secure/index.vue

@@ -9,7 +9,7 @@
       <view class="menu-list mt0 mlr0">
         <view class="list-cell list-cell-arrow" @click="handleUserModal('修改手机号')">
           <view class="menu-item-box">
-            <view class="title">手机号</view>
+            <view class="title">手机号</view>
             <view style="margin: 0 15px 0 auto; font-size: 14px; color: #909399">{{ user.phonenumber }}</view>
           </view>
         </view>
@@ -135,12 +135,12 @@ function handleUserModal(title) {
 function handleConfirm() {
   if (modalTitle.value == "修改手机号") {
     if (!userArr.value.phonenumber) {
-      proxy.$modal.showToast("手机号不能为空");
+      proxy.$modal.showToast("手机号不能为空");
       return;
     }
 
     if (!/^1[3|4|5|6|7|8|9][0-9]\d{8}$/.test(userArr.value.phonenumber)) {
-      proxy.$modal.showToast("请输入正确的手机号");
+      proxy.$modal.showToast("请输入正确的手机号");
       return;
     }
   }

+ 207 - 0
src/pages/register.vue

@@ -0,0 +1,207 @@
+<template>
+  <view id="register-container">
+    <view class="top-area">
+      <u-icon name="arrow-left" size="17px" color="#000" :bold="true" @click="navigateTo"></u-icon>
+    </view>
+
+    <view class="content-area">
+      <text class="content-area-title">注册</text>
+    </view>
+
+    <view class="bottom-area">
+      <u-input v-model="phone" prefixIcon="phone" placeholder="手机号(必填)" border="none" />
+      <u-input v-model="verify" prefixIcon="email" 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="newPassword" prefixIcon="lock" placeholder="密码(必填)" border="none" :password="newPasswordBool">
+        <template #suffix>
+          <text :class="!newPasswordBool ? 'iconfont ucicon-eye' : 'iconfont ucicon-eye-close'" @click="newPasswordBool = !newPasswordBool"></text>
+        </template>
+      </u-input>
+      <u-input v-model="confirmPassword" prefixIcon="lock" placeholder="再次输入密码(必填)" border="none" :password="confirmPasswordBool">
+        <template #suffix>
+          <text :class="!confirmPasswordBool ? 'iconfont ucicon-eye' : 'iconfont ucicon-eye-close'" @click="confirmPasswordBool = !confirmPasswordBool"></text>
+        </template>
+      </u-input>
+
+      <u-button
+        type="primary"
+        shape="circle"
+        :customStyle="{
+          display: 'block',
+          width: '100%',
+          height: '45px',
+          lineHeight: '45px',
+          fontSize: '17px',
+        }"
+        @click="handleSubmit()"
+      >
+        注 册
+      </u-button>
+    </view>
+  </view>
+</template>
+
+<script setup>
+import config from "@/config";
+import { onLoad, onShow, onHide, onLaunch } from "@dcloudio/uni-app";
+import { ref, onMounted, inject, shallowRef, reactive, toRefs, getCurrentInstance } from "vue";
+import { publicStores, useStores } from "@/store/modules/index";
+import { getToken, setToken, removeToken } from "@/utils/auth";
+
+const publicStore = publicStores();
+const useStore = useStores();
+
+const { proxy } = getCurrentInstance();
+
+const dataList = reactive({
+  nickName: undefined,
+  phone: undefined,
+  verify: undefined,
+  newPassword: undefined,
+  newPasswordBool: true,
+  confirmPassword: undefined,
+  confirmPasswordBool: true,
+});
+
+const uForm = ref(null);
+const { nickName, phone, verify, newPassword, newPasswordBool, confirmPassword, confirmPasswordBool } = toRefs(dataList);
+
+/**
+ * @点击发送验证码
+ */
+function getVerifyCode() {
+  verify.value = undefined;
+  useStore.GetCodeImg({
+    phone: phone.value,
+    success: (res) => {
+      proxy.$modal.msgSuccess("发送成功");
+    },
+  });
+}
+
+/**
+ * @注册
+ * @按钮点击事件
+ */
+function handleSubmit() {
+  useStore.PhoneVerify({
+    data: {
+      phone: phone.value,
+      verify: verify.value,
+    },
+    success: (res) => {
+      useStore.UserAdd({
+        data: {
+          nickName: nickName.value,
+          phone: phone.value,
+          verify: verify.value,
+          newPassword: newPassword.value,
+          confirmPassword: confirmPassword.value,
+        },
+        success: (res) => {
+          proxy.$modal.msgSuccess("注册成功");
+
+          setTimeout(() => {
+            proxy.$modal.loading("登录中,请耐心等待...");
+            useStore
+              .Login({
+                username: phone.value,
+                password: newPassword.value,
+                tenantId: useStore.$state.tenantId,
+              })
+              .then(() => {
+                /** 获取用户信息 */
+                proxy.$modal.closeLoading();
+                useStore.GetInfo().then((res) => {
+                  proxy.$tab.reLaunch("/pages/index");
+                });
+              });
+          }, 1000);
+        },
+      });
+    },
+    error: (res) => {
+      return false;
+    },
+  });
+}
+
+/**
+ * @跳转登录
+ */
+function navigateTo() {
+  proxy.$tab.navigateBack(1);
+}
+
+onLoad((options) => {});
+</script>
+
+<style lang="scss" scoped>
+#register-container {
+  position: fixed;
+  top: 0;
+  left: 0;
+  right: 0;
+  bottom: 0;
+  z-index: 1;
+  width: 100%;
+  margin: auto;
+  padding: 0 30px;
+  padding-top: 20%;
+  //#ifdef MP-WEIXIN
+  padding-top: 30%;
+  //#endif
+  background-color: #ffffff;
+
+  .top-area {
+  }
+
+  .content-area {
+    display: flex;
+    margin: 30px 0;
+
+    &-title {
+      margin: auto auto auto 0;
+      color: #000;
+      font-size: 18px;
+    }
+  }
+
+  .bottom-area {
+    :deep(.u-input) {
+      height: 45px;
+      border-radius: 8px;
+      padding: 5px 12px !important;
+      border: 0 !important;
+      background-color: #f5f6fa !important;
+      margin-bottom: 15px;
+    }
+
+    :deep(.u-icon__icon) {
+      font-size: 24px !important;
+      line-height: 24px !important;
+      color: gray !important;
+    }
+
+    :deep(.iconfont) {
+      color: gray !important;
+    }
+
+    :deep(.input-placeholder) {
+      color: #c0c4cc !important;
+    }
+
+    :deep(.uni-input-wrapper) {
+      font-size: 16px;
+    }
+
+    :deep(.u-line) {
+      display: none !important;
+    }
+  }
+}
+</style>

+ 1 - 1
src/pages/serveConfig.vue

@@ -186,7 +186,7 @@ onLoad((options) => {
       margin: auto 5px auto 0;
     }
 
-    &setting {
+    &-setting {
       color: #2a98ff;
       margin: auto 0;
     }

+ 1 - 1
src/pages/serveConfigSelect.vue

@@ -185,7 +185,7 @@ onLoad((options) => {});
 </script>
 
 <style lang="scss" scoped>
-#serveConfig-container {
+#serveConfigSelect-container {
   position: fixed;
   top: 0;
   left: 0;

+ 4 - 3
src/permission.js

@@ -6,9 +6,10 @@ const loginPage = "/pages/login";
 
 // 页面白名单
 const whiteList = [
-  "/pages/login",
-  "/pages/serveConfig",
-  "/pages/serveConfigSelect",
+  "/pages/login",//登录
+  "/pages/register",//注册
+  "/pages/serveConfig",//服务器配置
+  "/pages/serveConfigSelect",//服务器配置
   "/pages/common/textview/index1",
   "/pages/common/webview/index",
   "/pages/business/mhxf/unitInfoCollection/index",//单位信息采集

+ 12 - 0
src/static/scss/index.scss

@@ -99,4 +99,16 @@
     overflow: hidden; //超出的文本隐藏
     text-overflow: ellipsis; //溢出用省略号显示
     white-space: nowrap; // 默认不换行;
+}
+
+.verify {
+    color: #2a98ff;
+    font-size: 14px;
+    padding-left: 0px;
+    padding-right: 0px;
+    background-color: transparent;
+
+    &::after {
+        border: 0px;
+    }
 }

+ 89 - 3
src/store/modules/user.js

@@ -3,7 +3,8 @@ import { getToken, setToken, removeToken } from "@/utils/auth";
 import { defineStore } from "pinia";
 // 接口引用
 import { login, logout, getInfo, getMobileTenantConfig, getCodeImg } from "@/api/login";
-import { getUserProfile } from "@/api/system/user";
+import { getUserProfile, appAdd } from "@/api/system/user";
+import { phoneVerify } from "@/api/common/index.js";
 // 组件引用
 import modal from "@/plugins/modal.plugins.js";
 
@@ -52,6 +53,7 @@ const useStores = defineStore("useStores", {
           .then((res) => {
             this.SET_TOKEN(res.data.access_token)
             setToken(res.data.access_token);
+            this.codeTime = 0
             resolve();
           })
           .catch((error) => {
@@ -124,11 +126,11 @@ const useStores = defineStore("useStores", {
      */
     GetCodeImg({ phone, success, error }) {
       if (!phone) {
-        modal.msg("请输入手机号");
+        modal.msg("请输入手机号");
         return;
       }
       if (!/^1(?:3\d|4[4-9]|5[0-35-9]|6[67]|7[013-8]|8\d|9\d)\d{8}$/.test(phone)) {
-        modal.msg("请输入正确的手机号");
+        modal.msg("请输入正确的手机号");
         return;
       }
 
@@ -167,6 +169,90 @@ const useStores = defineStore("useStores", {
       }, 1000);
     },
 
+    /**
+     * @手机验证码校验
+     * @param { 数据 } data 
+     * @param { 成功 } success 
+     * @param { 失败 } error 
+     */
+    PhoneVerify({ data, success, error }) {
+      if (!data.phone) {
+        modal.msg("请输入手机号");
+        return;
+      }
+
+      if (!/^1(?:3\d|4[4-9]|5[0-35-9]|6[67]|7[013-8]|8\d|9\d)\d{8}$/.test(data.phone)) {
+        modal.msg("请输入正确的手机号");
+        return;
+      }
+
+      if (!data.verify) {
+        modal.msg("请输入验证码");
+        return;
+      }
+
+      phoneVerify({
+        phone: data.phone,
+        verify: data.verify,
+      }).then((res) => {
+        if (res.status === "SUCCESS") {
+          success(res)
+
+        } else {
+          error(res)
+        }
+        modal.closeLoading();
+      });
+    },
+
+    /**
+     * @注册
+     * @param { 数据 } data 
+     * @param { 成功 } success 
+     * @param { 失败 } error 
+     */
+    UserAdd({ data, success, error }) {
+      if (!data.nickName) {
+        modal.showToast("昵称不能为空");
+        return;
+      }
+
+      if (!data.newPassword) {
+        modal.showToast("新密码不能为空");
+        return;
+      }
+
+      if (data.newPassword.length < 6 && data.newPassword.length > 20) {
+        modal.showToast("长度在 6 到 20 个字符");
+        return;
+      }
+
+      if (!data.confirmPassword) {
+        modal.showToast("确认密码不能为空");
+        return;
+      }
+
+      if (data.confirmPassword != data.newPassword) {
+        modal.showToast("两次输入的密码不一致");
+        return;
+      }
+
+      modal.loading("加载中");
+      appAdd({
+        tenantId: this.tenantId,
+        nickName: data.nickName,
+        phonenumber: data.phone,
+        userName: data.phone,
+        status: "0",
+        password: data.newPassword,
+      }).then((res) => {
+        if (res.status === "SUCCESS") {
+          success(res)
+          modal.closeLoading();
+        }
+      })
+    },
+
     // 退出系统
     LogOut() {
       return new Promise((resolve, reject) => {

+ 1 - 1
src/utils/request.js

@@ -38,7 +38,7 @@ function verification(res, resolve, reject) {
       reject(data.msg);
     }
     modal.closeLoading();
-  } else if (code === 500 || res.statusCode === 500) {
+  } else if (code === 500 || res.statusCode === 500 || code === 'BIZ-0000') {
     if (data.msg.indexOf(":") !== -1) {
       modal.msg(data.msg.split(":")[1]);
       reject(data.msg.split(":")[1]);