ソースを参照

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

tags/湖南版5.1.4
meo 6年前
コミット
a1a08e62dc
4個のファイルの変更23行の追加8行の削除
  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 ファイルの表示

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


+ 5
- 1
config/config.js ファイルの表示

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


+ 2
- 1
pages/main/index.js ファイルの表示

@@ -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}`
}) })
}, },
/** /**


+ 11
- 6
pages/topicDetail/index.js ファイルの表示

@@ -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)


読み込み中…
キャンセル
保存