first add files
This commit is contained in:
21
ProjectLiaisonForm/pages/avatar/action/index.js
Normal file
21
ProjectLiaisonForm/pages/avatar/action/index.js
Normal file
@@ -0,0 +1,21 @@
|
||||
Component({
|
||||
data: {
|
||||
pics: [
|
||||
'https://tdesign.gtimg.com/mobile/demos/avatar1.png',
|
||||
'https://tdesign.gtimg.com/mobile/demos/avatar2.png',
|
||||
'https://tdesign.gtimg.com/mobile/demos/avatar3.png',
|
||||
'https://tdesign.gtimg.com/mobile/demos/avatar4.png',
|
||||
'https://tdesign.gtimg.com/mobile/demos/avatar5.png',
|
||||
'https://tdesign.gtimg.com/mobile/demos/avatar1.png',
|
||||
],
|
||||
},
|
||||
|
||||
methods: {
|
||||
onAddTap() {
|
||||
wx.showToast({ title: '您按下了添加', icon: 'none', duration: 1000 });
|
||||
},
|
||||
onClickCollapsedAvatar() {
|
||||
console.log('click collapsed avatar');
|
||||
},
|
||||
},
|
||||
});
|
||||
7
ProjectLiaisonForm/pages/avatar/action/index.json
Normal file
7
ProjectLiaisonForm/pages/avatar/action/index.json
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"t-avatar": "tdesign-miniprogram/avatar/avatar",
|
||||
"t-avatar-group": "tdesign-miniprogram/avatar-group/avatar-group"
|
||||
}
|
||||
}
|
||||
3
ProjectLiaisonForm/pages/avatar/action/index.wxml
Normal file
3
ProjectLiaisonForm/pages/avatar/action/index.wxml
Normal file
@@ -0,0 +1,3 @@
|
||||
<t-avatar-group cascading="right-up" max="5" bind:collapsed-item-click="onClickCollapsedAvatar">
|
||||
<t-avatar wx:for="{{pics}}" wx:for-item="pic" wx:key="index" image="{{pic}}" />
|
||||
</t-avatar-group>
|
||||
0
ProjectLiaisonForm/pages/avatar/action/index.wxss
Normal file
0
ProjectLiaisonForm/pages/avatar/action/index.wxss
Normal file
1
ProjectLiaisonForm/pages/avatar/avatar.d.ts
vendored
Normal file
1
ProjectLiaisonForm/pages/avatar/avatar.d.ts
vendored
Normal file
@@ -0,0 +1 @@
|
||||
|
||||
1
ProjectLiaisonForm/pages/avatar/avatar.js
Normal file
1
ProjectLiaisonForm/pages/avatar/avatar.js
Normal file
@@ -0,0 +1 @@
|
||||
Page({});
|
||||
13
ProjectLiaisonForm/pages/avatar/avatar.json
Normal file
13
ProjectLiaisonForm/pages/avatar/avatar.json
Normal file
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"navigationBarTitleText": "Avatar",
|
||||
"navigationBarBackgroundColor": "#fff",
|
||||
"usingComponents": {
|
||||
"imageAvatar": "./image-avatar",
|
||||
"characterAvatar": "./character-avatar",
|
||||
"iconAvatar": "./icon-avatar",
|
||||
"badgeAvatar": "./badge-avatar",
|
||||
"size": "./size",
|
||||
"exhibition": "./exhibition",
|
||||
"action": "./action"
|
||||
}
|
||||
}
|
||||
36
ProjectLiaisonForm/pages/avatar/avatar.wxml
Normal file
36
ProjectLiaisonForm/pages/avatar/avatar.wxml
Normal file
@@ -0,0 +1,36 @@
|
||||
<view class="skyline">
|
||||
<t-navbar class="demo-navbar" title="Avatar" leftArrow />
|
||||
<scroll-view scroll-y type="list" class="scroll-view">
|
||||
<view class="demo">
|
||||
<t-demo-header
|
||||
title="Avatar 头像"
|
||||
desc="用于展示用户头像信息,除了纯展示也可点击进入个人详情等操作。"
|
||||
notice="渲染框架支持情况:Skyline、WebView"
|
||||
/>
|
||||
<t-demo title="01 组件类型" desc="图片头像" padding>
|
||||
<imageAvatar />
|
||||
</t-demo>
|
||||
<t-demo desc="字符头像" padding>
|
||||
<characterAvatar />
|
||||
</t-demo>
|
||||
<t-demo desc="图标头像" padding>
|
||||
<iconAvatar />
|
||||
</t-demo>
|
||||
|
||||
<t-demo desc="带徽标头像" padding>
|
||||
<badgeAvatar />
|
||||
</t-demo>
|
||||
|
||||
<t-demo title="02 特殊类型" desc="纯展示的头像组" padding>
|
||||
<exhibition />
|
||||
</t-demo>
|
||||
<t-demo desc="带操作的头像组" padding>
|
||||
<action />
|
||||
</t-demo>
|
||||
|
||||
<t-demo title="03 组件尺寸" desc="组件尺寸" padding>
|
||||
<size />
|
||||
</t-demo>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
12
ProjectLiaisonForm/pages/avatar/avatar.wxss
Normal file
12
ProjectLiaisonForm/pages/avatar/avatar.wxss
Normal file
@@ -0,0 +1,12 @@
|
||||
page {
|
||||
background-color: var(--td-bg-color-container);
|
||||
}
|
||||
.demo-avatar {
|
||||
margin: 0 32rpx;
|
||||
}
|
||||
.desc {
|
||||
margin: 10rpx 32rpx;
|
||||
color: #999;
|
||||
font-size: 26rpx;
|
||||
line-height: 36rpx;
|
||||
}
|
||||
5
ProjectLiaisonForm/pages/avatar/badge-avatar/index.js
Normal file
5
ProjectLiaisonForm/pages/avatar/badge-avatar/index.js
Normal file
@@ -0,0 +1,5 @@
|
||||
Component({
|
||||
data: {
|
||||
image: 'https://tdesign.gtimg.com/mobile/demos/avatar1.png',
|
||||
},
|
||||
});
|
||||
6
ProjectLiaisonForm/pages/avatar/badge-avatar/index.json
Normal file
6
ProjectLiaisonForm/pages/avatar/badge-avatar/index.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"t-avatar": "tdesign-miniprogram/avatar/avatar"
|
||||
}
|
||||
}
|
||||
8
ProjectLiaisonForm/pages/avatar/badge-avatar/index.wxml
Normal file
8
ProjectLiaisonForm/pages/avatar/badge-avatar/index.wxml
Normal file
@@ -0,0 +1,8 @@
|
||||
<t-avatar class="avatar-example" image="{{image}}" badge-props="{{ {dot: true, offset: [0, 4] } }}" />
|
||||
<t-avatar
|
||||
class="avatar-example"
|
||||
t-class-content="external-class-content"
|
||||
badge-props="{{ {count: 8, offset: [-6, 6] } }}"
|
||||
>A</t-avatar
|
||||
>
|
||||
<t-avatar class="avatar-example" icon="user" badge-props="{{ {count: 12, offset: [-6, 6] } }}" />
|
||||
9
ProjectLiaisonForm/pages/avatar/badge-avatar/index.wxss
Normal file
9
ProjectLiaisonForm/pages/avatar/badge-avatar/index.wxss
Normal file
@@ -0,0 +1,9 @@
|
||||
.avatar-example:not(:last-child) {
|
||||
margin-right: 64rpx;
|
||||
}
|
||||
|
||||
.external-class-content {
|
||||
color: #fff;
|
||||
background-color: var(--td-brand-color, #0052d9);
|
||||
font-weight: 400;
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
Component({
|
||||
data: {
|
||||
image: 'https://tdesign.gtimg.com/mobile/demos/avatar1.png',
|
||||
},
|
||||
});
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"t-avatar": "tdesign-miniprogram/avatar/avatar"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
<t-avatar class="avatar-example" t-class-content="external-class-content" aria-label="字符头像">A</t-avatar>
|
||||
<t-avatar class="avatar-example" t-class-content="external-class-content" shape="round">A</t-avatar>
|
||||
@@ -0,0 +1,9 @@
|
||||
.avatar-example:not(:last-child) {
|
||||
margin-right: 64rpx;
|
||||
}
|
||||
|
||||
.external-class-content {
|
||||
color: #fff;
|
||||
background-color: var(--td-brand-color, #0052d9);
|
||||
font-weight: 400;
|
||||
}
|
||||
12
ProjectLiaisonForm/pages/avatar/exhibition/index.js
Normal file
12
ProjectLiaisonForm/pages/avatar/exhibition/index.js
Normal file
@@ -0,0 +1,12 @@
|
||||
Component({
|
||||
data: {
|
||||
pics: [
|
||||
'https://tdesign.gtimg.com/mobile/demos/avatar1.png',
|
||||
'https://tdesign.gtimg.com/mobile/demos/avatar2.png',
|
||||
'https://tdesign.gtimg.com/mobile/demos/avatar3.png',
|
||||
'https://tdesign.gtimg.com/mobile/demos/avatar4.png',
|
||||
'https://tdesign.gtimg.com/mobile/demos/avatar5.png',
|
||||
'https://tdesign.gtimg.com/mobile/demos/avatar1.png',
|
||||
],
|
||||
},
|
||||
});
|
||||
7
ProjectLiaisonForm/pages/avatar/exhibition/index.json
Normal file
7
ProjectLiaisonForm/pages/avatar/exhibition/index.json
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"t-avatar": "tdesign-miniprogram/avatar/avatar",
|
||||
"t-avatar-group": "tdesign-miniprogram/avatar-group/avatar-group"
|
||||
}
|
||||
}
|
||||
3
ProjectLiaisonForm/pages/avatar/exhibition/index.wxml
Normal file
3
ProjectLiaisonForm/pages/avatar/exhibition/index.wxml
Normal file
@@ -0,0 +1,3 @@
|
||||
<t-avatar-group max="5" collapseAvatar="+5">
|
||||
<t-avatar wx:for="{{pics}}" wx:for-item="pic" wx:key="index" image="{{pic}}" />
|
||||
</t-avatar-group>
|
||||
5
ProjectLiaisonForm/pages/avatar/icon-avatar/index.js
Normal file
5
ProjectLiaisonForm/pages/avatar/icon-avatar/index.js
Normal file
@@ -0,0 +1,5 @@
|
||||
Component({
|
||||
data: {
|
||||
image: 'https://tdesign.gtimg.com/mobile/demos/avatar1.png',
|
||||
},
|
||||
});
|
||||
6
ProjectLiaisonForm/pages/avatar/icon-avatar/index.json
Normal file
6
ProjectLiaisonForm/pages/avatar/icon-avatar/index.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"t-avatar": "tdesign-miniprogram/avatar/avatar"
|
||||
}
|
||||
}
|
||||
2
ProjectLiaisonForm/pages/avatar/icon-avatar/index.wxml
Normal file
2
ProjectLiaisonForm/pages/avatar/icon-avatar/index.wxml
Normal file
@@ -0,0 +1,2 @@
|
||||
<t-avatar class="avatar-example" icon="user" />
|
||||
<t-avatar class="avatar-example" shape="round" icon="user" />
|
||||
3
ProjectLiaisonForm/pages/avatar/icon-avatar/index.wxss
Normal file
3
ProjectLiaisonForm/pages/avatar/icon-avatar/index.wxss
Normal file
@@ -0,0 +1,3 @@
|
||||
.avatar-example:not(:last-child) {
|
||||
margin-right: 64rpx;
|
||||
}
|
||||
5
ProjectLiaisonForm/pages/avatar/image-avatar/index.js
Normal file
5
ProjectLiaisonForm/pages/avatar/image-avatar/index.js
Normal file
@@ -0,0 +1,5 @@
|
||||
Component({
|
||||
data: {
|
||||
image: 'https://tdesign.gtimg.com/mobile/demos/avatar1.png',
|
||||
},
|
||||
});
|
||||
6
ProjectLiaisonForm/pages/avatar/image-avatar/index.json
Normal file
6
ProjectLiaisonForm/pages/avatar/image-avatar/index.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"t-avatar": "tdesign-miniprogram/avatar/avatar"
|
||||
}
|
||||
}
|
||||
2
ProjectLiaisonForm/pages/avatar/image-avatar/index.wxml
Normal file
2
ProjectLiaisonForm/pages/avatar/image-avatar/index.wxml
Normal file
@@ -0,0 +1,2 @@
|
||||
<t-avatar class="avatar-example" image="{{image}}" />
|
||||
<t-avatar class="avatar-example" shape="round" image="{{image}}" />
|
||||
3
ProjectLiaisonForm/pages/avatar/image-avatar/index.wxss
Normal file
3
ProjectLiaisonForm/pages/avatar/image-avatar/index.wxss
Normal file
@@ -0,0 +1,3 @@
|
||||
.avatar-example {
|
||||
margin-right: 64rpx;
|
||||
}
|
||||
5
ProjectLiaisonForm/pages/avatar/size/index.js
Normal file
5
ProjectLiaisonForm/pages/avatar/size/index.js
Normal file
@@ -0,0 +1,5 @@
|
||||
Component({
|
||||
data: {
|
||||
image: 'https://tdesign.gtimg.com/mobile/demos/avatar1.png',
|
||||
},
|
||||
});
|
||||
6
ProjectLiaisonForm/pages/avatar/size/index.json
Normal file
6
ProjectLiaisonForm/pages/avatar/size/index.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"t-avatar": "tdesign-miniprogram/avatar/avatar"
|
||||
}
|
||||
}
|
||||
17
ProjectLiaisonForm/pages/avatar/size/index.wxml
Normal file
17
ProjectLiaisonForm/pages/avatar/size/index.wxml
Normal file
@@ -0,0 +1,17 @@
|
||||
<view class="avatar-example">
|
||||
<t-avatar class="avatar-example--large" image="{{image}}" size="large" />
|
||||
<t-avatar class="avatar-example--large" t-class-content="external-class-content" size="large">A</t-avatar>
|
||||
<t-avatar class="avatar-example--large" icon="user" size="large" />
|
||||
</view>
|
||||
|
||||
<view class="avatar-example">
|
||||
<t-avatar class="avatar-example--medium" image="{{image}}" />
|
||||
<t-avatar class="avatar-example--medium" t-class-content="external-class-content" size="medium">A</t-avatar>
|
||||
<t-avatar class="avatar-example--medium" icon="user" size="medium" />
|
||||
</view>
|
||||
|
||||
<view class="avatar-example">
|
||||
<t-avatar class="avatar-example--small" image="{{image}}" size="small" />
|
||||
<t-avatar class="avatar-example--small" t-class-content="external-class-content" size="small">A</t-avatar>
|
||||
<t-avatar class="avatar-example--small" icon="user" size="small" />
|
||||
</view>
|
||||
22
ProjectLiaisonForm/pages/avatar/size/index.wxss
Normal file
22
ProjectLiaisonForm/pages/avatar/size/index.wxss
Normal file
@@ -0,0 +1,22 @@
|
||||
.avatar-example {
|
||||
display: flex;
|
||||
margin-bottom: 32rpx;
|
||||
}
|
||||
|
||||
.external-class-content {
|
||||
color: #fff;
|
||||
background-color: var(--td-brand-color, #0052d9);
|
||||
font-weight: 400;
|
||||
}
|
||||
|
||||
.avatar-example--small:not(:last-child) {
|
||||
margin-right: 112rpx;
|
||||
}
|
||||
|
||||
.avatar-example--medium:not(:last-child) {
|
||||
margin-right: 96rpx;
|
||||
}
|
||||
|
||||
.avatar-example--large:not(:last-child) {
|
||||
margin-right: 64rpx;
|
||||
}
|
||||
1
ProjectLiaisonForm/pages/avatar/skyline/avatar.d.ts
vendored
Normal file
1
ProjectLiaisonForm/pages/avatar/skyline/avatar.d.ts
vendored
Normal file
@@ -0,0 +1 @@
|
||||
|
||||
1
ProjectLiaisonForm/pages/avatar/skyline/avatar.js
Normal file
1
ProjectLiaisonForm/pages/avatar/skyline/avatar.js
Normal file
@@ -0,0 +1 @@
|
||||
Page({});
|
||||
10
ProjectLiaisonForm/pages/avatar/skyline/avatar.json
Normal file
10
ProjectLiaisonForm/pages/avatar/skyline/avatar.json
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"navigationStyle": "custom",
|
||||
"renderer": "skyline",
|
||||
"componentFramework": "glass-easel",
|
||||
"disableScroll": true,
|
||||
"usingComponents": {
|
||||
"t-navbar": "tdesign-miniprogram/navbar/navbar",
|
||||
"demo-avatar": "../avatar"
|
||||
}
|
||||
}
|
||||
1
ProjectLiaisonForm/pages/avatar/skyline/avatar.wxml
Normal file
1
ProjectLiaisonForm/pages/avatar/skyline/avatar.wxml
Normal file
@@ -0,0 +1 @@
|
||||
<demo-avatar />
|
||||
0
ProjectLiaisonForm/pages/avatar/skyline/avatar.wxss
Normal file
0
ProjectLiaisonForm/pages/avatar/skyline/avatar.wxss
Normal file
Reference in New Issue
Block a user