You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
147 lines
3.4 KiB
147 lines
3.4 KiB
3 years ago
|
// pages/club/club.js
|
||
|
var Api = require('../../../utils/common.js');
|
||
|
var re = require('../../../utils/request.js');
|
||
|
Page({
|
||
|
|
||
|
/**
|
||
|
* 页面的初始数据
|
||
|
*/
|
||
|
data: {
|
||
|
outList:[
|
||
|
{img:'../../../images/logo.jpg',name:'众行天下户外',mark:['徒步','登山','露营'],message:'我是个热爱旅游的小可爱,希望能寻找志同道合的人',people:'102'}
|
||
|
,{img:'../../../images/logo.jpg',name:'众行天下户外',mark:['徒步','登山','露营'],message:'我是个热爱旅游的小可爱,希望能寻找志同道合的人',people:'102'}
|
||
|
,{img:'../../../images/logo.jpg',name:'众行天下户外',mark:['徒步','登山','露营'],message:'我是个热爱旅游的小可爱,希望能寻找志同道合的人',people:'102'}
|
||
|
],
|
||
|
secondList:[]
|
||
|
},
|
||
|
/**
|
||
|
* 生命周期函数--监听页面加载
|
||
|
*/
|
||
|
onLoad: function (options) {
|
||
|
console.log(options);
|
||
|
//跳转后需要只显示对应的内容
|
||
|
if(options.id!=''){
|
||
|
let data={
|
||
|
currentTarget:{
|
||
|
id:options.id
|
||
|
}
|
||
|
}
|
||
|
console.log(data);
|
||
|
this.TooldDetail(data)
|
||
|
// e.currentTarget.id
|
||
|
}else{
|
||
|
this.TooldDetail()
|
||
|
}
|
||
|
},
|
||
|
clubdetail:function(e){
|
||
|
var id = e.currentTarget.id
|
||
|
wx.navigateTo({
|
||
|
url: '../clubDetail/clubDetail?id='+id+''
|
||
|
})
|
||
|
},
|
||
|
getclubCircle:function(){
|
||
|
var that = this;
|
||
|
const imgUrl = wx.getStorageSync('imgUrl')
|
||
|
var header = {
|
||
|
token:wx.getStorageSync('token'),
|
||
|
"Content-Type": "application/x-www-form-urlencoded"
|
||
|
};
|
||
|
re.request(Api.getclubCircle(), '', header).then((res) => {
|
||
|
let datas = res.data.data;
|
||
|
for(let i=0;i<datas.length;i++){
|
||
|
if(datas[i].typeImg){
|
||
|
datas[i].typeImg = imgUrl + datas[i].typeImg
|
||
|
}
|
||
|
}
|
||
|
that.setData({
|
||
|
secondList:datas
|
||
|
})
|
||
|
})
|
||
|
},
|
||
|
TooldDetail:function(e){
|
||
|
let clubCircle = '';
|
||
|
if(e){
|
||
|
clubCircle = e.currentTarget.id
|
||
|
// console.log(e);
|
||
|
}else{
|
||
|
clubCircle = ''
|
||
|
}
|
||
|
|
||
|
var that = this;
|
||
|
const imgUrl = wx.getStorageSync('imgUrl')
|
||
|
var header = {
|
||
|
token:wx.getStorageSync('token'),
|
||
|
"Content-Type": "application/x-www-form-urlencoded"
|
||
|
};
|
||
|
var postData = {
|
||
|
clubCircle:clubCircle
|
||
|
};
|
||
|
re.request(Api.getmoreClubList(), 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<datas[key].length;i++){
|
||
|
datas[key][i].clubLogo = imgUrl + datas[key][i].clubLogo;
|
||
|
}
|
||
|
}
|
||
|
for(let a=0;a<datas[key].length;a++){
|
||
|
lists.push(datas[key][a])
|
||
|
}
|
||
|
}
|
||
|
that.setData({
|
||
|
outList:lists
|
||
|
})
|
||
|
})
|
||
|
},
|
||
|
|
||
|
/**
|
||
|
* 生命周期函数--监听页面初次渲染完成
|
||
|
*/
|
||
|
onReady: function () {
|
||
|
|
||
|
},
|
||
|
|
||
|
/**
|
||
|
* 生命周期函数--监听页面显示
|
||
|
*/
|
||
|
onShow: function () {
|
||
|
this.getclubCircle();
|
||
|
// this.TooldDetail();
|
||
|
},
|
||
|
|
||
|
/**
|
||
|
* 生命周期函数--监听页面隐藏
|
||
|
*/
|
||
|
onHide: function () {
|
||
|
|
||
|
},
|
||
|
|
||
|
/**
|
||
|
* 生命周期函数--监听页面卸载
|
||
|
*/
|
||
|
onUnload: function () {
|
||
|
|
||
|
},
|
||
|
|
||
|
/**
|
||
|
* 页面相关事件处理函数--监听用户下拉动作
|
||
|
*/
|
||
|
onPullDownRefresh: function () {
|
||
|
|
||
|
},
|
||
|
|
||
|
/**
|
||
|
* 页面上拉触底事件的处理函数
|
||
|
*/
|
||
|
onReachBottom: function () {
|
||
|
|
||
|
},
|
||
|
|
||
|
/**
|
||
|
* 用户点击右上角分享
|
||
|
*/
|
||
|
onShareAppMessage: function () {
|
||
|
|
||
|
}
|
||
|
})
|