|
@@ -12,51 +12,82 @@ Router({
|
|
|
// 头部导航栏的高度
|
|
|
statusBarHeight: app.globalData.statusBarHeight,
|
|
|
classifyList: [{
|
|
|
- id: 1,
|
|
|
+ type: 0,
|
|
|
title: '新房',
|
|
|
icon: "../../static/images/icon/house@2x.png",
|
|
|
},
|
|
|
{
|
|
|
- id: 2,
|
|
|
+ type: 1,
|
|
|
title: '二手房',
|
|
|
icon: "../../static/images/icon/second_hand@2x.png",
|
|
|
},
|
|
|
|
|
|
{
|
|
|
- id: 3,
|
|
|
+ type: 2,
|
|
|
title: '公寓',
|
|
|
icon: "../../static/images/icon/apartments@2x.png",
|
|
|
},
|
|
|
{
|
|
|
- id: 4,
|
|
|
+ type: 3,
|
|
|
title: '民宿',
|
|
|
icon: "../../static/images/icon/b&b@2x.png",
|
|
|
},
|
|
|
{
|
|
|
- id: 5,
|
|
|
+ type: 4,
|
|
|
title: '社区',
|
|
|
icon: "../../static/images/icon/community@2x.png",
|
|
|
},
|
|
|
],
|
|
|
+ type:'',
|
|
|
+ middleType: 11,
|
|
|
+ // type :-1:所有;0:新房;1:二手房;2:公寓;3:民宿;4:社区
|
|
|
+ // 11:新上房源;12:热门房源;13:热门企业;
|
|
|
+ // 21:商家列表;
|
|
|
+ // 31:VR场景;32:VR直播间
|
|
|
middleTabList: [{
|
|
|
- id: 1,
|
|
|
+ type: 11,
|
|
|
title: '新上房源'
|
|
|
},
|
|
|
{
|
|
|
- id: 2,
|
|
|
+ type: 12,
|
|
|
title: '热门房源'
|
|
|
},
|
|
|
{
|
|
|
- id: 3,
|
|
|
+ type: 13,
|
|
|
title: '热门企业'
|
|
|
},
|
|
|
],
|
|
|
- middleType: 1,
|
|
|
+ middleList: [{
|
|
|
+ url: 'https://m4.publicimg.browser.qq.com/publicimg/pcqb/ewtab_yunying/477_266_datu_20210802.jpg',
|
|
|
+ title: '华发水岸1'
|
|
|
+ }, {
|
|
|
+ url: 'https://m4.publicimg.browser.qq.com/publicimg/pcqb/ewtab_yunying/477_266_datu_20210802.jpg',
|
|
|
+ title: '华发水岸1'
|
|
|
+ }, {
|
|
|
+ url: 'https://m4.publicimg.browser.qq.com/publicimg/pcqb/ewtab_yunying/477_266_datu_20210802.jpg',
|
|
|
+ title: '华发水岸1'
|
|
|
+ }, ],
|
|
|
+ roomTabList: [{
|
|
|
+ type: 0,
|
|
|
+ title: '新房'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: 1,
|
|
|
+ title: '二手房'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: 2,
|
|
|
+ title: '公寓'
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ roomType: 0,
|
|
|
city: app.globalData.city,
|
|
|
fetcherData: {
|
|
|
- city:'',
|
|
|
+ type:'',
|
|
|
+ city: '',
|
|
|
page_num: 1,
|
|
|
- page_size:20
|
|
|
+ page_size: 20,
|
|
|
+ name:''
|
|
|
}
|
|
|
|
|
|
},
|
|
@@ -75,7 +106,67 @@ Router({
|
|
|
// this.getBrandList(1, false, true);
|
|
|
app.onPullDownRefresh()
|
|
|
},
|
|
|
+ onReachBottom: function () {
|
|
|
+ console.log('onReachBottom')
|
|
|
+ },
|
|
|
inputFocus: function () {},
|
|
|
+ changeMiddleTab(e) {
|
|
|
+ let type = e.currentTarget.dataset.type
|
|
|
+ this.setData({
|
|
|
+ middleType: type
|
|
|
+ })
|
|
|
+
|
|
|
+ },
|
|
|
+ chengeRoomType(e) {
|
|
|
+ let type = e.currentTarget.dataset.type
|
|
|
+ this.setData({
|
|
|
+ roomType: type
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ getRoomList(){
|
|
|
+ this.setData({
|
|
|
+ 'fetcherData.type':this.data.roomType,
|
|
|
+ })
|
|
|
+ if(app.globalData.city=='全国'){
|
|
|
+ this.setData({
|
|
|
+ 'fetcherData.city':'',
|
|
|
+ })
|
|
|
+
|
|
|
+ }else{
|
|
|
+ this.setData({
|
|
|
+ 'fetcherData.city':app.globalData.city,
|
|
|
+ })
|
|
|
+ }
|
|
|
+ util.request(api.OrderList, this.data.fetcherData).then( (res)=> {
|
|
|
+ console.log(res)
|
|
|
+ if (res.errno === 0) {
|
|
|
+
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ getMiddleList(){
|
|
|
+ this.setData({
|
|
|
+ 'fetcherData.type':this.data.middleType,
|
|
|
+ })
|
|
|
+ if(app.globalData.city=='全国'){
|
|
|
+ this.setData({
|
|
|
+ 'fetcherData.city':'',
|
|
|
+ })
|
|
|
+
|
|
|
+ }else{
|
|
|
+ this.setData({
|
|
|
+ 'fetcherData.city':app.globalData.city,
|
|
|
+ })
|
|
|
+ }
|
|
|
+ util.request(api.OrderList, this.data.fetcherData).then( (res)=> {
|
|
|
+ console.log(res)
|
|
|
+ if (res.errno === 0) {
|
|
|
+
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
toCity() {
|
|
|
wx.navigateTo({
|
|
|
url: `/pages/city/city`
|
|
@@ -97,10 +188,12 @@ Router({
|
|
|
|
|
|
onReady: function () {
|
|
|
// 页面渲染完成
|
|
|
+ this.getRoomList()
|
|
|
+ this.getMiddleList()
|
|
|
},
|
|
|
|
|
|
onShow: function (options) {
|
|
|
-
|
|
|
+
|
|
|
console.log(app.globalData.city)
|
|
|
// 页面显示
|
|
|
let city = app.globalData.city
|
|
@@ -108,6 +201,8 @@ Router({
|
|
|
this.setData({
|
|
|
'city': app.globalData.city,
|
|
|
})
|
|
|
+ this.getRoomList()
|
|
|
+ this.getMiddleList()
|
|
|
}
|
|
|
|
|
|
|