提交 55e62003 编写于 作者: DCloud-yyl's avatar DCloud-yyl

Merge branch 'dev' into alpha

# Conflicts:
#	pages.json
......@@ -41,5 +41,6 @@
justify-content: space-between;
padding: 10px;
border-bottom: 1px solid rgba(0, 0, 0, .06);
align-items: center;
}
</style>
......@@ -4,10 +4,10 @@
<!-- #endif -->
<page-head title="权限申请监听"></page-head>
<view class="permission-alert" id="permission-alert" :style="{'transform':isPermissionAlertShow ? 'translateY(0)':'translateY(-110px)'}">
<text style="font-size: 20px;margin-bottom: 10px;margin-top: 5px;">手机状态权限申请说明:</text>
<text style="color: darkgray;">uni-app x正在申请手机状态权限,允许或拒绝均不会获取任何隐私信息。</text>
<text style="font-size: 20px;margin-bottom: 10px;margin-top: 5px;">日历权限申请说明:</text>
<text style="color: darkgray;">uni-app x正在申请日历权限,允许或拒绝均不会获取任何隐私信息。</text>
</view>
<button type="primary" style="margin: 10px;" @click="requestPermission">点击申请权限</button>
<button type="primary" style="margin: 10px;" @click="requestPermission">点击申请日历权限</button>
<!-- #ifdef APP -->
</scroll-view>
......@@ -48,14 +48,14 @@
},
requestPermission() {
// #ifdef APP-ANDROID
if (UTSAndroid.checkSystemPermissionGranted(UTSAndroid.getUniActivity()!, ["android.permission.READ_PHONE_STATE"])) {
if (UTSAndroid.checkSystemPermissionGranted(UTSAndroid.getUniActivity()!, ["android.permission.READ_CALENDAR"])) {
uni.showToast({
title: "权限已经同意了,不需要再申请",
position: "bottom"
})
return
}
UTSAndroid.requestSystemPermission(UTSAndroid.getUniActivity()!, ["android.permission.READ_PHONE_STATE"], (_ : boolean, p : string[]) => {
UTSAndroid.requestSystemPermission(UTSAndroid.getUniActivity()!, ["android.permission.READ_CALENDAR"], (_ : boolean, p : string[]) => {
console.log(p)
}, (_ : boolean, p : string[]) => {
uni.showToast({
......
......@@ -22,15 +22,27 @@ describe('ExtApi-DownloadFile', () => {
expect(res).toBe(true);
});
it('Check Set Cookie', async () => {
if (process.env.uniTestPlatformInfo.startsWith('android')) {
let version = process.env.uniTestPlatformInfo
version = version.split(" ")[1]
if(version > 9){
res = await page.callMethod('jest_set_cookie')
await page.waitFor(1000);
res = await page.data('jest_result');
expect(res).toBe(true)
}
}
});
it('Check Delete Cookie', async () => {
if (process.env.uniTestPlatformInfo.startsWith('android')) {
let version = process.env.uniTestPlatformInfo
version = version.split(" ")[1]
if(version > 9){
res = await page.callMethod('jest_delete_cookie')
await page.waitFor(1000);
res = await page.data('jest_result');
expect(res).toBe(true)
}
}
});
});
......@@ -21,12 +21,12 @@ describe('page-scroll-to', () => {
const scrollToElement = await page.$('.custom-element')
await btnScrollTo.tap()
await page.waitFor(600)
await page.waitFor(1000)
const offset = await scrollToElement.offset()
// android 6 分辨率为 720*1280,需要调整期望数值
if (!process.env.uniTestPlatformInfo.startsWith('android 6')) {
expect(offset.top >= 1188).toBe(true)
expect(offset.top >= 1180).toBe(true)
}
})
})
......@@ -82,16 +82,28 @@ describe('ExtApi-Request', () => {
if (process.env.uniTestPlatformInfo.indexOf('web') === -1) {
it('Check Set Cookie', async () => {
if (process.env.uniTestPlatformInfo.startsWith('android')) {
let version = process.env.uniTestPlatformInfo
version = version.split(" ")[1]
if(version > 9){
res = await page.callMethod('jest_set_cookie')
await page.waitFor(500);
res = await page.data('jest_result');
expect(res).toBe(true)
}
}
});
it('Check Delete Cookie', async () => {
if (process.env.uniTestPlatformInfo.startsWith('android')) {
let version = process.env.uniTestPlatformInfo
version = version.split(" ")[1]
if(version > 9){
res = await page.callMethod('jest_delete_cookie')
await page.waitFor(1000);
res = await page.data('jest_result');
expect(res).toBe(true)
}
}
});
}
});
......@@ -23,16 +23,28 @@ describe('ExtApi-UploadFile', () => {
});
it('Check Set Cookie', async () => {
if (process.env.uniTestPlatformInfo.startsWith('android')) {
let version = process.env.uniTestPlatformInfo
version = version.split(" ")[1]
if(version > 9){
res = await page.callMethod('jest_set_cookie')
await page.waitFor(1000);
res = await page.data('jest_result');
expect(res).toBe(true)
}
}
});
it('Check Delete Cookie', async () => {
if (process.env.uniTestPlatformInfo.startsWith('android')) {
let version = process.env.uniTestPlatformInfo
version = version.split(" ")[1]
if(version > 9){
res = await page.callMethod('jest_delete_cookie')
await page.waitFor(1000);
res = await page.data('jest_result');
expect(res).toBe(true)
}
}
});
it('Check files upload', async () => {
res = await page.callMethod('jest_files_upload')
......
......@@ -12,7 +12,7 @@
style="width: 50px; height: 50px; background-color: red"
></view>
<view class="common" style="position: relative">
<text>relative</text>
<text class="text">relative</text>
</view>
<view
style="width: 50px; height: 50px; background-color: blue"
......@@ -47,7 +47,7 @@
style="width: 50px; height: 50px; background-color: red"
></view>
<view class="common" style="position: absolute">
<text>absolute</text>
<text class="text">absolute</text>
</view>
<view
style="width: 50px; height: 50px; background-color: blue"
......@@ -82,7 +82,7 @@
style="width: 50px; height: 50px; background-color: red"
></view>
<view class="common fixed" style="position: fixed">
<text>fixed</text>
<text class="text">fixed</text>
</view>
<view
style="width: 50px; height: 50px; background-color: blue"
......@@ -131,4 +131,8 @@
/* #endif */
}
.text {
white-space: nowrap;
width: 100%;
}
</style>
......@@ -80,8 +80,8 @@
},
// 工具方法,用于快速设置 Element 的 style
setElementStyle(refName : string, propertyName : string, propertyStyle : any) : void {
const elementMap = this.$data['$elementMap'] as Map<string, Element>
let element : Element | null = elementMap.get(refName)
const elementMap = this.$data['$elementMap'] as Map<string, UniElement>
let element : UniElement | null = elementMap.get(refName)
if (element == null) {
element = this.$refs[refName] as UniElement;
elementMap.set(refName, element)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册