var Api = require('../../utils/common.js'); var re = require('../../utils/request.js'); Page({ /** * 页面的初始数据 */ data: { scrolls:[], navTab: ['我的加入','我的管理'], currentTab: 0, myjoinList:[ {img:'../../images/logo.jpg',name:'众行天下户外',activing:'21',allact:'30'} ,{img:'../../images/logo.jpg',name:'众行天下户外',activing:'21',allact:'30'} ,{img:'../../images/logo.jpg',name:'众行天下户外',activing:'21',allact:'30'} ], create:true }, toSearch:function(){ wx.navigateTo({ url: '../index/search/search' }) }, currentTab: function (e) { var that = this; if (that.data.currentTab == e.currentTarget.dataset.idx){ return; } that.setData({ currentTab: e.currentTarget.dataset.idx, }) console.log(e.currentTarget.dataset.idx) if(e.currentTarget.dataset.idx=='1'){ that.setData({ create:false }) that.getMyManageClubList(); }else{ that.setData({ create:true }); that.getMyJoinClubList(); } }, toaddmark:function(){ // wx.navigateTo({ // url: './mark/mark' // }) }, creatClub:function(){ // 判断是否可以创建俱乐部 var header = { token:wx.getStorageSync('token'), "Content-Type": "application/x-www-form-urlencoded" }; var postData={ }; re.request(Api.checkUserClubRole(), postData, header).then((res) => { let msg = res.data.msg; if(msg != 'OK'){ wx.showToast({ title: msg, icon: 'none', duration: 3000 }) }else{ wx.navigateTo({ url: './createClub/createClub' }) } }) }, clubdetail:function(e){ var id = e.currentTarget.id; // console.log(e); if(+e.currentTarget.dataset['status'] != 1){ wx.showToast({ title: '该俱乐部审核未通过', icon: 'none' }); return; } wx.navigateTo({ url: './clubDetail/clubDetail?id='+id }) }, toclub:function(){ wx.navigateTo({ url: './clublist/clublist?id=' }) }, /** * 生命周期函数--监听页面加载 */ onLoad: function (options) { }, getClubList:function(){ var that = this; const imgUrl = wx.getStorageSync('imgUrl') var header = { token:wx.getStorageSync('token'), "Content-Type": "application/x-www-form-urlencoded" }; var postData={ pageSize:3, pageNum:1 }; re.request(Api.getclubList(), postData, header).then((res) => { let datas = res.data.data; let lists=[]; for(let key in datas){ if(datas[key].length){ for(var i=0;i { let datas = res.data.data; console.log(datas) for(var i=0;i { let datas = res.data.data; // for(var i=0;i