927 lines
36 KiB
Plaintext
927 lines
36 KiB
Plaintext
<template>
|
||
<page-meta page-style="background:{{bgColor}}"></page-meta>
|
||
<view class="selfTextarea" style="padding: {{text == '期望对方'?'0 30rpx 30rpx':''}};">
|
||
<view class="m_con" v-if="text == '期望对方'">
|
||
<view class="u_con_tt font_28 color-999 bold">征友条件</view>
|
||
<view class="m_conPi">
|
||
<view class="m_conPi_lst">
|
||
<picker mode="multiSelector" value="{{ageIndex}}" range="{{ageArray}}" bindchange="bindAgePickerChange" bindcolumnchange="bindAgePickerColumnChange">
|
||
<view class="u_conPi_lst f-fbc">
|
||
<view class="font_28 color-333 bold">年龄</view>
|
||
<view class="f-fc">
|
||
<view class="font_28 u_conLst_ct {{ageColor?'color-333':'color-999'}}" v-if="ageIndex.length == 0">{{mate_conditon.age}}</view>
|
||
<view class="font_28 color-333 u_conLst_ct" v-else>{{ageArray[0][ageIndex[0]]}} - {{ageArray[1][ageIndex[1]]}}岁</view>
|
||
<view class="font_family icon-jiantoubeifen7 color-999" style="margin-left: 14rpx;font-size: 22rpx;"></view>
|
||
</view>
|
||
</view>
|
||
</picker>
|
||
<picker mode="multiSelector" value="{{heightIndex}}" range="{{heightArray}}" bindchange="bindHeightPickerChange" bindcolumnchange="bindHeightPickerColumnChange">
|
||
<view class="u_conPi_lst f-fbc">
|
||
<view class="font_28 color-333 bold">身高</view>
|
||
<view class="f-fc">
|
||
<view class="font_28 u_conLst_ct {{heightColor?'color-333':'color-999'}}" v-if="heightIndex.length == 0">{{mate_conditon.stature}}</view>
|
||
<view class="font_28 color-333 u_conLst_ct" v-else>{{heightArray[0][heightIndex[0]]}} - {{heightArray[1][heightIndex[1]]}}cm</view>
|
||
<view class="font_family icon-jiantoubeifen7 color-999" style="margin-left: 14rpx;font-size: 22rpx;"></view>
|
||
</view>
|
||
</view>
|
||
</picker>
|
||
<picker value="{{stateIndex}}" range="{{stateArray}}" bindchange="bindStatePickerChange">
|
||
<view class="u_conPi_lst f-fbc">
|
||
<view class="font_28 color-333 bold">情感状态</view>
|
||
<view class="f-fc">
|
||
<view class="font_28 u_conLst_ct {{stateColor?'color-333':'color-999'}}" v-if="stateIndex == '' || stateIndex == 0">{{mate_conditon.state}}</view>
|
||
<view class="font_28 color-333 u_conLst_ct" v-else>{{stateArray[stateIndex]}}</view>
|
||
<view class="font_family icon-jiantoubeifen7 color-999" style="margin-left: 14rpx;font-size: 22rpx;"></view>
|
||
</view>
|
||
</view>
|
||
</picker>
|
||
|
||
<picker value="{{educIndex}}" range="{{educArray}}" bindchange="bindEducPickerChange">
|
||
<view class="u_conPi_lst f-fbc">
|
||
<view class="font_28 color-333 bold">最低学历</view>
|
||
<view class="f-fc">
|
||
<view class="font_28 u_conLst_ct {{educColor?'color-333':'color-999'}}" v-if="educIndex == '' || educIndex == 0">{{mate_conditon.degree}}</view>
|
||
<view class="font_28 color-333 u_conLst_ct" v-else>{{educArray[educIndex]}}</view>
|
||
<view class="font_family icon-jiantoubeifen7 color-999" style="margin-left: 14rpx;font-size: 22rpx;"></view>
|
||
</view>
|
||
</view>
|
||
</picker>
|
||
<picker value="{{faithIndex}}" range="{{faithArray}}" bindchange="bindFaithPickerChange">
|
||
<view class="u_conPi_lst f-fbc">
|
||
<view class="font_28 color-333 bold">信仰</view>
|
||
<view class="f-fc">
|
||
<view class="font_28 u_conLst_ct {{faithColor?'color-333':'color-999'}}" v-if="faithIndex == '' || faithIndex == 0">{{mate_conditon.belief}}</view>
|
||
<view class="font_28 color-333 u_conLst_ct" v-else>{{faithArray[faithIndex]}}</view>
|
||
<view class="font_family icon-jiantoubeifen7 color-999" style="margin-left: 14rpx;font-size: 22rpx;"></view>
|
||
</view>
|
||
</view>
|
||
</picker>
|
||
<picker value="{{incomeIndex}}" range="{{incomeArray}}" bindchange="bindIncomePickerChange">
|
||
<view class="u_conPi_lst f-fbc">
|
||
<view class="font_28 color-333 bold">最低月收入</view>
|
||
<view class="f-fc">
|
||
<view class="font_28 u_conLst_ct {{incomeColor?'color-333':'color-999'}}" v-if="incomeIndex == '' || incomeIndex == 0">{{mate_conditon.income}}</view>
|
||
<view class="font_28 color-333 u_conLst_ct" v-else>{{incomeArray[incomeIndex]}}</view>
|
||
<view class="font_family icon-jiantoubeifen7 color-999" style="margin-left: 14rpx;font-size: 22rpx;"></view>
|
||
</view>
|
||
</view>
|
||
</picker>
|
||
</view>
|
||
</view>
|
||
<view class="u_text_tt font_28 color-999 bold" v-if="text == '期望对方'">Ta所在的城市(自定义最多选择7个)</view>
|
||
<view class="demand_item_box" v-if="text == '期望对方'">
|
||
<view class="f-fc m_tsc" style="overflow: hidden">
|
||
<view :class="{'sel': tscList.length == 0}" class="u_tsc_bu f-fcc font_28 black_6" bindtap="wholeDelete">同城优先</view>
|
||
<view class="u_tsc_bu f-fcc font_28 black_6 sel" v-for="(item,index) in tscList" :key="index" @tap="deleteTsc('index')">
|
||
<view>{{item}}</view>
|
||
<image class="u_del_img" src="https://images.ufutx.com/202106/18/cda8d68011fec82c2672ce5a4ff48a6d.png" mode="aspectFit" lazy-load="false"></image>
|
||
</view>
|
||
<view class="u_tsc_bu f-fcc" v-if="tscList.length < 7">
|
||
<selectCity ref="selectCity" :multiIndex.sync="multiIndex" @selectCity.user="selectTaCity" @selectCity="selectCity" @multiCity="multiCityV2" @provinces="getProvinces">
|
||
<view class="f-fc">
|
||
<image class="u_add_img" src="https://images.ufutx.com/202106/18/2cafc8a1ceb30f23ec10438478d78706.png" mode="aspectFit" lazy-load="false"></image>
|
||
<view class=" font_28 black_6">自定义</view>
|
||
</view>
|
||
</selectCity>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
<view class="u_text_tt font_28 color-999 bold" v-if="text == '期望对方'">对另一半的期待</view>
|
||
<view class="textarea">
|
||
<textarea
|
||
class="areas"
|
||
auto-height
|
||
placeholder="{{placeholderText}}(请勿留下联系方式,否则将会被禁封)"
|
||
placeholder-style="placeholder_class"
|
||
minlength="{{min}}"
|
||
maxlength="800"
|
||
v-model="value"
|
||
>
|
||
</textarea>
|
||
<view class="currentWordNumber font_24">{{value.length}}/800</view>
|
||
</view>
|
||
</view>
|
||
<view class="m_con" v-else-if="text=='兴趣标签'">
|
||
<view class="u_con_tt font_28 color-999 bold">兴趣爱好的标签</view>
|
||
<view class="f-fc ui-wrap ui-hobbies-big-box">
|
||
<view :class="{'hobbies-box-select': item.show}" class="hobbies-box" v-for="(item,index) in hobbiesList" :key="index" @tap="changeSelect(item,index,'0')">
|
||
{{item.title}}
|
||
</view>
|
||
</view>
|
||
<view class="custom-title f-fbc">
|
||
<view class="u_con_tt font_28 color-999 bold">自定义标签</view>
|
||
<view class="f-fc">
|
||
<image @tap="isDeleteStatus = !isDeleteStatus" :src="isDeleteStatus ? 'https://image.fulllinkai.com/202407/31/5caab5a45aca621171500f25e7f58933.png' : 'https://image.fulllinkai.com/202407/31/f4d3854372062583eb368ce88c9fd900.png'" class="custom-delete-icon"></image>
|
||
<view @tap="isDeleteStatus = !isDeleteStatus" :class="{'is-delete':isDeleteStatus}" class="custom-delete-title">删除</view>
|
||
</view>
|
||
</view>
|
||
<view class="f-fc ui-wrap ui-hobbies-big-box">
|
||
<view :class="{'hobbies-box-select': item.show}" class="hobbies-box" v-for="(item,index) in customHobbiesList" :key="index" @tap="changeSelect(item,index,'1')">
|
||
<view>{{item.title}}</view>
|
||
<image @tap.stop="delCustomHob(item,index)" v-if="isDeleteStatus" class="hobbies-box-del" src="https://image.fulllinkai.com/202407/31/d76556526f6636717496e5d81383213a.png"></image>
|
||
</view>
|
||
<view class="custom-hobbies-add font_26" @tap="customAdd">+ 添加</view>
|
||
</view>
|
||
</view>
|
||
<view v-else>
|
||
<view class="textarea">
|
||
<textarea
|
||
class="areas"
|
||
auto-height
|
||
placeholder="{{placeholderText}}(请勿留下联系方式,否则将会被禁封)"
|
||
placeholder-style="placeholder_class"
|
||
minlength="{{min}}"
|
||
maxlength="800"
|
||
v-model="value"
|
||
>
|
||
</textarea>
|
||
<view class="currentWordNumber font_24">{{value.length}}/800</view>
|
||
</view>
|
||
</view>
|
||
<view class="f-fcc">
|
||
<view class="u_bt font_32 white f-fcc" bindtap="submitFn">保存</view>
|
||
</view>
|
||
</view>
|
||
<view :class="{'show': modalName == 'customAdd'}" class="cu-modal">
|
||
<view class="cu-dialog" style="width:600rpx;">
|
||
<view class="bg-img bg-imgs">自定义标签</view>
|
||
<input type="text" placeholder="请输入不超过八个字的标签" class="u_name_inp_V2" v-model="customName" cursor-spacing="50" maxlength="10" />
|
||
<view class="cu-bar bg-white" style="border-top:10rpx solid #f5f5f5;display:flex;">
|
||
<view class="action margin-0 flex-sub" style="color:#999999;font-size:32rpx;font-weight:500;border-right:1rpx solid #f5f5f5;" @tap="cancel">取消</view>
|
||
<view class="action margin-0 flex-sub solid-left" style="color:#F33B6C;font-size:32rpx;font-weight:500;" @tap="changeOccupation">确认</view>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
</template>
|
||
<script>
|
||
import wepy from '@wepy/core'
|
||
import {service} from '../../config.js'
|
||
import https from '../../mixins/https'
|
||
import base from '../../mixins/base'
|
||
wepy.page({
|
||
mixins: [base, https],
|
||
data: {
|
||
placeholderText: '',
|
||
text: '',
|
||
introduction: '',
|
||
ideal_mate: '',
|
||
interest_hobby: '',
|
||
value: '',
|
||
max: 1500,
|
||
CITY_INDEX: 0,
|
||
multiIndex: [0, 18, 2],
|
||
region: ['', '', ''],
|
||
selfTextareaShow: false,
|
||
ageArray: [['不限'], []],
|
||
ageIndex: [],
|
||
ageColor: false,
|
||
heightArray: [['不限'], []],
|
||
heightIndex: [],
|
||
heightColor: false,
|
||
regionArray: ['不限', '距离优先'],
|
||
regionIndex: '',
|
||
regionColor: false,
|
||
educArray: ['不限', '大专', '本科', '硕士以上'],
|
||
educIndex: '',
|
||
educColor: false,
|
||
faithArray: ['不限', '基督教', '佛教', '伊斯兰教'],
|
||
faithIndex: '',
|
||
faithColor: false,
|
||
incomeArray: ['不限', '4千-6千', '6千-1万', '1万-2万', '2万以上'],
|
||
incomeIndex: '',
|
||
incomeColor: false,
|
||
stateArray: ['不限', '单身', '离异', '丧偶'],
|
||
stateIndex: '',
|
||
stateColor: '',
|
||
mate_condition: [],
|
||
mate_conditon: {
|
||
age: '年龄不限',
|
||
stature: '身高不限',
|
||
location: '所在地不限',
|
||
degree: '学历不限',
|
||
belief: '信仰不限',
|
||
income: '月收入不限',
|
||
state: '情感不限'
|
||
},
|
||
throttleShow: true,
|
||
provinces: [],
|
||
customItem: '不限',
|
||
stateList: ['情感不限', '单身', '离异', '丧偶'],
|
||
// Ta所在的城市相关
|
||
modalName: '',
|
||
certification: 1,
|
||
givePriority: true,
|
||
only: false,
|
||
hopeV2Data: {
|
||
city: 1,
|
||
hometown: 1,
|
||
Certification: 1
|
||
},
|
||
tscList: [],
|
||
submitList: [],
|
||
address: { // 居住地
|
||
country: '', province: '', city: ''
|
||
},
|
||
addressType: 'address',
|
||
selectType: '',
|
||
selectCity: '',
|
||
bgColor: '#f5f5f5',
|
||
hobbiesList: [
|
||
{title: '旅行', show: false},
|
||
{title: '爬山', show: false},
|
||
{title: '篮球', show: false},
|
||
{title: '羽毛球', show: false},
|
||
{title: '乒乓球', show: false},
|
||
{title: '徒步', show: false},
|
||
{title: '摄影', show: false},
|
||
{title: '音乐', show: false},
|
||
{title: '古典', show: false},
|
||
{title: '舞蹈', show: false},
|
||
{title: '电子游戏', show: false},
|
||
{title: '瑜伽', show: false},
|
||
{title: '跆拳道', show: false}
|
||
],
|
||
selectHobbiesList: ['旅行', '爬山', '篮球'],
|
||
customHobbiesList: [],
|
||
selCustomList: [],
|
||
isDeleteStatus: false,
|
||
customName: ''
|
||
|
||
},
|
||
onLoad(e) {
|
||
this.text = e.text
|
||
this.selfTextareaShow = true
|
||
if (e.text) {
|
||
console.log(e.text, 'text==-')
|
||
if (e.text == '兴趣标签') {
|
||
this.bgColor = '#ffffff'
|
||
wx.setNavigationBarColor({
|
||
frontColor: '#000000',
|
||
backgroundColor: '#ffffff'
|
||
})
|
||
} else {
|
||
this.bgColor = '#f5f5f5'
|
||
wx.setNavigationBarColor({
|
||
frontColor: '#000000',
|
||
backgroundColor: '#F5F5F5'
|
||
})
|
||
}
|
||
}
|
||
this.placeholderText = e.placeText
|
||
for (let i = 18; i < 75; i++) {
|
||
this.ageArray[0].push(i)
|
||
}
|
||
for (let i = 140; i < 200; i++) {
|
||
this.heightArray[0].push(i)
|
||
}
|
||
this.GetAddress()
|
||
if (e.text) {
|
||
wx.setNavigationBarTitle({
|
||
title: e.text
|
||
})
|
||
}
|
||
let colorData = wx.getStorageSync('colorData')
|
||
if (colorData) {
|
||
this.ageColor = colorData.ageColor
|
||
this.heightColor = colorData.heightColor
|
||
this.regionColor = colorData.regionColor
|
||
this.educColor = colorData.educColor
|
||
this.faithColor = colorData.faithColor
|
||
this.incomeColor = colorData.incomeColor
|
||
}
|
||
},
|
||
|
||
methods: {
|
||
GetAddress() { // getaddress
|
||
let that = this
|
||
that.$get({url: `${service.host}/address/country/list`}).then(({code, data}) => {
|
||
that.provinces = data
|
||
that.provinces.forEach(item => {
|
||
if (item.Name == '中国') {
|
||
item.Children.forEach(sonItem => {
|
||
that.regionArray.push(sonItem.Name)
|
||
})
|
||
}
|
||
})
|
||
this.getuser()
|
||
})
|
||
},
|
||
getuser() {
|
||
let that = this
|
||
that.$get({url: `${service.host}/user/profile`}).then(({code, data}) => {
|
||
that.introduction = data.introduction
|
||
that.ideal_mate = data.ideal_mate
|
||
that.interest_hobby = data.interest_hobby
|
||
if (that.text == '自我描述') {
|
||
that.value = data.introduction
|
||
} else if (that.text == '兴趣爱好') {
|
||
that.value = data.interest_hobby
|
||
} else if (that.text == '期望对方') {
|
||
that.value = data.ideal_mate
|
||
}
|
||
if (data.city_list_claim && data.city_list_claim != '') {
|
||
that.tscList = JSON.parse(JSON.stringify(data.city_list_claim.replace(/市/g, '').split(',')))
|
||
that.submitList = data.city_list_claim.split(',')
|
||
} else {
|
||
that.tscList = []
|
||
that.submitList = []
|
||
}
|
||
that.customHobbiesList = wx.getStorageSync('customHobList') || []
|
||
// 兴趣爱好有值
|
||
if (data.interest_label && data.interest_label.length > 0) {
|
||
that.hobbiesList = that.hobbiesList.map(item => {
|
||
return {
|
||
title: item.title,
|
||
show: data.interest_label.includes(item.title)
|
||
}
|
||
})
|
||
let objectValue = that.hobbiesList.map(item => { return item.title })
|
||
let newHobbies = data.interest_label.filter(item => {
|
||
console.log(objectValue.includes(item), 'obj===')
|
||
return !objectValue.includes(item)
|
||
})
|
||
console.log(objectValue, newHobbies, 'newHobbies===')
|
||
that.customHobbiesList = that.customHobbiesList.map(item => {
|
||
return {
|
||
title: item,
|
||
show: data.interest_label.includes(item)
|
||
}
|
||
})
|
||
if (newHobbies && newHobbies.length > 0) {
|
||
newHobbies = newHobbies.map(item => {
|
||
return {
|
||
title: item,
|
||
show: true
|
||
}
|
||
})
|
||
that.customHobbiesList = [...new Set([...that.customHobbiesList, ...newHobbies])]
|
||
}
|
||
} else {
|
||
that.customHobbiesList = that.customHobbiesList.map(item => {
|
||
return {
|
||
title: item,
|
||
show: false
|
||
}
|
||
})
|
||
}
|
||
|
||
try {
|
||
// this.mate_conditon = data.mate_conditon
|
||
let ageArr = data.mate_conditon.age.split('-', 2)
|
||
let agePickerArr = []
|
||
let statureArr = data.mate_conditon.stature.split('-', 2)
|
||
let staturePickerArr = []
|
||
this.ageArray[0].forEach((item, index) => {
|
||
if (item == ageArr[0]) {
|
||
this.ageIndex = [index, this.ageIndex[1]]
|
||
}
|
||
})
|
||
for (let i = +ageArr[0] + 1; i < 76; i++) {
|
||
agePickerArr.push(i)
|
||
}
|
||
this.ageArray = [this.ageArray[0], agePickerArr]
|
||
this.ageArray[1].forEach((item, index) => {
|
||
if (item == ageArr[1].replace('岁', '')) {
|
||
this.ageIndex = [this.ageIndex[0], index]
|
||
}
|
||
})
|
||
|
||
this.heightArray[0].forEach((item, index) => {
|
||
if (item == statureArr[0]) {
|
||
this.heightIndex = [index, this.heightIndex[1]]
|
||
}
|
||
})
|
||
for (let i = +statureArr[0] + 1; i < 201; i++) {
|
||
staturePickerArr.push(i)
|
||
}
|
||
this.heightArray = [this.heightArray[0], staturePickerArr]
|
||
this.heightArray[1].forEach((item, index) => {
|
||
console.log(item, statureArr)
|
||
if (item == statureArr[1].replace('cm', '')) {
|
||
console.log('----9988')
|
||
console.log(index, 'index===')
|
||
this.heightIndex = [this.heightIndex[0], index]
|
||
}
|
||
})
|
||
console.log(this.heightIndex, 'heightIndex=')
|
||
this.regionArray.forEach((item, index) => {
|
||
if (item == data.mate_conditon.location) {
|
||
this.regionIndex = index
|
||
}
|
||
})
|
||
this.educArray.forEach((item, index) => {
|
||
if (item == data.mate_conditon.degree) {
|
||
this.educIndex = index
|
||
}
|
||
})
|
||
this.stateArray.forEach((item, index) => {
|
||
if (item == data.mate_conditon.state) {
|
||
this.stateIndex = index
|
||
}
|
||
})
|
||
this.faithArray.forEach((item, index) => {
|
||
if (item == data.mate_conditon.belief) {
|
||
this.faithIndex = index
|
||
}
|
||
})
|
||
this.incomeArray.forEach((item, index) => {
|
||
if (item == data.mate_conditon.income) {
|
||
this.incomeIndex = index
|
||
}
|
||
})
|
||
} catch (e) {}
|
||
})
|
||
},
|
||
multiCity(country, province, city) {
|
||
let multiIndex = [0, 0, 0]
|
||
try {
|
||
this.provinces.forEach((item, index) => {
|
||
if (item.Name == '中国') {
|
||
multiIndex = [index, 0, 0]
|
||
this.$refs.selectCity.MultiPickerColumnChange({$wx: {detail: {
|
||
value: index,
|
||
column: 0
|
||
}}})
|
||
item.Children.forEach((res, indexA) => {
|
||
if (res.Name == province) {
|
||
this.$refs.selectCity.MultiPickerColumnChange({$wx: {detail: {
|
||
value: indexA,
|
||
column: 1
|
||
}}})
|
||
multiIndex = [multiIndex[0], indexA, 0]
|
||
res.Children.forEach((data, indexB) => {
|
||
if (data.Name == city) {
|
||
this.$refs.selectCity.MultiPickerColumnChange({$wx: {detail: {
|
||
value: indexB,
|
||
column: 2
|
||
}}})
|
||
multiIndex = [multiIndex[0], multiIndex[1], indexB]
|
||
}
|
||
})
|
||
}
|
||
})
|
||
}
|
||
})
|
||
console.log('33--')
|
||
this.multiIndex = multiIndex
|
||
} catch (e) {}
|
||
},
|
||
submitFn() {
|
||
let that = this
|
||
if (this.throttleShow) {
|
||
// this.throttleShow = false
|
||
if (!this.value && that.text != '兴趣标签') {
|
||
this.$showToast('请输入内容')
|
||
return
|
||
}
|
||
let reg = new RegExp('(微信|QQ|qq|weixin|wx|WX|1[0-9]{10}|[0-9]{6,11})+', 'g')
|
||
if (reg.test(this.value)) {
|
||
this.$showToast('你输入的信息可能含有联系方式,请重新填写!')
|
||
return
|
||
}
|
||
let data = {}
|
||
if (that.text == '自我描述') {
|
||
data.introduction = that.value
|
||
} else if (that.text == '兴趣标签') {
|
||
let defaultHob = that.hobbiesList.filter(item => {
|
||
return item.show
|
||
}).map(item => { return item.title })
|
||
let customHob = that.customHobbiesList.filter(item => {
|
||
return item.show
|
||
}).map(item => { return item.title })
|
||
console.log(defaultHob, customHob, '----999-----')
|
||
data.interest_label = [...defaultHob, ...customHob]
|
||
console.log(data.interest_label, 'data.interest_label')
|
||
if (data.interest_label.length == 0) {
|
||
this.$showToast('请至少选择一个标签')
|
||
return
|
||
}
|
||
} else if (that.text == '兴趣爱好') {
|
||
data.interest_hobby = that.value
|
||
} else if (that.text == '期望对方') {
|
||
data.ideal_mate = that.value
|
||
if (this.ageIndex.length != 0) {
|
||
let ageText = `${this.ageArray[0][this.ageIndex[0]]}-${this.ageArray[1][this.ageIndex[1]]}岁`
|
||
this.mate_conditon.age = ageText
|
||
} else {
|
||
this.mate_conditon.age = '年龄不限'
|
||
}
|
||
if (this.heightIndex.length != 0) {
|
||
let heightText = `${this.heightArray[0][this.heightIndex[0]]}-${this.heightArray[1][this.heightIndex[1]]}cm`
|
||
this.mate_conditon.stature = heightText
|
||
} else {
|
||
this.mate_conditon.stature = '身高不限'
|
||
}
|
||
if (this.regionIndex && this.regionIndex != 0) {
|
||
this.mate_conditon.location = this.regionArray[this.regionIndex]
|
||
} else {
|
||
this.mate_conditon.location = '所在地不限'
|
||
}
|
||
if (this.educIndex && this.educIndex != 0) {
|
||
this.mate_conditon.degree = this.educArray[this.educIndex]
|
||
} else {
|
||
this.mate_conditon.degree = '学历不限'
|
||
}
|
||
if (this.stateIndex && this.stateIndex != 0) {
|
||
this.mate_conditon.state = this.stateArray[this.stateIndex]
|
||
} else {
|
||
this.mate_conditon.state = '情感不限'
|
||
}
|
||
if (this.faithIndex && this.faithIndex != 0) {
|
||
this.mate_conditon.belief = this.faithArray[this.faithIndex]
|
||
} else {
|
||
this.mate_conditon.belief = '信仰不限'
|
||
}
|
||
if (this.incomeIndex && this.incomeIndex != 0) {
|
||
this.mate_conditon.income = this.incomeArray[this.incomeIndex]
|
||
} else {
|
||
this.mate_conditon.income = '月收入不限'
|
||
}
|
||
let stcListSitkon = ''
|
||
if (this.submitList.length > 0) {
|
||
stcListSitkon = this.submitList.join(',')
|
||
}
|
||
data.mate_conditon = this.mate_conditon
|
||
data.city_claim = this.submitList.length == 0 ? 1 : 3
|
||
data.city_list_claim = stcListSitkon
|
||
let colorData = {
|
||
ageColor: this.ageColor,
|
||
heightColor: this.heightColor,
|
||
regionColor: this.regionColor,
|
||
educColor: this.educColor,
|
||
faithColor: this.faithColor,
|
||
incomeColor: this.incomeColor
|
||
}
|
||
wx.setStorageSync('colorData', colorData)
|
||
}
|
||
this.$showLoading('提交中..')
|
||
this.$put({url: `${service.host}/user/other/profie`, data}).then(({code, data}) => {
|
||
this.throttleShow = true
|
||
console.log('参数保存成功!')
|
||
setTimeout(() => {
|
||
wx.hideLoading()
|
||
wx.navigateBack({
|
||
delta: 1
|
||
})
|
||
}, 2000)
|
||
})
|
||
} else {
|
||
this.throttleShow = false
|
||
}
|
||
},
|
||
textareaValue(e) {
|
||
console.log('textareaValue-----------------------------', e)
|
||
this.value = e
|
||
if (this.text == '自我描述') {
|
||
this.introduction = e
|
||
} else if (this.text == '兴趣爱好') {
|
||
this.interest_hobby = e
|
||
} else if (this.text == '期望对方') {
|
||
this.ideal_mate = e
|
||
}
|
||
},
|
||
bindAgePickerColumnChange(e) {
|
||
let agePickerArr = []
|
||
console.log('ageIndex---------------------', e.$wx.detail)
|
||
if (e.$wx.detail.value == 0 && e.$wx.detail.column === 0) {
|
||
this.ageIndex = []
|
||
this.mate_conditon.age = '年龄不限'
|
||
this.ageArray[1] = [this.ageArray[0], []]
|
||
return
|
||
}
|
||
if (e.$wx.detail.column == 0) {
|
||
for (let i = this.ageArray[0][e.$wx.detail.value] + 1; i < 76; i++) {
|
||
agePickerArr.push(i)
|
||
}
|
||
console.log(agePickerArr, '-agePickerArr')
|
||
this.ageArray = [this.ageArray[0], agePickerArr]
|
||
}
|
||
},
|
||
bindAgePickerChange(e) {
|
||
console.log(e)
|
||
this.ageColor = true
|
||
if (e.$wx.detail.value[0] == 0) {
|
||
this.ageIndex = []
|
||
this.mate_conditon.age = '年龄不限'
|
||
return
|
||
}
|
||
if (!e.$wx.detail.value[1]) {
|
||
e.$wx.detail.value = [e.$wx.detail.value[0], 0]
|
||
}
|
||
this.ageIndex = e.$wx.detail.value
|
||
},
|
||
bindHeightPickerColumnChange(e) {
|
||
let heightPickerArr = []
|
||
if (e.$wx.detail.value == 0 && e.$wx.detail.column === 0) {
|
||
this.heightIndex = []
|
||
this.mate_conditon.stature = '身高不限'
|
||
this.heightArray = [this.heightArray[0], []]
|
||
return
|
||
}
|
||
if (e.$wx.detail.column == 0) {
|
||
for (let i = this.heightArray[0][e.$wx.detail.value] + 1; i < 201; i++) {
|
||
heightPickerArr.push(i)
|
||
}
|
||
console.log(heightPickerArr, '-heightPickerArr')
|
||
this.heightArray = [this.heightArray[0], heightPickerArr]
|
||
}
|
||
},
|
||
bindHeightPickerChange(e) {
|
||
console.log(e)
|
||
this.heightColor = true
|
||
if (e.$wx.detail.value[0] == 0) {
|
||
this.heightIndex = []
|
||
this.mate_conditon.stature = '身高不限'
|
||
return
|
||
}
|
||
if (!e.$wx.detail.value[1]) {
|
||
e.$wx.detail.value = [e.$wx.detail.value[0], 0]
|
||
}
|
||
this.heightIndex = e.$wx.detail.value
|
||
},
|
||
bindEducPickerChange(e) {
|
||
this.educColor = true
|
||
if (e.$wx.detail.value == 0) {
|
||
this.mate_conditon.degree = '学历不限'
|
||
}
|
||
this.educIndex = e.$wx.detail.value
|
||
},
|
||
bindStatePickerChange(e) {
|
||
this.stateColor = true
|
||
if (e.$wx.detail.value == 0) {
|
||
this.mate_conditon.state = '情感不限'
|
||
}
|
||
this.stateIndex = e.$wx.detail.value
|
||
},
|
||
bindFaithPickerChange(e) {
|
||
this.faithColor = true
|
||
if (e.$wx.detail.value == 0) {
|
||
this.mate_conditon.belief = '信仰不限'
|
||
}
|
||
this.faithIndex = e.$wx.detail.value
|
||
},
|
||
bindIncomePickerChange(e) {
|
||
this.incomeColor = true
|
||
if (e.$wx.detail.value == 0) {
|
||
this.mate_conditon.income = '月收入不限'
|
||
}
|
||
this.incomeIndex = e.$wx.detail.value
|
||
},
|
||
deleteTsc(index) {
|
||
this.tscList.splice(index, 1)
|
||
this.submitList.splice(index, 1)
|
||
},
|
||
wholeDelete() {
|
||
this.tscList = []
|
||
this.submitList = []
|
||
},
|
||
selectCity(e, index) {
|
||
let identical = false,
|
||
sfdIndex = 0
|
||
try {
|
||
if (this.tscList.length == 0) {
|
||
this.tscList.push(e[2].replace(/市/g, ''))
|
||
this.tscList.splice(0, 0) // 长度判断渲染问题
|
||
this.submitList.push(e[2])
|
||
} else {
|
||
this.tscList.forEach((item, index) => {
|
||
if (item == e[2].replace(/市/g, '')) {
|
||
identical = true
|
||
this.$showToast('请不要重复添加城市')
|
||
}
|
||
})
|
||
if (identical) return
|
||
this.tscList.push(e[2].replace(/市/g, ''))
|
||
this.submitList.push(e[2])
|
||
}
|
||
} catch (e) {}
|
||
this.selectType = 'custom'
|
||
},
|
||
multiCityV2(value) {
|
||
this.multiIndex = value
|
||
},
|
||
getProvinces(value) {
|
||
this.provinces = value
|
||
},
|
||
// 选中标签
|
||
changeSelect(item, index, type) {
|
||
if (type == '0') {
|
||
this.hobbiesList[index].show = !item.show
|
||
} else {
|
||
this.customHobbiesList[index].show = !item.show
|
||
}
|
||
},
|
||
customAdd() {
|
||
this.customName = ''
|
||
this.modalName = 'customAdd'
|
||
},
|
||
cancel() {
|
||
this.modalName = ''
|
||
},
|
||
changeOccupation() {
|
||
let that = this
|
||
let data = {
|
||
customName: that.customName
|
||
}
|
||
|
||
that.customHobbiesList.push({title: that.customName, show: false})
|
||
let list = that.customHobbiesList.map(item => item.title)
|
||
wx.setStorageSync('customHobList', list)
|
||
that.modalName = ''
|
||
// that.$post({url: `${service.host}/addresses/v2`}, data).then(({code, data}) => {
|
||
// that.getuser()
|
||
// that.modalName = ''
|
||
// })
|
||
},
|
||
delCustomHob(item, index) {
|
||
let that = this
|
||
that.customHobbiesList.splice(index, 1)
|
||
let list = that.customHobbiesList.map(item => item.title)
|
||
wx.setStorageSync('customHobList', list)
|
||
console.log(that.customHobbiesList, 'that.customHobbiesList==')
|
||
},
|
||
changeSelectHob(item) {
|
||
console.log('22')
|
||
return this.selectHobbiesList.includes(item)
|
||
}
|
||
}
|
||
})
|
||
</script>
|
||
<style lang="less">
|
||
page{
|
||
background-color: #F5F5F5;
|
||
}
|
||
.selfTextarea {
|
||
padding-bottom: 100rpx;
|
||
.u_bt {
|
||
width: 520rpx;
|
||
height: 80rpx;
|
||
background: linear-gradient(270deg, #FF85A5 0%, #FF5380 100%);
|
||
border-radius: 44rpx;
|
||
}
|
||
.m_con {
|
||
.u_con_tt {
|
||
padding: 20rpx 40rpx;
|
||
}
|
||
.custom-title{
|
||
margin-top: 100rpx;
|
||
.custom-delete-icon{
|
||
margin-right: 2rpx;
|
||
width: 24rpx;
|
||
height: 24rpx;
|
||
}
|
||
.custom-delete-title{
|
||
margin-right: 30rpx;
|
||
height: 34rpx;
|
||
font-weight: 400;
|
||
font-size: 24rpx;
|
||
color: #999999;
|
||
}
|
||
.is-delete{
|
||
color: #F33B6C;
|
||
}
|
||
}
|
||
.m_conPi {
|
||
border-radius: 32rpx;
|
||
background-color: white;
|
||
.m_conPi_lst {
|
||
padding: 20rpx 40rpx;
|
||
.u_conPi_lst {
|
||
padding: 20rpx 0;
|
||
.u_conLst_ct {
|
||
font-family: PingFangSC-Regular, PingFang SC;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
.u_text_tt {
|
||
padding: 60rpx 40rpx 20rpx;
|
||
}
|
||
}
|
||
textarea {
|
||
width: 100%;
|
||
caret-color:#FF95B1;
|
||
}
|
||
.textarea {
|
||
padding: 10rpx 30rpx 10rpx;
|
||
box-sizing: border-box;
|
||
background-color: white;
|
||
margin-bottom: 80rpx;
|
||
border-radius: 32rpx;
|
||
.areas {
|
||
width: 100%;
|
||
min-height: 300rpx;
|
||
font-size: 30rpx;
|
||
line-height: 40rpx;
|
||
color: #333333;
|
||
}
|
||
.placeholder_class {
|
||
font-size: 28rpx;
|
||
line-height: 40rpx;
|
||
}
|
||
.currentWordNumber {
|
||
text-align: right;
|
||
color: #C2C2C2;
|
||
}
|
||
}
|
||
.demand_item_box{
|
||
padding: 40rpx 20rpx 60rpx 20rpx;
|
||
background-color: #ffffff;
|
||
border-radius: 32rpx;
|
||
.demand_item_title{
|
||
display: flex;
|
||
justify-content: space-between;
|
||
align-items: center;
|
||
}
|
||
.m_tsc {
|
||
flex-wrap: wrap;
|
||
.u_tsc_bu {
|
||
padding: 12rpx 28rpx;
|
||
line-height: 40rpx;
|
||
border-radius: 100rpx;
|
||
background-color: #F8F8F8;
|
||
margin-right: 46rpx;
|
||
margin-bottom: 30rpx;
|
||
.u_add_img {
|
||
width: 20rpx;
|
||
height: 20rpx;
|
||
margin-right: 8rpx;
|
||
}
|
||
.u_del_img {
|
||
width: 16rpx;
|
||
height: 16rpx;
|
||
margin-left: 16rpx;
|
||
}
|
||
}
|
||
.u_tsc_bu.sel {
|
||
color: #F33B6C;
|
||
background-color: #FFF4F7;
|
||
}
|
||
}
|
||
}
|
||
.ui-hobbies-big-box{
|
||
margin: 20rpx 30rpx;
|
||
.hobbies-box{
|
||
position: relative;
|
||
margin-right: 20rpx;
|
||
margin-bottom: 24rpx;
|
||
padding: 10rpx 28rpx;
|
||
height: 60rpx;
|
||
background: #f5f5f5;
|
||
border-radius: 30rpx;
|
||
}
|
||
.hobbies-box-select{
|
||
color: #FFFFFF;
|
||
background: #FF5380;
|
||
}
|
||
.hobbies-box-del{
|
||
position: absolute;
|
||
top:0;
|
||
right:0;
|
||
width: 28rpx;
|
||
height: 28rpx;
|
||
}
|
||
.custom-hobbies-add{
|
||
margin-bottom: 24rpx;
|
||
padding:10rpx 24rpx;
|
||
height: 60rpx;
|
||
//line-height: 60rpx;
|
||
color: #F33B6C;
|
||
border-radius: 15px;
|
||
border: 1px solid #FF5380;
|
||
}
|
||
}
|
||
|
||
.bg-imgs {
|
||
height: 100rpx;
|
||
display: flex;
|
||
justify-content: center;
|
||
align-items: center;
|
||
background: #ffffff;
|
||
font-size: 32rpx;
|
||
color: #333333;
|
||
font-weight: 500;
|
||
}
|
||
.u_name_inp_V2 {
|
||
height: 80rpx;
|
||
text-align: center;
|
||
flex: 1;
|
||
font-size: 28rpx;
|
||
color: #333333;
|
||
}
|
||
</style>
|
||
|
||
<config>
|
||
{
|
||
navigationBarTitleText: '自我描述',
|
||
enablePullDownRefresh: false,
|
||
backgroundColorTop: '#f2f2f2',
|
||
backgroundColorBottom: '#f2f2f2',
|
||
usingComponents: {
|
||
texTarea: '~@/components/textarea',
|
||
selectCity: '~@/components/selectCity',
|
||
}
|
||
}
|
||
</config>
|