V0.0.9 更新
修正IOS登录错误
This commit is contained in:
1 parent
15c82bdb46
commit
a3c886146a
13 files changed
+105
-69
No files matched your search
@@ -24,44 +24,33 @@ Page({
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad(options) {
|
||||
//只有当登录才有效
|
||||
if (wx.getStorageSync('UserInfoCache').IsLogin) {
|
||||
//获取接收到的视频序号
|
||||
var receivedIndex = options.number ?? null;
|
||||
if (receivedIndex){
|
||||
//获取接收到的视频序号
|
||||
var receivedIndex = options.number ?? null;
|
||||
if (receivedIndex){
|
||||
|
||||
MyApi.ApiGetFreeCourseData(receivedIndex)
|
||||
.then(result => {
|
||||
this.setData({
|
||||
VideoTitle:result.PlayData[0].课程名称,
|
||||
playdata:result.PlayData,
|
||||
VideoImageURL:this.data.BaseURL+"/Course/"+result.课程id+".png",
|
||||
coursedata:result,
|
||||
});
|
||||
})
|
||||
.catch(err => {
|
||||
this.setData({
|
||||
playdata:[],
|
||||
});
|
||||
console.error("请求失败:"+err);
|
||||
MyApi.ApiGetFreeCourseData(receivedIndex)
|
||||
.then(result => {
|
||||
this.setData({
|
||||
VideoTitle:result.PlayData[0].课程名称,
|
||||
playdata:result.PlayData,
|
||||
VideoImageURL:this.data.BaseURL+"/Course/"+result.课程id+".png",
|
||||
coursedata:result,
|
||||
});
|
||||
} else {
|
||||
wx.switchTab({
|
||||
url: '/pages/index/index',
|
||||
})
|
||||
}
|
||||
|
||||
})
|
||||
.catch(err => {
|
||||
this.setData({
|
||||
playdata:[],
|
||||
});
|
||||
console.error("请求失败:"+err);
|
||||
});
|
||||
} else {
|
||||
setTimeout(function() {
|
||||
wx.switchTab({
|
||||
url: '/pages/index/index',
|
||||
})
|
||||
},50);
|
||||
}
|
||||
wx.switchTab({
|
||||
url: '/pages/index/index',
|
||||
})
|
||||
}
|
||||
},
|
||||
OnTapVideoList(e){
|
||||
//只有当登录才有效
|
||||
if (wx.getStorageSync('UserInfoCache').IsLogin) {
|
||||
|
||||
// 获取当前点击的索引
|
||||
|
||||
const courseindex = e.currentTarget.dataset.courseindex;
|
||||
@@ -72,13 +61,7 @@ Page({
|
||||
HiddenVideoControl:false,
|
||||
top:420,
|
||||
});
|
||||
} else {
|
||||
setTimeout(function() {
|
||||
wx.switchTab({
|
||||
url: '/pages/index/index',
|
||||
})
|
||||
},50);
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -92,13 +75,7 @@ Page({
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow() {
|
||||
if (!wx.getStorageSync('UserInfoCache').IsLogin) {
|
||||
setTimeout(function() {
|
||||
wx.switchTab({
|
||||
url: '/pages/index/index',
|
||||
})
|
||||
},50);
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user