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

Merge branch 'dev' into alpha

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