xuhuajiao 3 years ago
parent
commit
fc802a91f5
  1. 4
      .hbuilderx/launch.json
  2. 18
      main.js
  3. 26
      manifest.json
  4. 89
      pages/show/show.js
  5. 264
      pages/show/show.vue
  6. BIN
      unpackage/cache/apk/__UNI__487D0A3_cm.apk
  7. 2
      unpackage/cache/apk/apkurl
  8. 2
      unpackage/cache/apk/cmManifestCache.json
  9. BIN
      unpackage/release/apk/__UNI__487D0A3__20220314084851.apk
  10. BIN
      unpackage/release/apk/__UNI__487D0A3__20220408162047.apk
  11. BIN
      unpackage/release/apk/__UNI__487D0A3__20220408165337.apk
  12. BIN
      unpackage/res/icons/1024x1024.png
  13. BIN
      unpackage/res/icons/120x120.png
  14. BIN
      unpackage/res/icons/144x144.png
  15. BIN
      unpackage/res/icons/152x152.png
  16. BIN
      unpackage/res/icons/167x167.png
  17. BIN
      unpackage/res/icons/180x180.png
  18. BIN
      unpackage/res/icons/192x192.png
  19. BIN
      unpackage/res/icons/20x20.png
  20. BIN
      unpackage/res/icons/29x29.png
  21. BIN
      unpackage/res/icons/40x40.png
  22. BIN
      unpackage/res/icons/58x58.png
  23. BIN
      unpackage/res/icons/60x60.png
  24. BIN
      unpackage/res/icons/72x72.png
  25. BIN
      unpackage/res/icons/76x76.png
  26. BIN
      unpackage/res/icons/80x80.png
  27. BIN
      unpackage/res/icons/87x87.png
  28. BIN
      unpackage/res/icons/96x96.png
  29. 48
      utils/music.js

4
.hbuilderx/launch.json

@ -10,6 +10,10 @@
{
"launchtype" : "local"
},
"h5" :
{
"launchtype" : "local"
},
"mp-weixin" :
{
"launchtype" : "local"

18
main.js

@ -1,22 +1,4 @@
import App from './App'
// import music from '@/utils/music.js'
// // 挂载到vue实例上
// Vue.prototype.$music = music
// Vue.prototype.ScanAudio = function(src) {
// var music = null;
// if(music){
// music.destroy()
// }
// music = uni.createInnerAudioContext(); //创建播放器对象
// music.src = src;
// console.log("src",src)
// music.play(); //执行播放
// music.onEnded(() => {
// //播放结束
// music = null;
// });
// }
// #ifndef VUE3
import Vue from 'vue'

26
manifest.json

@ -7,6 +7,7 @@
"transformPx" : false,
/* 5+App */
"app-plus" : {
"runmode" : "liberate",
"usingComponents" : true,
"nvueStyleCompiler" : "uni-app",
"compilerVersion" : 3,
@ -16,6 +17,9 @@
"autoclose" : true,
"delay" : 0
},
"compatible" : {
"ignoreVersion" : true //true
},
/* */
"modules" : {
"VideoPlayer" : {}
@ -33,10 +37,14 @@
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
"<uses-permission android:name=\"android.permission.CALL_PHONE\"/>",
"<uses-permission android:name=\"android.permission.CAMERA\"/>",
"<uses-permission android:name=\"android.permission.CAPTURE_AUDIO_OUTPUT\"/>",
"<uses-permission android:name=\"android.permission.CAPTURE_SECURE_VIDEO_OUTPUT\"/>",
"<uses-permission android:name=\"android.permission.CAPTURE_VIDEO_OUTPUT\"/>",
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
"<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
"<uses-permission android:name=\"android.permission.MEDIA_CONTENT_CONTROL\"/>",
"<uses-permission android:name=\"android.permission.MODIFY_AUDIO_SETTINGS\"/>",
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
@ -89,7 +97,12 @@
}
},
"splashscreen" : {
"androidStyle" : "common"
"androidStyle" : "default",
"android" : {
"hdpi" : "C:/Users/xuhua/Desktop/画屏2/画屏/切图/bg.png",
"xhdpi" : "C:/Users/xuhua/Desktop/画屏2/画屏/切图/bg.png",
"xxhdpi" : "C:/Users/xuhua/Desktop/画屏2/画屏/切图/bg.png"
}
}
}
},
@ -115,5 +128,14 @@
"uniStatistics" : {
"enable" : false
},
"vueVersion" : "2"
"vueVersion" : "2",
"h5" : {
"router" : {
"mode" : ""
},
"devServer" : {
"port" : "",
"https" : false
}
}
}

89
pages/show/show.js

@ -6,7 +6,7 @@ let data = {
"relaase_id": "4028e3d47fd34b5d017fd34c08e60003",
"relaase_name": "fsfsdf",
"bgm_name": "res_01",
"bgm_main": "https://qiniu.aiyxlib.com/yuekan-BGM31.mp3",
"bgm_main": "yuekan-BGM31.mp3",
"release_start": "2022-03-30 00:00:00.0",
"release_end": "2022-04-24 00:00:00.0",
"show_materials": [
@ -14,10 +14,10 @@ let data = {
"release_id": "4028e3d47fd34b5d017fd34c08e60003",
"material_name": "bg-index.jpg",
"material_type": "0",
"deposit_url": "https://qiniu.aiyxlib.com/yuekan-6-shiguangji%402x.png",
"img_path": "https://qiniu.aiyxlib.com/yuekan-6-shiguangji%402x.png",
"deposit_url": "yuekan-4-content-background@2x.png",
"img_path": "yuekan-4-content-background@2x.png",
"device_direction": "1",
"duration": "2",
"duration": "4",
"effect": "animate__fadeInTopRight",
"bgm_name": "1-1",
"bgm_url": '',
@ -27,20 +27,20 @@ let data = {
"release_id": "4028e3d47fd34b5d017fd34c08e60003",
"material_name": "s-j1.png",
"material_type": "0",
"deposit_url": "https://qiniu.aiyxlib.com/yuekan-4-content-background%402x.png",
"img_path": "https://qiniu.aiyxlib.com/yuekan-4-content-background%402x.png",
"deposit_url": "yuekan-6-shiguangji@2x.png",
"img_path": "yuekan-6-shiguangji@2x.png",
"device_direction": "1",
"duration": "3",
"effect": "animate__backInLeft",
"bgm_name": '1-2',
"bgm_url": 'https://qiniu.aiyxlib.com/yuekan-BGM20-Chinap.mp3',
"bgm_url": 'yuekan-BGM27.mp3',
"ranking": "2"
},
{
"release_id": "4028e3d47fd34b5d017fd34c08e60003",
"material_name": "Atlas跑酷的成功与失败|2021【Boston Dynamics】.mp4",
"material_type": "1",
"deposit_url": "https://qiniu.aiyxlib.com/1608277325000.mp4",
"deposit_url": "1608277325000.mp4",
"img_path": "",
"device_direction": "1",
"duration": "0",
@ -55,15 +55,15 @@ let data = {
"relaase_id": "4028e3d47fcfa36c017fd0063c4d001a",
"relaase_name": "111",
"bgm_name": "res_02",
"bgm_main": "https://qiniu.aiyxlib.com/yuekan-BGM27.mp3",
"bgm_main": "yuekan-BGM31.mp3",
"release_start": "2022-03-28 00:00:00.0",
"release_end": "2022-03-28 00:00:00.0",
"show_materials": [{
"release_id": "4028e3d47fcfa36c017fd0063c4d001a",
"material_name": "s-j3.png",
"material_type": "0",
"deposit_url": "https://qiniu.aiyxlib.com/bj45_1%402x.png",
"img_path": "https://qiniu.aiyxlib.com/bj45_1%402x.png",
"deposit_url": "bj45_1@2x.png",
"img_path": "bj45_1@2x.png",
"device_direction": "1",
"duration": "3",
"effect": "animate__flip",
@ -75,8 +75,8 @@ let data = {
"release_id": "4028e3d47fcfa36c017fd0063c4d001a",
"material_name": "s-t3.png",
"material_type": "0",
"deposit_url": "https://qiniu.aiyxlib.com/yuekan-1-read.jpg",
"img_path": "https://qiniu.aiyxlib.com/yuekan-1-read.jpg",
"deposit_url": "yuekan-1-read.jpg",
"img_path": "yuekan-1-read.jpg",
"device_direction": "1",
"duration": "10",
"effect": "animate__rotateInUpRight",
@ -88,21 +88,21 @@ let data = {
"release_id": "4028e3d47fcfa36c017fd0063c4d001a",
"material_name": "s-j1.png",
"material_type": "0",
"deposit_url": "https://qiniu.aiyxlib.com/bj_15%402x.png",
"img_path": "https://qiniu.aiyxlib.com/bj_15%402x.png",
"deposit_url": "bj_15@2x.png",
"img_path": "bj_15@2x.png",
"device_direction": "1",
"duration": "5",
"effect": "animate__jackInTheBox",
"bgm_name": '2-3',
"bgm_url": 'https://qiniu.aiyxlib.com/yuekan-BGM16.mp3',
"bgm_url": 'yuekan-BGM27.mp3',
"ranking": "3"
},
{
"release_id": "4028e3d47fd34b5d017fd34c08e60003",
"material_name": "bg-index.jpg",
"material_type": "0",
"deposit_url": "https://qiniu.aiyxlib.com/yuekan-6-shiguangji%402x.png",
"img_path": "https://qiniu.aiyxlib.com/yuekan-6-shiguangji%402x.png",
"deposit_url": "yuekan-6-shiguangji@2x.png",
"img_path": "yuekan-6-shiguangji@2x.png",
"device_direction": "1",
"duration": "2",
"effect": "animate__zoomInDown",
@ -114,8 +114,8 @@ let data = {
"release_id": "4028e3d47fd34b5d017fd34c08e60003",
"material_name": "s-j1.png",
"material_type": "0",
"deposit_url": "https://qiniu.aiyxlib.com/yuekan-4-content-background%402x.png",
"img_path": "https://qiniu.aiyxlib.com/yuekan-4-content-background%402x.png",
"deposit_url": "yuekan-4-content-background@2x.png",
"img_path": "yuekan-4-content-background@2x.png",
"device_direction": "1",
"duration": "2",
"effect": "animate__slideInLeft",
@ -127,7 +127,7 @@ let data = {
"release_id": "4028e3d47fcfa36c017fd0063c4d001a",
"material_name": "Atlas跑酷的成功与失败|2021【Boston Dynamics】.mp4",
"material_type": "1",
"deposit_url": "https://qiniu.aiyxlib.com/1634285181000.mp4",
"deposit_url": "1608277325000.mp4",
"img_path": "",
"device_direction": "1",
"duration": "0",
@ -140,13 +140,13 @@ let data = {
"release_id": "4028e3d47fcfa36c017fd0063c4d001a",
"material_name": "s-j1.png",
"material_type": "0",
"deposit_url": "https://qiniu.aiyxlib.com/bj_15%402x.png",
"img_path": "https://qiniu.aiyxlib.com/bj_15%402x.png",
"deposit_url": "bj_15@2x.png",
"img_path": "bj_15@2x.png",
"device_direction": "1",
"duration": "5",
"effect": "animate__jackInTheBox",
"bgm_name": '2-3',
"bgm_url": 'https://qiniu.aiyxlib.com/yuekan-BGM16.mp3',
"bgm_name": '2-7',
"bgm_url": 'yuekan-BGM27.mp3',
"ranking": "3"
}
]
@ -155,29 +155,17 @@ let data = {
"relaase_id": "4028e3d47fd34b5d017fd34c08e60003",
"relaase_name": "fsfsdf",
"bgm_name": "res_03",
"bgm_main": "https://qiniu.aiyxlib.com/yuekan-BGM19.mp3",
"bgm_main": "yuekan-BGM31.mp3",
"release_start": "2022-03-30 00:00:00.0",
"release_end": "2022-04-24 00:00:00.0",
"show_materials": [
{
"release_id": "4028e3d47fd34b5d017fd34c08e60003",
"material_name": "Atlas跑酷的成功与失败|2021【Boston Dynamics】.mp4",
"material_type": "1",
"deposit_url": "https://qiniu.aiyxlib.com/1608277325000.mp4",
"img_path": "",
"device_direction": "1",
"duration": "0",
"effect": "false",
"bgm_name": null,
"bgm_url": null,
"ranking": "4"
},
{
"release_id": "4028e3d47fd34b5d017fd34c08e60003",
"material_name": "bg-index.jpg",
"material_type": "0",
"deposit_url": "https://qiniu.aiyxlib.com/yuekan-6-shiguangji%402x.png",
"img_path": "https://qiniu.aiyxlib.com/yuekan-6-shiguangji%402x.png",
"deposit_url": "yuekan-6-shiguangji@2x.png",
"img_path": "yuekan-6-shiguangji@2x.png",
"device_direction": "1",
"duration": "6",
"effect": "animate__fadeInTopRight",
@ -189,14 +177,27 @@ let data = {
"release_id": "4028e3d47fd34b5d017fd34c08e60003",
"material_name": "s-j1.png",
"material_type": "0",
"deposit_url": "https://qiniu.aiyxlib.com/bj_15%402x.png",
"img_path": "https://qiniu.aiyxlib.com/bj_15%402x.png",
"deposit_url": "bj45_1@2x.png",
"img_path": "bj45_1@2x.png",
"device_direction": "1",
"duration": "3",
"effect": "animate__backInLeft",
"bgm_name": '3-2',
"bgm_url": 'https://qiniu.aiyxlib.com/yuekan-BGM20-Chinap.mp3',
"bgm_url": 'yuekan-BGM27.mp3',
"ranking": "2"
},
{
"release_id": "4028e3d47fd34b5d017fd34c08e60003",
"material_name": "Atlas跑酷的成功与失败|2021【Boston Dynamics】.mp4",
"material_type": "1",
"deposit_url": "1608277325000.mp4",
"img_path": "",
"device_direction": "1",
"duration": "0",
"effect": "false",
"bgm_name": null,
"bgm_url": null,
"ranking": "4"
}
]
},

264
pages/show/show.vue

@ -1,13 +1,31 @@
<template>
<view class="main_container">
<view class="show-content">
<view class="show-content" @touchstart="touchStart" @touchend="touchEnd">
<view v-for="(item, index) in show_materials" :key="index" :class="['show-item', item.material_type == 1 && itemIndex == index ? 'show-video' : '']">
<image :class="['show-img','animate__animated', item.material_type == 0 ? item.effect : '']" v-show="item.material_type == 0 && itemIndex == index" :src="linkUrl"></image>
<video v-if="item.material_type == 1 && itemIndex == index" :src="linkUrl" :autoplay="autoplay" controls object-fit="fill" @ended="videoPlayEnd"></video>
<!-- <image
:class="['show-img', 'animate__animated', item.material_type == 0 ? item.effect : '']"
v-show="item.material_type == 0 && itemIndex == index"
:src="require('@/static/source/' + linkUrl)"
></image> -->
<image
:class="['show-img', 'animate__animated', item.material_type == 0 ? item.effect : '']"
v-show="item.material_type == 0 && itemIndex == index"
:src="linkUrl"
mode="aspectFill"
></image>
<!-- <video
v-if="item.material_type == 1 && itemIndex == index"
:src="'../../static/source/' + linkUrl"
:autoplay="autoplay"
controls
object-fit="fill"
@ended="videoPlayEnd"
></video> -->
<video v-if="item.material_type == 1 && itemIndex == index" :src="linkUrl" :autoplay="autoplay" :controls="false" object-fit="fill" @ended="videoPlayEnd"></video>
</view>
</view>
</view>fill
<view class="show-audio"></view>
<view style="position:absolute; bottom: 6.94rpx; color: #fff; z-index: 99999;">{{ audioName }}</view>
<view style="position:absolute; bottom:55.55rpx; left: 69.44rpx; color: #fff; z-index: 99999;">{{ infoTxt }}----{{ audioName }}</view>
<!-- <view v-if="!deviceInfoShow" class="local-data">
<text class="title">欢迎使用数字新视窗</text>
@ -20,14 +38,8 @@
</template>
<script>
// https://qiniu.aiyxlib.com/1608277325000.mp4
// https://qiniu.aiyxlib.com/1634285181000.mp4
// https://qiniu.aiyxlib.com/yuekan-BGM19.mp3
// https://qiniu.aiyxlib.com/yuekan-BGM31.mp3
// https://qiniu.aiyxlib.com/yuekan-BGM27.mp3
// https://qiniu.aiyxlib.com/yuekan-BGM41-f.mp3
import utils from '@/utils/common.js';
import one from './show.js';
import one from './show2.js';
let innerAudioContext = uni.createInnerAudioContext();
export default {
components: {},
@ -47,154 +59,152 @@ export default {
duration: null,
audioSrc: null,
audioName: null,
itemLength: []
itemLength: [],
flagIndex: 0,
infoTxt: '',
//
startTime: 0,
//
startPosition: 0,
//
endPosition: 0
};
},
onLoad() {
const _this = this;
let result = one.data.data;
this.materialsCont = result;
console.log(this.materialsCont.length);
this.materialsCont.map(item => {
this.itemLength = this.itemLength.concat(item.show_materials.length);
this.show_materials = this.show_materials.concat(item.show_materials);
});
console.log(this.itemLength);
//
this.linkUrl = this.show_materials[this.itemIndex].deposit_url;
this.duration = this.show_materials[this.itemIndex].duration;
if (this.show_materials[this.itemIndex].material_type != 1) {
if (this.show_materials[this.itemIndex].bgm_url) {
this.audioSrc = this.show_materials[this.itemIndex].bgm_url;
this.audioName = this.show_materials[this.itemIndex].bgm_name;
} else {
if (this.materialsCont[this.contentIndex].bgm_main) {
this.audioSrc = this.materialsCont[this.contentIndex].bgm_main;
this.audioName = this.materialsCont[this.contentIndex].bgm_name;
}
}
this.playVoice(this.audioSrc)
}else{
innerAudioContext.stop()
}
this.changIndex();
},
created() {
this.atuo();
},
mounted() {
// this.countdown();
this.changeImg();
this.changeMaterial();
},
methods: {
playVoice(src) {
if(innerAudioContext != undefined){
innerAudioContext.stop()
touchStart(event) {
//
this.startTime = Date.now();
//
this.startPosition = event.changedTouches[0].clientX;
},
touchEnd(event) {
const endTime = Date.now();
if (endTime - this.startTime > 2000) {
// 2s
return;
}
innerAudioContext = uni.createInnerAudioContext()
innerAudioContext.stop();
innerAudioContext.src = src;
innerAudioContext.autoplay = true;
innerAudioContext.onPlay(() => {
console.log('开始播放');
});
innerAudioContext.onError(res => {
console.log(res.errMsg);
console.log(res.errCode);
innerAudioContext.stop()
});
innerAudioContext.onPause(() => {//
console.log('暂停');
innerAudioContext.stop()
});
innerAudioContext.onEnded(() => {// isPause
console.log('音频自然播放结束事件');
innerAudioContext.stop()
});
// 10
if (Math.abs(this.endPosition - this.startPosition) > 10) {
this.endPosition = event.changedTouches[0].clientX;
var elePosition = this.endPosition - this.startPosition > 0 ? 'right' : 'left';
} else {
return;
}
if(elePosition=='left'){
this.itemIndex++
this.flagIndex++
}else{
this.itemIndex--
this.flagIndex--
if(this.itemIndex == -1 || this.flagIndex == -1){
this.itemIndex = this.show_materials.length-1;
}
}
this.changIndex();
console.log(elePosition);
},
changeImg() {
changeMaterial() {
const _this = this;
clearInterval(_this.timer);
_this.timer = setInterval(() => {
_this.duration -= 1;
if (_this.duration == 0) {
_this.itemIndex++;
if (_this.itemIndex == this.show_materials.length) {
// clearInterval(_this.timer);
this.itemIndex = 0
this.contentIndex = 0
_this.duration = this.show_materials[this.itemIndex].duration;
_this.linkUrl = this.show_materials[this.itemIndex].deposit_url;
if (this.show_materials[this.itemIndex].material_type != 1) {
if (this.show_materials[this.itemIndex].bgm_url) {
_this.audioSrc = this.show_materials[this.itemIndex].bgm_url;
_this.audioName = this.show_materials[this.itemIndex].bgm_name;
} else {
if (this.materialsCont[this.contentIndex].bgm_main) {
this.audioSrc = this.materialsCont[this.contentIndex].bgm_main;
this.audioName = this.materialsCont[this.contentIndex].bgm_name;
}
}
this.playVoice(this.audioSrc)
}else{
innerAudioContext.stop()
}
} else {
_this.duration = this.show_materials[this.itemIndex].duration;
_this.linkUrl = this.show_materials[this.itemIndex].deposit_url;
if (this.show_materials[this.itemIndex].material_type != 1) {
if (this.show_materials[this.itemIndex].bgm_url) {
_this.audioSrc = this.show_materials[this.itemIndex].bgm_url;
_this.audioName = this.show_materials[this.itemIndex].bgm_name;
} else {
const result = this.itemLength.some(item => {
return this.itemIndex == item;
});
console.log('result',result)
if (result) {
this.contentIndex++;
}
if (this.materialsCont[this.contentIndex].bgm_main) {
this.audioSrc = this.materialsCont[this.contentIndex].bgm_main;
this.audioName = this.materialsCont[this.contentIndex].bgm_name;
}
}
this.playVoice(this.audioSrc)
}else{
innerAudioContext.stop()
}
}
_this.flagIndex++;
this.changIndex();
}
}, 1000);
},
videoPlayEnd() {
this.itemIndex = this.itemIndex + 1;
if (this.itemIndex == this.show_materials.length) {
// clearInterval(this.timer);
this.itemIndex = -1
innerAudioContext.stop()
changIndex() {
const _this = this;
if (_this.itemIndex == this.show_materials.length) {
// clearInterval(_this.timer);
this.itemIndex = 0;
this.flagIndex = 0;
this.contentIndex = 0;
innerAudioContext.stop();
}
_this.duration = this.show_materials[this.itemIndex].duration;
_this.linkUrl = this.show_materials[this.itemIndex].deposit_url;
if (this.show_materials[this.itemIndex].bgm_url) {
// _this.audioSrc = '../../static/source/' + this.show_materials[this.itemIndex].bgm_url;
_this.audioSrc = this.show_materials[this.itemIndex].bgm_url;
_this.audioName = this.show_materials[this.itemIndex].bgm_name;
} else {
this.duration = this.show_materials[this.itemIndex].duration;
this.linkUrl = this.show_materials[this.itemIndex].deposit_url;
if (this.show_materials[this.itemIndex].material_type != 1) {
if (this.show_materials[this.itemIndex].bgm_url) {
this.audioSrc = this.show_materials[this.itemIndex].bgm_url;
this.audioName = this.show_materials[this.itemIndex].bgm_name;
} else {
const result = this.itemLength.some(item => {
return this.itemIndex == item;
});
if (result) {
this.contentIndex++;
}
if (this.materialsCont[this.contentIndex].bgm_main) {
this.audioSrc = this.materialsCont[this.contentIndex].bgm_main;
this.audioName = this.materialsCont[this.contentIndex].bgm_name;
}
if (this.contentIndex == this.itemLength.length) {
this.flagIndex = 0;
this.contentIndex = 0;
} else {
if (this.flagIndex == this.itemLength[this.contentIndex]) {
this.flagIndex = 0;
this.contentIndex++;
}
this.playVoice(this.audioSrc)
}else{
innerAudioContext.stop()
}
if (this.materialsCont[this.contentIndex].bgm_main) {
// this.audioSrc = '../../static/source/' + this.materialsCont[this.contentIndex].bgm_main;
this.audioSrc = this.materialsCont[this.contentIndex].bgm_main;
this.audioName = this.materialsCont[this.contentIndex].bgm_name;
}
}
this.playVoice(this.audioSrc);
if (this.show_materials[this.itemIndex].material_type == 1) {
innerAudioContext.stop();
}
},
videoPlayEnd() {
this.itemIndex++;
this.flagIndex++;
this.changIndex();
},
playVoice(src) {
if (innerAudioContext != undefined) {
innerAudioContext.stop();
}
innerAudioContext = uni.createInnerAudioContext();
innerAudioContext.stop();
innerAudioContext.src = src;
innerAudioContext.autoplay = true;
innerAudioContext.onPlay(() => {
this.infoTxt = '';
this.infoTxt = '开始播放';
console.log('开始播放');
});
innerAudioContext.onError(res => {
console.log(res.errMsg);
console.log(res.errCode);
innerAudioContext.stop();
});
innerAudioContext.onPause(() => {
//
this.infoTxt = '暂停';
console.log('暂停');
// innerAudioContext.stop();
});
innerAudioContext.onEnded(() => {
// isPause
this.infoTxt = '音频自然播放结束事件';
console.log('音频自然播放结束事件');
innerAudioContext.stop();
});
},
atuo() {
this.autoplay = true;

BIN
unpackage/cache/apk/__UNI__487D0A3_cm.apk

2
unpackage/cache/apk/apkurl

@ -1 +1 @@
https://ide.dcloud.net.cn/build/download/60feb080-b719-11ec-9ecd-6b58dc11063a
https://ide.dcloud.net.cn/build/download/6e254010-b979-11ec-8bee-47dfbe383b6d

2
unpackage/cache/apk/cmManifestCache.json
File diff suppressed because it is too large
View File

BIN
unpackage/release/apk/__UNI__487D0A3__20220314084851.apk

BIN
unpackage/release/apk/__UNI__487D0A3__20220408162047.apk

BIN
unpackage/release/apk/__UNI__487D0A3__20220408165337.apk

BIN
unpackage/res/icons/1024x1024.png

Before

Width: 1024  |  Height: 1024  |  Size: 332 KiB

After

Width: 1024  |  Height: 1024  |  Size: 142 KiB

BIN
unpackage/res/icons/120x120.png

Before

Width: 120  |  Height: 120  |  Size: 6.0 KiB

After

Width: 120  |  Height: 120  |  Size: 9.4 KiB

BIN
unpackage/res/icons/144x144.png

Before

Width: 144  |  Height: 144  |  Size: 7.9 KiB

After

Width: 144  |  Height: 144  |  Size: 12 KiB

BIN
unpackage/res/icons/152x152.png

Before

Width: 152  |  Height: 152  |  Size: 8.7 KiB

After

Width: 152  |  Height: 152  |  Size: 12 KiB

BIN
unpackage/res/icons/167x167.png

Before

Width: 167  |  Height: 167  |  Size: 10 KiB

After

Width: 167  |  Height: 167  |  Size: 13 KiB

BIN
unpackage/res/icons/180x180.png

Before

Width: 180  |  Height: 180  |  Size: 11 KiB

After

Width: 180  |  Height: 180  |  Size: 15 KiB

BIN
unpackage/res/icons/192x192.png

Before

Width: 192  |  Height: 192  |  Size: 12 KiB

After

Width: 192  |  Height: 192  |  Size: 16 KiB

BIN
unpackage/res/icons/20x20.png

Before

Width: 20  |  Height: 20  |  Size: 1.6 KiB

After

Width: 20  |  Height: 20  |  Size: 1.5 KiB

BIN
unpackage/res/icons/29x29.png

Before

Width: 29  |  Height: 29  |  Size: 1.8 KiB

After

Width: 29  |  Height: 29  |  Size: 2.2 KiB

BIN
unpackage/res/icons/40x40.png

Before

Width: 40  |  Height: 40  |  Size: 2.1 KiB

After

Width: 40  |  Height: 40  |  Size: 2.9 KiB

BIN
unpackage/res/icons/58x58.png

Before

Width: 58  |  Height: 58  |  Size: 2.7 KiB

After

Width: 58  |  Height: 58  |  Size: 4.5 KiB

BIN
unpackage/res/icons/60x60.png

Before

Width: 60  |  Height: 60  |  Size: 2.7 KiB

After

Width: 60  |  Height: 60  |  Size: 4.5 KiB

BIN
unpackage/res/icons/72x72.png

Before

Width: 72  |  Height: 72  |  Size: 3.3 KiB

After

Width: 72  |  Height: 72  |  Size: 5.4 KiB

BIN
unpackage/res/icons/76x76.png

Before

Width: 76  |  Height: 76  |  Size: 3.4 KiB

After

Width: 76  |  Height: 76  |  Size: 5.5 KiB

BIN
unpackage/res/icons/80x80.png

Before

Width: 80  |  Height: 80  |  Size: 3.7 KiB

After

Width: 80  |  Height: 80  |  Size: 5.8 KiB

BIN
unpackage/res/icons/87x87.png

Before

Width: 87  |  Height: 87  |  Size: 3.9 KiB

After

Width: 87  |  Height: 87  |  Size: 6.7 KiB

BIN
unpackage/res/icons/96x96.png

Before

Width: 96  |  Height: 96  |  Size: 4.4 KiB

After

Width: 96  |  Height: 96  |  Size: 7.3 KiB

48
utils/music.js

@ -1,26 +1,26 @@
const bgm = uni.createInnerAudioContext();
bgm.src = 'https://qiniu.aiyxlib.com/yuekan-BGM20-Chinap.mp3'
bgm.loop = true;
// const bgm = uni.createInnerAudioContext();
// bgm.src = 'https://qiniu.aiyxlib.com/yuekan-BGM20-Chinap.mp3'
// bgm.loop = true;
var music = {
//mute 表示是否是静音,,默认不静音
playBgm({mute=false}){
if (!bgm) return;
if(mute){
bgm.pause()
}else{
bgm.play()
}
bgm.onPause(()=>{
console.log('暂停背景音乐');
})
bgm.onPlay(() => {
console.log('开始播放音乐#######');
})
bgm.onError((res) => {
console.log(res)
})
}
}
module.exports = music
// var music = {
// //mute 表示是否是静音,,默认不静音
// playBgm({mute=false}){
// if (!bgm) return;
// if(mute){
// bgm.pause()
// }else{
// bgm.play()
// }
// bgm.onPause(()=>{
// console.log('暂停背景音乐');
// })
// bgm.onPlay(() => {
// console.log('开始播放音乐#######');
// })
// bgm.onError((res) => {
// console.log(res)
// })
// }
// }
// module.exports = music
Loading…
Cancel
Save