You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
const app = getApp();
|
|
|
|
Page({
|
|
|
|
data: {
|
|
|
|
imageUrl: getApp().globalData.imageUrl,
|
|
|
|
id: "",
|
|
|
|
source: "",
|
|
|
|
user_author: "",
|
|
|
|
sourcetime: "",
|
|
|
|
title: "",
|
|
|
|
content: ""
|
|
|
|
},
|
|
|
|
onLoad() {
|
|
|
|
wx.setNavigationBarTitle({
|
|
|
|
title: '详情'
|
|
|
|
})
|
|
|
|
let pages = getCurrentPages();
|
|
|
|
let currentPage = pages[pages.length-1]
|
|
|
|
let options = currentPage.options
|
|
|
|
this.setData({
|
|
|
|
id: options.id
|
|
|
|
})
|
|
|
|
},
|
|
|
|
onShow() {
|
|
|
|
this.getData()
|
|
|
|
},
|
|
|
|
getData() {
|
|
|
|
app.globalData.request({
|
|
|
|
action: 'getDataById',
|
|
|
|
sId: this.data.id,
|
|
|
|
sType: 'ZhuTiFenXiBl',
|
|
|
|
token: wx.getStorageSync('token') || 't%2BrswgjvzGM='
|
|
|
|
}).then(res => {
|
|
|
|
let arr = res || [];
|
|
|
|
if(arr.length > 0) {
|
|
|
|
let data = arr[0];
|
|
|
|
console.log(data)
|
|
|
|
this.setData({
|
|
|
|
source: data._source.source,
|
|
|
|
user_author: data._source.user_author,
|
|
|
|
sourcetime: data._source.sourcetime,
|
|
|
|
title: data._source.title,
|
|
|
|
content: data._source.content
|
|
|
|
})
|
|
|
|
}
|
|
|
|
})
|
|
|
|
}
|
|
|
|
})
|