Commit 00516ff3 authored by 罗超's avatar 罗超

1

parent 28a782b7
......@@ -16,18 +16,47 @@
</view>
<view class="imgBox" v-if="item.type==1">
<view class="left">
<image src="" mode="widthFix" class="img1"></image>
<!-- 大照片 -->
<view class="img1Box" :style="{'border-color': `${mainColor}`}" @click="chooseImg(0,'img1')">
<image :src="data.AlbumList[0]" mode="widthFix" v-if="AlbumListShow.img1"></image>
<image :src="photoDemo" mode="widthFix" v-if="!AlbumListShow.img1" class="imgDemo"></image>
</view>
<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 class="img2Box" @click="chooseImg(1,'img2')" :style="{'border-color': `${mainColor}`}">
<image :src="data.AlbumList[1]" mode="widthFix" class="img2" v-if="AlbumListShow.img2"></image>
<image :src="photoDemo" mode="widthFix" v-if="!AlbumListShow.img2" class="imgDemo"></image>
</view>
<view class="img2Box" @click="chooseImg(2,'img3')" :style="{'border-color': `${mainColor}`}">
<image :src="data.AlbumList[2]" mode="widthFix" class="img2" v-if="AlbumListShow.img3"></image>
<image :src="photoDemo" mode="widthFix" v-if="!AlbumListShow.img3" class="imgDemo"></image>
</view>
<view class="img2Box" @click="chooseImg(3,'img4')" :style="{'border-color': `${mainColor}`}">
<image :src="data.AlbumList[3]" mode="widthFix" class="img2" v-if="AlbumListShow.img4"></image>
<image :src="photoDemo" mode="widthFix" v-if="!AlbumListShow.img4" class="imgDemo"></image>
</view>
</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 class="img2Box" @click="chooseImg(4,'img5')" :style="{'border-color': `${mainColor}`}">
<image :src="data.AlbumList[4]" mode="widthFix" class="img2" v-if="AlbumListShow.img5"></image>
<image :src="photoDemo" mode="widthFix" v-if="!AlbumListShow.img5" class="imgDemo"></image>
</view>
<view class="img2Box" @click="chooseImg(5,'img6')" :style="{'border-color': `${mainColor}`}">
<image :src="data.AlbumList[5]" mode="widthFix" class="img2" v-if="AlbumListShow.img6"></image>
<image :src="photoDemo" mode="widthFix" v-if="!AlbumListShow.img6" class="imgDemo"></image>
</view>
<view class="img2Box" @click="chooseImg(6,'img7')" :style="{'border-color': `${mainColor}`}">
<image :src="data.AlbumList[6]" mode="widthFix" class="img2" v-if="AlbumListShow.img7"></image>
<image :src="photoDemo" mode="widthFix" v-if="!AlbumListShow.img7" class="imgDemo"></image>
</view>
<view class="img2Box" @click="chooseImg(7,'img8')" :style="{'border-color': `${mainColor}`}">
<image :src="data.AlbumList[7]" mode="widthFix" class="img2" v-if="AlbumListShow.img8"></image>
<image :src="photoDemo" mode="widthFix" v-if="!AlbumListShow.img8" class="imgDemo"></image>
</view>
</view>
</view>
<view class="conBox" v-if="item.type==2">
......@@ -36,12 +65,12 @@
<view class="subName">
{{item1.name}}
</view>
<input type="text" :placeholder="item1.placehloder" class="subInput" v-if="item1.subType==1"/>
<input type="text" :placeholder="item1.placehloder" v-model="data[item1.field]" 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)">
<view class="subpicker" v-if="item1.subType==2">
<picker :mode ="item1.mode" class="subpicker" :range="item1.array" @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>
......@@ -56,7 +85,7 @@
</view>
</view>
</view>
<view class="saveBtn">
<view class="saveBtn" :style="{'background-color': `${mainColor}`}" @click="saveData">
保存
</view>
</view>
......@@ -80,7 +109,7 @@
//subType:1输入框,2选择框
childDataList:[{
name:"昵称",
field:"",
field:"nickname",
placehloder:"请填写昵称",
subType:1
},{
......@@ -114,7 +143,20 @@
field:"EducationType",
placehloder:"请选择学历",
subType:2,
array:['高中','大专','本科','研究生'],
array:['高中及以下','大专','本科','研究生及以上'],
// array:[{
// name:'高中及以下',
// id:1,
// },{
// name:'大专',
// id:2,
// },{
// name:'本科',
// id:3,
// },{
// name:'研究生及以上',
// id:4,
// }],
mode:"selector"
},{
name:"毕业院校",
......@@ -126,7 +168,7 @@
field:"Marriage",
placehloder:"请选择婚姻状况",
subType:2,
array:['未婚','已婚','离异','丧偶'],
array:['未婚','离异','丧偶'],
mode:"selector"
},{
name:"职位",
......@@ -205,7 +247,7 @@
type:3
},{
name:"自我介绍",
field:"",
field:"About",
placehloder:"介绍自己",
type:3
},{
......@@ -216,26 +258,27 @@
},{
name:"约会档期",
tip2:"(方便约见的时间和地点)",
field:"FamilyInfo",
field:"",
// placehloder:"希望心中的TA是一个什么样的人",
type:2,
childDataList:[{
name:"时间",
field:"",
field:"Appointment",
placehloder:"请选择约见的时间",
subType:2,
array:[],
mode:"time"
mode:"date"
},{
name:"地点",
field:"Marriage",
field:"AppointmentAddress",
placehloder:"请填写方便的地点",
subType:1,
},]
},
],
photoDemo:"https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/camera.png",//占位图片
data:{
nickname:"",
Sex:"",
Birthday:"",
Height:"",
......@@ -250,6 +293,7 @@
// HuKou:"",//籍贯(国家)
HouseInfo:"",
nativePlace:"",//自定义籍贯
addCode:"",//行政编码
FamilyInfo:"",
Hobby:"",
LikeFood:"",
......@@ -260,38 +304,58 @@
LoveTalk:"",
SingleReason:"",
HopeYou:"",
About:"",
Appointment:"",
AppointmentAddress:"",
CName:"",//市名称
DName:"",//区名称
PName:"",//省名称
Province:0,//省行政编码
City:0,//市行政编码
District:0,//区行政编码
AlbumList:[],//照片墙
},
//控制图片显示
AlbumListShow:{
img1:false,
img2:false,
img3:false,
img4:false,
img5:false,
img6:false,
img7:false,
img8:false,
}
}
},
methods:{
changPicker(arg,e,mode,arr){
console.log(arg,e,mode,arr)
console.log(arg)
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])
this.data.addCode=arg.detail.code
console.log(this.data.addCode)
}
},
chooseImg() {
chooseImg(index,key) {
let that = this
uni.chooseImage({
count: 1, //默认9
sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
sourceType: ['album'], //从相册选择
success: function(res) {
console.log(res)
that.upFile(res.tempFilePaths[0],(_res)=>{
let resData=JSON.parse(_res.data)
that.data.AlbumList[index]=resData.data
that.AlbumListShow[key]=true
})
}
});
},
upFile(img, resCall) {
var that = this;
......@@ -313,7 +377,7 @@
resCall(uploadFileRes)
},
fail: function(res) {
that.businessLicenseUploadIsSuccess = false
uni.hideLoading()
wx.showToast({
title: '上传失败!',
icon: 'none',
......@@ -323,8 +387,137 @@
});
},
saveData(){
let msg=JSON.parse(JSON.stringify(this.data))
if(this.data.nativePlace&&this.data.nativePlace.length>0){
msg.PName=this.data.nativePlace[0]
msg.CName=this.data.nativePlace[1]
msg.DName=this.data.nativePlace[2]
}
if(this.data.addCode&&this.data.addCode.length>0){
console.log(this.data.addCode)
msg.Province=parseInt(this.data.addCode[0])
msg.City=parseInt(this.data.addCode[1])
msg.District=parseInt(this.data.addCode[2])
}
delete msg.nativePlace
delete msg.addCode
if(this.data.Sex=="男"){
msg.Sex=1
}else{
msg.Sex=2
}
if(this.data.EducationType=="高中及以下"){
msg.EducationType=1
}else if(this.data.EducationType=="大专"){
msg.EducationType=2
}else if(this.data.EducationType=="本科"){
msg.EducationType=2
}else if(this.data.EducationType=="研究生及以上"){
msg.EducationType=4
}
if(this.data.Marriage=="未婚"){
msg.Marriage=1
}else if(this.data.Marriage=="离异"){
msg.Marriage=2
}else if(this.data.Marriage=="丧偶"){
msg.Marriage=3
}
if(this.data.Birthday==""){
uni.showToast({
title: '请选择出生日期',
duration: 2000,
icon:"none"
});
return
}
if(this.data.Height ==""){
uni.showToast({
title: '请填写身高',
duration: 2000,
icon:"none"
});
return
}
if(this.data.Weight==""){
uni.showToast({
title: '请填写体重',
duration: 2000,
icon:"none"
});
return
}
if(this.data.EducationType==""){
uni.showToast({
title: '请选择学历',
duration: 2000,
icon:"none"
});
return
}
if(this.data.EducationType==""){
uni.showToast({
title: '请选择学历',
duration: 2000,
icon:"none"
});
return
}
console.log(this.data)
// this.request2({
// url: '/api/AppletMiai/GetSetMiAiBaseInfo',
// data: msg
// },
// res => {
// if (res.resultCode == 1) {
// console.log(res)
// }
// }
// );
},
getEnumList(){
this.request2(
{
url: '/api/AppletMiai/GetEducationTypeEnumList',
data: {}
},
res => {
if(res.resultCode==1){
}
}
);
},
getMarriage(){
this.request2(
{
url: '/api/AppletMiai/GetMarriageEnumList',
data: {}
},
res => {
if(res.resultCode==1){
}
}
);
},
//获取个人资料
getInfo(){
this.request2(
{
url: '/api/AppletMiai/GetMiAiBaseIfo',
data: { UserId:""}
},
res => {
if(res.resultCode==1){
}
}
);
}
},
created() {
this.mainColor = this.$uiConfig.mainColor;
......@@ -332,7 +525,19 @@
// this.pricecolor = this.$uiConfig.pricecolor;
},
mounted() {
this.getEnumList();
this.getMarriage();
// this.getInfo();
uni.getStorage({
key: 'basedata',
success: (res) =>{
let data= res.data.user_info
this.data.nickname=data.nickname
},
fail:(err)=> {
// console.log(err);
}
});
}
}
</script>
......@@ -350,12 +555,23 @@
color: #111111;
}
.dataBox{
.img2{
.img2Box{
width: 147rpx;
height: 147rpx;
background-color: #000000;
border: 1rpx solid #000000;
border-width:1rpx;
border-style:solid;
border-radius: 20rpx;
display: flex;
justify-content: center;
align-items: center;
overflow: hidden;
.img2{
width: 100%;
}
}
.imgDemo{
width: 54rpx;
}
.itemBox{
margin-bottom: 40rpx;
......@@ -386,12 +602,20 @@
justify-content: space-between;
.left{
width: 492rpx;
.img1{
.img1Box{
width: 492rpx;
height: 492rpx;
background-color: #000000;
border-width:1rpx;
border-style:solid;
border-radius: 30rpx;
margin-bottom: 25rpx;
display: flex;
justify-content: center;
align-items: center;
overflow: hidden;
.img1{
width: 100%;
}
}
.subImgBox{
width: 492rpx;
......@@ -412,8 +636,10 @@
.conBox{
.subItemBox{
display: flex;
justify-content: space-between;
align-items: center;
height: 100rpx;
width: 100%;
border-bottom: 1rpx solid #E2E2E2FF;
.subName{
width: 130rpx;
......@@ -453,7 +679,7 @@
margin: 0 auto;
width: 690rpx;
height: 88rpx;
background-color: #00C6C1;
// background-color: #00C6C1;
border-radius: 44rpx;
display: flex;
justify-content: center;
......
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