[新增]企业主页,企业活动
This commit is contained in:
@@ -1,66 +1,81 @@
|
||||
// pages/home/index.js
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad: function (options) {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
onReady: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面隐藏
|
||||
*/
|
||||
onHide: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面卸载
|
||||
*/
|
||||
onUnload: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
onPullDownRefresh: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面上拉触底事件的处理函数
|
||||
*/
|
||||
onReachBottom: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 用户点击右上角分享
|
||||
*/
|
||||
onShareAppMessage: function () {
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
selectMenuId: 0, //默认是企业信息0 视频1 活动2 项目筹集3
|
||||
company_id: wx.getStorageSync('company_id'), //企业Id,
|
||||
info: '', //企业信息
|
||||
},
|
||||
onLoad(e) {
|
||||
console.log(e)
|
||||
if(e.id){
|
||||
this.company(e.id)
|
||||
wx.setStorageSync('company_id', e.id)
|
||||
}else{
|
||||
this.company(this.company_id)
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
},
|
||||
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
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 拨打电话
|
||||
*/
|
||||
call() {
|
||||
wx.makePhoneCall({
|
||||
phoneNumber: this.data.info.certification.phone,
|
||||
})
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user