4e6738af by simon

默认提交

1 parent 10c6d284
......@@ -6,7 +6,7 @@ import {
import Dialog from '../../ui/vant-weapp/dialog/dialog';
import Poster from '../../miniprogram_dist/poster/poster';
const back = wx.getBackgroundAudioManager();
const innerAudio = wx.createInnerAudioContext();
let app = getApp();
Page({
......@@ -74,6 +74,12 @@ Page({
authorizeVisible: true
})
},
onHide() {
},
onUnload() {
this.pauseBgm();
},
onLoad(options) {
this.setData({
options
......@@ -135,23 +141,34 @@ Page({
let {
detailData
} = this.data;
innerAudio.src = detailData.musicUrl;
innerAudio.seek(0);
innerAudio.play();
innerAudio.onEnded(() => {
_this.playBgm();
})
this.setData({
isPlayingBgm: true,
})
back.title = "背景音乐";
back.src = detailData.musicUrl;
back.onEnded(() => {
_this.playBgm();
})
},
pauseBgm() {
wx.pauseBackgroundAudio()
innerAudio.pause();
innerAudio.offEnded(() => {})
this.setData({
isPlayingBgm: false,
})
},
onBgmHandler() {
if (this.data.isPlayingBgm) {
this.pauseBgm();
} else {
this.playBgm();
}
},
onShowMoreHandler() {
this.setData({
isMore: true
......@@ -659,7 +676,7 @@ Page({
} catch (error) {}
let memberList = result.memberList;
// hardcode数据
// for (let index = 0; index < 18; index++) {
// for (let index = 0; index < 4; index++) {
// memberList.push({
// blessCode: "4144feba2b904ba89585d90e8618a863",
// blessMemberCode: "747e8e314d0e46679be17fb495975439",
......
......@@ -5,8 +5,12 @@
font-size: 36rpx;
}
.van-popup {
background-color: transparent !important;
.van-popup {}
.poster-popup {
.van-popup {
background-color: transparent !important;
}
}
// 用户头像
......@@ -36,6 +40,7 @@
@extend .bb;
padding: 36px 24px;
font-size: 38px;
// background-color: #ffffff;
&-item {
margin-bottom: 48px;
......@@ -176,6 +181,7 @@
width: 660px;
display: flex;
justify-content: flex-start;
// justify-content: center;
flex-wrap: wrap;
margin: 36px auto 0;
height: 450px;
......
......@@ -146,7 +146,7 @@
</view>
</view>
<!-- 背景音乐 -->
<image bindtap="onBgmHandler" src="../../image/icon/icon-music.png" class="music {{isPlayingBgm?'ani-rotation-music':''}}" mode="widthFix"></image>
<image wx:if="{{detailData.musicUrl}}" bindtap="onBgmHandler" src="../../image/icon/icon-music.png" class="music {{isPlayingBgm?'ani-rotation-music':''}}" mode="widthFix"></image>
<!-- <audio src="{{detailData.musicUrl}}" id="myAudio"></audio> -->
<!-- 修改用户信息 -->
<van-dialog close-on-click-overlay use-slot title="修改信息" confirm-button-text="确认修改" show="{{ updateUserInfoDialogVisible }}" show-cancel-button bind:confirm="onUpdateUserInfoHander">
......@@ -189,7 +189,7 @@
<van-popup show="{{ authorizeVisible }}">
<authorize-comp bind:evtcomp="evtcomp"></authorize-comp>
</van-popup>
<van-popup bind:click-overlay="onHidePosterHandler" show="{{ posterVisible }}">
<van-popup class="poster-popup" bind:click-overlay="onHidePosterHandler" show="{{ posterVisible }}">
<image bindtap="onPreviewImageHandler" class="poster" mode="widthFix" src="{{imageUrl}}" />
<view bindtap="saveImageToPhotosAlbum" class="save-btn">一键保存</view>
</van-popup>
......