1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- const app = getApp()
- var http = require("../../utils/config.js");
- Page({
- data: {
- setting: '',
- areaList: [],
- index: 0,
- },
- getAreas: function () {
- wx.showLoading({
- title: '加载中...',
- })
- app.request('/areas', '', 'get').then(res => {
- console.log(res)
- let areaId = wx.getStorageSync('home').id
- let list = res.data
- let index = 0
- list.map((item, index) => {
- if (item.id == areaId) {
- index = index
- }
- })
- if (res.statusCode == 200) {
- this.setData({
- areaList: res.data,
- setting: list[index].setting,
- index
- })
- }
- wx.hideLoading()
- })
- },
- // 点击筛选区域
- bindPickerChange(e) {
- console.log(e, 'pppppp')
- let index=e.detail.value
- index=Number(index)
- this.setData({
- index,
- setting:this.data.areaList[index].setting
- })
- },
- onLoad: function (options) {
- },
- onReady: function () {
- },
- onShow: function () {
- this.getAreas()
- },
- onHide: function () {
- },
- onUnload: function () {
- },
- onPullDownRefresh: function () {
- },
- onReachBottom: function () {
- },
- onShareAppMessage: function () {
- }
- })
|