Commit 281edbf5 authored by 罗超's avatar 罗超

1

parent a3072cea
<template>
<view class="page">
<view class="header">
<text>
编辑个人主页
</text>
</view>
<view class="dataBox">
<view v-for="(item,index) in dataList" :key="index">
<view class="itemBox">
<view class="tip" v-if="item.tip">
{{item.tip}}
</view>
<view class="name">
{{item.name}} <text v-if="item.tip2" class="tip2">{{item.tip2}}</text>
</view>
<view class="imgBox" v-if="item.type==1">
<view class="left">
<image src="" mode="widthFix" class="img1"></image>
<view class="subImgBox">
<image src="" mode="widthFix" class="img2"></image>
<image src="" mode="widthFix" class="img2"></image>
<image src="" mode="widthFix" class="img2"></image>
</view>
</view>
<view class="right">
<image src="" mode="widthFix" class="img2"></image>
<image src="" mode="widthFix" class="img2"></image>
<image src="" mode="widthFix" class="img2"></image>
<image src="" mode="widthFix" class="img2"></image>
</view>
</view>
<view class="conBox" v-if="item.type==2">
<view v-for="(item1,index1) in item.childDataList" :key="index1">
<view class="subItemBox">
<view class="subName">
{{item1.name}}
</view>
<input type="text" :placeholder="item1.placehloder" class="subInput" v-if="item1.subType==1"/>
<view class="unit" v-if="item1.unit">
{{item1.unit}}
</view>
<view class="subpicker">
<picker :mode ="item1.mode" class="subpicker" :range="item1.array" v-if="item1.subType==2" @change="changPicker($event,item1.field,item1.mode,item1.array)">
<input class="subInput" disabled type="text" :placeholder="item1.placehloder" v-model="data[item1.field]" />
</picker>
</view>
</view>
</view>
</view>
<view class="conBox" v-if="item.type==3">
<textarea v-model="data[item.field]" class="textareaBox" :placeholder="item.placehloder" />
</view>
</view>
</view>
</view>
<view class="saveBtn">
保存
</view>
</view>
</template>
<script>
export default{
data(){
return{
time:"0",
pageTitle:"",
mainColor: "",
dataList:[{
name:"相册",
data:{},
type:1
},{
name:"基础资料",
tip:"基本资料(实名认证通过后,部分资料无法修改)",
data:{},
//subType:1输入框,2选择框
childDataList:[{
name:"昵称",
field:"",
placehloder:"请填写昵称",
subType:1
},{
name:"性别",
field:"Sex",
placehloder:"请选择性别",
subType:2,
array:['男','女'],
mode:"selector"
},{
name:"出生日期",
field:"Birthday",
placehloder:"请填写出生日期",
subType:2,
array:"",
mode:"date"
},{
name:"身高",
field:"Height",
placehloder:"请填写身高",
subType:1,
unit:"厘米"
},{
name:"体重",
field:"Weight",
placehloder:"请填写体重",
subType:1,
unit:"公斤"
},{
name:"学历",
field:"EducationType",
placehloder:"请选择学历",
subType:2,
array:['高中','大专','本科','研究生'],
mode:"selector"
},{
name:"毕业院校",
field:"SchoolInfo",
placehloder:"请填写毕业院校",
subType:1,
},{
name:"婚姻",
field:"Marriage",
placehloder:"请选择婚姻状况",
subType:2,
array:['未婚','已婚','离异','丧偶'],
mode:"selector"
},{
name:"职位",
field:"Job",
placehloder:"请填写职位",
subType:1
},{
name:"工作单位",
field:"WorkUnit",
placehloder:"请填写工作单位",
subType:1
},{
name:"年收入",
field:"YearMoney",
placehloder:"请填写年收入",
subType:1,
unit:"万"
},{
name:"籍贯",
field:"nativePlace",
placehloder:"请选择籍贯",
subType:2,
array:[],
mode:"region"
},{
name:"资产",
field:"HouseInfo",
placehloder:"请填写资产",
subType:1,
}],
type:2
},{
name:"家庭背景",
field:"FamilyInfo",
placehloder:"家庭成员、工作、成长环境等",
type:3
},{
name:"业余爱好",
field:"Hobby",
placehloder:"唱歌、跳街舞、拍照、旅游、看电影、画画、自驾游、等",
type:3
},{
name:"喜欢的食物",
field:"LikeFood",
placehloder:"草莓、西瓜、蛋糕、奶油、牛排、奶茶等",
type:3
},{
name:"喜欢的书",
field:"LikeBook",
placehloder:"写下你喜欢的书的名称",
type:3
},{
name:"喜欢的电影和电视剧",
field:"LikeTV",
placehloder:"写下你喜欢的电影和电视剧的名称",
type:3
},{
name:"喜欢的一首情歌",
field:"LikeSong",
placehloder:"写下你喜欢的歌曲名称",
type:3
},{
name:"欣赏哪对名人的爱情,原因是什么",
field:"IdealLove",
placehloder:"快来说说吧",
type:3
},{
name:"你听过最美的情话",
field:"LoveTalk",
placehloder:"曾经有一份爱情摆在我面前...",
type:3
},{
name:"为什么单身",
field:"SingleReason",
placehloder:"写下自己单身的原因",
type:3
},{
name:"自我介绍",
field:"",
placehloder:"介绍自己",
type:3
},{
name:"希望的TA是...",
field:"HopeYou",
placehloder:"希望心中的TA是一个什么样的人",
type:3
},{
name:"约会档期",
tip2:"(方便约见的时间和地点)",
field:"FamilyInfo",
// placehloder:"希望心中的TA是一个什么样的人",
type:2,
childDataList:[{
name:"时间",
field:"",
placehloder:"请选择约见的时间",
subType:2,
array:[],
mode:"time"
},{
name:"地点",
field:"Marriage",
placehloder:"请填写方便的地点",
subType:1,
},]
},
],
data:{
Sex:"",
Birthday:"",
Height:"",
Weight:"",
EducationType:"",
SchoolInfo:"",
Marriage:"",
Job:"",
WorkUnit:"",
YearMoney:"",
// NativePlace:"",//籍贯(省)
// HuKou:"",//籍贯(国家)
HouseInfo:"",
nativePlace:"",//自定义籍贯
FamilyInfo:"",
Hobby:"",
LikeFood:"",
LikeBook:"",
LikeTV:"",
LikeSong:"",
IdealLove:"",
LoveTalk:"",
SingleReason:"",
HopeYou:"",
Appointment:"",
AppointmentAddress:"",
CName:"",//市名称
DName:"",//区名称
PName:"",//省名称
}
}
},
methods:{
changPicker(arg,e,mode,arr){
console.log(arg,e,mode,arr)
if(mode=="selector"){
this.data[e]=arr[arg.detail.value]
}else if(mode=="date"){
this.data[e]=arg.detail.value
console.log(this.data[e])
}else if(mode=="region"){
this.data[e]=arg.detail.value
console.log(this.data[e])
}
},
chooseImg() {
let that = this
uni.chooseImage({
count: 1, //默认9
sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
sourceType: ['album'], //从相册选择
success: function(res) {
console.log(res)
}
});
},
upFile(img, resCall) {
var that = this;
wx.showLoading({
title: '上传中'
})
let MallBaseId = uni.getStorageSync("mall_UserInfo").MallBaseId ? uni.getStorageSync("mall_UserInfo")
.MallBaseId : 1;
let action = that.host2 + '/api/File/UploadTencent?MallBaseId=' + MallBaseId
uni.uploadFile({
url: action,
filePath: img,
name: 'field',
formData: {
user: 'test'
},
success: (uploadFileRes) => {
uni.hideLoading()
resCall(uploadFileRes)
},
fail: function(res) {
that.businessLicenseUploadIsSuccess = false
wx.showToast({
title: '上传失败!',
icon: 'none',
duration: 1000
})
}
});
},
saveData(){
}
},
created() {
this.mainColor = this.$uiConfig.mainColor;
// this.secondary = this.$uiConfig.secondary;
// this.pricecolor = this.$uiConfig.pricecolor;
},
mounted() {
}
}
</script>
<style lang="scss" scoped>
.page{
padding: 0 30rpx 65rpx;
.header{
height: 88rpx;
display: flex;
justify-content: center;
align-items: center;
font-size: 32rpx;
font-weight: 800;
color: #111111;
}
.dataBox{
.img2{
width: 147rpx;
height: 147rpx;
background-color: #000000;
border: 1rpx solid #000000;
border-radius: 20rpx;
}
.itemBox{
margin-bottom: 40rpx;
.tip{
font-size: 24rpx;
font-weight: 500;
color: #C1C1C1;
}
.name{
font-size: 30rpx;
font-weight: bold;
color: #111111;
margin-top: 20rpx;
margin-bottom: 20rpx;
.tip2{
font-size: 24rpx;
font-weight: bold;
color: #111111;
margin-left: 4rpx;
}
}
}
.imgBox{
position: relative;
display: flex;
justify-content: space-between;
.left{
width: 492rpx;
.img1{
width: 492rpx;
height: 492rpx;
background-color: #000000;
border-radius: 30rpx;
margin-bottom: 25rpx;
}
.subImgBox{
width: 492rpx;
height: 147rpx;
display: flex;
justify-content: space-between;
align-items: center;
}
}
.right{
width: 147rpx;
display: flex;
flex-wrap: wrap;
align-content: space-between;
}
}
.conBox{
.subItemBox{
display: flex;
align-items: center;
height: 100rpx;
border-bottom: 1rpx solid #E2E2E2FF;
.subName{
width: 130rpx;
font-size: 24rpx;
font-weight: 500;
color: #666666;
}
.subInput{
flex-grow: 5;
font-size: 24rpx;
font-weight: bold;
color: #111111;
}
.subpicker{
flex-grow: 5;
font-size: 24rpx;
font-weight: bold;
color: #111111;
// background-color: #008000;
}
.unit{
font-size: 24rpx;
font-weight: bold;
color: #B6B6B6;
}
}
.textareaBox{
height: 180rpx;
width: 100%;
border-bottom: 1rpx solid #E2E2E2FF;
}
}
}
}
.saveBtn{
margin: 0 auto;
width: 690rpx;
height: 88rpx;
background-color: #00C6C1;
border-radius: 44rpx;
display: flex;
justify-content: center;
align-items: center;
font-size: 32rpx;
font-weight: 500;
color: #FFFFFF;
margin-top: 50rpx;
}
/deep/.input-placeholder{
font-size: 24rpx;
font-weight: bold;
color: #999999;
}
/deep/.textarea-placeholder{
font-size: 24rpx;
font-weight: bold;
color: #999999;
}
</style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment