精彩回顾

master
lion 2 months ago
parent e9db779bdb
commit 40cbd24ecd

@ -158,7 +158,9 @@ export default {
//
if (type === 1) {
if (ev.course_id) {
uni.navigateTo({ url: `/packages/course/detail?id=${ev.course_id}&newsUrl=${ev.url}` })
uni.navigateTo({
url: `/packages/course/detail?id=${ev.course_id}&newsUrl=${encodeURIComponent(ev.url || '')}`
})
return
}
// course_id

@ -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)}`
})
},
}

@ -21,7 +21,8 @@
this.link = this.baseUrl+`/news/?from=wx`
}else if(options.type==3){
//
this.link = this.baseUrl+`${options.url}?from=wx`
const path = options.url ? decodeURIComponent(options.url) : ''
this.link = this.baseUrl + `${path}?from=wx`
}else if(options.type==4){
//
this.link = this.baseUrl+`/contact/?from=wx`

Loading…
Cancel
Save