|
@@ -13,21 +13,45 @@
|
|
|
<text>注:请务必阅读</text>
|
|
|
<text class="statement" @click="isShowStatement = true">免责声明 </text>
|
|
|
</view>
|
|
|
- <view class="content-audio">
|
|
|
- <view class="audio-img">
|
|
|
- <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 class="audio-card">
|
|
|
+ <view class="card-title text_oneLine">
|
|
|
+ {{ detali.VideoName }}
|
|
|
</view>
|
|
|
- <view class="audio-title">
|
|
|
- <text>{{ detali.VideoName }}</text>
|
|
|
- <text>{{ detali.VideoPlaySeconds }}</text>
|
|
|
+ <view class="slider-paly">
|
|
|
+ <view style="flex: 1; padding-top: 20rpx">
|
|
|
+ <slider
|
|
|
+ activeColor="#3385FF"
|
|
|
+ :max="detali.VideoPlaySeconds"
|
|
|
+ :value="curTime"
|
|
|
+ @change="handleAudioSliderChange($event)"
|
|
|
+ @changing="handleAudioSliderChangeing($event)"
|
|
|
+ block-size="16"
|
|
|
+ class="slider"
|
|
|
+ />
|
|
|
+ <view class="card-time">
|
|
|
+ <text class="time">{{ curTime | formatVoiceTime }}</text>
|
|
|
+ <text class="time">{{ detali.VideoPlaySeconds | formatVoiceTime }}</text>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view class="is-paly-card">
|
|
|
+ <image
|
|
|
+ @click.stop="audioPlayBack"
|
|
|
+ :src="
|
|
|
+ curVoiceId === detali.ArticleId && !curAudioPaused
|
|
|
+ ? 'https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/play_icon.gif'
|
|
|
+ : 'https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/pause_icon.png'
|
|
|
+ "
|
|
|
+ ></image>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view class="fast-reverse">
|
|
|
+ <image @click="speedReverseHandler('reverse')" class="speed-img" src="https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/fastReverse_icon.png"></image>
|
|
|
+ <block v-for="(item, index) in timesTheSpeed" :key="item.value">
|
|
|
+ <view class="speed-button" v-if="isTimes == item.value" @click="isTimesHandler(index)">
|
|
|
+ {{ item.name }}
|
|
|
+ </view>
|
|
|
+ </block>
|
|
|
+ <image @click="speedReverseHandler('speed')" class="speed-img" src="https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/speed_icon.png"></image>
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="content-abstract">
|
|
@@ -60,7 +84,9 @@
|
|
|
</block>
|
|
|
</view>
|
|
|
<freeCharge class="free-charge" :isShowFreeBtn="isShowFree" />
|
|
|
- <audioModule :showAudioPop="false" />
|
|
|
+ <view v-show="false">
|
|
|
+ <audioModule ref="refAudioPop" :showAudioPop="showAudioPop" />
|
|
|
+ </view>
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
@@ -81,6 +107,14 @@ export default {
|
|
|
haveAuth: "", //权限判断
|
|
|
videoUrl: "",
|
|
|
isShowAlert: false,
|
|
|
+ timesTheSpeed: [
|
|
|
+ { name: "倍速", value: 1 },
|
|
|
+ { name: "1.25倍", value: 1.25 },
|
|
|
+ { name: "1.5倍", value: 1.5 },
|
|
|
+ { name: "2倍", value: 2 },
|
|
|
+ ],
|
|
|
+ showAudioBox: false,
|
|
|
+ curTime: 0,
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
@@ -92,6 +126,30 @@ export default {
|
|
|
//当前音频是否暂停状态
|
|
|
return this.$store.state.audioBg.paused;
|
|
|
},
|
|
|
+ //几倍的播放数度
|
|
|
+ isTimes() {
|
|
|
+ let isMultiple = this.curVoiceId === this.detali.ArticleId ? this.$store.state.audioBg.multiple : 1;
|
|
|
+ return isMultiple;
|
|
|
+ },
|
|
|
+ showAudioPop() {
|
|
|
+ return this.$store.state.audioBg.show;
|
|
|
+ },
|
|
|
+ },
|
|
|
+ filters: {
|
|
|
+ formatVoiceTime(e) {
|
|
|
+ let m = parseInt(e / 60);
|
|
|
+ let s = parseInt(e % 60);
|
|
|
+ return `${m > 9 ? m : "0" + m}:${s > 9 ? s : "0" + s}`;
|
|
|
+ },
|
|
|
+ },
|
|
|
+ width: {
|
|
|
+ "$store.state.audioBg.curTime": {
|
|
|
+ handler(newVal) {
|
|
|
+ this.curTime = this.curVoiceId === this.detali.ArticleId ? newVal : 0;
|
|
|
+ },
|
|
|
+ immediate: true,
|
|
|
+ deep: true,
|
|
|
+ },
|
|
|
},
|
|
|
methods: {
|
|
|
async getDetail() {
|
|
@@ -99,6 +157,8 @@ export default {
|
|
|
ArticleId: this.id,
|
|
|
});
|
|
|
if (res.Ret === 200) {
|
|
|
+ let arr = res.Data.Detail.VideoPlaySeconds.split(":");
|
|
|
+ res.Data.Detail.VideoPlaySeconds = arr[0] * 60 + (arr[1] - 0);
|
|
|
this.detali = res.Data.Detail;
|
|
|
this.haveAuth = res.Data.HasPermission;
|
|
|
this.videoUrl = res.Data.Detail.VideoUrl;
|
|
@@ -143,18 +203,14 @@ export default {
|
|
|
//音频点击暂停播放
|
|
|
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();
|
|
|
- }
|
|
|
+ if (this.$store.state.audioBg.reportId == this.detali.ArticleId) {
|
|
|
+ if (this.globalBgAudioManager.paused) {
|
|
|
+ this.globalBgAudioManager.play();
|
|
|
} else {
|
|
|
- this.$store.commit("audioBg/addAudio", { list, reportId: this.detali.ArticleId });
|
|
|
+ this.globalBgAudioManager.pause();
|
|
|
}
|
|
|
} else {
|
|
|
- this.$store.commit("audioBg/removeAudio");
|
|
|
+ this.$store.commit("audioBg/updateAudioTime", 0);
|
|
|
this.$store.commit("audioBg/addAudio", { list, reportId: this.detali.ArticleId });
|
|
|
}
|
|
|
},
|
|
@@ -169,23 +225,57 @@ export default {
|
|
|
this.isShowAlert = res.Data.IsShow;
|
|
|
}
|
|
|
},
|
|
|
+ //拖动进度条
|
|
|
+ handleAudioSliderChange(e) {
|
|
|
+ const value = e.detail.value;
|
|
|
+ this.globalBgAudioManager.seek(value);
|
|
|
+ },
|
|
|
+ handleAudioSliderChangeing(e) {
|
|
|
+ this.curTime = e.detail.value;
|
|
|
+ },
|
|
|
+ //倍速播放
|
|
|
+ isTimesHandler(i) {
|
|
|
+ let list = { Url: this.detali.VideoUrl, Name: this.detali.Title, PlaySeconds: this.detali.VideoPlaySeconds };
|
|
|
+ let index = i == 3 ? 0 : i + 1;
|
|
|
+ this.$store.commit("audioBg/setMultiple", this.timesTheSpeed[index].value);
|
|
|
+ this.globalBgAudioManager.playbackRate = this.isTimes;
|
|
|
+ this.globalBgAudioManager.startTime = this.curTime;
|
|
|
+ if (this.$store.state.audioBg.reportId != this.detali.ArticleId) {
|
|
|
+ this.$store.commit("audioBg/addAudio", { list, reportId: this.detali.ArticleId });
|
|
|
+ this.globalBgAudioManager.play();
|
|
|
+ } else {
|
|
|
+ if (this.globalBgAudioManager.paused) {
|
|
|
+ this.globalBgAudioManager.play();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //快进 快退
|
|
|
+ speedReverseHandler(type) {
|
|
|
+ let isTime = type == "reverse" ? this.curTime - 15 : this.curTime + 15;
|
|
|
+ isTime = isTime <= 0 ? 0 : isTime >= this.audioTime ? this.audioTime - 1 : isTime;
|
|
|
+ this.globalBgAudioManager.seek(isTime);
|
|
|
+ },
|
|
|
},
|
|
|
components: {
|
|
|
statement,
|
|
|
freeCharge,
|
|
|
audioModule,
|
|
|
},
|
|
|
- onLoad(option) {
|
|
|
+ async onLoad(option) {
|
|
|
this.id = Number(option.id) || "";
|
|
|
this.userIsShowAlert();
|
|
|
- },
|
|
|
- async onShow() {
|
|
|
await this.$store.dispatch("checkHandle");
|
|
|
if (!this.$store.state.isAuth && !this.$store.state.isBind) {
|
|
|
//已授权已绑定
|
|
|
this.getDetail();
|
|
|
}
|
|
|
},
|
|
|
+ onShow() {
|
|
|
+ this.showAudioBox = true;
|
|
|
+ },
|
|
|
+ onHide() {
|
|
|
+ this.showAudioBox = false;
|
|
|
+ },
|
|
|
/**
|
|
|
* 用户点击分享
|
|
|
*/
|
|
@@ -314,6 +404,65 @@ export default {
|
|
|
margin: 0 auto 20rpx;
|
|
|
color: #999999;
|
|
|
}
|
|
|
+ .audio-card {
|
|
|
+ width: 100%;
|
|
|
+ height: 282rpx;
|
|
|
+ background: #f9f9f9;
|
|
|
+ border-radius: 16rpx;
|
|
|
+ margin: 30rpx auto;
|
|
|
+ padding: 30rpx;
|
|
|
+ .slider {
|
|
|
+ width: 100%;
|
|
|
+ margin: 0;
|
|
|
+ }
|
|
|
+ .slider-paly {
|
|
|
+ display: flex;
|
|
|
+ height: 80rpx;
|
|
|
+ align-items: center;
|
|
|
+ padding-left: 20rpx;
|
|
|
+ }
|
|
|
+ .card-title {
|
|
|
+ font-size: 28rpx;
|
|
|
+ padding: 0 40rpx;
|
|
|
+ text-align: center;
|
|
|
+ margin-bottom: 35rpx;
|
|
|
+ }
|
|
|
+ .card-time {
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ color: #999999;
|
|
|
+ font-size: 20rpx;
|
|
|
+ }
|
|
|
+ .is-paly-card {
|
|
|
+ width: 70rpx;
|
|
|
+ height: 70rpx;
|
|
|
+ flex-shrink: 0;
|
|
|
+ margin-left: 30rpx;
|
|
|
+ image {
|
|
|
+ width: 70rpx;
|
|
|
+ height: 70rpx;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .fast-reverse {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+ margin-top: 30rpx;
|
|
|
+ .speed-button {
|
|
|
+ width: 96rpx;
|
|
|
+ height: 47rpx;
|
|
|
+ background: #eaeaea;
|
|
|
+ border-radius: 8rpx;
|
|
|
+ text-align: center;
|
|
|
+ line-height: 47rpx;
|
|
|
+ margin: 0 70rpx;
|
|
|
+ }
|
|
|
+ .speed-img {
|
|
|
+ width: 50rpx;
|
|
|
+ height: 50rpx;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
@import "../jurisdiction.scss";
|
|
|
}
|
|
|
</style>
|