123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121 |
- const util = require('../../utils/util.js');
- const api = require('../../config/api.js');
- const user = require('../../services/user.js');
- import header from './data'
- import {
- Router
- } from '../../utils/router.js'
- const app = getApp()
- //获取应用实例
- Router({
- data: {
- // 头部导航栏的高度
- statusBarHeight: app.globalData.statusBarHeight,
- classifyList: [{
- id: 1,
- title: '新房',
- icon: "../../static/images/icon/house@2x.png",
- },
- {
- id: 2,
- title: '二手房',
- icon: "../../static/images/icon/second_hand@2x.png",
- },
- {
- id: 3,
- title: '公寓',
- icon: "../../static/images/icon/apartments@2x.png",
- },
- {
- id: 4,
- title: '民宿',
- icon: "../../static/images/icon/b&b@2x.png",
- },
- {
- id: 5,
- title: '社区',
- icon: "../../static/images/icon/community@2x.png",
- },
- ],
- middleTabList: [{
- id: 1,
- title: '新上房源'
- },
- {
- id: 2,
- title: '热门房源'
- },
- {
- id: 3,
- title: '热门企业'
- },
- ],
- middleType: 1,
- city: app.globalData.city,
- fetcherData: {
- city:'',
- page_num: 1,
- page_size:20
- }
- },
- onShareAppMessage: function () {
- return {
- path: '/pages/index/index'
- }
- },
- onPullDownRefresh() {
- // this.setData({
- // brandList: this.data.brandList.slice(0, 10),
- // currentPage: 1
- // });
- // this.getBrandList(1, false, true);
- app.onPullDownRefresh()
- },
- inputFocus: function () {},
- toCity() {
- wx.navigateTo({
- url: `/pages/city/city`
- })
- },
- toSearch(e) {
- var id = e.currentTarget.dataset.id
- wx.navigateTo({
- url: `/pages/searchRoom/searchRoom?id=` + id
- })
- },
- onLoad: async function (options) {
- },
- onReady: function () {
- // 页面渲染完成
- },
- onShow: function (options) {
- console.log(app.globalData.city)
- // 页面显示
- let city = app.globalData.city
- if (city != this.data.city) {
- this.setData({
- 'city': app.globalData.city,
- })
- }
- },
- onHide: function () {
- // 页面隐藏
- },
- onUnload: function () {
- // 页面关闭
- }
- })
|