| @@ -51,6 +51,11 @@ App({ | |||||
| }, | }, | ||||
| fail: error => { | fail: error => { | ||||
| console.log(error); | console.log(error); | ||||
| wx.showModal({ | |||||
| title:'提示', | |||||
| content: error.errMsg, | |||||
| showCancel:false | |||||
| }) | |||||
| } | } | ||||
| }); | }); | ||||
| }, | }, | ||||
| @@ -267,7 +267,11 @@ var config = { | |||||
| /** | /** | ||||
| * 专题 | * 专题 | ||||
| */ | */ | ||||
| topicShow:"/topic/show" | |||||
| topicShow:"/topic/show", | |||||
| /** | |||||
| * 专题详情 | |||||
| */ | |||||
| topicFindById:"/topic/findById" | |||||
| }, | }, | ||||
| weapp: { | weapp: { | ||||
| AppId: weappId | AppId: weappId | ||||
| @@ -509,6 +509,7 @@ Page({ | |||||
| if (res&&res.data){ | if (res&&res.data){ | ||||
| that.setData({ | that.setData({ | ||||
| cover: res.data.cover, | cover: res.data.cover, | ||||
| id: res.data.id, | |||||
| showTopic: true | showTopic: true | ||||
| }) | }) | ||||
| } | } | ||||
| @@ -519,7 +520,7 @@ Page({ | |||||
| }, | }, | ||||
| gotoTopic(){ | gotoTopic(){ | ||||
| wx.navigateTo({ | wx.navigateTo({ | ||||
| url: '/pages/topicDetail/index', | |||||
| url: `/pages/topicDetail/index?id=${this.data.id}` | |||||
| }) | }) | ||||
| }, | }, | ||||
| /** | /** | ||||
| @@ -14,16 +14,21 @@ Page({ | |||||
| minute: "", | minute: "", | ||||
| nodes: '' | nodes: '' | ||||
| }, | }, | ||||
| onShow() { | |||||
| let that = this; | |||||
| that.topicShow() | |||||
| onLoad(options){ | |||||
| console.log(options) | |||||
| if(options&&options.id){ | |||||
| this.setData({ | |||||
| id:options.id | |||||
| }) | |||||
| this.topicShow(options.id) | |||||
| } | |||||
| }, | }, | ||||
| topicShow(){ | |||||
| topicShow(id){ | |||||
| let that = this; | let that = this; | ||||
| Http.get({ | Http.get({ | ||||
| url: config.api.topicShow, | |||||
| url: config.api.topicFindById, | |||||
| data: { | data: { | ||||
| token: app.globalData.token | |||||
| id: id | |||||
| } | } | ||||
| }).then(res => { | }).then(res => { | ||||
| console.log(res) | console.log(res) | ||||