浏览代码

基础框架优化/代码封装

fanghuisheng 1 年之前
父节点
当前提交
08f69fc019

+ 0 - 1
src/components/list-test/list-test.vue

@@ -128,7 +128,6 @@ export default {
 
     // 隐藏显示
     showDetail(e) {
-      // alert(1);
       // 存储点击那一项的状态
       const nowStatu = e.isShow;
       // 将每一项列表的isShow设置为false,让所有的列表都隐藏

+ 6 - 0
src/components/oa-scroll/index.vue

@@ -10,6 +10,7 @@
     :refresher-triggered="triggered"
     :refresher-background="refresherBackground"
     :scroll-top="scrollTop"
+    :scroll-into-view="scrollIntoView"
     @refresherrefresh="onRefresh"
     @scrolltolower="scrolltolower"
   >
@@ -107,6 +108,11 @@ const props = defineProps({
     type: String,
     default: "#fff",
   },
+  //是否滚动到指定id的位置
+  scrollIntoView: {
+    type: String,
+    default: "",
+  },
 });
 
 const { pageSize, total, scrollTop, customClass, customStyle, refresherLoad, lowerThreshold, refresherEnabled, refresherThreshold, refresherDefaultStyle, refresherBackground } = toRefs(props);

+ 15 - 0
src/pages.json

@@ -183,6 +183,14 @@
             "enablePullDownRefresh": false
           }
         },
+        {
+          "path": "secure/fingerprint/index",
+          "style": {
+            "navigationBarTitleText": "",
+            "navigationBarTextStyle": "black",
+            "navigationBarBackgroundColor": "#FFFFFF"
+          }
+        },
         {
           "path": "avatar/index",
           "style": {
@@ -214,6 +222,13 @@
               "titleNView": false
             }
           }
+        },
+        {
+          "path": "setting/index",
+          "style": {
+            "navigationBarTitleText": "设置",
+            "enablePullDownRefresh": false
+          }
         }
       ]
     },

+ 105 - 104
src/pages/business/fireIot/facilitiesGather/index.vue

@@ -1,116 +1,117 @@
 <template>
-  <scroll-view class="scroll-height" :scroll-y="true" :data-theme="'theme-' + proxy.$settingStore.themeColor.name">
-    <view id="facilitiesGather">
-      <view class="centerOne">
-        <!-- <view class="title"> </view> -->
-
-        <u--form :model="form" ref="uForm" :rules="rules" labelWidth="90">
-          <view>
-            <view style="padding: 10px 10px 20px 10px; background: #ffffff">
-              <view style="padding-left: 9px">
-                <u-form-item label="所属部门" prop="department" :borderBottom="true" @click="handleAction('所属部门')" required>
-                  <u-input v-model="form.department" placeholder="请选择所属部门" suffixIcon="arrow-right" suffixIconStyle="color: #909399" border="none" disabledColor="transparent" disabled />
-                </u-form-item>
-                <u-form-item label="设施类型" prop="facilityTypeName" :borderBottom="true" @click="handleAction('设施类型')" required>
-                  <u-input v-model="form.facilityTypeName" placeholder="请选择设施类型" suffixIcon="arrow-right" suffixIconStyle="color: #909399" border="none" disabledColor="transparent" disabled />
-                </u-form-item>
-                <u-form-item label="设施名称" prop="facilityName" :borderBottom="true" required>
-                  <u-input v-model="form.facilityName" placeholder="请输入设施名称" border="none" />
-                </u-form-item>
-                <u-form-item label="状态" prop="status" :borderBottom="true" required>
-                  <u-radio-group v-model="form.status" placement="row">
-                    <u-radio v-for="se in sexList" :key="se" :activeColor="proxy.$settingStore.themeColor.color" :label="se.text" :name="se.value" style="margin-right: 15px"></u-radio>
-                  </u-radio-group>
-                </u-form-item>
-                <u-form-item label="设施地址" prop="address" :borderBottom="true" required>
-                  <u-input v-model="form.address" placeholder="请选择设施地址" border="none" disabledColor="transparent" disabled @click="handleAction('设施地址')">
-                    <template #suffix>
-                      <view class="iconfont ucicon-map menu-icon" style="font-size: 18px; color: #909399"> </view>
-                    </template>
-                  </u-input>
-                </u-form-item>
-                <u-form-item label="行政区划" prop="facilityAddress" :borderBottom="true" required>
-                  <view style="width: 100%">
-                    <view style="font-size: 15px"> {{ form.address ? form.address.split(form.facilityAddress)[0] : "" }}</view>
-                    <u-input v-model="form.facilityAddress" placeholder="请输入详细地址" border="none" />
-                  </view>
-                </u-form-item>
-                <u-form-item v-if="form.typeGuise && form.typeGuise != 1" label="类型" prop="gpsAreas" :borderBottom="true" @click="handleAction('类型')" required>
-                  <view style="font-size: 15px">{{ form.typeGuise == 1 ? "点" : form.typeGuise == 2 ? "线" : form.typeGuise == 3 ? "面" : "" }}</view>
-                  <view v-if="form.gpsAreas.length <= 0" style="font-size: 15px; margin: auto; color: #ff0000">未编辑</view>
-                  <view v-if="form.gpsAreas.length > 0" style="font-size: 15px; margin: auto; color: #30bb00">已编辑</view>
-                  <view class="iconfont ucicon-bianji1 menu-icon" style="font-size: 14px; color: #909399"> </view>
-                </u-form-item>
-                <u-form-item label="联系人" prop="contact" :borderBottom="true">
-                  <u-input v-model="form.contact" placeholder="请输入联系人" border="none" />
-                </u-form-item>
-                <u-form-item label="联系电话" prop="contactPhone" :borderBottom="true">
-                  <u-input v-model="form.contactPhone" placeholder="请输入联系电话" border="none" maxlength="11" />
-                </u-form-item>
-                <u-form-item label="设备图片" prop="imagesUrl" :borderBottom="true">
-                  <oa-upload :uploadCount="1" :uploadImage="form.imagesUrl" @uploadSuccessChange="uploadSuccessChange" @uploadDeleteChange="uploadDeleteChange"></oa-upload>
-                </u-form-item>
-                <u-form-item label="备注" prop="facilityDesc" :borderBottom="true">
-                  <u-textarea v-model="form.facilityDesc" placeholder="请输入" border="none" maxlength="30" style="padding: 0px"></u-textarea>
-                </u-form-item>
-
-                <u-form-item v-for="(fo, index) in form.extendData" :key="index" :label="fo.name" :prop="fo.key" :borderBottom="true">
-                  <u-input v-if="fo.type === 'SRK'" v-model="fo.value" :placeholder="'请输入' + fo.name" border="none" disabledColor="transparent" />
-
-                  <u-radio-group v-if="fo.type === 'DXK'" v-model="fo.value" placement="row">
-                    <u-radio
-                      v-for="se in fo.list"
-                      :key="se"
-                      :activeColor="proxy.$settingStore.themeColor.color"
-                      :label="se.attributeValue"
-                      :name="se.attributeCode"
-                      style="margin-right: 15px"
-                    ></u-radio>
-                  </u-radio-group>
-
-                  <u-input
-                    v-if="fo.type === 'XLK'"
-                    v-model="fo.valueName"
-                    :placeholder="'请选择' + fo.name"
-                    suffixIcon="arrow-right"
-                    suffixIconStyle="color: #909399"
-                    border="none"
-                    disabledColor="transparent"
-                    disabled
-                    @click="handleAction('属性', fo)"
-                  />
-                </u-form-item>
-              </view>
+  <oa-scroll
+    id="facilitiesGather"
+    customClass="scroll-height"
+    :customStyle="{}"
+    :refresherLoad="false"
+    :refresherEnabled="false"
+    :refresherDefaultStyle="'none'"
+    :refresherThreshold="44"
+    :refresherBackground="'#f5f6f7'"
+    :data-theme="'theme-' + proxy.$settingStore.themeColor.name"
+  >
+    <view class="centerOne">
+      <!-- <view class="title"> </view> -->
+
+      <u--form :model="form" ref="uForm" :rules="rules" labelWidth="90">
+        <view>
+          <view style="padding: 10px 10px 20px 10px; background: #ffffff">
+            <view style="padding-left: 9px">
+              <u-form-item label="所属部门" prop="department" :borderBottom="true" @click="handleAction('所属部门')" required>
+                <u-input v-model="form.department" placeholder="请选择所属部门" suffixIcon="arrow-right" suffixIconStyle="color: #909399" border="none" disabledColor="transparent" disabled />
+              </u-form-item>
+              <u-form-item label="设施类型" prop="facilityTypeName" :borderBottom="true" @click="handleAction('设施类型')" required>
+                <u-input v-model="form.facilityTypeName" placeholder="请选择设施类型" suffixIcon="arrow-right" suffixIconStyle="color: #909399" border="none" disabledColor="transparent" disabled />
+              </u-form-item>
+              <u-form-item label="设施名称" prop="facilityName" :borderBottom="true" required>
+                <u-input v-model="form.facilityName" placeholder="请输入设施名称" border="none" />
+              </u-form-item>
+              <u-form-item label="状态" prop="status" :borderBottom="true" required>
+                <u-radio-group v-model="form.status" placement="row">
+                  <u-radio v-for="se in sexList" :key="se" :activeColor="proxy.$settingStore.themeColor.color" :label="se.text" :name="se.value" style="margin-right: 15px"></u-radio>
+                </u-radio-group>
+              </u-form-item>
+              <u-form-item label="设施地址" prop="address" :borderBottom="true" required>
+                <u-input v-model="form.address" placeholder="请选择设施地址" border="none" disabledColor="transparent" disabled @click="handleAction('设施地址')">
+                  <template #suffix>
+                    <view class="iconfont ucicon-map menu-icon" style="font-size: 18px; color: #909399"> </view>
+                  </template>
+                </u-input>
+              </u-form-item>
+              <u-form-item label="行政区划" prop="facilityAddress" :borderBottom="true" required>
+                <view style="width: 100%">
+                  <view style="font-size: 15px"> {{ form.address ? form.address.split(form.facilityAddress)[0] : "" }}</view>
+                  <u-input v-model="form.facilityAddress" placeholder="请输入详细地址" border="none" />
+                </view>
+              </u-form-item>
+              <u-form-item v-if="form.typeGuise && form.typeGuise != 1" label="类型" prop="gpsAreas" :borderBottom="true" @click="handleAction('类型')" required>
+                <view style="font-size: 15px">{{ form.typeGuise == 1 ? "点" : form.typeGuise == 2 ? "线" : form.typeGuise == 3 ? "面" : "" }}</view>
+                <view v-if="form.gpsAreas.length <= 0" style="font-size: 15px; margin: auto; color: #ff0000">未编辑</view>
+                <view v-if="form.gpsAreas.length > 0" style="font-size: 15px; margin: auto; color: #30bb00">已编辑</view>
+                <view class="iconfont ucicon-bianji1 menu-icon" style="font-size: 14px; color: #909399"> </view>
+              </u-form-item>
+              <u-form-item label="联系人" prop="contact" :borderBottom="true">
+                <u-input v-model="form.contact" placeholder="请输入联系人" border="none" />
+              </u-form-item>
+              <u-form-item label="联系电话" prop="contactPhone" :borderBottom="true">
+                <u-input v-model="form.contactPhone" placeholder="请输入联系电话" border="none" maxlength="11" />
+              </u-form-item>
+              <u-form-item label="设备图片" prop="imagesUrl" :borderBottom="true">
+                <oa-upload :uploadCount="1" :uploadImage="form.imagesUrl" @uploadSuccessChange="uploadSuccessChange" @uploadDeleteChange="uploadDeleteChange"></oa-upload>
+              </u-form-item>
+              <u-form-item label="备注" prop="facilityDesc" :borderBottom="true">
+                <u-textarea v-model="form.facilityDesc" placeholder="请输入" border="none" maxlength="30" style="padding: 0px"></u-textarea>
+              </u-form-item>
+
+              <u-form-item v-for="(fo, index) in form.extendData" :key="index" :label="fo.name" :prop="fo.key" :borderBottom="true">
+                <u-input v-if="fo.type === 'SRK'" v-model="fo.value" :placeholder="'请输入' + fo.name" border="none" disabledColor="transparent" />
+
+                <u-radio-group v-if="fo.type === 'DXK'" v-model="fo.value" placement="row">
+                  <u-radio v-for="se in fo.list" :key="se" :activeColor="proxy.$settingStore.themeColor.color" :label="se.attributeValue" :name="se.attributeCode" style="margin-right: 15px"></u-radio>
+                </u-radio-group>
+
+                <u-input
+                  v-if="fo.type === 'XLK'"
+                  v-model="fo.valueName"
+                  :placeholder="'请选择' + fo.name"
+                  suffixIcon="arrow-right"
+                  suffixIconStyle="color: #909399"
+                  border="none"
+                  disabledColor="transparent"
+                  disabled
+                  @click="handleAction('属性', fo)"
+                />
+              </u-form-item>
             </view>
           </view>
-        </u--form>
+        </view>
+      </u--form>
 
-        <view class="app-padding-bottom"> </view>
+      <view class="app-padding-bottom"> </view>
 
-        <view class="app-button-fixed">
-          <view class="app-flex">
-            <u-button class="app-buttom" style="margin-right: 15px" @click="handleSubmit('取消')" shape="circle"> 取消 </u-button>
+      <view class="app-button-fixed">
+        <view class="app-flex">
+          <u-button class="app-buttom" style="margin-right: 15px" @click="handleSubmit('取消')" shape="circle"> 取消 </u-button>
 
-            <u-button class="app-buttom" type="primary" @click="handleSubmit('提交')" shape="circle"> 提交 </u-button>
-          </view>
+          <u-button class="app-buttom" type="primary" @click="handleSubmit('提交')" shape="circle"> 提交 </u-button>
         </view>
       </view>
-
-      <u-picker
-        :show="actionShow"
-        :columns="actionsList"
-        :title="'请选择' + actionTitle"
-        keyName="name"
-        visibleItemCount="6"
-        :defaultIndex="[actionDefaultIndex]"
-        :closeOnClickOverlay="true"
-        @close="actionShow = false"
-        @cancel="actionShow = false"
-        @confirm="selectAction"
-        @change="changeHandler"
-      ></u-picker>
     </view>
-  </scroll-view>
+
+    <u-picker
+      :show="actionShow"
+      :columns="actionsList"
+      :title="'请选择' + actionTitle"
+      keyName="name"
+      visibleItemCount="6"
+      :defaultIndex="[actionDefaultIndex]"
+      :closeOnClickOverlay="true"
+      @close="actionShow = false"
+      @cancel="actionShow = false"
+      @confirm="selectAction"
+      @change="changeHandler"
+    ></u-picker>
+  </oa-scroll>
 </template>
 
 <script setup>

+ 0 - 1
src/pages/business/mhxf/deviceManage/index.vue

@@ -116,7 +116,6 @@ const list = ref([
  */
 function tabsClick(e) {
   current.value = e.index;
-  // alert(current.value)
   dataInput.value = "";
 }
 

+ 1 - 1
src/pages/business/mhxf/needMatter/index.vue

@@ -266,7 +266,7 @@ function handleConfirm() {
 
   let params = {
     reformId: arrayList.value.reformId, //整改单编号
-    reformPerson: useStore.$state.name, //整改提交人
+    reformPerson: useStore.$state.nickName, //整改提交人
     reformRemark: textValue.value, //整改备注
     reformPath1: "", //整改相关图片或文件路径1
     reformPath2: "", //整改相关图片或文件路径2

+ 0 - 7
src/pages/business/zhxf/funReport/funcAdd/index.vue

@@ -312,13 +312,6 @@ onReady(() => {
   proxy.$settingStore.systemThemeColor([1]);
 });
 
-watch(
-  () => start_time.value,
-  (val) => {
-    // alert(start_time.value)
-  }
-);
-
 watch(
   () => report_type.value,
   (newVal) => {

+ 1 - 10
src/pages/business/zhxf/messagePush/index.vue

@@ -128,16 +128,7 @@ function getCheckList(params = {}) {
 //提交
 async function btnSubmit() {
   // 提交验证
-  // alert(aa.value);
-  // alert(checkedValue.value)
-  // if (!aa.value.length) {
-  // 	uni.showToast({
-  // 		title: "请选择推送选项",
-  // 		icon: "none"
-  // 	});
-  // 	return
-  // }
-
+  
   let mingParams = {};
   if (!flag.value) {
     //不点击默认传参

+ 0 - 1
src/pages/common/export/index.vue

@@ -115,7 +115,6 @@ function exportButton() {
   var end_time = datetimerange[1] ? `end_time/${datetimerange[1]}/` : "";
   let exportUrl = config.BASE_URL + url2 + `/${start_time}${end_time}company_code/${uni.getStorageSync("selectedCode")}/`;
   var ua = window.navigator.userAgent.toLowerCase();
-  // alert(exportUrl)
   if (ua.match(/MicroMessenger/i) == "micromessenger") {
     uni.showModal({
       showCancel: false,

+ 95 - 118
src/pages/common/test/index.vue

@@ -1,126 +1,103 @@
 <template>
-	<view>
-		<view @tap="goCamera()" class="cameraButton">
-			拍照按钮
-		</view>
-		
-		<view class="uni-list list-pd">
-			<view class="uni-uploader__files">
-				<view v-for="(image, index) in imageList" :key="index" class="abc">
-					<view class="uni-uploader__file" style="inline-block">
-						<view class="delete " :style="{'z-index': 99}" @tap="onDeleteClick(index)">x</view>
-						<view class=" images-one">
-							<image class="uni-uploader__img image-bg" :src="image" :data-src="image"
-								@tap="previewImage"></image>
-						</view>
-
-					</view>
-				</view>
-				<view class="uni-uploader__input-box" v-show="imageList.length > 0">
-					<view class="uni-uploader__input" @tap="onGetImgClick"></view>
-				</view>
-			</view>
-		</view>
-
-
-
-	</view>
+  <view>
+    <view @tap="goCamera()" class="cameraButton"> 拍照按钮 </view>
+
+    <view class="uni-list list-pd">
+      <view class="uni-uploader__files">
+        <view v-for="(image, index) in imageList" :key="index" class="abc">
+          <view class="uni-uploader__file" style="inline-block">
+            <view class="delete" :style="{ 'z-index': 99 }" @tap="onDeleteClick(index)">x</view>
+            <view class="images-one">
+              <image class="uni-uploader__img image-bg" :src="image" :data-src="image" @tap="previewImage"></image>
+            </view>
+          </view>
+        </view>
+        <view class="uni-uploader__input-box" v-show="imageList.length > 0">
+          <view class="uni-uploader__input" @tap="onGetImgClick"></view>
+        </view>
+      </view>
+    </view>
+  </view>
 </template>
 
 <script>
-	export default {
-		data() {
-			return {
-
-				imageList: [],
-
-			}
-		},
-		mounted() {
-
-		},
-
-
-		//拍照
-		methods: {
-
-			// 删除图片
-			onDeleteClick(index) {
-				this.imageList.splice(index, 1)
-			},
-			// previewImage() {
-			// 	// 预览功能,相关博客有
-			// },
-
-
-
-			goCamera() {
-				const that = this
-				uni.chooseImage({
-					count: 2, // 最多可以选择的图片张数,默认9
-					sizeType: ['original', 'compressed'], //original 原图,compressed 压缩图,默认二者都有
-					sourceType: ['camera'], //album 从相册选图,camera 使用相机,默认二者都有。如需直接开相机或直接选相册,请只使用一个选项
-					success: function(res) {
-						
-						var tempFilePaths = res.tempFilePaths[0]
-						alert(1)
-						alert(tempFilePaths)
-						const len = that.imageList.length
-						if (len >= 2) {
-							uni.showToast({
-								title: '图片最多上传2张'
-							})
-						} else {
-							for (let i = 0; i < 2 - len; i++) {
-								if (res.tempFilePaths[i]) that.imageList.push(res.tempFilePaths[i])
-							}
-						}
-					}
-				})
-
-			},
-
-
-
-
-		}
-
-	}
+export default {
+  data() {
+    return {
+      imageList: [],
+    };
+  },
+  mounted() {},
+
+  //拍照
+  methods: {
+    // 删除图片
+    onDeleteClick(index) {
+      this.imageList.splice(index, 1);
+    },
+    // previewImage() {
+    // 	// 预览功能,相关博客有
+    // },
+
+    goCamera() {
+      const that = this;
+      uni.chooseImage({
+        count: 2, // 最多可以选择的图片张数,默认9
+        sizeType: ["original", "compressed"], //original 原图,compressed 压缩图,默认二者都有
+        sourceType: ["camera"], //album 从相册选图,camera 使用相机,默认二者都有。如需直接开相机或直接选相册,请只使用一个选项
+        success: function (res) {
+          var tempFilePaths = res.tempFilePaths[0];
+          alert(tempFilePaths);
+          const len = that.imageList.length;
+          if (len >= 2) {
+            uni.showToast({
+              title: "图片最多上传2张",
+            });
+          } else {
+            for (let i = 0; i < 2 - len; i++) {
+              if (res.tempFilePaths[i]) that.imageList.push(res.tempFilePaths[i]);
+            }
+          }
+        },
+      });
+    },
+  },
+};
 </script>
 
 <style>
-	.cameraButton {
-		border: 1px solid red;
-		display: inline-block;
-		border-radius: 10rpx;
-		padding: 10rpx
-	}
-
-	.images-one {
-		white-space: nowrap;
-		position: relative;
-		width: 150rpx;
-		height: 150rpx;
-		background-size: cover;
-		background-position: center;
-		vertical-align: middle;
-		font-size: 1.5em;
-		display: inline-block;
-		margin-right: 20rpx
-	}
-
-	.image-bg {
-		position: absolute;
-		z-index: -1;
-		left: 0;
-		right: 0;
-		bottom: 0;
-		right: 0;
-		width: 100%;
-		height: 100%;
-	}
-
-	.abc {
-		display: inline-block
-	}
+.cameraButton {
+  border: 1px solid red;
+  display: inline-block;
+  border-radius: 10rpx;
+  padding: 10rpx;
+}
+
+.images-one {
+  white-space: nowrap;
+  position: relative;
+  width: 150rpx;
+  height: 150rpx;
+  background-size: cover;
+  background-position: center;
+  vertical-align: middle;
+  font-size: 1.5em;
+  display: inline-block;
+  margin-right: 20rpx;
+}
+
+.image-bg {
+  position: absolute;
+  z-index: -1;
+  left: 0;
+  right: 0;
+  bottom: 0;
+  right: 0;
+  width: 100%;
+  height: 100%;
+}
+
+.abc {
+  display: inline-block;
+}
 </style>

+ 3 - 6
src/pages/common/test/test-1.vue

@@ -79,7 +79,7 @@ export default {
     },
 
     scancode: function () {
-      alert(1);
+      console.log(1);
       this.$wx.scanQRCode({
         needResult: 1, // 默认为0,扫描结果由微信处理,1则直接返回扫描结果,
 
@@ -88,7 +88,7 @@ export default {
         success: function (res) {
           setTimeout(function () {
             /* 放200ms后执行的代码 */
-            alert(2);
+            console.log(2);
           }, 1000);
 
           var result = res.resultStr; // 当needResult 为 1 时,扫码返回的结果
@@ -99,7 +99,4 @@ export default {
 };
 </script>
 
-
-
-<style lang="scss">
-</style>
+<style lang="scss"></style>

+ 10 - 16
src/pages/index.vue

@@ -295,22 +295,16 @@ function navItemClick(item) {
     item.sort = 0;
 
     recentlyUsed.value.push(item);
-
-    if (recentlyUsed.value.length > 0) {
-      recentlyUsed.value = recentlyUsed.value.filter((currentValue, currentIndex, selfArr) => {
-        return selfArr.findIndex((x) => x.path === currentValue.path) === currentIndex;
-      });
-
-      recentlyUsed.value.filter((el) => {
-        if (el.path === item.path) {
-          el.sort++;
-        }
-      });
-    }
-
+    recentlyUsed.value = proxy.$common.uniq(recentlyUsed.value, "path");
+    recentlyUsed.value.filter((el) => {
+      if (el.path === item.path) {
+        el.meta.icon = item.meta.icon;
+        el.sort++;
+      }
+    });
     recentlyUsed.value = publicStore.sortEvent(recentlyUsed.value, 1);
 
-    uni.setStorageSync(useStore.$state.name + useStore.$state.tenantId, recentlyUsed.value);
+    uni.setStorageSync(useStore.$state.nickName + useStore.$state.tenantId, recentlyUsed.value);
 
     if (item.path.indexOf("http") != -1) {
       uni.navigateTo({
@@ -391,8 +385,8 @@ onLoad((option) => {
 });
 
 onShow(() => {
-  if (uni.getStorageSync(useStore.$state.name + useStore.$state.tenantId)) {
-    recentlyUsed.value = uni.getStorageSync(useStore.$state.name + useStore.$state.tenantId);
+  if (uni.getStorageSync(useStore.$state.nickName + useStore.$state.tenantId)) {
+    recentlyUsed.value = uni.getStorageSync(useStore.$state.nickName + useStore.$state.tenantId);
   } else {
     recentlyUsed.value = [];
   }

+ 5 - 5
src/pages/mine.vue

@@ -4,13 +4,13 @@
     <view class="header-section" :class="'bg-' + themeColor.name" :style="{ paddingTop: proxy.$settingStore.StatusBar ? proxy.$settingStore.StatusBar + 20 + 'px' : '55px' }">
       <view class="flex padding justify-between">
         <view class="flex align-center">
-          <view v-if="!avatar" class="cu-avatar xl round bg-white" @click="handleToAvatar(1)">
+          <view v-if="!avatar" class="cu-avatar xl round bg-white" @click="!data.nickName ? handleToLogin() : handleToAvatar(1)">
             <view class="iconfont ucicon-people text-gray icon"></view>
           </view>
           <image v-if="avatar" @click="handleToAvatar(2)" :src="avatar" class="cu-avatar xl round"> </image>
-          <view v-if="!data.name" @click="handleToLogin" class="login-tip"> 点击登录 </view>
-          <view v-if="data.name" class="user-info">
-            <view class="u_title"> {{ data.name }} </view>
+          <view v-if="!data.nickName" @click="handleToLogin()" class="login-tip"> 点击登录 </view>
+          <view v-if="data.nickName" class="user-info">
+            <view class="u_title"> {{ data.nickName }} </view>
             <view class="u_title"> {{ data.phone }} </view>
           </view>
         </view>
@@ -204,7 +204,7 @@ const windowHeight = computed(() => {
 });
 
 const data = reactive({
-  name: useStore.$state.name,
+  nickName: useStore.$state.nickName,
   phone: useStore.$state.phonenumber,
   version: config.appInfo.version,
 

+ 0 - 466
src/pages/mine/index.vue

@@ -1,466 +0,0 @@
-<template>
-  <view :data-theme="'theme-' + proxy.$settingStore.themeColor.name" class="mine-container" :style="{ height: `calc(100vh - 50.67px)` }">
-    <!--顶部个人信息栏-->
-    <view class="header-section" :class="'bg-' + themeColor.name" :style="{ paddingTop: proxy.$settingStore.StatusBar ? proxy.$settingStore.StatusBar + 20 + 'px' : '55px' }">
-      <view class="flex padding justify-between">
-        <view class="flex align-center">
-          <view v-if="!avatar" class="cu-avatar xl round bg-white" @click="handleToAvatar(1)">
-            <view class="iconfont ucicon-people text-gray icon"></view>
-          </view>
-          <image v-if="avatar" @click="handleToAvatar(2)" :src="avatar" class="cu-avatar xl round"> </image>
-          <view v-if="!data.name" @click="handleToLogin" class="login-tip"> 点击登录 </view>
-          <view v-if="data.name" class="user-info">
-            <view class="u_title"> {{ data.name }} </view>
-            <view class="u_title"> {{ data.phone }} </view>
-          </view>
-        </view>
-        <view class="flex align-center"> </view>
-      </view>
-
-      <view class="vip-card-box"> </view>
-    </view>
-
-    <view
-      class="content-section"
-      :style="[
-        {
-          transform: coverTransform,
-          transition: coverTransition,
-        },
-      ]"
-      @touchstart="coverTouchstart"
-      @touchmove="coverTouchmove"
-      @touchend="coverTouchend"
-    >
-      <image class="mine-image" src="@/static/images/mine/arc.png"></image>
-
-      <view class="menu-list">
-        <view class="list-cell list-cell-arrow" @click="proxy.$settingStore.handleToEditInfo()">
-          <view class="menu-item-box">
-            <view class="iconfont ucicon-user menu-icon"></view>
-            <view>我的信息</view>
-          </view>
-        </view>
-        <view class="list-cell list-cell-arrow" @click="proxy.$settingStore.handleToSecure()">
-          <view class="menu-item-box">
-            <view class="iconfont ucicon-yanzheng menu-icon"></view>
-            <view>账号与安全</view>
-          </view>
-        </view>
-        <view class="list-cell list-cell-arrow" @click="proxy.$settingStore.handleAbout()">
-          <view class="menu-item-box">
-            <view class="iconfont ucicon-aixin menu-icon"></view>
-            <view>关于我们</view>
-          </view>
-        </view>
-        <view class="list-cell list-cell-arrow" @click="proxy.$settingStore.handleHelp()">
-          <view class="menu-item-box">
-            <view class="iconfont ucicon-Help menu-icon"></view>
-            <view>常见问题</view>
-          </view>
-        </view>
-        <view class="list-cell list-cell-arrow" @click="proxy.$settingStore.handleCleanTmp()">
-          <view class="menu-item-box">
-            <view class="iconfont ucicon-qinglihuancun menu-icon"></view>
-            <view>清理缓存</view>
-            <view style="margin: 0 15px 0 auto; font-size: 14px; color: #909399">{{ proxy.$settingStore.currentSize }}</view>
-          </view>
-        </view>
-        <view class="list-cell list-cell-arrow" @click="proxy.$settingStore.handleToUpgrade()">
-          <view class="menu-item-box">
-            <view class="iconfont ucicon-jianchagengxin menu-icon"></view>
-            <view>检查更新</view>
-          </view>
-        </view>
-        <!-- <view class="list-cell list-cell-arrow" @click="proxy.$settingStore.handleSetting()">
-          <view class="menu-item-box">
-            <view class="iconfont ucicon-shezhi menu-icon"></view>
-            <view>设置</view>
-          </view>
-        </view> -->
-      </view>
-
-      <!-- <view class="menu-list">
-        <view class="list-cell list-cell-arrow" @click="goMessagePush()">
-          <view class="menu-item-box">
-            <view class="iconfont ucicon-aixin menu-icon"></view>
-            <view>推送设置</view>
-          </view>
-        </view>
-        <view class="list-cell list-cell-arrow" @click="goBuilding()">
-          <view class="menu-item-box">
-            <view class="iconfont ucicon-aixin menu-icon"></view>
-            <view>建筑管理</view>
-          </view>
-        </view>
-        <view class="list-cell list-cell-arrow" @click="goFunReport()">
-          <view class="menu-item-box">
-            <view class="iconfont ucicon-aixin menu-icon"></view>
-            <view>功能报备</view>
-          </view>
-        </view>
-      </view> -->
-
-      <view class="cu-list menu">
-        <view class="cu-item" style="margin-top: 0; margin-bottom: 0">
-          <view class="content flex align-center">
-            <text class="iconfont ucicon-colorlens" :class="'text-' + themeColor.name"></text>
-            <view class="padding solid radius shadow-blur" :class="'bg-' + themeColor.name" style="margin-left: 10px"></view>
-            <view class="title" style="margin-left: 10px">
-              主题色:<text :class="'text-' + themeColor.name">{{ themeColor.title }}</text>
-            </view>
-          </view>
-          <view class="action">
-            <button class="cu-btn round shadow" @click="colorModal = true" :class="'bg-' + themeColor.name">
-              <text class="iconfont ucicon-colorlens"></text>
-              选择主题
-            </button>
-          </view>
-        </view>
-      </view>
-
-      <view class="cu-list menu">
-        <view class="cu-item">
-          <view class="content text-center" @click="proxy.$settingStore.handleLogout">
-            <text class="text-black">退出登录</text>
-          </view>
-        </view>
-      </view>
-    </view>
-
-    <!-- <view class="cu-list menu-avatar padding-lr-sm padding-top-sm">
-      <view class="cu-item" @tap="goSiteManage" v-if="permissionLabel == 1">
-        <view class="cu-avatar" style="background-image: url(@/static/images/setting/setting-icon2.png)"></view>
-        <view class="content">
-          <view class="">站点管理</view>
-        </view>
-        <view class="nav-right">
-          <view class="text-grey">
-            <text class="icon iconfont margin-right-xs margin-left-lg">&#xe629;</text>
-          </view>
-        </view>
-      </view>
-      <view class="cu-item" @tap="goAuthManage" v-if="permissionLabel == 1">
-        <view class="cu-avatar" style="background-image: url(@/static/images/setting/setting-icon4.png)"></view>
-        <view class="content">
-          <view class="">权限管理</view>
-        </view>
-        <view class="nav-right">
-          <view class="text-grey">
-            <text class="icon iconfont margin-right-xs margin-left-lg">&#xe629;</text>
-          </view>
-        </view>
-      </view>
-    </view> -->
-
-    <!-- 选择颜色模态框 -->
-    <view class="cu-modal" :class="{ show: colorModal }">
-      <view class="cu-dialog">
-        <view class="cu-bar justify-end solid-bottom">
-          <view class="content">选择颜色</view>
-          <view class="action" @tap="colorModal = false">
-            <u-icon name="close" size="14"></u-icon>
-            <text class="cuIcon-close text-red"></text>
-          </view>
-        </view>
-        <view class="grid col-5 padding">
-          <view class="padding-xs" v-for="(item, index) in themeList" :key="index" @tap="SetColor(item)" :data-color="item.name">
-            <view class="padding-tb radius" :class="'bg-' + item.name">
-              {{ item.title }}
-            </view>
-          </view>
-        </view>
-      </view>
-    </view>
-  </view>
-
-  <oa-tabbar :tabbarValue="2"></oa-tabbar>
-</template>
-
-<script setup>
-import config from "@/config";
-import storage from "@/utils/storage";
-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 { uploadAvatar, updateUserProfile } from "@/api/system/user";
-import { getAuthorization } from "@/api/business/zhxf/messagePush/index.js";
-
-const useStore = useStores();
-
-const { proxy } = getCurrentInstance();
-
-const avatar = computed(() => {
-  return useStore.$state.avatar;
-});
-
-const themeColor = computed(() => {
-  return proxy.$settingStore.themeColor;
-});
-
-const windowHeight = computed(() => {
-  return uni.getSystemInfoSync().windowHeight - 50;
-});
-
-const data = reactive({
-  name: useStore.$state.name,
-  phone: useStore.$state.phonenumber,
-  version: config.appInfo.version,
-
-  coverTransform: "translateY(0px)",
-  coverTransition: "0s",
-  moving: false,
-
-  colorModal: false,
-  themeList: proxy.$constData.themeList,
-});
-
-const { coverTransform, coverTransition, moving, colorModal, themeList } = toRefs(data);
-
-const permissionLabel = ref(0);
-
-function getAuthorizationApi(params) {
-  getAuthorization(params).then((res) => {
-    permissionLabel.value = res.data.permissionLabel;
-  });
-}
-
-/**
- * @推送设置
- */
-function goMessagePush() {
-  proxy.$tab.navigateTo("/pages/business/zhxf/messagePush/index");
-}
-
-/**
- * @建筑管理
- */
-function goBuilding() {
-  proxy.$tab.navigateTo("/pages/business/zhxf/building/index");
-}
-
-/**
- * @功能报备
- */
-function goFunReport() {
-  proxy.$tab.navigateTo("/pages/business/zhxf/funReport/index");
-}
-
-/**
- * @主题颜色选择
- */
-function SetColor(item) {
-  colorModal.value = false;
-  proxy.$settingStore.SET_THEMECOLOR(item);
-  proxy.$settingStore.systemThemeColor([1, 2]);
-}
-
-/**
- * @点击登录
- */
-function handleToLogin() {
-  proxy.$tab.reLaunch("/pages/login");
-}
-
-/**
- * @upload上传头像
- * @api接口请求
- */
-function uploadApi(res) {
-  let data = { name: "file", filePath: res.tempFilePaths[0] };
-  uploadAvatar(data).then((response) => {
-    useStore.$state.avatar = response.data.url;
-    updateUserProfile({
-      avatar: response.data.url,
-    }).then(() => {});
-  });
-}
-
-/**
- * @点击头像
- */
-function handleToAvatar(type) {
-  if (type == 1) {
-    uni.chooseImage({
-      count: 1, //默认9
-      sizeType: ["original", "compressed"], //可以指定是原图还是压缩图,默认二者都有
-      sourceType: ["album", "camera"], //从相册选择、摄像头
-      success: function (res) {
-        uploadApi(res);
-      },
-    });
-  } else if (type == 2) {
-    proxy.$tab.navigateTo("/pages/mine/avatar/index");
-  }
-}
-
-let startY = 0,
-  moveY = 0,
-  pageAtTop = true;
-
-/**
- * @触摸开始
- */
-function coverTouchstart(e) {
-  if (pageAtTop === false) {
-    return;
-  }
-  coverTransition.value = "transform .1s linear";
-  startY = e.touches[0].clientY;
-}
-
-/**
- * @触摸移动
- */
-function coverTouchmove(e) {
-  moveY = e.touches[0].clientY;
-  let moveDistance = moveY - startY;
-  if (moveDistance < 0) {
-    moving.value = false;
-    return;
-  }
-  moving.value = true;
-  if (moveDistance >= 80 && moveDistance < 100) {
-    moveDistance = 80;
-  }
-  if (moveDistance > 0 && moveDistance <= 80) {
-    coverTransform.value = `translateY(${moveDistance}px)`;
-  }
-}
-
-/**
- * @触摸结束
- */
-function coverTouchend() {
-  if (moving.value === false) {
-    return;
-  }
-  moving.value = false;
-  coverTransition.value = "transform 0.3s cubic-bezier(.21,1.93,.53,.64)";
-  coverTransform.value = "translateY(0px)";
-}
-
-onShow(() => {});
-
-onReady(() => {});
-
-onLoad((options) => {
-  uni.hideTabBar(); //隐藏自带tabbar
-});
-
-// 自定义导航事件
-onNavigationBarButtonTap((e) => {
-  if (e.float == "right") {
-    proxy.$tab.navigateTo("/pages/mine/setting/index");
-  }
-});
-</script>
-
-<style lang="scss" scoped>
-.mine-container {
-  width: 100%;
-  height: 100vh;
-
-  .header-section {
-    padding: 55px 15px 0 15px;
-
-    .login-tip {
-      font-size: 18px;
-      margin-left: 10px;
-    }
-
-    .cu-avatar {
-      border: 2px solid #eaeaea;
-
-      .icon {
-        font-size: 40px;
-      }
-    }
-
-    .user-info {
-      margin-left: 15px;
-
-      .u_title {
-        font-size: 18px;
-        line-height: 30px;
-      }
-    }
-
-    .vip-card-box {
-      display: flex;
-      flex-direction: column;
-      color: #f7d680;
-      height: 132px;
-      background: url("@/static/images/mine/vip-card.png");
-      background-size: 100% 100%;
-      border-radius: 8px 8px 0 0;
-      overflow: hidden;
-      position: relative;
-      padding: 11px 13px;
-    }
-  }
-
-  .content-section {
-    position: relative;
-    margin-top: -85px;
-    padding-bottom: 50.67px;
-    background-color: #f5f6f7;
-
-    .mine-image {
-      position: absolute;
-      left: 0;
-      top: -16px;
-      width: 100%;
-      height: 36upx;
-    }
-
-    .mine-actions {
-      margin: 0.625rem 0.625rem;
-      padding: 20px 0px;
-      border-radius: 8px;
-      background-color: white;
-
-      .action-item {
-        .icon {
-          font-size: 28px;
-        }
-
-        .text {
-          display: block;
-          font-size: 13px;
-          margin: 8px 0px;
-        }
-      }
-    }
-  }
-
-  .cu-list.menu-avatar .cu-item {
-    border-radius: 5px;
-    padding: 30rpx 0;
-    box-shadow: 1px 1px 4px rgb(26 26 26 / 10%);
-    .cu-avatar {
-      background-color: rgba(0, 0, 0, 0);
-      background-size: 100% 100%;
-      left: 26rpx;
-    }
-    .content {
-      left: 130rpx;
-      font-size: 32rpx;
-    }
-  }
-}
-
-.item-box {
-  background-color: #ffffff;
-  margin: 30rpx;
-  display: flex;
-  flex-direction: row;
-  justify-content: center;
-  align-items: center;
-  padding: 10rpx;
-  border-radius: 8rpx;
-  color: #303133;
-  font-size: 32rpx;
-}
-</style>

+ 32 - 7
src/pages/serveConfig.vue

@@ -52,10 +52,11 @@ const dataList = reactive({
   linkUrl: "", //链接地址
   port: "",
   content: "",
+  index: "",
 });
 
 const uForm = ref(null);
-const { linkUrl, port, content } = toRefs(dataList);
+const { linkUrl, port, content, index } = toRefs(dataList);
 
 /**
  * @扫一扫
@@ -109,12 +110,20 @@ function handleSubmit() {
   //   return;
   // }
 
-  if (!port.value) {
-    uni.setStorageSync("serveUrl", linkUrl.value);
-    publicStore.setServeList(linkUrl.value, content.value);
+  if (index.value) {
+    let serveList = uni.getStorageSync("serveList");
+    serveList[0].radiolist[index.value].linkUrl = !port.value ? linkUrl.value : linkUrl.value + ":" + port.value;
+    serveList[0].radiolist[index.value].content = content.value;
+    uni.setStorageSync("serveUrl", !port.value ? linkUrl.value : linkUrl.value + ":" + port.value);
+    uni.setStorageSync("serveList", serveList);
   } else {
-    uni.setStorageSync("serveUrl", linkUrl.value + ":" + port.value);
-    publicStore.setServeList(linkUrl.value + ":" + port.value, content.value);
+    if (!port.value) {
+      uni.setStorageSync("serveUrl", linkUrl.value);
+      publicStore.setServeList(linkUrl.value, content.value);
+    } else {
+      uni.setStorageSync("serveUrl", linkUrl.value + ":" + port.value);
+      publicStore.setServeList(linkUrl.value + ":" + port.value, content.value);
+    }
   }
 
   config.baseUrl = "http://" + uni.getStorageSync("serveUrl") + "/prod-api";
@@ -128,7 +137,23 @@ function navigateTo() {
   proxy.$tab.navigateBack(1);
 }
 
-onLoad((options) => {});
+onLoad((options) => {
+  if ("index" in options) {
+    index.value = options.index;
+    let serveList = uni.getStorageSync("serveList");
+    var serveArray = serveList[0].radiolist[options.index];
+
+    if (serveArray.linkUrl.indexOf(":") != -1) {
+      linkUrl.value = serveArray.linkUrl.split(":")[0];
+      port.value = serveArray.linkUrl.split(":")[1];
+      content.value = serveArray.content;
+    } else {
+      linkUrl.value = serveArray.linkUrl;
+      port.value = "";
+      content.value = serveArray.content;
+    }
+  }
+});
 </script>
 
 <style lang="scss" scoped>

+ 12 - 1
src/pages/serveConfigSelect.vue

@@ -24,6 +24,10 @@
             <div v-if="item.id != radiovalue" style="margin: auto 0 auto 0; height: 100%" @click="deleteRadio(index)">
               <u-icon name="close" color="#a0a4af" size="14"></u-icon>
             </div>
+
+            <div v-if="item.id == radiovalue" style="margin: auto 0 auto 0; height: 100%" @click="editRadio(index)">
+              <u-icon name="arrow-right" color="#a0a4af" size="14"></u-icon>
+            </div>
           </div>
         </u-radio-group>
       </div>
@@ -91,6 +95,14 @@ function deleteRadio(index) {
   proxy.$tab.redirectTo("/pages/serveConfigSelect"); //重载当前页
 }
 
+/**
+ * @编辑
+ * @按钮点击事件
+ */
+function editRadio(index) {
+  proxy.$tab.navigateTo("/pages/serveConfig?index=" + index);
+}
+
 /**
  * @扫一扫
  * @按钮点击事件
@@ -159,7 +171,6 @@ function navigateTo() {
  */
 function init() {
   let serveList = uni.getStorageSync("serveList");
-  console.log(serveList);
   if (serveList.length > 0) {
     radiolist.value = serveList[0].radiolist;
     radiovalue.value = serveList[0].radiovalue;

+ 22 - 0
src/plugins/common.plugins.js

@@ -147,4 +147,26 @@ export default {
     }
     return fmt;
   },
+
+  /**
+   * @数组对象去重
+   * @methods data 需要去重的数据
+   * @methods objectName 需要去重的对象名称
+   */
+  uniq(data, objectName) {
+    if (!objectName) {
+      var newArr = [...new Set(data)]
+
+      return newArr;
+    } else {
+      let obj = {};
+
+      let peon = data.reduce((cur, next) => {
+        obj[next[objectName]] ? "" : obj[next[objectName]] = true && cur.push(next);
+        return cur;
+      }, []) //设置cur默认类型为数组,并且初始值为空的数组
+
+      return peon;
+    }
+  }
 };

+ 2 - 2
src/plugins/modal.plugins.js

@@ -25,9 +25,9 @@ export default {
     uni.hideToast();
   },
   // 弹出提示
-  alert(content) {
+  alert(title, content) {
     uni.showModal({
-      title: "提示",
+      title: title,
       content: content,
       showCancel: false,
       mask: true,

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

@@ -1,8 +1,8 @@
 @font-face {
   font-family: "iconfont"; /* Project id 3620854 */
-  src: url("https://at.alicdn.com/t/c/font_3620854_kdcp7gpqqz.woff2?t=1691730084858") format("woff2"), 
-       url("https://at.alicdn.com/t/c/font_3620854_kdcp7gpqqz.woff?t=1691730084858") format("woff"),
-       url("https://at.alicdn.com/t/c/font_3620854_kdcp7gpqqz.ttf?t=1691730084858") format("truetype");
+  src: url("https://at.alicdn.com/t/c/font_3620854_k0vl6lrxxy.woff2?t=1693536081618") format("woff2"),
+       url("https://at.alicdn.com/t/c/font_3620854_k0vl6lrxxy.woff?t=1693536081618") format("woff"),
+       url("https://at.alicdn.com/t/c/font_3620854_k0vl6lrxxy.ttf?t=1693536081618") format("truetype");
 }
 
 .iconfont {
@@ -13,6 +13,10 @@
   -moz-osx-font-smoothing: grayscale;
 }
 
+.ucicon-zhiwen:before {
+  content: "\e74f";
+}
+
 .ucicon-position:before {
   content: "\e618";
 }
@@ -232,3 +236,4 @@
 .ucicon-eye-close:before {
   content: "\e8ff";
 }
+

二进制
src/static/iconfont/iconfont.ttf


+ 11 - 18
src/store/modules/setting.js

@@ -1,7 +1,6 @@
 
 import { defineStore } from "pinia";
 import storage from "@/utils/storage";
-import constant from "@/utils/constant";
 import modal from "@/plugins/modal.plugins.js";
 import tab from "@/plugins/tab.plugins.js";
 import setting from "@/plugins/setting.plugins.js";
@@ -12,21 +11,17 @@ import { uploadAvatar, updateUserProfile } from "@/api/system/user";
 const settingStore = defineStore("setting", {
     state: () => ({
         currentSize: "",//APP缓存
-
-        themeColor: storage.get(constant.themeColor),//主题
-
         barHeight: 0,//微信小程序顶部安全距离
         webViewHeight: "",//webView整体高度-铺满
-        StatusBar: 0,//app顶部安全距离
-        tabBarHeight: "",//app底部安全距离
-        barHightTop: "",//app头部计算距离
+        StatusBar: 0,//APP顶部安全距离
+        tabBarHeight: "",//APP底部安全距离
+        barHightTop: "",//APP头部计算距离
 
+        themeColor: storage.get("themeColor"),//主题
+        fingerprintUserList: storage.get("fingerprintUserList"),//指纹登录用户数据
     }),
     persist: {
-        // 自定义数据持久化方式
-        // key: 'store-key', 指定key进行存储,此时非key的值不会持久化,刷新就会丢失
         storage: window ? window.localStorage : uni.setStorageSync(), // 指定换成地址
-        // paths: ['nested.data'],// 指定需要持久化的state的路径名称
         beforeRestore: (context) => {
             console.log("Before" + context);
         },
@@ -122,7 +117,7 @@ const settingStore = defineStore("setting", {
             setting.clearCache();//清除应用访问缓存
             // #endif
 
-            uni.removeStorageSync(useStore.$state.name + useStore.$state.tenantId);//清除首页宫格缓存
+            uni.removeStorageSync(useStore.$state.nickName + useStore.$state.tenantId);//清除首页宫格缓存
         },
 
         /**
@@ -139,7 +134,6 @@ const settingStore = defineStore("setting", {
             tab.navigateTo("/pages/mine/secure/index");
         },
 
-
         /**
          * @设置
          */
@@ -147,8 +141,6 @@ const settingStore = defineStore("setting", {
             tab.navigateTo("/pages/mine/setting/index");
         },
 
-
-
         /**
          * @退出登录
          */
@@ -161,7 +153,6 @@ const settingStore = defineStore("setting", {
             });
         },
 
-
         /**
          * @点击头像
          */
@@ -195,12 +186,14 @@ const settingStore = defineStore("setting", {
             });
         },
 
-
         SET_THEMECOLOR(themeColor) {
-            // storage.get(constant.name)
             this.themeColor = themeColor;
-            storage.set(constant.themeColor, themeColor);
+            storage.set("themeColor", themeColor);
         },
+        SET_FINGERPRINT(array) {
+            this.fingerprintUserList = array;
+            storage.set("fingerprintUserList", array);
+        }
     },
 });
 

+ 27 - 23
src/store/modules/user.js

@@ -1,5 +1,4 @@
 import storage from "@/utils/storage";
-import constant from "@/utils/constant";
 import { login, logout, getInfo, getMobileTenantConfig } from "@/api/login";
 import { getUserProfile } from "@/api/system/user";
 import { getToken, setToken, removeToken } from "@/utils/auth";
@@ -9,17 +8,18 @@ import modal from "@/plugins/modal.plugins.js";
 const useStores = defineStore("useStores", {
   state: () => ({
     token: getToken(),
-    name: storage.get(constant.name),//用户名称
-    phonenumber: storage.get(constant.phonenumber),//用户手机号
-    avatar: storage.get(constant.avatar),
-    roles: storage.get(constant.roles),
-    permissions: storage.get(constant.permissions),
+    name: storage.get("name"),//用户名称
+    nickName: storage.get("nickName"),//用户昵称
+    phonenumber: storage.get("phonenumber"),//用户手机号
+    avatar: storage.get("avatar"),
+    roles: storage.get("roles"),
+    permissions: storage.get("permissions"),
 
-    loginTitle: storage.get(constant.loginTitle),
-    loginBottomTitle: storage.get(constant.loginFooter),
-    loginBg: storage.get(constant.loginBackUrl),
-    loginLogo: storage.get(constant.loginLogo),
-    tenantId: storage.get(constant.tenantId),
+    loginTitle: storage.get("loginTitle"),
+    loginBottomTitle: storage.get("loginBottomTitle"),
+    loginBg: storage.get("loginBg"),
+    loginLogo: storage.get("loginLogo"),
+    tenantId: storage.get("tenantId"),
 
     user: {},
     userArr: {},
@@ -97,7 +97,8 @@ const useStores = defineStore("useStores", {
               this.SET_ROLES(["ROLE_DEFAULT"]);
             }
 
-            this.SET_NAME(data.user.nickName);
+            this.SET_NAME(data.user.userName);
+            this.SET_NICKNAME(data.user.nickName);
             this.SET_PHONE(data.user.phonenumber);
             this.SET_AVATAR(data.user.avatar);
 
@@ -141,41 +142,44 @@ const useStores = defineStore("useStores", {
     },
     SET_NAME(name) {
       this.name = name;
-      storage.set(constant.name, name);
+      storage.set("name", name);
+    },
+    SET_NICKNAME(nickName) {
+      this.nickName = nickName;
+      storage.set("nickName", nickName);
     },
     SET_PHONE(phonenumber) {
       this.phonenumber = phonenumber;
-      storage.set(constant.phonenumber, phonenumber);
+      storage.set("phonenumber", phonenumber);
     },
     SET_AVATAR(avatar) {
       this.avatar = avatar;
-      storage.set(constant.avatar, avatar);
+      storage.set("avatar", avatar);
     },
     SET_ROLES(roles) {
       this.roles = roles;
-      storage.set(constant.roles, roles);
+      storage.set("roles", roles);
     },
     SET_PERMISSIONS(permissions) {
       this.permissions = permissions;
-      storage.set(constant.permissions, permissions);
+      storage.set("permissions", permissions);
     },
-
     SET_LOGINMOBILELIST(loginMobileList) {
       //title
       this.loginTitle = loginMobileList.loginTitle
-      storage.set(constant.loginTitle, loginMobileList.loginTitle);
+      storage.set("loginTitle", loginMobileList.loginTitle);
       //bottomTitle
       this.loginBottomTitle = loginMobileList.loginBottomTitle
-      storage.set(constant.loginBottomTitle, loginMobileList.loginBottomTitle);
+      storage.set("loginBottomTitle", loginMobileList.loginBottomTitle);
       //bg
       this.loginBg = loginMobileList.loginBg
-      storage.set(constant.loginBg, loginMobileList.loginBg);
+      storage.set("loginBg", loginMobileList.loginBg);
       //logo
       this.loginLogo = loginMobileList.loginLogo
-      storage.set(constant.loginLogo, loginMobileList.loginLogo);
+      storage.set("loginLogo", loginMobileList.loginLogo);
       //tenantId
       this.tenantId = loginMobileList.tenantId
-      storage.set(constant.tenantId, loginMobileList.tenantId);
+      storage.set("tenantId", loginMobileList.tenantId);
     }
   },
 });

+ 0 - 16
src/utils/constant.js

@@ -1,16 +0,0 @@
-const constant = {
-  avatar: 'vuex_avatar',
-  name: 'vuex_name',
-  roles: 'vuex_roles',
-  permissions: 'vuex_permissions',
-
-  loginTitle: 'vuex_loginTitle',
-  loginBottomTitle: 'vuex_loginBottomTitle',
-  loginBg: 'vuex_loginBg',
-  loginLogo: 'vuex_loginLogo',
-  tenantId: 'vuex_tenantId',
-
-  themeColor: 'vuex_themeColor'
-}
-
-export default constant

+ 9 - 7
src/utils/request.js

@@ -18,13 +18,15 @@ function verification(res, resolve, reject) {
   const code = data.code || 200;
 
   if (code === 401) {
-    modal.confirm("登录状态已过期,您可以继续留在该页面,或者重新登录?").then((res) => {
-      if (res) {
-        useStore.LogOut().then((res) => {
-          uni.reLaunch({ url: "/pages/login" });
-        });
-      }
-    });
+    // modal.confirm("登录状态已过期,您可以继续留在该页面,或者重新登录?").then((res) => {
+    //   if (res) {
+    //     useStore.LogOut().then((res) => {
+    //       uni.reLaunch({ url: "/pages/login" });
+    //     });
+    //   }
+    // });
+
+    uni.reLaunch({ url: "/pages/login" });
     modal.closeLoading();
     reject("无效的会话,或者会话已过期,请重新登录。");
   } else if (code === 404 || res.statusCode === 404) {

+ 4 - 23
src/utils/storage.js

@@ -1,34 +1,15 @@
-import constant from './constant'
-
 // 存储变量名
 let storageKey = 'storage_data'
 
-// 存储节点变量名
-let storageNodeKeys = [
-  constant.avatar,
-  constant.name,
-  constant.phonenumber,
-  constant.roles,
-  constant.permissions,
-  constant.loginTitle,
-  constant.loginBottomTitle,
-  constant.loginBg,
-  constant.loginLogo,
-  constant.tenantId,
-  constant.themeColor
-]
-
 // 存储的数据
 let storageData = uni.getStorageSync(storageKey) || {}
 
 const storage = {
   set: function (key, value) {
-    if (storageNodeKeys.indexOf(key) != -1) {
-      let tmp = uni.getStorageSync(storageKey)
-      tmp = tmp ? tmp : {}
-      tmp[key] = value
-      uni.setStorageSync(storageKey, tmp)
-    }
+    let tmp = uni.getStorageSync(storageKey)
+    tmp = tmp ? tmp : {}
+    tmp[key] = value
+    uni.setStorageSync(storageKey, tmp)
   },
   get: function (key) {
     return storageData[key] || ""