太湖公益
This commit is contained in:
203
App.vue
203
App.vue
@@ -26,9 +26,37 @@ export default {
|
||||
};
|
||||
},
|
||||
onLaunch: function (e) {
|
||||
uni.setStorageSync("isJump", null);
|
||||
// 禁止横屏
|
||||
// #ifdef APP-PLUS
|
||||
plus.screen.lockOrientation("portrait-primary");
|
||||
|
||||
console.log("at line 32到这里获取token:", uni.getStorageSync("token"));
|
||||
if (
|
||||
uni.getStorageSync("guidePages") != 2 ||
|
||||
!uni.getStorageSync("guidePages")
|
||||
) {
|
||||
console.log(11111);
|
||||
plus.navigator.closeSplashscreen();
|
||||
// uni.reLaunch({
|
||||
// url: "/pages/advertisement/index/index",
|
||||
|
||||
// success: function () {},
|
||||
// });
|
||||
// this.protocolShow = true;
|
||||
} else {
|
||||
uni.switchTab({
|
||||
// url: "/pages/advertisement/index/index",
|
||||
url: "/pages/homePage/index/index",
|
||||
success: function () {
|
||||
plus.navigator.closeSplashscreen();
|
||||
let page = getCurrentPages()[0];
|
||||
console.log(page);
|
||||
page.$vm.requestAll();
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
// plus.screen.lockOrientation("portrait-primary");
|
||||
// #endif
|
||||
// 检测自动更新
|
||||
@@ -44,96 +72,93 @@ export default {
|
||||
},
|
||||
});
|
||||
|
||||
// // 取出初始播放信息
|
||||
// uni.getStorage({
|
||||
// key: "playingInfo",
|
||||
// success: function (res) {
|
||||
// console.log(res, "playingInfo本地初始化");
|
||||
// store.commit("setUserInfo", {
|
||||
// playingInfo: res.data,
|
||||
// });
|
||||
// store.commit("setUserInfo", {
|
||||
// playTitle: res.data.chapter,
|
||||
// fengImg: res.data.bookImage,
|
||||
// });
|
||||
// console.log(store.state.userInfo, "初始化");
|
||||
// },
|
||||
// fail: function (e) {
|
||||
// console.log(e, "playingInfo本地初始化失败");
|
||||
// store.commit("setUserInfo", {
|
||||
// playingInfo: {
|
||||
// images: "../../static/icon/fengziIcon.jpg",
|
||||
// chapterName: "暂无播放信息",
|
||||
// },
|
||||
// });
|
||||
// store.commit("setUserInfo", {
|
||||
// playTitle: "暂无播放信息",
|
||||
// fengImg: "../../static/icon/fengziIcon.jpg",
|
||||
// });
|
||||
// },
|
||||
// });
|
||||
// // 取出播放列表
|
||||
// uni.getStorage({
|
||||
// key: "playData",
|
||||
// success: function (res) {
|
||||
// // 本地有播放数据就用本地的
|
||||
// console.log(res.data, "取出的本地数据");
|
||||
// if (res.data.myList.length <= 0) {
|
||||
// store.commit("setUserInfo", {
|
||||
// playVisible: false,
|
||||
// });
|
||||
// } else {
|
||||
// music.setList(res.data.myList, "", store.state.userInfo.playIndex);
|
||||
// // music.setCoverImg(res.data.fengImg)
|
||||
// store.commit("setUserInfo", res.data);
|
||||
// }
|
||||
// store.commit("setUserInfo", {
|
||||
// playFlag: false,
|
||||
// }); // 设置播放按钮状态为暂停
|
||||
// store.commit("setUserInfo", {
|
||||
// currentTime: 0,
|
||||
// });
|
||||
// },
|
||||
// fail: function (e) {
|
||||
// // 如果没有,就查询一下线上的播放记录
|
||||
// console.log("本地无数据");
|
||||
// music.setList([]);
|
||||
// //store.commit('setUserInfo',{'playingInfo': {'bookid':0,'chapterId':0}});
|
||||
// store.commit("setUserInfo", {
|
||||
// playVisible: false,
|
||||
// });
|
||||
// store.commit("setUserInfo", {
|
||||
// myList: [],
|
||||
// fengImg: "../../static/icon/fengziIcon.jpg",
|
||||
// });
|
||||
// store.commit("setUserInfo", {
|
||||
// playFlag: false,
|
||||
// });
|
||||
// store.commit("setUserInfo", {
|
||||
// currentTime: 0,
|
||||
// });
|
||||
// },
|
||||
// });
|
||||
// // end
|
||||
// // 取出播放弹窗显示或者隐藏
|
||||
// uni.getStorage({
|
||||
// key: "playVisible",
|
||||
// success: function (res) {
|
||||
// store.commit("setUserInfo", {
|
||||
// playVisible: res.data,
|
||||
// }); // 设置是否显示按钮
|
||||
// },
|
||||
// fail: function (e) {
|
||||
// // 如果本地没有playVisible数据,默认为false
|
||||
// store.commit("setUserInfo", {
|
||||
// playVisible: false,
|
||||
// });
|
||||
// },
|
||||
// });
|
||||
|
||||
|
||||
|
||||
|
||||
// 取出初始播放信息
|
||||
uni.getStorage({
|
||||
key: "playingInfo",
|
||||
success: function (res) {
|
||||
console.log(res, "playingInfo本地初始化");
|
||||
store.commit("setUserInfo", {
|
||||
playingInfo: res.data,
|
||||
});
|
||||
store.commit("setUserInfo", {
|
||||
playTitle: res.data.chapter,
|
||||
fengImg: res.data.bookImage,
|
||||
});
|
||||
console.log(store.state.userInfo, "初始化");
|
||||
},
|
||||
fail: function (e) {
|
||||
console.log(e, "playingInfo本地初始化失败");
|
||||
store.commit("setUserInfo", {
|
||||
playingInfo: {
|
||||
images: "../../static/icon/fengziIcon.jpg",
|
||||
chapterName: "暂无播放信息",
|
||||
},
|
||||
});
|
||||
store.commit("setUserInfo", {
|
||||
playTitle: "暂无播放信息",
|
||||
fengImg: "../../static/icon/fengziIcon.jpg",
|
||||
});
|
||||
},
|
||||
});
|
||||
// 取出播放列表
|
||||
uni.getStorage({
|
||||
key: "playData",
|
||||
success: function (res) {
|
||||
// 本地有播放数据就用本地的
|
||||
console.log(res.data, "取出的本地数据");
|
||||
if (res.data.myList.length <= 0) {
|
||||
store.commit("setUserInfo", {
|
||||
playVisible: false,
|
||||
});
|
||||
} else {
|
||||
music.setList(res.data.myList, "", store.state.userInfo.playIndex);
|
||||
// music.setCoverImg(res.data.fengImg)
|
||||
store.commit("setUserInfo", res.data);
|
||||
}
|
||||
store.commit("setUserInfo", {
|
||||
playFlag: false,
|
||||
}); // 设置播放按钮状态为暂停
|
||||
store.commit("setUserInfo", {
|
||||
currentTime: 0,
|
||||
});
|
||||
},
|
||||
fail: function (e) {
|
||||
// 如果没有,就查询一下线上的播放记录
|
||||
console.log("本地无数据");
|
||||
music.setList([]);
|
||||
//store.commit('setUserInfo',{'playingInfo': {'bookid':0,'chapterId':0}});
|
||||
store.commit("setUserInfo", {
|
||||
playVisible: false,
|
||||
});
|
||||
store.commit("setUserInfo", {
|
||||
myList: [],
|
||||
fengImg: "../../static/icon/fengziIcon.jpg",
|
||||
});
|
||||
store.commit("setUserInfo", {
|
||||
playFlag: false,
|
||||
});
|
||||
store.commit("setUserInfo", {
|
||||
currentTime: 0,
|
||||
});
|
||||
},
|
||||
});
|
||||
// end
|
||||
// 取出播放弹窗显示或者隐藏
|
||||
uni.getStorage({
|
||||
key: "playVisible",
|
||||
success: function (res) {
|
||||
store.commit("setUserInfo", {
|
||||
playVisible: res.data,
|
||||
}); // 设置是否显示按钮
|
||||
},
|
||||
fail: function (e) {
|
||||
// 如果本地没有playVisible数据,默认为false
|
||||
store.commit("setUserInfo", {
|
||||
playVisible: false,
|
||||
});
|
||||
},
|
||||
});
|
||||
//取出缓存数据
|
||||
store.commit("setCacheData");
|
||||
// #ifdef MP-WEIXIN
|
||||
|
||||
Reference in New Issue
Block a user