提交 a0d2083e 编写于 作者: W wanganxp

完善字体和图片测试

上级 f5cac7bd
......@@ -16,7 +16,7 @@
}}</text>
<text style="margin-left:5px;line-height:22px;">\ue101</text>
</view>
<text class="uni-common-mt font-size-20">上一页非全局加载字体:</text>
<text class="uni-common-mt font-size-20">上一页非全局加载字体(不生效为正常):</text>
<text class="font-size-20 line-height-40" style="font-family: AlimamaDaoLiTiTTF"
>font-family: 阿里妈妈刀隶体-ttf</text
>
......
<template>
<view>
<page-head title="loadFontFace"></page-head>
<view class="uni-padding-wrap">
<text class="font-size-20">全局加载字体:</text>
<text class="font-size-20 line-height-40" style="font-family: UniFontFamily"
>font-family: uni.ttf</text
>
<view style="flex-direction: row;">
<text class="font-size-20" style="font-family: UniFontFamily;">{{
<view>
<page-head title="loadFontFace"></page-head>
<view class="uni-padding-wrap">
<text class="font-size-20">全局加载字体:</text>
<text class="font-size-20 line-height-40" style="font-family: UniFontFamily">font-family: uni.ttf</text>
<view style="flex-direction: row;">
<text class="font-size-20" style="font-family: UniFontFamily;">{{
uniIcon1
}}</text>
<text style="margin-left:5px;margin-right: 20px;line-height:22px;">\ue100</text>
<text class="font-size-20" style="font-family: UniFontFamily;">{{
<text style="margin-left:5px;margin-right: 20px;line-height:22px;">\ue100</text>
<text class="font-size-20" style="font-family: UniFontFamily;">{{
uniIcon2
}}</text>
<text style="margin-left:5px;line-height:22px;">\ue101</text>
</view>
<text class="uni-common-mt font-size-20">非全局加载字体:</text>
<text class="font-size-20 line-height-40" style="font-family: AlimamaDaoLiTiTTF"
>font-family: 阿里妈妈刀隶体-ttf (网络字体下载后生效)</text
>
<text class="font-size-20 line-height-40" style="font-family: AlimamaDaoLiTiOTF"
>font-family: 阿里妈妈刀隶体-otf</text
>
<!-- <text class="item" style="font-family: AlimamaDaoLiTiWOFF"
>font-family: 阿里妈妈刀隶体-woff</text
>
<text class="item" style="font-family: AlimamaDaoLiTiWOFF2"
>font-family: 阿里妈妈刀隶体-woff2</text
> -->
<button class="uni-btn" @click="navigateToChild">跳转子页面</button>
</view>
</view>
<text style="margin-left:5px;line-height:22px;">\ue101</text>
</view>
<text class="uni-common-mt font-size-20">非全局加载字体:</text>
<text class="font-size-20 line-height-40" style="font-family: AlimamaDaoLiTiTTF">font-family: 阿里妈妈刀隶体-ttf
(网络字体下载后生效)</text>
<text class="font-size-20 line-height-40" style="font-family: AlimamaDaoLiTiOTF">font-family:
阿里妈妈刀隶体-otf</text>
<text class="item" style="font-family: AlimamaDaoLiTiWOFF">font-family: 阿里妈妈刀隶体-woff</text>
<text class="item" style="font-family: AlimamaDaoLiTiWOFF2">font-family: 阿里妈妈刀隶体-woff2</text>
<button class="uni-btn" @click="navigateToChild">跳转子页面测试字体生效范围</button>
</view>
</view>
</template>
<script>
export default {
data() {
return {
uniIcon1: '\ue100',
uniIcon2: '\ue101',
}
},
onLoad() {
uni.loadFontFace({
global: true,
family: 'UniFontFamily',
source: '/static/font/uni.ttf',
success() {
console.log('global loadFontFace uni.ttf success')
},
fail(error) {
console.warn('global loadFontFace uni.ttf fail', error.errMsg)
},
})
uni.loadFontFace({
family: 'AlimamaDaoLiTiTTF',
source:
'https://native-res.dcloud.net.cn/uni-app-x/static/font/AlimamaDaoLiTi.ttf',
success() {
console.log('loadFontFace AlimamaDaoLiTi.ttf success')
},
fail(error) {
console.warn('loadFontFace AlimamaDaoLiTi.ttf fail', error.errMsg)
},
})
uni.loadFontFace({
family: 'AlimamaDaoLiTiOTF',
source: '/static/font/AlimamaDaoLiTi.otf',
success() {
console.log('loadFontFace AlimamaDaoLiTi.otf success')
},
fail(error) {
console.warn('loadFontFace AlimamaDaoLiTi.otf fail', error.errMsg)
},
})
// uni.loadFontFace({
// family: 'AlimamaDaoLiTiWOFF',
// source: '/static/font/AlimamaDaoLiTi.woff',
// success() {
// console.log('loadFontFace AlimamaDaoLiTi.woff success')
// },
// fail(error) {
// console.warn('loadFontFace AlimamaDaoLiTi.woff fail', error.errMsg)
// },
// })
// uni.loadFontFace({
// family: 'AlimamaDaoLiTiWOFF2',
// source: '/static/font/AlimamaDaoLiTi.woff2',
// success() {
// console.log('loadFontFace AlimamaDaoLiTi.woff2 success')
// },
// fail(error) {
// console.warn('loadFontFace AlimamaDaoLiTi.woff2 fail', error.errMsg)
// },
// })
},
methods: {
navigateToChild() {
uni.navigateTo({
url: '/pages/API/load-font-face/load-font-face-child',
})
},
},
}
export default {
data() {
return {
uniIcon1: '\ue100',
uniIcon2: '\ue101',
}
},
onLoad() {
uni.loadFontFace({
global: true,
family: 'UniFontFamily',
source: '/static/font/uni.ttf',
success() {
console.log('global loadFontFace uni.ttf success')
},
fail(error) {
console.warn('global loadFontFace uni.ttf fail', error.errMsg)
},
})
uni.loadFontFace({
family: 'AlimamaDaoLiTiTTF',
source:
'https://native-res.dcloud.net.cn/uni-app-x/static/font/AlimamaDaoLiTi.ttf',
success() {
console.log('loadFontFace Remote AlimamaDaoLiTi.ttf success')
},
fail(error) {
console.warn('loadFontFace Remote AlimamaDaoLiTi.ttf fail', error.errMsg)
},
})
uni.loadFontFace({
family: 'AlimamaDaoLiTiOTF',
source: '/static/font/AlimamaDaoLiTi.otf',
success() {
console.log('loadFontFace AlimamaDaoLiTi.otf success')
},
fail(error) {
console.warn('loadFontFace AlimamaDaoLiTi.otf fail', error.errMsg)
},
})
uni.loadFontFace({
family: 'AlimamaDaoLiTiWOFF',
source: '/static/font/AlimamaDaoLiTi.woff',
success() {
console.log('loadFontFace AlimamaDaoLiTi.woff success')
},
fail(error) {
console.warn('loadFontFace AlimamaDaoLiTi.woff fail', error.errMsg)
},
})
uni.loadFontFace({
family: 'AlimamaDaoLiTiWOFF2',
source: '/static/font/AlimamaDaoLiTi.woff2',
success() {
console.log('loadFontFace AlimamaDaoLiTi.woff2 success')
},
fail(error) {
console.warn('loadFontFace AlimamaDaoLiTi.woff2 fail', error.errMsg)
},
})
},
methods: {
navigateToChild() {
uni.navigateTo({
url: '/pages/API/load-font-face/load-font-face-child',
})
},
},
}
</script>
<style>
.font-size-20 {
font-size: 20px;
}
.line-height-40 {
line-height: 40px;
}
</style>
.font-size-20 {
font-size: 20px;
}
.line-height-40 {
line-height: 40px;
}
</style>
\ No newline at end of file
......@@ -11,6 +11,15 @@
<image class="image" mode="widthFix" :src="item.src"></image>
</view>
</view>
<view class="uni-title">
<text class="uni-title-text">暂不支持的格式</text>
</view>
<view>
<text class="uni-subtitle-text">tif</text>
<view class="uni-center" style="background:#FFFFFF;">
<image src="/static/test-image/logo.tif" @error="imageErrorEvent"></image>
</view>
</view>
</view>
</view>
</template>
......@@ -20,29 +29,47 @@
data() {
return {
title: 'image-format',
data: [{
format: 'png',
src: '/static/logo.png'
data: [
{
format: 'avif',
src: '/static/test-image/logo.avif' //TODO
},
{
format: 'jpg',
src: '/static/logo.jpg'
format: 'bmp',
src: '/static/test-image/logo.bmp'
},
{
format: 'webp',
src: '/static/logo.webp'
format: 'gif',
src: '/static/test-image/logo.gif'
},
{
format: 'bmp',
src: '/static/logo.bmp'
format: 'heic',
src: '/static/test-image/logo.heic'
},
{
format: 'gif',
src: '/static/logo.gif'
format: 'ico',
src: '/static/test-image/logo.ico'
},
{
format: 'jpg',
src: '/static/test-image/logo.jpg'
},
{
format: 'png',
src: '/static/test-image/logo.png'
},
{
format: 'webp',
src: '/static/test-image/logo.webp'
}
] as Array < ImageFormat >
}
}
},
methods: {
imageErrorEvent(e:ImageErrorEvent) {
console.log("图片加载错误",e.detail); //TODO tif打不出正确的错误日志
}
},
}
class ImageFormat {
......
......@@ -3,12 +3,12 @@
<page-head :title="title"></page-head>
<view class="uni-padding-wrap uni-common-mt">
<view class="uni-title">
<text class="uni-title-text">支持的图片路径示例</text>
<text class="uni-title-text">图片路径示例</text>
</view>
<view v-for="(item,index) in data" :key="index">
<text class="uni-subtitle-text">{{item.description}}</text>
<view class="uni-center" style="background:#FFFFFF;">
<image class="image" mode="widthFix" :src="item.src"></image>
<image class="image" mode="widthFix" :src="item.src" @error="imageErrorEvent"></image>
</view>
</view>
</view>
......@@ -20,25 +20,58 @@
data() {
return {
title: 'image-path',
data: [{
src: 'https://web-assets.dcloud.net.cn/unidoc/zh/uni@2x.png',
description: '网络路径'
data: [
{
src: '/static/test-image/logo.png',
description: '本地根路径'
},
{
src: '/static/logo.png',
src: '../../../static/test-image/logo.png', //TODO
description: '本地相对路径'
},
{
src: 'file:///storage/emulated/0/Android/data/io.dcloud.uniappx/apps/__UNI__4517034/www/static/logo.png',
src: 'logo.png', //TODO
description: '本地当前路径'
},
{
src: 'file:///storage/emulated/0/Android/data/io.dcloud.uniappx/apps/__UNI__4517034/www/static/test-image/logo.png',
description: '本地绝对路径'
},
{
src: 'testerror.jpg',
description: '错误的本地路径'
},
{
src: 'data:image/*;base64,iVBORw0KGgoAAAANSUhEUgAAAMAAAADACAYAAABS3GwHAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAABZ0RVh0Q3JlYXRpb24gVGltZQAwNS8xMi8yM3CzGsQAAAAcdEVYdFNvZnR3YXJlAEFkb2JlIEZpcmV3b3JrcyBDUzbovLKMAAAQGUlEQVR4nO3df5ScVX3H8ffMLpsfBDCkQrQQQiAhHq5EIog+IAKCpwqHcFQKTbQg2AultLUiUDg5gNZfh2CFWjl45UBpg5IaUYugRUsSoDdIUBO9QhAhIYQ0AUlIQn4nO/3jPgPDZmd3Zp4f95mZ7+ucPezOPj8+WZ7v3DvPj3tLlUoFkR5lojJwCDAROAw4PP4aDxwMjAP2B0YBfUAJ2AnsADYD64F18dfzwIqa/6522m7L71/T+UpSAK1RJtoPmAAcARwJTIp/Phj4E2A/YDSwD9ALlJvcRQXYDewCtgFbgFeAl4BVwErgD/HXSqft+kT/oC4lBdAAZaIe4CjgOOA9wLH4g/6gkLlqbACeA34L/BJYAjin7ZagqdqAFEAdykRHAe8HTsMf+JPDJmraGnwxPAwsBJY5bXcFTVRAUgAxZaIRQAR8BDgdmIbvn3eKZ4EFwAPAQqfthsB5CqGrC0CZqBf/Ln8u8Gf4D6vd4I/4Y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4r8sEPBW8BaikTfRD4BvCO0FnEkF4FrnbatsWV/kK3ALWctv8DHIfvT7ZH1Xafe4Hp7XLwQxu1ALWUiU7AF0LLowKLVK0A/tFp23ZT6bZlAVQpE10CXIdcPAtlB3Az/qruxtBhWtHWBQCgTDQOuBr4W2Bk4Djd5HvA5522vwsdJIm2L4AqZaIpwLXAJ2mjzzZt6OfAl5y2C8PGSEfHFECVMtG78LMFzkQKIU0LgDlO25+EDpKmjiuAKmWiafhhGmciV5OTeAC4xWn7YOggWejYAqhSJjoCP4vNBciH5UZtwffxb3PaFmI20Kx0fAFUKRPtD5wLfAq527Se5fiHVOY6bZ8PHSYPXVMAteLrCLOAc4BDA8cJbQPwE/yB/6DTdk/gPLnqygKoUibaFzgN3zKcDrwtbKLcvAYsAuYDD4R4GL0ouroAaikT7Qd8ADgLOBWYEjZR6tYADwP3Aw/FI3h3PSmAQSgT9QDH4B/OOQWYDhwSMFIr1uPH2nkUfwpzidN2S9hIxSMF0ABlotHA0fib8Y4HpgGTgKLMzr0Vfz+OA57ATyX0G6ftK0FTtQEpgBbFt2BMBCbHX4fjP1AfBBwIjMHfmtEbf7WiH9iFn2jkNfytxi8Dq4GVwDPA74EVTtv/a3EfXU0KIGXx6dZDgSOBCfjPEhPw1yDGA+OAUXVW34k/K7MO32dfjT/AV+EP9hfyHjqw0/0/VOBpKm24LQkAAAAASUVORK5CYII=',
description: 'Base64'
}
},
{
src: 'https://request.dcloud.net.cn/api/http/contentType/image/png',
description: '正确网络路径'
},{
src: 'https://request.dcloud.net.cn/api/http/contentType/wrongImage/gif',
description: '错误网络格式,假gif实为jpeg'
},{
src: 'https://request.dcloud.net.cn/api/http/contentType/wrongImage/jpeg',
description: '错误网络格式,假jpg实为png'
},{
src: 'https://request.dcloud.net.cn/api/http/contentType/wrongImage/png',
description: '错误网络格式,假png实为gif'
},{
src: 'https://request.dcloud.net.cn/api/http/contentType/404',
description: '错误网络地址404接口'
},{
src: 'https://request.dcloud.net.cn/api/http/contentType/404.png',
description: '错误网络地址,不存在的图片'
},
] as Array < ImagePath >
}
}
},
methods: {
imageErrorEvent(e:ImageErrorEvent) {
console.log("图片加载错误",e.detail); //TODO
}
},
}
class ImagePath {
......
......@@ -3,7 +3,7 @@
<page-head :title="title"></page-head>
<view class="uni-padding-wrap uni-common-mt">
<view class="uni-center" style="background:#FFFFFF;">
<image class="image" :fade-show="true" mode="widthFix" src="/static/logo.png" @error="error"
<image class="image" :fade-show="true" mode="widthFix" src="/static/test-image/logo.png" @error="error"
@load="load"></image>
</view>
<view class="uni-btn-v">
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册