43 lines
875 B
JavaScript
43 lines
875 B
JavaScript
const { httpRequest } = getApp();
|
|
|
|
Page({
|
|
data: {
|
|
historyList: [],
|
|
listFlag: false,
|
|
systemInfo: {}
|
|
},
|
|
onShow() {
|
|
my.showLoading({
|
|
content: '加载中...',
|
|
});
|
|
const paramenter = {
|
|
path: '/history',
|
|
method: 'GET',
|
|
}
|
|
httpRequest(paramenter).then(res => {
|
|
my.hideLoading()
|
|
if (res.status == 1 && Array.isArray(res.data)) {
|
|
this.setData({
|
|
historyList: res.data,
|
|
listFlag: true,
|
|
systemInfo: getApp().globalData.systemInfo
|
|
})
|
|
}
|
|
})
|
|
|
|
},
|
|
toGetVideo(event) {
|
|
const data = event.target.dataset.item;
|
|
const systemInfo = this.data.systemInfo;
|
|
if (systemInfo.platform == 'android') {
|
|
my.navigateTo({
|
|
url: `/pages/videoAndroid/videoAndroid?sid=${data.sid}&id=${data.chapterid || ""}`,
|
|
});
|
|
} else {
|
|
my.navigateTo({
|
|
url: `/pages/video/video?sid=${data.sid}&id=${data.chapterid || ""}`,
|
|
});
|
|
}
|
|
|
|
}
|
|
}) |