Przeglądaj źródła

[专题][修改]:[专题详情的接口修改]

tags/湖南版5.1.4
meo 6 lat temu
rodzic
commit
a1a08e62dc
4 zmienionych plików z 23 dodań i 8 usunięć
  1. +5
    -0
      app.js
  2. +5
    -1
      config/config.js
  3. +2
    -1
      pages/main/index.js
  4. +11
    -6
      pages/topicDetail/index.js

+ 5
- 0
app.js Wyświetl plik

@@ -51,6 +51,11 @@ App({
},
fail: error => {
console.log(error);
wx.showModal({
title:'提示',
content: error.errMsg,
showCancel:false
})
}
});
},


+ 5
- 1
config/config.js Wyświetl plik

@@ -267,7 +267,11 @@ var config = {
/**
* 专题
*/
topicShow:"/topic/show"
topicShow:"/topic/show",
/**
* 专题详情
*/
topicFindById:"/topic/findById"
},
weapp: {
AppId: weappId


+ 2
- 1
pages/main/index.js Wyświetl plik

@@ -509,6 +509,7 @@ Page({
if (res&&res.data){
that.setData({
cover: res.data.cover,
id: res.data.id,
showTopic: true
})
}
@@ -519,7 +520,7 @@ Page({
},
gotoTopic(){
wx.navigateTo({
url: '/pages/topicDetail/index',
url: `/pages/topicDetail/index?id=${this.data.id}`
})
},
/**


+ 11
- 6
pages/topicDetail/index.js Wyświetl plik

@@ -14,16 +14,21 @@ Page({
minute: "",
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;
Http.get({
url: config.api.topicShow,
url: config.api.topicFindById,
data: {
token: app.globalData.token
id: id
}
}).then(res => {
console.log(res)


Ładowanie…
Anuluj
Zapisz