|
|
|
|
@ -21,20 +21,19 @@
|
|
|
|
|
</view>
|
|
|
|
|
</block>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="detail-btn" v-if="info.sign_status===10">
|
|
|
|
|
<view class="detail-btn" v-if="Number(info.sign_status) === 10">
|
|
|
|
|
<view @click="toApply">
|
|
|
|
|
<image class="course-btn" :src="base.imgHost('course-btn.png')"></image>
|
|
|
|
|
<text>我要报名</text>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|
<!-- 悬浮按钮:当不可报名且有url时显示 -->
|
|
|
|
|
<view class="floating-btn" v-if="info.sign_status !== 10 && info.url && info.url_title">
|
|
|
|
|
<view @click="openWebview" class="url-container">
|
|
|
|
|
<image class="url-bg" :src="base.imgHost('urlbtn.png')" mode="aspectFill"></image>
|
|
|
|
|
<text class="url-text">查看精彩回顾</text>
|
|
|
|
|
<!-- {{ info.url_title }} -->
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|
<!-- 悬浮按钮:不可报名且(后台配置了资讯链接 或 页面带 newsUrl)时显示 -->
|
|
|
|
|
<view class="floating-btn" v-if="showRecapBtn">
|
|
|
|
|
<view @click="openWebview" class="url-container">
|
|
|
|
|
<image class="url-bg" :src="base.imgHost('urlbtn.png')" mode="aspectFill"></image>
|
|
|
|
|
<text class="url-text">查看精彩回顾</text>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|
@ -85,6 +84,15 @@
|
|
|
|
|
newsUrl: ''
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
computed: {
|
|
|
|
|
showRecapBtn() {
|
|
|
|
|
// 报名进行中(10)不显示
|
|
|
|
|
if (Number(this.info.sign_status) === 10) return false
|
|
|
|
|
if (!this.base.isNull(this.newsUrl)) return true
|
|
|
|
|
if (!this.base.isNull(this.info.url) && !this.base.isNull(this.info.url_title)) return true
|
|
|
|
|
return false
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
onShareAppMessage(res) {
|
|
|
|
|
return {
|
|
|
|
|
@ -102,7 +110,7 @@
|
|
|
|
|
},
|
|
|
|
|
onLoad(options) {
|
|
|
|
|
this.course_id = options.id
|
|
|
|
|
this.newsUrl = options.newsUrl?options.newsUrl:''
|
|
|
|
|
this.newsUrl = this.parseNewsUrl(options)
|
|
|
|
|
let token = uni.getStorageSync('stbc1_lifeData') ? uni.getStorageSync('stbc1_lifeData').vuex_token : ''
|
|
|
|
|
if (this.base.isNull(token)) {
|
|
|
|
|
this.getToken()
|
|
|
|
|
@ -120,6 +128,16 @@
|
|
|
|
|
this.showRegister = false
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
parseNewsUrl(options) {
|
|
|
|
|
if (!options) return ''
|
|
|
|
|
const raw = options.newsUrl || options.newsurl || ''
|
|
|
|
|
if (this.base.isNull(raw)) return ''
|
|
|
|
|
try {
|
|
|
|
|
return decodeURIComponent(raw)
|
|
|
|
|
} catch (e) {
|
|
|
|
|
return raw
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
async getToken() {
|
|
|
|
|
let that = this
|
|
|
|
|
const loginResult = await new Promise((resolve, reject) => {
|
|
|
|
|
@ -259,17 +277,11 @@
|
|
|
|
|
|
|
|
|
|
// 打开webview页面
|
|
|
|
|
openWebview() {
|
|
|
|
|
if (this.newsUrl) {
|
|
|
|
|
uni.navigateTo({
|
|
|
|
|
url: `/packages/webview/index?type=3&url=${this.newsUrl}`
|
|
|
|
|
})
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
if (this.info.url) {
|
|
|
|
|
uni.navigateTo({
|
|
|
|
|
url: `/packages/webview/index?type=3&url=${this.info.url}`
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
const targetUrl = !this.base.isNull(this.newsUrl) ? this.newsUrl : this.info.url
|
|
|
|
|
if (this.base.isNull(targetUrl)) return
|
|
|
|
|
uni.navigateTo({
|
|
|
|
|
url: `/packages/webview/index?type=3&url=${encodeURIComponent(targetUrl)}`
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|