This commit is contained in:
A1300399510 2023-04-26 17:17:29 +08:00
parent 97094b6789
commit fecbdf7e3c
2 changed files with 44 additions and 23 deletions

View File

@ -835,7 +835,7 @@ Page({
// 初始化弹出的窗口
firstStepPopover() {
return
let field = 'type'
let step = 0
let it = 'basic'
@ -845,16 +845,22 @@ Page({
let popUpIs = ""
let popUpStepState = ""
this.data.aa.forEach(element => {
if (this.data.fieldinfo['status'][0].title == element.name) {
popUpIs = element.popUpIs
popUpStepState = element.popUpStepState
}
});
let popUpdate = {
...this.data.fieldinfoNew[field]
}
popUpIs = popUpdate.popUpIs
popUpStepState = popUpdate.popUpStepState
// this.data.aa.forEach(element => {
// if (this.data.fieldinfo['status'][0].title == element.name) {
// popUpIs = element.popUpIs
// popUpStepState = element.popUpStepState
// }
// });
this.setData({
step,
popUpIs,
popUpdate: this.data.fieldinfoNew[field],
popUpdate,
popUpit: it,
popUpStepState
})
@ -1515,8 +1521,9 @@ Page({
bindChange: function (e) {
const val = e.detail.value[0]
console.log(e, "sdfd");
// console.log(e, "sdfd");
let popUpdate = this.data.popUpdate
console.log("popUpdate.choices[val].value", popUpdate.choices[val].value, val);
this.setData({
leaseTimeValue: val,
['newinfo.rentalduration']: popUpdate.choices[val].value
@ -1690,6 +1697,7 @@ Page({
this.data.newinfo[field] = [0]
this.data.fieldinfoNew[field]['value'] = [0]
} else this.data.fieldinfoNew[field]['value'] = this.data.newinfo[field]
this.setData({
step,
popUpIs,
@ -1748,7 +1756,6 @@ Page({
popUpStepState,
})
console.log("popUpTitle", this.data.popUpTitle);
return
} else {
@ -1791,7 +1798,9 @@ Page({
let fieldinfoNew = this.data.fieldinfoNew
// let popUpdate = { ...fieldinfoNew[this.data.fieldinfo[this.data.popUpit][this.data.step].field] }
let popUpdate = { ...fieldinfoNew[this.data.fieldinfo[this.data.popUpit][this.data.step].field] }
let popUpdate = {
...fieldinfoNew[this.data.fieldinfo[this.data.popUpit][this.data.step].field]
}
let field = popUpdate.field
if (field == 'video') {
if (this.data.videos.length > 0) {
@ -1813,10 +1822,19 @@ Page({
if (popUpIs == 'unilineInput' || popUpIs == 'multilineInput' || popUpIs == 'multilineInput1') {
this.data.focustitle = popUpdate.field
}
if (popUpdate.field == "sunshinearea" && this.data.newinfo['sunshinearea'].length == 0 ) {
this.data.newinfo['sunshinearea'] = [0]
popUpdate.value = [0]
}
this.setData({
popUpdate,
focustitle: this.data.focustitle
})
console.log("0popUpdate", popUpdate);
}
if (popUpIs == 'nearSchool') {
@ -1834,6 +1852,7 @@ Page({
this.data.newinfo.leasetime = calculateOfDateList.year + '-' + calculateOfDateList.month + '-' + new Date().getDate()
}
this.setData({
popUpSubtitle,
popUpTitle,
@ -1862,7 +1881,6 @@ Page({
if (popUpdate.field == "location" && targetValue.length > 6) return
targetValue.sort()
if (targetValue.length == 0) targetValue = [0]
@ -2118,6 +2136,12 @@ Page({
this.data.focustitle = popUpdate.field
}
if ((field == "floor" || field == "property" || field == 'sunshinearea') && this.data.newinfo[field].length == 0) {
this.data.newinfo[field] = [0]
popUpdate['value'] = [0]
} else popUpdate['value'] = this.data.newinfo[field]
this.setData({
popUpdate,
popUpIs: popUpdate.popUpIs,
@ -2247,13 +2271,11 @@ Page({
newinfo.school = this.data.nearSchoolList
if (newinfo.rentalduration == '不限租期') {
newinfo.rentalduration = 0
}
if (newinfo.rentalduration == '不限租期') newinfo.rentalduration = 0
if (newinfo.leasetime == '随时') newinfo.leasetime = 0
if (newinfo.leasetime == '随时') {
newinfo.leasetime = 0
}
for (const key in fieldinfo) {
fieldinfo[key].forEach(element => {
@ -2263,10 +2285,10 @@ Page({
console.log("this.data.fieldinfoNew", this.data.fieldinfoNew);
let fieldinfoNew = this.data.fieldinfoNew
fieldinfoNew[element.field].choices.forEach(el => {
el.choices.forEach(e => {
if (newinfo.type && newinfo.type.indexOf(e.value) >= 0) newinfo.type = e.key
// el.choices.forEach(e => {
if (newinfo.type && newinfo.type.indexOf(el.value) >= 0) newinfo.type = el.key
})
// })
})
}

View File

@ -437,13 +437,12 @@
<view class="leaseTime pop-up">
<view class="pop-up-box">
<view class="pop-up-top" bindtap="closePopUp">
<!-- <view class="pop-up-arrow"></view> -->
<image class="pop-up-arrow" mode="widthFix" src="/img/back.png"></image>
</view>
<view class="pop-up-title">{{ item.title || popUpTitle }}</view>
<text class="last-step-text">{{popUpSubtitle}}</text>
<picker-view indicator-class="picker" indicator-style="height: 50px;" style="width: 100%; height: 670rpx;margin: 100rpx 0;" immediate-change="{{ true }}" value="{{leaseTimeValue}}" bindchange="bindChange">
<picker-view indicator-class="picker" indicator-style="height: 50px;" style="width: 100%; height: 670rpx;margin: 100rpx 0;" immediate-change="{{ true }}" value="{{ [leaseTimeValue] }}" bindchange="bindChange">
<picker-view-column style="text-align: center;margin: 0 75rpx 200rpx;">
<view wx:for="{{ item.choices }}" wx:key="key" class="{{ index == leaseTimeValue ? 'pickerpitch' : ''}}" style="line-height: 50px;" data-item="{{ item }}">{{item.value}}</view>
</picker-view-column>