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.

47 lines
1.2 KiB

3 years ago
const app = getApp();
Page({
data: {
imageUrl: getApp().globalData.imageUrl,
3 years ago
id: "",
source: "",
user_author: "",
sourcetime: "",
title: "",
content: ""
3 years ago
},
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({
3 years ago
action: 'getDataById',
sId: this.data.id,
sType: 'ZhuTiFenXiBl',
3 years ago
token: wx.getStorageSync('token') || 't%2BrswgjvzGM='
}).then(res => {
3 years ago
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
})
}
3 years ago
})
}
})