用户协议优化

This commit is contained in:
仲么了
2023-09-18 19:23:27 +08:00
parent 5c8b716ef1
commit b3ca6ece1a
12 changed files with 204 additions and 121 deletions

13
App.vue
View File

@@ -10,6 +10,7 @@ export default {
console.log(window) console.log(window)
// this.connect() // this.connect()
console.log('App Launch') console.log('App Launch')
let devCode = uni.getStorageSync('devCode') let devCode = uni.getStorageSync('devCode')
if (!devCode) { if (!devCode) {
uni.getSystemInfo({ uni.getSystemInfo({
@@ -18,18 +19,6 @@ export default {
}, },
}) })
} }
if (!uni.getStorageSync(this.$cacheKey.access_token)) {
uni.reLaunch({
url: '/pages/user/login',
})
}
let userInfo = uni.getStorageSync(this.$cacheKey.userInfo)
if (!userInfo) return
// 查询字典
queryDictDataCache().then((res) => {
uni.setStorageSync(this.$cacheKey.dictData, res.data)
})
}, },
onHide: function () { onHide: function () {
console.log('App Hide') console.log('App Hide')

View File

@@ -1,3 +1,38 @@
{ {
"prompt" : "none" "version": "2",
"prompt": "template",
"title": "服务协议和隐私政策",
"message": "  请你务必审慎阅读、充分理解“服务协议”和“隐私政策”各条款,包括但不限于:为了更好的向你提供服务,我们需要收集你的设备标识、操作日志等信息用于分析、优化应用性能。<br/>  你可阅读<a href=\"\">《服务协议》</a>和<a href=\"\">《隐私政策》</a>了解详细信息。如果你同意,请点击下面按钮开始接受我们的服务。",
"buttonAccept": "同意并接受",
"buttonRefuse": "暂不同意",
"hrefLoader": "system|default",
"backToExit":"false",
"second": {
"title": "确认提示",
"message": "  进入应用前,你需先同意<a href=\"\">《用户协议》</a>和<a href=\"\">《隐私政策》</a>,否则将退出应用。",
"buttonAccept": "同意并继续",
"buttonRefuse": "退出应用"
},
"disagreeMode":{
"support": false,
"loadNativePlugins": false,
"visitorEntry": false,
"showAlways": false
},
"styles": {
"backgroundColor": "#ffffff",
"borderRadius":"5px",
"title": {
"color": "#111"
},
"buttonAccept": {
"color": "#111"
},
"buttonRefuse": {
"color": "#111"
},
"buttonVisitor": {
"color": "#111"
}
}
} }

View File

@@ -1,10 +1,10 @@
import request from './request' import request from './request'
import cache from './cacheKey.js' import cache from './cacheKey.js'
import {getImageUrl} from '@/common/api/basic' import { getImageUrl } from '@/common/api/basic'
import {apiUpdatePush} from '@/common/api/user' import { apiUpdatePush } from '@/common/api/user'
import {queryDictDataCache} from '../api/dictionary.js' import { queryDictDataCache } from '../api/dictionary.js'
import cacheKey from './cacheKey.js' import cacheKey from './cacheKey.js'
import config from "@/common/js/config"; import config from '@/common/js/config'
import jsrsasign from 'jsrsasign' import jsrsasign from 'jsrsasign'
const toast = (title, duration = 1500, call, mask = false, icon = 'none') => { const toast = (title, duration = 1500, call, mask = false, icon = 'none') => {
@@ -268,10 +268,20 @@ const decodeToken = (token) => {
} }
const getDictData = (key) => { const getDictData = (key) => {
let dictData = uni.getStorageSync(cacheKey.dictData) return new Promise((resolve, reject) => {
if (dictData) { let dictData = uni.getStorageSync(cacheKey.dictData)
return dictData.filter((item) => item.code === key)[0]?.children || [] if (dictData) {
} resolve(dictData.filter((item) => item.code === key)[0]?.children || [])
} else {
// 查询字典
queryDictDataCache().then((res) => {
uni.setStorageSync(cacheKey.dictData, res.data)
resolve(res.data.filter((item) => item.code === key)[0]?.children || [])
}).catch(err=>{
reject(err)
})
}
})
} }
export default { export default {
@@ -285,5 +295,5 @@ export default {
prePage, prePage,
loginSuccess, loginSuccess,
refreshPrePage, refreshPrePage,
getDictData getDictData,
} }

View File

@@ -3,7 +3,7 @@
"appid" : "__UNI__88BC25B", "appid" : "__UNI__88BC25B",
"description" : "", "description" : "",
"versionName" : "1.2.8", "versionName" : "1.2.8",
"versionCode" : 128, "versionCode" : 127,
"transformPx" : false, "transformPx" : false,
/* 5+App */ /* 5+App */
"app-plus" : { "app-plus" : {
@@ -106,6 +106,9 @@
"spotlight@3x" : "unpackage/res/icons/120x120.png" "spotlight@3x" : "unpackage/res/icons/120x120.png"
} }
} }
},
"splashscreen" : {
"useOriginalMsgbox" : true
} }
} }
}, },
@@ -131,7 +134,7 @@
"proxy" : { "proxy" : {
"/api" : { "/api" : {
"https" : true, "https" : true,
"target" : "http://192.168.1.115:10215", "target" : "https://pqmcn.com:8092/api",
"changOrigin" : true, "changOrigin" : true,
"pathRewrite" : { "pathRewrite" : {
"/api" : "" "/api" : ""

View File

@@ -488,31 +488,33 @@ export default {
}) })
} }
} }
this.topolodyData = this.$util.getDictData('Line_Position').map((item) => { this.$util.getDictData('Line_Position').then((res) => {
switch (item.name) { this.topolodyData = res.map((item) => {
case '电网侧': switch (item.name) {
item.showKey = ['Apf_ThdA_Sys(%)'] case '电网侧':
break item.showKey = ['Apf_ThdA_Sys(%)']
case '负载侧': break
item.showKey = ['Apf_ThdA_Load(%)'] case '负载侧':
break item.showKey = ['Apf_ThdA_Load(%)']
case '输出侧': break
item.showKey = ['Apf_RmsI_TolOut(A)'] case '输出侧':
break item.showKey = ['Apf_RmsI_TolOut(A)']
case 'PCC公共点': break
item.showKey = [] case 'PCC公共点':
break item.showKey = []
default: break
break default:
} break
return { }
label: item.name, return {
linePostion: item.id, label: item.name,
lat: '', linePostion: item.id,
lng: '', lat: '',
showKey: item.showKey, //要展示的指标key lng: '',
value: [], showKey: item.showKey, //要展示的指标key
} value: [],
}
})
}) })
this.init() this.init()
}, },

View File

@@ -15,26 +15,25 @@
<text style="font-size: 32rpx; font-weight: 500">灿能物联</text> <text style="font-size: 32rpx; font-weight: 500">灿能物联</text>
</template> </template>
<template slot="right"> <template slot="right">
<text class="hide-txt mr5" style="font-size: 28rpx">{{ <text class="hide-txt mr5" style="font-size: 28rpx"
select.engineeringName || emptyEngineeringName >{{ select.engineeringName || emptyEngineeringName }}
}}
</text> </text>
<uni-icons type="bottom" size="16" color="#111" v-if="select.engineeringName"></uni-icons> <uni-icons type="bottom" size="16" color="#111" v-if="select.engineeringName"></uni-icons>
</template> </template>
</uni-nav-bar> </uni-nav-bar>
<view class="index"> <view class="index">
<!-- 运维 --> <!-- 运维 -->
<YunWei :devCount="devCount" v-if="userInfo.authorities === 'operation_manager'"/> <YunWei :devCount="devCount" v-if="userInfo.authorities === 'operation_manager'" />
<!-- 专职 --> <!-- 专职 -->
<ZhuanZhi :devCount="devCount" v-if="userInfo.authorities === 'market_user'"/> <ZhuanZhi :devCount="devCount" v-if="userInfo.authorities === 'market_user'" />
<!-- 工程 --> <!-- 工程 -->
<GongCheng :devCount="devCount" v-if="userInfo.authorities === 'engineering_user'"/> <GongCheng :devCount="devCount" v-if="userInfo.authorities === 'engineering_user'" />
<!-- 主用户 --> <!-- 主用户 -->
<ZhuYongHu :devCount="devCount" v-if="userInfo.authorities === 'app_vip_user'"/> <ZhuYongHu :devCount="devCount" v-if="userInfo.authorities === 'app_vip_user'" />
<YouKe :devCount="devCount" v-if="userInfo.authorities === 'tourist'"></YouKe> <YouKe :devCount="devCount" v-if="userInfo.authorities === 'tourist'"></YouKe>
<template v-if="engineeringList.length"> <template v-if="engineeringList.length">
<view class="canneng-index-title mt20">设备列表</view> <view class="canneng-index-title mt20">设备列表</view>
<Device ref="device" :store="store"/> <Device ref="device" :store="store" />
</template> </template>
</view> </view>
</view> </view>
@@ -48,8 +47,8 @@ import ZhuanZhi from './comp/indexZhuanZhi.vue'
import YouKe from './comp/indexYouKe.vue' import YouKe from './comp/indexYouKe.vue'
import Device from './comp/device.vue' import Device from './comp/device.vue'
import list from '../../common/js/list' import list from '../../common/js/list'
import {getDevCount} from '../../common/api/device.js' import { getDevCount } from '../../common/api/device.js'
import {queryEngineering} from '@/common/api/engineering.js' import { queryEngineering } from '@/common/api/engineering.js'
export default { export default {
mixins: [list], mixins: [list],
@@ -71,7 +70,7 @@ export default {
engineeringId: '', engineeringId: '',
}, },
engineeringList: [], engineeringList: [],
navTabHeight: 0 navTabHeight: 0,
} }
}, },
computed: { computed: {
@@ -83,7 +82,7 @@ export default {
} else { } else {
return '创建工程' return '创建工程'
} }
} },
}, },
methods: { methods: {
selectEngineering() { selectEngineering() {
@@ -153,19 +152,27 @@ export default {
item.runStatus = 1 item.runStatus = 1
}) })
this.devCount.engineeringListLength = this.engineeringList.length this.devCount.engineeringListLength = this.engineeringList.length
console.log(this.devCount); console.log(this.devCount)
}) })
}, },
}, },
onLoad() { onLoad() {
if (!uni.getStorageSync(this.$cacheKey.access_token)) {
uni.reLaunch({
url: '/pages/user/login',
})
}
this.store = this.DataSource('/cs-device-boot/EquipmentDelivery/queryEquipmentByProject') this.store = this.DataSource('/cs-device-boot/EquipmentDelivery/queryEquipmentByProject')
// #ifdef APP-PLUS // #ifdef APP-PLUS
setTimeout(() => { setTimeout(() => {
// 获取nav高度 // 获取nav高度
uni.createSelectorQuery().select('.uni-navbar').boundingClientRect((rect) => { uni.createSelectorQuery()
this.navTabHeight = rect.height .select('.uni-navbar')
console.log('calc(100vh - ' + this.navTabHeight + ')') .boundingClientRect((rect) => {
}).exec() this.navTabHeight = rect.height
console.log('calc(100vh - ' + this.navTabHeight + ')')
})
.exec()
}, 1000) }, 1000)
// #endif // #endif
}, },
@@ -174,7 +181,7 @@ export default {
let access_token = uni.getStorageSync(this.$cacheKey.access_token) let access_token = uni.getStorageSync(this.$cacheKey.access_token)
if (!access_token) { if (!access_token) {
uni.reLaunch({ uni.reLaunch({
url: `/pages/user/login` url: `/pages/user/login`,
}) })
} else { } else {
if ( if (
@@ -189,7 +196,6 @@ export default {
} }
this.init() this.init()
} }
}, },
} }
</script> </script>

View File

@@ -26,8 +26,8 @@ export default {
this.init() this.init()
}, },
methods: { methods: {
init() { async init() {
let dictData = this.$util.getDictData('app_event') let dictData = await this.$util.getDictData('app_event')
console.log(dictData) console.log(dictData)
this.store = this.DataSource('/cs-harmonic-boot/event/queryEventList') this.store = this.DataSource('/cs-harmonic-boot/event/queryEventList')
this.store.params.type = 3 this.store.params.type = 3

View File

@@ -26,8 +26,8 @@ export default {
this.init() this.init()
}, },
methods: { methods: {
init() { async init() {
let dictData = this.$util.getDictData('app_event') let dictData = await this.$util.getDictData('app_event')
console.log(dictData) console.log(dictData)
this.store = this.DataSource('/cs-harmonic-boot/event/queryEventList') this.store = this.DataSource('/cs-harmonic-boot/event/queryEventList')
this.store.params.type = 2 this.store.params.type = 2

View File

@@ -1,17 +1,60 @@
<template> <template>
<view class="content"> <view class="content">
<uni-list :border="false"> <uni-list :border="false">
<uni-list-item show-badge badgeType="error" isDot badge-text="未读" title="发生稳态越限监测点10个" note="2023-02-03" clickable @click="jump" /> <uni-list-item
<uni-list-item show-badge badgeType="error" isDot badge-text="未读" title="发生稳态越限监测点10个" note="2023-02-02" clickable @click="jump" /> show-badge
<uni-list-item show-badge badgeType="error" isDot badge-text="未读" title="发生稳态越限监测点10个" note="2023-02-01" clickable @click="jump" /> badgeType="error"
<uni-list-item badgeType="error" isDot badge-text="未读" title="发生稳态越限监测点10个" note="2023-01-31" clickable @click="jump" /> isDot
<uni-list-item badgeType="error" isDot badge-text="未读" title="发生稳态越限监测点10个" note="2023-01-30" clickable @click="jump" /> badge-text="未读"
title="发生稳态越限监测点10个"
note="2023-02-03"
clickable
@click="jump"
/>
<uni-list-item
show-badge
badgeType="error"
isDot
badge-text="未读"
title="发生稳态越限监测点10个"
note="2023-02-02"
clickable
@click="jump"
/>
<uni-list-item
show-badge
badgeType="error"
isDot
badge-text="未读"
title="发生稳态越限监测点10个"
note="2023-02-01"
clickable
@click="jump"
/>
<uni-list-item
badgeType="error"
isDot
badge-text="未读"
title="发生稳态越限监测点10个"
note="2023-01-31"
clickable
@click="jump"
/>
<uni-list-item
badgeType="error"
isDot
badge-text="未读"
title="发生稳态越限监测点10个"
note="2023-01-30"
clickable
@click="jump"
/>
</uni-list> </uni-list>
<uni-load-more status="nomore"></uni-load-more> <uni-load-more status="nomore"></uni-load-more>
</view> </view>
</template> </template>
<script> <script>
import list from "@/common/js/list"; import list from '@/common/js/list'
export default { export default {
mixins: [list], mixins: [list],
@@ -24,14 +67,14 @@ export default {
this.init() this.init()
}, },
methods: { methods: {
init() { async init() {
let dictData = this.$util.getDictData('app_event') let dictData = await this.$util.getDictData('app_event')
console.log(dictData) console.log(dictData)
this.store = this.DataSource('/cs-harmonic-boot/event/queryEventList') this.store = this.DataSource('/cs-harmonic-boot/event/queryEventList')
this.store.params.type = 1 this.store.params.type = 1
this.store.firstCallBack = (res) => { this.store.firstCallBack = (res) => {
this.store.data.forEach(item => { this.store.data.forEach((item) => {
item.title = item.equipmentName + dictData.find(item2 => item2.code === item.tag).name item.title = item.equipmentName + dictData.find((item2) => item2.code === item.tag).name
}) })
console.log(this.store.data) console.log(this.store.data)
this.loading = false this.loading = false
@@ -39,10 +82,10 @@ export default {
this.store.reload() this.store.reload()
}, },
jump(item) { jump(item) {
let str = JSON.stringify(item).replace(/%/g,'百分比') let str = JSON.stringify(item).replace(/%/g, '百分比')
uni.navigateTo({url: '/pages/message/transientDetail?detail=' + encodeURIComponent(str)}) uni.navigateTo({ url: '/pages/message/transientDetail?detail=' + encodeURIComponent(str) })
}, },
} },
} }
</script> </script>
@@ -51,7 +94,6 @@ export default {
padding-top: 20rpx; padding-top: 20rpx;
} }
/deep/ .uni-list-item { /deep/ .uni-list-item {
background-color: $uni-theme-white !important; background-color: $uni-theme-white !important;
} }

View File

@@ -1,14 +1,19 @@
<template> <template>
<Cn-page :loading="loading"> <Cn-page :loading="loading">
<view class="content" slot="body"> <view class="content" slot="body">
<uni-card :title="item.title" :extra="item.status === '1'?'':'未读'" :sub-title="item.startTime" <uni-card
@click="jump(item)" :title="item.title"
v-for="(item,index) in store.data" :key="index"> :extra="item.status === '1' ? '' : '未读'"
:sub-title="item.startTime"
@click="jump(item)"
v-for="(item, index) in store.data"
:key="index"
>
<view class="term-list-bottom"> <view class="term-list-bottom">
<view class="term-list-bottom-item"> <view class="term-list-bottom-item">
{{ item.engineeringName + '' + item.projectName }} {{ item.engineeringName + '' + item.projectName }}
</view> </view>
<view class="term-list-bottom-item" v-for="(item2,textIndex) in item.dataSet" :key="textIndex"> <view class="term-list-bottom-item" v-for="(item2, textIndex) in item.dataSet" :key="textIndex">
{{ item2.showName + ':' + item2.value + (item2.unit || '') }} {{ item2.showName + ':' + item2.value + (item2.unit || '') }}
</view> </view>
</view> </view>
@@ -17,11 +22,10 @@
<uni-load-more v-if="store.data && store.data.length > 0" :status="store.status"></uni-load-more> <uni-load-more v-if="store.data && store.data.length > 0" :status="store.status"></uni-load-more>
</view> </view>
</Cn-page> </Cn-page>
</template> </template>
<script> <script>
import list from "@/common/js/list"; import list from '@/common/js/list'
export default { export default {
mixins: [list], mixins: [list],
@@ -34,14 +38,14 @@ export default {
this.init() this.init()
}, },
methods: { methods: {
init() { async init() {
let dictData = this.$util.getDictData('app_event') let dictData = await this.$util.getDictData('app_event')
console.log(dictData) console.log(dictData)
this.store = this.DataSource('/cs-harmonic-boot/event/queryEventList') this.store = this.DataSource('/cs-harmonic-boot/event/queryEventList')
this.store.params.type = 0 this.store.params.type = 0
this.store.firstCallBack = (res) => { this.store.firstCallBack = (res) => {
this.store.data.forEach(item => { this.store.data.forEach((item) => {
item.title = item.equipmentName + dictData.find(item2 => item2.code === item.tag).name item.title = item.equipmentName + dictData.find((item2) => item2.code === item.tag).name
}) })
console.log(this.store.data) console.log(this.store.data)
this.loading = false this.loading = false
@@ -49,10 +53,10 @@ export default {
this.store.reload() this.store.reload()
}, },
jump(item) { jump(item) {
let str = JSON.stringify(item).replace(/%/g,'百分比') let str = JSON.stringify(item).replace(/%/g, '百分比')
uni.navigateTo({url: '/pages/message/transientDetail?detail=' + encodeURIComponent(str)}) uni.navigateTo({ url: '/pages/message/transientDetail?detail=' + encodeURIComponent(str) })
}, },
} },
} }
</script> </script>

View File

@@ -21,17 +21,13 @@ export default {
} }
}, },
methods: {}, methods: {},
created() { async onLoad() {
let dictData = uni.getStorageSync(this.$cacheKey.dictData) let dictData = await this.$util.getDictData('appInformationType')
dictData.forEach((item) => { dictData.forEach((item2) => {
if (item.code === 'appInformationType') { if (item2.code === 'User_Agreement') {
item.children.forEach((item2) => { queryAppInfoByType(item2.id).then((res) => {
if (item2.code === 'User_Agreement') { this.value = res.data.content
queryAppInfoByType(item2.id).then((res) => { this.loading = false
this.value = res.data.content
this.loading = false
})
}
}) })
} }
}) })

View File

@@ -21,17 +21,13 @@ export default {
} }
}, },
methods: {}, methods: {},
created() { async onLoad() {
let dictData = uni.getStorageSync(this.$cacheKey.dictData) let dictData = await this.$util.getDictData('appInformationType')
dictData.forEach((item) => { dictData.forEach((item2) => {
if (item.code === 'appInformationType') { if (item2.code === 'Personal_Infor_Protect') {
item.children.forEach((item2) => { queryAppInfoByType(item2.id).then((res) => {
if (item2.code === 'Personal_Infor_Protect') { this.value = res.data.content
queryAppInfoByType(item2.id).then((res) => { this.loading = false
this.value = res.data.content
this.loading = false
})
}
}) })
} }
}) })