提交 306b1430 编写于 作者: W wanganxp

Merge branch 'dev' of https://gitcode.net/dcloud/hello-uni-app-x into dev

......@@ -2,7 +2,7 @@
<view>
<page-head :title="title"></page-head>
<view class="uni-padding-wrap">
<view class="uni-hello-text">注意:离开当前页面后背景音乐将保持播放,但退出uni-app将停止</view>
<view class="uni-hello-text">注意:离开当前页面后背景音乐将保持播放</view>
<view class="page-body-buttons">
<block v-if="playing">
<view class="page-body-button" @tap="stop">
......@@ -38,8 +38,7 @@
onLoad: function () {
let bgAudioMannager = uni.getBackgroundAudioManager();
bgAudioMannager.title = '致爱丽丝';
bgAudioMannager.epname = '致爱丽丝'
bgAudioMannager.singer = '暂无';
bgAudioMannager.singer = '路德维希·范·贝多芬';
bgAudioMannager.coverImgUrl = 'https://web-assets.dcloud.net.cn/unidoc/zh/Alice.jpeg';
bgAudioMannager.onPlay(() => {
......@@ -52,14 +51,12 @@
})
bgAudioMannager.onEnded(() => {
this.playing = false;
// this.playTime = this.playTime = 0;
// thi.formatedPlayTime = this.formatedPlayTime
})
bgAudioMannager.onNext(() => {
console.log("下一曲");
this.bgAudioMannager?.stop()
bgAudioMannager.title = '致爱丽丝' + this.count++;
bgAudioMannager.singer = '暂无2' + this.count++;
bgAudioMannager.singer = '路德维希·范·贝多芬';
bgAudioMannager.coverImgUrl = 'https://web-assets.dcloud.net.cn/unidoc/zh/Alice.jpeg';
this.bgAudioMannager!.src = this.dataUrl;
this.bgAudioMannager?.play()
......@@ -68,17 +65,10 @@
console.log("上一曲");
this.bgAudioMannager?.stop()
bgAudioMannager.title = '致爱丽丝' + this.count--;
bgAudioMannager.singer = '暂无' + this.count--;
bgAudioMannager.singer = '路德维希·范·贝多芬';
this.bgAudioMannager!.src = this.dataUrl;
this.bgAudioMannager?.play()
})
// bgAudioMannager.onTimeUpdate((e) => {
// if (Math.floor(bgAudioMannager.currentTime) > Math.floor(this.playTime)) {
// this.$backgroundAudioData.formatedPlayTime = this.formatedPlayTime = util.formatTime(Math.floor(bgAudioMannager.currentTime));
// }
// this.$backgroundAudioData.playTime = this.playTime = bgAudioMannager.currentTime;
// })
this.bgAudioMannager = bgAudioMannager;
},
methods: {
......@@ -142,5 +132,6 @@
.page-body-button {
flex-direction: row;
justify-content: center;
margin-bottom: 10px;
}
</style>
\ No newline at end of file
</style>
......@@ -2,7 +2,7 @@ const platformInfo = process.env.uniTestPlatformInfo.toLocaleLowerCase()
const isMP = platformInfo.startsWith('mp')
describe('component-native-grid-view', () => {
if (isMP) {
if (isMP || platformInfo.indexOf('web') > -1) {
it('skip mp', () => {
expect(1).toBe(1)
})
......@@ -14,7 +14,7 @@ describe('component-native-grid-view', () => {
//打开grid-view测试页
page = await program.reLaunch('/pages/component/grid-view/grid-view')
await page.waitFor(600)
})
})
//检测竖向scrolltop属性赋值
it('check_scroll_top', async () => {
......@@ -63,9 +63,9 @@ describe('component-native-grid-view', () => {
endPoint: { x: 100, y: 100 },
duration: 100
})
await page.waitFor(600)
await page.waitFor(1200)
const endDetail = await page.data('scrollEndDetailTest')
// console.log('scrollEndDetailTest:', endDetail)
console.log('scrollEndDetailTest:', endDetail)
expect(endDetail.deltaY).toBe(0)
expect(endDetail.deltaX).toBe(0)
expect(endDetail.scrollLeft).toBe(0)
......@@ -81,7 +81,7 @@ describe('component-native-grid-view', () => {
expect(value).toBe(true)
})
// //检测下拉刷新 备注:iOS本地测试结果正确,但是自动化测试结果错误
//检测下拉刷新 备注:iOS本地测试结果正确,但是自动化测试结果错误
it('check_refresher', async () => {
await page.callMethod('confirm_scroll_top_input', 0)
await page.setData({
......
......@@ -90,9 +90,9 @@ describe('component-native-list-view', () => {
endPoint: { x: 100, y: 100 },
duration: 100
})
await page.waitFor(600)
await page.waitFor(1600)
const endDetail = await page.data('scrollEndDetailTest')
// console.log('scrollEndDetailTest:', endDetail)
console.log('scrollEndDetailTest:', endDetail)
expect(endDetail.deltaY).toBe(0)
expect(endDetail.deltaX).toBe(0)
expect(endDetail.scrollLeft).toBe(0)
......
let page;
describe('web-map', () => {
if (!process.env.uniTestPlatformInfo.startsWith('web')) {
it('app', () => {
expect(1).toBe(1)
})
return
}
beforeAll(async () => {
page = await program.reLaunch('/pages/component/map/map')
await page.waitFor('view');
......@@ -16,6 +11,26 @@ describe('web-map', () => {
await page.callMethod('updateAutoTest',true)
});
it('handleMoveToLocation', async () => {
await page.callMethod('handleMoveToLocation')
await page.waitFor(500);
const moveToLocationRes = await page.data('jestResult')
expect(moveToLocationRes.moveToLocationMsg).toBe("moveToLocation:ok");
});
it('Check EventDetail JsonStringify', async () => {
const res = await page.data('jestResult')
console.log(res.eventDetailJsonStringify);
expect(res.eventDetailJsonStringify).not.toBe("{}");
})
if (!process.env.uniTestPlatformInfo.startsWith('web')) {
it('app', () => {
expect(1).toBe(1)
})
return
}
it('Check MapMethods', async () => {
const mapMethods = ['addControls', 'addMarkers', 'addMarkersLabel','removeMarker','addPolyline','removePolyline', 'addPolygons','removePolygon', 'addCircles','removeCircle','includePoint']
for (var i = 0; i < mapMethods.length; i++) {
......@@ -58,12 +73,7 @@ describe('web-map', () => {
expect(translateMarkerRes.translateMarkerMsg).toBe('translateMarker:ok');
});
it('handleMoveToLocation', async () => {
await page.callMethod('handleMoveToLocation')
await page.waitFor(500);
const moveToLocationRes = await page.data('jestResult')
expect(moveToLocationRes.moveToLocationMsg).toBe("moveToLocation:ok");
});
it('handleGetScale', async () => {
await page.callMethod('handleGetScale')
......@@ -73,5 +83,4 @@ describe('web-map', () => {
expect(scaleRes.scale).toBeLessThanOrEqual(18);
console.log("jestResult",await page.data())
});
});
......@@ -59,7 +59,8 @@
southwest : LocationObject,
northeast : LocationObject,
moveToLocationMsg : string,
scale : number
scale : number,
eventDetailJsonStringify: string,
}
const testMarkers :Marker[]= [{
......@@ -344,7 +345,8 @@
longitude: 0
},
moveToLocationMsg: "",
scale: 0,
scale: 0,
eventDetailJsonStringify: "{}"
} as TypeJestResult);
......@@ -632,11 +634,18 @@
})
}
const maptap = (e : UniMapTapEvent) => {
const maptap = (e : UniMapTapEvent) => {
// #ifdef WEB
uni.showModal({
content: 'web端map组件tap事件不支持返回经纬度'
});
// #endif
// #ifndef WEB
// console.log('点击地图时触发',e)
uni.showModal({
content: JSON.stringify(e.detail)
});
});
// #endif
};
const onmarkertap = (e : UniMapMarkerTapEvent) => {
......@@ -665,7 +674,8 @@
};
const onregionchange = (e : UniMapRegionChangeEvent) => {
console.log('视野发生变化时触发', e.detail)
console.log('视野发生变化时触发', e.detail)
jestResult.eventDetailJsonStringify = JSON.stringify(e.detail)
};
const onpoitap = (e : UniMapPoiTapEvent) => {
......
......@@ -68,9 +68,10 @@
},
updateRichTextHeight() {
if (this.richTextElement != null) {
const elRect = this.richTextElement!.getBoundingClientRect()
this.richTextHeight = elRect.height
console.log('richTextHeight:', this.richTextHeight)
this.richTextElement!.getBoundingClientRectAsync().then((elRect: DOMRect) => {
this.richTextHeight = elRect.height
console.log('richTextHeight:', this.richTextHeight)
})
}
},
// 自动化测试
......
......@@ -24,6 +24,7 @@
selectionEnd: -1,
hold_keyboard: false,
adjust_position: false,
disabled: false,
jest_result: false
}
},
......@@ -70,6 +71,9 @@
changeAdjustPosition(event : UniSwitchChangeEvent) {
const checked = event.detail.value;
this.adjust_position = checked;
},
change_disabled_boolean(checked : boolean) {
this.disabled = checked
}
}
}
......@@ -85,7 +89,7 @@
:show-confirm-bar="show_confirm_bar_boolean" :adjust-position="adjust_position_boolean"
:cursor-color="cursor_color" :cursor="cursor" :placeholder="placeholder_value"
:inputmode="inputmode_enum[inputmode_enum_current].name"
:confirm-type="confirm_type_list[confirm_type_current].name" @click="textarea_click"
:confirm-type="confirm_type_list[confirm_type_current].name" :disabled="disabled" @click="textarea_click"
@touchstart="textarea_touchstart" @touchmove="textarea_touchmove" @touchcancel="textarea_touchcancel"
@touchend="textarea_touchend" @tap="textarea_tap" @longpress="textarea_longpress" @confirm="textarea_confirm"
@input="textarea_input" @linechange="textarea_linechange" @blur="textarea_blur"
......@@ -99,7 +103,9 @@
@change="change_auto_height_boolean"></boolean-data>
<boolean-data :defaultValue="focus_boolean" title="获取焦点" @change="change_focus_boolean"></boolean-data>
<boolean-data :defaultValue="true" title="首次自动获取焦点" @change="change_auto_focus_boolean"></boolean-data>
<boolean-data :defaultValue="false" title="改变光标颜色为透明" @change="change_cursor_color_boolean"></boolean-data>
<boolean-data :defaultValue="false" title="改变光标颜色为透明" @change="change_cursor_color_boolean"></boolean-data>
<boolean-data :defaultValue="false" title="设置禁用输入框"
@change="change_disabled_boolean"></boolean-data>
<enum-data :items="confirm_type_list" title="confirm-type,设置键盘右下角按钮。(Android仅支持return)"
@change="radio_change_confirm_type"></enum-data>
<boolean-data :defaultValue="false" title="点击软键盘右下角按钮时是否保持键盘不收起(confirm-type为return时必然不收起)"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册