86 lines
2.0 KiB
JavaScript
86 lines
2.0 KiB
JavaScript
Page({
|
|
|
|
/**
|
|
* 页面的初始数据
|
|
*/
|
|
data: {
|
|
selectMenuId: 0, //默认是企业信息0 视频1 活动2 项目筹集3
|
|
company_id: wx.getStorageSync('company_id'), //企业Id,
|
|
info: '', //企业信息
|
|
loaded:false
|
|
},
|
|
onLoad(e) {
|
|
},
|
|
onShow() {
|
|
this.company(wx.getStorageSync('company_id'))
|
|
},
|
|
onUnload: function () {
|
|
wx.removeStorageSync('company_id')
|
|
},
|
|
/**
|
|
* 点击按钮触发事件
|
|
*/
|
|
menuSelect: function (e) {
|
|
console.log(e.currentTarget.dataset.id);
|
|
if (this.data.selectMenuId != e.currentTarget.dataset.id) {
|
|
this.setData({
|
|
selectMenuId: e.currentTarget.dataset.id
|
|
})
|
|
if (e.currentTarget.dataset.id == 3) {
|
|
this.selectComponent('#categoryTypeList').crowdfundcategory(this.data.company_id);
|
|
} else if (e.currentTarget.dataset.id == 2) {
|
|
this.selectComponent('#activeList').actives();
|
|
} else if (e.currentTarget.dataset.id == 4) {
|
|
this.selectComponent('#noticeList').actives();
|
|
}
|
|
}
|
|
},
|
|
/**
|
|
* 上拉触底事件
|
|
*/
|
|
onReachBottom() {
|
|
if (this.data.selectMenuId == 3) {
|
|
console.log('项目筹集触底')
|
|
this.selectComponent('#categoryTypeList').crowdfunds();
|
|
}
|
|
if (this.data.selectMenuId == 2) {
|
|
console.log('活动触底')
|
|
this.selectComponent('#activeList').actives();
|
|
}
|
|
if (this.data.selectMenuId == 4) {
|
|
console.log('动态触底')
|
|
this.selectComponent('#noticeList').actives();
|
|
}
|
|
},
|
|
|
|
/**
|
|
* 请求项目筹集分类接口
|
|
*/
|
|
company() {
|
|
wx.$api.companyModule.company(this.data.company_id, this.data.page).then(res => {
|
|
console.log(res)
|
|
this.setData({
|
|
info: res,
|
|
loaded:true,
|
|
})
|
|
})
|
|
},
|
|
|
|
/**
|
|
* 拨打电话
|
|
*/
|
|
call() {
|
|
wx.makePhoneCall({
|
|
phoneNumber: this.data.info.certification.phone,
|
|
})
|
|
},
|
|
/**
|
|
* 进入商城
|
|
*/
|
|
goMall(e){
|
|
console.log('1111')
|
|
wx.navigateTo({
|
|
url: '/pages/mall/index',
|
|
})
|
|
}
|
|
}) |