|
@@ -15,8 +15,15 @@
|
|
|
</view>
|
|
|
<view class="content-audio">
|
|
|
<view class="audio-img">
|
|
|
- <image v-if="isPlay" @click="audiouspend" src="https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/czbk/suspend_icon.png"></image>
|
|
|
- <image v-else @click="audioPlay" src="https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/czbk/play_icon.png" mode=""></image>
|
|
|
+ <image
|
|
|
+ @click.stop="audioPlayBack"
|
|
|
+ class=""
|
|
|
+ :src="
|
|
|
+ curVoiceId === detali.ArticleId && !curAudioPaused
|
|
|
+ ? 'https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/czbk/suspend_icon.png'
|
|
|
+ : 'https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/czbk/play_icon.png'
|
|
|
+ "
|
|
|
+ ></image>
|
|
|
</view>
|
|
|
<view class="audio-title">
|
|
|
<text>{{ detali.VideoName }}</text>
|
|
@@ -69,6 +76,7 @@
|
|
|
</block>
|
|
|
</view>
|
|
|
<freeCharge class="free-charge" :isShowFreeBtn="isShowFree" />
|
|
|
+ <audioModule :showAudioPop="false" />
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
@@ -76,8 +84,9 @@
|
|
|
import statement from "@/reportPages/components/statement.vue";
|
|
|
import researchSummary from "./components/researchSummary.vue";
|
|
|
import reportChoiceness from "./components/reportChoiceness.vue";
|
|
|
+import audioModule from "@/components/audioModule/index";
|
|
|
import freeCharge from "@/components/freeCharge";
|
|
|
-import { Reports,FreeButton } from "@/config/api.js";
|
|
|
+import { Reports, FreeButton } from "@/config/api.js";
|
|
|
let app = getApp({ allowDefault: true });
|
|
|
export default {
|
|
|
data() {
|
|
@@ -95,20 +104,36 @@ export default {
|
|
|
isShowAlert: false,
|
|
|
};
|
|
|
},
|
|
|
+ computed: {
|
|
|
+ curVoiceId() {
|
|
|
+ //当前正在播放的音频id
|
|
|
+ return this.$store.state.audioBg.reportId;
|
|
|
+ },
|
|
|
+ curAudioPaused() {
|
|
|
+ //当前音频是否暂停状态
|
|
|
+ return this.$store.state.audioBg.paused;
|
|
|
+ },
|
|
|
+ },
|
|
|
methods: {
|
|
|
- audioPlay() {
|
|
|
- if (this.videoUrl === this.globalBgAudioManager.src) {
|
|
|
- this.globalBgAudioManager.play();
|
|
|
+ //音频点击暂停播放
|
|
|
+ audioPlayBack() {
|
|
|
+ let list = { Url: this.detali.VideoUrl, Name: this.detali.Title, PlaySeconds: this.detali.VideoPlaySeconds };
|
|
|
+ if (this.globalBgAudioManager.src) {
|
|
|
+ if (this.$store.state.audioBg.reportId == this.detali.ArticleId) {
|
|
|
+ if (this.globalBgAudioManager.paused) {
|
|
|
+ this.globalBgAudioManager.play();
|
|
|
+ } else {
|
|
|
+ this.globalBgAudioManager.pause();
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ this.$store.commit("audioBg/addAudio", { list, reportId: this.detali.ArticleId });
|
|
|
+ }
|
|
|
} else {
|
|
|
- this.globalBgAudioManager.title = this.detali.VideoName;
|
|
|
- this.globalBgAudioManager.src = this.videoUrl;
|
|
|
+ this.$store.commit("audioBg/removeAudio");
|
|
|
+ this.$store.commit("audioBg/addAudio", { list, reportId: this.detali.ArticleId });
|
|
|
}
|
|
|
- this.isPlay = true;
|
|
|
- },
|
|
|
- audiouspend() {
|
|
|
- this.isPlay = false;
|
|
|
- this.globalBgAudioManager.pause();
|
|
|
},
|
|
|
+ //获取数据详情
|
|
|
async getDetilaiList() {
|
|
|
const res =
|
|
|
this.isType == 1
|
|
@@ -173,32 +198,18 @@ export default {
|
|
|
researchSummary,
|
|
|
reportChoiceness,
|
|
|
freeCharge,
|
|
|
+ audioModule,
|
|
|
},
|
|
|
- onLoad(option) {
|
|
|
+ async onLoad(option) {
|
|
|
this.isType = option.type;
|
|
|
this.id = Number(option.id) || "";
|
|
|
uni.setNavigationBarTitle({
|
|
|
title: this.isType == 1 ? "报告精选" : this.isType == 2 ? "本周研究汇总" : "上周纪要汇总",
|
|
|
});
|
|
|
this.userIsShowAlert();
|
|
|
- this.globalBgAudioManager.onEnded((res) => {
|
|
|
- this.isPlay = false;
|
|
|
- });
|
|
|
- this.globalBgAudioManager.onPause((res) => {
|
|
|
- this.isPlay = false;
|
|
|
- });
|
|
|
- this.globalBgAudioManager.onPlay((res) => {
|
|
|
- this.isPlay = true;
|
|
|
- });
|
|
|
- this.globalBgAudioManager.onStop((res) => {
|
|
|
- this.isPlay = false;
|
|
|
- });
|
|
|
- },
|
|
|
- async onShow() {
|
|
|
await this.$store.dispatch("checkHandle");
|
|
|
if (!this.$store.state.isAuth && !this.$store.state.isBind) this.getDetilaiList();
|
|
|
},
|
|
|
- onUnload() {},
|
|
|
/**
|
|
|
* 用户点击分享
|
|
|
*/
|