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', 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, data: this.params,
header: this.header, header: this.header,
method: 'POST', method: 'POST',
debounce: false,
}).then((res) => { }).then((res) => {
console.warn(res) console.warn(res)
let resultData = res.data?.list || res.data?.records || res.data || [] let resultData = res.data?.list || res.data?.records || res.data || []

View File

@@ -5,17 +5,20 @@ export default (options = {}) => {
if (options.data == undefined) { if (options.data == undefined) {
options.data = {} options.data = {}
} }
options.debounce = options.debounce === undefined ? true : options.debounce
// 防止接口重复点击 // 防止接口重复点击
if (arr.indexOf(options.url) === -1) { if (options.debounce) {
arr.push(options.url) if (arr.indexOf(options.url) === -1) {
} else { arr.push(options.url)
return new Promise((resolve, reject) => { } else {
reject({ return new Promise((resolve, reject) => {
code: -1, reject({
msg: '请勿重复提交', code: -1,
data:options.url msg: '请勿重复提交',
data: options.url,
})
}) })
}) }
} }
return new Promise((reslove, reject) => { return new Promise((reslove, reject) => {
let url = options.url.indexOf('http') === -1 ? config.domain + options.url : options.url let url = options.url.indexOf('http') === -1 ? config.domain + options.url : options.url
@@ -70,7 +73,7 @@ export default (options = {}) => {
* @param {Number} code 错误码 * @param {Number} code 错误码
*/ */
function errHandler(res) { function errHandler(res) {
console.log(res); console.log(res)
switch (res.code) { switch (res.code) {
case 'A0024': case 'A0024':
uni.reLaunch({ url: '/pages/user/login' }) uni.reLaunch({ url: '/pages/user/login' })

View File

@@ -2,8 +2,8 @@
"name" : "灿能物联", "name" : "灿能物联",
"appid" : "__UNI__88BC25B", "appid" : "__UNI__88BC25B",
"description" : "", "description" : "",
"versionName" : "1.3.7", "versionName" : "1.3.8",
"versionCode" : 137, "versionCode" : 138,
"transformPx" : false, "transformPx" : false,
/* 5+App */ /* 5+App */
"app-plus" : { "app-plus" : {
@@ -139,8 +139,8 @@
"proxy" : { "proxy" : {
"/api" : { "/api" : {
"https" : true, "https" : true,
"target" : "https://pqmcn.com:8092/api", // "target" : "https://pqmcn.com:8092/api",
// "target" : "http://192.168.1.13:10215", "target" : "http://192.168.1.115:10215",
"changOrigin" : true, "changOrigin" : true,
"pathRewrite" : { "pathRewrite" : {
"/api" : "" "/api" : ""

View File

@@ -71,6 +71,12 @@
"navigationBarTitleText": "设置" "navigationBarTitleText": "设置"
} }
}, },
{
"path": "pages/mine/deleteUser",
"style": {
"navigationBarTitleText": "账号注销"
}
},
{ {
"path": "pages/mine/setupMessage", "path": "pages/mine/setupMessage",
"style": { "style": {
@@ -359,13 +365,7 @@
{ {
"path": "pages/device/user", "path": "pages/device/user",
"style": { "style": {
"navigationBarTitleText": "子用户" "navigationBarTitleText": "设备共享"
}
},
{
"path": "pages/device/user",
"style": {
"navigationBarTitleText": "子用户"
} }
}, },
{ {

View File

@@ -205,7 +205,7 @@ export default {
} else if (e.item.text === '记录') { } else if (e.item.text === '记录') {
uni.navigateTo({ url: '/pages/device/APF/record' }) uni.navigateTo({ url: '/pages/device/APF/record' })
} else if (e.item.text === '告警') { } 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 === '关于') { } else if (e.item.text === '关于') {
uni.navigateTo({ url: '/pages/device/APF/about?id=' + this.devId }) uni.navigateTo({ url: '/pages/device/APF/about?id=' + this.devId })
} else if (e.item.text === '移交') { } else if (e.item.text === '移交') {

View File

@@ -1,64 +1,109 @@
<template> <template>
<Cn-page :loading='loading'> <Cn-page :loading="loading">
<view slot='body'> <view class="content" slot="body">
<view class='record'> <uni-list :border="false">
<uni-nav-bar dark :fixed="true" status-bar left-icon="left" rightText="关闭通知" background-color="#fff" <uni-list-item
color="#111" title="告警情况" @clickLeft="back" @clickRight="messageSet" /> isDot
<div class="header"> show-badge
<uni-segmented-control :current="current" :values="items" :style-type="styleType" badgeType="error"
:active-color="activeColor" @clickItem="onClickItem" /> :badge-text="item.status == 1 ? '' : '未读'"
</div> :title="'告警代码:'+item.code"
<uni-list :border="false"> :note="item.startTime"
<uni-list-item title="输入电压异常" rightText="2023-02-01 15:10:29" v-for="item in 5" /> @click="jump(item)"
</uni-list> clickable
<uni-load-more status="nomore"></uni-load-more> v-for="(item, index) in store.data"
</view> />
</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> </view>
</Cn-page> </Cn-page>
</template> </template>
<script> <script>
import list from '@/common/js/list'
import { updateStatus } from '@/common/api/message'
export default { export default {
data () { mixins: [list],
data() {
return { return {
loading: false, loading: true,
current: 0, deviceId:''
items: ['当前告警', '历史告警'],
styleType: 'text',
activeColor: '#007aff',
} }
}, },
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: { methods: {
back(){ async init() {
uni.navigateBack() 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(){ jump(item) {
uni.showModal({ let str = JSON.stringify(item).replace(/%/g, '百分比')
title: '提示', uni.navigateTo({ url: '/pages/message/reportDetail?detail=' + encodeURIComponent(str) })
content: '确定关闭该设备的告警通知吗?',
showCancel: true,
success: ({ confirm, cancel }) => {}
})
}, },
onClickItem (e) { },
this.current = e.currentIndex
},
}
} }
</script> </script>
<style lang='scss'>
.record { <style lang="scss">
.header { .content {
position: sticky; // padding-top: 20rpx;
top: 0; }
left: 0;
z-index: 10; .term-list-bottom {
background: $uni-theme-white; .term-list-bottom-item {
padding: 10rpx 20rpx 20rpx; font-size: 28rpx;
box-shadow: 0 0 10rpx #eee; 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 { /deep/ .uni-list-item {
background-color: $uni-theme-white !important; 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 = '工程用户' roleName = '工程用户'
break break
case 'app_vip_user': case 'app_vip_user':
roleName = 'VIP用户' roleName = '正式用户'
break break
case 'market_user': case 'market_user':
roleName = '营销用户' roleName = '营销用户'

View File

@@ -132,6 +132,8 @@ export default {
}, },
computed: { computed: {
deviceListFilter() { deviceListFilter() {
this.transfer = false
this.share = false
let arr = this.store.data.filter((item) => { let arr = this.store.data.filter((item) => {
if (this.select.projectName && this.select.projectType) { if (this.select.projectName && this.select.projectType) {
return item.project === this.select.projectName && item.type === 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'}) uni.navigateTo({url: '/pages/home/feedback'})
}, },
registerDevice() { registerDevice() {
this.$util.toast('此功能仅对VIP用户开放') this.$util.toast('此功能仅对正式用户开放')
}, },
}, },
} }

View File

@@ -97,7 +97,7 @@ export default {
} else { } else {
if (this.userInfo.authorities === 'tourist') { if (this.userInfo.authorities === 'tourist') {
return uni.showToast({ return uni.showToast({
title: '此功能仅对VIP用户开放', title: '此功能仅对正式用户开放',
icon: 'none', icon: 'none',
}) })
} else if (this.userInfo.authorities === 'market_user') { } else if (this.userInfo.authorities === 'market_user') {

View File

@@ -128,7 +128,7 @@ export default {
roleName = '工程用户' roleName = '工程用户'
break break
case 'app_vip_user': case 'app_vip_user':
roleName = 'VIP用户' roleName = '正式用户'
break break
case 'market_user': case 'market_user':
roleName = '营销用户' 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> <view class="mine-nav-label">更换手机号</view>
<uni-icons type="forward" color="#aaa" size="20"></uni-icons> <uni-icons type="forward" color="#aaa" size="20"></uni-icons>
</view> </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> <view class="mine-nav-label">修改密码</view>
<uni-icons type="forward" color="#aaa" size="20"></uni-icons> <uni-icons type="forward" color="#aaa" size="20"></uni-icons>
</view> </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" @click="jump('setupMessage')" style="margin-top:20rpx;border-bottom: none; ">
<view class="mine-nav-label">消息配置</view> <view class="mine-nav-label">消息配置</view>
<uni-icons type="forward" color="#aaa" size="20"></uni-icons> <uni-icons type="forward" color="#aaa" size="20"></uni-icons>
@@ -46,7 +50,7 @@
<uni-icons type="forward" color="#aaa" size="20"></uni-icons> <uni-icons type="forward" color="#aaa" size="20"></uni-icons>
</view> </view>
<view class="mine-nav" @click="jump('layout')" style="margin-top: 20rpx; border-bottom: none"> <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> </view>
</view> </view>
@@ -77,7 +81,7 @@ export default {
case 'layout': case 'layout':
uni.showModal({ uni.showModal({
title: '提示', title: '提示',
content: '是否确认账号注销', content: '是否确认退出登录',
success: (res) => { success: (res) => {
if (res.confirm) { if (res.confirm) {
uni.reLaunch({ uni.reLaunch({

View File

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

4
readme
View File

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