This commit is contained in:
仲么了
2023-10-26 09:03:16 +08:00
parent 9b6ba745f2
commit 89d3d78f22
16 changed files with 209 additions and 76 deletions

View File

@@ -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',
})
}
// 更新用户推送标识

View File

@@ -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 || []

View File

@@ -5,17 +5,20 @@ export default (options = {}) => {
if (options.data == undefined) {
options.data = {}
}
options.debounce = options.debounce === undefined ? true : options.debounce
// 防止接口重复点击
if (arr.indexOf(options.url) === -1) {
arr.push(options.url)
} else {
return new Promise((resolve, reject) => {
reject({
code: -1,
msg: '请勿重复提交',
data:options.url
if (options.debounce) {
if (arr.indexOf(options.url) === -1) {
arr.push(options.url)
} else {
return new Promise((resolve, reject) => {
reject({
code: -1,
msg: '请勿重复提交',
data: options.url,
})
})
})
}
}
return new Promise((reslove, reject) => {
let url = options.url.indexOf('http') === -1 ? config.domain + options.url : options.url
@@ -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' })

View File

@@ -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" : ""

View File

@@ -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": "设备共享"
}
},
{

View File

@@ -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 === '移交') {

View File

@@ -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>
<uni-list :border="false">
<uni-list-item title="输入电压异常" rightText="2023-02-01 15:10:29" v-for="item in 5" />
</uni-list>
<uni-load-more status="nomore"></uni-load-more>
</view>
<Cn-page :loading="loading">
<view class="content" slot="body">
<uni-list :border="false">
<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>
<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 {
data () {
mixins: [list],
data() {
return {
loading: false,
current: 0,
items: ['当前告警', '历史告警'],
styleType: 'text',
activeColor: '#007aff',
loading: true,
deviceId:''
}
},
onLoad(options) {
this.deviceId = options.id
},
onShow() {
this.init()
},
onNavigationBarButtonTap(e) {
uni.showModal({
title: '提示',
content: '确定要全部标记为已读吗?',
success: (res) => {
if (res.confirm) {
updateStatus({
type: 3,
eventIds:[]
}).then(() => {
this.store.reload()
})
}
},
})
},
methods: {
back(){
uni.navigateBack()
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()
},
messageSet(){
uni.showModal({
title: '提示',
content: '确定关闭该设备的告警通知吗?',
showCancel: true,
success: ({ confirm, cancel }) => {}
})
jump(item) {
let str = JSON.stringify(item).replace(/%/g, '百分比')
uni.navigateTo({ url: '/pages/message/reportDetail?detail=' + encodeURIComponent(str) })
},
onClickItem (e) {
this.current = e.currentIndex
},
}
},
}
</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;
}
</style>
/deep/ .uni-card__header-extra-text {
color: #dd524d !important;
font-size: 20rpx;
}
</style>

View File

@@ -63,7 +63,7 @@ export default {
roleName = '工程用户'
break
case 'app_vip_user':
roleName = 'VIP用户'
roleName = '正式用户'
break
case 'market_user':
roleName = '营销用户'

View File

@@ -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

View File

@@ -63,7 +63,7 @@ export default {
uni.navigateTo({url: '/pages/home/feedback'})
},
registerDevice() {
this.$util.toast('此功能仅对VIP用户开放')
this.$util.toast('此功能仅对正式用户开放')
},
},
}

View File

@@ -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') {

View File

@@ -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
View 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>

View File

@@ -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({

View File

@@ -56,7 +56,7 @@ export default {
roleName = '工程用户'
break
case 'app_vip_user':
roleName = 'VIP用户'
roleName = '正式用户'
break
case 'market_user':
roleName = '营销用户'

4
readme
View File

@@ -2,7 +2,7 @@
13999999999
营销用户
13888888888
VIP用户
正式用户
13764779092
13333333333
运维管理元
@@ -11,5 +11,5 @@ njcnyw
1.工程用户 1899999999
2.营销用户 1888888888
3.VIP用户 187777777777
3.正式用户 187777777777
4.运维管理元 18666666666