首页修改用户信息修改

This commit is contained in:
zzyuan 2025-04-22 17:39:56 +08:00
parent dd8b25fb55
commit 8885c74fcb
9 changed files with 123 additions and 156 deletions

View File

@ -43,7 +43,7 @@ export function saveUserHeaderPhoto(data) {
// 修改用户个人信息
export function updateUserProfile(data) {
return request({
url: '/smart-canteen/custCasual/updateDetailInfoCasualForApp',
url: '/system/user/edit',
method: 'post',
data: data
})

View File

@ -35,13 +35,13 @@
</view> -->
<view class="handle-box">
<view class="handle-box-item" @click="goCode" style="background: #F7FFF5;">
<!-- <view class="handle-box-item" @click="goCode" style="background: #F7FFF5;">
<view class="image-box">
<image src="/static/images/index/code.png" style="width: 100%;height: 100%;" mode="aspectFit"></image>
</view>
<view class="box-title">个人二维码</view>
<view class="box-subtitle">核身支付核销</view>
</view>
</view> -->
<view class="handle-box-item" @click="goToRemainingSum" style="background: #F4FFFF;">
<view class="image-box">
@ -50,7 +50,7 @@
<view class="box-title">个人余额</view>
<view class="box-subtitle">
<text style="font-size: 24rpx;color: #333;margin-right: 6rpx;">¥</text>
<text style="font-size: 48rpx;font-weight: 700;color: #FF6816;">{{ (walletBal/100).toFixed(2) }}</text>
<text style="font-size: 40rpx;font-weight: 700;color: #FF6816;">{{ (walletBal/100).toFixed(2) }}</text>
<text style="font-size: 24rpx;color: #333;margin-left: 6rpx;"></text>
</view>
</view>
@ -69,51 +69,8 @@
</view>
<view class="box-title">预定餐</view>
<view class="box-subtitle">智能预定鲜活</view>
</view>
</view>
<!-- 功能按钮区 -->
<!-- <view class="function-area">
<view class="function-item" @click="goToMenu">
<view class="icon-box menu">
<image src="/static/images/index/weeklyMenu.png" mode="aspectFit"></image>
</view>
<text class="function-text">一周菜谱</text>
</view>
<view class="function-item" @click="goToOrder">
<view class="icon-box order">
<image src="/static/images/index/food.png" mode="aspectFit"></image>
</view>
<text class="function-text">预订餐</text>
</view>
</view> -->
<!-- 底部信息区 -->
<!-- <view class="bottom-info">
<view class="qr-area" @click="goCode">
<view class="qr-title">个人二维码</view>
<view class="qr-subtitle">核身支付核销</view>
<view class="qr-code">
<image src="/static/images/index/code.png" mode="aspectFit"></image>
</view>
</view>
<view class="balance-area">
<view class="balance-text" @click="goToRemainingSum">
<text class="balance-label">余额/充值</text>
<view class="balance-amount">
<text class="currency">¥</text>
<text class="amount">{{ (walletBal/100).toFixed(2) }}</text>
</view>
<view class="wallet-icon">
<image src="/static/images/index/balance.png" mode="aspectFit"></image>
</view>
</view>
</view>
</view> -->
</view>
</view>
<u-popup :show="showNotice" mode="center" @close="close" @open="open" >
<view style="width: 70vw;height: 30vh;">
@ -372,15 +329,16 @@ view {
width: 100%;
height: auto;
display: flex;
justify-content: center;
flex-wrap: wrap;
margin-bottom: 30rpx;
.handle-box-item {
width: 44%;
margin: 3%;
width: 28%;
margin: 2%;
background-color: #ffffff;
border-radius: 12rpx;
padding: 30rpx 20rpx;
padding: 20rpx 10rpx;
display: flex;
flex-direction: column;
justify-content: center;
@ -388,9 +346,9 @@ view {
box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.04);
.image-box{
width: 80px;
height: 70px;
margin-bottom: 20rpx;
width: 60px;
height: 40px;
margin-bottom: 10rpx;
}
.box-title{
font-size: 32rpx;
@ -398,7 +356,7 @@ view {
margin-bottom: 20rpx;
}
.box-subtitle{
font-size: 28rpx;
font-size: 24rpx;
// font-weight: bold;
}

View File

@ -1,6 +1,9 @@
<template>
<page-meta :page-font-size="fontValue+'px'" :root-font-size="fontValue+'px'"></page-meta>
<view class="message-page">
<view class="message-page">
<view v-if="messageList.length == 0" class="flex justify-center align-center" style="height: 50vh">
<u-empty icon="../../../static/images/not_order.png" text="暂无数据" textColor="#000" />
</view>
<!-- 列表 -->
<scroll-view style="width: 100%;height: 92vh;" @scrolltolower="onScrollTolower" scroll-y="true">
<view class="message-item" v-for="(item, index) in messageList" :key="index">
@ -68,7 +71,7 @@ export default {
const res = await canteenEvaluateListAPI(param)
console.log(res)
// this.messageList = res.rows
this.total = res.total;
this.total = Number(res.total);
if(this.pageNum==1){
this.messageList = res.rows
}else{

View File

@ -126,17 +126,10 @@
walletBal: 0 ,//
}
},
onLoad() {
this.getUserInfo()
onLoad() {
this.getWalletBalance()
},
methods: {
//
getUserInfo(){
this.$store.dispatch('GetInfo').then(res => {
console.log(res)
})
},
//
async getWalletBalance(userId) {
let param = {
@ -160,8 +153,6 @@
// })
})
},
avatarClick() {
this.avatarShow = true
},

View File

@ -34,19 +34,21 @@
<view class="info-item">
<text class="label">手机号</text>
<view class="value-wrapper">
<text class="value">{{userInfo.mobile}}</text>
<!-- <u--input v-model="userInfo.phonenumber" style="font-size: 32rpx;color: #333;" border="none" maxlength="11"></u--input> -->
<uni-easyinput v-model="userInfo.phonenumber" :inputBorder="false" :clearable="false" placeholder="请输入手机号" maxlength="11" color="#333" class="fs32" style="text-align: right;" />
<!-- <text class="value">{{userInfo.phonenumber}}</text> -->
<image class="arrow-icon" :src="require('@/static/images/my/enter.png')" mode="aspectFit"></image>
</view>
</view>
<!-- 性别 -->
<view class="info-item">
<!-- <view class="info-item">
<text class="label">性别</text>
<view class="value-wrapper" @click="sexShow=true">
<text class="value" :class="userInfo.sex? '' :'placeholder'">{{userInfo.sexStr || '填选择性别'}}</text>
<image class="arrow-icon" :src="require('@/static/images/my/enter.png')" mode="aspectFit"></image>
</view>
</view>
</view> -->
<!-- 生日 -->
<view class="info-item">
@ -58,38 +60,35 @@
</view>
<!-- 年龄 -->
<view class="info-item">
<!-- <view class="info-item">
<text class="label">年龄</text>
<view class="value-wrapper">
<text class="value">{{userInfo.age}}</text>
<image class="arrow-icon" :src="require('@/static/images/my/enter.png')" mode="aspectFit"></image>
</view>
</view>
</view> -->
<!-- 身份证号码 -->
<view class="info-item">
<!-- <view class="info-item">
<text class="label">身份证号码</text>
<view class="value-wrapper">
<u--input v-model="userInfo.idCard" style="font-size: 32rpx;color: #333;" border="none" maxlength="24"></u--input>
<!-- <text class="value">{{userInfo.idCard}}</text> -->
<!-- <image class="arrow-icon" :src="require('@/static/images/my/enter.png')" mode="aspectFit"></image> -->
</view>
</view>
</view> -->
<!-- 邮箱 -->
<view class="info-item">
<!-- <view class="info-item">
<text class="label">邮箱</text>
<view class="value-wrapper">
<u--input v-model="userInfo.email" style="font-size: 32rpx;color: #333;" border="none" maxlength="30"></u--input>
</view>
</view>
</view> -->
<!-- 地址 -->
<view class="info-item">
<!-- <view class="info-item">
<text class="label">地址</text>
<view class="value-wrapper">
<u--input v-model="userInfo.homeAddr" border="none" maxlength="30"></u--input>
<!-- <image class="arrow-icon" :src="require('@/static/images/my/enter.png')" mode="aspectFit"></image> -->
</view>
</view>
</view> -->
</view>
@ -101,7 +100,7 @@
</view>
<!-- 提交按钮 -->
<view style="padding: 20rpx 30rpx;margin-top: 20px;">
<view style="padding: 20rpx 30rpx;margin-top: 20px;position:absolute;bottom: 5vh;width: 100%;">
<u-button
text="保存"
shape="squrd"
@ -121,8 +120,7 @@
<script>
import Cookies from "js-cookie";
import {
getUserProfile,
import {
uploadAvatar,
updateUserProfile,
saveUserHeaderPhoto
@ -155,12 +153,18 @@
},
methods: {
getUserInfo() {
getUserProfile({'userId':Cookies.get('userId'),"sourceType":7}).then(res => {
this.userInfo = res.data;
this.userInfo.sex = this.userInfo.sex-1
this.userInfo.sexStr = this.columns[0][this.userInfo.sex]
console.log('this.userInfo',this.userInfo)
this.$store.dispatch('GetInfo').then(res => {
console.log(res)
this.userInfo = res.user;
this.userInfo.postIds = res.postIds||[]
this.userInfo.roleIds = res.roleIds||[]
})
// getUserProfile({'userId':Cookies.get('userId'),"sourceType":7}).then(res => {
// this.userInfo = res.data;
// this.userInfo.sex = this.userInfo.sex-1
// this.userInfo.sexStr = this.columns[0][this.userInfo.sex]
// console.log('this.userInfo',this.userInfo)
// })
},
goBack() {
@ -184,20 +188,19 @@
},
saveUserInfo(){
console.log(this.userInfo)
let param = {
"userId":Cookies.get('userId'),
"mobile":this.userInfo.mobile,
"sex":this.userInfo.sex+1,
"birthday":this.userInfo.birthday,
"age":this.userInfo.age,
"idCard":this.userInfo.idCard,
"email":this.userInfo.email,
"homeAddr":this.userInfo.homeAddr,
"pwd":Cookies.get('pwd'),
"sourceType":7
}
console.log(param)
updateUserProfile(param).then(res => {
// let param = {
// "userId":Cookies.get('userId'),
// "phonenumber":this.userInfo.phonenumber,
// "sex":this.userInfo.sex+1,
// "birthday":this.userInfo.birthday,
// "age":this.userInfo.age,
// "idCard":this.userInfo.idCard,
// "email":this.userInfo.email,
// "homeAddr":this.userInfo.homeAddr,
// "pwd":Cookies.get('pwd'),
// "sourceType":7
// }
updateUserProfile(this.userInfo).then(res => {
if(res.code==200){
uni.showToast({
title: '保存成功',
@ -319,6 +322,7 @@
.container {
min-height: 100vh;
background-color: #FBFCFF;
position: relative;
}
.form-container {
@ -399,4 +403,13 @@
}
}
}
.fs32{
& :nth-child(1){
font-size: 32rpx;
}
& :nth-child(2){
font-size: 32rpx;
}
}
</style>

View File

@ -51,10 +51,10 @@ export default {
title: '基本信息',
path: '/pages/mine/me/basicInfo'
},
// {
// title: '',
// path: '/pages/mine/me/myAddress'
// },
{
title: '我的地址',
path: '/pages/mine/me/myAddress'
},
{
title: '健康信息',
path: '/pages/mine/me/healthInformation'
@ -67,10 +67,10 @@ export default {
title: '修改密码',
path: '/pages/mine/me/changePassword'
},
{
title: '绑定手机号',
path: '/pages/mine/me/bindingPhone'
},
// {
// title: '',
// path: '/pages/mine/me/bindingPhone'
// },
{
title: '挂失解绑',
path: '/pages/mine/me/carteenCard'

View File

@ -2,6 +2,9 @@
<page-meta :page-font-size="fontValue+'px'" :root-font-size="fontValue+'px'"></page-meta>
<view class="address-list">
<Navbar title="我的地址" :showRightText="true" :isBack="false" :text="'新增地址'" @clickIcon="addAddress"/>
<view v-if="addressList.length == 0" class="flex justify-center align-center" style="height: 50vh">
<u-empty icon="../../../static/images/not_order.png" text="暂无数据" textColor="#000" />
</view>
<view v-for="(item, index) in addressList" :key="index" class="address-item">
<view class="address-info">
<text class="address-text">{{ item.addrFullName }} {{item.detailAddr}}</text>

View File

@ -1,25 +1,26 @@
<template>
<page-meta :page-font-size="fontValue+'px'" :root-font-size="fontValue+'px'"></page-meta>
<view class="report-detail">
<view style="border-bottom: 1rpx solid #ccc;margin-bottom: 20rpx;">
<u-loading-page :loading="sumbitStaus" loading-text="提交中..."></u-loading-page>
<view style="border-bottom: 1rpx solid #ccc;margin-bottom: 20rpx;" v-if="!sumbitStaus">
<view class="info-item">
<text class="label">体检日期</text>
<view class="label">体检日期</view>
<view class="value-wrapper" @click="dateShow=true">
<text class="value" :class="medicalDate? '' :'placeholder'">{{medicalDate || '请选择体检日期'}}</text>
<!-- <uni-easyinput v-model="medicalDate" placeholder="请选择体检日期" border="none" maxlength="24" /> -->
<view class="value" :class="medicalDate? '' :'placeholder'">{{medicalDate || '请选择体检日期'}}</view>
</view>
</view>
<view class="info-item">
<text class="label">体检机构</text>
<view class="value-wrapper">
<u--input v-model="medicalMechanism" placeholder="请输入体检机构" border="none" maxlength="24"></u--input>
<view class="label">体检机构</view>
<view class="value-wrapper" style="border: none;">
<uni-easyinput v-model="medicalMechanism" placeholder="请输入体检机构" maxlength="24" />
</view>
</view>
</view>
</view>
<u-datetime-picker :minDate="minDate" :maxDate="maxDate" :show="dateShow" v-model="defaultDate" mode="date"
:closeOnClickOverlay="true" :formatter="formatter" @cancel="dateShow = false" @confirm="birthDayConfirm">
</u-datetime-picker>
<scroll-view style="width: 100%;height: 72vh;" scroll-y="true">
<scroll-view style="width: 100%;height: 70vh;" scroll-y="true" v-if="!sumbitStaus">
<view style="height: auto;padding-bottom: 20rpx;">
<view v-for="(item,index) in reportList":key="index">
<view class="list-title">
@ -31,14 +32,14 @@
<text v-if="dItem.medicalProjectDetailUnit">({{ dItem.medicalProjectDetailUnit }})</text>
</view>
<view class="value-wrapper">
<u--input v-model="dItem.result" :placeholder="'请输入'+dItem.medicalProjectDetailName" border="none" maxlength="24"></u--input>
<u-input v-model="dItem.result" :placeholder="'请输入'+dItem.medicalProjectDetailName" border="none" maxlength="24"></u-input>
</view>
</view>
</view>
</view>
</scroll-view>
<!-- 提交按钮 -->
<view class="submit-btn">
<view class="submit-btn" v-if="!sumbitStaus">
<u-button
shape="squrd"
@click="saveReport"
@ -51,8 +52,7 @@
}" style="font-size: 28rpx;"
>保存</u-button>
</view>
</view>
</template>
@ -73,7 +73,7 @@ export default {
paramsData:{},
medicalTemplateId:"",
reportList:[],
sumbitStaus:true
sumbitStaus:false
}
},
onLoad(opt) {
@ -119,9 +119,9 @@ export default {
this.reportList = res
console.log(res, '详情--------')
},
async saveReport() {
if(this.sumbitStaus){
this.sumbitStaus=false
saveReport() {
if(!this.sumbitStaus){
this.sumbitStaus=true
let param = {}
if(this.paramsData.medicalId&&this.paramsData.medicalId!=""){
param = {
@ -141,19 +141,17 @@ export default {
"reportProjectVOS":this.reportList
}
}
const res = await editMedicalReportApi(param)
if(res.code==200){
this.sumbitStaus=true
uni.showToast({
title: '提交成功',
icon: 'none'
});
setTimeout(()=>{
uni.navigateBack()
},800)
}else{
this.sumbitStaus=true
}
editMedicalReportApi(param).then((res)=>{
if(res.code==200){
this.sumbitStaus=false
uni.navigateBack()
}else{
this.sumbitStaus=false
}
}).catch(()=>{
this.sumbitStaus=false
})
}
},
@ -198,23 +196,24 @@ export default {
}
.label {
width: 25%;
font-size: 32rpx;
color: #333;
margin-right: 20rpx;
margin-right: 10rpx;
}
.value-wrapper {
display: flex;
align-items: center;
border: 1px solid #999;
border: 1px solid rgb(229, 229, 229);
border-radius: 10rpx;
width: 70%;
height: 60rpx;
height: 70rpx;
.value {
font-size: 32rpx;
font-size: 28rpx;
color: #333;
margin-right: 16rpx;
padding-left: 16rpx;
&.placeholder {
color: #999;
}
@ -251,8 +250,8 @@ export default {
.value-wrapper {
display: flex;
align-items: center;
/* border: 1px solid #999;
border-radius: 10rpx; */
border: 1px solid rgb(229, 229, 229);
border-radius: 10rpx;
width: 60%;
height: 60rpx;
}

View File

@ -98,7 +98,7 @@
v-for="(item, index) in dateOptions"
:key="index"
class="date-option"
:class="{ active: currentDateOption === index }"
:class="{ active: currentDateOption == index }"
@click="selectDateOption(index)"
>
{{ item.label }}
@ -407,13 +407,13 @@ export default {
},
//
selectDateOption(index) {
this.currentDateOption = index
const months = this.dateOptions[index].value
const end = new Date()
const start = new Date()
this.currentDateOption = Number(index)
const months = Number(this.dateOptions[index].value)
const end = new Date()
const start = new Date()
start.setMonth(start.getMonth() - months)
this.startDate = this.formatDate(start)
this.endDate = this.formatDate(end)
this.startDate = this.formatDate(start)
this.endDate = this.formatDate(end)
},
selectStartDate(e) {
console.log('selectStartDate', e)