提交
This commit is contained in:
parent
9119a9cd49
commit
46509dd860
@ -533,6 +533,11 @@ Page({
|
||||
let aa = this.data.aa
|
||||
let locationObj = {}
|
||||
|
||||
if (data.info['rent'] == 0) data.info['rent'] = []
|
||||
if (data.info['sunshinearea'] == 0) data.info['sunshinearea'] = []
|
||||
if (data.info['floor'] == 0) data.info['floor'] = []
|
||||
if (data.info['acreage'] == '') data.info['acreage'] = []
|
||||
|
||||
for (const key in data.fieldinfo) {
|
||||
let choices = null
|
||||
data.fieldinfo[key].forEach(element => {
|
||||
@ -557,7 +562,6 @@ Page({
|
||||
fieldinfoNew[element.field]['leftSliderPriceWidthX'] = '0%'
|
||||
fieldinfoNew[element.field]['rightSliderPriceWidthX'] = '0%'
|
||||
|
||||
console.log("Array.isArray(data.info[element.field])", data.info[element.field]);
|
||||
if (Array.isArray(data.info[element.field]) && data.info[element.field].length == 0) {
|
||||
fieldinfoNew[element.field]['slider1Value'] = 0
|
||||
fieldinfoNew[element.field]['slider2Value'] = 10000
|
||||
@ -579,7 +583,6 @@ Page({
|
||||
choices.forEach((e, i) => {
|
||||
if (e.key == Math.trunc(el.key)) data.info.type = e.value + '>' + el.value
|
||||
})
|
||||
|
||||
}
|
||||
if (el.key % 1 == 0) {
|
||||
choicesnew[el.key - 1] = {
|
||||
@ -679,11 +682,9 @@ Page({
|
||||
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') {
|
||||
if ((this.data.types == 'edit' || this.data.types == 'edit1') && element.field != 'floor' && element.field != 'sunshinearea') {
|
||||
element.choices.forEach(el => {
|
||||
if (el.key == data.info[element.field]) {
|
||||
data.info[element.field] = el.value
|
||||
}
|
||||
if (el.key == data.info[element.field]) data.info[element.field] = el.value
|
||||
})
|
||||
}
|
||||
|
||||
@ -773,6 +774,11 @@ Page({
|
||||
});
|
||||
}
|
||||
|
||||
// if (data.info['rent'] == 0) data.info['rent'] = []
|
||||
// if (data.info['sunshinearea'] == 0) data.info['sunshinearea'] = []
|
||||
// if (data.info['floor'] == 0) data.info['floor'] = []
|
||||
// if (data.info['acreage'] == '') data.info['acreage'] = []
|
||||
|
||||
|
||||
// if (data.info.floor != null) data.info.floor = data.info.floor != 0 ? data.info.floor + '楼' : null
|
||||
|
||||
@ -809,6 +815,7 @@ Page({
|
||||
newinfo: data.info,
|
||||
newToken: data.token,
|
||||
imgs: data.info.images,
|
||||
allowpublishednum: data.allowpublishednum,
|
||||
videos: data.info.video,
|
||||
publishingrules: data.publishingrules,
|
||||
floorValue: this.data.floorValue,
|
||||
@ -985,9 +992,8 @@ Page({
|
||||
if (that.data.info[i]) {
|
||||
that.data.info[i]['value'] = data.data.info[i]
|
||||
}
|
||||
if (i == 'school') {
|
||||
this.data.aroundSchoolList = data.data.info.school;
|
||||
}
|
||||
if (i == 'school') this.data.aroundSchoolList = data.data.info.school;
|
||||
|
||||
|
||||
}
|
||||
if (data.data.info.images_url && data.data.info.images_url.length > 0) {
|
||||
@ -1693,11 +1699,11 @@ Page({
|
||||
|
||||
if (popUpIs == 'unilineInput' || popUpIs == 'multilineInput' || popUpIs == 'multilineInput1') this.data.focustitle = field
|
||||
|
||||
if (field == "acreage" && this.data.newinfo[field].length < 2) {
|
||||
this.data.newinfo[field] = [0, 1000]
|
||||
this.data.fieldinfoNew[field]['value'] = [0, 1000]
|
||||
if ((field == "acreage" || field == "rent") && this.data.newinfo[field].length < 2) {
|
||||
this.data.newinfo[field] = [0, 10000]
|
||||
this.data.fieldinfoNew[field]['value'] = [0, 10000]
|
||||
this.data.fieldinfoNew[field]['slider1Value'] = 0
|
||||
this.data.fieldinfoNew[field]['slider2Value'] = 1000
|
||||
this.data.fieldinfoNew[field]['slider2Value'] = 10000
|
||||
} else if ((field == "floor" || field == "property" || field == 'sunshinearea') && this.data.newinfo[field].length == 0) {
|
||||
this.data.newinfo[field] = [0]
|
||||
this.data.fieldinfoNew[field]['value'] = [0]
|
||||
@ -1714,8 +1720,6 @@ Page({
|
||||
focustitle: this.data.focustitle
|
||||
})
|
||||
|
||||
console.log("popUpdate", this.data.popUpdate);
|
||||
|
||||
},
|
||||
|
||||
// 选择弹窗选项 单选
|
||||
@ -1878,10 +1882,11 @@ Page({
|
||||
|
||||
let popUpdate = this.data.popUpdate
|
||||
let targetValue = popUpdate.value ? [...popUpdate.value] : []
|
||||
|
||||
key = key.toString()
|
||||
if (key == 0) targetValue = [0]
|
||||
else {
|
||||
if (targetValue.includes(0)) targetValue.splice(targetValue.indexOf(0), 1)
|
||||
if (targetValue.includes("0")) targetValue.splice(targetValue.indexOf("0"), 1)
|
||||
if (targetValue.includes(key)) targetValue.splice(targetValue.indexOf(key), 1)
|
||||
else targetValue.push(key)
|
||||
}
|
||||
@ -2006,7 +2011,6 @@ Page({
|
||||
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
|
||||
})
|
||||
@ -2036,7 +2040,6 @@ Page({
|
||||
if (currentField == 'rentalduration') {
|
||||
this.setData({
|
||||
['newinfo.rentalduration']: this.data.popUpdate.choices[this.data.leaseTimeValue].value
|
||||
// ['newinfo.rentalduration']: this.data.fieldinfoNew['rentalduration'].choices[1].choices[this.data.leaseTimeValue].value
|
||||
})
|
||||
}
|
||||
|
||||
@ -2143,10 +2146,10 @@ Page({
|
||||
|
||||
|
||||
if (field == "acreage" && this.data.newinfo[field].length < 2) {
|
||||
this.data.newinfo[field] = [0, 1000]
|
||||
popUpdate['value'] = [0, 1000]
|
||||
this.data.newinfo[field] = [0, 10000]
|
||||
popUpdate['value'] = [0, 10000]
|
||||
popUpdate['slider1Value'] = 0
|
||||
popUpdate['slider2Value'] = 1000
|
||||
popUpdate['slider2Value'] = 10000
|
||||
} else if ((field == "floor" || field == "property" || field == 'sunshinearea') && this.data.newinfo[field].length == 0) {
|
||||
this.setData({
|
||||
[`newinfo.${field}`]: [0]
|
||||
@ -2312,6 +2315,7 @@ Page({
|
||||
|
||||
// 房屋类型
|
||||
// if (element.field == "property") {
|
||||
// console.log("res.value", newinfo.property);
|
||||
// element.choices.forEach(res => {
|
||||
// if (res.value == newinfo.property) {
|
||||
// newinfo.property = res.key
|
||||
@ -2359,6 +2363,7 @@ Page({
|
||||
})
|
||||
}
|
||||
|
||||
// return
|
||||
|
||||
// miucms.request(app.globalData.baseURL + '/tenement/publish/submit', {
|
||||
miucms.request(app.globalData.baseURL + '/tenement/v2/api/publish/submit', {
|
||||
@ -2543,6 +2548,13 @@ Page({
|
||||
|
||||
let popUpdate = this.data.fieldinfoNew[field]
|
||||
|
||||
if (field == "rent" && this.data.newinfo[field].length < 2) {
|
||||
this.data.newinfo[field] = [0, 10000]
|
||||
popUpdate['value'] = [0, 10000]
|
||||
popUpdate['slider1Value'] = 0
|
||||
popUpdate['slider2Value'] = 10000
|
||||
}
|
||||
|
||||
for (const key in fieldinfo) {
|
||||
fieldinfo[key].forEach((element, index) => {
|
||||
if (element.field == field) {
|
||||
@ -2555,10 +2567,10 @@ Page({
|
||||
popUpStepState: popUpdate.popUpStepState
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
})
|
||||
|
||||
console.log("popUpdate", this.data.popUpdate);
|
||||
|
||||
}
|
||||
|
||||
// for (const key in fieldinfo) {
|
||||
|
@ -95,7 +95,7 @@
|
||||
</view>
|
||||
|
||||
<view class="edit-head-surplus flexacenter" bindtap="setValue" data-key="popUpIs" data-value="about">
|
||||
<view class="edit-head-surplus-text">您还可以发布 <text>3</text> 条普通房源</view>
|
||||
<view class="edit-head-surplus-text">您还可以发布 <text>{{ allowpublishednum }}</text> 条普通房源</view>
|
||||
<view class="flexacenter">
|
||||
了解更多<image class="edit-head-surplus-icon" src="/img/blue-arrow.svg"></image>
|
||||
</view>
|
||||
@ -118,7 +118,7 @@
|
||||
|
||||
<!-- 基础区域 -->
|
||||
<view class="edit-option-item">
|
||||
<block wx:for="{{ fieldinfo.basic }}" wx:key="index"> {{ item.field }}
|
||||
<block wx:for="{{ fieldinfo.basic }}" wx:key="index">
|
||||
<template wx:if="{{ item.field == 'acreage' }}" is="pageInput" data="{{ item,index,it:'basic',newinfo,fieldinfo }}"></template>
|
||||
<template wx:elif="{{ item.field == 'property' || item.field == 'floor' || item.field == 'sunshinearea' }}" is="clickInputUnderArrowMultiple" data="{{ item,index,it:'basic',newinfo,fieldinfo,propertyObj,floorObj,sunshineareaObj }}"></template>
|
||||
<template wx:else is="clickInputUnderArrow" data="{{ item,index,it:'basic',newinfo,fieldinfo,fieldinfoNew }}"></template>
|
||||
@ -297,13 +297,13 @@
|
||||
<view class="clickInput-title">{{ item.title }}<text style="color:#C54235;margin-left: 10rpx;">*</text></view>
|
||||
<view class="clickInput" bindtap="clickOption" data-field="{{ item.field }}" data-step="{{ index }}" data-it="{{ it }}">
|
||||
<block wx:if="{{ item.field == 'property' && newinfo[item.field].length != 0 }}">
|
||||
<block wx:for="{{ newinfo[item.field] }}" wx:for-item="it">{{ propertyObj[it] }}{{ index != newinfo[item.field].length - 1 ? ' / ' : '' }}</block>
|
||||
<block wx:for="{{ newinfo[item.field] }}" wx:for-item="it" wx:key="index">{{ propertyObj[it] }}{{ index != newinfo[item.field].length - 1 ? ' / ' : '' }}</block>
|
||||
</block>
|
||||
<block wx:elif="{{ item.field == 'floor' && newinfo[item.field].length != 0 }}">
|
||||
<block wx:for="{{ newinfo[item.field] }}" wx:for-item="it">{{ floorObj[it] }}{{ index != newinfo[item.field].length - 1 ? ' / ' : '' }}</block>
|
||||
<block wx:for="{{ newinfo[item.field] }}" wx:for-item="it" wx:key="index">{{ floorObj[it] }}{{ index != newinfo[item.field].length - 1 ? ' / ' : '' }}</block>
|
||||
</block>
|
||||
<block wx:elif="{{ item.field == 'sunshinearea' && newinfo[item.field].length != 0 }}">
|
||||
<block wx:for="{{ newinfo[item.field] }}" wx:for-item="it">{{ sunshineareaObj[it] }}{{ index != newinfo[item.field].length - 1 ? ' / ' : '' }}</block>
|
||||
<block wx:for="{{ newinfo[item.field] }}" wx:for-item="it" wx:key="index">{{ sunshineareaObj[it] }}{{ index != newinfo[item.field].length - 1 ? ' / ' : '' }}</block>
|
||||
</block>
|
||||
<input wx:else disabled type="{{ item.type }}" placeholder="请选择" value="{{newinfo[item.field]}}" />
|
||||
<view class="clickInputBottomArrow"></view>
|
||||
@ -824,8 +824,8 @@
|
||||
<view class="pop-up-footer flexcenter" wx:if="{{ popUpStepState == 1 && newStatus != 1}}">
|
||||
<view class="pop-up-save" style="width: 360rpx;" bindtap='NewRelease' data-status="0">保存并退出</view>
|
||||
</view>
|
||||
<view class="pop-up-footer flexcenter" wx:if="{{ popUpStepState == 2}}">
|
||||
<view class="pop-up-save" bindtap='NewRelease' data-status="0" wx:if="{{ newStatus != 1}}">保存并退出</view>
|
||||
<view class="pop-up-footer flexcenter" wx:if="{{ popUpStepState == 2 }}">
|
||||
<view class="pop-up-save" bindtap='NewRelease' data-status="0" wx:if="{{ newStatus != 1 }}"> {{ newStatus }} 保存并退出</view>
|
||||
<view class="pop-up-nextStep" catchtap="popUpNextStep" data-field="{{ field }}">下一步</view>
|
||||
</view>
|
||||
<view class="pop-up-footer flexcenter" wx:if="{{ popUpStepState == 3 }}">
|
||||
@ -992,7 +992,7 @@
|
||||
|
||||
</view>
|
||||
</view>
|
||||
<template is="pop-up-footer" data="{{ popUpStepState: item.popUpStepState }}"></template>
|
||||
<template is="pop-up-footer" data="{{ popUpStepState: item.popUpStepState,newStatus,newtype }}"></template>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
|
@ -774,7 +774,7 @@
|
||||
<view class="pop-up-save" style="width: 360rpx;" bindtap='NewRelease' data-status="0">保存并退出</view>
|
||||
</view>
|
||||
<view class="pop-up-footer flexcenter" wx:if="{{ popUpStepState == 2}}">
|
||||
<view class="pop-up-save" bindtap='NewRelease' data-status="0" wx:if="{{ newStatus != 1}}">保存并退出</view>
|
||||
<view class="pop-up-save" bindtap='NewRelease' data-status="0" wx:if="{{ newStatus != 1 }}">保存并退出</view>
|
||||
<view class="pop-up-nextStep" catchtap="popUpNextStep" data-field="{{ field }}">下一步</view>
|
||||
</view>
|
||||
<view class="pop-up-footer flexcenter" wx:if="{{ popUpStepState == 3 }}">
|
||||
|
@ -21,7 +21,7 @@
|
||||
|
||||
<view class="footer">
|
||||
<view class="l">
|
||||
<view class="currency">{{ item.currency }}</view>
|
||||
<view class="currency">{{ item.currency || '港元' }}</view>
|
||||
<view class="price">{{ item.rent }}</view>
|
||||
<view class="unit">/{{ item.rentalperiod || '月' }}</view>
|
||||
</view>
|
||||
|
@ -8,32 +8,43 @@ Page({
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
showTOTOP:false,
|
||||
loading:true,
|
||||
conditionFixed: false,//筛选条件一列是否固定在顶部
|
||||
attachment:[],
|
||||
groupSearch: [],//组合最热
|
||||
showTOTOP: false,
|
||||
loading: true,
|
||||
conditionFixed: false, //筛选条件一列是否固定在顶部
|
||||
attachment: [],
|
||||
groupSearch: [], //组合最热
|
||||
selectGroupIndex: null,
|
||||
orderby: {
|
||||
value: 'timestamp',
|
||||
list: [
|
||||
{ name: "最新发布", value: 'timestamp' },
|
||||
{ name: "热门", value: 'hotnum' },
|
||||
{ name: "价格从低到高", value: 'rentasc' },
|
||||
{ name: "价格从高到低", value: 'rentdesc' },
|
||||
list: [{
|
||||
name: "最新发布",
|
||||
value: 'timestamp'
|
||||
},
|
||||
{
|
||||
name: "热门",
|
||||
value: 'hotnum'
|
||||
},
|
||||
{
|
||||
name: "价格从低到高",
|
||||
value: 'rentasc'
|
||||
},
|
||||
{
|
||||
name: "价格从高到低",
|
||||
value: 'rentdesc'
|
||||
},
|
||||
]
|
||||
},
|
||||
list:[],
|
||||
page:{
|
||||
next_page:1
|
||||
list: [],
|
||||
page: {
|
||||
next_page: 1
|
||||
},
|
||||
location:{},
|
||||
types:{
|
||||
data:[],
|
||||
value:''
|
||||
location: {},
|
||||
types: {
|
||||
data: [],
|
||||
value: ''
|
||||
},
|
||||
property:{},
|
||||
cityList:[],
|
||||
property: {},
|
||||
cityList: [],
|
||||
moreCondition: {
|
||||
show: false,
|
||||
data: {
|
||||
@ -42,12 +53,12 @@ Page({
|
||||
publish: "twomonth",
|
||||
}
|
||||
},
|
||||
city:{
|
||||
uniqid:"",
|
||||
name:"",
|
||||
alias:''
|
||||
city: {
|
||||
uniqid: "",
|
||||
name: "",
|
||||
alias: ''
|
||||
},
|
||||
hascondition:true,
|
||||
hascondition: true,
|
||||
},
|
||||
onPageScroll(e) {
|
||||
if (e.scrollTop > 1000 && !this.data.showTOTOP) {
|
||||
@ -80,45 +91,47 @@ Page({
|
||||
this.get_config()
|
||||
this.firstInpage = false;
|
||||
},
|
||||
firstInpage:true,
|
||||
onShow(){
|
||||
firstInpage: true,
|
||||
onShow() {
|
||||
var that = this;
|
||||
if(this.firstInpage){return false}
|
||||
if (this.firstInpage) {
|
||||
return false
|
||||
}
|
||||
wx.getStorage({
|
||||
key: 'selectcityData',
|
||||
success: function(res) {
|
||||
if (res.data.uniqid == that.data.city.uniqid){
|
||||
success: function (res) {
|
||||
if (res.data.uniqid == that.data.city.uniqid) {
|
||||
return false
|
||||
}
|
||||
that.setData({
|
||||
city: res.data,
|
||||
selectGroupIndex: null
|
||||
})
|
||||
if (res.data && res.data.uniqid && app.globalData.config.lists ){
|
||||
if (res.data && res.data.uniqid && app.globalData.config.lists) {
|
||||
that.clear_data()
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
})
|
||||
},
|
||||
|
||||
onUnload(){
|
||||
|
||||
onUnload() {
|
||||
wx.removeStorage({
|
||||
key: 'selectcityData',
|
||||
success: function(res) {},
|
||||
success: function (res) {},
|
||||
})
|
||||
wx.removeStorage({
|
||||
key: 'countryList',
|
||||
success: function(res) {},
|
||||
success: function (res) {},
|
||||
})
|
||||
|
||||
|
||||
},
|
||||
get_config() {
|
||||
var that = this;
|
||||
// console.log('get_configget_configget_configget_config');
|
||||
|
||||
if (app.globalData.config.lists) {
|
||||
|
||||
|
||||
config = app.globalData.config;
|
||||
|
||||
that.data.user = app.globalData.user;
|
||||
@ -139,15 +152,15 @@ Page({
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
onPullDownRefresh: function () {
|
||||
if (!app.globalData.config || !app.globalData.config.lists) {
|
||||
// console.log('还没拿到数据呢。。。。。。。。')
|
||||
wx.stopPullDownRefresh();
|
||||
return false
|
||||
}
|
||||
|
||||
|
||||
this.clear_data()
|
||||
this.getAd()
|
||||
this.getgroupSearch();
|
||||
@ -158,7 +171,7 @@ Page({
|
||||
* 页面上拉触底事件的处理函数
|
||||
*/
|
||||
onReachBottom: function () {
|
||||
if (!app.globalData.config || !app.globalData.config.lists || this.data.page.next_page<2) {
|
||||
if (!app.globalData.config || !app.globalData.config.lists || this.data.page.next_page < 2) {
|
||||
return false
|
||||
}
|
||||
this.get_list()
|
||||
@ -170,13 +183,13 @@ Page({
|
||||
onShareAppMessage: function () {
|
||||
let path = `/pages/restOfWorld/restOfWorld?name=${this.data.city.name}&cityid=${this.data.city.uniqid}&alias=${this.data.city.alias}`;
|
||||
var title = '寄托香港租房';
|
||||
if(this.data.city.name){
|
||||
if (this.data.city.name) {
|
||||
title = '寄托香港租房 - ' + this.data.city.name
|
||||
}
|
||||
return {
|
||||
path:path,
|
||||
path: path,
|
||||
title: title,
|
||||
success:function(res){
|
||||
success: function (res) {
|
||||
miucms.share(app, 'index')
|
||||
}
|
||||
}
|
||||
@ -190,7 +203,7 @@ Page({
|
||||
})
|
||||
wx.hideLoading()
|
||||
|
||||
}).catch(res => { })
|
||||
}).catch(res => {})
|
||||
|
||||
},
|
||||
// 组合搜索
|
||||
@ -199,33 +212,39 @@ Page({
|
||||
miucms.request(app.globalData.config.otherlist.groupsearch, {}).then(data => {
|
||||
this.setData({
|
||||
groupSearch: data.data
|
||||
},function(){
|
||||
}, function () {
|
||||
that.calculateConditionPosition()
|
||||
})
|
||||
wx.hideLoading()
|
||||
|
||||
}).catch(res => { })
|
||||
}).catch(res => {})
|
||||
},
|
||||
// 拉取列表
|
||||
get_list() {
|
||||
var that = this;
|
||||
this.setData({
|
||||
loading:true
|
||||
loading: true
|
||||
})
|
||||
miucms.request(app.globalData.config.otherlist.init, Object.assign({}, this.data.moreCondition.data,{
|
||||
page:this.data.page.next_page,
|
||||
'type':this.data.types.value*1,
|
||||
miucms.request(app.globalData.config.otherlist.init, Object.assign({}, this.data.moreCondition.data, {
|
||||
page: this.data.page.next_page,
|
||||
'type': this.data.types.value * 1,
|
||||
orderby: this.data.orderby.value,
|
||||
cityid:this.data.city.uniqid
|
||||
cityid: this.data.city.uniqid
|
||||
})).then(data => {
|
||||
let list = data.data
|
||||
|
||||
list.forEach(element => {
|
||||
if (Array.isArray(element.rent)) element.rent = element.rent.join(' ~ ')
|
||||
})
|
||||
|
||||
that.setData({
|
||||
list: that.data.list.concat(data.data),
|
||||
loading:false,
|
||||
page:data.page
|
||||
list: that.data.list.concat(list),
|
||||
loading: false,
|
||||
page: data.page
|
||||
})
|
||||
wx.hideLoading()
|
||||
|
||||
}).catch(res => { })
|
||||
}).catch(res => {})
|
||||
},
|
||||
// 获取地域列表
|
||||
getLocationList() {
|
||||
@ -241,16 +260,18 @@ Page({
|
||||
})
|
||||
wx.setStorage({
|
||||
key: 'countryList',
|
||||
data:data.data.cityList,
|
||||
data: data.data.cityList,
|
||||
})
|
||||
wx.hideLoading()
|
||||
|
||||
}).catch(res => { })
|
||||
}).catch(res => {})
|
||||
},
|
||||
// 计算筛选条件位置
|
||||
calculateConditionPosition() {
|
||||
var that = this;
|
||||
wx.createIntersectionObserver().relativeToViewport({ top: -20 }).observe('.hot-text-box', res => {
|
||||
wx.createIntersectionObserver().relativeToViewport({
|
||||
top: -20
|
||||
}).observe('.hot-text-box', res => {
|
||||
console.log(res.intersectionRatio)
|
||||
if (res.intersectionRatio > 0) {
|
||||
that.setData({
|
||||
@ -326,23 +347,24 @@ Page({
|
||||
let index = e.currentTarget.dataset.index;
|
||||
let obj = this.data.groupSearch[index].where;
|
||||
// this.data.location.value = [...obj.location];//区域
|
||||
this.data.types.value = obj['type'];//出租方式
|
||||
this.data.types.value = obj['type']; //出租方式
|
||||
// this.data.money.rent_min = obj.rent_min;
|
||||
// this.data.money.rent_max = obj.rent_max;//租金
|
||||
this.data.orderby.value = obj.orderby;//排序
|
||||
var isNotID = true, city = {
|
||||
uniqid: obj.cityid,
|
||||
name: '',
|
||||
"alias": ""
|
||||
};
|
||||
this.data.orderby.value = obj.orderby; //排序
|
||||
var isNotID = true,
|
||||
city = {
|
||||
uniqid: obj.cityid,
|
||||
name: '',
|
||||
"alias": ""
|
||||
};
|
||||
|
||||
this.data.cityList.every(item=>{
|
||||
item.city.every(s=>{
|
||||
if (s.cityid == obj.cityid){
|
||||
this.data.cityList.every(item => {
|
||||
item.city.every(s => {
|
||||
if (s.cityid == obj.cityid) {
|
||||
isNotID = false;
|
||||
city.name = s.name;
|
||||
city.alias = item.alias;
|
||||
}
|
||||
}
|
||||
return isNotID
|
||||
})
|
||||
return isNotID
|
||||
@ -378,5 +400,5 @@ Page({
|
||||
})
|
||||
miucms.closeAD(e.detail.id)
|
||||
}
|
||||
|
||||
|
||||
})
|
@ -71,6 +71,8 @@ Page({
|
||||
elseResourceData: [], // 其他房源数据
|
||||
unitTop: 0, // 租金预算的高度
|
||||
bottomUnitState: false, // 底部租金 预算显示状态
|
||||
service: "",
|
||||
servicename: "",
|
||||
basicRequirementsList: [{ // 求房源的基本数据 键值对
|
||||
key: "property",
|
||||
name: "房屋类型"
|
||||
@ -240,12 +242,7 @@ Page({
|
||||
} else {
|
||||
|
||||
data = data.data
|
||||
// data.info.intermediary = 6
|
||||
let info = data.info
|
||||
if (Array.isArray(info['rent'])) {
|
||||
info['rent'] = info['rent'][0] + ' ~ ' + info['rent'][1]
|
||||
}
|
||||
|
||||
|
||||
that.setData({
|
||||
irentCouponBig: app.globalData.irentCouponBig || true,
|
||||
@ -264,6 +261,8 @@ Page({
|
||||
listingcount: data.listingcount,
|
||||
landlordcertification: data.landlordcertification,
|
||||
langs: this.data.langs,
|
||||
service: data.service,
|
||||
servicename: data.servicename,
|
||||
loding: false
|
||||
})
|
||||
if (data.info && data.info.introduction && data.info.introduction.length > 0 && data.info.introduction != ' ') {
|
||||
@ -282,7 +281,7 @@ Page({
|
||||
// 判断是否是求房源 如果是需要获取租金位置
|
||||
this.getRentalLocation()
|
||||
|
||||
this.againstTargetArea()
|
||||
this.handleDetailData()
|
||||
}
|
||||
}).catch(res => {
|
||||
wx.hideLoading()
|
||||
@ -306,38 +305,42 @@ Page({
|
||||
})
|
||||
},
|
||||
|
||||
// 对照目标区域的
|
||||
againstTargetArea() {
|
||||
let langs = this.data.langs
|
||||
console.log("langs", langs);
|
||||
// 专门梳理v4出现的 语音包 及 不同房源值的处理
|
||||
handleDetailData() {
|
||||
let langs = this.data.langs || {}
|
||||
if (Object.keys(langs).length == 0) {
|
||||
setTimeout(() => {
|
||||
this.againstTargetArea()
|
||||
}, 800)
|
||||
}, 300)
|
||||
} else {
|
||||
let info = this.data.info
|
||||
|
||||
if (Array.isArray(info['acreage'])) info['acreage'] = info['acreage'][0] + ' ~ ' + info['acreage'][1]
|
||||
// 判断是否是求房源的区间 面积 和 价格
|
||||
// if (Array.isArray(info['rent'])) info['rent'] = info['rent'][0] + ' ~ ' + info['rent'][1]
|
||||
let judgeArr = ['acreage', 'rent']
|
||||
judgeArr.forEach(element => {
|
||||
if (Array.isArray(info[element])) info[element] = info[element][0] + ' ~ ' + info[element][1]
|
||||
})
|
||||
|
||||
|
||||
// 这个是将 详情键 替换语言包里的值
|
||||
let list = ['type', 'rentalduration', 'intermediary']
|
||||
console.log("info['floor']", info['floor']);
|
||||
if (Array.isArray(info['floor'])) list.push('floor')
|
||||
|
||||
|
||||
let differentNames = {
|
||||
if (Array.isArray(info['floor'])) list.push('floor') // 判断 楼层是否需要 替换值, 因为在求房源里是多个值
|
||||
let differentNames = { // 需要替换的 键名
|
||||
"intermediary": "intermediary_text"
|
||||
}
|
||||
|
||||
list.forEach(element => {
|
||||
if (info[element] == 0) info[differentNames[element] ? differentNames[element] : element] = '不限'
|
||||
if (info[element] == 0) info[differentNames[element] ? differentNames[element] : element] = '不限' // 当 值为 [0] 时为不限
|
||||
else info[differentNames[element] ? differentNames[element] : element] = langs[element][info[element]]
|
||||
})
|
||||
|
||||
let location = langs.location
|
||||
let location = langs.location // 遍历替换区域的值 所有房源
|
||||
let pendingData = info['location']
|
||||
let locationList = []
|
||||
for (const key in location) {
|
||||
if (pendingData.indexOf(key) != -1) {
|
||||
if (pendingData.indexOf(key) != -1 && Math.trunc(key) != key) {
|
||||
console.log("key", location[key]);
|
||||
|
||||
locationList.push({
|
||||
head: location[Math.trunc(key)],
|
||||
end: location[key],
|
||||
@ -345,6 +348,7 @@ Page({
|
||||
}
|
||||
}
|
||||
|
||||
console.log("locationList", locationList);
|
||||
info['locationList'] = locationList
|
||||
|
||||
this.setData({
|
||||
@ -892,5 +896,12 @@ Page({
|
||||
|
||||
},
|
||||
|
||||
// 点击复制微信号
|
||||
copyy() {
|
||||
const content = this.data.servicename;
|
||||
if (!content) return
|
||||
miucms.copy(content).then((res) => {}).catch(err => {})
|
||||
},
|
||||
|
||||
|
||||
})
|
@ -90,7 +90,7 @@
|
||||
<view class="basic-aLine-key">{{ item.name }}</view>
|
||||
<view class="basic-aLine-value flex1" wx:if="{{ item.key == 'acreage' }}">{{ info[item.key] + ' 平方呎' }}</view>
|
||||
<view class="basic-aLine-value flex1" wx:elif="{{ (item.key == 'sunshinearea' || item.key == 'property') && info[item.key] != 0 }}">
|
||||
<block wx:for="{{ info[item.key] }}" wx:for-item="it">
|
||||
<block wx:for="{{ info[item.key] }}" wx:for-item="it" wx:key="index">
|
||||
{{ langs[item.key][it] }} {{ index == info[item.key].length - 1 ? '' : '/' }}
|
||||
</block>
|
||||
</view>
|
||||
@ -145,7 +145,7 @@
|
||||
|
||||
<!-- 免责声明 -->
|
||||
<template is="disclaimer" data="{{ info }}"></template>
|
||||
|
||||
<image wx:if="{{ service }}" show-menu-by-longpress class="popularize" bindtap="copyy" src="{{ service }}" mode="widthFix"></image>
|
||||
<!-- 底部 -->
|
||||
<template is="footer1" data="{{ info,isfav,bottomLift,bottomUnitState }}"></template>
|
||||
|
||||
@ -254,7 +254,7 @@
|
||||
<view class="location-header">
|
||||
<image class="location-icon" mode="widthFix" src="/img/u1695.png"></image>
|
||||
<!-- {{ info.cityid==1 ? info.location : ((info.country || '') +' > ' + (info.city || '')) }} -->
|
||||
{{ info.locationList[0].head + ' > ' + info.locationList[1].end }}
|
||||
{{ info.locationList[0].head + ' > ' + info.locationList[0].end }}
|
||||
</view>
|
||||
<!-- 地图 -->
|
||||
<block wx:if="{{info.cityid==1 && info.point && info.point.length==2 && info.point[0]>0 && info.point[1]>0 }}">
|
||||
@ -311,6 +311,9 @@
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<image wx:if="{{ service }}" show-menu-by-longpress class="popularize" bindtap="copyy" src="{{ service }}" mode="widthFix"></image>
|
||||
|
||||
|
||||
<!-- 其他房源 -->
|
||||
<view class="else" id="else" wx:if="{{ groupid == 19 && listingcount != 1}}">
|
||||
<view class="else-title">Ta的其他房源<text style="font-weight: 500;">({{ listingcount - 1 }})</text></view>
|
||||
|
@ -658,6 +658,7 @@ map .clickmap {
|
||||
.certification {
|
||||
background-color: rgba(238, 239, 242, 1);
|
||||
min-height: 100vh;
|
||||
padding-bottom: 120rpx;
|
||||
}
|
||||
|
||||
.certification .header {
|
||||
@ -1813,4 +1814,11 @@ map .clickmap {
|
||||
color: #f95d5d;
|
||||
font-weight: 900;
|
||||
margin-bottom: 9rpx;
|
||||
}
|
||||
|
||||
.popularize {
|
||||
display: block;
|
||||
width: calc(100vw - 60rpx);
|
||||
margin: 60rpx auto 0;
|
||||
border-radius: 10rpx;
|
||||
}
|
@ -286,15 +286,20 @@ Page({
|
||||
}
|
||||
if (data.code == 200) {
|
||||
data = data.data
|
||||
that.data.fav_list = that.data.fav_list.concat(data.data)
|
||||
if (that.data.fav_list.length >= data.count) {
|
||||
this.data.fav_page.next_page = 0
|
||||
} else {
|
||||
this.data.fav_page.next_page += 1
|
||||
}
|
||||
|
||||
let list = data.data
|
||||
list.forEach(element => {
|
||||
if (Array.isArray(element.rent)) element.rent = element.rent.join(' ~ ')
|
||||
})
|
||||
|
||||
console.log(data, "0");
|
||||
|
||||
that.data.fav_list = that.data.fav_list.concat(list)
|
||||
if (that.data.fav_list.length >= data.count) this.data.fav_page.next_page = 0
|
||||
else this.data.fav_page.next_page += 1
|
||||
|
||||
that.setData({
|
||||
fav_list: that.data.fav_list,
|
||||
// fav_page: data.page,
|
||||
fav_page: this.data.fav_page,
|
||||
fav_count: data.count,
|
||||
loading: false,
|
||||
@ -335,17 +340,18 @@ Page({
|
||||
}
|
||||
if (!data.extraparam) {
|
||||
data = data.data
|
||||
that.data.publish_list = that.data.publish_list.concat(data.data);
|
||||
let list = data.data
|
||||
list.forEach(element => {
|
||||
if (Array.isArray(element.rent)) element.rent = element.rent.join(' ~ ')
|
||||
})
|
||||
|
||||
that.data.publish_list = that.data.publish_list.concat(list);
|
||||
if (that.data.publish_list.length != 0 && that.data.publish_list.length == data.count) {
|
||||
this.data.publish_page.next_page = 0;
|
||||
} else {
|
||||
this.data.publish_page.next_page += 1;
|
||||
}
|
||||
// if (data.data.length == 0) {
|
||||
// this.data.publish_page.next_page = 0;
|
||||
// } else {
|
||||
// this.data.publish_page.next_page += 1;
|
||||
// }
|
||||
|
||||
that.setData({
|
||||
publish_list: that.data.publish_list,
|
||||
publish_page: that.data.publish_page,
|
||||
|
@ -482,13 +482,13 @@
|
||||
{
|
||||
"name": "",
|
||||
"pathName": "pages/show/show",
|
||||
"query": "tid=&uniqid=OnffSLrXmeWK",
|
||||
"query": "tid=&uniqid=f8SiGzmLLSbG&cityid=1",
|
||||
"scene": null
|
||||
},
|
||||
{
|
||||
"name": "",
|
||||
"pathName": "pages/askHousing/askHousing",
|
||||
"query": "uniqid=G9SKb098Cn9W&token=rouI3n-Wb4O06YwC1IhQ24LJzU8OkTcficd0nuv1i5AgqLl2boGht5ggCJSUlyQZ8KbZOdNYw9n-LiF4J_4GV4GjTA4_qiIEA0QMG7MqM8BiM2M0&types=edit1",
|
||||
"query": "uniqid=mHD5iu4ST84a&token=TIRefefiP5keu1xJH_0LsQXqjwBCYVWi74ttIJmjpw8UtS-o-d0-SNZvKi7uCyvfUe-XA9kgc7V9xsHpM1ovC2AgJyDNgOGdfLv2RWZe4ellN2Vj&types=edit1",
|
||||
"scene": null
|
||||
}
|
||||
]
|
||||
|
Loading…
x
Reference in New Issue
Block a user