APPbug反馈修改

This commit is contained in:
仲么了
2023-08-10 09:18:17 +08:00
parent 192bd44c7a
commit f395da8f93
48 changed files with 1420 additions and 480 deletions

View File

@@ -137,9 +137,9 @@ export default {
{
text: '功率',
},
{
text: '波形',
},
// {
// text: '波形',
// },
{
text: 'I/O',
},
@@ -238,56 +238,29 @@ export default {
uni.pageScrollTo({ scrollTop: 0, duration: 0 })
},
init() {
switch (this.userInfo.authorities) {
case 1:
this.content.splice(0, 1)
this.content.splice(
0,
0,
{
iconPath: '/static/version.png',
text: '版本',
},
{
iconPath: '/static/template.png',
text: '模版',
},
)
break
case 2:
this.content.splice(0, 1)
break
case 4:
this.content.splice(
1,
0,
{
iconPath: '/static/delate.png',
text: '报表',
},
{
iconPath: '/static/feedback.png',
text: '反馈',
},
)
break
case 5:
this.content.splice(
2,
0,
{
iconPath: '/static/table.png',
text: '报表',
},
{
iconPath: '/static/feedback.png',
text: '反馈',
},
)
break
default:
break
if (this.isPrimaryUser == 1) {
this.content.splice(
0,
0,
{
iconPath: '/static/transfer.png',
text: '移交',
},
{
iconPath: '/static/feedback.png',
text: '编辑',
},
{
iconPath: '/static/delate.png',
text: '删除',
},
)
if (this.userInfo.authorities === 'app_vip_user') {
this.content.splice(3, 0, {
iconPath: '/static/share.png',
text: '分享',
})
}
}
},
renderFinish(e) {
@@ -387,26 +360,7 @@ export default {
this.devId = options.id
this.isPrimaryUser = options.isPrimaryUser
if (this.isPrimaryUser == 1) {
this.content.splice(0, 0, {
iconPath: '/static/delate.png',
text: '删除',
})
this.content.splice(0, 0, {
iconPath: '/static/feedback.png',
text: '编辑',
})
this.content.splice(0, 0, {
iconPath: '/static/transfer.png',
text: '移交',
})
if (this.userInfo.authorities !== 'engineering_user') {
this.content.splice(0, 0, {
iconPath: '/static/share.png',
text: '分享',
})
}
}
this.init()
queryTopologyDiagram(options.id).then((res) => {
this.deviceInfo = res.data

View File

@@ -5,7 +5,7 @@
<Cn-empty v-if="projectList.length == 0"></Cn-empty>
<template v-else>
<uni-card
:title="item.equipmentName"
:title="item.name"
:sub-title="item.projectName"
:extra="item.projectType"
padding="0"
@@ -76,6 +76,7 @@ export default {
</script>
<style lang="scss">
.device-list {
padding-top: 20rpx;
.header {
position: sticky;
top: 0;

View File

@@ -93,14 +93,14 @@ export default {
// },
],
content: [
{
iconPath: '/static/share.png',
text: '编辑',
},
{
iconPath: '/static/delate.png',
text: '删除',
},
// {
// iconPath: '/static/share.png',
// text: '编辑',
// },
// {
// iconPath: '/static/delate.png',
// text: '删除',
// },
],
navHeight: 0,
navMenuActive: 0,
@@ -177,16 +177,17 @@ export default {
onLoad(option) {
this.engineering = JSON.parse(decodeURIComponent(option.engineering))
let userInfo = uni.getStorageSync('userInfo')
if (userInfo.authorities == '3') {
this.content.push({
iconPath: '/static/transfer.png',
text: '移交',
})
} else if (userInfo.authorities == '4') {
this.content.push({
iconPath: '/static/share.png',
text: '分享',
})
if (userInfo.authorities == 'engineering_user' || userInfo.authorities == 'app_vip_user') {
this.content.push(
{
iconPath: '/static/share.png',
text: '编辑',
},
{
iconPath: '/static/delate.png',
text: '删除',
},
)
}
setTimeout(() => {
// 获取nav高度

View File

@@ -6,7 +6,11 @@
:fixed="true"
status-bar
left-icon="left"
:rightIcon="userInfo.authorities == '2' ? '' : 'plusempty'"
:rightIcon="
userInfo.authorities === 'app_vip_user' || userInfo.authorities === 'engineering_user'
? 'plusempty'
: ''
"
background-color="#fff"
color="#111"
title="工程管理"
@@ -50,17 +54,17 @@ export default {
},
methods: {
init() {
this.userInfo = uni.getStorageSync(this.$cacheKey.userInfo)
this.store = this.DataSource('/cs-device-boot/engineering/queryEngineeringPage')
this.store.params.userId = uni.getStorageSync('userInfo').id
this.store.reload()
this.store.firstCallBack = (res) => {
let engineering = uni.getStorageSync('engineering')
if (!engineering) {
uni.setStorageSync('engineering',this.store.data[0])
}else{
uni.setStorageSync('engineering', this.store.data[0])
} else {
this.store.data.forEach((item) => {
if (item.id == engineering.id) {
uni.setStorageSync('engineering',item)
uni.setStorageSync('engineering', item)
}
})
}

View File

@@ -3,6 +3,7 @@
<view slot="body">
<view class="new">
<view class="content">
<page-meta :page-style="'overflow:'+(show?'hidden':'visible')"></page-meta>
<uni-forms :label-width="80">
<uni-forms-item label="工程名称">
<uni-easyinput type="text" v-model="formData.name" placeholder="请输入工程名称" />
@@ -14,7 +15,7 @@
<uni-icons type="location" color="#007aff" size="26" class="ml20"
@click="chooseLocation"></uni-icons>
</view> -->
<uni-data-picker :localdata="localdata" @change="areaChange" v-model="value">
<uni-data-picker :localdata="localdata" @change="areaChange" v-model="value" @popupopened="show=true" @popupclosed="show=false">
</uni-data-picker>
</uni-forms-item>
<uni-forms-item label="描述">
@@ -50,6 +51,7 @@ export default {
province: '',
},
engineering: {},
show: false,
}
},
onLoad(options) {

View File

@@ -0,0 +1,201 @@
<template>
<view :loading="loading">
<uni-search-bar v-model="keyWord" bgColor="#fff" placeholder="请输入关键词"></uni-search-bar>
<view class="message">
<!-- <uni-card
:title="item.engineerName"
:extra="item.projectType"
@click="jump(item)"
v-for="(item, index) in list"
:key="index"
>
<view class="term-list-bottom">
<view class="term-list-bottom-item">
<view>区域</view>
<view>{{ item.provinceName + item.cityName }}</view>
</view>
<view class="term-list-bottom-item">
<view>创建时间</view>
<view>{{ item.createTime }}</view>
</view>
</view>
</uni-card> -->
<uni-list>
<uni-list-item @click="jump(item)" v-for="(item, index) in filterList" :key="index">
<template v-slot:header>
<view class="slot-box">
<view class="slot-box-left hide-txt mr20">{{ item.engineerName }}</view>
<switch
:checked="selectList.indexOf(item.engineerId) > -1"
style="transform: scale(0.8)"
@change="switchChange(item)"
/>
</view>
</template>
</uni-list-item>
</uni-list>
<uni-load-more v-if="list && list.length > 0" status="nomore"></uni-load-more>
<Cn-empty v-else style="padding-top: 300rpx"></Cn-empty>
</view>
</view>
</template>
<script>
import list from '../../common/js/list'
import { queryAllEnginner, csMarketDataAdd } from '@/common/api/engineering'
export default {
data() {
return {
loading: true,
userInfo: {},
list: [],
selectList: [],
keyWord: '',
}
},
computed: {
filterList() {
return this.list.filter((item) => {
return item.engineerName.indexOf(this.keyWord) > -1
})
},
},
methods: {
switchChange(e) {
console.log(e)
let index = this.selectList.indexOf(e.engineerId)
if (index > -1) {
this.selectList.splice(index, 1)
} else {
this.selectList.push(e.engineerId)
}
csMarketDataAdd({
engineerIds: this.selectList,
}).then((res) => {
console.log(res)
})
},
init() {
this.userInfo = uni.getStorageSync(this.$cacheKey.userInfo)
queryAllEnginner().then((res) => {
this.list = res.data
console.log(this.list)
this.selectList = res.data.filter((item) => item.isSelect === '1').map((item) => item.engineerId)
console.log(this.selectList)
this.loading = false
})
},
back() {
uni.navigateBack()
},
add() {
uni.navigateTo({
url: `/pages/engineering/new`,
})
},
upgrade(code) {
console.log(code)
uni.showToast({
title: '升级成功',
icon: 'none',
})
},
jump(engineering) {
uni.navigateTo({
url: `/pages/engineering/detail?engineering=${encodeURIComponent(JSON.stringify(engineering))}`,
})
},
},
onLoad() {
this.init()
},
}
</script>
<style lang="scss">
.message {
/deep/ .slot-box {
width: 100%;
display: flex;
align-items: center;
&-left {
flex: 1;
margin-right: 20rpx;
}
}
/deep/ .uni-list-item__content {
padding-right: 0;
}
.message-header {
padding: 200rpx 34rpx 34rpx;
display: flex;
align-items: center;
background: $uni-theme-white;
margin-bottom: 20rpx;
box-shadow: 0 4rpx 8rpx #e7e7e74c;
.message-header-head {
margin-right: 30rpx;
height: 128rpx;
width: 128rpx;
border-radius: $uni-theme-radius;
overflow: hidden;
}
.message-header-name {
margin-right: 30rpx;
flex: 1;
font-size: 36rpx;
color: #111;
font-weight: 700;
.tag {
margin-top: 10rpx;
font-size: 24rpx;
color: #aaa;
}
}
}
.message-nav {
padding: 34rpx;
display: flex;
align-items: center;
background: $uni-theme-white;
border-bottom: 1rpx solid #e8e8e8;
&-icon {
margin-right: 30rpx;
height: 44rpx;
width: 44rpx;
border-radius: $uni-theme-radius;
overflow: hidden;
}
&-label {
margin-right: 30rpx;
flex: 1;
font-size: 28rpx;
color: #111;
}
}
}
.term-list-bottom {
.term-list-bottom-item {
font-size: 28rpx;
margin-bottom: 20rpx;
display: flex;
justify-content: space-between;
// view:first-of-type{
// color: #111;
// }
}
.term-list-bottom-item:last-of-type {
margin-bottom: 0;
}
}
</style>

View File

@@ -16,10 +16,30 @@
<uni-icons type="bottom" size="14" color="#666"></uni-icons>
</view>
</picker>
<view style="flex: 1"></view>
<template v-if="deviceListFilter.length">
<template v-if="transfer || share">
<view class="nav-menu nav-menu-btn" @click="submit">完成 </view>
</template>
<template v-else>
<view
class="nav-menu nav-menu-btn"
@click="transfer = true"
v-if="userInfo.authorities === 'app_vip_user' || userInfo.authorities === 'engineering_user'"
>移交
</view>
<view
class="nav-menu nav-menu-btn"
@click="share = true"
v-if="userInfo.authorities === 'app_vip_user'"
>分享
</view>
</template>
</template>
<!-- <picker @change="projectTypeChange" :value="select.projectTypeIndex" :range="projectType" range-key="text">
<view class="nav-menu" :class="{ 'nav-menu-active': select.projectType }"
>{{ select.projectType || '类型' }}
</view>
</view>
</picker> -->
</view>
<view class="content device" :style="{ minHeight: minHeight }">
@@ -31,15 +51,25 @@
v-for="(item, index) in deviceListFilter"
:key="index"
@click="jump(item)"
thumbnail="/static/device.png"
:thumbnail="deviceIcon(item.runStatus)"
>
<!-- <text>{{ item.project }} {{ item.type }}</text> -->
<template v-slot:title v-if="transfer || share">
<view class="switch-title">
<view class="switch-title-left">{{ item.equipmentName }}</view>
<switch
:checked="checkList.indexOf(item.equipmentId) > -1"
style="transform: scale(0.8)"
@change="switchChange(item)"
/>
</view>
</template>
</uni-card>
<Cn-empty v-if="store.empty || deviceListFilter.length == 0"></Cn-empty>
<uni-load-more
v-if="deviceListFilter && deviceListFilter.length > 0"
v-if="store.status == 'loading' || deviceListFilter.length > 0"
:status="store.status"
></uni-load-more>
<Cn-empty v-else></Cn-empty>
</view>
</view>
</template>
@@ -56,6 +86,9 @@ export default {
data() {
return {
loading: false,
transfer: false,
share: false,
checkList: [],
select: {
projectName: '',
projectNameIndex: 0,
@@ -67,6 +100,7 @@ export default {
projectList: [],
projectType: [],
navHeight: 0,
userInfo: {},
}
},
computed: {
@@ -84,39 +118,66 @@ export default {
})
},
},
mounted() {
setTimeout(() => {
// 获取nav高度
uni.createSelectorQuery()
.select('.uni-navbar')
.boundingClientRect((rect1) => {
this.navHeight = rect1.height
// 获取nav高度
uni.createSelectorQuery()
.select('.nav')
.boundingClientRect((rect2) => {
// #ifdef H5
this.minHeight =
'calc(100vh - env(safe-area-inset-bottom) - ' +
(50 + (rect2.height + rect1.height)) +
'px)'
// #endif
// #ifdef APP-PLUS
this.minHeight = 'calc(100vh - ' + (rect2.height + rect1.height) + 'px)'
// #endif
})
.exec()
})
.exec()
}, 1000)
created() {
this.userInfo = uni.getStorageSync(this.$cacheKey.userInfo)
},
methods: {
deviceIcon(e) {
let str = ''
switch (e) {
case 1:
str = '/static/device_bad.png'
break
case 2:
str = '/static/device.png'
break
default:
str = '/static/device.png'
break
}
return str
},
switchChange(e) {
console.log(e)
let index = this.checkList.indexOf(e.equipmentId)
if (index > -1) {
this.checkList.splice(index, 1)
} else {
this.checkList.push(e.equipmentId)
}
},
submit() {
console.log(this.checkList)
if (this.transfer) {
this.transfer = false
uni.navigateTo({ url: '/pages/device/transfer?id=' + this.checkList.join(',') })
} else if (this.share) {
this.share = false
this.$emit('share', this.shareList)
}
this.checkList = []
},
async init() {
this.getProjectList()
this.getDeviceList()
},
getDeviceList() {
this.store.params.pageSize = 999
this.store.firstCallBack = () => {
// 获取nav高度
uni.createSelectorQuery()
.select('.nav')
.boundingClientRect((rect2) => {
if (!rect2) return
// #ifdef H5
this.minHeight = 'calc(100vh - env(safe-area-inset-bottom) - ' + (50 + rect2.height) + 'px)'
// #endif
// #ifdef APP-PLUS
this.minHeight = 'calc(100vh - ' + rect2.height + 'px)'
// #endif
})
.exec()
}
this.store.reload()
},
getProjectList() {
@@ -214,4 +275,14 @@ export default {
},
}
</script>
<style lang="scss"></style>
<style lang="scss">
/deep/ .switch-title {
display: flex;
align-items: center;
padding: 20rpx 0;
&-left {
flex: 1;
margin-right: 10px;
}
}
</style>

View File

@@ -1,21 +1,40 @@
<template>
<view class="index-zhuyonghu">
<div class="header">
<div class="header-item">
<div class="header-item-value">{{ devCount.onLineCount || 0 }}</div>
<div class="header-item-label">正常设备</div>
</div>
<div class="header-item" @click="jump('alarmLineDevs')">
<div class="header-item-value">{{ devCount.alarmLineCount || 0 }}</div>
<div class="header-item-label">报警设备</div>
</div>
<div class="header-item" @click="jump('offLineDevs')">
<div class="header-item-value">{{ devCount.offLineCount || 0 }}</div>
<div class="header-item-label">离线设备</div>
</div>
</div>
<view class="canneng-index-title mb20">所有工程统计信息</view>
<view class="header">
<view class="header-item">
<view class="header-item-value">{{ devCount.onLineDevCount + devCount.offLineDevCount || 0 }}</view>
<view class="header-item-label">设备总数</view>
</view>
<view class="header-item" @click="jump('onLineDevs')">
<view class="header-item-value">{{ devCount.onLineDevCount || 0 }}</view>
<view class="header-item-label">在线设备</view>
</view>
<view class="header-item" @click="jump('offLineDevs')">
<view class="header-item-value">{{ devCount.offLineDevCount || 0 }}</view>
<view class="header-item-label">离线设备</view>
</view>
</view>
<view class="canneng-index-title mb20 mt20">当前工程统计信息</view>
<view class="header">
<view class="header-item">
<view class="header-item-value">{{
devCount.currentOnLineDevCount + devCount.currentOffLineDevCount || 0
}}</view>
<view class="header-item-label">设备总数</view>
</view>
<view class="header-item" @click="jump('currentOnLineDevs')">
<view class="header-item-value">{{ devCount.currentOnLineDevCount || 0 }}</view>
<view class="header-item-label">在线设备</view>
</view>
<view class="header-item" @click="jump('currentOffLineDevs')">
<view class="header-item-value">{{ devCount.currentOffLineDevCount || 0 }}</view>
<view class="header-item-label">离线设备</view>
</view>
</view>
<view class="canneng-index-title mt20">常用功能</view>
<view style="padding: 20rpx 20rpx 0">
<Cn-grid title="常用功能">
<Cn-grid title="">
<Cn-grid-item src="/static/device2.png" text="设备注册" @click="registerDevice"></Cn-grid-item>
<!-- <Cn-grid-item src="/static/gateway2.png" text="网关注册" @click="registerGateway"></Cn-grid-item> -->
<Cn-grid-item src="/static/feedback2.png" text="提交反馈" @click="submitFeedBack"></Cn-grid-item>
@@ -67,22 +86,14 @@ export default {
},
jump(type) {
switch (type) {
case 'alarmLineDevs':
uni.navigateTo({
url:
'/pages/device/list?type=alarmLineDevs&projectList=' +
encodeURIComponent(JSON.stringify(this.devCount.alarmLineDevs)),
})
break
case 'offLineDevs':
uni.navigateTo({
url:
'/pages/device/list?type=offLineDevs&projectList=' +
encodeURIComponent(JSON.stringify(this.devCount.offLineDevs)),
})
break
default:
uni.navigateTo({
url:
'/pages/device/list?type=' +
type +
'&projectList=' +
encodeURIComponent(JSON.stringify(this.devCount[type])),
})
break
}
},

View File

@@ -1,19 +1,37 @@
<template>
<view class="index-zhuyonghu">
<div class="header">
<div class="header-item">
<div class="header-item-value">{{ devCount.onLineCount || 0 }}</div>
<div class="header-item-label">正常设备</div>
</div>
<div class="header-item" @click="jump('alarmLineDevs')">
<div class="header-item-value">{{ devCount.alarmLineCount || 0 }}</div>
<div class="header-item-label">报警设备</div>
</div>
<div class="header-item" @click="jump('offLineDevs')">
<div class="header-item-value">{{ devCount.offLineCount || 0 }}</div>
<div class="header-item-label">离线设备</div>
</div>
</div>
<view class="canneng-index-title mb20">所有工程统计信息</view>
<view class="header">
<view class="header-item">
<view class="header-item-value">{{ devCount.onLineDevCount + devCount.offLineDevCount || 0 }}</view>
<view class="header-item-label">设备总数</view>
</view>
<view class="header-item" @click="jump('onLineDevs')">
<view class="header-item-value">{{ devCount.onLineDevCount || 0 }}</view>
<view class="header-item-label">在线设备</view>
</view>
<view class="header-item" @click="jump('offLineDevs')">
<view class="header-item-value">{{ devCount.offLineDevCount || 0 }}</view>
<view class="header-item-label">离线设备</view>
</view>
</view>
<view class="canneng-index-title mb20 mt20">当前工程统计信息</view>
<view class="header">
<view class="header-item">
<view class="header-item-value">{{
devCount.currentOnLineDevCount + devCount.currentOffLineDevCount || 0
}}</view>
<view class="header-item-label">设备总数</view>
</view>
<view class="header-item" @click="jump('currentOnLineDevs')">
<view class="header-item-value">{{ devCount.currentOnLineDevCount || 0 }}</view>
<view class="header-item-label">在线设备</view>
</view>
<view class="header-item" @click="jump('currentOffLineDevs')">
<view class="header-item-value">{{ devCount.currentOffLineDevCount || 0 }}</view>
<view class="header-item-label">离线设备</view>
</view>
</view>
</view>
</template>
<script>
@@ -27,22 +45,14 @@ export default {
methods:{
jump(type) {
switch (type) {
case 'alarmLineDevs':
uni.navigateTo({
url:
'/pages/device/list?type=alarmLineDevs&projectList=' +
encodeURIComponent(JSON.stringify(this.devCount.alarmLineDevs)),
})
break
case 'offLineDevs':
uni.navigateTo({
url:
'/pages/device/list?type=offLineDevs&projectList=' +
encodeURIComponent(JSON.stringify(this.devCount.offLineDevs)),
})
break
default:
uni.navigateTo({
url:
'/pages/device/list?type=' +
type +
'&projectList=' +
encodeURIComponent(JSON.stringify(this.devCount[type])),
})
break
}
},

View File

@@ -1,23 +1,70 @@
<template>
<view class="index-zhuyonghu">
<div class="header">
<div class="header-item">
<div class="header-item-value">{{ devCount.onLineCount || 0 }}</div>
<div class="header-item-label">正常设备</div>
</div>
<div class="header-item" @click="jump('alarmLineDevs')">
<div class="header-item-value">{{ devCount.alarmLineCount || 0 }}</div>
<div class="header-item-label">报警设备</div>
</div>
<div class="header-item" @click="jump('offLineDevs')">
<div class="header-item-value">{{ devCount.offLineCount || 0 }}</div>
<div class="header-item-label">离线设备</div>
</div>
</div>
<view class="index-zhuanzhi">
<view class="canneng-index-title mb20">所有工程统计信息</view>
<view class="header">
<view class="header-item">
<view class="header-item-value">{{ devCount.onLineDevCount + devCount.offLineDevCount || 0 }}</view>
<view class="header-item-label">设备总数</view>
</view>
<view class="header-item" @click="jump('onLineDevs')">
<view class="header-item-value">{{ devCount.onLineDevCount || 0 }}</view>
<view class="header-item-label">在线设备</view>
</view>
<view class="header-item" @click="jump('offLineDevs')">
<view class="header-item-value">{{ devCount.offLineDevCount || 0 }}</view>
<view class="header-item-label">离线设备</view>
</view>
<view class="header-item">
<view class="header-item-value">{{ devCount.alarmCount || 0 }}</view>
<view class="header-item-label">告警数量</view>
</view>
<view class="header-item">
<view class="header-item-value">{{ devCount.eventCount || 0 }}</view>
<view class="header-item-label">事件数量</view>
</view>
<view class="header-item" @click="projectNum">
<view class="header-item-value">{{ devCount.projectCount || 0 }}</view>
<view class="header-item-label">项目个数</view>
</view>
</view>
<view class="canneng-index-title mb20 mt20">当前工程统计信息</view>
<view class="header">
<view class="header-item">
<view class="header-item-value">{{
devCount.currentOnLineDevCount + devCount.currentOffLineDevCount || 0
}}</view>
<view class="header-item-label">设备总数</view>
</view>
<view class="header-item" @click="jump('currentOnLineDevs')">
<view class="header-item-value">{{ devCount.currentOnLineDevCount || 0 }}</view>
<view class="header-item-label">在线设备</view>
</view>
<view class="header-item" @click="jump('currentOffLineDevs')">
<view class="header-item-value">{{ devCount.currentOffLineDevCount || 0 }}</view>
<view class="header-item-label">离线设备</view>
</view>
<view class="header-item">
<view class="header-item-value">{{ devCount.currentAlarmCount || 0 }}</view>
<view class="header-item-label">告警数量</view>
</view>
<view class="header-item">
<view class="header-item-value">{{ devCount.currentEventCount || 0 }}</view>
<view class="header-item-label">事件数量</view>
</view>
<view class="header-item" @click="projectNum">
<view class="header-item-value">{{ devCount.currentProjectCount || 0 }}</view>
<view class="header-item-label">项目个数</view>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
loading: false,
}
},
props: {
devCount: {
type: Object,
@@ -25,28 +72,34 @@ export default {
},
},
methods: {
projectWarning() {
uni.navigateTo({
url: '/pages/zhuanzhi/warning',
})
},
projectNum() {
uni.navigateTo({
url: '/pages/project/list',
})
},
jump(type) {
switch (type) {
case 'alarmLineDevs':
uni.navigateTo({
url:
'/pages/device/list?type=alarmLineDevs&projectList=' +
encodeURIComponent(JSON.stringify(this.devCount.alarmLineDevs)),
})
break
case 'offLineDevs':
uni.navigateTo({
url:
'/pages/device/list?type=offLineDevs&projectList=' +
encodeURIComponent(JSON.stringify(this.devCount.offLineDevs)),
})
break
default:
uni.navigateTo({
url:
'/pages/device/list?type=' +
type +
'&projectList=' +
encodeURIComponent(JSON.stringify(this.devCount[type])),
})
break
}
},
},
created() {},
}
</script>
<style lang="scss"></style>
<style lang="scss">
.index-zhuanzhi {
}
</style>

View File

@@ -1,21 +1,40 @@
<template>
<view class="index-zhuyonghu">
<div class="header">
<div class="header-item">
<div class="header-item-value">{{ devCount.onLineCount || 0 }}</div>
<div class="header-item-label">正常设备</div>
</div>
<div class="header-item" @click="jump('alarmLineDevs')">
<div class="header-item-value">{{ devCount.alarmLineCount || 0 }}</div>
<div class="header-item-label">报警设备</div>
</div>
<div class="header-item" @click="jump('offLineDevs')">
<div class="header-item-value">{{ devCount.offLineCount || 0 }}</div>
<div class="header-item-label">离线设备</div>
</div>
</div>
<view class="canneng-index-title mb20">所有工程统计信息</view>
<view class="header">
<view class="header-item">
<view class="header-item-value">{{ devCount.onLineDevCount + devCount.offLineDevCount || 0 }}</view>
<view class="header-item-label">设备总数</view>
</view>
<view class="header-item" @click="jump('onLineDevs')">
<view class="header-item-value">{{ devCount.onLineDevCount || 0 }}</view>
<view class="header-item-label">在线设备</view>
</view>
<view class="header-item" @click="jump('offLineDevs')">
<view class="header-item-value">{{ devCount.offLineDevCount || 0 }}</view>
<view class="header-item-label">离线设备</view>
</view>
</view>
<view class="canneng-index-title mb20 mt20">当前工程统计信息</view>
<view class="header">
<view class="header-item">
<view class="header-item-value">{{
devCount.currentOnLineDevCount + devCount.currentOffLineDevCount || 0
}}</view>
<view class="header-item-label">设备总数</view>
</view>
<view class="header-item" @click="jump('currentOnLineDevs')">
<view class="header-item-value">{{ devCount.currentOnLineDevCount || 0 }}</view>
<view class="header-item-label">在线设备</view>
</view>
<view class="header-item" @click="jump('currentOffLineDevs')">
<view class="header-item-value">{{ devCount.currentOffLineDevCount || 0 }}</view>
<view class="header-item-label">离线设备</view>
</view>
</view>
<view class="canneng-index-title mt20">常用功能</view>
<view style="padding: 20rpx 20rpx 0">
<Cn-grid title="常用功能">
<Cn-grid title="">
<Cn-grid-item src="/static/device2.png" text="设备注册" @click="registerDevice"></Cn-grid-item>
<!-- <Cn-grid-item src="/static/gateway2.png" text="网关注册" @click="registerGateway"></Cn-grid-item> -->
<Cn-grid-item src="/static/feedback2.png" text="提交反馈" @click="submitFeedBack"></Cn-grid-item>
@@ -67,22 +86,14 @@ export default {
},
jump(type) {
switch (type) {
case 'alarmLineDevs':
uni.navigateTo({
url:
'/pages/device/list?type=alarmLineDevs&projectList=' +
encodeURIComponent(JSON.stringify(this.devCount.alarmLineDevs)),
})
break
case 'offLineDevs':
uni.navigateTo({
url:
'/pages/device/list?type=offLineDevs&projectList=' +
encodeURIComponent(JSON.stringify(this.devCount.offLineDevs)),
})
break
default:
uni.navigateTo({
url:
'/pages/device/list?type=' +
type +
'&projectList=' +
encodeURIComponent(JSON.stringify(this.devCount[type])),
})
break
}
},

View File

@@ -1,67 +1,61 @@
<template>
<view class="index-zhuanzhi">
<view class="canneng-index-title mb20">所有工程统计信息</view>
<div class="header">
<div class="header-item">
<div class="header-item-value">{{ devCount.allDevCount || 0 }}</div>
<div class="header-item-label">设备总数</div>
</div>
<div class="header-item">
<div class="header-item-value">{{ devCount.onLineCount || 0 }}</div>
<div class="header-item-label">正常设备</div>
</div>
<div class="header-item" @click="jump('alarmLineDevs')">
<div class="header-item-value">{{ devCount.alarmLineCount || 0 }}</div>
<div class="header-item-label">报警设备</div>
</div>
<div class="header-item" @click="jump('offLineDevs')">
<div class="header-item-value">{{ devCount.offLineCount || 0 }}</div>
<div class="header-item-label">离线设备</div>
</div>
<div class="header-item">
<div class="header-item-value">{{ devCount.alarmEventCount || 0 }}</div>
<div class="header-item-label">告警数量</div>
</div>
<div class="header-item">
<div class="header-item-value">{{ devCount.eventCount || 0 }}</div>
<div class="header-item-label">事件数量</div>
</div>
<div class="header-item" @click="projectNum">
<div class="header-item-value">{{ devCount.projectCount || 0 }}</div>
<div class="header-item-label">项目个数</div>
</div>
</div>
<view class="header">
<view class="header-item">
<view class="header-item-value">{{ devCount.onLineDevCount + devCount.offLineDevCount || 0 }}</view>
<view class="header-item-label">设备总数</view>
</view>
<view class="header-item" @click="jump('onLineDevs')">
<view class="header-item-value">{{ devCount.onLineDevCount || 0 }}</view>
<view class="header-item-label">在线设备</view>
</view>
<view class="header-item" @click="jump('offLineDevs')">
<view class="header-item-value">{{ devCount.offLineDevCount || 0 }}</view>
<view class="header-item-label">离线设备</view>
</view>
<view class="header-item">
<view class="header-item-value">{{ devCount.alarmCount || 0 }}</view>
<view class="header-item-label">告警数量</view>
</view>
<view class="header-item">
<view class="header-item-value">{{ devCount.eventCount || 0 }}</view>
<view class="header-item-label">事件数量</view>
</view>
<view class="header-item" @click="projectNum">
<view class="header-item-value">{{ devCount.projectCount || 0 }}</view>
<view class="header-item-label">项目个数</view>
</view>
</view>
<view class="canneng-index-title mb20 mt20">当前工程统计信息</view>
<div class="header">
<div class="header-item">
<div class="header-item-value">{{ devCount.allDevCount || 0 }}</div>
<div class="header-item-label">设备总数</div>
</div>
<div class="header-item">
<div class="header-item-value">{{ devCount.onLineCount || 0 }}</div>
<div class="header-item-label">正常设备</div>
</div>
<div class="header-item" @click="jump('alarmLineDevs')">
<div class="header-item-value">{{ devCount.alarmLineCount || 0 }}</div>
<div class="header-item-label">报警设备</div>
</div>
<div class="header-item" @click="jump('offLineDevs')">
<div class="header-item-value">{{ devCount.offLineCount || 0 }}</div>
<div class="header-item-label">离线设备</div>
</div>
<div class="header-item">
<div class="header-item-value">{{ devCount.alarmEventCount || 0 }}</div>
<div class="header-item-label">告警数量</div>
</div>
<div class="header-item">
<div class="header-item-value">{{ devCount.eventCount || 0 }}</div>
<div class="header-item-label">事件数量</div>
</div>
<div class="header-item" @click="projectNum">
<div class="header-item-value">{{ devCount.projectCount || 0 }}</div>
<div class="header-item-label">项目个数</div>
</div>
</div>
<view class="header">
<view class="header-item">
<view class="header-item-value">{{
devCount.currentOnLineDevCount + devCount.currentOffLineDevCount || 0
}}</view>
<view class="header-item-label">设备总数</view>
</view>
<view class="header-item" @click="jump('currentOnLineDevs')">
<view class="header-item-value">{{ devCount.currentOnLineDevCount || 0 }}</view>
<view class="header-item-label">在线设备</view>
</view>
<view class="header-item" @click="jump('currentOffLineDevs')">
<view class="header-item-value">{{ devCount.currentOffLineDevCount || 0 }}</view>
<view class="header-item-label">离线设备</view>
</view>
<view class="header-item">
<view class="header-item-value">{{ devCount.currentAlarmCount || 0 }}</view>
<view class="header-item-label">告警数量</view>
</view>
<view class="header-item">
<view class="header-item-value">{{ devCount.currentEventCount || 0 }}</view>
<view class="header-item-label">事件数量</view>
</view>
<view class="header-item" @click="projectNum">
<view class="header-item-value">{{ devCount.currentProjectCount || 0 }}</view>
<view class="header-item-label">项目个数</view>
</view>
</view>
</view>
</template>
<script>
@@ -90,22 +84,14 @@ export default {
},
jump(type) {
switch (type) {
case 'alarmLineDevs':
uni.navigateTo({
url:
'/pages/device/list?type=alarmLineDevs&projectList=' +
encodeURIComponent(JSON.stringify(this.devCount.alarmLineDevs)),
})
break
case 'offLineDevs':
uni.navigateTo({
url:
'/pages/device/list?type=offLineDevs&projectList=' +
encodeURIComponent(JSON.stringify(this.devCount.offLineDevs)),
})
break
default:
uni.navigateTo({
url:
'/pages/device/list?type=' +
type +
'&projectList=' +
encodeURIComponent(JSON.stringify(this.devCount[type])),
})
break
}
},

View File

@@ -1,7 +1,7 @@
<template>
<Cn-page :loading="loading" noPadding>
<view slot="body" class="canneng-index">
<uni-nav-bar
<!-- <uni-nav-bar
rightWidth="300rpx"
leftWidth="300rpx"
dark
@@ -18,7 +18,7 @@
<text class="hide-txt mr5" style="font-size: 28rpx">{{ select.engineeringName }}</text>
<uni-icons type="bottom" size="16" color="#fff"></uni-icons>
</template>
</uni-nav-bar>
</uni-nav-bar> -->
<view class="index">
<!-- 运维 -->
<YunWei :devCount="devCount" v-if="userInfo.authorities === 'operation_manager'" />
@@ -33,8 +33,6 @@
<Device ref="device" :store="store" />
</view>
<uni-drawer ref="showRight" mode="right" :mask-click="false">
<uni-nav-bar :fixed="true" status-bar title="选择工程" color="#111"> </uni-nav-bar>
<view style="height: 200px"></view>
<view>
<uni-indexed-list
:options="engineeringListFilter"
@@ -78,6 +76,7 @@ export default {
engineeringId: '',
},
engineeringList: [],
drawer: false,
}
},
computed: {
@@ -101,6 +100,16 @@ export default {
},
},
methods: {
onNavigationBarButtonTap(e) {
console.log(e)
// e的返回格式为json对象{"text":"测试","index":0}
this.drawer = !this.drawer
if (this.drawer) {
this.openDrawer()
} else {
this.closeDrawer()
}
},
async init() {
let engineering = uni.getStorageSync('engineering')
let res = await queryEngineering()
@@ -123,12 +132,23 @@ export default {
}
}
this.store.params.engineerId = this.select.engineeringId
// #ifdef APP-PLUS
var webView = this.$mp.page.$getAppWebview()
// 修改buttons
webView.setTitleNViewButtonStyle(0, {
text: this.select.engineeringName,
})
// #endif
getDevCount(this.select.engineeringId).then((res) => {
this.devCount = res.data
})
this.$refs.device && this.$refs.device.init()
},
closeDrawer(e) {
if (!e) {
this.$refs.showRight.close()
return
}
console.log(e)
this.engineeringList.forEach((item) => {
if (item.name === e.item.name) {
@@ -136,10 +156,20 @@ export default {
this.select.engineeringName = item.name
this.select.engineeringId = item.id
this.store.params.engineerId = item.id
// #ifdef APP-PLUS
var webView = this.$mp.page.$getAppWebview()
// 修改buttons
webView.setTitleNViewButtonStyle(0, {
text: this.select.engineeringName,
})
// #endif
}
})
this.$refs.device.select.projectName = ''
this.$refs.device.select.projectNameIndex = 0
getDevCount(this.select.engineeringId).then((res) => {
this.devCount = res.data
})
this.$refs.device.init()
this.$refs.showRight.close()
},

View File

@@ -3,12 +3,12 @@
<view class="message">
<view class="message-nav" @click="jump('system')">
<image mode="aspectFill" class="message-nav-icon" src="/static/message3.png" />
<view class="message-nav-label">系统</view>
<view class="message-nav-label">设备消息</view>
<uni-icons type="forward" color="#aaa" size="20"></uni-icons>
</view>
<view class="message-nav" @click="jump('feedback')" v-if="userInfo.authorities === 'app_vip_user'">
<image mode="aspectFill" class="message-nav-icon" src="/static/feedback.png" />
<view class="message-nav-label">反馈</view>
<view class="message-nav-label">反馈回复</view>
<uni-icons type="forward" color="#aaa" size="20"></uni-icons>
</view>
<view class="message-nav" @click="jump('report')">

View File

@@ -20,30 +20,39 @@
<view class="mine-nav-label">角色升级</view>
<uni-icons type="forward" color="#aaa" size="20"></uni-icons>
</view>
<view class="mine-nav" @click="jump('audit')" v-if="userInfo.authorities === 'app_vip_user'">
<!-- <view class="mine-nav" @click="jump('audit')" v-if="userInfo.authorities === 'app_vip_user'">
<image mode="aspectFill" class="mine-nav-icon" src="/static/server.png" />
<view class="mine-nav-label">角色审核</view>
<uni-icons type="forward" color="#aaa" size="20"></uni-icons>
</view>
</view> -->
<!-- <view class="mine-nav" @click="jump('user')" v-if="userInfo.authorities === 'app_vip_user'">
<image mode="aspectFill" class="mine-nav-icon" src="/static/subordinate.png" />
<view class="mine-nav-label">子用户列表</view>
<uni-icons type="forward" color="#aaa" size="20"></uni-icons>
</view> -->
<view class="mine-nav" @click="jump('scan')">
<view
class="mine-nav"
@click="jump('scan')"
v-if="userInfo.authorities === 'app_vip_user' || userInfo.authorities === 'engineering_user'"
>
<image mode="aspectFill" class="mine-nav-icon" src="/static/scan.png" />
<view class="mine-nav-label">扫一扫</view>
<uni-icons type="forward" color="#aaa" size="20"></uni-icons>
</view>
<view class="mine-nav" @click="jump('engineering')">
<image mode="aspectFill" class="mine-nav-icon" src="/static/project.png" />
<view class="mine-nav-label">工程管理</view>
<view class="mine-nav-label">工程列表</view>
<uni-icons type="forward" color="#aaa" size="20"></uni-icons>
</view>
<view class="mine-nav" @click="jump('engineering/setting')" v-if="userInfo.authorities === 'engineering_user'">
<image mode="aspectFill" class="mine-nav-icon" src="/static/like.png" />
<view class="mine-nav-label">关注工程配置</view>
<uni-icons type="forward" color="#aaa" size="20"></uni-icons>
</view>
<view class="mine-nav" @click="jump('project')">
<image mode="aspectFill" class="mine-nav-icon" src="/static/project.png" />
<view class="mine-nav-label">项目管理</view>
<view class="mine-nav-label">项目列表</view>
<uni-icons type="forward" color="#aaa" size="20"></uni-icons>
</view>
<!-- <view
@@ -145,9 +154,8 @@ export default {
let content = JSON.parse(res.result)
switch (content.type) {
case 'transferDevice':
this.transferDevice(content.id)
this.transferDevice(content.id.split(','))
break
default:
break
}
@@ -182,6 +190,11 @@ export default {
url: `/pages/engineering/list`,
})
break
case 'engineering/setting':
uni.navigateTo({
url: `/pages/engineering/setting`,
})
break
default:
uni.navigateTo({
url: `/pages/mine/${type}`,

View File

@@ -1,25 +1,53 @@
<template>
<Cn-page :loading='loading'>
<view slot='body'>
<view class='index'>
隐私政策
<Cn-page :loading="loading">
<view slot="body">
<view class="html-wrap">
<view v-html="value"></view>
</view>
</view>
</Cn-page>
</template>
<script>
import { queryAppInfoByType } from '@/common/api/mine.js'
export default {
data () {
data() {
return {
loading: false
showFlag: 0,
pageNameFlag: 1,
pageName: '用户协议',
loading: true,
value: '',
}
},
methods: {
}
methods: {},
created() {
let dictData = uni.getStorageSync(this.$cacheKey.dictData)
dictData.forEach((item) => {
if (item.code === 'appInformationType') {
item.children.forEach((item2) => {
if (item2.code === 'Personal_Infor_Protect') {
queryAppInfoByType(item2.id).then((res) => {
this.value = res.data.content
this.loading = false
})
}
})
}
})
},
}
</script>
<style lang='scss'>
.index {
<style lang="scss">
.html-wrap {
width: 750rpx;
box-sizing: border-box;
padding: 20rpx;
font-size: 24rpx;
color: #666;
img {
width: 100%;
}
}
</style>
</style>

View File

@@ -6,7 +6,7 @@
<view class="name">{{ text }}</view>
<view class="btn-wrap">
<navigator open-type="navigateBack" hover-class="none" class="btn"> 返回 </navigator>
<view class="btn ml20" @click="look"> 查看 </view>
<!-- <view class="btn ml20" @click="look"> 查看 </view> -->
</view>
</view>
</view>

View File

@@ -17,6 +17,10 @@
<view class="mine-nav-label">用户协议</view>
<uni-icons type="forward" color="#aaa" size="20"></uni-icons>
</view>
<view class="mine-nav" @click="jump('policy')" >
<view class="mine-nav-label">个人信息保护政策</view>
<uni-icons type="forward" color="#aaa" size="20"></uni-icons>
</view>
<view class="mine-nav" @click="jump('system')">
<view class="mine-nav-label">系统介绍</view>
<uni-icons type="forward" color="#aaa" size="20"></uni-icons>
@@ -72,7 +76,7 @@ export default {
})
break;
case 'layout':
uni.navigateTo({
uni.reLaunch({
url: `/pages/user/login`
})
break;

View File

@@ -1,50 +1,56 @@
<template>
<view :loading="loading">
<view class="mine">
<view class="mine-nav" style="margin-top:20rpx;">
<view class="mine-nav-label">终端消息</view>
<view class="mine-nav" style="margin-top: 20rpx">
<view class="mine-nav-label">稳态越限</view>
<switch color="#376cf3" />
</view>
<view class="mine-nav" style="border-bottom: none; ">
<view class="mine-nav-label">系统消息</view>
<view class="mine-nav" style="border-bottom: none">
<view class="mine-nav-label">暂态事件</view>
<switch color="#376cf3" />
</view>
<view class="mine-nav" style="border-bottom: none">
<view class="mine-nav-label">设备状态</view>
<switch color="#376cf3" />
</view>
<view class="mine-nav" style="border-bottom: none">
<view class="mine-nav-label">设备消息</view>
<switch color="#376cf3" />
</view>
</view>
</view>
</template>
<script>
export default {
data () {
data() {
return {
loading: false
loading: false,
}
},
methods: {
init () {
},
jump (type) {
init() {},
jump(type) {
switch (type) {
case 'changePwd':
uni.navigateTo({
url: `/pages/user/changePwd`
url: `/pages/user/changePwd`,
})
break;
break
case 'changePhone':
uni.navigateTo({
url: `/pages/user/changePhone`
url: `/pages/user/changePhone`,
})
break;
break
default:
uni.navigateTo({
url: `/pages/mine/${type}`
url: `/pages/mine/${type}`,
})
break;
break
}
}
},
},
onLoad () {
onLoad() {
this.init()
},
}
@@ -52,6 +58,11 @@ export default {
<style lang="scss">
.mine {
.title {
padding: 0 20rpx;
font-size: 28rpx;
font-weight: 500;
}
.mine-header {
padding: 200rpx 34rpx 34rpx;
display: flex;
@@ -78,7 +89,7 @@ export default {
}
.mine-nav {
padding: 34rpx;
padding: 34rpx;
display: flex;
align-items: center;
background: $uni-theme-white;
@@ -100,4 +111,4 @@ export default {
}
}
}
</style>
</style>

View File

@@ -89,6 +89,7 @@
vertical="bottom"
:content="content"
@trigger="trigger"
v-if="content.length"
/>
<uni-popup ref="share" type="share" background-color="#fff">
<uni-popup-share title="分享到"></uni-popup-share>
@@ -116,7 +117,7 @@ export default {
text: '设备',
},
{
text: '用户',
text: '用户',
},
{
text: '拓扑图',
@@ -249,24 +250,33 @@ export default {
},
onLoad(option) {
let userInfo = uni.getStorageSync('userInfo')
this.content.push({
iconPath: '/static/share.png',
text: '编辑',
})
this.content.push({
iconPath: '/static/delate.png',
text: '删除',
})
this.content.push({
iconPath: '/static/transfer.png',
text: '移交',
})
this.content.push({
iconPath: '/static/share.png',
text: '分享',
})
if (userInfo.authorities == '3') {
} else if (userInfo.authorities == '4') {
// this.content.push({
// iconPath: '/static/share.png',
// text: '编辑',
// })
// this.content.push({
// iconPath: '/static/delate.png',
// text: '删除',
// })
// this.content.push({
// iconPath: '/static/transfer.png',
// text: '移交',
// })
// this.content.push({
// iconPath: '/static/share.png',
// text: '分享',
// })
if (userInfo.authorities == 'engineering_user' || userInfo.authorities == 'app_vip_user') {
this.content.push(
{
iconPath: '/static/share.png',
text: '编辑',
},
{
iconPath: '/static/delate.png',
text: '删除',
},
)
}
setTimeout(() => {
// 获取nav高度

View File

@@ -6,7 +6,7 @@
:fixed="true"
status-bar
left-icon="left"
:rightIcon="userInfo.authorities == '2' ? '' : 'plusempty'"
:rightIcon="userInfo.authorities === 'app_vip_user' || userInfo.authorities === 'engineering_user' ? 'plusempty' : ''"
background-color="#fff"
color="#111"
title="项目管理"
@@ -44,6 +44,7 @@ export default {
},
methods: {
init() {
this.userInfo = uni.getStorageSync(this.$cacheKey.userInfo)
this.store = this.DataSource('/cs-device-boot/project/queryProject')
this.store.params.engineeringId = uni.getStorageSync('engineering')?.id
this.store.reload()

View File

@@ -8,8 +8,8 @@
<uni-easyinput
v-model="formData.engineeringName"
placeholder="请输入项目名称"
@click.native="showDrawer"
:clearable="false"
disabled
/>
</uni-forms-item>
<uni-forms-item label="项目名称">
@@ -122,8 +122,8 @@ export default {
topoIds: [],
description: '',
name: '',
lat: '2',
lng: '3',
lat: '',
lng: '',
},
engineeringList: [],
tempList: [],
@@ -162,6 +162,10 @@ export default {
this.formData[key] = this.project[key]
}
}
} else {
let engineering = uni.getStorageSync(this.$cacheKey.engineering)
this.formData.engineeringId = engineering.id
this.formData.engineeringName = engineering.name
}
uni.getLocation({
type: 'wgs84',
@@ -229,7 +233,9 @@ export default {
chooseLocation() {
uni.chooseLocation({
success: function (res) {
this.address = res.name
this.formData.area = res.name
this.formData.lat = res.latitudeame
this.formData.lng = res.longitude
console.log('位置名称:' + res.name)
console.log('详细地址:' + res.address)
console.log('纬度:' + res.latitude)
@@ -268,18 +274,24 @@ export default {
let data = JSON.parse(JSON.stringify(this.formData))
delete data.files
let res = {}
console.warn(data, arr)
if (this.project) {
data.id = this.project.id
res = await updateAppProject(data, arr)
} else {
res = await addAppProject(data, arr)
}
console.log(res)
if (res.length === 1) {
this.$util.toast(res[0].message)
return
let result = {}
if (res.code === 'A0000') {
result = res
} else {
console.warn(res)
if (res.length === 1) {
this.$util.toast(res[0].message)
return
}
result = JSON.parse(res[1].data)
}
let result = JSON.parse(res[1].data)
if (result.code === 'A0000') {
if (this.project) {
this.$util.toast('项目修改成功')

View File

@@ -15,7 +15,7 @@
</uni-forms-item>
<uni-forms-item name="code">
<view class="login-box-input">
<uni-easyinput type="number" v-model="formData.code" placeholder="请输入验证码" />
<uni-easyinput type="text" v-model="formData.code" placeholder="请输入验证码" maxlength="6" />
<view
class="ml40"
style="
@@ -48,7 +48,7 @@
</uni-forms-item>
<uni-forms-item name="code">
<view class="login-box-input">
<uni-easyinput type="number" v-model="formData.code2" placeholder="请输入验证码" />
<uni-easyinput type="text" v-model="formData.code2" placeholder="请输入验证码" maxlength="6" />
<view
class="ml40"
style="

View File

@@ -13,7 +13,7 @@
</uni-forms-item>
<uni-forms-item name="code">
<view class="login-box-input">
<uni-easyinput type="number" v-model="formData.code" placeholder="请输入验证码" />
<uni-easyinput type="text" v-model="formData.code" placeholder="请输入验证码" maxlength="6" />
<view
class="ml40"
style="

View File

@@ -2,11 +2,12 @@
<Cn-page :loading="loading">
<view slot="body">
<view class="login">
<view class="login-title">登录</view>
<view class="login-des">灿能物联</view>
<view class="login-title" style="font-size: 36rpx;">欢迎登录</view>
<!-- <view class="login-des">灿能物联</view> -->
<view class="login-box">
<!-- <image class="login-box-logo" mode="widthFix" src="/static/logo.png"></image> -->
<image class="login-box-logo" mode="widthFix" src="/static/logo.png"></image>
<view style="font-size: 40rpx;text-align: center;font-weight: 500;" class="mt20">灿能物联</view>
<template v-if="loginType == 'yzm'">
<view class="login-box-input mt100">
<input
@@ -21,7 +22,7 @@
<view class="login-box-input-img"></view>
</view> -->
<view class="login-box-input mt40">
<input class="login-box-input-main" v-model="yzmForm.code" placeholder="手机验证码" />
<input type="text" class="login-box-input-main" v-model="yzmForm.code" placeholder="手机验证码" maxlength="6" />
<view
class="ml40"
style="font-size: 28rpx; color: #666; width: 200rpx; text-align: center"
@@ -59,13 +60,20 @@
<view @click="loginType = 'pwd'" v-if="loginType == 'yzm'">账号密码登录</view>
<view @click="loginType = 'yzm'" v-else>短信验证码登录</view>
<view style="flex: 1"></view>
<navigator url="/pages/user/forget" hover-class="none">忘记密码</navigator>
<view style="margin: 0 10px; color: #999">|</view>
<template v-if="loginType === 'pwd'">
<navigator url="/pages/user/forget" hover-class="none">忘记密码</navigator>
<view style="margin: 0 10px; color: #999">|</view>
</template>
<navigator url="/pages/user/register" hover-class="none">快速注册</navigator>
</view>
<view class="login-box-tips">
<view style="color: #999"
><checkbox :checked="checkbox" @click="checkbox = !checkbox" /> 我已阅读并同意</view
><checkbox
style="transform: scale(0.7)"
:checked="checkbox"
@click="checkbox = !checkbox"
/>
我已阅读并同意</view
>
<navigator url="/pages/mine/agreement" hover-class="none">用户协议</navigator>
<navigator url="/pages/mine/policy" hover-class="none">个人信息保护政策</navigator>
@@ -85,14 +93,14 @@ export default {
return {
checkbox: false,
loading: false,
loginType: 'pwd',
loginType: 'yzm',
phone: '',
pwdForm: {
pwd: '',
imgCode: '',
},
yzmForm: {
code: '123456789',
code: '',
imgCode: '',
},
waitTime: 0,
@@ -178,6 +186,10 @@ export default {
onLoad(o) {
// 移除所有的缓存
// uni.clearStorageSync()
let userInfo = uni.getStorageSync(this.$cacheKey.userInfo)
if (userInfo) {
this.phone = userInfo.user_name
}
uni.removeStorageSync(this.$cacheKey.access_token)
uni.removeStorageSync(this.$cacheKey.engineering)
},
@@ -203,7 +215,7 @@ export default {
.login-box {
display: flex;
flex-direction: column;
margin: 60rpx auto 0;
margin: 40rpx auto 0;
box-sizing: border-box;
width: 680rpx;
padding: 100rpx 40rpx;

View File

@@ -9,7 +9,7 @@
</uni-forms-item>
<uni-forms-item name="code">
<view class="login-box-input">
<uni-easyinput type="number" v-model="formData.code" placeholder="请输入验证码" />
<uni-easyinput type="text" v-model="formData.code" placeholder="请输入验证码" maxlength="6" />
<view
class="ml40"
style="margin-left: 40rpx; font-size: 28rpx; color: #666; width: 200rpx; text-align: center"
@@ -23,7 +23,7 @@
<button type="default" class="submit-btn" @click="firstSubmit">注册</button>
<view class="login-box-tips">
<view style="color: #999"
><checkbox :checked="checkbox" @click="checkbox = !checkbox" /> 我已阅读并同意</view
><checkbox style="transform: scale(0.7)" :checked="checkbox" @click="checkbox = !checkbox" /> 我已阅读并同意</view
>
<navigator url="/pages/mine/agreement" hover-class="none">用户协议</navigator>
<navigator url="/pages/mine/policy" hover-class="none">个人信息保护政策</navigator>