提交 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 @@
myMap: new Map<string, any>(),
func: () : string => {
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)
console.log('App Launch')
......@@ -37,16 +45,57 @@
// observer1.observe({
// entryTypes: ['render', 'navigation'],
// } 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)
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 () {
// 自动化测试
setLifeCycleNum(state.lifeCycleNum - 100)
console.log('App Hide')
// 统计上报 - 应用进入后台
// uni.report({
// name: 'uni-app-hide',
// success(res) {
// console.log(res);
// }, fail(err) {
// console.log(err);
// }
// })
},
// #ifdef APP-ANDROID
onLastPageBackPress: function () {
......@@ -70,11 +119,56 @@
onExit() {
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
methods: {
increasetLifeCycleNum() {
setLifeCycleNum(state.lifeCycleNum + 100)
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 @@
<style>
/*每个页面公共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>
## 1.0.16
* update 4.24.2024072208
## 1.0.31
* update 4.28.2024092105-alpha
## 1.0.15
* update 4.23.2024070804
## 1.0.30
* update 4.27.2024091308-alpha
## 1.0.27
* update 4.23.2024070309-alpha
## 1.0.29
* update 4.26.2024082213-alpha
## 1.0.25
* update 4.22.2024062415-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.28
* update 4.25.2024081703-alpha
## 1.0.11
* update 4.01.2024020211-alpha
......
......@@ -123,7 +123,7 @@
.uni-bg-blue {
background: #007AFF;
}
}
.uni-btn-v {
padding: 5px 0;
......@@ -189,7 +189,7 @@
}
.text-disabled {
color: #a0a0a0;
color: #a0a0a0!important;
}
......@@ -244,6 +244,11 @@
color: #000000;
font-size: 14px;
font-weight: normal;
}
/* left-windows */
.left-win-active {
color: #007AFF!important;
}
/* --tab-bar-end-- */
......
......@@ -6,6 +6,8 @@
<button class="button" @click="customStyle">{{ !hasCustomedStyle ? '自定义Tab样式' : '移除自定义样式'}}</button>
<button class="button" @click="customItem">{{ !hasCustomedItem ? '自定义Tab信息' : '移除自定义信息' }}</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">
<!-- <button class="button" type="primary" @click="navigateBack">关闭</button> -->
</view>
......@@ -21,7 +23,9 @@
hasShownTabBarRedDot: false,
hasCustomedStyle: false,
hasCustomedItem: false,
hasHiddenTabBar: false
hasHiddenTabBar: false,
hasHiddenTabBarItem: false,
hasSetLongTitle: false,
}
},
destroyed() {
......@@ -56,8 +60,58 @@
} as SetTabBarItemOptions
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: {
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() {
this.$emit('unmount')
},
......
......@@ -35,6 +35,7 @@
<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="getEnv">getEnv</button>
<!-- <button class="btn" type="button" data-action="getTheme">获取主题</button> -->
</div>
<p class="desc">网页向应用发送消息。注意:小程序端应用会在此页面后退时接收到消息。</p>
<div class="btn-list">
......@@ -88,6 +89,9 @@
})
});
break;
/* case 'getTheme':
alert(getThemePreference())
break; */
default:
uni.webView[action]({
url: '/pages/component/button/button'
......@@ -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>
</body>
</html>
// 仅测试 console.log 时机问题
import './test-main-console.uts'
import App from './App.uvue'
import { createSSRApp } from 'vue'
import { createSSRApp } from 'vue'
export function createApp() {
const app = createSSRApp(App)
const app = createSSRApp(App)
// app.mixin({
// onReady() {
// setTimeout(() => {
......
......@@ -2,8 +2,8 @@
"name": "Hello uni-app x",
"appid": "__UNI__HelloUniAppX",
"description": "",
"versionName": "1.4",
"versionCode": 10400,
"versionName": "1.5",
"versionCode": 10500,
"uni-app-x": {},
/* 快应用特有相关 */
"quickapp": {},
......@@ -41,6 +41,10 @@
}
}
},
"uni-getLocation":{
"system":{},
"tencent":{}
},
"uni-ad": {
"gdt": {}
}
......@@ -64,7 +68,7 @@
"sdkConfigs" : {
"maps" : {
"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>
<view>
<page-head :title="title"></page-head>
<view class="uni-padding-wrap">
<view style="background:#FFFFFF; padding:40rpx;">
<view class="uni-hello-text uni-center">当前位置信息</view>
<block v-if="hasLocation === false">
<view class="uni-h2 uni-center uni-common-mt">未选择位置</view>
</block>
<block v-if="hasLocation === true">
<view class="uni-hello-text uni-center" style="margin-top:10px;">
{{locationAddress}}
</view>
<view class="uni-h2 uni-center uni-common-mt">
<text>E: {{location.longitude[0]}}°{{location.longitude[1]}}′</text>
<text>\nN: {{location.latitude[0]}}°{{location.latitude[1]}}′</text>
</view>
</block>
</view>
<view class="uni-btn-v">
<button type="primary" @tap="chooseLocation">选择位置</button>
<button @tap="clear">清空</button>
</view>
</view>
</view>
<view>
<page-head :title="title"></page-head>
<view class="uni-padding-wrap">
<view style="background:#FFFFFF; padding:40rpx;">
<view class="uni-hello-text uni-center">当前位置信息</view>
<block v-if="hasLocation === false">
<view class="uni-h2 uni-center uni-common-mt">未选择位置</view>
</block>
<block v-if="hasLocation === true">
<view class="uni-hello-text uni-center" style="margin-top:10px;">
{{locationAddress}}
</view>
<view class="uni-h2 uni-center uni-common-mt">
<text>E: {{location.longitude[0]}}°{{location.longitude[1]}}′</text>
<text>\nN: {{location.latitude[0]}}°{{location.latitude[1]}}′</text>
</view>
</block>
</view>
<view class="uni-btn-v">
<view class="tips">注意:需要正确配置地图服务商的Key才能正常选择位置</view>
<button type="primary" @tap="chooseLocation">选择位置</button>
<button @tap="clear">清空</button>
</view>
</view>
</view>
</template>
<script lang="uts">
function formatLocation(longitude, latitude) {
if (typeof longitude === 'string' && typeof latitude === 'string') {
longitude = parseFloat(longitude)
latitude = parseFloat(latitude)
}
longitude = longitude.toFixed(2)
latitude = latitude.toFixed(2)
return {
longitude: longitude.toString().split('.'),
latitude: latitude.toString().split('.')
}
}
export default {
data() {
return {
title: 'chooseLocation',
hasLocation: false,
location: {},
locationAddress: ''
}
},
methods: {
chooseLocation: function () {
uni.chooseLocation({
success: (res) => {
console.log(res,123)
this.hasLocation = true,
this.location = formatLocation(res.longitude, res.latitude),
this.locationAddress = res.address
}
})
},
clear: function () {
this.hasLocation = false
}
}
}
function formatLocation (longitude, latitude) {
if (typeof longitude === 'string' && typeof latitude === 'string') {
longitude = parseFloat(longitude)
latitude = parseFloat(latitude)
}
longitude = longitude.toFixed(2)
latitude = latitude.toFixed(2)
return {
longitude: longitude.toString().split('.'),
latitude: latitude.toString().split('.')
}
}
export default {
data () {
return {
title: 'chooseLocation',
hasLocation: false,
location: {},
locationAddress: ''
}
},
methods: {
chooseLocation: function () {
uni.chooseLocation({
success: (res) => {
console.log(res, 123)
this.hasLocation = true
this.location = formatLocation(res.longitude, res.latitude)
this.locationAddress = res.address
}
})
},
clear: function () {
this.hasLocation = false
}
}
}
</script>
<style>
.page-body-info {
padding-bottom: 0;
height: 440rpx;
}
.page-body-info {
padding-bottom: 0;
height: 440rpx;
}
.tips {
font-size: 12px;
margin-top: 15px;
opacity: .8;
}
</style>
......@@ -28,19 +28,21 @@
<script>
import { ItemType } from '@/components/enum-data/enum-data';
type Camera = "back" | "front"
type Source = "album" | "camera"
export default {
data() {
return {
title: "chooseVideo",
src: "",
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[],
cameraItems: ["back", "front"],
sourceType: ["album", "camera"],
cameraItems: ["back", "front"] as Camera[],
sourceType: ["album", "camera"] as Source[],
compressed: true,
maxDuration: 60,
camera: "back",
camera: "back" as Camera,
videoInfo: ""
}
},
......
此差异已折叠。
......@@ -19,7 +19,7 @@ describe('API-compressVideo', () => {
if (process.env.uniTestPlatformInfo.startsWith('android')) {
const infos = process.env.uniTestPlatformInfo.split(' ');
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({
width: 640,
height: 360,
......
......@@ -32,10 +32,10 @@
<view class="uni-title">
<text class="uni-title-text">格式/路径示例</text>
</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>
</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>
</navigator>
</view>
......@@ -58,9 +58,9 @@
_isChanging: false,
_audioContext: null as InnerAudioContext | null,
// 自动化测试
onSeekingTest:false,
onSeekedTest:false,
onWaitingTest:false
onSeekingTest: false,
onSeekedTest: false,
onWaitingTest: false
}
},
computed: {
......@@ -129,7 +129,7 @@
}
this._audioContext!.onPlay(() => {
this.isPaused = false;
console.log('开始播放',this.isPaused);
console.log('开始播放', this.isPaused);
});
this.onTimeUpdate()
this.onWaiting()
......@@ -159,6 +159,7 @@
// console.log('onTimeUpdate:音频播放进度更新事件,currentTime',this._audioContext!.currentTime);
if (this._isChanging === true) { return; }
this.currentTime = this._audioContext!.currentTime || 0;
console.log('currentTime', this.currentTime);
if (this.currentTime > this.buffered) {
console.log('缓冲不足');
}
......@@ -208,7 +209,7 @@
console.log('音频停止事件');
});
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.
先完成此消息的编辑!
想要评论请 注册