提交 704d64d0 编写于 作者: DCloud-yyl's avatar DCloud-yyl

Merge branch 'alpha'

# Conflicts:
#	changelog.md
#	manifest.json
#	package.json
#	pages.json
#	pages/API/choose-location/choose-location.uvue
#	pages/API/compress-image/compress-image.uvue
#	pages/API/compress-video/compress-video.test.js
#	pages/API/compress-video/compress-video.uvue
#	pages/API/create-inner-audio-context/inner-audio.test.js
#	pages/API/download-file/download-file.uvue
#	pages/API/get-video-info/get-video-info.uvue
#	pages/API/inner-audio/inner-audio.uvue
#	pages/API/navigator/navigator.uvue
#	pages/API/open-location/open-location.uvue
#	pages/API/pull-down-refresh/pull-down-refresh.test.js
#	pages/API/request/request.test.js
#	pages/API/request/request.uvue
#	pages/API/show-modal/show-modal.test.js
#	pages/API/unicloud/unicloud/database.test.js
#	pages/API/upload-file/upload-file.uvue
#	pages/CSS/overflow/overflow-visible-event.uvue
#	pages/CSS/transform/scale.uvue
#	pages/component/canvas/canvas.test.js
#	pages/component/canvas/canvas.uvue
#	pages/component/checkbox/checkbox.uvue
#	pages/component/editor/editor.test.js
#	pages/component/general-event/general-event.test.js
#	pages/component/general-event/general-event.uvue
#	pages/component/image/image.test.js
#	pages/component/input/input.test.js
#	pages/component/input/input.uvue
#	pages/component/list-view/list-view-children-in-slot.test.js
#	pages/component/list-view/list-view-refresh.test.js
#	pages/component/list-view/list-view.test.js
#	pages/component/list-view/list-view.uvue
#	pages/component/map/map.test.js
#	pages/component/map/map.uvue
#	pages/component/radio/radio.uvue
#	pages/component/scroll-view/scroll-view-refresher.test.js
#	pages/component/scroll-view/scroll-view.test.js
#	pages/component/scroll-view/scroll-view.uvue
#	pages/component/swiper/swiper.test.js
#	pages/component/swiper/swiper.uvue
#	pages/component/textarea/textarea.uvue
#	pages/component/video/video.test.js
#	pages/component/video/video.uvue
#	pages/component/web-view-local/web-view-local.test.js
#	pages/component/web-view-local/web-view-local.uvue
#	pages/component/web-view/web-view.test.js
#	pages/component/web-view/web-view.uvue
#	pages/pages.test.js
#	pages/tabBar/API.uvue
#	pages/tabBar/CSS.uvue
#	pages/tabBar/component.uvue
#	pages/tabBar/template.uvue
#	pages/template/browser-canvas/browser-canvas.uvue
#	pages/template/slider-100/slider-100.uvue
#	readme.md
#	testSequencer.js
...@@ -20,9 +20,17 @@ ...@@ -20,9 +20,17 @@
myMap: new Map<string, any>(), myMap: new Map<string, any>(),
func: () : string => { func: () : string => {
return 'globalData func' return 'globalData func'
} },
launchOptions: {
path: '',
} as OnLaunchOptions,
onShowOption: {
path: ''
} as OnShowOptions
}, },
onLaunch: function () { onLaunch: function (res : OnLaunchOptions) {
this.globalData.launchOptions = res
// 自动化测试 // 自动化测试
setLifeCycleNum(state.lifeCycleNum + 1000) setLifeCycleNum(state.lifeCycleNum + 1000)
console.log('App Launch') console.log('App Launch')
...@@ -37,16 +45,57 @@ ...@@ -37,16 +45,57 @@
// observer1.observe({ // observer1.observe({
// entryTypes: ['render', 'navigation'], // entryTypes: ['render', 'navigation'],
// } as PerformanceObserverOptions) // } as PerformanceObserverOptions)
// 统计上报 - 应用启动
// uni.report({
// name: 'uni-app-launch',
// options: res,
// success(res_data) {
// console.log(res_data);
// }, fail(err_data) {
// console.log(err_data);
// }
// })
}, },
onShow: function () { onShow: function (res : OnShowOptions) {
this.globalData.onShowOption = res
// 处理scheme或通用链接直达
let url = this.getRedirectUrl(res.appScheme, res.appLink);
if (null != url) {
uni.navigateTo({
url: url
})
}
// 自动化测试 // 自动化测试
setLifeCycleNum(state.lifeCycleNum + 100) setLifeCycleNum(state.lifeCycleNum + 100)
console.log('App Show') console.log('App Show')
// 统计上报 - 应用显示
// uni.report({
// name: 'uni-app-show',
// success(res_data) {
// console.log(res_data);
// }, fail(err_data) {
// console.log(err_data);
// }
// })
}, },
onHide: function () { onHide: function () {
// 自动化测试 // 自动化测试
setLifeCycleNum(state.lifeCycleNum - 100) setLifeCycleNum(state.lifeCycleNum - 100)
console.log('App Hide') console.log('App Hide')
// 统计上报 - 应用进入后台
// uni.report({
// name: 'uni-app-hide',
// success(res) {
// console.log(res);
// }, fail(err) {
// console.log(err);
// }
// })
}, },
// #ifdef APP-ANDROID // #ifdef APP-ANDROID
onLastPageBackPress: function () { onLastPageBackPress: function () {
...@@ -70,11 +119,56 @@ ...@@ -70,11 +119,56 @@
onExit() { onExit() {
console.log('App Exit') console.log('App Exit')
}, },
// onError(err : any) {
// // 统计上报 - 应用发生错误
// uni.report({
// name: 'uni-app-error',
// options: err,
// success(res) {
// console.log(res);
// }, fail(err) {
// console.log(err);
// }
// })
// },
// #endif // #endif
methods: { methods: {
increasetLifeCycleNum() { increasetLifeCycleNum() {
setLifeCycleNum(state.lifeCycleNum + 100) setLifeCycleNum(state.lifeCycleNum + 100)
console.log('App increasetLifeCycleNum') console.log('App increasetLifeCycleNum')
},
getRedirectUrl(scheme : string | null, ulink : string | null) : string | null {
//解析scheme或universal link启动直达页面:
//scheme格式:uniappx://redirect/pages/component/view/view?key=value //其中redirect后为页面路径
//universal link格式:https://uniappx.dcloud.net.cn/ulink/redirect.html?url=%2Fpages%2Fcomponent%2Fview%2Fview%3Fkey%3Dvalue //通用链接路径需固定,?后面的url参数为直达页面路径,注意url字段值需做url编码(可使用encodeURIComponent方法)
let url : string | null = null;
if (null != scheme && scheme.length > 0) {
const PATHPRE = 'redirect';
let parts : string | null = null;
let pos = scheme.search('//');
if (pos > 0) {
parts = scheme.substring(pos + 2);
}
if (null != parts && parts.startsWith(PATHPRE)) {
url = parts.substring(PATHPRE.length);
}
} else if (null != ulink && ulink.length > 0) {
const PATH = 'ulink/redirect.html';
let parts = ulink.split('?');
if (parts.length > 1 && parts[0].endsWith(PATH) && parts[1].length > 0) {
parts[1].split('&').forEach((e) => {
let params = e.split('=');
if (params.length > 1 && params[0].length > 0 && params[1].length > 0) {
if ('url' == params[0]) {
if (null == url) {
url = decodeURIComponent(params[1]);
}
}
}
});
}
}
return url;
} }
} }
} }
...@@ -83,4 +177,15 @@ ...@@ -83,4 +177,15 @@
<style> <style>
/*每个页面公共css */ /*每个页面公共css */
@import "./common/uni.css"; @import "./common/uni.css";
/* #ifdef WEB */
.uni-top-window uni-tabbar .uni-tabbar {
background-color: #fff !important;
}
.uni-app--showleftwindow .uni-page-head-btn {
display: none !important;
}
/* #endif */
</style> </style>
## 1.0.16 ## 1.0.31
* update 4.24.2024072208 * update 4.28.2024092105-alpha
## 1.0.15 ## 1.0.30
* update 4.23.2024070804 * update 4.27.2024091308-alpha
## 1.0.27 ## 1.0.29
* update 4.23.2024070309-alpha * update 4.26.2024082213-alpha
## 1.0.25 ## 1.0.28
* update 4.22.2024062415-alpha * update 4.25.2024081703-alpha
## 1.0.24
* update 4.21.2024061818-alpha
## 1.0.23
* update 4.19.2024060704-alpha
## 1.0.22
* update 4.18.2024060311-alpha
## 1.0.21
* update 4.17.2024051110-alpha
## 1.0.20
* update 4.16.2024051009-alpha
## 1.0.19
* update 4.14.2024042905-alpha
## 1.0.18
* update 4.13.2024042321-alpha
## 1.0.17
* update 4.12.2024041009-alpha
## 1.0.11 ## 1.0.11
* update 4.01.2024020211-alpha * update 4.01.2024020211-alpha
......
...@@ -123,7 +123,7 @@ ...@@ -123,7 +123,7 @@
.uni-bg-blue { .uni-bg-blue {
background: #007AFF; background: #007AFF;
} }
.uni-btn-v { .uni-btn-v {
padding: 5px 0; padding: 5px 0;
...@@ -189,7 +189,7 @@ ...@@ -189,7 +189,7 @@
} }
.text-disabled { .text-disabled {
color: #a0a0a0; color: #a0a0a0!important;
} }
...@@ -244,6 +244,11 @@ ...@@ -244,6 +244,11 @@
color: #000000; color: #000000;
font-size: 14px; font-size: 14px;
font-weight: normal; font-weight: normal;
}
/* left-windows */
.left-win-active {
color: #007AFF!important;
} }
/* --tab-bar-end-- */ /* --tab-bar-end-- */
......
...@@ -6,6 +6,8 @@ ...@@ -6,6 +6,8 @@
<button class="button" @click="customStyle">{{ !hasCustomedStyle ? '自定义Tab样式' : '移除自定义样式'}}</button> <button class="button" @click="customStyle">{{ !hasCustomedStyle ? '自定义Tab样式' : '移除自定义样式'}}</button>
<button class="button" @click="customItem">{{ !hasCustomedItem ? '自定义Tab信息' : '移除自定义信息' }}</button> <button class="button" @click="customItem">{{ !hasCustomedItem ? '自定义Tab信息' : '移除自定义信息' }}</button>
<button class="button" @click="hideTabBar">{{ !hasHiddenTabBar ? '隐藏TabBar' : '显示TabBar' }}</button> <button class="button" @click="hideTabBar">{{ !hasHiddenTabBar ? '隐藏TabBar' : '显示TabBar' }}</button>
<button class="button" @click="hideTabBarItem">{{ !hasHiddenTabBarItem ? '隐藏接口Item' : '显示接口Item' }}</button>
<button class="button" @click="setTabBarTitle">{{ !hasSetLongTitle ? '自定义超长标题' : '移除自定义信息' }}</button>
<view class="btn-area"> <view class="btn-area">
<!-- <button class="button" type="primary" @click="navigateBack">关闭</button> --> <!-- <button class="button" type="primary" @click="navigateBack">关闭</button> -->
</view> </view>
...@@ -21,7 +23,9 @@ ...@@ -21,7 +23,9 @@
hasShownTabBarRedDot: false, hasShownTabBarRedDot: false,
hasCustomedStyle: false, hasCustomedStyle: false,
hasCustomedItem: false, hasCustomedItem: false,
hasHiddenTabBar: false hasHiddenTabBar: false,
hasHiddenTabBarItem: false,
hasSetLongTitle: false,
} }
}, },
destroyed() { destroyed() {
...@@ -56,8 +60,58 @@ ...@@ -56,8 +60,58 @@
} as SetTabBarItemOptions } as SetTabBarItemOptions
uni.setTabBarItem(tabBarOptions) uni.setTabBarItem(tabBarOptions)
} }
if (this.hasHiddenTabBarItem || this.hasSetLongTitle) {
let tabBarOptions = {
visible: true,
index: 1,
text: '接口',
iconPath: '/static/api.png',
selectedIconPath: '/static/apiHL.png'
} as SetTabBarItemOptions
uni.setTabBarItem(tabBarOptions)
}
}, },
methods: { methods: {
setTabBarTitle(){
let tabBarOptions = {
visible: true,
index: 1,
text: '接口',
iconPath: '/static/api.png',
selectedIconPath: '/static/apiHL.png'
} as SetTabBarItemOptions
if (!this.hasSetLongTitle) {
tabBarOptions.text = "超长标题内容超长标题内容超长标题内容超长标题测试";
tabBarOptions.iconPath = "";
tabBarOptions.selectedIconPath = "";
} else {
tabBarOptions.text = "接口";
tabBarOptions.iconPath = "/static/api.png";
tabBarOptions.selectedIconPath = "/static/apiHL.png";
}
uni.setTabBarItem(tabBarOptions)
this.hasSetLongTitle = !this.hasSetLongTitle
},
hideTabBarItem(){
let tabBarOptions = {
visible: true,
index: 1,
text: '接口',
iconPath: '/static/api.png',
selectedIconPath: '/static/apiHL.png'
} as SetTabBarItemOptions
if (!this.hasHiddenTabBarItem) {
tabBarOptions.visible = false;
} else {
tabBarOptions.visible = true;
}
uni.setTabBarItem(tabBarOptions)
this.hasHiddenTabBarItem = !this.hasHiddenTabBarItem
},
navigateBack() { navigateBack() {
this.$emit('unmount') this.$emit('unmount')
}, },
......
...@@ -35,6 +35,7 @@ ...@@ -35,6 +35,7 @@
<button class="btn" type="button" data-action="reLaunch">reLaunch</button> <button class="btn" type="button" data-action="reLaunch">reLaunch</button>
<button class="btn" type="button" data-action="switchTab">switchTab</button> <button class="btn" type="button" data-action="switchTab">switchTab</button>
<button class="btn" type="button" data-action="getEnv">getEnv</button> <button class="btn" type="button" data-action="getEnv">getEnv</button>
<!-- <button class="btn" type="button" data-action="getTheme">获取主题</button> -->
</div> </div>
<p class="desc">网页向应用发送消息。注意:小程序端应用会在此页面后退时接收到消息。</p> <p class="desc">网页向应用发送消息。注意:小程序端应用会在此页面后退时接收到消息。</p>
<div class="btn-list"> <div class="btn-list">
...@@ -88,6 +89,9 @@ ...@@ -88,6 +89,9 @@
}) })
}); });
break; break;
/* case 'getTheme':
alert(getThemePreference())
break; */
default: default:
uni.webView[action]({ uni.webView[action]({
url: '/pages/component/button/button' url: '/pages/component/button/button'
...@@ -108,6 +112,15 @@ ...@@ -108,6 +112,15 @@
} }
}) })
}) })
/* function getThemePreference() {
if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) {
return 'dark';
} else if (window.matchMedia && window.matchMedia('(prefers-color-scheme: light)').matches) {
return 'light';
}
return 'unknown';
} */
</script> </script>
</body> </body>
</html> </html>
// 仅测试 console.log 时机问题 // 仅测试 console.log 时机问题
import './test-main-console.uts' import './test-main-console.uts'
import App from './App.uvue' import App from './App.uvue'
import { createSSRApp } from 'vue' import { createSSRApp } from 'vue'
export function createApp() { export function createApp() {
const app = createSSRApp(App) const app = createSSRApp(App)
// app.mixin({ // app.mixin({
// onReady() { // onReady() {
// setTimeout(() => { // setTimeout(() => {
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
"name": "Hello uni-app x", "name": "Hello uni-app x",
"appid": "__UNI__HelloUniAppX", "appid": "__UNI__HelloUniAppX",
"description": "", "description": "",
"versionName": "1.4", "versionName": "1.5",
"versionCode": 10400, "versionCode": 10500,
"uni-app-x": {}, "uni-app-x": {},
/* 快应用特有相关 */ /* 快应用特有相关 */
"quickapp": {}, "quickapp": {},
...@@ -41,6 +41,10 @@ ...@@ -41,6 +41,10 @@
} }
} }
}, },
"uni-getLocation":{
"system":{},
"tencent":{}
},
"uni-ad": { "uni-ad": {
"gdt": {} "gdt": {}
} }
...@@ -64,7 +68,7 @@ ...@@ -64,7 +68,7 @@
"sdkConfigs" : { "sdkConfigs" : {
"maps" : { "maps" : {
"qqmap" : { "qqmap" : {
"key" : "TKUBZ-D24AF-GJ4JY-JDVM2-IBYKK-KEBCU" "key" : ""
} }
} }
} }
......
此差异已折叠。
const PAGE_PATH = '/pages/API/animation-frame/animation-frame'
describe('API-cancelAnimationFrame', () => {
let page
beforeAll(async () => {
page = await program.reLaunch(PAGE_PATH)
await page.waitFor(600);
});
it('cancelAnimationFrame', async () => {
await page.callMethod('startRequestAnimationFrame')
await page.waitFor(100)
const data1 = await page.data()
expect(data1.testFrameCount > 0).toBe(true)
await page.callMethod('stopRequestAnimationFrame')
await page.waitFor(100)
const data2 = await page.data()
const testFrameCount = data2.testFrameCount
await page.waitFor(100)
const data3 = await page.data()
expect(data3.testFrameCount).toBe(testFrameCount)
});
});
<template>
<view class="page">
<page-head :title="title"></page-head>
<button @click="startRequestAnimationFrame">requestAnimationFrame</button>
<button @click="stopRequestAnimationFrame">cancelAnimationFrame</button>
<text class="frame-count">FPS: {{FPSString}}</text>
<text class="frame-count">FrameCount: {{testFrameCount}}</text>
<text class="tips">提示: 在当前测试例子中,每增加一次调用 requestAnimationFrame 帧率翻倍,cancelAnimationFrame 后恢复</text>
</view>
</template>
<script>
export default {
data() {
return {
title: 'AnimationFrame',
taskId: 0,
FPSString: '- / -ms',
lastTime: 0,
frameCount: 0,
testFrameCount: 0
}
},
onUnload() {
if (this.taskId > 0) {
this.stopRequestAnimationFrame()
}
},
methods: {
startRequestAnimationFrame() {
this.taskId = requestAnimationFrame((timestamp : number) => {
this.updateFPS(timestamp)
this.testFrameCount++
this.startRequestAnimationFrame()
})
},
stopRequestAnimationFrame() {
cancelAnimationFrame(this.taskId)
this.lastTime = 0
this.frameCount = 0
this.FPSString = '- / -ms'
},
updateFPS(timestamp : number) {
this.frameCount++
if (timestamp - this.lastTime >= 1000) {
const timeOfFrame = (1000 / this.frameCount)
this.FPSString = `${this.frameCount} / ${timeOfFrame.toFixed(3)}ms`
this.frameCount = 0
this.lastTime = timestamp
}
}
}
}
</script>
<style>
.page {
padding: 15px;
}
.frame-count {
margin-top: 15px;
}
.tips {
font-size: 12px;
margin-top: 30px;
opacity: 0.7;
}
</style>
此差异已折叠。
<template> <template>
<view> <view>
<page-head :title="title"></page-head> <page-head :title="title"></page-head>
<view class="uni-padding-wrap"> <view class="uni-padding-wrap">
<view style="background:#FFFFFF; padding:40rpx;"> <view style="background:#FFFFFF; padding:40rpx;">
<view class="uni-hello-text uni-center">当前位置信息</view> <view class="uni-hello-text uni-center">当前位置信息</view>
<block v-if="hasLocation === false"> <block v-if="hasLocation === false">
<view class="uni-h2 uni-center uni-common-mt">未选择位置</view> <view class="uni-h2 uni-center uni-common-mt">未选择位置</view>
</block> </block>
<block v-if="hasLocation === true"> <block v-if="hasLocation === true">
<view class="uni-hello-text uni-center" style="margin-top:10px;"> <view class="uni-hello-text uni-center" style="margin-top:10px;">
{{locationAddress}} {{locationAddress}}
</view> </view>
<view class="uni-h2 uni-center uni-common-mt"> <view class="uni-h2 uni-center uni-common-mt">
<text>E: {{location.longitude[0]}}°{{location.longitude[1]}}′</text> <text>E: {{location.longitude[0]}}°{{location.longitude[1]}}′</text>
<text>\nN: {{location.latitude[0]}}°{{location.latitude[1]}}′</text> <text>\nN: {{location.latitude[0]}}°{{location.latitude[1]}}′</text>
</view> </view>
</block> </block>
</view> </view>
<view class="uni-btn-v"> <view class="uni-btn-v">
<button type="primary" @tap="chooseLocation">选择位置</button> <view class="tips">注意:需要正确配置地图服务商的Key才能正常选择位置</view>
<button @tap="clear">清空</button> <button type="primary" @tap="chooseLocation">选择位置</button>
</view> <button @tap="clear">清空</button>
</view> </view>
</view> </view>
</view>
</template> </template>
<script lang="uts"> <script lang="uts">
function formatLocation(longitude, latitude) { function formatLocation (longitude, latitude) {
if (typeof longitude === 'string' && typeof latitude === 'string') { if (typeof longitude === 'string' && typeof latitude === 'string') {
longitude = parseFloat(longitude) longitude = parseFloat(longitude)
latitude = parseFloat(latitude) latitude = parseFloat(latitude)
} }
longitude = longitude.toFixed(2) longitude = longitude.toFixed(2)
latitude = latitude.toFixed(2) latitude = latitude.toFixed(2)
return { return {
longitude: longitude.toString().split('.'), longitude: longitude.toString().split('.'),
latitude: latitude.toString().split('.') latitude: latitude.toString().split('.')
} }
} }
export default { export default {
data() { data () {
return { return {
title: 'chooseLocation', title: 'chooseLocation',
hasLocation: false, hasLocation: false,
location: {}, location: {},
locationAddress: '' locationAddress: ''
} }
}, },
methods: { methods: {
chooseLocation: function () { chooseLocation: function () {
uni.chooseLocation({ uni.chooseLocation({
success: (res) => { success: (res) => {
console.log(res,123) console.log(res, 123)
this.hasLocation = true, this.hasLocation = true
this.location = formatLocation(res.longitude, res.latitude), this.location = formatLocation(res.longitude, res.latitude)
this.locationAddress = res.address this.locationAddress = res.address
} }
}) })
}, },
clear: function () { clear: function () {
this.hasLocation = false this.hasLocation = false
} }
} }
} }
</script> </script>
<style> <style>
.page-body-info { .page-body-info {
padding-bottom: 0; padding-bottom: 0;
height: 440rpx; height: 440rpx;
} }
.tips {
font-size: 12px;
margin-top: 15px;
opacity: .8;
}
</style> </style>
...@@ -28,19 +28,21 @@ ...@@ -28,19 +28,21 @@
<script> <script>
import { ItemType } from '@/components/enum-data/enum-data'; import { ItemType } from '@/components/enum-data/enum-data';
type Camera = "back" | "front"
type Source = "album" | "camera"
export default { export default {
data() { data() {
return { return {
title: "chooseVideo", title: "chooseVideo",
src: "", src: "",
sourceTypeItemTypes: [{ "value": 0, "name": "从相册中选择视频" }, { "value": 1, "name": "拍摄视频" }, { "value": 2, "name": "从相册中选择视频或拍摄视频" }] as ItemType[], sourceTypeItemTypes: [{ "value": 0, "name": "从相册中选择视频" }, { "value": 1, "name": "拍摄视频" }, { "value": 2, "name": "从相册中选择视频或拍摄视频" }] as ItemType[],
sourceTypeItems: [["album"], ["camera"], ["album", "camera"]], sourceTypeItems: [["album"], ["camera"], ["album", "camera"]] as Source[][],
cameraItemTypes: [{ "value": 0, "name": "后置摄像头" }, { "value": 1, "name": "前置摄像头" }] as ItemType[], cameraItemTypes: [{ "value": 0, "name": "后置摄像头" }, { "value": 1, "name": "前置摄像头" }] as ItemType[],
cameraItems: ["back", "front"], cameraItems: ["back", "front"] as Camera[],
sourceType: ["album", "camera"], sourceType: ["album", "camera"] as Source[],
compressed: true, compressed: true,
maxDuration: 60, maxDuration: 60,
camera: "back", camera: "back" as Camera,
videoInfo: "" videoInfo: ""
} }
}, },
......
此差异已折叠。
...@@ -19,7 +19,7 @@ describe('API-compressVideo', () => { ...@@ -19,7 +19,7 @@ describe('API-compressVideo', () => {
if (process.env.uniTestPlatformInfo.startsWith('android')) { if (process.env.uniTestPlatformInfo.startsWith('android')) {
const infos = process.env.uniTestPlatformInfo.split(' '); const infos = process.env.uniTestPlatformInfo.split(' ');
const version = parseInt(infos[infos.length - 1]); const version = parseInt(infos[infos.length - 1]);
if (version == 5 || version == 7 || version == 10) return; // android5.1、android7、android10存在兼容问题,待修复 if (version == 5 || version == 7 || version == 9 || version == 10) return; // android5.1、android7、android9、android10存在兼容问题,待修复
expect(await page.data('videoInfoForTest')).toEqual({ expect(await page.data('videoInfoForTest')).toEqual({
width: 640, width: 640,
height: 360, height: 360,
......
...@@ -32,10 +32,10 @@ ...@@ -32,10 +32,10 @@
<view class="uni-title"> <view class="uni-title">
<text class="uni-title-text">格式/路径示例</text> <text class="uni-title-text">格式/路径示例</text>
</View> </View>
<navigator url="/pages/API/inner-audio/inner-audio-format" class="uni-btn"> <navigator url="/pages/API/create-inner-audio-context/inner-audio-format" class="uni-btn">
<button type="primary" @click="pause">音频格式示例</button> <button type="primary" @click="pause">音频格式示例</button>
</navigator> </navigator>
<navigator url="/pages/API/inner-audio/inner-audio-path" class="uni-btn uni-common-mb"> <navigator url="/pages/API/create-inner-audio-context/inner-audio-path" class="uni-btn uni-common-mb">
<button type="primary" @click="pause">音频路径示例</button> <button type="primary" @click="pause">音频路径示例</button>
</navigator> </navigator>
</view> </view>
...@@ -58,9 +58,9 @@ ...@@ -58,9 +58,9 @@
_isChanging: false, _isChanging: false,
_audioContext: null as InnerAudioContext | null, _audioContext: null as InnerAudioContext | null,
// 自动化测试 // 自动化测试
onSeekingTest:false, onSeekingTest: false,
onSeekedTest:false, onSeekedTest: false,
onWaitingTest:false onWaitingTest: false
} }
}, },
computed: { computed: {
...@@ -129,7 +129,7 @@ ...@@ -129,7 +129,7 @@
} }
this._audioContext!.onPlay(() => { this._audioContext!.onPlay(() => {
this.isPaused = false; this.isPaused = false;
console.log('开始播放',this.isPaused); console.log('开始播放', this.isPaused);
}); });
this.onTimeUpdate() this.onTimeUpdate()
this.onWaiting() this.onWaiting()
...@@ -159,6 +159,7 @@ ...@@ -159,6 +159,7 @@
// console.log('onTimeUpdate:音频播放进度更新事件,currentTime',this._audioContext!.currentTime); // console.log('onTimeUpdate:音频播放进度更新事件,currentTime',this._audioContext!.currentTime);
if (this._isChanging === true) { return; } if (this._isChanging === true) { return; }
this.currentTime = this._audioContext!.currentTime || 0; this.currentTime = this._audioContext!.currentTime || 0;
console.log('currentTime', this.currentTime);
if (this.currentTime > this.buffered) { if (this.currentTime > this.buffered) {
console.log('缓冲不足'); console.log('缓冲不足');
} }
...@@ -208,7 +209,7 @@ ...@@ -208,7 +209,7 @@
console.log('音频停止事件'); console.log('音频停止事件');
}); });
this.isPlaying = false; this.isPlaying = false;
console.log('stop',this.isPaused); console.log('stop', this.isPaused);
} }
} }
} }
......
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册