import {whetherFollowGzh} from "../../api/home" Page({ data: { iconSize: [20, 30, 40, 50, 60, 70], iconColor: [ 'red', 'orange', 'yellow', 'green', 'rgb(0,255,255)', 'blue', 'purple' ], iconType: [ 'success', 'success_no_circle', 'info', 'warn', 'waiting', 'cancel', 'download', 'search', 'clear' ], showOfficial:true }, /** * 生命周期函数--监听页面加载 */ onLoad: function (options) { var app = getApp(); whetherFollowGzh({ unionId:app.globalData.unionId, stationId:app.globalData.stationId, }).then((res)=>{ // res.retCode //-5 无信息 //-4 没关注 // 0 关注了 if(res.retCode === 0 ){ this.setData({ showOfficial:false }) } }) } })