提交 3e37c5fb 编写于 作者: 杜庆泉's avatar 杜庆泉

Merge branch 'master' of http://git.dcloud.io/uni-app-x/hello-uniapp-x into master

...@@ -85,6 +85,24 @@ ...@@ -85,6 +85,24 @@
"navigationBarTitleText": "image" "navigationBarTitleText": "image"
} }
}, },
{
"path": "pages/component/image/image-format",
"style": {
"navigationBarTitleText": "image-format"
}
},
{
"path": "pages/component/image/image-mode",
"style": {
"navigationBarTitleText": "image-mode"
}
},
{
"path": "pages/component/image/image-path",
"style": {
"navigationBarTitleText": "image-path"
}
},
{ {
"path": "pages/component/web-view/web-view", "path": "pages/component/web-view/web-view",
"style": { "style": {
...@@ -416,6 +434,16 @@ ...@@ -416,6 +434,16 @@
"style": { "style": {
"navigationBarTitleText": "text-decoration-line" "navigationBarTitleText": "text-decoration-line"
} }
},{
"path": "pages/CSS/transition/transition",
"style": {
"navigationBarTitleText": "Transition"
}
},{
"path": "pages/CSS/transform/transform",
"style": {
"navigationBarTitleText": "Transform"
}
}, { }, {
"path": "pages/API/request/request", "path": "pages/API/request/request",
"style": { "style": {
...@@ -486,6 +514,13 @@ ...@@ -486,6 +514,13 @@
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
}, {
"path": "pages/API/preview-image/preview-image",
"style": {
"navigationBarTitleText": "图片预览",
"enablePullDownRefresh": false
}
} }
], ],
"globalStyle": { "globalStyle": {
......
<template>
<view style="padding-left: 16rpx;padding-right: 16rpx;">
<view>
<text class="text-desc">图片指示器样式</text>
<radio-group class="cell-ct" style="background-color: white;" @change="onIndicatorChanged">
<view class="indicator-it" v-for="(item,index) in indicator" :key="item.value">
<radio :checked="index === 0" :value="item.value">{{item.name}}</radio>
</view>
</radio-group>
</view>
<view>
<checkbox-group @change="onCheckboxChange" style="margin-top: 32rpx;margin-bottom: 32rpx;margin-left: 16rpx;">
<checkbox :checked="isLoop" style="margin-right: 30rpx;">循环播放</checkbox>
</checkbox-group>
</view>
<view style="background-color: white;">
<text class="text-desc">点击图片开始预览</text>
<view class="cell-ct" style="background-color: #eeeeee; padding: 16rpx;">
<view class="cell cell-choose-image" v-for="(image,index) in imageList" :key="index">
<image style="width: 210rpx;height: 210rpx;" mode="aspectFit" :src="image" @click="previewImage(index)"></image>
</view>
<image class="cell cell-choose-image" src="/static/plus.png" @click="chooseImage">
<view></view>
</image>
</view>
</view>
</view>
</template>
<script>
type ItemType = {
value: string,
name: string
}
export default {
data() {
return {
imageList: ["https://web-assets.dcloud.net.cn/unidoc/zh/uni@2x.png", "/static/logo.png"],
indicator: [{
value: "default",
name: "圆点"
}, {
value: "number",
name: "数字"
}, {
value: "none",
name: "不显示"
}] as ItemType[],
currentIndicator: "default",
isLoop: true
}
},
methods: {
previewImage(index: number) {
uni.previewImage({
urls: this.imageList,
current: index,
indicator: this.currentIndicator,
loop: this.isLoop
})
},
chooseImage() {
uni.chooseImage({
sourceType: ['album'],
success: (e) => {
this.imageList = this.imageList.concat(e.tempFilePaths)
},
fail(e) {
}
})
},
onIndicatorChanged(e: RadioGroupChangeEvent) {
this.currentIndicator = e.detail.value
},
onCheckboxChange(e: CheckboxGroupChangeEvent) {
this.isLoop = !this.isLoop
}
}
}
</script>
<style>
.text-desc {
margin-top: 32rpx;
margin-left: 16rpx;
margin-bottom: 32rpx;
font-weight: bold;
}
.cell-ct {
display: flex;
flex-wrap: wrap;
flex-direction: row;
}
.cell {
margin-left: 14rpx;
width: 210rpx;
height: 210rpx;
}
.cell-choose-image {
border-width: 1px;
border-color: lightgray;
}
.indicator-it {
margin: 16rpx;
}
</style>
\ No newline at end of file
<template>
<view>
<view class="baseStyle" style="transform: translateX(120%);">translateX(120%)</view>
<view class="baseStyle" style="transform: translateY(-30rpx);">translateY(-30rpx)</view>
<view class="baseStyle" style="transform: translate(120%,50%);">translate(120%,50%)</view>
<view class="baseStyle" style="transform: scaleX(0.8);">scaleX(0.8)</view>
<view class="baseStyle" style="transform: scaleY(0.8);">scaleY(0.8)</view>
<view class="baseStyle" style="transform: scale(0.8,0.8);">scale(0.8,0.8)</view>
<view class="baseStyle" style="transform: rotate(20deg);">rotate(20deg)</view>
<view class="baseStyle" style="transform: rotateX(50deg);">rotateX(50deg)</view>
<view class="baseStyle" style="transform: rotateY(50deg);">rotateY(50deg)</view>
<view class="baseStyle" style="transform: rotateZ(50deg);">rotateZ(50deg)</view>
</view>
</template>
<script lang="ts">
export default {
data() {
return {}
},
methods: {
}
}
</script>
<style>
.baseStyle {
background-color: cadetblue;
margin: 10rpx;
width: 300rpx;
height: 300rpx;
align-items: center;
flex: 1;
justify-content: center;
}
</style>
\ No newline at end of file
<template>
<view>
<view class="container">
<text class="text">点击修改宽度</text>
<view class="base-style transition-width" :style="widthOrHeight" @click="changeWidthOrHeight"></view>
</view>
<view class="container">
<text class="text">点击修改Margin</text>
<view class="base-style transition-margin" :style="styleMargin" @click="changeMargin"></view>
</view>
<view class="container">
<text class="text">点击修改Padding</text>
<view class="base-style transition-padding" :style="stylePadding" @click="changePadding">
<view style="background-color: black;height: 50px;width: 50px;"></view>
</view>
</view>
<view class="container">
<text class="text">点击修改Background</text>
<view class="base-style transition-background" :style="styleBackground" @click="changeBackground"></view>
</view>
<view class="container">
<text class="text">点击修改Transform</text>
<view class="base-style transition-transform" :style="styleTransform" @click="changeTransform"></view>
</view>
<view class="container">
<text class="text">点击修改Border</text>
<view class="base-style transition-border" :style="styleBorder" @click="changeBorder"></view>
</view>
<view class="container">
<text class="text">点击修改Position</text>
<view class="base-style transition-position" :style="stylePosition" @click="changestylePosition"></view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
isTranstionWidthOrHeight: false,
widthOrHeight: "",
isTranstionChangeMargin: false,
styleMargin: "",
isTransitionStylePadding: false,
stylePadding: "",
isTransitionstyleBackground: false,
styleBackground: "",
isTransitionStyleTransform: false,
styleTransform: "",
isTransitionstyleBorder: false,
styleBorder: "",
isTransitionstylePosition: false,
stylePosition: ""
}
},
methods: {
changeWidthOrHeight() {
this.widthOrHeight = this.isTranstionWidthOrHeight ? "width:400rpx" : "width:600rpx"
this.isTranstionWidthOrHeight = !this.isTranstionWidthOrHeight
},
changeMargin() {
this.styleMargin = this.isTranstionChangeMargin ? "margin-top:0rpx;margin-left:0rpx" : "margin-top:100rpx;margin-left:100rpx"
this.isTranstionChangeMargin = !this.isTranstionChangeMargin
},
changePadding() {
this.stylePadding = this.isTransitionStylePadding ? "padding-top:0rpx;padding-left:0rpx" : "padding-top:100rpx;padding-left:100rpx"
this.isTransitionStylePadding = !this.isTransitionStylePadding
},
changeBackground() {
this.styleBackground = this.isTransitionstyleBackground ? "background-color: brown;opacity:1" : "background-color: black;opacity:0.5"
this.isTransitionstyleBackground = !this.isTransitionstyleBackground
},
changeTransform() {
this.styleTransform = this.isTransitionStyleTransform ? "transform: rotate(0deg)" : "transform: rotate(135deg)"
this.isTransitionStyleTransform = !this.isTransitionStyleTransform
},
changeBorder() {
this.styleBorder = this.isTransitionstyleBorder ? "border-color: brown;" : "border-color: yellow;"
this.isTransitionstyleBorder = !this.isTransitionstyleBorder
},
changestylePosition() {
this.stylePosition = this.isTransitionstylePosition ? "left:0rpx" : "left:150rpx;"
this.isTransitionstylePosition = !this.isTransitionstylePosition
}
}
}
</script>
<style>
.container {
margin: 15rpx;
background-color: white;
}
.text{
margin-top: 20rpx;
margin-bottom: 32rpx;
}
.base-style {
width: 400rpx;
height: 400rpx;
background-color: brown;
}
.transition-width {
transition-property: width;
transition-duration: 1000;
}
.transition-margin {
transition-property: margin-left, margin-top;
transition-duration: 1000;
}
.transition-padding {
transition-property: padding-left, padding-top;
transition-duration: 1000;
}
.transition-background {
transition-property: background-color, opacity;
transition-duration: 1000;
}
.transition-transform {
transition-property: transform;
transition-duration: 1000;
}
.transition-border {
border-width: 5px;
border-color: brown;
transition-property: border-color;
transition-duration: 1000;
}
.transition-position {
transition-property: left;
transition-duration: 1000;
}
</style>
\ No newline at end of file
<template>
<view>
<page-head :title="title"></page-head>
<view class="uni-padding-wrap uni-common-mt">
<view class="uni-title">
<text class="uni-title-text">支持的图片格式示例</text>
</view>
<view v-for="(item,index) in data" :key="index">
<text class="uni-subtitle-text">{{item.format}}</text>
<view class="uni-center" style="background:#FFFFFF;">
<image class="image" mode="widthFix" :src="item.src"></image>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
title: 'image-format',
data: [{
format: 'png',
src: '/static/logo.png'
},
{
format: 'jpg',
src: '/static/logo.jpg'
},
{
format: 'webp',
src: '/static/logo.webp'
},
{
format: 'bmp',
src: '/static/logo.bmp'
},
{
format: 'gif',
src: '/static/logo.gif'
}
] as Array < ImageFormat >
}
}
}
class ImageFormat {
format: string;
src: string;
constructor(format: string, src: string) {
this.format = format;
this.src = src;
}
}
</script>
<style>
.image {
margin: 40rpx auto;
width: 200rpx;
}
</style>
\ No newline at end of file
<template>
<view>
<page-head :title="title"></page-head>
<view class="uni-padding-wrap uni-common-mt">
<view class="uni-title">
<text class="uni-title-text">支持的图片缩放模式示例</text>
</view>
<view v-for="(item,index) in data" :key="index">
<text class="uni-subtitle-text">{{item.mode}}: {{item.description}}</text>
<view class="uni-center" style="background:#FFFFFF;">
<image class="image" :mode="item.mode" src="/static/shuijiao.jpg"></image>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
title: 'image-mode',
data: [{
mode: 'scaleToFill',
description: '不保持纵横比缩放图片,使图片的宽高完全拉伸至填满 image 元素'
},
{
mode: 'aspectFit',
description: '保持纵横比缩放图片,使图片的长边能完全显示出来。也就是说,可以完整地将图片显示出来'
},
{
mode: 'aspectFill',
description: '保持纵横比缩放图片,只保证图片的短边能完全显示出来。也就是说,图片通常只在水平或垂直方向是完整的,另一个方向将会发生截取'
},
{
mode: 'top',
description: '不缩放图片,只显示图片的顶部区域'
},
{
mode: 'bottom',
description: '不缩放图片,只显示图片的底部区域'
},
{
mode: 'center',
description: '不缩放图片,只显示图片的中间区域'
},
{
mode: 'left',
description: '不缩放图片,只显示图片的左边区域'
},
{
mode: 'right',
description: '不缩放图片,只显示图片的右边区域'
},
{
mode: 'top left',
description: '不缩放图片,只显示图片的左上边区域'
},
{
mode: 'top right',
description: '不缩放图片,只显示图片的右上边区域'
},
{
mode: 'bottom left',
description: '不缩放图片,只显示图片的左下边区域'
},
{
mode: 'bottom right',
description: '不缩放图片,只显示图片的右下边区域'
},
{
mode: 'widthFix',
description: '宽度不变,高度自动变化,保持原图宽高比不变'
},
{
mode: 'heightFix',
description: '高度不变,宽度自动变化,保持原图宽高比不变'
}
] as Array < ImageMode >
}
}
}
class ImageMode {
mode: string;
description: string;
constructor(mode: string, description: string) {
this.mode = mode;
this.description = description;
}
}
</script>
<style>
.image {
margin: 40rpx auto;
width: 200rpx;
height: 200rpx;
background-color: #eeeeee;
}
</style>
\ No newline at end of file
<template>
<view>
<page-head :title="title"></page-head>
<view class="uni-padding-wrap uni-common-mt">
<view class="uni-title">
<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>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
title: 'image-path',
data: [{
src: 'https://web-assets.dcloud.net.cn/unidoc/zh/uni@2x.png',
description: '网络路径'
},
{
src: '/static/logo.png',
description: '本地相对路径'
},
{
src: 'file:///storage/emulated/0/Android/data/io.dcloud.uniappx/apps/__UNI__4517034/www/static/logo.png',
description: '本地绝对路径'
},
{
src: 'data:image/*;base64,iVBORw0KGgoAAAANSUhEUgAAAMAAAADACAYAAABS3GwHAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAABZ0RVh0Q3JlYXRpb24gVGltZQAwNS8xMi8yM3CzGsQAAAAcdEVYdFNvZnR3YXJlAEFkb2JlIEZpcmV3b3JrcyBDUzbovLKMAAAQGUlEQVR4nO3df5ScVX3H8ffMLpsfBDCkQrQQQiAhHq5EIog+IAKCpwqHcFQKTbQg2AultLUiUDg5gNZfh2CFWj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Xx6dZDgSOBCfjPEhPw1yDGA+OAUXVW34k/K7MO32dfjT/AV+EP9hfyHjqw0/0/VOBpKm24LQkAAAAASUVORK5CYII=',
description: 'Base64'
}
] as Array < ImagePath >
}
}
}
class ImagePath {
src: string;
description: string;
constructor(src: string, description: string) {
this.src = src;
this.description = description;
}
}
</script>
<style>
.image {
margin: 40rpx auto;
width: 200rpx;
}
</style>
\ No newline at end of file
...@@ -2,27 +2,18 @@ ...@@ -2,27 +2,18 @@
<view> <view>
<page-head :title="title"></page-head> <page-head :title="title"></page-head>
<view class="uni-padding-wrap uni-common-mt"> <view class="uni-padding-wrap uni-common-mt">
<view class="uni-title"> <view class="uni-center" style="background:#FFFFFF;">
<text class="uni-title-text"> <image class="image" :fade-show="true" mode="widthFix" src="/static/logo.png" @error="error"
示例1 @load="load"></image>
</text>
<text class="uni-subtitle-text">
本地图片
</text>
</view> </view>
<view class="uni-center" style="background:#FFFFFF; font-size:0;"> <view class="uni-btn-v">
<image class="image" mode="widthFix" src="/static/uni.png" /> <button type="primary" @tap="imageFormat">图片格式示例</button>
</view> </view>
<view class="uni-title"> <view class="uni-btn-v">
<text class="uni-title-text"> <button type="primary" @tap="imageMode">图片缩放模式示例</button>
示例2
</text>
<text class="uni-subtitle-text">
网络图片
</text>
</view> </view>
<view class="uni-center" style="background:#FFFFFF; font-size:0;"> <view class="uni-btn-v">
<image class="image" mode="widthFix" src="https://web-assets.dcloud.net.cn/unidoc/zh/uni@2x.png" /> <button type="primary" @tap="imagePath">图片路径示例</button>
</view> </view>
</view> </view>
</view> </view>
...@@ -33,6 +24,29 @@ ...@@ -33,6 +24,29 @@
return { return {
title: 'image' title: 'image'
} }
},
methods: {
error(event: ImageErrorEvent) {
console.log(event.type, event.detail);
},
load(event: ImageLoadEvent) {
console.log(event.type, event.detail);
},
imageFormat() {
uni.navigateTo({
url: '/pages/component/image/image-format'
});
},
imageMode() {
uni.navigateTo({
url: '/pages/component/image/image-mode'
});
},
imagePath() {
uni.navigateTo({
url: '/pages/component/image/image-path'
});
}
} }
} }
</script> </script>
......
...@@ -270,6 +270,11 @@ ...@@ -270,6 +270,11 @@
name: "图片", name: "图片",
url: "image", url: "image",
}, },
{
name: "图片预览",
url: "preview-image",
enable: true
},
// #ifndef MP-LARK // #ifndef MP-LARK
{ {
name: "音频", name: "音频",
......
...@@ -5,19 +5,16 @@ ...@@ -5,19 +5,16 @@
</view> </view>
<view class="uni-hello-text"> <view class="uni-hello-text">
<text class="hello-text">uni-app x目前已支持的CSS属性,展示样式仅供参考,文档详见:</text> <text class="hello-text">uni-app x目前已支持的CSS属性,展示样式仅供参考,文档详见:</text>
<u-link :href="'https://uniapp.dcloud.io/component/'" :text="'https://uniapp.dcloud.io/component/'" <u-link :href="'https://uniapp.dcloud.io/component/'" :text="'https://uniapp.dcloud.io/component/'" :inWhiteList="true"></u-link>
:inWhiteList="true"></u-link>
</view> </view>
<view class="uni-panel" v-for="(item, index) in list" :key="item.id"> <view class="uni-panel" v-for="(item, index) in list" :key="item.id">
<view class="uni-panel-h" :class="item.open ? 'uni-panel-h-on' : ''" @click="triggerCollapse(index, item)"> <view class="uni-panel-h" :class="item.open ? 'uni-panel-h-on' : ''" @click="triggerCollapse(index, item)">
<text class="uni-panel-text" :class="item.enable == false ? 'text-disabled' : ''">{{item.name}}</text> <text class="uni-panel-text" :class="item.enable == false ? 'text-disabled' : ''">{{item.name}}</text>
<image :src="item.pages.length > 0 ? item.open ? arrowUpIcon : arrowDownIcon : arrowRightIcon" <image :src="item.pages.length > 0 ? item.open ? arrowUpIcon : arrowDownIcon : arrowRightIcon" class="uni-icon"></image>
class="uni-icon"></image>
</view> </view>
<view class="uni-panel-c" v-if="item.open"> <view class="uni-panel-c" v-if="item.open">
<view class="uni-navigate-item" v-for="(page,key) in item.pages" :key="key" @click="goDetailPage(page)"> <view class="uni-navigate-item" v-for="(page,key) in item.pages" :key="key" @click="goDetailPage(page)">
<text class="uni-navigate-text" <text class="uni-navigate-text" :class="page.enable != true ? 'text-disabled' : ''">{{page.name}}</text>
:class="page.enable != true ? 'text-disabled' : ''">{{page.name}}</text>
<image :src="arrowRightIcon" class="uni-icon"></image> <image :src="arrowRightIcon" class="uni-icon"></image>
</view> </view>
</view> </view>
...@@ -298,6 +295,22 @@ ...@@ -298,6 +295,22 @@
url: 'pages/CSS/text/text-decoration-line' url: 'pages/CSS/text/text-decoration-line'
} }
] as Page[] ] as Page[]
}, {
id: 'animate',
name: '动画',
open: false,
pages: [
{
name: 'transition',
enable: true,
url: 'pages/CSS/transition/transition'
},
{
name: 'transform',
enable: true,
url: 'pages/CSS/transform/transform'
}
] as Page[]
} }
] as ListItem[], ] as ListItem[],
arrowUpIcon: '/static/icons/arrow-up.png', arrowUpIcon: '/static/icons/arrow-up.png',
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册