用户信息修改

This commit is contained in:
赵正易 2024-09-20 16:28:34 +08:00
parent f9ca823fc4
commit e70033fd80
8 changed files with 361 additions and 328 deletions

View File

@ -155,7 +155,7 @@ export default {
<style scoped> <style scoped>
.scroll-view{ .scroll-view{
height: 1000rpx; height: 960rpx;
padding-bottom: 40rpx; padding-bottom: 40rpx;
} }
</style> </style>

View File

@ -9,14 +9,22 @@
<uni-forms-item label="线别"> <uni-forms-item label="线别">
<uni-data-select v-model="query.lineCode" :localdata="lineOptions" @change="getList()"></uni-data-select> <uni-data-select v-model="query.lineCode" :localdata="lineOptions" @change="getList()"></uni-data-select>
</uni-forms-item> </uni-forms-item>
<button type="primary" @click="getList()">查询</button> <button type="primary" plain @click="getList()">
<uni-icons color="#2979ff" type="search" size="18"></uni-icons>
查询
</button>
</uni-forms> </uni-forms>
</view> </view>
<uni-list style="width: 100%"> <scroll-view class="scroll-view" scroll-y="true">
<uni-list-item v-for="(item, index) in dataList" :key="index" :title="item.title" rightText="任务详情" link @click="onListItemClick(item)"></uni-list-item> <uni-list style="width: 100%">
</uni-list> <uni-list-item v-for="(item, index) in dataList" :key="index" :title="item.title" rightText="任务详情" link @click="onListItemClick(item)"></uni-list-item>
</uni-list>
</scroll-view>
<view class="bottom-box"> <view class="bottom-box">
<button type="primary" @click="doAddTask">新建备料任务</button> <button type="primary" @click="doAddTask">
<uni-icons color="#fff" type="plusempty" size="18"></uni-icons>
新建备料任务
</button>
</view> </view>
</view> </view>
</template> </template>
@ -141,5 +149,8 @@ export default {
.card-box { .card-box {
width: 100%; width: 100%;
} }
.scroll-view {
height: 760rpx;
padding-bottom: 40rpx;
}
</style> </style>

View File

@ -1,75 +1,74 @@
<template> <template>
<view class="about-container"> <view class="about-container">
<view class="header-section text-center"> <view class="header-section text-center">
<image style="width: 150rpx;height: 150rpx;" src="/static/logo200.png" mode="widthFix"> <image style="width: 150rpx; height: 150rpx" src="/static/logo.png" mode="widthFix"></image>
</image> <uni-title type="h2" title="车镜实业"></uni-title>
<uni-title type="h2" title="若依移动端"></uni-title> </view>
</view>
<view class="content-section"> <view class="content-section">
<view class="menu-list"> <view class="menu-list">
<view class="list-cell list-cell-arrow"> <view class="list-cell list-cell-arrow">
<view class="menu-item-box"> <view class="menu-item-box">
<view>版本信息</view> <view>版本信息</view>
<view class="text-right">v{{version}}</view> <view class="text-right">v{{ version }}</view>
</view> </view>
</view> </view>
<view class="list-cell list-cell-arrow"> <view class="list-cell list-cell-arrow">
<view class="menu-item-box"> <view class="menu-item-box">
<view>官方邮箱</view> <view>官方邮箱</view>
<view class="text-right">ruoyi@xx.com</view> <view class="text-right">doan@163.com</view>
</view> </view>
</view> </view>
<view class="list-cell list-cell-arrow"> <view class="list-cell list-cell-arrow">
<view class="menu-item-box"> <view class="menu-item-box">
<view>服务热线</view> <view>服务热线</view>
<view class="text-right">400-999-9999</view> <view class="text-right">17351662861</view>
</view> </view>
</view> </view>
<view class="list-cell list-cell-arrow"> <view class="list-cell list-cell-arrow">
<view class="menu-item-box"> <view class="menu-item-box">
<view>公司网站</view> <view>公司网站</view>
<view class="text-right"> <view class="text-right">
<uni-link :href="url" :text="url" showUnderLine="false"></uni-link> <uni-link :href="url" :text="url" showUnderLine="false"></uni-link>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
<view class="copyright"> <!-- <view class="copyright">
<view>Copyright &copy; 2022 ruoyi.vip All Rights Reserved.</view> <view>Copyright &copy; 2022 ruoyi.vip All Rights Reserved.</view>
</view> </view> -->
</view> </view>
</template> </template>
<script> <script>
export default { export default {
data() { data() {
return { return {
url: getApp().globalData.config.appInfo.site_url, url: getApp().globalData.config.appInfo.site_url,
version: getApp().globalData.config.appInfo.version version: getApp().globalData.config.appInfo.version
} };
} }
} };
</script> </script>
<style lang="scss"> <style lang="scss">
page { page {
background-color: #f8f8f8; background-color: #f8f8f8;
} }
.copyright { .copyright {
margin-top: 50rpx; margin-top: 50rpx;
text-align: center; text-align: center;
line-height: 60rpx; line-height: 60rpx;
color: #999; color: #999;
} }
.header-section { .header-section {
display: flex; display: flex;
padding: 30rpx 0 0; padding: 30rpx 0 0;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
} }
</style> </style>

View File

@ -1,112 +1,117 @@
<template> <template>
<view class="help-container"> <view class="help-container">
<view v-for="(item, findex) in list" :key="findex" :title="item.title" class="list-title"> <view v-for="(item, findex) in list" :key="findex" :title="item.title" class="list-title">
<view class="text-title"> <view class="text-title">
<view :class="item.icon"></view>{{ item.title }} <view :class="item.icon"></view>
</view> {{ item.title }}
<view class="childList"> </view>
<view v-for="(child, zindex) in item.childList" :key="zindex" class="question" hover-class="hover" <view class="childList">
@click="handleText(child)"> <view v-for="(child, zindex) in item.childList" :key="zindex" class="question" hover-class="hover" @click="handleText(child)">
<view class="text-item">{{ child.title }}</view> <view class="text-item">{{ child.title }}</view>
<view class="line" v-if="zindex !== item.childList.length - 1"></view> <view class="line" v-if="zindex !== item.childList.length - 1"></view>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
</template> </template>
<script> <script>
export default { export default {
data() { data() {
return { return {
list: [{ list: [
icon: 'iconfont icon-github', // {
title: '若依问题', // icon: 'iconfont icon-github',
childList: [{ // title: '',
title: '若依开源吗?', // childList: [{
content: '开源' // title: '',
}, { // content: ''
title: '若依可以商用吗?', // }, {
content: '可以' // title: '',
}, { // content: ''
title: '若依官网地址多少?', // }, {
content: 'http://ruoyi.vip' // title: '',
}, { // content: 'http://ruoyi.vip'
title: '若依文档地址多少?', // }, {
content: 'http://doc.ruoyi.vip' // title: '',
}] // content: 'http://doc.ruoyi.vip'
}, // }]
{ // },
icon: 'iconfont icon-help', {
title: '其他问题', icon: 'iconfont icon-help',
childList: [{ title: '其他问题',
title: '如何退出登录?', childList: [
content: '请点击[我的] - [应用设置] - [退出登录]即可退出登录', {
}, { title: '如何退出登录?',
title: '如何修改用户头像?', content: '请点击[我的] - [应用设置] - [退出登录]即可退出登录'
content: '请点击[我的] - [选择头像] - [点击提交]即可更换用户头像', },
}, { {
title: '如何修改登录密码?', title: '如何修改用户头像?',
content: '请点击[我的] - [应用设置] - [修改密码]即可修改登录密码', content: '请点击[我的] - [选择头像] - [点击提交]即可更换用户头像'
}] },
} {
] title: '如何修改登录密码?',
} content: '请点击[我的] - [应用设置] - [修改密码]即可修改登录密码'
}, }
methods: { ]
handleText(item) { }
this.$tab.navigateTo(`/pages/common/textview/index?title=${item.title}&content=${item.content}`) ]
} };
} },
} methods: {
handleText(item) {
this.$tab.navigateTo(`/pages/common/textview/index?title=${item.title}&content=${item.content}`);
}
}
};
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
page { page {
background-color: #f8f8f8; background-color: #f8f8f8;
} }
.help-container { .help-container {
margin-bottom: 100rpx; margin-bottom: 100rpx;
padding: 30rpx; padding: 30rpx;
} }
.list-title { .list-title {
margin-bottom: 30rpx; margin-bottom: 30rpx;
} }
.childList { .childList {
background: #ffffff; background: #ffffff;
box-shadow: 0px 0px 10rpx rgba(193, 193, 193, 0.2); box-shadow: 0px 0px 10rpx rgba(193, 193, 193, 0.2);
border-radius: 16rpx; border-radius: 16rpx;
margin-top: 10rpx; margin-top: 10rpx;
} }
.line { .line {
width: 100%; width: 100%;
height: 1rpx; height: 1rpx;
background-color: #F5F5F5; background-color: #f5f5f5;
} }
.text-title { .text-title {
color: #303133; color: #303133;
font-size: 32rpx; font-size: 32rpx;
font-weight: bold; font-weight: bold;
margin-left: 10rpx; margin-left: 10rpx;
.iconfont { .iconfont {
font-size: 16px; font-size: 16px;
margin-right: 10rpx; margin-right: 10rpx;
} }
} }
.text-item { .text-item {
font-size: 28rpx; font-size: 28rpx;
padding: 24rpx; padding: 24rpx;
} }
.question { .question {
color: #606266; color: #606266;
font-size: 28rpx; font-size: 28rpx;
} }
</style> </style>

View File

@ -22,21 +22,21 @@
<view class="content-section"> <view class="content-section">
<view class="mine-actions grid col-4 text-center"> <view class="mine-actions grid col-4 text-center">
<view class="action-item" @click="handleJiaoLiuQun"> <view class="action-item" @click="handleBuilding">
<view class="iconfont icon-friendfill text-pink icon"></view> <view class="iconfont icon-friendfill text-orange icon"></view>
<text class="text">交流群</text> <text class="text">同事</text>
</view> </view>
<view class="action-item" @click="handleBuilding"> <view class="action-item" @click="handleBuilding">
<view class="iconfont icon-service text-blue icon"></view> <view class="iconfont icon-service text-blue icon"></view>
<text class="text">在线客服</text> <text class="text">客服</text>
</view> </view>
<view class="action-item" @click="handleBuilding"> <view class="action-item" @click="handleBuilding">
<view class="iconfont icon-community text-mauve icon"></view> <view class="iconfont icon-community text-mauve icon"></view>
<text class="text">反馈社区</text> <text class="text">反馈</text>
</view> </view>
<view class="action-item" @click="handleBuilding"> <view class="action-item" @click="handleBuilding">
<view class="iconfont icon-dianzan text-green icon"></view> <view class="iconfont icon-share text-green icon"></view>
<text class="text">点赞我们</text> <text class="text">分享</text>
</view> </view>
</view> </view>
@ -74,6 +74,11 @@
import storage from '@/utils/storage'; import storage from '@/utils/storage';
export default { export default {
onShow() {
// this.$store.dispatch('GetInfo').then((res) => {
// // this.$tab.reLaunch('/pages/index');
// });
},
data() { data() {
return { return {
name: this.$store.state.user.name, name: this.$store.state.user.name,
@ -118,7 +123,7 @@ export default {
this.$tab.navigateTo('/pages/mine/about/index'); this.$tab.navigateTo('/pages/mine/about/index');
}, },
handleJiaoLiuQun() { handleJiaoLiuQun() {
this.$modal.showToast('QQ群①133713780、②146013835'); this.$modal.showToast('模块建设中~');
}, },
handleBuilding() { handleBuilding() {
this.$modal.showToast('模块建设中~'); this.$modal.showToast('模块建设中~');

View File

@ -1,127 +1,138 @@
<template> <template>
<view class="container"> <view class="container">
<view class="example"> <view class="example">
<uni-forms ref="form" :model="user" labelWidth="80px"> <uni-forms ref="form" :model="user" labelWidth="80px">
<uni-forms-item label="用户昵称" name="nickName"> <uni-forms-item label="用户昵称" name="nickName">
<uni-easyinput v-model="user.nickName" placeholder="请输入昵称" /> <uni-easyinput v-model="user.nickName" placeholder="请输入昵称" />
</uni-forms-item> </uni-forms-item>
<uni-forms-item label="手机号码" name="phonenumber"> <uni-forms-item label="手机号码" name="phonenumber">
<uni-easyinput v-model="user.phonenumber" placeholder="请输入手机号码" /> <uni-easyinput v-model="user.phonenumber" placeholder="请输入手机号码" />
</uni-forms-item> </uni-forms-item>
<uni-forms-item label="邮箱" name="email"> <uni-forms-item label="邮箱" name="email">
<uni-easyinput v-model="user.email" placeholder="请输入邮箱" /> <uni-easyinput v-model="user.email" placeholder="请输入邮箱" />
</uni-forms-item> </uni-forms-item>
<uni-forms-item label="性别" name="sex" required> <uni-forms-item label="性别" name="sex" required>
<uni-data-checkbox v-model="user.sex" :localdata="sexs" /> <uni-data-checkbox v-model="user.sex" :localdata="sexs" />
</uni-forms-item> </uni-forms-item>
</uni-forms> </uni-forms>
<button type="primary" @click="submit">提交</button> <button type="primary" @click="submit">提交</button>
</view> </view>
</view> </view>
</template> </template>
<script> <script>
import { getUserProfile } from "@/api/system/user" import { getUserProfile } from '@/api/system/user';
import { updateUserProfile } from "@/api/system/user" import { updateUserProfile } from '@/api/system/user';
export default { export default {
data() { data() {
return { return {
user: { user: {
nickName: "", nickName: '',
phonenumber: "", phonenumber: '',
email: "", email: '',
sex: "" sex: ''
}, },
sexs: [{ sexs: [
text: '男', {
value: "0" text: '男',
}, { value: 0
text: '女', },
value: "1" {
}], text: '女',
rules: { value: 1
nickName: { }
rules: [{ ],
required: true, rules: {
errorMessage: '用户昵称不能为空' nickName: {
}] rules: [
}, {
phonenumber: { required: true,
rules: [{ errorMessage: '用户昵称不能为空'
required: true, }
errorMessage: '手机号码不能为空' ]
}, { },
pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/, phonenumber: {
errorMessage: '请输入正确的手机号码' rules: [
}] {
}, required: true,
email: { errorMessage: '手机号码不能为空'
rules: [{ },
required: true, {
errorMessage: '邮箱地址不能为空' pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
}, { errorMessage: '请输入正确的手机号码'
format: 'email', }
errorMessage: '请输入正确的邮箱地址' ]
}] },
} email: {
} rules: [
} {
}, required: true,
onLoad() { errorMessage: '邮箱地址不能为空'
this.getUser() },
}, {
onReady() { format: 'email',
this.$refs.form.setRules(this.rules) errorMessage: '请输入正确的邮箱地址'
}, }
methods: { ]
getUser() { }
getUserProfile().then(response => { }
this.user = response.data };
}) },
}, onLoad() {
submit(ref) { this.getUser();
this.$refs.form.validate().then(res => { },
updateUserProfile(this.user).then(response => { onReady() {
this.$modal.msgSuccess("修改成功") this.$refs.form.setRules(this.rules);
}) },
}) methods: {
} getUser() {
} getUserProfile().then((response) => {
} this.user = response.data.user;
});
},
submit(ref) {
this.$refs.form.validate().then((res) => {
updateUserProfile(this.user).then((response) => {
this.$modal.msgSuccess('修改成功');
});
});
}
}
};
</script> </script>
<style lang="scss"> <style lang="scss">
page { page {
background-color: #ffffff; background-color: #ffffff;
} }
.example { .example {
padding: 15px; padding: 15px;
background-color: #fff; background-color: #fff;
} }
.segmented-control { .segmented-control {
margin-bottom: 15px; margin-bottom: 15px;
} }
.button-group { .button-group {
margin-top: 15px; margin-top: 15px;
display: flex; display: flex;
justify-content: space-around; justify-content: space-around;
} }
.form-item { .form-item {
display: flex; display: flex;
align-items: center; align-items: center;
flex: 1; flex: 1;
} }
.button { .button {
display: flex; display: flex;
align-items: center; align-items: center;
height: 35px; height: 35px;
line-height: 35px; line-height: 35px;
margin-left: 10px; margin-left: 10px;
} }
</style> </style>

View File

@ -1,44 +1,44 @@
<template> <template>
<view class="container"> <view class="container">
<uni-list> <uni-list>
<uni-list-item showExtraIcon="true" :extraIcon="{type: 'person-filled'}" title="昵称" :rightText="user.nickName" /> <uni-list-item showExtraIcon="true" :extraIcon="{ type: 'person-filled' }" title="昵称" :rightText="user.nickName" />
<uni-list-item showExtraIcon="true" :extraIcon="{type: 'phone-filled'}" title="手机号码" :rightText="user.phonenumber" /> <uni-list-item showExtraIcon="true" :extraIcon="{ type: 'phone-filled' }" title="手机号码" :rightText="user.phonenumber" />
<uni-list-item showExtraIcon="true" :extraIcon="{type: 'email-filled'}" title="邮箱" :rightText="user.email" /> <uni-list-item showExtraIcon="true" :extraIcon="{ type: 'email-filled' }" title="邮箱" :rightText="user.email" />
<uni-list-item showExtraIcon="true" :extraIcon="{type: 'auth-filled'}" title="岗位" :rightText="postGroup" /> <uni-list-item showExtraIcon="true" :extraIcon="{ type: 'auth-filled' }" title="岗位" :rightText="postGroup" />
<uni-list-item showExtraIcon="true" :extraIcon="{type: 'staff-filled'}" title="角色" :rightText="roleGroup" /> <uni-list-item showExtraIcon="true" :extraIcon="{ type: 'staff-filled' }" title="角色" :rightText="roleGroup" />
<uni-list-item showExtraIcon="true" :extraIcon="{type: 'calendar-filled'}" title="创建日期" :rightText="user.createTime" /> <uni-list-item showExtraIcon="true" :extraIcon="{ type: 'calendar-filled' }" title="创建日期" :rightText="user.createTime" />
</uni-list> </uni-list>
</view> </view>
</template> </template>
<script> <script>
import { getUserProfile } from "@/api/system/user" import { getUserProfile } from '@/api/system/user';
export default { export default {
data() { data() {
return { return {
user: {}, user: {},
roleGroup: "", roleGroup: '',
postGroup: "" postGroup: ''
} };
}, },
onLoad() { onLoad() {
this.getUser() this.getUser();
}, },
methods: { methods: {
getUser() { getUser() {
getUserProfile().then(response => { getUserProfile().then((response) => {
this.user = response.data this.user = response.data.user;
this.roleGroup = response.roleGroup this.roleGroup = response.data.roles + '';
this.postGroup = response.postGroup this.postGroup = response.data.postGroup;
}) });
} }
} }
} };
</script> </script>
<style lang="scss"> <style lang="scss">
page { page {
background-color: #ffffff; background-color: #ffffff;
} }
</style> </style>

View File

@ -56,7 +56,6 @@ const user = {
const uuid = userInfo.uuid const uuid = userInfo.uuid
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
login(username, password, code, uuid).then(res => { login(username, password, code, uuid).then(res => {
console.log(res)
setToken(res.data) setToken(res.data)
commit('SET_TOKEN', res.data) commit('SET_TOKEN', res.data)
resolve() resolve()
@ -73,17 +72,20 @@ const user = {
}) { }) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
getInfo().then(res => { getInfo().then(res => {
const user = res.user console.log(res);
const user = res.data.user
const avatar = (user == null || user.avatar == "" || user.avatar == null) ? const avatar = (user == null || user.avatar == "" || user.avatar == null) ?
require("@/static/images/profile.jpg") : baseUrl + user.avatar require("@/static/images/profile.jpg") : baseUrl + user.avatar
const username = (user == null || user.userName == "" || user.userName == const username = (user == null || user.userName == "" || user.userName ==
null) ? "" : user.userName null) ? "" : user.userName
if (res.roles && res.roles.length > 0) { if (res.data.roles && res.data.roles.length > 0) {
commit('SET_ROLES', res.roles) commit('SET_ROLES', res.data.roles)
commit('SET_PERMISSIONS', res.permissions) commit('SET_PERMISSIONS', res.data.permissions)
} else { } else {
commit('SET_ROLES', ['ROLE_DEFAULT']) commit('SET_ROLES', ['ROLE_DEFAULT'])
} }
console.log(username,avatar,res.data.roles);
commit('SET_NAME', username) commit('SET_NAME', username)
commit('SET_AVATAR', avatar) commit('SET_AVATAR', avatar)
resolve(res) resolve(res)