|
@@ -251,6 +251,7 @@
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
|
|
+ import { mapGetters } from 'vuex';
|
|
|
import ques from "./components/ques.vue"
|
|
import ques from "./components/ques.vue"
|
|
|
import descInfo from "./components/descInfo.vue"
|
|
import descInfo from "./components/descInfo.vue"
|
|
|
import descInfoNav from "./components/descInfoNav.vue"
|
|
import descInfoNav from "./components/descInfoNav.vue"
|
|
@@ -411,17 +412,30 @@
|
|
|
projectCode:''
|
|
projectCode:''
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
|
|
+ computed:{
|
|
|
|
|
+ ...mapGetters(['coureLogin']),
|
|
|
|
|
+ },
|
|
|
|
|
+ watch: {
|
|
|
|
|
+ coureLogin: {
|
|
|
|
|
+ immediate: true, // 页面一进入就检查一次
|
|
|
|
|
+ handler(val) {
|
|
|
|
|
+ if (val == 2&&this.isLogin) {
|
|
|
|
|
+ console.log("看课AppToken失效,请重新登录")
|
|
|
|
|
+ this.isLogin = false
|
|
|
|
|
+ this.isAddKf = 0
|
|
|
|
|
+ this.goLogin()
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
onLoad(option) {
|
|
onLoad(option) {
|
|
|
- console.log("onLoad===",'')
|
|
|
|
|
|
|
+ console.log("onLoad===")
|
|
|
this.urlOption = option.course ? JSON.parse(option.course) : {}
|
|
this.urlOption = option.course ? JSON.parse(option.course) : {}
|
|
|
this.videoId = this.urlOption.videoId || ''
|
|
this.videoId = this.urlOption.videoId || ''
|
|
|
this.qwUserId = this.urlOption.qwUserId || ''
|
|
this.qwUserId = this.urlOption.qwUserId || ''
|
|
|
this.corpId = this.urlOption.corpId || ''
|
|
this.corpId = this.urlOption.corpId || ''
|
|
|
this.linkType = this.urlOption.linkType || 0
|
|
this.linkType = this.urlOption.linkType || 0
|
|
|
this.projectCode = this.urlOption.projectCode || ''
|
|
this.projectCode = this.urlOption.projectCode || ''
|
|
|
- // if (this.code) {
|
|
|
|
|
- // this.loginByMp()
|
|
|
|
|
- // }
|
|
|
|
|
this.sortLink = this.urlOption.link || ''
|
|
this.sortLink = this.urlOption.link || ''
|
|
|
|
|
|
|
|
uni.$on('usercode',(data)=>{
|
|
uni.$on('usercode',(data)=>{
|
|
@@ -436,16 +450,15 @@
|
|
|
// #endif
|
|
// #endif
|
|
|
},
|
|
},
|
|
|
onShow() {
|
|
onShow() {
|
|
|
|
|
+ console.log("==onShow===")
|
|
|
this.baseUrl=uni.getStorageSync('requestImagesPath')
|
|
this.baseUrl=uni.getStorageSync('requestImagesPath')
|
|
|
this.tipsOpen = false
|
|
this.tipsOpen = false
|
|
|
- // this.isLogin = this.utils.isLoginCourseAuto()
|
|
|
|
|
this.uuId = this.utils.generateRandomString(16)
|
|
this.uuId = this.utils.generateRandomString(16)
|
|
|
if(uni.getStorageSync('auto_userInfo') && JSON.stringify(uni.getStorageSync('auto_userInfo'))!='{}') {
|
|
if(uni.getStorageSync('auto_userInfo') && JSON.stringify(uni.getStorageSync('auto_userInfo'))!='{}') {
|
|
|
this.user = JSON.parse(uni.getStorageSync('auto_userInfo'))
|
|
this.user = JSON.parse(uni.getStorageSync('auto_userInfo'))
|
|
|
} else {
|
|
} else {
|
|
|
this.user = {}
|
|
this.user = {}
|
|
|
}
|
|
}
|
|
|
- console.log("https://wxaurl.cn/skRIquxVTtu==========")
|
|
|
|
|
if(!this.sortLink||!this.projectCode){
|
|
if(!this.sortLink||!this.projectCode){
|
|
|
uni.showToast({
|
|
uni.showToast({
|
|
|
title: '链接有误',
|
|
title: '链接有误',
|
|
@@ -1084,6 +1097,9 @@
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
goLogin(data) {
|
|
goLogin(data) {
|
|
|
|
|
+ if (this.player) {
|
|
|
|
|
+ this.player.pause()
|
|
|
|
|
+ }
|
|
|
if(!this.sortLink||!this.projectCode){
|
|
if(!this.sortLink||!this.projectCode){
|
|
|
uni.showToast({
|
|
uni.showToast({
|
|
|
title: '链接有误',
|
|
title: '链接有误',
|
|
@@ -1112,6 +1128,7 @@
|
|
|
loginByMp({code: loginRes.code,encryptedData:infoRes.encryptedData,iv:infoRes.iv,appId:getApp().globalData.appId}).then(res=>{
|
|
loginByMp({code: loginRes.code,encryptedData:infoRes.encryptedData,iv:infoRes.iv,appId:getApp().globalData.appId}).then(res=>{
|
|
|
uni.hideLoading();
|
|
uni.hideLoading();
|
|
|
if (res.code == 200) {
|
|
if (res.code == 200) {
|
|
|
|
|
+ this.$store.commit('setCoureLogin', 1);
|
|
|
uni.setStorageSync(this.utils.TOKEN_KEYAuto, res.token);
|
|
uni.setStorageSync(this.utils.TOKEN_KEYAuto, res.token);
|
|
|
uni.setStorageSync('auto_userInfo', JSON.stringify(res.user));
|
|
uni.setStorageSync('auto_userInfo', JSON.stringify(res.user));
|
|
|
this.user = res.user
|
|
this.user = res.user
|
|
@@ -1223,7 +1240,6 @@
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
getScrollTop(res) {
|
|
getScrollTop(res) {
|
|
|
- console.log(res)
|
|
|
|
|
if(this.currentTab == 2) {
|
|
if(this.currentTab == 2) {
|
|
|
this.scrollTop = res
|
|
this.scrollTop = res
|
|
|
} else {
|
|
} else {
|
|
@@ -1307,20 +1323,13 @@
|
|
|
// H5授权绑定关系
|
|
// H5授权绑定关系
|
|
|
async loginFsUserWx(data){
|
|
async loginFsUserWx(data){
|
|
|
if(data){
|
|
if(data){
|
|
|
- console.log('huoqu1222',data)
|
|
|
|
|
- // console.log("loginFsUserWx:",res)
|
|
|
|
|
- // this.userinfos=uni.getStorageSync('userinfos')
|
|
|
|
|
let token = uni.getStorageSync('TOKEN_WEXIN');
|
|
let token = uni.getStorageSync('TOKEN_WEXIN');
|
|
|
let user = uni.getStorageSync('userInfo')
|
|
let user = uni.getStorageSync('userInfo')
|
|
|
- // this.userInfo=uni.getStorageSync('userInfo');
|
|
|
|
|
- // this.isLogin = true
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
uni.setStorageSync(this.utils.TOKEN_KEYAuto, token);
|
|
uni.setStorageSync(this.utils.TOKEN_KEYAuto, token);
|
|
|
uni.setStorageSync('auto_userInfo', JSON.stringify(user));
|
|
uni.setStorageSync('auto_userInfo', JSON.stringify(user));
|
|
|
this.user = user
|
|
this.user = user
|
|
|
this.isLogin = true
|
|
this.isLogin = true
|
|
|
- this.getIsAddKf()
|
|
|
|
|
}else{
|
|
}else{
|
|
|
uni.setStorageSync('H5course',{
|
|
uni.setStorageSync('H5course',{
|
|
|
companyId: this.urlOption.companyId,
|
|
companyId: this.urlOption.companyId,
|