diff --git a/components/company/projectRaise/projectRaise.js b/components/company/projectRaise/projectRaise.js index 89fdc96..81e623e 100644 --- a/components/company/projectRaise/projectRaise.js +++ b/components/company/projectRaise/projectRaise.js @@ -52,7 +52,7 @@ Component({ * 请求项目筹集分类接口 */ crowdfundcategory(company_id){ - wx.$api.companyModule.crowdfundcategory(company_id).then(res=>{ + wx.$api.companyModule.crowdfundcategory(wx.getStorageSync('company_id')).then(res=>{ console.log(res) this.setData({ categoryList:res, @@ -67,7 +67,7 @@ Component({ */ crowdfunds(){ if(this.data.has_more){ - wx.$api.companyModule.crowdfunds(this.data.company_id,this.data.category_id,this.data.page).then(res=>{ + wx.$api.companyModule.crowdfunds(wx.getStorageSync('company_id'),this.data.category_id,this.data.page).then(res=>{ console.log(res) if(res.page.has_more){ this.setData({ diff --git a/pages/home/index.js b/pages/home/index.js index 656ce8c..691ca70 100644 --- a/pages/home/index.js +++ b/pages/home/index.js @@ -11,15 +11,7 @@ Page({ }, onLoad(e) { var that = this - wx.getStorage({ - key: 'company_id', - success(res) { - that.company(e.companyId) - that.setData({ - company_id:res.data - }) - } - }) + that.company() }, onUnload: function () { wx.removeStorageSync('company_id') @@ -68,7 +60,7 @@ Page({ title: 'title', mask: 'true' }) - wx.$api.companyModule.company(id, this.data.page).then(res => { + wx.$api.companyModule.company(wx.getStorageSync('company_id'), this.data.page).then(res => { this.setData({ info: res, loaded: true,