diff --git a/components/uni-navbar-lite/uni-navbar-lite.uvue b/components/uni-navbar-lite/uni-navbar-lite.uvue index 797e33649a7922f935d27009412f8d06256c1a9f..5d1465e982564187075650c99e38d01d1027e5ed 100644 --- a/components/uni-navbar-lite/uni-navbar-lite.uvue +++ b/components/uni-navbar-lite/uni-navbar-lite.uvue @@ -44,8 +44,8 @@ created() { uni.loadFontFace({ global: false, - family: 'UniIconsFontFamily', - source: iconpath, + family: 'UniIconsFontFamily', + source: "url(" + iconpath + ")", success() { }, fail(err) { console.log(err); diff --git a/pages/API/navigator/new-page/new-page-1.uvue b/pages/API/navigator/new-page/new-page-1.uvue index c339940bd1bfe2b7949bad212c3f7bd61dc8b115..ce35b91ffc894aebbf4a9755cab5e4e6063756b0 100644 --- a/pages/API/navigator/new-page/new-page-1.uvue +++ b/pages/API/navigator/new-page/new-page-1.uvue @@ -19,8 +19,8 @@ export default { } }, onLoad(options: OnLoadOptions) { - if (options.has('data')) { - this.data = options.get('data')! + if (options['data'] != null) { + this.data = options['data'] } }, methods: { diff --git a/pages/API/set-navigation-bar-color/set-custom-navigation-bar-color.uvue b/pages/API/set-navigation-bar-color/set-custom-navigation-bar-color.uvue index 8c99bca057f2674f794a15ddedcae05b460390d8..cc7cde8fbbe6bbd5df41e753800021271180c288 100644 --- a/pages/API/set-navigation-bar-color/set-custom-navigation-bar-color.uvue +++ b/pages/API/set-navigation-bar-color/set-custom-navigation-bar-color.uvue @@ -36,7 +36,7 @@ export default { onShow(){ uni.loadFontFace({ family: 'UniFontFamily', - source: 'static/font/uni.ttf' + source: 'url(static/font/uni.ttf)' }) }, methods: { diff --git a/pages/API/storage/storage.uvue b/pages/API/storage/storage.uvue index 39a0f5bfd6d47ba41e4cebc19bffabdde95edf4b..330d869a2f9fb4a7427853ef806100209b3cf925 100644 --- a/pages/API/storage/storage.uvue +++ b/pages/API/storage/storage.uvue @@ -31,7 +31,7 @@ type="text" placeholder="请输入value" name="data" - :value="data" + :value="typeof data === 'string' ? data : JSON.stringify(data)" @input="dataChange" /> diff --git a/pages/component/form/form.uvue b/pages/component/form/form.uvue index c7f7682b2f235c304a5d76db7c8321c1ae925cc7..39dd858579dcdb1b9c2bbffa5567ffa87b548b2d 100644 --- a/pages/component/form/form.uvue +++ b/pages/component/form/form.uvue @@ -11,10 +11,10 @@ 性别 - + - + @@ -31,7 +31,7 @@ 年龄 - + 保留选项 diff --git a/pages/component/image/image-format.uvue b/pages/component/image/image-format.uvue index 39a950a35abc54a50c1b8c9743c1815c4f10be8e..d47894ad99350ed181a58dcb83e08b197d119086 100644 --- a/pages/component/image/image-format.uvue +++ b/pages/component/image/image-format.uvue @@ -1,95 +1,96 @@ \ No newline at end of file + .image { + margin: 40rpx auto; + width: 200rpx; + } + diff --git a/pages/component/image/image-path.uvue b/pages/component/image/image-path.uvue index 08984261a1d92878c3ed1022b33f1cd2540b6180..cc54eb777d65a3f5ed20a475727d0c5c4b1e1ba3 100644 --- a/pages/component/image/image-path.uvue +++ b/pages/component/image/image-path.uvue @@ -8,13 +8,13 @@ {{item.description}} - + 非static目录的src静态路径:./logo.png - + @@ -27,6 +27,8 @@ data() { return { title: 'image-path', + outsideStaticPath: './logo.png', + outsideStaticErrorPath: null as string | null, data: [ { src: '/static/test-image/logo.png', @@ -91,16 +93,21 @@ } }, methods: { - imageErrorEvent(e : ImageErrorEvent) { + imageErrorEvent(index: number, e : ImageErrorEvent) { console.log("图片加载错误", e.detail); // 图片加载失败,加载本地占位图 - e.target?.setAttribute('src', '/static/template/drop-card/dislike.png') + this.data[index].errorImage = '/static/template/drop-card/dislike.png' + }, + imageOutsideStaticErrorEvent(e: ImageErrorEvent) { + console.log("图片加载错误", e.detail); + this.outsideStaticErrorPath = '/static/template/drop-card/dislike.png' } }, } type ImagePath = { src : string + errorImage ?: string | null description : string } diff --git a/pages/component/video/video-format.uvue b/pages/component/video/video-format.uvue index c907264b075c127fe663b5ff540de9a6836a3990..3fdd4d4e86ccb705369867aa69bed5d6f778d7a0 100644 --- a/pages/component/video/video-format.uvue +++ b/pages/component/video/video-format.uvue @@ -8,7 +8,7 @@ {{item.format}} + @error="onError(item.format, $event as VideoErrorEvent)"> 暂不支持的格式 @@ -78,10 +78,9 @@ } }, methods: { - onError: function (e : VideoErrorEvent) { - const id = e.target?.getAttribute("id"); - console.log(id + ":" + e.detail); - if (id != "video-错误路径") { + onError: function (format: string, e : VideoErrorEvent) { + console.log(format + ":" + e.detail); + if (format != "video-错误路径") { this.isError = true; } } diff --git a/pages/template/list-news/list-news.test.js b/pages/template/list-news/list-news.test.js index 78f6d5f5036450e6ee965254f158326779206cf4..507c196014d0dbd17d836fa49be62a1789cdb195 100644 --- a/pages/template/list-news/list-news.test.js +++ b/pages/template/list-news/list-news.test.js @@ -1,6 +1,12 @@ // uni-app自动化测试教程: https://uniapp.dcloud.net.cn/worktile/auto/hbuilderx-extension/ describe('template-list-news', () => { + if (process.env.uniTestPlatformInfo.startsWith('web')) { + it('dummyTest', async () => { + expect(1).toBe(1) + }) + return + } let page; beforeAll(async () => { page = await program.reLaunch('/pages/template/list-news/list-news');