t
This commit is contained in:
@@ -203,6 +203,16 @@ export function apiUpdateUser(params) {
|
||||
method: 'PUT',
|
||||
})
|
||||
}
|
||||
// 更改用户信息
|
||||
export function apiDeleteUser(params) {
|
||||
return request({
|
||||
url: '/user-boot/user/delete',
|
||||
data: {
|
||||
id:uni.getStorageSync('userInfo').userIndex,
|
||||
},
|
||||
method: 'DELETE',
|
||||
})
|
||||
}
|
||||
|
||||
// 更新用户推送标识
|
||||
|
||||
|
||||
@@ -54,6 +54,7 @@ export default {
|
||||
data: this.params,
|
||||
header: this.header,
|
||||
method: 'POST',
|
||||
debounce: false,
|
||||
}).then((res) => {
|
||||
console.warn(res)
|
||||
let resultData = res.data?.list || res.data?.records || res.data || []
|
||||
|
||||
@@ -5,7 +5,9 @@ export default (options = {}) => {
|
||||
if (options.data == undefined) {
|
||||
options.data = {}
|
||||
}
|
||||
options.debounce = options.debounce === undefined ? true : options.debounce
|
||||
// 防止接口重复点击
|
||||
if (options.debounce) {
|
||||
if (arr.indexOf(options.url) === -1) {
|
||||
arr.push(options.url)
|
||||
} else {
|
||||
@@ -13,10 +15,11 @@ export default (options = {}) => {
|
||||
reject({
|
||||
code: -1,
|
||||
msg: '请勿重复提交',
|
||||
data:options.url
|
||||
data: options.url,
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
return new Promise((reslove, reject) => {
|
||||
let url = options.url.indexOf('http') === -1 ? config.domain + options.url : options.url
|
||||
if (options.params) {
|
||||
@@ -70,7 +73,7 @@ export default (options = {}) => {
|
||||
* @param {Number} code 错误码
|
||||
*/
|
||||
function errHandler(res) {
|
||||
console.log(res);
|
||||
console.log(res)
|
||||
switch (res.code) {
|
||||
case 'A0024':
|
||||
uni.reLaunch({ url: '/pages/user/login' })
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
"name" : "灿能物联",
|
||||
"appid" : "__UNI__88BC25B",
|
||||
"description" : "",
|
||||
"versionName" : "1.3.7",
|
||||
"versionCode" : 137,
|
||||
"versionName" : "1.3.8",
|
||||
"versionCode" : 138,
|
||||
"transformPx" : false,
|
||||
/* 5+App特有相关 */
|
||||
"app-plus" : {
|
||||
@@ -139,8 +139,8 @@
|
||||
"proxy" : {
|
||||
"/api" : {
|
||||
"https" : true,
|
||||
"target" : "https://pqmcn.com:8092/api",
|
||||
// "target" : "http://192.168.1.13:10215",
|
||||
// "target" : "https://pqmcn.com:8092/api",
|
||||
"target" : "http://192.168.1.115:10215",
|
||||
"changOrigin" : true,
|
||||
"pathRewrite" : {
|
||||
"/api" : ""
|
||||
|
||||
14
pages.json
14
pages.json
@@ -71,6 +71,12 @@
|
||||
"navigationBarTitleText": "设置"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/mine/deleteUser",
|
||||
"style": {
|
||||
"navigationBarTitleText": "账号注销"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/mine/setupMessage",
|
||||
"style": {
|
||||
@@ -359,13 +365,7 @@
|
||||
{
|
||||
"path": "pages/device/user",
|
||||
"style": {
|
||||
"navigationBarTitleText": "子用户"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/device/user",
|
||||
"style": {
|
||||
"navigationBarTitleText": "子用户"
|
||||
"navigationBarTitleText": "设备共享"
|
||||
}
|
||||
},
|
||||
{
|
||||
|
||||
@@ -205,7 +205,7 @@ export default {
|
||||
} else if (e.item.text === '记录') {
|
||||
uni.navigateTo({ url: '/pages/device/APF/record' })
|
||||
} else if (e.item.text === '告警') {
|
||||
uni.navigateTo({ url: '/pages/device/APF/report' })
|
||||
uni.navigateTo({ url: '/pages/device/APF/report?id=' + this.devId })
|
||||
} else if (e.item.text === '关于') {
|
||||
uni.navigateTo({ url: '/pages/device/APF/about?id=' + this.devId })
|
||||
} else if (e.item.text === '移交') {
|
||||
|
||||
@@ -1,64 +1,109 @@
|
||||
<template>
|
||||
<Cn-page :loading='loading'>
|
||||
<view slot='body'>
|
||||
<view class='record'>
|
||||
<uni-nav-bar dark :fixed="true" status-bar left-icon="left" rightText="关闭通知" background-color="#fff"
|
||||
color="#111" title="告警情况" @clickLeft="back" @clickRight="messageSet" />
|
||||
<div class="header">
|
||||
<uni-segmented-control :current="current" :values="items" :style-type="styleType"
|
||||
:active-color="activeColor" @clickItem="onClickItem" />
|
||||
</div>
|
||||
<Cn-page :loading="loading">
|
||||
<view class="content" slot="body">
|
||||
<uni-list :border="false">
|
||||
<uni-list-item title="输入电压异常" rightText="2023-02-01 15:10:29" v-for="item in 5" />
|
||||
<uni-list-item
|
||||
isDot
|
||||
show-badge
|
||||
badgeType="error"
|
||||
:badge-text="item.status == 1 ? '' : '未读'"
|
||||
:title="'告警代码:'+item.code"
|
||||
:note="item.startTime"
|
||||
@click="jump(item)"
|
||||
clickable
|
||||
v-for="(item, index) in store.data"
|
||||
/>
|
||||
</uni-list>
|
||||
<uni-load-more status="nomore"></uni-load-more>
|
||||
</view>
|
||||
<Cn-empty v-if="store.empty" style="padding-top: 400rpx"></Cn-empty>
|
||||
<uni-load-more v-if="store.data && store.data.length > 0" :status="store.status"></uni-load-more>
|
||||
</view>
|
||||
</Cn-page>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import list from '@/common/js/list'
|
||||
import { updateStatus } from '@/common/api/message'
|
||||
|
||||
export default {
|
||||
mixins: [list],
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
current: 0,
|
||||
items: ['当前告警', '历史告警'],
|
||||
styleType: 'text',
|
||||
activeColor: '#007aff',
|
||||
loading: true,
|
||||
deviceId:''
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
back(){
|
||||
uni.navigateBack()
|
||||
onLoad(options) {
|
||||
this.deviceId = options.id
|
||||
},
|
||||
messageSet(){
|
||||
onShow() {
|
||||
this.init()
|
||||
},
|
||||
onNavigationBarButtonTap(e) {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '确定关闭该设备的告警通知吗?',
|
||||
showCancel: true,
|
||||
success: ({ confirm, cancel }) => {}
|
||||
content: '确定要全部标记为已读吗?',
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
updateStatus({
|
||||
type: 3,
|
||||
eventIds:[]
|
||||
}).then(() => {
|
||||
this.store.reload()
|
||||
})
|
||||
}
|
||||
},
|
||||
})
|
||||
},
|
||||
onClickItem (e) {
|
||||
this.current = e.currentIndex
|
||||
methods: {
|
||||
async init() {
|
||||
let dictData = await this.$util.getDictData('app_event')
|
||||
this.store = this.DataSource('/cs-harmonic-boot/eventUser/queryEventpage')
|
||||
this.store.params.type = 3
|
||||
this.store.params.deviceId = this.deviceId
|
||||
this.store.firstCallBack = (res) => {
|
||||
// this.store.data.forEach((item) => {
|
||||
// item.title = dictData.find((item2) => item2.code === item.tag)?.name
|
||||
// })
|
||||
// console.log(this.store.data)
|
||||
this.loading = false
|
||||
}
|
||||
this.store.reload()
|
||||
},
|
||||
jump(item) {
|
||||
let str = JSON.stringify(item).replace(/%/g, '百分比')
|
||||
uni.navigateTo({ url: '/pages/message/reportDetail?detail=' + encodeURIComponent(str) })
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang='scss'>
|
||||
.record {
|
||||
.header {
|
||||
position: sticky;
|
||||
top: 0;
|
||||
left: 0;
|
||||
z-index: 10;
|
||||
background: $uni-theme-white;
|
||||
padding: 10rpx 20rpx 20rpx;
|
||||
box-shadow: 0 0 10rpx #eee;
|
||||
|
||||
<style lang="scss">
|
||||
.content {
|
||||
// padding-top: 20rpx;
|
||||
}
|
||||
|
||||
.term-list-bottom {
|
||||
.term-list-bottom-item {
|
||||
font-size: 28rpx;
|
||||
margin-bottom: 10rpx;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
// view:first-of-type{
|
||||
// color: #111;
|
||||
// }
|
||||
}
|
||||
|
||||
.term-list-bottom-item:last-of-type {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
}
|
||||
|
||||
/deep/ .uni-list-item {
|
||||
background-color: $uni-theme-white !important;
|
||||
}
|
||||
|
||||
/deep/ .uni-card__header-extra-text {
|
||||
color: #dd524d !important;
|
||||
font-size: 20rpx;
|
||||
}
|
||||
</style>
|
||||
@@ -63,7 +63,7 @@ export default {
|
||||
roleName = '工程用户'
|
||||
break
|
||||
case 'app_vip_user':
|
||||
roleName = 'VIP用户'
|
||||
roleName = '正式用户'
|
||||
break
|
||||
case 'market_user':
|
||||
roleName = '营销用户'
|
||||
|
||||
@@ -132,6 +132,8 @@ export default {
|
||||
},
|
||||
computed: {
|
||||
deviceListFilter() {
|
||||
this.transfer = false
|
||||
this.share = false
|
||||
let arr = this.store.data.filter((item) => {
|
||||
if (this.select.projectName && this.select.projectType) {
|
||||
return item.project === this.select.projectName && item.type === this.select.projectType
|
||||
|
||||
@@ -63,7 +63,7 @@ export default {
|
||||
uni.navigateTo({url: '/pages/home/feedback'})
|
||||
},
|
||||
registerDevice() {
|
||||
this.$util.toast('此功能仅对VIP用户开放')
|
||||
this.$util.toast('此功能仅对正式用户开放')
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
@@ -97,7 +97,7 @@ export default {
|
||||
} else {
|
||||
if (this.userInfo.authorities === 'tourist') {
|
||||
return uni.showToast({
|
||||
title: '此功能仅对VIP用户开放',
|
||||
title: '此功能仅对正式用户开放',
|
||||
icon: 'none',
|
||||
})
|
||||
} else if (this.userInfo.authorities === 'market_user') {
|
||||
|
||||
@@ -128,7 +128,7 @@ export default {
|
||||
roleName = '工程用户'
|
||||
break
|
||||
case 'app_vip_user':
|
||||
roleName = 'VIP用户'
|
||||
roleName = '正式用户'
|
||||
break
|
||||
case 'market_user':
|
||||
roleName = '营销用户'
|
||||
|
||||
68
pages/mine/deleteUser.vue
Normal file
68
pages/mine/deleteUser.vue
Normal file
@@ -0,0 +1,68 @@
|
||||
<template>
|
||||
<Cn-page :loading="loading">
|
||||
<view slot="body">
|
||||
<view class="index">
|
||||
<view>成功注销后所有的账号信息将会被删除且无法找回,原账号将无法登陆,请谨慎操作。</view>
|
||||
<view class="btn-wrap">
|
||||
<view class="btn-wrap-item" @click="submit"> 注销</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</Cn-page>
|
||||
</template>
|
||||
<script>
|
||||
import { apiDeleteUser } from '@/common/api/user.js'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
submit() {
|
||||
uni.showModal({
|
||||
title: '注销提示',
|
||||
content: '确认注销账号吗?',
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
apiDeleteUser().then((res) => {
|
||||
uni.showToast({
|
||||
title: '注销成功',
|
||||
icon: 'none',
|
||||
})
|
||||
setTimeout(() => {
|
||||
uni.reLaunch({
|
||||
url: `/pages/user/login`,
|
||||
})
|
||||
}, 1000)
|
||||
})
|
||||
}
|
||||
},
|
||||
})
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.index {
|
||||
padding: 34rpx;
|
||||
font-size: 28rpx;
|
||||
.btn-wrap {
|
||||
margin-top: 40rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
|
||||
.btn-wrap-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex: 1;
|
||||
background: $uni-theme-color;
|
||||
color: #fff;
|
||||
height: 80rpx;
|
||||
border-radius: 12rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -5,10 +5,14 @@
|
||||
<view class="mine-nav-label">更换手机号</view>
|
||||
<uni-icons type="forward" color="#aaa" size="20"></uni-icons>
|
||||
</view>
|
||||
<view class="mine-nav" @click="jump('changePwd')" style="border-bottom: none">
|
||||
<view class="mine-nav" @click="jump('changePwd')" >
|
||||
<view class="mine-nav-label">修改密码</view>
|
||||
<uni-icons type="forward" color="#aaa" size="20"></uni-icons>
|
||||
</view>
|
||||
<view class="mine-nav" @click="jump('deleteUser')" style="border-bottom: none">
|
||||
<view class="mine-nav-label">账号注销</view>
|
||||
<uni-icons type="forward" color="#aaa" size="20"></uni-icons>
|
||||
</view>
|
||||
<!-- <view class="mine-nav" @click="jump('setupMessage')" style="margin-top:20rpx;border-bottom: none; ">
|
||||
<view class="mine-nav-label">消息配置</view>
|
||||
<uni-icons type="forward" color="#aaa" size="20"></uni-icons>
|
||||
@@ -46,7 +50,7 @@
|
||||
<uni-icons type="forward" color="#aaa" size="20"></uni-icons>
|
||||
</view>
|
||||
<view class="mine-nav" @click="jump('layout')" style="margin-top: 20rpx; border-bottom: none">
|
||||
<view class="mine-nav-label" style="text-align: center">账号注销</view>
|
||||
<view class="mine-nav-label" style="text-align: center">退出登录</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -77,7 +81,7 @@ export default {
|
||||
case 'layout':
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '是否确认账号注销?',
|
||||
content: '是否确认退出登录?',
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
uni.reLaunch({
|
||||
|
||||
@@ -56,7 +56,7 @@ export default {
|
||||
roleName = '工程用户'
|
||||
break
|
||||
case 'app_vip_user':
|
||||
roleName = 'VIP用户'
|
||||
roleName = '正式用户'
|
||||
break
|
||||
case 'market_user':
|
||||
roleName = '营销用户'
|
||||
|
||||
Reference in New Issue
Block a user