浏览代码

消息通知设置模块完成/代码优化

fanghuisheng 11 月之前
父节点
当前提交
5fdda29999

+ 6 - 3
src/manifest.json

@@ -2,7 +2,7 @@
     "name" : "综合智慧云",
     "appid" : "__UNI__36DE3A0",
     "description" : "综合智慧云app,助力企业数字化转型升级",
-    "versionName" : "2.1.4",
+    "versionName" : "2.1.2",
     "versionCode" : 12,
     "transformPx" : false,
     /* 5+App特有相关 */
@@ -72,7 +72,9 @@
                     "<uses-permission android:name=\"android.permission.WRITE_CONTACTS\"/>",
                     "<uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\"/>",
                     "<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>",
-                    "<uses-permission android:name=\"android.permission.WRITE_SMS\"/>"
+                    "<uses-permission android:name=\"android.permission.WRITE_SMS\"/>",
+                    "<uses-permission android:name=\"android.permission.ACCESS_LOCATION_EXTRA_COMMANDS\"/>",
+                    "<uses-permission android:name=\"android.permission.FOREGROUND_SERVICE\"/>"
                 ],
                 "minSdkVersion" : "",
                 "abiFilters" : [ "armeabi-v7a", "arm64-v8a" ],
@@ -94,7 +96,8 @@
                     "NSBluetoothPeripheralUsageDescription" : "该应用需要你的蓝牙,以便读取相关蓝牙设备",
                     "NFCReaderUsageDescription" : "",
                     "NSBluetoothAlwaysUsageDescription" : "该应用需要你的蓝牙,以便读取相关蓝牙设备"
-                }
+                },
+                "UIBackgroundModes" : "location"
             },
             /* SDK配置 */
             "sdkConfigs" : {

+ 7 - 1
src/pages.json

@@ -200,6 +200,12 @@
             // }
           }
         },
+        {
+          "path": "msg/index",
+          "style": {
+            "navigationBarTitleText": "新消息通知"
+          }
+        },
         {
           "path": "secure/index",
           "style": {
@@ -686,7 +692,7 @@
         "text": "工作台"
       },
       // {
-      //   "pagePath": "pages/analyse/analyse",
+      //   "pagePath": "pages/business/analyse/index",
       //   "iconPath": "/static/images/tabBar/analyse.png",
       //   "selectedIconPath": "/static/images/tabBar/analyse-selected.png",
       //   "text": "分析"

+ 8 - 10
src/pages/business/zhaf/signIn/index.vue

@@ -14,11 +14,11 @@
           class="signIn-button round mb30"
           :class="`bg-${themeColor.name}`"
           :style="{
-            background: state.signInType === 0 ? themeColor.color : '#999999',
+            background: state.signInType === 1 ? themeColor.color : '#999999',
           }"
           @click="handleInsert()"
         >
-          <view class="pt40 font40">{{ state.signInType === 0 ? "签到" : "签退" }}</view>
+          <view class="pt40 font40">{{ state.signInType === 1 ? "签到" : "签退" }}</view>
           <view class="mt5">{{ state.operateDate.split(" ")[1] }}</view>
         </view>
         <view class="signIn-address" v-if="state.address">
@@ -46,7 +46,7 @@ const themeColor = computed(() => {
 const state = reactive({
   address: "", //准确位置信息
   deviceCode: uni.getSystemInfoSync().deviceId, //设备编号
-  signInType: 0, //签到类型(0:已签到 1:已签退)
+  signInType: 1, //签到类型(0:已签到 1:已签退)
   operateDate: commonStore.formatterDateTime(new Date()), //操作时间
   operateCode: 0, //操作类型
   longitude: "", //经度
@@ -68,7 +68,7 @@ function handleInsert() {
     remarks: state.remarks,
   }).then((res) => {
     if (res.status == "SUCCESS") {
-      proxy.$modal.msgSuccess(state.signInType === 0 ? "签到成功" : "签退成功");
+      proxy.$modal.msgSuccess(state.signInType === 1 ? "签到成功" : "签退成功");
       getStatusApi(); //调用人员状态查询接口
     }
   });
@@ -91,16 +91,14 @@ function getLocation() {
     type: "gcj02",
     geocode: true,
     highAccuracyExpireTime: 5000,
-    success: function (res) {
+    success: (res) => {
+      console.log(res);
       state.longitude = res.longitude;
       state.latitude = res.latitude;
       state.address = res.address.city + res.address.district + res.address.street + res.address.streetNum + res.address.poiName;
     },
-    fail: function (res) {
-      uni.showToast({
-        title: "请打开手机定位或相关应用权限定位!",
-        icon: "none",
-      });
+    fail: (res) => {
+      console.log(res);
     },
   });
 }

+ 6 - 1
src/pages/mine.vue

@@ -35,6 +35,12 @@
               <view>账号与安全</view>
             </view>
           </view>
+          <view class="list-cell list-cell-arrow" @click="proxy.$settingStore.handleToMessage()">
+            <view class="menu-item">
+              <view class="iconfont ucicon-tongzhi menu-item-icon"></view>
+              <view>新消息通知</view>
+            </view>
+          </view>
           <view class="list-cell list-cell-arrow" @click="proxy.$settingStore.handleAbout()">
             <view class="menu-item">
               <view class="iconfont ucicon-aixin menu-item-icon"></view>
@@ -54,7 +60,6 @@
               <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="handleToUpgrade" v-if="proxy.$common.isVisible()">
             <view class="menu-item">
               <view class="iconfont ucicon-jianchagengxin menu-item-icon"></view>

+ 3 - 4
src/pages/mine/about/index.vue

@@ -8,14 +8,13 @@
       </template>
     </u-navbar>
 
-    <view class="uni-content-header"></view>
-    <view class="header-section text-center">
+    <view class="oa-header-section text-center">
       <image style="width: 150rpx; height: 150rpx" mode="heightFix" :src="useStore.$state.loginLogo" v-if="useStore.$state.loginLogo" />
       <image style="width: 150rpx; height: 150rpx" mode="heightFix" src="@/static/logo200.png" v-else />
       <uni-title type="h2" :title="useStore.$state.loginTitle"></uni-title>
     </view>
 
-    <view class="content-section">
+    <view class="oa-content-section">
       <view class="menu-list">
         <view class="list-cell list-cell-arrow">
           <view class="menu-item">
@@ -84,7 +83,7 @@ onShow(() => {
     color: #999;
   }
 
-  .header-section {
+  .oa-header-section {
     display: flex;
     padding: 30rpx 0 0;
     flex-direction: column;

+ 2 - 2
src/pages/mine/avatar/index.vue

@@ -1,7 +1,7 @@
 <template>
   <view class="avatar-container" :data-theme="'theme-' + proxy.$settingStore.themeColor.name">
-    <view class="uni-content-header"></view>
-    <view class="page-body uni-content-info">
+    <view class="oa-header-section"></view>
+    <view class="oa-content-section page-body">
       <view class="cropper-content">
         <view ref="uniCorpper" v-if="isShowImg" class="uni-corpper" :style="'display: flex;' + 'width:' + cropperInitW + 'px;height:' + cropperInitH + 'px;'">
           <view class="uni-corpper-content" :style="'margin: auto;' + 'width:' + cropperW + 'px;height:' + cropperH + 'px;left:' + cropperL + 'px;top:' + cropperT + 'px'">

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

@@ -8,8 +8,8 @@
       </template>
     </u-navbar>
 
-    <view class="uni-content-header"></view>
-    <view class="uni-content-body">
+    <view class="oa-header-section"></view>
+    <view class="oa-content-section">
       <view class="uni-list" v-for="(item, findex) in list" :key="findex" :title="item.title">
         <view class="uni-list-title">
           <view :class="item.icon"></view>
@@ -71,7 +71,7 @@ onShow(() => {
 
 <style lang="scss" scoped>
 .help-container {
-  .uni-content-body {
+  .oa-content-section {
     padding: 30rpx;
 
     .uni-list {

+ 62 - 0
src/pages/mine/msg/index.vue

@@ -0,0 +1,62 @@
+<template>
+  <view class="msg-container">
+    <view class="oa-header-section">
+      <view class="menu-list mt0 mlr0">
+        <view class="list-cell">
+          <view class="menu-item">
+            <view class="title" style="width: 100%">通知</view>
+            <u-switch v-model="state.switchValue" size="20"></u-switch>
+          </view>
+        </view>
+        <view class="list-cell">
+          <view class="menu-item">
+            <view class="title" style="width: 100%">公告</view>
+            <u-switch v-model="state.switchValue" size="20"></u-switch>
+          </view>
+        </view>
+        <view class="list-cell">
+          <view class="menu-item">
+            <view class="title" style="width: 100%">设备告警</view>
+            <u-switch v-model="state.switchValue" size="20"></u-switch>
+          </view>
+        </view>
+        <view class="list-cell">
+          <view class="menu-item">
+            <view class="title" style="width: 100%">巡检系统</view>
+            <u-switch v-model="state.switchValue" size="20"></u-switch>
+          </view>
+        </view>
+        <view class="list-cell">
+          <view class="menu-item">
+            <view class="title" style="width: 100%">会议系统</view>
+            <u-switch v-model="state.switchValue" size="20"></u-switch>
+          </view>
+        </view>
+      </view>
+    </view>
+  </view>
+</template>
+
+<script setup>
+import config from "@/config";
+import { onReady, onLoad, onShow, onNavigationBarButtonTap } from "@dcloudio/uni-app";
+import { ref, reactive, computed, getCurrentInstance, toRefs, inject } from "vue";
+import { useStores, commonStores } from "@/store/modules/index";
+
+const useStore = useStores();
+const { proxy } = getCurrentInstance();
+
+const state = reactive({
+  switchValue: true,
+});
+
+onShow(() => {
+  //调用系统主题颜色
+  proxy.$settingStore.systemThemeColor([1]);
+});
+</script>
+
+<style lang="scss" scoped>
+.msg-container {
+}
+</style>

+ 7 - 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_qj0jv579lnl.woff2?t=1703828032966') format('woff2'),
-       url('https://at.alicdn.com/t/c/font_3620854_qj0jv579lnl.woff?t=1703828032966') format('woff'),
-       url('https://at.alicdn.com/t/c/font_3620854_qj0jv579lnl.ttf?t=1703828032966') format('truetype');
+  src: url('https://at.alicdn.com/t/c/font_3620854_4sfa1zx2v1n.woff2?t=1713168752839') format('woff2'),
+       url('https://at.alicdn.com/t/c/font_3620854_4sfa1zx2v1n.woff?t=1713168752839') format('woff'),
+       url('https://at.alicdn.com/t/c/font_3620854_4sfa1zx2v1n.ttf?t=1713168752839') format('truetype');
 }
 
 .iconfont {
@@ -13,6 +13,10 @@
   -moz-osx-font-smoothing: grayscale;
 }
 
+.ucicon-tongzhi:before {
+  content: "\e86b";
+}
+
 .ucicon-oa-upgrade:before {
   content: "\e61b";
 }

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


+ 9 - 4
src/store/modules/setting.js

@@ -103,14 +103,12 @@ const settingStore = defineStore("storage-setting", {
                 type: "gcj02",
                 geocode: true,
                 highAccuracyExpireTime: 5000,
-                success: function (res) {
+                success: (res) => {
                     params.longitude = res.longitude.toString();
                     params.latitude = res.latitude.toString();
-
                     baseAppInfoApi(params).then((res) => { })
                 },
-                fail: function (res) {
-                    baseAppInfoApi(params).then((res) => { })
+                fail: (res) => {
                 },
             });
         },
@@ -153,6 +151,13 @@ const settingStore = defineStore("storage-setting", {
             // #endif
         },
 
+        /**
+         * @新消息通知
+         */
+        handleToMessage() {
+            tab.navigateTo("/pages/mine/msg/index");
+        },
+
         /**
          * @账号与安全
          */