|
@@ -1,9 +1,9 @@
|
|
|
<template>
|
|
|
<view class="content " >
|
|
|
- <view class="header-nav" :style="{height: `calc(88rpx + ${statusBarHeight}px)`,paddingTop: statusBarHeight + 'px'}">
|
|
|
+ <!-- <view class="header-nav" :style="{height: `calc(88rpx + ${statusBarHeight}px)`,paddingTop: statusBarHeight + 'px'}">
|
|
|
<u-icon name="arrow-left" size="28" @click="tosales" v-if="appToken"></u-icon>
|
|
|
<view class="header-title" :style="{width:menuButtonLeft + 'px',height:menuButtonH+'px',lineHeight:menuButtonH+'px'}">{{courseInfo.title}}</view>
|
|
|
- </view>
|
|
|
+ </view> -->
|
|
|
<view class="video-box">
|
|
|
<image v-if="!isLogin || isAddKf!=1" class="video-poster" :src="courseInfo.imgUrl" mode="aspectFill">
|
|
|
</image>
|
|
@@ -246,7 +246,7 @@
|
|
|
<view class="submitname" @click="confimrname" :class="nameuser&&avataruser?'subact':'sub'">确定</view>
|
|
|
</view>
|
|
|
</u-popup>
|
|
|
- <view class="footer-tips">重庆云联融智提供技术支持</view>
|
|
|
+ <!-- <view class="footer-tips">重庆云联融智提供技术支持{{AppTokenAPP}}</view> -->
|
|
|
<!-- footer -->
|
|
|
<view class="footer" v-if="videoId">
|
|
|
<view class="btns" >
|
|
@@ -268,8 +268,8 @@
|
|
|
@click="submit">{{isLogin&&isAddKf==1 ?'提交答案领取奖励' : '立即学习'}}</button>
|
|
|
</view>
|
|
|
</view>
|
|
|
- <u-loading-page :loading="viewload" iconSize="32" loadingColor="#3c9cff" fontSize="24"
|
|
|
- :loading-text="loadingtext"></u-loading-page>
|
|
|
+ <!-- <u-loading-page :loading="viewload" iconSize="32" loadingColor="#3c9cff" fontSize="24"
|
|
|
+ :loading-text="loadingtext"></u-loading-page> -->
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
@@ -415,8 +415,10 @@
|
|
|
avatar:""
|
|
|
},
|
|
|
headImg:'',
|
|
|
- authType:0,//0微信登录 1手机号登录
|
|
|
+ authType:1,//0微信登录 1手机号登录
|
|
|
userdisabled:false,
|
|
|
+ AppTokenAPP:null,
|
|
|
+ projectId:null
|
|
|
}
|
|
|
},
|
|
|
filters: {
|
|
@@ -476,7 +478,10 @@
|
|
|
|
|
|
// },
|
|
|
onLoad(option) {
|
|
|
+ console.log(option)
|
|
|
this.videoContext = uni.createVideoContext('video-content-box', this)
|
|
|
+
|
|
|
+ // #ifdef MP-WEIXIN
|
|
|
this.code = option.code
|
|
|
if(uni.getStorageSync('userInfo')&&JSON.stringify(uni.getStorageSync('userInfo'))!='{}') {
|
|
|
this.userInfo = JSON.parse(uni.getStorageSync('userInfo'))
|
|
@@ -484,7 +489,6 @@
|
|
|
this.userInfo = {}
|
|
|
}
|
|
|
this.appToken=uni.getStorageSync('companyUserInfo')
|
|
|
- // decodeURIComponent()
|
|
|
if(!option.course){
|
|
|
const keys = decodeURIComponent(Object.keys(option)[0]);
|
|
|
this.urlOption=JSON.parse(keys.split('course=')[1])
|
|
@@ -499,28 +503,43 @@
|
|
|
this.timeid=this.urlOption.id
|
|
|
console.log(this.urlOption)
|
|
|
console.log(decodeURIComponent(option.course))
|
|
|
- // this.sortLink = this.urlOption.link || ''
|
|
|
this.getMenuButton()
|
|
|
- // #ifdef MP-WEIXIN
|
|
|
- // if(this.$store.state.logoname!=='乐氏本源'&&!uni.getStorageSync('userInfos')){
|
|
|
- // this.userlogo=true
|
|
|
- // }
|
|
|
- console.log(uni.getStorageSync('userInfos'))
|
|
|
- if(!uni.getStorageSync('userInfos')&&this.$store.state.logoname=='乐氏本源'){
|
|
|
- uni.navigateTo({
|
|
|
- url:'/pages_course/webview'
|
|
|
+ // #endif
|
|
|
+ // #ifdef H5
|
|
|
+ console.log(option)
|
|
|
+ if(option.s){
|
|
|
+ this.sortLink = option.s || ''
|
|
|
+ console.log(option.s)
|
|
|
+ }else if(option.course){
|
|
|
+ console.log(option.course)
|
|
|
+ this.urlOption = option.course ? JSON.parse(option.course) : {},
|
|
|
+ this.videoId = this.urlOption.videoId
|
|
|
+ this.courseId = this.urlOption.courseId
|
|
|
+ this.periodId = this.urlOption.periodId
|
|
|
+ this.companyId = this.urlOption.companyId
|
|
|
+ this.companyUserId = this.urlOption.companyUserId
|
|
|
+ this.timeid=this.urlOption.id
|
|
|
+ this.projectId=this.urlOption.projectId
|
|
|
+ this.plusReady(() => {
|
|
|
+ this.AppTokenAPP = plus.storage.getItem('AppToken');
|
|
|
+ // this.AppTokenAPP='eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJzdWIiOiIxMDgwNTA5IiwiaWF0IjoxNzU3Mzk1MDYxLCJleHAiOjE3ODg5MzEwNjF9.aRF0amePt9AHZoCglJ8zLGs6AB3z-0uZQ1SiddAu7WAcv98FPVsTyRjpGrCb96ir_0fU5g8ZQj70HIhTGMFrKA'
|
|
|
+ // console.log("AppToken= onLoad====",AppTokenAPP)
|
|
|
+ uni.setStorageSync('TOKEN_KEY',this.AppTokenAPP);
|
|
|
})
|
|
|
- return
|
|
|
+ // this.AppTokenAPP='eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJzdWIiOiIxMDgwNTA5IiwiaWF0IjoxNzU3Mzk1MDYxLCJleHAiOjE3ODg5MzEwNjF9.aRF0amePt9AHZoCglJ8zLGs6AB3z-0uZQ1SiddAu7WAcv98FPVsTyRjpGrCb96ir_0fU5g8ZQj70HIhTGMFrKA'
|
|
|
+ // console.log("AppToken= onLoad====",this.AppTokenAPP)
|
|
|
+ // uni.setStorageSync('TOKEN_KEY',this.AppTokenAPP);
|
|
|
}
|
|
|
// #endif
|
|
|
},
|
|
|
onShow() {
|
|
|
- this.tipsOpen = false
|
|
|
- this.isExpand = true
|
|
|
- this.uuId = generateRandomString(16)
|
|
|
if (this.videoId) {
|
|
|
this.getH5CourseByVideo()
|
|
|
}
|
|
|
+ // #ifdef MP-WEIXIN
|
|
|
+ this.tipsOpen = false
|
|
|
+ this.isExpand = true
|
|
|
+ this.uuId = generateRandomString(16)
|
|
|
const AppToken=uni.getStorageSync('TOKEN_WEXIN')
|
|
|
console.log(AppToken)
|
|
|
if(AppToken){
|
|
@@ -528,18 +547,37 @@
|
|
|
if(this.isAddKf == 1){
|
|
|
this.getH5CourseVideoDetails()
|
|
|
} else{
|
|
|
+ if(this.companyUserId!=''){
|
|
|
+ this.getIsAddKf()
|
|
|
+ }
|
|
|
this.checkUserInfoA()
|
|
|
- // this.getIsAddKf()
|
|
|
}
|
|
|
}
|
|
|
- // if(this.sortLink){
|
|
|
- // this.getLink()
|
|
|
- // } else {
|
|
|
- // uni.showToast({
|
|
|
- // title: 'sortLink is not found',
|
|
|
- // icon: 'none'
|
|
|
- // });
|
|
|
- // }
|
|
|
+ // #endif
|
|
|
+
|
|
|
+ // #ifdef H5
|
|
|
+ console.log('大家萨克贷记卡',uni.getStorageSync('TOKEN_KEY'))
|
|
|
+ if(uni.getStorageSync('TOKEN_KEY')){
|
|
|
+ this.isLogin=true
|
|
|
+ if(this.isAddKf == 1){
|
|
|
+ this.getH5CourseVideoDetails()
|
|
|
+ } else{
|
|
|
+ if(this.companyUserId){
|
|
|
+ this.getIsAddKf()
|
|
|
+ }
|
|
|
+ this.checkUserInfoA()
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(this.sortLink){
|
|
|
+ this.getLink()
|
|
|
+ } else if(!this.sortLink&&!this.videoId) {
|
|
|
+ uni.showToast({
|
|
|
+ title: 'sortLink is not found',
|
|
|
+ icon: 'none'
|
|
|
+ });
|
|
|
+ }
|
|
|
+ // #endif
|
|
|
+
|
|
|
},
|
|
|
mounted() {
|
|
|
// this.getIP()
|
|
@@ -575,6 +613,13 @@
|
|
|
this.clearIntegral()
|
|
|
},
|
|
|
methods: {
|
|
|
+ plusReady(callback) {
|
|
|
+ if (window.plus) {
|
|
|
+ callback()
|
|
|
+ } else {
|
|
|
+ document.addEventListener('plusready', callback, { once: true })
|
|
|
+ }
|
|
|
+ },
|
|
|
//检查用户昵称以及头像
|
|
|
checkUserInfoA(){
|
|
|
checkUserInfo().then(res=>{
|
|
@@ -929,8 +974,8 @@
|
|
|
this.errorCount++
|
|
|
if (this.errorCount > 3) return
|
|
|
console.log(e)
|
|
|
- this.getErrMsg(e.target.errMsg)
|
|
|
- this.getH5CourseVideoDetails('error')
|
|
|
+ // this.getErrMsg(e.target.errMsg)
|
|
|
+ // this.getH5CourseVideoDetails('error')
|
|
|
},
|
|
|
// 当开始/继续播放时触发play事件
|
|
|
getPlay() {
|
|
@@ -1166,15 +1211,19 @@
|
|
|
}
|
|
|
},
|
|
|
submit() {
|
|
|
- if(this.isExpire){
|
|
|
- uni.showToast({
|
|
|
- title: '课程已过期或链接无效',
|
|
|
- icon: 'none'
|
|
|
- });
|
|
|
+ if(this.isAddKf==0){
|
|
|
+ this.getIsAddKf()
|
|
|
return
|
|
|
}
|
|
|
+ // if(this.isExpire){
|
|
|
+ // uni.showToast({
|
|
|
+ // title: '课程已过期或链接无效',
|
|
|
+ // icon: 'none'
|
|
|
+ // });
|
|
|
+ // return
|
|
|
+ // }
|
|
|
// 登录
|
|
|
- this.$isLoginCourse().then(
|
|
|
+ this.$isLoginCourseH5().then(
|
|
|
res => {
|
|
|
console.log(res)
|
|
|
if(res){
|
|
@@ -1214,6 +1263,7 @@
|
|
|
},
|
|
|
// 答题
|
|
|
courseAnswer() {
|
|
|
+ console.log(this.errTitle)
|
|
|
let time = this.playTime
|
|
|
if (this.isEnded||this.isFinish==1) {
|
|
|
time = this.duration
|
|
@@ -1263,7 +1313,7 @@
|
|
|
}
|
|
|
this.remain = res.remain || 0
|
|
|
if (res.remain > 0) {
|
|
|
- this.answerPopup=true
|
|
|
+ // this.answerPopup=true
|
|
|
this.errTitle = "很遗憾答错了"
|
|
|
this.errDesc = `<span style="color:#FF5C03">还有${res.remain}次机会,继续加油</span>`
|
|
|
// this.$refs.answerPopup.open("center")
|
|
@@ -1271,14 +1321,17 @@
|
|
|
}
|
|
|
} else {
|
|
|
this.errTitle = "恭喜你,回答正确"
|
|
|
- uni.login({
|
|
|
- provider: 'weixin',
|
|
|
- success: async loginRes => {
|
|
|
- console.log(loginRes)
|
|
|
- var code=loginRes
|
|
|
- this.closeAnswerPopup(loginRes.code)
|
|
|
- }
|
|
|
- })
|
|
|
+ if(res.msg=='答题成功'){
|
|
|
+ this.closeAnswerPopup()
|
|
|
+ // uni.login({
|
|
|
+ // provider: 'weixin',
|
|
|
+ // success: async loginRes => {
|
|
|
+ // console.log(loginRes)
|
|
|
+ // var code=loginRes
|
|
|
+ // this.closeAnswerPopup(loginRes.code)
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ }
|
|
|
// 答题成功
|
|
|
// this.errDesc = `请选择奖励`
|
|
|
// this.$refs.answerPopup.open("center")
|
|
@@ -1306,6 +1359,7 @@
|
|
|
this.currentReward = e.detail.value
|
|
|
},
|
|
|
closeAnswerPopup(code) {
|
|
|
+ // console.log("closeAnswerPopup===",code)
|
|
|
// this.$refs.answerPopup.close()
|
|
|
uni.showLoading({
|
|
|
title: "加载中..."
|
|
@@ -1315,7 +1369,7 @@
|
|
|
...this.urlOption,
|
|
|
userId:this.userInfo.userId,
|
|
|
// rewardType: Number(this.currentReward),
|
|
|
- source: 2, // 小程序
|
|
|
+ source: 3, // 2 小程序 3 app
|
|
|
appId: this.appid,
|
|
|
code:code
|
|
|
}
|
|
@@ -1359,7 +1413,7 @@
|
|
|
})
|
|
|
}else{
|
|
|
uni.hideLoading()
|
|
|
- this.answerPopup=!this.answerPopup
|
|
|
+ this.answerPopup=false
|
|
|
}
|
|
|
},
|
|
|
// 线路
|
|
@@ -1426,13 +1480,16 @@
|
|
|
companyUserId:this.companyUserId,
|
|
|
companyId:this.companyId,
|
|
|
courseId:this.courseId,
|
|
|
- periodId:this.periodId
|
|
|
+ periodId:this.periodId,
|
|
|
+ projectId:this.projectId
|
|
|
}
|
|
|
// {videoId: this.videoId,qwUserId: this.qwUserId,corpId: this.corpId}
|
|
|
getIsAddKf(data).then(res => {
|
|
|
if (res.code == 200) {
|
|
|
this.isLogin = true
|
|
|
if(res.data){
|
|
|
+ this.userInfo= res.data
|
|
|
+ uni.setStorageSync('userInfo', JSON.stringify(res.user));
|
|
|
this.isAddKf = 1
|
|
|
this.getH5CourseVideoDetails()
|
|
|
}
|
|
@@ -1548,20 +1605,16 @@
|
|
|
getErrMsg({
|
|
|
msg: JSON.stringify(msgerr)
|
|
|
})
|
|
|
- },
|
|
|
- goLogin() {
|
|
|
-
|
|
|
},
|
|
|
getLink() {
|
|
|
- this.goLogin()
|
|
|
- return
|
|
|
+ // if(plus.storage.getItem('AppToken'))return
|
|
|
let that = this;
|
|
|
this.msg = ''
|
|
|
getRealLink({sortLink:this.sortLink}).then(res=>{
|
|
|
if(res.code == 200) {
|
|
|
this.isExpire = false
|
|
|
// 如果响应中包含真实链接,则跳转到真实链接
|
|
|
- // window.location.href = res.realLink +"&sortLink="+this.sortLink+"&code="+this.code+"&time="+new Date().getTime()
|
|
|
+ window.location.href = res.realLink +"&sortLink="+this.sortLink+"&code="+this.code+"&time="+new Date().getTime()
|
|
|
if (this.isLogin && this.isAddKf == 1) {
|
|
|
this.getH5CourseVideoDetails()
|
|
|
}
|
|
@@ -2116,7 +2169,7 @@
|
|
|
}
|
|
|
|
|
|
.content {
|
|
|
- padding-bottom: calc(var(--window-bottom) + 164rpx);
|
|
|
+ padding-bottom: calc(var(--window-bottom) + 140rpx);
|
|
|
.video-box {
|
|
|
width: 100%;
|
|
|
height: 420rpx;
|