project init & fix ui
This commit is contained in:
12
miniprogram_npm/tdesign-miniprogram/footer/README.en-US.md
Normal file
12
miniprogram_npm/tdesign-miniprogram/footer/README.en-US.md
Normal file
@@ -0,0 +1,12 @@
|
||||
:: BASE_DOC ::
|
||||
|
||||
## API
|
||||
### Footer Props
|
||||
|
||||
name | type | default | description | required
|
||||
-- | -- | -- | -- | --
|
||||
copyright | String | '' | \- | N
|
||||
custom-style `v0.25.0` | String | - | \- | N
|
||||
logo | Object | - | Typescript:`FooterLogo` `interface FooterLogo { icon: string; title?: string; titleUrl?: string }`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/footer/type.ts) | N
|
||||
text-link-list | Array | [] | Typescript:`Array<LinkObj>` `interface LinkObj { name: string; url?: string; openType?: 'navigate' \| 'redirect' \| 'relaunch' \| 'switchTab' \| 'navigateBack' }`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/footer/type.ts) | N
|
||||
theme | String | 'text' | options:text/logo | N
|
||||
47
miniprogram_npm/tdesign-miniprogram/footer/README.md
Normal file
47
miniprogram_npm/tdesign-miniprogram/footer/README.md
Normal file
@@ -0,0 +1,47 @@
|
||||
---
|
||||
title: Footer 页脚
|
||||
description: 用于基础列表展示,可附带文字、品牌 logo、操作,常用商详、个人中心、设置等页面。
|
||||
spline: data
|
||||
isComponent: true
|
||||
---
|
||||
|
||||
<span class="coverages-badge" style="margin-right: 10px"><img src="https://img.shields.io/badge/coverages%3A%20lines-100%25-blue" /></span><span class="coverages-badge" style="margin-right: 10px"><img src="https://img.shields.io/badge/coverages%3A%20functions-100%25-blue" /></span><span class="coverages-badge" style="margin-right: 10px"><img src="https://img.shields.io/badge/coverages%3A%20statements-100%25-blue" /></span><span class="coverages-badge" style="margin-right: 10px"><img src="https://img.shields.io/badge/coverages%3A%20branches-100%25-blue" /></span>
|
||||
## 引入
|
||||
|
||||
全局引入,在 miniprogram 根目录下的`app.json`中配置,局部引入,在需要引入的页面或组件的`index.json`中配置。
|
||||
|
||||
```json
|
||||
"usingComponents": {
|
||||
"t-footer": "tdesign-miniprogram/footer/footer"
|
||||
}
|
||||
```
|
||||
|
||||
## 代码演示
|
||||
|
||||
|
||||
<img src="https://tdesign.gtimg.com/miniprogram/readme/footer.png" width="375px" height="50%">
|
||||
|
||||
### 类型
|
||||
|
||||
基础页脚
|
||||
|
||||
{{ base }}
|
||||
|
||||
基础加链接页脚
|
||||
|
||||
{{ link }}
|
||||
|
||||
品牌页脚
|
||||
|
||||
{{ logo }}
|
||||
|
||||
## API
|
||||
### Footer Props
|
||||
|
||||
名称 | 类型 | 默认值 | 说明 | 必传
|
||||
-- | -- | -- | -- | --
|
||||
copyright | String | '' | 版权信息,type 为`text`生效 | N
|
||||
custom-style `v0.25.0` | String | - | 自定义组件样式 | N
|
||||
logo | Object | - | 图标配置,type 为`logo`生效。`logo.icon` 表示图标链接地址,`logo.title` 表示标题文本,`logo.url` 表示链接跳转地址。TS 类型:`FooterLogo` `interface FooterLogo { icon: string; title?: string; titleUrl?: string }`。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/footer/type.ts) | N
|
||||
text-link-list | Array | [] | 链接列表,type 为`text`生效。name 表示链接名称, url 表示链接 page 路径,目前只支持小程序内部跳转,openType 表示跳转方式。TS 类型:`Array<LinkObj>` `interface LinkObj { name: string; url?: string; openType?: 'navigate' \| 'redirect' \| 'relaunch' \| 'switchTab' \| 'navigateBack' }`。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/footer/type.ts) | N
|
||||
theme | String | 'text' | 页脚展示类型。可选项:text/logo | N
|
||||
7
miniprogram_npm/tdesign-miniprogram/footer/footer.d.ts
vendored
Normal file
7
miniprogram_npm/tdesign-miniprogram/footer/footer.d.ts
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
import { SuperComponent } from '../common/src/index';
|
||||
export default class Footer extends SuperComponent {
|
||||
properties: import("./type").TdFooterProps;
|
||||
data: {
|
||||
classPrefix: string;
|
||||
};
|
||||
}
|
||||
24
miniprogram_npm/tdesign-miniprogram/footer/footer.js
Normal file
24
miniprogram_npm/tdesign-miniprogram/footer/footer.js
Normal file
@@ -0,0 +1,24 @@
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
import { SuperComponent, wxComponent } from '../common/src/index';
|
||||
import config from '../common/config';
|
||||
import props from './props';
|
||||
const { prefix } = config;
|
||||
const name = `${prefix}-footer`;
|
||||
let Footer = class Footer extends SuperComponent {
|
||||
constructor() {
|
||||
super(...arguments);
|
||||
this.properties = props;
|
||||
this.data = {
|
||||
classPrefix: name,
|
||||
};
|
||||
}
|
||||
};
|
||||
Footer = __decorate([
|
||||
wxComponent()
|
||||
], Footer);
|
||||
export default Footer;
|
||||
6
miniprogram_npm/tdesign-miniprogram/footer/footer.json
Normal file
6
miniprogram_npm/tdesign-miniprogram/footer/footer.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"t-image": "../image/image"
|
||||
}
|
||||
}
|
||||
29
miniprogram_npm/tdesign-miniprogram/footer/footer.wxml
Normal file
29
miniprogram_npm/tdesign-miniprogram/footer/footer.wxml
Normal file
@@ -0,0 +1,29 @@
|
||||
<view style="{{ customStyle }}" class="{{classPrefix}}">
|
||||
<!-- theme 为 logo -->
|
||||
<block wx:if="{{theme === 'logo'}}">
|
||||
<view class="{{classPrefix}}__logo">
|
||||
<t-image t-class="{{classPrefix}}__icon" src="{{logo.icon}}" wx:if="{{logo.icon}}" />
|
||||
<view class="{{classPrefix}}__title" wx:if="{{logo.title}}">{{logo.title}}</view>
|
||||
<t-image t-class="{{classPrefix}}__title-url" src="{{logo.url}}" mode="widthFix" wx:elif="{{logo.url}}" />
|
||||
</view>
|
||||
</block>
|
||||
<!-- theme 为 text -->
|
||||
<block wx:else>
|
||||
<view wx:if="{{textLinkList.length > 0}}" class="{{classPrefix}}__link-list">
|
||||
<block wx:for="{{textLinkList}}" wx:key="name" wx:for-item="item">
|
||||
<navigator
|
||||
url="{{item.url}}"
|
||||
open-type="{{item.openType}}"
|
||||
hover-class="none"
|
||||
class="{{classPrefix}}__link-item"
|
||||
>
|
||||
{{item.name}}
|
||||
</navigator>
|
||||
<view aria-hidden="{{true}}" wx:if="{{index !== (textLinkList.length - 1)}}" class="{{classPrefix}}__link-line"
|
||||
>|</view
|
||||
>
|
||||
</block>
|
||||
</view>
|
||||
<view class="{{classPrefix}}__copyright-info">{{copyright}}</view>
|
||||
</block>
|
||||
</view>
|
||||
75
miniprogram_npm/tdesign-miniprogram/footer/footer.wxss
Normal file
75
miniprogram_npm/tdesign-miniprogram/footer/footer.wxss
Normal file
@@ -0,0 +1,75 @@
|
||||
.t-float-left {
|
||||
float: left;
|
||||
}
|
||||
.t-float-right {
|
||||
float: right;
|
||||
}
|
||||
@keyframes tdesign-fade-out {
|
||||
from {
|
||||
opacity: 1;
|
||||
}
|
||||
to {
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
.hotspot-expanded.relative {
|
||||
position: relative;
|
||||
}
|
||||
.hotspot-expanded::after {
|
||||
content: '';
|
||||
display: block;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
transform: scale(1.5);
|
||||
}
|
||||
.t-footer {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: flex-start;
|
||||
}
|
||||
.t-footer__copyright-info {
|
||||
font-size: var(--td-footer-copyright-font-size, var(--td-font-size-s, 24rpx));
|
||||
line-height: var(--td-footer-copyright-line-height, 40rpx);
|
||||
color: var(--td-footer-copyright-color, var(--td-font-gray-3, rgba(0, 0, 0, 0.4)));
|
||||
}
|
||||
.t-footer__link-list {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
margin-bottom: var(--td-footer-link-margin-bottom, 8rpx);
|
||||
}
|
||||
.t-footer__link-item {
|
||||
color: var(--td-footer-link-color, var(--td-primary-color, #0052d9));
|
||||
font-size: var(--td-footer-link-font-size, var(--td-font-size-s, 24rpx));
|
||||
line-height: var(--td-footer-link-line-height, 40rpx);
|
||||
text-decoration: underline;
|
||||
}
|
||||
.t-footer__link-line {
|
||||
font-size: 24rpx;
|
||||
color: var(--td-footer-link-dividing-line-color, var(--td-font-gray-3, rgba(0, 0, 0, 0.4)));
|
||||
display: inline-block;
|
||||
padding: 0 var(--td-footer-link-dividing-line-padding, var(--td-spacer-1, 24rpx));
|
||||
}
|
||||
.t-footer__logo {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
.t-footer__icon {
|
||||
width: var(--td-footer-logo-icon-width, 48rpx);
|
||||
height: var(--td-footer-logo-icon-height, 48rpx);
|
||||
margin-right: var(--td-footer-logo-icon-margin-right, var(--td-spacer, 16rpx));
|
||||
}
|
||||
.t-footer__title {
|
||||
font-weight: bold;
|
||||
font-size: var(--td-footer-logo-title-font-size, var(--td-font-size-m, 32rpx));
|
||||
line-height: var(--td-footer-logo-title-line-height, 48rpx);
|
||||
font-style: italic;
|
||||
}
|
||||
.t-footer__title-url {
|
||||
width: var(--td-footer-logo-title-url-width, 256rpx);
|
||||
}
|
||||
3
miniprogram_npm/tdesign-miniprogram/footer/props.d.ts
vendored
Normal file
3
miniprogram_npm/tdesign-miniprogram/footer/props.d.ts
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
import { TdFooterProps } from './type';
|
||||
declare const props: TdFooterProps;
|
||||
export default props;
|
||||
22
miniprogram_npm/tdesign-miniprogram/footer/props.js
Normal file
22
miniprogram_npm/tdesign-miniprogram/footer/props.js
Normal file
@@ -0,0 +1,22 @@
|
||||
const props = {
|
||||
copyright: {
|
||||
type: String,
|
||||
value: '',
|
||||
},
|
||||
customStyle: {
|
||||
type: String,
|
||||
value: '',
|
||||
},
|
||||
logo: {
|
||||
type: Object,
|
||||
},
|
||||
textLinkList: {
|
||||
type: Array,
|
||||
value: [],
|
||||
},
|
||||
theme: {
|
||||
type: String,
|
||||
value: 'text',
|
||||
},
|
||||
};
|
||||
export default props;
|
||||
32
miniprogram_npm/tdesign-miniprogram/footer/type.d.ts
vendored
Normal file
32
miniprogram_npm/tdesign-miniprogram/footer/type.d.ts
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
export interface TdFooterProps {
|
||||
copyright?: {
|
||||
type: StringConstructor;
|
||||
value?: string;
|
||||
};
|
||||
customStyle?: {
|
||||
type: StringConstructor;
|
||||
value?: string;
|
||||
};
|
||||
logo?: {
|
||||
type: ObjectConstructor;
|
||||
value?: FooterLogo;
|
||||
};
|
||||
textLinkList?: {
|
||||
type: ArrayConstructor;
|
||||
value?: Array<LinkObj>;
|
||||
};
|
||||
theme?: {
|
||||
type: StringConstructor;
|
||||
value?: 'text' | 'logo';
|
||||
};
|
||||
}
|
||||
export interface FooterLogo {
|
||||
icon: string;
|
||||
title?: string;
|
||||
titleUrl?: string;
|
||||
}
|
||||
export interface LinkObj {
|
||||
name: string;
|
||||
url?: string;
|
||||
openType?: 'navigate' | 'redirect' | 'relaunch' | 'switchTab' | 'navigateBack';
|
||||
}
|
||||
1
miniprogram_npm/tdesign-miniprogram/footer/type.js
Normal file
1
miniprogram_npm/tdesign-miniprogram/footer/type.js
Normal file
@@ -0,0 +1 @@
|
||||
export {};
|
||||
Reference in New Issue
Block a user