123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- //index.js
- //获取应用实例
- const app = getApp()
- import fetch from '../../../utils/http'
- const $api = require('../../../config/api.js').$api;
- import ArticleList from './article.js'
-
- Page({
- onShow() {
- wx.setNavigationBarTitle({
- title: '购房百科'
- })
- },
- onLoad() {
- this.ReturnList()
- },
- data: {
- UserInfo: app.globalData.UserInfo, // 用户信息
- NavList: [{
- value: '准备买房',
- id: '1'
- }, {
- value: '看房选房',
- id: '2'
- }, {
- value: '订房签约',
- id: '3'
- }, {
- value: '收房验房',
- id: '4'
- }],
- ActiveIndex: 0,
- List: []
- },
- CutNav(e) {
- this.setData({
- ActiveIndex: e.target.dataset.index
- })
- this.ReturnList()
- },
- ReturnList() {
- let aArr = []
- ArticleList.ArticleList.map((item) => {
- if (item.Type - 0 === this.data.NavList[this.data.ActiveIndex].id - 0) {
- aArr = item.List
- }
- })
- this.setData({
- List: aArr
- })
- },
- TapItem(e) {
- wx.navigateTo({
- url: '/pages/SelfServiceTool/Cyclopedia/Detail?id=' + e.target.dataset.id + '&type=' + e.target.dataset.type,
- })
- },
- /**
- * 用户点击右上角分享
- */
- onShareAppMessage: function () {
- return app.globalData.ShareDate
- }
- })
|