Files
2025-04-30 14:04:34 +08:00

352 lines
15 KiB
Vue

<template>
<view class="page" :style="themeColor">
<!--选择性别开始 -->
<benben-picker ref="benbenWritePickerCodepicker0" :visible.sync="pickerDiy1683966462102" :value.sync='userInfo.sex' :options='sex_options' mode='selector' :mask-show='true' :timeout='true' :picker-height='88' default-type='value' :default-props='{"label":"name","value":"value"}' >
<template #picker-header>
<view class='flex flex-wrap align-center justify-between myProfile_picker0_0' >
<text @tap="$refs.benbenWritePickerCodepicker0.cancel()" >取消</text>
<text >选择性别</text>
<text class='myProfile_picker0_0_c2' @tap="$refs.benbenWritePickerCodepicker0.pickerConfirm()" >确认</text>
</view>
</template>
</benben-picker>
<!--选择性别结束 -->
<!--选择日期开始 -->
<benben-picker ref="benbenWritePickerCodepicker1" :visible.sync="pickerDiy1684137696643" :value.sync='userInfo.birthday' mode='date' :picker-height='88' :current='true' :mask-show='true' fields='day' :timeout='true' start-year='1990-01-01' end-year='2050-12-31' >
<template #picker-header>
<view class='flex flex-wrap align-center justify-between myProfile_picker1_0' >
<text @tap="$refs.benbenWritePickerCodepicker1.cancel()" >取消</text>
<text >选择生日</text>
<text class='myProfile_picker1_0_c2' @tap="$refs.benbenWritePickerCodepicker1.pickerConfirm()" >确认</text>
</view>
</template>
</benben-picker>
<!--选择日期结束 -->
<view class="flex benben-position-layout flex flex-wrap align-center myProfile_flex_2" :style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx'}">
<view class='flex flex-wrap align-center justify-between flex-sub myProfile_fd2_0' >
<view class='flex flex-wrap align-center' @tap.stop="handleJumpDiy" data-type="back" data-url="1" >
<text class='fu-iconfont2 myProfile_fd2_0_c0_c0' @tap.stop="handleJumpDiy" data-type="back" data-url="1" >&#xE794;</text>
</view>
<view class='flex flex-wrap align-stretch justify-center flex-sub' >
<text class='myProfile_fd2_0_c1_c0' >我的资料</text>
</view>
<view class='flex flex-wrap align-center myProfile_fd2_0_c2' >
</view>
</view>
</view>
<view :style="{height: (88+StatusBarRpx)+'rpx'}" ></view>
<view class="flex flex-direction flex-wrap align-stretch myProfile_flex_3" >
<view class='flex flex-wrap align-center justify-between myProfile_fd3_0' @tap.stop="popupShow1684399756741=true" >
<text class='myProfile_fd3_0_c0' >头像</text>
<view class="upload position-relative">
<image class=" myProfile_fd3_0_c1_image" mode="aspectFit" @tap="soloChooseImage('fd3_0_c1id','head_img',false,userInfo)" :src="userInfo.head_img ? userInfo.head_img : STATIC_URL+'1.png'"></image>
</view>
</view>
<view class='flex flex-wrap align-center justify-between myProfile_fd3_1' >
<text class='myProfile_fd3_1_c0' >ID</text>
<text class='myProfile_fd3_1_c1' >{{userInfo.id}}</text>
</view>
<view class='flex flex-wrap align-center justify-between myProfile_fd3_2' >
<text class='myProfile_fd3_2_c0' >昵称</text>
<input class='myProfile_fd3_2_c1' type="text" placeholder="请输入昵称" confirm-type="done" :maxlength="-1" placeholder-style="color:rgba(102, 102, 102, 1);font-size:32rpx" v-model="fd3_2_c1" />
</view>
<view class='flex flex-wrap align-center justify-between myProfile_fd3_3' @tap.stop="pickerDiy1683966462102=true" >
<text class='myProfile_fd3_3_c0' >性别</text>
<view class='flex flex-wrap align-center' >
<text class='myProfile_fd3_3_c1_c0' v-if= "userInfo.sex!='1' && userInfo.sex!='2'" >请选择性别</text><text class='myProfile_fd3_3_c1_c0_1' v-if= "userInfo.sex=='1'" ></text><text class='myProfile_fd3_3_c1_c0_2' v-if= "userInfo.sex=='2'" ></text>
</view>
</view>
<view class='flex flex-wrap align-center justify-between myProfile_fd3_4' @tap.stop="pickerDiy1684137696643=true" >
<text class='myProfile_fd3_4_c0' >生日</text>
<input class='flex-sub myProfile_fd3_4_c1' type="text" placeholder="请选择生日" confirm-type="done" :maxlength="30" :disabled='true' placeholder-style="color:rgba(102, 102, 102, 1);font-size:32rpx" v-model="userInfo.birthday" />
</view>
</view>
<!--选择性别开始 -->
<benben-picker ref="benbenWritePickerCodepicker4" :visible.sync="pickerDiy1683966462102" :value.sync='userInfo.sex' :options='sex_options' mode='selector' :mask-show='true' :timeout='true' :picker-height='88' default-type='value' :default-props='{"label":"name","value":"value"}' >
<template #picker-header>
<view class='flex flex-wrap align-center justify-between myProfile_picker4_0' >
<text @tap="$refs.benbenWritePickerCodepicker4.cancel()" >取消</text>
<text >选择性别</text>
<text class='myProfile_picker4_0_c2' @tap="$refs.benbenWritePickerCodepicker4.pickerConfirm()" >确认</text>
</view>
</template>
</benben-picker>
<!--选择性别结束 -->
<!--选择日期开始 -->
<benben-picker ref="benbenWritePickerCodepicker5" :visible.sync="pickerDiy1684137696643" :value.sync='userInfo.birthday' mode='date' :picker-height='88' :current='true' :mask-show='true' fields='day' :timeout='true' start-year='1990-01-01' end-year='2050-12-31' >
<template #picker-header>
<view class='flex flex-wrap align-center justify-between myProfile_picker5_0' >
<text @tap="$refs.benbenWritePickerCodepicker5.cancel()" >取消</text>
<text >选择生日</text>
<text class='myProfile_picker5_0_c2' @tap="$refs.benbenWritePickerCodepicker5.pickerConfirm()" >确认</text>
</view>
</template>
</benben-picker>
<!--选择日期结束 -->
<view class="flex flex-direction flex-wrap align-center justify-end benben-position-layout flex myProfile_flex_6" >
<button class='myProfile_fd6_0' >保存</button>
</view>
<view :style="{height: '110rpx'}" ></view>
<benben-popup v-model="popupShow1684399756741" :mask="true" mode='bottom'>
<!---我的资料修改头像弹窗flex布局开始-->
<view class="flex flex-direction flex-wrap align-stretch myProfile_flex_7" >
<view class='flex flex-wrap align-center myProfile_fd7_0' >
</view>
<text class='myProfile_fd7_1' >修改头像</text>
<view class='flex flex-wrap align-center myProfile_fd7_2' >
</view>
<text class='myProfile_fd7_3' >拍照</text>
<text class='myProfile_fd7_4' >从手机相册选择</text>
<view class='flex flex-wrap align-center myProfile_fd7_5' >
</view>
<text class='myProfile_fd7_6' @tap.stop="popupShow1684399756741=false" >取消</text>
</view>
<!---我的资料修改头像弹窗flex布局结束-->
</benben-popup>
</view>
</template>
<script>
import UploadImage from '@/common/utils/upload-image.js'
import {validate} from '@/common/utils/validate.js'
export default {
components:{},
data(){
return {"popupShow1684399756741":false,"pickerDiy1684137696643":false,"pickerDiy1683966462102":false,"fd3_0_c1id":"","fd3_2_c1":"","userInfo":{"invite_code":"","address":"","address_code":"","address_citycode":"","id":"","lastid":"","user_nickname":"","mobile":"","user_name":"","head_img":"","birthday":"","is_finger":"","user_money":"","freeze_money":"","withdrawal_money":"","score":"","empirical":"","invoice_title":"","invoice_company_title":"","total_consumption_money":"","sex":"","create_time":"","phone":"","online":"","_mobile":"","coupon":"","age":"","collection_count":"","browse_count":"","certified":"","invite":[]},"sex_options":[{"name":"男","value":"1","image":""},{"name":"女","value":"2","image":""}],"user":{"userinfo":{"id":"","avatar":"","real_name":"","nickname":"","email":"","gender":"","mobile":"","birthday":"","client_id":"","phone":""}}};
},
computed:{
themeColor() {
return this.$store.getters.themeColor
},
},
watch:{},
onLoad(options){
},
onUnload() {
},
onReady(){
},
onShow(){
},
onHide(){
},
onResize(){
},
onPullDownRefresh(){
},
onReachBottom(e){
},
onPageScroll(e){
},
methods:{
//上传单图、多图方法
soloChooseImage(id, path, obj, obj1, fnName = false) {
let self = this
if (!obj) obj = this
if (!obj1) obj1 = this
if (self.uploading) {
return
}
// 从相册中选择图片
uni.chooseImage({
count: 1, // 默认3
sizeType: ['original', 'compressed'], // 可以指定是原图还是压缩图,默认二者都有
success: function (res) {
self.uploading = true
// 开始上传
new UploadImage(res.tempFiles, {
complete: function (res) {
self.uploading = false
if (id) self.$set(obj, id, res[0].id)
if (path) self.$set(obj1, path, res[0].path)
if (fnName) self[fnName]()
},
})
},
})
},
//获取用户详细信息
async queryUserInfoFunc(){
//请求方法
//数据验证
let datauserInfo = await this.$api.post(global.apiUrls.post5c78c4772da97, {
});
if (datauserInfo.data.code != 1) {
this.$message.info(datauserInfo.data.msg);
return
}
let infouserInfo = datauserInfo.data;
this.userInfo = infouserInfo.data
},
//修改用户资料
async setUserInfoFunc(){
//请求方法
//数据验证
let datauser = await this.$api.post(global.apiUrls.post5cb54af125f1c, {
avatarUrl:this.userInfo.head_img,nickName:this.userInfo.user_nickname,gender:this.userInfo.sex,birthday:this.userInfo.birthday
});
if (datauser.data.code != 1) {
this.$message.info(datauser.data.msg);
return
}
let infouser = datauser.data;
this.user = infouser.data
}
}
};
</script>
<style lang="scss" scoped>
.page{
width: 100vw;
overflow-x: hidden;
min-height: calc(100vh - var(--window-bottom));
background:rgba(248, 248, 248, 1);background-size: 100% auto !important;
}
.myProfile_picker0_0_c2{
color:rgba(255, 147, 0, 1);
}
.myProfile_picker0_0{
border-bottom:1px solid #eee;background:#fff;padding:0rpx 32rpx 0rpx 32rpx;line-height:88rpx;border-radius:25rpx 25rpx 0rpx 0rpx;background-size:100% auto !important;
}
.myProfile_picker1_0_c2{
color:rgba(255, 147, 0, 1);
}
.myProfile_picker1_0{
border-bottom:1px solid #eee;background:#fff;padding:0rpx 32rpx 0rpx 32rpx;line-height:88rpx;border-radius:25rpx 25rpx 0rpx 0rpx;background-size:100% auto !important;
}
.myProfile_flex_2{
border-bottom:1px solid #eee;background:#fff;width:750rpx;height:88rpx;overflow:hidden;z-index:10;top:0rpx;background-size:100% auto !important;
}
.myProfile_fd2_0_c2{
width:32rpx;height:32rpx;
}
.myProfile_fd2_0_c1_c0{
font-size:36rpx;font-weight:500;color:#333;line-height:88rpx;
}
.myProfile_fd2_0_c0_c0{
font-size:32rpx;font-weight:500;color:#333;line-height:88rpx;
}
.myProfile_fd2_0{
margin:0rpx 32rpx 0rpx 32rpx;
}
.myProfile_flex_3{
background:#fff;padding:0rpx 0rpx 0rpx 32rpx;
}
.myProfile_fd3_4_c1{
line-height:45rpx;font-size:32rpx;font-weight:400;color:#333;text-align:right;margin:0rpx 0rpx 0rpx 48rpx;
}
.myProfile_fd3_4_c0{
font-size:32rpx;font-weight:400;color:rgba(51, 51, 51, 1);
}
.myProfile_fd3_4{
border-bottom:1px solid #eee;padding:32rpx 32rpx 32rpx 0rpx;
}
.myProfile_fd3_3_c1_c0_2{
font-size:32rpx;color:var(--benbenFontColor1);text-align:right;
}
.myProfile_fd3_3_c1_c0_1{
font-size:32rpx;color:var(--benbenFontColor1);text-align:right;
}
.myProfile_fd3_3_c1_c0{
font-size:32rpx;color:var(--benbenFontColor1);text-align:right;
}
.myProfile_fd3_3_c0{
font-size:32rpx;font-weight:400;color:rgba(51, 51, 51, 1);
}
.myProfile_fd3_3{
border-bottom:1px solid #eee;padding:32rpx 32rpx 32rpx 0rpx;
}
.myProfile_fd3_2_c1{
text-align:right;
}
.myProfile_fd3_2_c0{
font-size:32rpx;font-weight:400;color:rgba(51, 51, 51, 1);
}
.myProfile_fd3_2{
border-bottom:1px solid #eee;padding:32rpx 32rpx 32rpx 0rpx;
}
.myProfile_fd3_1_c1{
font-size:32rpx;font-weight:400;color:#666666;max-width:400rpx;-webkit-line-clamp:1;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-box-orient:vertical;line-height:32rpx;
}
.myProfile_fd3_1_c0{
font-size:32rpx;font-weight:400;color:rgba(51, 51, 51, 1);
}
.myProfile_fd3_1{
border-bottom:1px solid #eee;padding:32rpx 32rpx 32rpx 0rpx;
}
.myProfile_fd3_0_c1_image{
width:100rpx;height:100rpx;border-radius:50rpx 50rpx 50rpx 50rpx;
}
.myProfile_fd3_0_c0{
font-size:32rpx;font-weight:400;color:rgba(51, 51, 51, 1);
}
.myProfile_fd3_0{
border-bottom:1px solid #eee;padding:32rpx 32rpx 32rpx 0rpx;
}
.myProfile_picker4_0_c2{
color:#4781f5;
}
.myProfile_picker4_0{
border-bottom:1px solid #eee;background:#fff;padding:0rpx 32rpx 0rpx 32rpx;line-height:88rpx;border-radius:25rpx 25rpx 0rpx 0rpx;background-size:100% auto !important;
}
.myProfile_picker5_0_c2{
color:#4781f5;
}
.myProfile_picker5_0{
border-bottom:1px solid #eee;background:#fff;padding:0rpx 32rpx 0rpx 32rpx;line-height:88rpx;border-radius:25rpx 25rpx 0rpx 0rpx;background-size:100% auto !important;
}
.myProfile_flex_6{
background:rgba(244, 244, 244, 1);width:750rpx;height:110rpx;overflow:hidden;z-index:10;background-size:100% auto !important;bottom:calc(0rpx + var(--window-bottom));
}
.myProfile_fd6_0{
background:rgba(255, 255, 255, 1);border-radius:0rpx 0rpx 0rpx 0rpx;font-size:32rpx;color:rgba(255, 147, 0, 1);width:750rpx;height:110rpx;font-weight:500;line-height:110rpx;
}
.myProfile_flex_7{
background:#fff;border-radius:24rpx 24rpx 0rpx 0rpx;background-size:#eee;
}
.myProfile_fd7_6{
text-align:center;font-size:32rpx;padding:28rpx 0rpx 28rpx 0rpx;color:rgba(255, 147, 0, 1);
}
.myProfile_fd7_5{
background:rgba(246, 247, 249, 1);width:750rpx;height:20rpx;background-size:#eee;
}
.myProfile_fd7_4{
border-bottom:1px solid #eee;text-align:center;padding:28rpx 0rpx 28rpx 0rpx;font-size:32rpx;
}
.myProfile_fd7_3{
border-bottom:1px solid #eee;text-align:center;font-size:32rpx;padding:28rpx 0rpx 28rpx 0rpx;
}
.myProfile_fd7_2{
background:rgba(238, 238, 238, 1);width:750rpx;height:1rpx;background-size:#eee;
}
.myProfile_fd7_1{
border-bottom:1px solid #eee;text-align:center;font-size:32rpx;padding:28rpx 0rpx 28rpx 0rpx;
}
.myProfile_fd7_0{
background:rgba(238, 238, 238, 1);width:750rpx;height:1rpx;background-size:#eee;
}
</style>