@xtdev/xt-miniprogram-ui 1.2.60 → 1.2.63
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/libs/package.json +1 -0
- package/libs/xt-button/README.md +60 -0
- package/libs/xt-button/index.js +116 -0
- package/libs/xt-button/index.json +7 -0
- package/libs/xt-button/index.wxml +31 -0
- package/libs/xt-button/index.wxss +70 -0
- package/libs/xt-card-cell/README.md +67 -0
- package/libs/xt-card-cell/index.js +43 -0
- package/libs/xt-card-cell/index.json +6 -0
- package/libs/xt-card-cell/index.wxml +34 -0
- package/libs/xt-card-cell/index.wxss +89 -0
- package/libs/xt-cell/README.md +41 -0
- package/libs/xt-cell/index.js +42 -0
- package/libs/xt-cell/index.json +7 -0
- package/libs/xt-cell/index.wxml +12 -0
- package/libs/xt-cell/index.wxss +50 -0
- package/libs/xt-date-picker/README.md +77 -0
- package/libs/xt-date-picker/index.js +443 -0
- package/libs/xt-date-picker/index.json +7 -0
- package/libs/xt-date-picker/index.wxml +58 -0
- package/libs/xt-date-picker/index.wxss +118 -0
- package/libs/xt-date-picker-loop/README.md +77 -0
- package/libs/xt-date-picker-loop/index.js +684 -0
- package/libs/xt-date-picker-loop/index.json +8 -0
- package/libs/xt-date-picker-loop/index.wxml +61 -0
- package/libs/xt-date-picker-loop/index.wxss +117 -0
- package/libs/xt-dialog/README.md +157 -0
- package/libs/xt-dialog/index.js +142 -0
- package/libs/xt-dialog/index.json +5 -0
- package/libs/xt-dialog/index.wxml +64 -0
- package/libs/xt-dialog/index.wxss +129 -0
- package/libs/xt-form/index.js +83 -0
- package/libs/xt-form/index.json +5 -0
- package/libs/xt-form/index.wxml +67 -0
- package/libs/xt-form/index.wxss +141 -0
- package/libs/xt-icon/README.md +39 -0
- package/libs/xt-icon/index.js +25 -0
- package/libs/xt-icon/index.json +5 -0
- package/libs/xt-icon/index.wxml +2 -0
- package/libs/xt-icon/index.wxss +159 -0
- package/libs/xt-popover/README.md +71 -0
- package/libs/xt-popover/index.js +209 -0
- package/libs/xt-popover/index.json +7 -0
- package/libs/xt-popover/index.wxml +43 -0
- package/libs/xt-popover/index.wxss +135 -0
- package/libs/xt-search/README.md +55 -0
- package/libs/xt-search/index.js +88 -0
- package/libs/xt-search/index.json +7 -0
- package/libs/xt-search/index.wxml +17 -0
- package/libs/xt-search/index.wxss +82 -0
- package/libs/xt-stepper/README.md +52 -0
- package/libs/xt-stepper/index.js +158 -0
- package/libs/xt-stepper/index.json +5 -0
- package/libs/xt-stepper/index.wxml +11 -0
- package/libs/xt-stepper/index.wxss +77 -0
- package/libs/xt-steps/README.md +79 -0
- package/libs/xt-steps/index.js +37 -0
- package/libs/xt-steps/index.json +7 -0
- package/libs/xt-steps/index.wxml +34 -0
- package/libs/xt-steps/index.wxss +186 -0
- package/libs/xt-tabs/README.md +98 -0
- package/libs/xt-tabs/index.js +35 -0
- package/libs/xt-tabs/index.json +6 -0
- package/libs/xt-tabs/index.wxml +10 -0
- package/libs/xt-tabs/index.wxss +76 -0
- package/libs/xt-tag/README.md +65 -0
- package/libs/xt-tag/index.js +38 -0
- package/libs/xt-tag/index.json +7 -0
- package/libs/xt-tag/index.wxml +5 -0
- package/libs/xt-tag/index.wxss +36 -0
- package/libs/xt-toast/README.md +65 -0
- package/libs/xt-toast/index.js +85 -0
- package/libs/xt-toast/index.json +7 -0
- package/libs/xt-toast/index.wxml +6 -0
- package/libs/xt-toast/index.wxss +27 -0
- package/libs/xt-uploader/README.md +46 -0
- package/libs/xt-uploader/index.js +233 -0
- package/libs/xt-uploader/index.json +7 -0
- package/libs/xt-uploader/index.wxml +15 -0
- package/libs/xt-uploader/index.wxss +68 -0
- package/libs/xt-uploader/utils.js +69 -0
- package/package.json +1 -1
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
// path/to/custom-ul.js
|
|
2
|
+
Component({
|
|
3
|
+
properties: {
|
|
4
|
+
type: {
|
|
5
|
+
type: String,
|
|
6
|
+
value: 'line'
|
|
7
|
+
},
|
|
8
|
+
active: {
|
|
9
|
+
type: Number,
|
|
10
|
+
value: 0
|
|
11
|
+
},
|
|
12
|
+
list: {
|
|
13
|
+
type: Array,
|
|
14
|
+
},
|
|
15
|
+
cardBgColor: {
|
|
16
|
+
type: String,
|
|
17
|
+
},
|
|
18
|
+
borderColor: {
|
|
19
|
+
type: String,
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
methods: {
|
|
23
|
+
tabClick(e) {
|
|
24
|
+
const _index = e.currentTarget.dataset.index;
|
|
25
|
+
const _item = e.currentTarget.dataset.item;
|
|
26
|
+
this.setData({
|
|
27
|
+
active: _index
|
|
28
|
+
})
|
|
29
|
+
this.triggerEvent('change', {
|
|
30
|
+
..._item,
|
|
31
|
+
index: _index
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
})
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
<view style="background-color: {{cardBgColor}};border-color:{{type === 'card' ? borderColor : ''}}" class="{{type === 'card' ? 'xt-tabs xt-tabs-card' : 'xt-tabs'}}">
|
|
2
|
+
<view bind:tap="tabClick" data-index="{{index}}" data-item="{{item}}" wx:for="{{list}}" wx:if="{{type === 'line'}}" class="{{active === index ? 'xt-tab active' : 'xt-tab'}}">
|
|
3
|
+
<view class="xt-tab-title">{{item.title}}</view>
|
|
4
|
+
<view wx:if="{{item.subTitle}}" class="xt-tab-sub-title">{{item.subTitle}}</view>
|
|
5
|
+
<view wx:if="{{active === index}}" class="{{item.subTitle ? 'bottom-line sub-bottom-line' : 'bottom-line'}}"></view>
|
|
6
|
+
</view>
|
|
7
|
+
<view bind:tap="tabClick" data-index="{{index}}" wx:for="{{list}}" data-item="{{item}}" wx:if="{{type === 'card'}}" class="{{active === index ? 'xt-tab xt-tab-card active' : 'xt-tab xt-tab-card'}}">
|
|
8
|
+
<view style="color: {{active === index ? '' : item.titleColor}};" class="xt-tab-title">{{item.title}}</view>
|
|
9
|
+
</view>
|
|
10
|
+
</view>
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
.xt-tabs {
|
|
2
|
+
display: flex;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.xt-tabs.xt-tabs-card {
|
|
6
|
+
border-radius: 60rpx;
|
|
7
|
+
padding: 6rpx;
|
|
8
|
+
background-color: #f5f5f5;
|
|
9
|
+
border: 2rpx solid #DDDDDD;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.xt-tab {
|
|
13
|
+
display: flex;
|
|
14
|
+
flex-direction: column;
|
|
15
|
+
align-items: center;
|
|
16
|
+
font-size: 40rpx;
|
|
17
|
+
flex-grow: 1;
|
|
18
|
+
font-family: PingFang SC-Regular, PingFang SC;
|
|
19
|
+
font-weight: 400;
|
|
20
|
+
color: #000000;
|
|
21
|
+
/* width: 100%; */
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.xt-tab-title {
|
|
25
|
+
height: 56rpx;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.xt-tab-sub-title {
|
|
29
|
+
height: 44rpx;
|
|
30
|
+
font-size: 32rpx;
|
|
31
|
+
font-family: PingFang SC-Regular, PingFang SC;
|
|
32
|
+
font-weight: 400;
|
|
33
|
+
color: #000000;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.active .xt-tab-sub-title {
|
|
37
|
+
height: 44rpx;
|
|
38
|
+
font-size: 32rpx;
|
|
39
|
+
font-family: PingFang SC-Semibold, PingFang SC;
|
|
40
|
+
font-weight: 600;
|
|
41
|
+
color: #6722AB;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.xt-tab.active {
|
|
45
|
+
font-weight: 600;
|
|
46
|
+
color: #6722AB;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.bottom-line {
|
|
50
|
+
width: 64rpx;
|
|
51
|
+
height: 8rpx;
|
|
52
|
+
background-color: #6722AB;
|
|
53
|
+
border-radius: 4rpx;
|
|
54
|
+
margin-top: 4rpx;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.bottom-line.sub-bottom-line {
|
|
58
|
+
width: 56rpx;
|
|
59
|
+
height: 6rpx;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.xt-tab-card.xt-tab {
|
|
63
|
+
height: 72rpx;
|
|
64
|
+
justify-content: center;
|
|
65
|
+
font-size: 34rpx;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.xt-tab-card.active {
|
|
69
|
+
background-color: #FFFFFF;
|
|
70
|
+
border-radius: 60rpx;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.xt-tab-card .xt-tab-title {
|
|
74
|
+
line-height: 72rpx;
|
|
75
|
+
height: 72rpx;
|
|
76
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# Icon图标
|
|
2
|
+
|
|
3
|
+
### 介绍
|
|
4
|
+
用于标记关键词或用于筛选
|
|
5
|
+
|
|
6
|
+
###效果图
|
|
7
|
+

|
|
8
|
+
|
|
9
|
+
### 引入
|
|
10
|
+
在app.json或页面配置json中引入
|
|
11
|
+
```
|
|
12
|
+
"usingComponents": {
|
|
13
|
+
"xt-tag": "@xtdev/xt-miniprogram-ui/xt-tag",
|
|
14
|
+
}
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## 代码演示
|
|
18
|
+
|
|
19
|
+
### 基础用法
|
|
20
|
+
|
|
21
|
+
```
|
|
22
|
+
<xt-tag>
|
|
23
|
+
标签一
|
|
24
|
+
</xt-tag>
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
### 状态
|
|
28
|
+
设置 `isChoosed` 属性标记选中状态
|
|
29
|
+
```
|
|
30
|
+
<xt-tag isChoosed="{{true}}">
|
|
31
|
+
选中了
|
|
32
|
+
</xt-tag>
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### 带关闭功能
|
|
36
|
+
设置 `closeable` 属性控制是否展示关闭图标
|
|
37
|
+
```
|
|
38
|
+
<xt-tag closeable="{{true}}">
|
|
39
|
+
可关闭
|
|
40
|
+
</xt-tag>
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### 带数字
|
|
44
|
+
设置 `number` 属性展示
|
|
45
|
+
```
|
|
46
|
+
<xt-tag number="{{2}}">
|
|
47
|
+
带数字
|
|
48
|
+
</xt-tag>
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
##API
|
|
52
|
+
|
|
53
|
+
####xt-tag props
|
|
54
|
+
|
|
55
|
+
| 参数 | 说明 | 类型 |
|
|
56
|
+
| ----------- | ----------- | ---------- |
|
|
57
|
+
| number | 对应的数字 | `Number` |
|
|
58
|
+
| isChoosed | 是否选中 | `Boolean` |
|
|
59
|
+
| closeable | 是否展示关闭图标 | `Boolean` |
|
|
60
|
+
|
|
61
|
+
####Events
|
|
62
|
+
|
|
63
|
+
| 事件名 | 说明 | 回调参数 |
|
|
64
|
+
| ----------- | ----------- | ---------- |
|
|
65
|
+
| bind:close | 关闭标签时触发 | - |
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
// pages/components/xt-icon.js
|
|
2
|
+
Component({
|
|
3
|
+
/**
|
|
4
|
+
* 组件的属性列表
|
|
5
|
+
*/
|
|
6
|
+
properties: {
|
|
7
|
+
// 是否带数字
|
|
8
|
+
number: {
|
|
9
|
+
type: Number | null,
|
|
10
|
+
default: null
|
|
11
|
+
},
|
|
12
|
+
// 是否选中
|
|
13
|
+
isChoosed: {
|
|
14
|
+
type: Boolean,
|
|
15
|
+
},
|
|
16
|
+
// 是否可关闭
|
|
17
|
+
closeable: {
|
|
18
|
+
type: Boolean,
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* 组件的初始数据
|
|
24
|
+
*/
|
|
25
|
+
data: {},
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* 组件的方法列表
|
|
29
|
+
*/
|
|
30
|
+
methods: {
|
|
31
|
+
close() {
|
|
32
|
+
this.triggerEvent('close');
|
|
33
|
+
},
|
|
34
|
+
onClick() {
|
|
35
|
+
this.triggerEvent('click');
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
});
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
<view catchtap="onClick" class="{{ isChoosed ? 'xt-tag is-active' : 'xt-tag' }}">
|
|
2
|
+
<slot></slot>
|
|
3
|
+
<view wx:if="{{number || number === 0}}" class="icon-number">{{number}}</view>
|
|
4
|
+
<xt-icon catchtap="close" class="close-icon" wx:if="{{closeable}}" size="32" icon="a-3"></xt-icon>
|
|
5
|
+
</view>
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
.xt-tag {
|
|
2
|
+
padding: 0 32rpx;
|
|
3
|
+
height: 80rpx;
|
|
4
|
+
border: 2rpx solid #DDDDDD;
|
|
5
|
+
border-radius: 60rpx;
|
|
6
|
+
align-items: center;
|
|
7
|
+
justify-content: center;
|
|
8
|
+
display: inline-flex;
|
|
9
|
+
font-size: 34rpx;
|
|
10
|
+
font-family: PingFang SC-Regular, PingFang SC;
|
|
11
|
+
font-weight: 400;
|
|
12
|
+
color: #000000;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.is-active {
|
|
16
|
+
border: 2rpx solid #6722AB;
|
|
17
|
+
background-color: #F6EDFF;
|
|
18
|
+
color: #6722AB;
|
|
19
|
+
font-weight: 600;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.close-icon {
|
|
23
|
+
margin-left: 20rpx;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.icon-number {
|
|
27
|
+
font-size: 34rpx;
|
|
28
|
+
font-family: PingFang SC-Regular, PingFang SC;
|
|
29
|
+
font-weight: 400;
|
|
30
|
+
color: #FF4D4D;
|
|
31
|
+
margin-left: 20rpx;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.is-active .icon-number {
|
|
35
|
+
font-weight: 600;
|
|
36
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# Toast
|
|
2
|
+
|
|
3
|
+
## 介绍
|
|
4
|
+
|
|
5
|
+
在页面中间弹出黑色半透明提示,用于消息通知、加载提示、操作结果提示等场景。
|
|
6
|
+
|
|
7
|
+
## 效果图
|
|
8
|
+
|
|
9
|
+

|
|
10
|
+
|
|
11
|
+
## 引入
|
|
12
|
+
|
|
13
|
+
在app.json或页面配置json中引入
|
|
14
|
+
|
|
15
|
+
```json
|
|
16
|
+
"usingComponents": {
|
|
17
|
+
"xt-toast": "@xtdev/xt-miniprogram-ui/xt-toast",
|
|
18
|
+
}
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## 代码演示
|
|
22
|
+
|
|
23
|
+
### 1)默认模式
|
|
24
|
+
|
|
25
|
+

|
|
26
|
+
|
|
27
|
+
```html
|
|
28
|
+
<xt-toast type="nomal" show="{{true}}" duration="{{5000}}" message="已确认合同"></xt-toast>
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
### 2)带跳转的提示
|
|
32
|
+
|
|
33
|
+

|
|
34
|
+
|
|
35
|
+
```html
|
|
36
|
+
<xt-toast type="navToast" message="哈喽早上好!支持跳转指定页面。哈喽早上好!支持跳转指定页面" navUrl="/template/list/index"></xt-toast>
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## API
|
|
40
|
+
|
|
41
|
+
### xt-toast props
|
|
42
|
+
|
|
43
|
+
| 参数 | 说明 | 类型 | 默认值 |
|
|
44
|
+
| ----------- | ------------------------------------------------------------ | ------- | ------ |
|
|
45
|
+
| show | 用于触发组件显示,仅当type为'nomal'时有用 | Boolean | false |
|
|
46
|
+
| type | 指定组件的类型,可选值为`nomal` `navToast` | String | nomal |
|
|
47
|
+
| duration | 展示时长(ms),仅当type为'nomal'时有用 | Number | 5000 |
|
|
48
|
+
| message | 内容 | String | '' |
|
|
49
|
+
| navDuration | 展示时长(ms),仅当type为'navToast'时有用,(若不设置,则永远不会消失,直到用户点击跳转到指定页面) | Number | null |
|
|
50
|
+
| navUrl | 指定跳转的页面路径(相对路径),仅当type为'navToast'时有用 | String | null |
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
// src/xt-toast/index.js
|
|
2
|
+
Component({
|
|
3
|
+
/**
|
|
4
|
+
* 组件的属性列表
|
|
5
|
+
*/
|
|
6
|
+
properties: {
|
|
7
|
+
show:{
|
|
8
|
+
type:Boolean,
|
|
9
|
+
value:false
|
|
10
|
+
},
|
|
11
|
+
type:{
|
|
12
|
+
type:String,
|
|
13
|
+
value:'nomal'
|
|
14
|
+
},
|
|
15
|
+
duration:{
|
|
16
|
+
type:Number,
|
|
17
|
+
value:5000
|
|
18
|
+
},
|
|
19
|
+
message:{
|
|
20
|
+
type:String,
|
|
21
|
+
value:''
|
|
22
|
+
},
|
|
23
|
+
navDuration:{
|
|
24
|
+
type:Number,
|
|
25
|
+
value:null
|
|
26
|
+
},
|
|
27
|
+
navUrl:{
|
|
28
|
+
type:String,
|
|
29
|
+
value:null
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* 组件的初始数据
|
|
35
|
+
*/
|
|
36
|
+
data: {
|
|
37
|
+
// 带跳转的toast是否允许自动消失
|
|
38
|
+
dispear: false
|
|
39
|
+
},
|
|
40
|
+
observers:{
|
|
41
|
+
show(val){
|
|
42
|
+
if(val){
|
|
43
|
+
this.showToast();
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
lifetimes:{
|
|
48
|
+
attached(){
|
|
49
|
+
// if(this.properties.type == 'nomal') this.showToast();
|
|
50
|
+
if(this.properties.type == 'navToast') this.showNavToast();
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
/**
|
|
54
|
+
* 组件的方法列表
|
|
55
|
+
*/
|
|
56
|
+
methods: {
|
|
57
|
+
// 常规toast
|
|
58
|
+
showToast(){
|
|
59
|
+
console.log('查看变量',this.properties.show);
|
|
60
|
+
wx.showToast({
|
|
61
|
+
title: this.properties.message,
|
|
62
|
+
duration: this.properties.duration,
|
|
63
|
+
icon:'none'
|
|
64
|
+
})
|
|
65
|
+
},
|
|
66
|
+
// 带跳转的提示
|
|
67
|
+
showNavToast(){
|
|
68
|
+
if(this.properties.navDuration){
|
|
69
|
+
setTimeout(()=>{
|
|
70
|
+
this.setData({
|
|
71
|
+
dispear: true
|
|
72
|
+
})
|
|
73
|
+
},this.properties.navDuration)
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
// 点击提示框跳转至目标页面
|
|
77
|
+
navTo(){
|
|
78
|
+
if(this.properties.navUrl){
|
|
79
|
+
wx.navigateTo({
|
|
80
|
+
url: this.properties.navUrl,
|
|
81
|
+
})
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
})
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
<!--src/xt-toast/index.wxml-->
|
|
2
|
+
<!-- 带跳转的提示 -->
|
|
3
|
+
<view class="nav_toast_box" wx:if="{{type === 'navToast'}}" style="{{dispear?'opacity: 0;':''}}" catchtap="navTo">
|
|
4
|
+
<view class="nav_toast_text">{{message}}</view>
|
|
5
|
+
<xt-icon class="nav_icon" slot="right-icon" icon="arrow" size="32"></xt-icon>
|
|
6
|
+
</view>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/* src/xt-toast/index.wxss */
|
|
2
|
+
.nav_toast_box{
|
|
3
|
+
/* position: absolute; */
|
|
4
|
+
/* left: 50%; */
|
|
5
|
+
/* margin-left: -351rpx; */
|
|
6
|
+
width: 100%;
|
|
7
|
+
display: flex;
|
|
8
|
+
align-items: center;
|
|
9
|
+
justify-content: space-between;
|
|
10
|
+
background-color: #FCE1D4;
|
|
11
|
+
border-radius: 8rpx;
|
|
12
|
+
padding: 20rpx 24rpx;
|
|
13
|
+
box-sizing: border-box;
|
|
14
|
+
transition:all 0.3s linear;
|
|
15
|
+
}
|
|
16
|
+
.nav_toast_text{
|
|
17
|
+
width: 598rpx;
|
|
18
|
+
box-sizing: border-box;
|
|
19
|
+
line-height: 40rpx;
|
|
20
|
+
font-size: 28rpx;
|
|
21
|
+
font-family: PingFang SC-Semibold, PingFang SC;
|
|
22
|
+
color: #F26B27;
|
|
23
|
+
}
|
|
24
|
+
.nav_icon{
|
|
25
|
+
color: #F26B27;
|
|
26
|
+
margin-left: 24rpx;
|
|
27
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# Icon图标
|
|
2
|
+
|
|
3
|
+
### 介绍
|
|
4
|
+
用于表单列表上传图片
|
|
5
|
+
|
|
6
|
+
###效果图
|
|
7
|
+

|
|
8
|
+
|
|
9
|
+
### 引入
|
|
10
|
+
在app.json或页面配置json中引入
|
|
11
|
+
```
|
|
12
|
+
"usingComponents": {
|
|
13
|
+
"xt-uploader": "@xtdev/xt-miniprogram-ui/xt-uploader",
|
|
14
|
+
}
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## 代码演示
|
|
18
|
+
|
|
19
|
+
### 基础用法
|
|
20
|
+
|
|
21
|
+
```
|
|
22
|
+
<xt-uploader title="标题标题"></xt-uploader>
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
##API
|
|
26
|
+
|
|
27
|
+
####xt-uploader props
|
|
28
|
+
|
|
29
|
+
| 参数 | 说明 | 类型 | 默认值
|
|
30
|
+
| ----------- | ----------- | ---------- | -------- |
|
|
31
|
+
| fileList | 图片列表,必传,受控组件 | Array<String> | `[]`
|
|
32
|
+
| title | 表单标题 | string |
|
|
33
|
+
| max | 上传最大值,每次可选照片数,默认为9 | number | 9
|
|
34
|
+
| upload-desc | 上传文案说明 | `String` |
|
|
35
|
+
| custom-upload | 是否自定义上传,true 点击盒子触发upload | boolean | `false`
|
|
36
|
+
| disabled | 是否禁用,禁用时不能删除和上传,可预览 | boolean | `false`
|
|
37
|
+
| sourceType | 照片来源 | `Array<String>` | ["album", "camera"]
|
|
38
|
+
| upload-api | 组件库放公网,上传接口api,必传 | {url: 'https://...',fileDir: 'microComponents'} |
|
|
39
|
+
|
|
40
|
+
####Events
|
|
41
|
+
|
|
42
|
+
| 事件名 | 说明 | 回调参数 |
|
|
43
|
+
| ---------------- | ------------- | ---------------------- |
|
|
44
|
+
| bind:upload | 上传成功后触发,如果customUpload为true则点击上传及触发 | fileList:图片列表, url:当前上传图片地址 |
|
|
45
|
+
| bind:delete | 删除成功后触发 | fileList:图片列表, url:当前删除图片地址,index:当前删除图片索引 |
|
|
46
|
+
| bind:error | 上传失败后触发 | errMsg: 失败原因 |
|