Commit 2eec2c09 authored by 汪欢's avatar 汪欢

1

parent 39cb93ba
...@@ -69,8 +69,12 @@ Page({ ...@@ -69,8 +69,12 @@ Page({
this.getOrderList(); this.getOrderList();
// this.screenAdapt(); // this.screenAdapt();
this.onmusicSwitch();
},
onReady(){
this.onmusicSwitch();
}, },
onmusicSwitch(){ onmusicSwitch(){
......
...@@ -17,6 +17,16 @@ ...@@ -17,6 +17,16 @@
opacity: 0.7; opacity: 0.7;
} }
.jie_shu_ye .music {
z-index: 90;
width: 56rpx;
height: 56rpx;
opacity: 1;
left: 224rpx;
top: 242rpx;
position: absolute;
}
.jie_shu_ye .logo { .jie_shu_ye .logo {
width: 160rpx; width: 160rpx;
height: 58rpx; height: 58rpx;
......
<view class="jie_shu_ye"> <view class="jie_shu_ye">
<view class="{{maskVisible ? 'mask' : ''}}"></view> <view class="{{maskVisible ? 'mask' : ''}}"></view>
<image class="music" a:if="{{musicSwitch}}" onTap="onmusicSwitch" src={{resList['0c115480-d22e-4902-a745-e55eadf7bf91'].url}} />
<image class="music" a:if="{{!musicSwitch}}" onTap="onmusicSwitch" src={{resList['ddd2f68b-0059-4eb1-8667-4b7471b11ddd'].url}} />
<image class="di_kao_bei3" src={{resList['66f2b76f-7265-4cb2-9b4d-7e8207ab1d74'].url}} /> <image class="di_kao_bei3" src={{resList['66f2b76f-7265-4cb2-9b4d-7e8207ab1d74'].url}} />
<image class="logo" src={{resList['dd7d3a3b-6fcb-427d-8353-da169708bbab'].url}} /> <image class="logo" src={{resList['dd7d3a3b-6fcb-427d-8353-da169708bbab'].url}} />
<image onTap="onPrizeBtnClick" class="jiang_pinicon" src={{resList['b7517eae-3bc2-4456-935a-e6e3e1fe995e'].url}} /> <image onTap="onPrizeBtnClick" class="jiang_pinicon" src={{resList['b7517eae-3bc2-4456-935a-e6e3e1fe995e'].url}} />
......
...@@ -3,7 +3,8 @@ ...@@ -3,7 +3,8 @@
import resList from '../../resconfig/resList'; import resList from '../../resconfig/resList';
import API from '../../api'; import API from '../../api';
import { SHARE_CONFIG } from '/tbcc-sdk/lib/constants'; import { SHARE_CONFIG } from '/tbcc-sdk/lib/constants';
import playBgMusic from '/utils/playBgMusic';
const app = getApp();
Page({ Page({
data: { data: {
prizeVisible: false, prizeVisible: false,
...@@ -23,7 +24,8 @@ Page({ ...@@ -23,7 +24,8 @@ Page({
maskVisible: false, maskVisible: false,
list: '', list: '',
totalFloor: '', totalFloor: '',
listlength: '' listlength: '',
musicSwitch:true
}, },
onLoad(props) { onLoad(props) {
...@@ -82,10 +84,21 @@ Page({ ...@@ -82,10 +84,21 @@ Page({
// } // }
this.getOrderList(); this.getOrderList();
this.getPrizeMenu(); this.getPrizeMenu();
this.onmusicSwitch();
}, },
onShareAppMessage() { onShareAppMessage() {
return SHARE_CONFIG; return SHARE_CONFIG;
}, },
onmusicSwitch(){
let {musicSwitch} = this.data;
this.addMusic(musicSwitch);
this.setData({
musicSwitch:!musicSwitch
})
console.log('music点击后',musicSwitch);
},
onPrizeBtnClick() { onPrizeBtnClick() {
my.navigateTo({ my.navigateTo({
...@@ -332,6 +345,17 @@ Page({ ...@@ -332,6 +345,17 @@ Page({
noprizeVisible: false, noprizeVisible: false,
maskVisible: false maskVisible: false
}) })
},
async addMusic(musicSwitch){
const resultSrc = await app.cloud.file.getTempFileURL({
fileId: 'cloud://C7A066C702682E94326284DF8A2975CC//FILA_building_loop.mp3'
});
let musicUrl = null;
if (resultSrc[0]) musicUrl = resultSrc[0].url;
// let {musicSwitch} = this.data;
// playBgMusic(true,musicUrl)
playBgMusic(musicSwitch,musicUrl);
console.log('fuck music')
} }
}); });
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment