|
@@ -1,8 +1,8 @@
|
|
|
<template>
|
|
|
<view class='app-container' :style="{ background: `url(${form.backgroundImage}) no-repeat 100% / cover` }">
|
|
|
<view class="content" :style="{ 'padding-bottom': form.buttonFixType === 0 ? '94px' : 0 }">
|
|
|
- <!-- 标题 -->
|
|
|
- <view class="title">{{ form.title }}</view>
|
|
|
+ <!-- 打开app -->
|
|
|
+ <open-app v-if="!inside" @open="getOpenApp" />
|
|
|
<!-- 页面布局 -->
|
|
|
<view v-if="form.contentShareLayoutList">
|
|
|
<view class="item" v-for="item in form.contentShareLayoutList" :key="item.id">
|
|
@@ -18,7 +18,8 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
<!-- 按钮 -->
|
|
|
- <view :class="['footer', form.buttonFixType === 0 ? 'fixed' : '']">
|
|
|
+ <view :class="['footer', form.buttonFixType === 0 ? 'fixed' : '']"
|
|
|
+ v-if="inside ? form.isButton == 1 ? true : false : false">
|
|
|
<button class="left" @click="getClick(form.leftButtonForwardType, form, 'leftButton')"
|
|
|
:style="{ background: form.leftButtonImg ? `url(${form.leftButtonImg}) no-repeat 100% / 100%` : '' }">
|
|
|
<text>{{ form.leftButtonText }}</text>
|
|
@@ -36,10 +37,10 @@ import { detail } from '@/api/content'
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
|
+ // 判断是否为APP内部H5
|
|
|
+ inside: JSON.stringify(getApp().globalData.userInfo) == "{}" ? false : true,
|
|
|
// 表单
|
|
|
form: {},
|
|
|
- // 是否显示底部按钮
|
|
|
- isShow: false,
|
|
|
// 跳转地址
|
|
|
audioOption: {
|
|
|
8: '/mobile/playAlbumPage',
|
|
@@ -72,9 +73,9 @@ export default {
|
|
|
})
|
|
|
this.form = res.data.data
|
|
|
// 检测当前是否有正在播放的音频
|
|
|
- this.getStatus()
|
|
|
- // 非APP内部H5底部按钮隐藏
|
|
|
- this.isShow = JSON.stringify(getApp().globalData.userInfo) == '{}' ? false : this.form.isButton === 1 ? true : false
|
|
|
+ if (this.inside) {
|
|
|
+ this.getStatus()
|
|
|
+ }
|
|
|
}
|
|
|
})
|
|
|
},
|
|
@@ -94,16 +95,29 @@ export default {
|
|
|
|
|
|
// 单个音频
|
|
|
getPlay(e, item) {
|
|
|
- let status = e === 2 ? 1 : 2
|
|
|
- openPage.postMessage(`?page=/mobile/audioPage&audioId=${item.contentInfo.audioId}&audioType=${item.contentInfo.audioType}&platformId=${item.platformId}&openAudioPage=0&cmd=openPage&playStatus=${status}`)
|
|
|
- window['setOpenPage'] = res => {
|
|
|
- item.playStatus = JSON.parse(res).status
|
|
|
+ if (this.inside) {
|
|
|
+ let status = e === 2 ? 1 : 2
|
|
|
+ openPage.postMessage(`?page=/mobile/audioPage&audioId=${item.contentInfo.audioId}&audioType=${item.contentInfo.audioType}&platformId=${item.platformId}&cmd=openPage&playStatus=${status}`)
|
|
|
+ window['setOpenPage'] = res => {
|
|
|
+ item.playStatus = JSON.parse(res).status
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ this.getOpenApp()
|
|
|
}
|
|
|
},
|
|
|
|
|
|
// 歌单 、专辑
|
|
|
getOpen(item) {
|
|
|
- openPage.postMessage(`?page=${this.audioOption[item.contentType]}&audioId=${item.contentInfo.audioId}&audioType=${item.contentInfo.audioType}&platformId=${item.platformId}&openAudioPage=1&cmd=openPage`)
|
|
|
+ if (this.inside) {
|
|
|
+ openPage.postMessage(`?page=${this.audioOption[item.contentType]}&audioId=${item.contentInfo.audioId}&audioType=${item.contentInfo.audioType}&platformId=${item.platformId}&openAudioPage=1&cmd=openPage`)
|
|
|
+ } else {
|
|
|
+ this.getOpenApp()
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ // 浏览器H5打开App内部H5
|
|
|
+ getOpenApp() {
|
|
|
+ this.openApp(`?page=/mobile/webViewPage&url=pages/content/index?articleId=${this.form.id}&cmd=openPage&isNeedLogin=1&title=${this.form.title}`)
|
|
|
},
|
|
|
|
|
|
// 底部按钮
|