From 7d1bce817401617a4684ee6741ffd9a4480c80f3 Mon Sep 17 00:00:00 2001 From: A1300399510 Date: Tue, 25 Apr 2023 20:51:11 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/askHousing/askHousing.js | 489 ++++++++++++++++++++----------- pages/askHousing/askHousing.wxml | 152 ++++++---- pages/askHousing/askHousing.wxss | 45 +-- project.config.json | 2 +- 4 files changed, 424 insertions(+), 264 deletions(-) diff --git a/pages/askHousing/askHousing.js b/pages/askHousing/askHousing.js index b71c9bf..354a7ed 100644 --- a/pages/askHousing/askHousing.js +++ b/pages/askHousing/askHousing.js @@ -190,7 +190,7 @@ Page({ fieldinfo: [], inputList: ['acreage'], contactInformation: 'contactInformation', - popUpIs: '', // 弹窗的 is + popUpIs: '0', // 弹窗的 is 默认 0 ,只是去掉初始化时报 null 的警告 popUpdate: [], // 目标数据 popUpSubtitle: '', popUpStepState: '', // 0是啥都没有 1 是 保存 2 是保存加下一步 @@ -228,7 +228,7 @@ Page({ property: { name: '房屋类型', popUpIs: 'new-marquee-box', - popUpStepState: 1, + popUpStepState: 2, it: 'basic', field: "property" }, @@ -248,7 +248,7 @@ Page({ sunshinearea: { name: '晾晒区', popUpIs: 'new-marquee-box', - popUpStepState: 1, + popUpStepState: 2, field: "sunshinearea" }, acreage: { @@ -258,6 +258,12 @@ Page({ it: 'basic', field: "acreage" }, + location: { + name: '目标区域', + popUpIs: 'pop-target-area', + popUpStepState: 2, + field: "location" + }, gender: { name: '同住人性别要求', popUpIs: 'AListOF', @@ -311,7 +317,6 @@ Page({ max: 10000, // 两个slider所能达到的最大值 min: 0, // 两个slider所能取的最小值 rate: 100, // slider的最大最小值之差和100(或1000)之间的比率 - scale: 1, // 比例系数。页面显示值的时候,需要将slider1Value(slider2Value)乘以比例系数scale slider1Max: 10000, // slider1的最大取值 slider1Value: 0, // slider1的值 slider2Value: 10000, // slider2的值 @@ -322,29 +327,34 @@ Page({ rightSliderPriceWidthX: '0%', aboutRulesList: {}, // 关于发布的数据 + locationObj: {}, // 目标区域的数据 + propertyObj: {}, // 房屋类型的配置数据 + floorObj: {}, // 房屋类型的配置数据 + sunshineareaObj: {}, // 房屋类型的配置数据 }, // 开始滑动 changeStart: function (e) { var idx = parseInt(e.currentTarget.dataset.idx) + let popUpdate = this.data.popUpdate if (idx === 1) { // dW是当前操作的slider所能占据的最大宽度百分数 - var dW = (this.data.slider2Value - this.data.min) / this.data.rate + var dW = (popUpdate.slider2Value - popUpdate.min) / popUpdate.rate this.setData({ - slider1W: dW, - slider2W: 100 - dW, - slider1Max: this.data.slider2Value, - slider2Min: this.data.slider2Value, - change: false + ['popUpdate.slider1W']: dW, + ['popUpdate.slider2W']: 100 - dW, + ['popUpdate.slider1Max']: popUpdate.slider2Value, + ['popUpdate.slider2Min']: popUpdate.slider2Value, + ['popUpdate.change']: false }) } else if (idx === 2) { - var dw = (this.data.max - this.data.slider1Value) / this.data.rate + var dw = (popUpdate.max - popUpdate.slider1Value) / popUpdate.rate this.setData({ - slider2W: dw, - slider1W: 100 - dw, - slider1Max: this.data.slider1Value, - slider2Min: this.data.slider1Value, - change: false + ['popUpdate.slider2W']: dw, + ['popUpdate.slider1W']: 100 - dw, + ['popUpdate.slider1Max']: popUpdate.slider1Value, + ['popUpdate.slider2Min']: popUpdate.slider1Value, + ['popUpdate.change']: false }) } }, @@ -353,26 +363,31 @@ Page({ changing: function (e) { var idx = parseInt(e.currentTarget.dataset.idx) var value = e.detail.value - // let rightSliderPriceWidthX = (this.data.max - value) / 116 - 21 - let rightSliderPriceWidthX = 100 - (value / this.data.max * 100) - let leftSliderPriceWidthX = value / this.data.max * 100 + let popUpdate = this.data.popUpdate + console.log("popUpdate", popUpdate); + let rightSliderPriceWidthX = 100 - (value / popUpdate.max * 100) + let leftSliderPriceWidthX = value / popUpdate.max * 100 if (idx === 1) { this.setData({ - slider1Value: value, - leftSliderPriceWidthX: leftSliderPriceWidthX + '%' + ['popUpdate.slider1Value']: value, + ['popUpdate.leftSliderPriceWidthX']: leftSliderPriceWidthX + '%' }) } else if (idx === 2) { this.setData({ - slider2Value: value, - rightSliderPriceWidthX: rightSliderPriceWidthX + '%' + ['popUpdate.slider2Value']: value, + ['popUpdate.rightSliderPriceWidthX']: rightSliderPriceWidthX + '%' }) } + + popUpdate.value = [popUpdate.slider1Value, popUpdate.slider2Value] + }, changed: function (e) { - if (this.data.slider1Value === this.data.slider2Value && this.data.slider2Value === this.data.max) { + let popUpdate = this.data.popUpdate + if (popUpdate.slider1Value === popUpdate.slider2Value && popUpdate.slider2Value === popUpdate.max) { this.setData({ - change: true + ['popUpdate.change']: true }) } }, @@ -442,7 +457,7 @@ Page({ }, get_config() { - var that = this; + var that = this; if (app.globalData.config.lists) { config = app.globalData.config; that.setData({ @@ -513,16 +528,35 @@ Page({ let locationhead = "" let locationtail = "" let aa = this.data.aa + let locationObj = {} for (const key in data.fieldinfo) { let choices = null data.fieldinfo[key].forEach(element => { - if (!element) return - // fieldinfoNew[element.field] = {} - // console.log("fieldinfoNew[element.field]",aa[element.field].popUpIs); - // fieldinfoNew[element.field]['popUpIs'] = aa[element.field].popUpIs + fieldinfoNew[element.field] = {} + if (aa[element.field]) { + fieldinfoNew[element.field]['popUpIs'] = aa[element.field].popUpIs + fieldinfoNew[element.field]['popUpStepState'] = aa[element.field].popUpStepState + } + if (element.field == "rent" || element.field == "acreage") { + fieldinfoNew[element.field]['change'] = false + fieldinfoNew[element.field]['max'] = 10000 + fieldinfoNew[element.field]['min'] = 0 + fieldinfoNew[element.field]['rate'] = 100 + fieldinfoNew[element.field]['slider1Max'] = 10000 + fieldinfoNew[element.field]['slider1Value'] = 100 + fieldinfoNew[element.field]['slider2Value'] = 1000 + fieldinfoNew[element.field]['slider2Min'] = 0 + fieldinfoNew[element.field]['slider1W'] = 100 + fieldinfoNew[element.field]['slider2W'] = 0 + fieldinfoNew[element.field]['leftSliderPriceWidthX'] = '0%' + fieldinfoNew[element.field]['rightSliderPriceWidthX'] = '0%' + } + + fieldinfoNew[element.field]['value'] = data.info[element.field] + if (element.field == 'type') { let choices = element.choices let choicesnew = [] @@ -539,6 +573,8 @@ Page({ value: el.value, key: el.key, field: newfield, + popUpIs: "AListOF", + popUpStepState: 2, choices: [] } } else { @@ -549,16 +585,20 @@ Page({ }) } }); - fieldinfoNew[element.field] = ({ + let obj = { choices: choicesnew, field: element.field, title: element.title, type: element.type, popupwindow: element.popupwindow, required: element.required, - }) + } + + Object.assign(fieldinfoNew[element.field], obj) + return } + if (element.field == 'rentalduration') { if (this.data.types == 'edit' || this.data.types == 'edit1') { element.choices.forEach((el, i) => { @@ -568,7 +608,7 @@ Page({ } }) } - fieldinfoNew[element.field] = ({ + let obj = { choices: [{ field: element.field, value: "不限租期", @@ -582,30 +622,48 @@ Page({ type: element.type, popupwindow: element.popupwindow, required: element.required, - }) + } + + Object.assign(fieldinfoNew[element.field], obj) + return } if (element.field == 'leasetime') { - fieldinfoNew[element.field] = ({ + let obj = { choices: [{ field: "leasetime", value: "随时", }, { field: "leasetime", value: "选择日期", - choices: element.choices, + // choices: element.choices, + choices: [1], }], field: element.field, title: element.title, type: element.type, popupwindow: element.popupwindow, required: element.required, - }) + } + + Object.assign(fieldinfoNew[element.field], obj) return } - if (element.field == 'property' || element.field == 'gender' || element.field == 'intermediary' || element.field == 'elevator' || element.field == 'sunshinearea') { + if (element.field == 'property' || element.field == "floor" || element.field == 'sunshinearea') { + let obj = {} + let choices = element.choices + obj[0] = '不限' + choices.forEach(el => { + obj[el.key] = el.value + }) + this.setData({ + [`${element.field}Obj`]: obj + }) + } + + if (element.field == 'property' || element.field == 'gender' || element.field == 'intermediary' || element.field == 'elevator' || element.field == 'sunshinearea' || element.field == 'publishergender' || element.field == 'floor') { choices = [] if (element.choices.length >= 0) { if (this.data.types == 'edit' || this.data.types == 'edit1') { @@ -631,7 +689,7 @@ Page({ } } - fieldinfoNew[element.field] = ({ + let obj = ({ choices: element.choices, field: element.field, title: element.title, @@ -639,6 +697,7 @@ Page({ popupwindow: element.popupwindow, required: element.required, }) + Object.assign(fieldinfoNew[element.field], obj) return } @@ -662,43 +721,47 @@ Page({ key: el.key, choices: [] } + locationObj[el.key] = el.value } else { choicesnew[Math.trunc(el.key) - 1]['choices'].push({ value: el.value, key: el.key, field: element.field }) + locationObj[el.key] = el.value } // console.log("choicesnew", choicesnew); }); - fieldinfoNew[element.field] = ({ + let obj = { choices: choicesnew, field: element.field, title: element.title, type: element.type, popupwindow: element.popupwindow, required: element.required, - }) + } + + Object.assign(fieldinfoNew[element.field], obj) return } - fieldinfoNew[element.field] = ({ - choices, + let obj = ({ + // choices, field: element.field, title: element.title, - unit: element.unit, + unit: element.unit ? element.unit : null, type: element.type, placeholder: element.placeholder, popupwindow: element.popupwindow, required: element.required, }) + Object.assign(fieldinfoNew[element.field], obj) }); } - console.log("fieldinfoNew", fieldinfoNew); - if (data.info.floor != null) data.info.floor = data.info.floor != 0 ? data.info.floor + '楼' : null + // if (data.info.floor != null) data.info.floor = data.info.floor != 0 ? data.info.floor + '楼' : null if (data.type == "edit") this.data.contactInformationState = data.info.iswechattype else data.info.iswechattype = 0 @@ -748,7 +811,7 @@ Page({ pitchyear: this.data.pitchyear, pitchmonth: this.data.pitchmonth, pitchday: this.data.pitchday, - + locationObj, }) wx.hideLoading() @@ -1440,11 +1503,13 @@ Page({ }, bindChange: function (e) { - const val = e.detail.value + const val = e.detail.value[0] + console.log(e, "sdfd"); + let popUpdate = this.data.popUpdate this.setData({ leaseTimeValue: val, - ['newinfo.rentalduration']: this.data.fieldinfoNew['rentalduration'].choices[1].choices[val].value - + ['newinfo.rentalduration']: popUpdate.choices[val].value + // ['newinfo.rentalduration']: this.data.fieldinfoNew['rentalduration'].choices[1].choices[val].value }) }, @@ -1574,9 +1639,8 @@ Page({ pitchday: day, newinfo: this.data.newinfo }) - this.data.step = this.data.step - 1 - let that = this - that.popUpNextStep() + // this.data.step = this.data.step - 1 + this.popUpNextStep() }, // 点击操作弹出弹窗 @@ -1586,16 +1650,15 @@ Page({ step, it } = e.currentTarget.dataset + let popUpIs = "" let popUpStepState = "" - + let fieldinfoNew = this.data.fieldinfoNew if (this.data.fieldinfo[it][step].popupwindow == 0) return - this.data.aa.forEach(element => { - if (this.data.fieldinfo[it][step].title == element.name) { - popUpIs = element.popUpIs - popUpStepState = element.popUpStepState - } - }); + + + popUpIs = fieldinfoNew[field].popUpIs + popUpStepState = fieldinfoNew[field].popUpStepState if (popUpIs == 'nearSchool') { this.data.nearSchoolList.push({ @@ -1613,18 +1676,23 @@ Page({ if (popUpIs == 'unilineInput' || popUpIs == 'multilineInput' || popUpIs == 'multilineInput1') this.data.focustitle = field - + console.log("this.data.newinfo[field9]", this.data.newinfo[field]); + this.data.fieldinfoNew[field]['value'] = this.data.newinfo[field] + console.log("this.data.fieldinfoNew[field]['value']", this.data.fieldinfoNew[field]['value']); this.setData({ step, popUpIs, - popUpdate: this.data.fieldinfoNew[field], + popUpdate: { + ...this.data.fieldinfoNew[field] + }, popUpit: it, popUpStepState, focustitle: this.data.focustitle }) + }, - // 选择弹窗选项 + // 选择弹窗选项 单选 selectOption(e) { let { choices, @@ -1639,28 +1707,47 @@ Page({ field = e.currentTarget.dataset.field } else field = e - let popUpSubtitle1 = this.data.popUpSubtitle let popUpIs = "" let popUpTitle = "" let popUpStepState = "" let popUpSubtitle = "" - if (choices) { popUpSubtitle = value - this.setData({ - popUpdate: { - choices - }, - }) - } else { + popUpIs = this.data.popUpIs + let popUpStepState = this.data.popUpStepState + if (field == "rentalduration") { + popUpIs = "leaseTime" + popUpStepState = 2 + } + + if (field == "leasetime") { + popUpIs = "ofDate" + popUpStepState = 1 + } + + this.setData({ + ['popUpdate.choices']: choices, + ['popUpdate.value']: value, + popUpSubtitle, + popUpIs, + // popUpIs: choices['popUpIs'], + popUpStepState, + }) + + console.log("popUpTitle", this.data.popUpTitle); + popUpSubtitle + return + + } else { // 选择出租方式后需要 >> 显示 if (this.data.fieldinfo[this.data.popUpit][this.data.step].field == 'type') { + let headValue = this.data.popUpdate.value this.setData({ step: this.data.step + 1, - popUpdate: this.data.fieldinfo[this.data.popUpit][this.data.step + 1], - [`newinfo.${this.data.fieldinfo[this.data.popUpit][this.data.step].field}`]: popUpSubtitle1 + '>>' + value + popUpdate: this.data.fieldinfo[this.data.popUpit][this.data.step + 1], // 这是一步的数据了 + [`newinfo.${this.data.fieldinfo[this.data.popUpit][this.data.step].field}`]: headValue + '>>' + value }) } else if (this.data.fieldinfo[this.data.popUpit][this.data.step].field == 'leasetime' && value != '随时') { @@ -1674,50 +1761,50 @@ Page({ [`newinfo.${this.data.fieldinfo[this.data.popUpit][this.data.step].field}`]: value }) } + } - this.data.aa.forEach(element => { - if (value == element.name) { - popUpStepState = element.popUpStepState - popUpIs = element.popUpIs - popUpTitle = this.data.fieldinfo[element.it][this.data.step].title - } - }); + // this.data.aa.forEach(element => { + // if (value == element.name) { + // popUpStepState = element.popUpStepState + // popUpIs = element.popUpIs + // popUpTitle = this.data.fieldinfo[element.it][this.data.step].title + // } + // }); if (popUpIs == "") { if (this.data.fieldinfo[this.data.popUpit].length == this.data.step && this.data.popUpOrder.indexOf(this.data.popUpit) != -1) { this.data.popUpit = this.data.popUpOrder[this.data.popUpOrder.indexOf(this.data.popUpit) + 1] this.data.step = 0 } - this.data.aa.forEach(element => { - if (this.data.fieldinfo[this.data.popUpit][this.data.step].title == element.name) { - let field = this.data.fieldinfo[this.data.popUpit][this.data.step].field - if (field == 'video') { - if (this.data.videos.length > 0) { - this.setData({ - popUpIs: "" - }) - return - } - } else if (this.data.newinfo[field] != null && this.data.newinfo[field] != "") { - this.setData({ - popUpIs: "" - }) - return - } - this.optionScroll(field) - popUpIs = element.popUpIs - popUpTitle = this.data.fieldinfo[this.data.popUpit][this.data.step].title - popUpStepState = element.popUpStepState - if (popUpIs == 'unilineInput' || popUpIs == 'multilineInput' || popUpIs == 'multilineInput1') { - this.data.focustitle = this.data.fieldinfo[this.data.popUpit][this.data.step].field - } + + let fieldinfoNew = this.data.fieldinfoNew + 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) { this.setData({ - popUpdate: this.data.fieldinfoNew[this.data.fieldinfo[this.data.popUpit][this.data.step].field], - focustitle: this.data.focustitle + popUpIs: "" }) + return } - }); + } else if (this.data.newinfo[field] != null && this.data.newinfo[field] != "") { + this.setData({ + popUpIs: "" + }) + return + } + this.optionScroll(field) + popUpIs = popUpdate.popUpIs + popUpTitle = popUpdate.title + popUpStepState = popUpdate.popUpStepState + if (popUpIs == 'unilineInput' || popUpIs == 'multilineInput' || popUpIs == 'multilineInput1') { + this.data.focustitle = popUpdate.field + } + this.setData({ + popUpdate, + focustitle: this.data.focustitle + }) } if (popUpIs == 'nearSchool') { @@ -1743,6 +1830,40 @@ Page({ }) }, + // 选择弹窗选项多选 + selectMultipleOption(e) { + let { + key, + value + } = e.currentTarget.dataset + + let popUpdate = this.data.popUpdate + console.log("popUpdate.value", popUpdate.value); + let targetValue = popUpdate.value ? [...popUpdate.value] : [] + + if (key == 0) targetValue = [0] + else { + if (targetValue.includes(0)) targetValue.splice(targetValue.indexOf(0), 1) + if (targetValue.includes(key)) targetValue.splice(targetValue.indexOf(key), 1) + else targetValue.push(key) + } + + if (popUpdate.field == "location" && targetValue.length > 6) return + + + targetValue.sort() + + if (targetValue.length == 0) targetValue = [0] + + this.data.newinfo[popUpdate.field] = targetValue + + this.setData({ + ['popUpdate.value']: targetValue, + newinfo: this.data.newinfo + }) + + }, + // 弹出上角的关闭弹窗 closePopUp() { let currentField = this.data.fieldinfo[this.data.popUpit][this.data.step].field @@ -1761,16 +1882,20 @@ Page({ this.data.newinfo.leasetime = "" } + console.log("leaseTimeValue", this.data.leaseTimeValue); + + let popUpdate = this.data.popUpdate + let leaseTimeValue = this.data.leaseTimeValue if (this.data.popUpIs == 'leaseTime' && currentField == 'rentalduration') { this.setData({ - ['newinfo.rentalduration']: this.data.fieldinfoNew['rentalduration'].choices[1].choices[this.data.leaseTimeValue].value + ['newinfo.rentalduration']: popUpdate.choices[leaseTimeValue].value }) } if (currentField == 'floor') { - this.setData({ - ['newinfo.floor']: this.data.floorValue - 2 > 0 ? this.data.floorValue - 2 + '楼' : this.data.floorValue - 3 + '楼' - }) + // this.setData({ + // ['newinfo.floor']: this.data.floorValue - 2 > 0 ? this.data.floorValue - 2 + '楼' : this.data.floorValue - 3 + '楼' + // }) } this.setData({ @@ -1801,6 +1926,7 @@ Page({ // 弹窗右上角的跳过 popUpSkip(e) { + let fieldinfoNew = this.data.fieldinfoNew let currentFieldinfo = this.data.fieldinfo[this.data.popUpit][this.data.step] // 当前步数的 fieldinfo 数据 // 在 学校弹窗 跳过时需要 验证是否有填学校名称,没有填则删除数据 if (currentFieldinfo.field == 'school') { @@ -1829,31 +1955,33 @@ Page({ return } - this.data.aa.forEach(element => { - if (this.data.fieldinfo[this.data.popUpit][this.data.step].title == element.name) { - if (element.popUpIs == 'nearSchool') { - this.data.nearSchoolList.push({ - name: '', - distance: "" - }) - this.setData({ - nearSchoolList: this.data.nearSchoolList - }) - } - this.optionScroll(this.data.fieldinfo[this.data.popUpit][this.data.step].field) - this.setData({ - popUpIs: element.popUpIs, - popUpTitle: this.data.fieldinfo[this.data.popUpit][this.data.step].title, - popUpdate: this.data.fieldinfoNew[this.data.fieldinfo[this.data.popUpit][this.data.step].field], - popUpStepState: element.popUpStepState - }) - } - }); + let popUpdate = fieldinfoNew[this.data.fieldinfo[this.data.popUpit][this.data.step].field] + // this.data.aa.forEach(element => { + // if (this.data.fieldinfo[this.data.popUpit][this.data.step].title == element.name) { + if (popUpdate.popUpIs == 'nearSchool') { + this.data.nearSchoolList.push({ + name: '', + distance: "" + }) + this.setData({ + nearSchoolList: this.data.nearSchoolList + }) + } + this.optionScroll(popUpdate.field) + this.setData({ + popUpIs: popUpdate.popUpIs, + popUpTitle: popUpdate.title, + // popUpdate: this.data.fieldinfoNew[this.data.fieldinfo[this.data.popUpit][this.data.step].field], + popUpdate, + popUpStepState: popUpdate.popUpStepState + }) + // } + // }); }, // 下一步 popUpNextStep(e) { - let currentField = this.data.fieldinfo[this.data.popUpit][this.data.step].field + let currentField = this.data.popUpdate.field let popUpIs = "" // 下一步是附近学校时 判断学校名是否为空 空则删除对应学校数据 @@ -1872,14 +2000,14 @@ Page({ // 出租时长 if (currentField == 'rentalduration') { this.setData({ - ['newinfo.rentalduration']: this.data.fieldinfoNew['rentalduration'].choices[1].choices[this.data.leaseTimeValue].value + ['newinfo.rentalduration']: this.data.popUpdate.choices[this.data.leaseTimeValue].value + // ['newinfo.rentalduration']: this.data.fieldinfoNew['rentalduration'].choices[1].choices[this.data.leaseTimeValue].value }) } - // 楼层 - if (currentField == 'floor') { + if (currentField == 'rent') { this.setData({ - ['newinfo.floor']: this.data.floorValue - 2 > 0 ? this.data.floorValue - 2 + '楼' : this.data.floorValue - 3 + '楼' + ['newinfo.rent']: this.data.popUpdate.value }) } @@ -1913,12 +2041,14 @@ Page({ this.setData({ step: this.data.step + 1 }) + if (this.data.fieldinfo[this.data.popUpit].length == this.data.step && this.data.popUpOrder.indexOf(this.data.popUpit) != -1) { this.data.popUpit = this.data.popUpOrder[this.data.popUpOrder.indexOf(this.data.popUpit) + 1] this.data.step = 0 } // 判断下一步是否有值,有则隐藏弹窗 + console.log("nextfield", nextfield, "this.data.popUpit", this.data.popUpit); let nextfield = this.data.fieldinfo[this.data.popUpit][this.data.step].field // 判断下一步学校是否有值,原因是school值没有直接放在 nextfield 里,需要特殊处理 if (nextfield == 'school' && this.data.nearSchoolList.length != 0) { @@ -1945,46 +2075,48 @@ Page({ return } - this.data.aa.forEach(element => { - if (this.data.fieldinfo[this.data.popUpit][this.data.step].title == element.name) { - // 附近学校没有数据时加一个默认数据 - if (element.popUpIs == 'nearSchool' && this.data.nearSchoolList.length == 0) { - this.data.nearSchoolList.push({ - name: '', - distance: "" - }) - } - // 因为 field == 'address' 分香港和非香港地区 这个是香港地区的 地址,调用地图API - if (this.data.fieldinfoNew[this.data.fieldinfo[this.data.popUpit][this.data.step].field].field == 'address') { - if (this.data.fieldinfoNew.address.type == 'map') { - element.popUpIs = "AddressHongKong" - } - } + console.log(this.data.fieldinfo[this.data.popUpit][this.data.step].field); + console.log("441", this.data.popUpdate); - if (this.data.types.indexOf('edit') > -1 && this.data.fieldinfo[this.data.popUpit][this.data.step].popupwindow == 0) { - this.setData({ - popUpIs: "" - }) - return - } + let field = this.data.fieldinfo[this.data.popUpit][this.data.step].field + let popUpdate = { + ...this.data.fieldinfoNew[field] + } + let popUpStepState = popUpdate.popUpStepState - this.optionScroll(this.data.fieldinfoNew[this.data.fieldinfo[this.data.popUpit][this.data.step].field].field) - if (element.popUpIs == 'unilineInput' || element.popUpIs == 'multilineInput' || element.popUpIs == 'multilineInput1') { - this.data.focustitle = this.data.fieldinfo[this.data.popUpit][this.data.step].field - } + // return + // this.data.aa.forEach(element => { + // if (this.data.fieldinfo[this.data.popUpit][this.data.step].title == element.name) { - this.setData({ - popUpdate: this.data.fieldinfoNew[this.data.fieldinfo[this.data.popUpit][this.data.step].field], - popUpIs: element.popUpIs, - popUpStepState: element.popUpStepState, - popUpTitle: this.data.fieldinfo[this.data.popUpit][this.data.step].title, - popUpSubtitle: "", - nearSchoolList: this.data.nearSchoolList, - focustitle: this.data.focustitle - }) - } - }); + // 因为 field == 'address' 分香港和非香港地区 这个是香港地区的 地址,调用地图API + if (this.data.fieldinfoNew[popUpdate.field].field == 'address') { + if (this.data.fieldinfoNew.address.type == 'map') popUpIs = "AddressHongKong" + } + + if (this.data.types.indexOf('edit') > -1 && popUpdate.popupwindow == 0) { + this.setData({ + popUpIs: "" + }) + return + } + + this.optionScroll(this.data.fieldinfoNew[popUpdate.field].field) + if (popUpdate.popUpIs == 'unilineInput' || popUpdate.popUpIs == 'multilineInput' || popUpdate.popUpIs == 'multilineInput1') { + this.data.focustitle = popUpdate.field + } + + this.setData({ + popUpdate, + popUpIs: popUpdate.popUpIs, + popUpStepState: popUpdate.popUpStepState, + popUpTitle: popUpdate.title, + popUpSubtitle: "", + nearSchoolList: this.data.nearSchoolList, + focustitle: this.data.focustitle + }) + // } + // }); }, // 单行输入框的输入 @@ -2436,5 +2568,20 @@ Page({ return }, + // 单独处理目标区域的删除 + deleteLocation(e) { + let key = e.currentTarget.dataset.key + let location = this.data.newinfo.location + let value = this.data.popUpdate.value + + location.splice(location.indexOf(key), 1) + + this.setData({ + ['newinfo.location']: location, + ['popUpdate.value']: location, + }) + + } + }) \ No newline at end of file diff --git a/pages/askHousing/askHousing.wxml b/pages/askHousing/askHousing.wxml index 6a372bf..476e86e 100644 --- a/pages/askHousing/askHousing.wxml +++ b/pages/askHousing/askHousing.wxml @@ -1,28 +1,39 @@ - function fn(arr, arg, state) { - var result = { - indexOf: false, - toString: '' - } - for (var i = 0; i < arr.length; i++) { - if (state == 'type' || state == 'location') { - if (arr[i] && arr[i].indexOf(arg) != -1) { - result.indexOf = true - return result - } - } else { - if (arr[i] && arr[i] == arg) { - result.indexOf = true - return result - } + module.exports = { + fn: function (arr, arg, state) { // 判断是否 包含的 + var result = { + indexOf: false, + toString: '' } - result.indexOf[i] = arr.indexOf(arg) > -1; + if (state == 'location' && arr.indexOf(arg) != -1) { + result.indexOf = true + return result + } + for (var i = 0; i < arr.length; i++) { + if (state == 'type') { + if (arr[i] && arr[i].indexOf(arg) != -1) { + result.indexOf = true + return result + } + } else { + if (arr[i] && arr[i] == arg) { + result.indexOf = true + return result + } + } + result.indexOf[i] = arr.indexOf(arg) > -1; + } + return result; + }, + + floor: function (value) { // 数据向下取值的 + return Math.floor(value) } - return result; } - module.exports.fn = fn; + + // module.exports.fn = fn; @@ -41,7 +52,7 @@ - + @@ -101,19 +112,24 @@ - + {{ item.field }} - - + + + + - - + + + + + + @@ -157,7 +173,7 @@ - + @@ -221,7 +237,7 @@ - + @@ -265,6 +281,26 @@ + + + \ No newline at end of file + + + \ No newline at end of file diff --git a/pages/askHousing/askHousing.wxss b/pages/askHousing/askHousing.wxss index 0ae1d2c..f1dfd2d 100644 --- a/pages/askHousing/askHousing.wxss +++ b/pages/askHousing/askHousing.wxss @@ -1,16 +1,16 @@ /* pages/edit/edit.wxss */ -@import '../common//common.wxss'; +@import '../common/common.wxss'; .header { padding: 30rpx; font-size: 30rpx; font-size: 0; } - + .container { padding-bottom: 170rpx; width: 100vw; - overflow-x: hidden; + overflow-x: hidden; background: rgba(246, 246, 246, 1); } @@ -36,7 +36,6 @@ .header-tips { color: #000000; - /* padding: 20px 30rpx; */ padding: 0px 30rpx; line-height: 1.6; border-top: 20rpx solid rgba(246, 246, 246, 1); @@ -56,7 +55,6 @@ display: flex; align-items: center; font-weight: 650; - } .header-tips .name-tips image { @@ -221,7 +219,6 @@ position: fixed; bottom: 0; width: 750rpx; - /* height: 150rpx; */ height: 186rpx; display: flex; justify-content: space-between; @@ -237,17 +234,11 @@ display: flex; justify-content: center; align-items: center; - /* height: 90rpx; */ - /* line-height: 90rpx; */ height: 96rpx; line-height: 96rpx; background-color: rgba(98, 177, 255, 1); - /* background-color: #333333; */ - /* box-shadow: rgb(0 0 0 / 35%) 0px 0px 10rpx; */ - /* border-radius: 50rpx; */ border-radius: 82.5rpx; color: #fff; - /* font-weight: 400; */ font-weight: 650; font-size: 36rpx; color: #fff; @@ -282,7 +273,6 @@ .edit-box { background-color: #fff; - /* border-radius: 60rpx 60rpx 0 0; */ } .edit-top { @@ -491,13 +481,6 @@ width: 30rpx; height: 30rpx; transform: rotate(-90deg); - - /* width: 20rpx; */ - /* height: 20rpx; */ - /* border-bottom: 7rpx solid #333333; - border-right: 7rpx solid #333333; - transform: rotate(45deg); - margin-top: -8rpx; */ } @@ -868,11 +851,9 @@ align-items: center; justify-content: space-between; width: 690rpx; - /* margin: 36rpx 0 66rpx; */ } .contactInformation .contactInformation-wechat-item { - /* width: 330rpx; */ width: 690rpx; height: 100rpx; line-height: 100rpx; @@ -884,15 +865,6 @@ position: relative; } -/* .contactInformation .contactInformation-wechat-item .contactInformation-recommend { - position: absolute; - top: 0; - right: 0; - margin: 0; - width: 70rpx; - height: 70rpx; -} */ - .contactInformation .contactInformation-wechat-item image { width: 28rpx; height: 28rpx; @@ -914,7 +886,6 @@ .contactInformation .contactInformation-wechat-input { display: flex; border: 2rpx solid #d7d7d7; - border-radius: 20rpx; } @@ -972,7 +943,6 @@ width: 100%; display: flex; justify-content: space-between; - /* padding: 0 64rpx; */ border-bottom: 2rpx dashed #d7d7d7; line-height: 68rpx; height: 68rpx; @@ -997,7 +967,6 @@ .ofDate .ofDate-date { display: flex; flex-wrap: wrap; - /* justify-content: space-between; */ margin-top: 34rpx; padding: 0 25rpx; } @@ -1413,7 +1382,6 @@ width: 108rpx; height: 36rpx; border-radius: 8rpx; - /* margin-left: calc(100% - 180rpx); */ margin-top: 60rpx; margin-right: 69rpx; align-self: flex-end; @@ -1583,6 +1551,7 @@ wx-slider .wx-slider-handle-wrapper { width: 18rpx; height: 18rpx; margin-left: 24rpx; + padding: 6rpx; } .pop-target-area .last-step-text { @@ -1642,6 +1611,12 @@ wx-slider .wx-slider-handle-wrapper { margin-right: 15rpx; } +.pop-new-marquee-box .pop-new-marquee-list .pop-new-marquee-pitch { + width: 30rpx; + height: 30rpx; + margin-right: 15rpx; +} + .target-area {} .target-area .target-area-list { diff --git a/project.config.json b/project.config.json index 5d2f8dc..9661965 100644 --- a/project.config.json +++ b/project.config.json @@ -41,7 +41,7 @@ "ignoreUploadUnusedFiles": true }, "compileType": "miniprogram", - "libVersion": "2.31.0", + "libVersion": "2.31.1", "appid": "wx9c68fbf7886ea9c4", "projectname": "%E5%AF%84%E6%89%98%E7%A7%9F%E6%88%BF", "simulatorType": "wechat",