// pages/index/index.js import { getApi, postApi } from "../../apis/api" import cloudApi from "../../apis/cloudApi" const app = getApp() Page({ data: { indexInfo: {}, }, async getIndexInfo() { let res = await postApi('/index', { loginAccountId: wx.getStorageSync('loginAccountId'), }) if (res.data.status == 0) { this.setData({ indexInfo: res.data.result }) } else if (res.data.status == 1) { wx.showToast({ title: '暂无数据', icon: "error" }) } else if (res.data.status == 2) { wx.showToast({ title: '尚未登录', icon: "error" }) } }, forbidTouchMove() { }, onLoad() { this.getIndexInfo() }, onShow() { let data = [{ letter: 'A', data: [{ name: 'azh', phone: 13303849723 }, { name: 'azz', phone: 13303849723 }, ] }, { letter: 'B', data: [{ name: 'bzh', phone: 13303849723 }, { name: 'bzz', phone: 13303849723 }, ] } ] }, goTo(e) { let { url, maintab } = e.currentTarget.dataset app.globalData.maintab = maintab if (maintab) { wx.switchTab({ url }) } else { wx.navigateTo({ url }) } }, })