@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,158 @@
|
|
|
1
|
+
// components/v-stepper/index.js
|
|
2
|
+
/**
|
|
3
|
+
* NumberBox 数字输入框
|
|
4
|
+
* @description 带加减按钮的数字输入框
|
|
5
|
+
* @tutorial https://ext.dcloud.net.cn/plugin?id=31
|
|
6
|
+
* @property {Number} value 输入框当前值
|
|
7
|
+
* @property {Number} min 最小值
|
|
8
|
+
* @property {Number} max 最大值
|
|
9
|
+
* @property {Number} step 每次点击改变的间隔大小
|
|
10
|
+
* @property {String} background 背景色
|
|
11
|
+
* @property {String} color 字体颜色(前景色)
|
|
12
|
+
* @property {Boolean} disabled = [true|false] 是否为禁用状态
|
|
13
|
+
* @property {String} stepTips 进步倍数纠正提示文案
|
|
14
|
+
* @event {Function} change 输入框值改变时触发的事件,参数为输入框当前的 value
|
|
15
|
+
* @event {Function} focus 输入框聚焦时触发的事件,参数为 event 对象
|
|
16
|
+
* @event {Function} blur 输入框失焦时触发的事件,参数为 event 对象
|
|
17
|
+
*/
|
|
18
|
+
Component({
|
|
19
|
+
lifetimes: {
|
|
20
|
+
attached: function() {
|
|
21
|
+
// 在组件实例进入页面节点树时执行
|
|
22
|
+
},
|
|
23
|
+
detached: function() {
|
|
24
|
+
// 在组件实例被从页面节点树移除时执行
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
/**
|
|
28
|
+
* 组件的属性列表
|
|
29
|
+
*/
|
|
30
|
+
properties: {
|
|
31
|
+
value: {
|
|
32
|
+
type: [Number, String],
|
|
33
|
+
default: 1
|
|
34
|
+
},
|
|
35
|
+
min: {
|
|
36
|
+
type: Number,
|
|
37
|
+
default: 0
|
|
38
|
+
},
|
|
39
|
+
max: {
|
|
40
|
+
type: Number,
|
|
41
|
+
default: 100
|
|
42
|
+
},
|
|
43
|
+
step: {
|
|
44
|
+
type: Number,
|
|
45
|
+
default: 1
|
|
46
|
+
},
|
|
47
|
+
background: {
|
|
48
|
+
type: String,
|
|
49
|
+
default: '#fff'
|
|
50
|
+
},
|
|
51
|
+
color: {
|
|
52
|
+
type: String,
|
|
53
|
+
default: '#000'
|
|
54
|
+
},
|
|
55
|
+
disabled: {
|
|
56
|
+
type: Boolean,
|
|
57
|
+
default: false
|
|
58
|
+
},
|
|
59
|
+
stepTips: {
|
|
60
|
+
type: String,
|
|
61
|
+
default: ''
|
|
62
|
+
},
|
|
63
|
+
disableInput: {
|
|
64
|
+
type: Boolean,
|
|
65
|
+
default: false
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* 组件的初始数据
|
|
71
|
+
*/
|
|
72
|
+
data: {
|
|
73
|
+
inputValue: 0
|
|
74
|
+
},
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* 组件的方法列表
|
|
78
|
+
*/
|
|
79
|
+
methods: {
|
|
80
|
+
// 输入完成数据预处理
|
|
81
|
+
// input 和 按钮都触发
|
|
82
|
+
preHandler(count) {
|
|
83
|
+
// -. 小数转整数
|
|
84
|
+
count = Math.ceil(count);
|
|
85
|
+
// -. 取3的倍数
|
|
86
|
+
if (count % this.data.step != 0) {
|
|
87
|
+
wx.showToast({
|
|
88
|
+
title: this.data.stepTips,
|
|
89
|
+
icon: 'none',
|
|
90
|
+
duration: 1500
|
|
91
|
+
})
|
|
92
|
+
count = Math.ceil(count / this.data.step) * this.data.step;
|
|
93
|
+
}
|
|
94
|
+
// -. 判断是否大于最大值
|
|
95
|
+
if (count > this.data.max) {
|
|
96
|
+
count = this.data.max;
|
|
97
|
+
}
|
|
98
|
+
// -. 判断是否小于最小值
|
|
99
|
+
if (count < this.data.min) {
|
|
100
|
+
count = this.data.min;
|
|
101
|
+
}
|
|
102
|
+
this.setData({
|
|
103
|
+
inputValue: count
|
|
104
|
+
});
|
|
105
|
+
return count;
|
|
106
|
+
},
|
|
107
|
+
/**
|
|
108
|
+
* 加减按钮
|
|
109
|
+
* @param {*} type
|
|
110
|
+
*/
|
|
111
|
+
_calcValue(e) {
|
|
112
|
+
const type = e.currentTarget.dataset.type;
|
|
113
|
+
let value = this.data.inputValue;
|
|
114
|
+
// 判断是否禁用
|
|
115
|
+
if (this.data.disabled) {
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
// 加减库存
|
|
119
|
+
if (type === 'minus') {
|
|
120
|
+
if (value <= this.data.min) {
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
value -= this.data.step;
|
|
124
|
+
} else if (type === 'plus') {
|
|
125
|
+
if (value >= this.data.max) {
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
128
|
+
value += this.data.step;
|
|
129
|
+
}
|
|
130
|
+
value = this.preHandler(value);
|
|
131
|
+
this.triggerEvent('change', value);
|
|
132
|
+
},
|
|
133
|
+
/**
|
|
134
|
+
* 输入框失去焦点
|
|
135
|
+
* @param {*} event
|
|
136
|
+
*/
|
|
137
|
+
_onBlur(event) {
|
|
138
|
+
let count = event.detail.value;
|
|
139
|
+
count = this.preHandler(count);
|
|
140
|
+
this.triggerEvent('change', +count);
|
|
141
|
+
},
|
|
142
|
+
_onFocus(event) {
|
|
143
|
+
this.triggerEvent('focus', event);
|
|
144
|
+
},
|
|
145
|
+
onInput(e) {
|
|
146
|
+
this.setData({
|
|
147
|
+
inputValue: e.detail.value
|
|
148
|
+
});
|
|
149
|
+
this.triggerEvent('change', +inputValue);
|
|
150
|
+
},
|
|
151
|
+
},
|
|
152
|
+
observers: {
|
|
153
|
+
value(val) {
|
|
154
|
+
const inputValue = this.data.inputValue + val;
|
|
155
|
+
this.setData({inputValue});
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<view class="uni-numbox">
|
|
2
|
+
<view catchtap="_calcValue" data-type="minus" class="uni-numbox__minus uni-numbox-btns" style="background:{{background}}">
|
|
3
|
+
<image wx:if="{{inputValue <= min || disabled}}" src="https://img.tanjiu.cn/home/N3hXeF3t62GfK2xAsn6PyCATw82d5QeK.png" />
|
|
4
|
+
<image wx:else src="https://img.tanjiu.cn/home/dznTAnDMTRR4NTmZnHYXpHxEdTPZcT5t.png" />
|
|
5
|
+
</view>
|
|
6
|
+
<input disabled="{{disableInput || disabled}}" bind:focus="_onFocus" bind:blur="_onBlur" class="uni-numbox__value" type="number" value="{{inputValue}}" style="background:{{background}}, color:{{color}}" />
|
|
7
|
+
<view catchtap="_calcValue" data-type="plus" class="uni-numbox__plus uni-numbox-btns" style="background:{{background}}">
|
|
8
|
+
<image wx:if="{{inputValue >= max || disabled}}" src="https://img.tanjiu.cn/home/Bp4De4y8FFwYk3s8bbMhb6YbwKmp4yxf.png" />
|
|
9
|
+
<image wx:else src="https://img.tanjiu.cn/home/WeSZCF7QHwptXEM7fWh5EPKt72meekPn.png" />
|
|
10
|
+
</view>
|
|
11
|
+
</view>
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
.uni-numbox {
|
|
2
|
+
/* #ifndef APP-NVUE */
|
|
3
|
+
display: flex;
|
|
4
|
+
/* #endif */
|
|
5
|
+
flex-direction: row;
|
|
6
|
+
}
|
|
7
|
+
.uni-numbox image {
|
|
8
|
+
width: 64rpx;
|
|
9
|
+
height: 64rpx;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.add-btn {
|
|
13
|
+
width: 64rpx;
|
|
14
|
+
height: 64rpx;
|
|
15
|
+
background: #6722ab;
|
|
16
|
+
font-size: 44rpx;
|
|
17
|
+
color: white;
|
|
18
|
+
border-radius: 64rpx;
|
|
19
|
+
text-align: center;
|
|
20
|
+
border-radius: #dddddd;
|
|
21
|
+
}
|
|
22
|
+
.reduce-btn {
|
|
23
|
+
width: 64rpx;
|
|
24
|
+
height: 64rpx;
|
|
25
|
+
background: white;
|
|
26
|
+
font-size: 44rpx;
|
|
27
|
+
color: #6722ab;
|
|
28
|
+
border-radius: 64rpx;
|
|
29
|
+
text-align: center;
|
|
30
|
+
border: 2rpx solid #dddddd;
|
|
31
|
+
}
|
|
32
|
+
.uni-numbox-btns {
|
|
33
|
+
/* #ifndef APP-NVUE */
|
|
34
|
+
display: flex;
|
|
35
|
+
/* #endif */
|
|
36
|
+
flex-direction: row;
|
|
37
|
+
align-items: center;
|
|
38
|
+
justify-content: center;
|
|
39
|
+
padding: 0 ;
|
|
40
|
+
background-color: #f5f5f5;
|
|
41
|
+
/* #ifdef H5 */
|
|
42
|
+
cursor: pointer;
|
|
43
|
+
|
|
44
|
+
/* #endif */
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.uni-numbox__value {
|
|
48
|
+
margin: 0 16rpx;
|
|
49
|
+
width: 120rpx;
|
|
50
|
+
height: 64rpx;
|
|
51
|
+
font-size: 34rpx;
|
|
52
|
+
color: #222222;
|
|
53
|
+
font-family: FengTan-Regular, FengTan;
|
|
54
|
+
border-radius: 32rpx;
|
|
55
|
+
font-weight: 800;
|
|
56
|
+
background-color: #fff;
|
|
57
|
+
text-align: center;
|
|
58
|
+
border: 2rpx solid #dddddd;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.uni-numbox__minus, .uni-numbox__plus {
|
|
62
|
+
border-radius: 64rpx;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.uni-numbox--text {
|
|
66
|
+
line-height: 20rpx;
|
|
67
|
+
font-size: 20rpx;
|
|
68
|
+
font-weight: 300;
|
|
69
|
+
color: #333;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.uni-numbox .uni-numbox--disabled {
|
|
73
|
+
color: #c0c0c0 !important;
|
|
74
|
+
/* #ifdef H5 */
|
|
75
|
+
cursor: not-allowed;
|
|
76
|
+
/* #endif */
|
|
77
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# Steps步骤条
|
|
2
|
+
|
|
3
|
+
### 介绍
|
|
4
|
+
用于展示操作流程的各个环节,让用户了解当前的操作在整体流程中的位置
|
|
5
|
+
|
|
6
|
+
###效果图
|
|
7
|
+

|
|
8
|
+
|
|
9
|
+
### 引入
|
|
10
|
+
在app.json或页面配置json中引入
|
|
11
|
+
```
|
|
12
|
+
"usingComponents": {
|
|
13
|
+
"xt-steps": "@xtdev/xt-miniprogram-ui/xt-steps",
|
|
14
|
+
}
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## 代码演示
|
|
18
|
+
|
|
19
|
+
### 默认模式,横向展示
|
|
20
|
+

|
|
21
|
+
|
|
22
|
+
```
|
|
23
|
+
<xt-steps steps="{{steps}}" active="{{active}}"></xt-steps>
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
### 默认模式,纵向展示
|
|
27
|
+

|
|
28
|
+
|
|
29
|
+
```
|
|
30
|
+
<xt-steps direction="vertical" steps="{{steps}}" active="{{active}}"></xt-steps>
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### 简约模式,横向展示
|
|
34
|
+

|
|
35
|
+
```
|
|
36
|
+
<xt-steps type="brief" steps="{{steps}}" active="{{active}}"></xt-steps>
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### 简约模式,纵向展示
|
|
40
|
+

|
|
41
|
+
```
|
|
42
|
+
<xt-steps type="brief" direction="vertical" steps="{{steps}}" active="{{active}}"></xt-steps>
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### 插槽模式,纵向展示
|
|
46
|
+
提示:插槽name规则为slot-{{index}} index从0开始
|
|
47
|
+

|
|
48
|
+
```
|
|
49
|
+
<xt-steps type="brief" direction="vertical" steps="{{steps}}" active="{{active}}">
|
|
50
|
+
<view slot="slot-1" class="custom-box">
|
|
51
|
+
<view slot:listIndex>订单编号:123456{{ listIndex }}</view>
|
|
52
|
+
<xt-button style="margin-left: 20rpx" size="small">复制</xt-button>
|
|
53
|
+
</view>
|
|
54
|
+
<view slot="slot-2" class="custom-box">
|
|
55
|
+
<view slot:listIndex>订单编号:123456777{{ listIndex }}</view>
|
|
56
|
+
<xt-button style="margin-left: 20rpx" size="small">复制</xt-button>
|
|
57
|
+
</view>
|
|
58
|
+
</xt-steps>
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
##API
|
|
63
|
+
|
|
64
|
+
#### xt-steps props
|
|
65
|
+
|
|
66
|
+
| 参数 | 说明 | 类型 | 默认值 |
|
|
67
|
+
| --------- | ------------------------------------ | ------------- | ---------- |
|
|
68
|
+
| steps | 步骤配置集合 | `stepsItem[]` | [] |
|
|
69
|
+
| active | 当前步骤 | `Number` | 0 |
|
|
70
|
+
| type | 当前步骤,可选值static、brief | `String` | static |
|
|
71
|
+
| direction | 展示方向,可选值horizontal、vertical | `String` | horizontal |
|
|
72
|
+
|
|
73
|
+
#### stepsItem Props
|
|
74
|
+
|
|
75
|
+
| 参数 | 说明 | 类型 |
|
|
76
|
+
| ----- | -------- | --------- |
|
|
77
|
+
| title | 标题 | `String` |
|
|
78
|
+
| desc | 副标题 | `String` |
|
|
79
|
+
| slot | 是否插槽 | `Boolean` |
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
Component({
|
|
2
|
+
options: {
|
|
3
|
+
multipleSlots: true
|
|
4
|
+
},
|
|
5
|
+
properties: {
|
|
6
|
+
steps: {
|
|
7
|
+
type: Array,
|
|
8
|
+
value: []
|
|
9
|
+
},
|
|
10
|
+
active: {
|
|
11
|
+
type: Number,
|
|
12
|
+
value: 0
|
|
13
|
+
},
|
|
14
|
+
type: {
|
|
15
|
+
type: String,
|
|
16
|
+
value: 'static'
|
|
17
|
+
},
|
|
18
|
+
direction: {
|
|
19
|
+
type: String,
|
|
20
|
+
value: 'horizontal'
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* 组件的初始数据
|
|
26
|
+
*/
|
|
27
|
+
data: {
|
|
28
|
+
},
|
|
29
|
+
attached: function () {
|
|
30
|
+
},
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* 组件的方法列表
|
|
34
|
+
*/
|
|
35
|
+
methods: {
|
|
36
|
+
}
|
|
37
|
+
});
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
<view wx:if="{{direction === 'horizontal'}}" class="xt-steps">
|
|
2
|
+
<view wx:for="{{steps}}" wx:key="index" class="{{ active > index ? 'finished xt-step' : (active === index ? 'xt-step active' : 'xt-step')}}">
|
|
3
|
+
<view wx:if="{{type === 'static'}}" class="step-dot">
|
|
4
|
+
<xt-icon wx:if="{{active > index}}" icon="zhengque"></xt-icon>
|
|
5
|
+
<view wx:else>{{index+1}}</view>
|
|
6
|
+
</view>
|
|
7
|
+
<view wx:if="{{type === 'brief'}}" class="step-dot-brief">
|
|
8
|
+
<view wx:if="{{index === active}}" class="center-box"></view>
|
|
9
|
+
</view>
|
|
10
|
+
<view class="step-title">{{item.title}}</view>
|
|
11
|
+
<view class="step-desc">
|
|
12
|
+
<slot wx:if="{{item.slot}}" name="slot-{{index}}" list-index="{{ index }}" item="{{ item }}" />
|
|
13
|
+
<rich-text wx:else nodes="{{item.desc}}"></rich-text>
|
|
14
|
+
</view>
|
|
15
|
+
<view wx:if="{{index < steps.length - 1}}" class="{{type === 'brief' ? 'step-line-brief' : 'step-line'}}"></view>
|
|
16
|
+
</view>
|
|
17
|
+
</view>
|
|
18
|
+
<view wx:if="{{direction === 'vertical'}}" class="{{type === 'brief' ? 'xt-steps xt-steps-column xt-steps-column-brief' : 'xt-steps xt-steps-column'}}">
|
|
19
|
+
<view wx:for="{{steps}}" wx:key="index" class="{{ active > index ? 'finished xt-step' : (active === index ? 'xt-step active' : 'xt-step')}}">
|
|
20
|
+
<view wx:if="{{type === 'static'}}" class="step-dot">
|
|
21
|
+
<xt-icon wx:if="{{active > index}}" icon="zhengque"></xt-icon>
|
|
22
|
+
<view wx:else>{{index+1}}</view>
|
|
23
|
+
</view>
|
|
24
|
+
<view wx:if="{{type === 'brief'}}" class="step-dot-brief"></view>
|
|
25
|
+
<view class="text-box">
|
|
26
|
+
<view class="step-title">{{item.title}}</view>
|
|
27
|
+
<view class="step-desc">
|
|
28
|
+
<slot wx:if="{{item.slot}}" name="slot-{{index}}" list-index="{{ index }}" item="{{ item }}" />
|
|
29
|
+
<rich-text wx:else nodes="{{item.desc}}"></rich-text>
|
|
30
|
+
</view>
|
|
31
|
+
</view>
|
|
32
|
+
<view wx:if="{{index < steps.length - 1}}" class="{{type === 'brief' ? 'step-line-brief' : 'step-line'}}"></view>
|
|
33
|
+
</view>
|
|
34
|
+
</view>
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
.xt-steps {
|
|
2
|
+
display: flex;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.xt-steps-column {
|
|
6
|
+
flex-direction: column;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.xt-steps-column .xt-step {
|
|
10
|
+
flex-grow: 0;
|
|
11
|
+
flex-direction: row;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.xt-step {
|
|
15
|
+
display: flex;
|
|
16
|
+
flex-direction: column;
|
|
17
|
+
align-items: center;
|
|
18
|
+
position: relative;
|
|
19
|
+
flex: 1;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.xt-step.active {
|
|
23
|
+
color: #6622aa;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.step-dot {
|
|
27
|
+
width: 48rpx;
|
|
28
|
+
height: 48rpx;
|
|
29
|
+
min-width: 48rpx;
|
|
30
|
+
border-radius: 24rpx;
|
|
31
|
+
background-color: #ededed;
|
|
32
|
+
text-align: center;
|
|
33
|
+
line-height: 48rpx;
|
|
34
|
+
font-size: 34rpx;
|
|
35
|
+
font-family: FengTan-Regular, FengTan;
|
|
36
|
+
font-weight: 400;
|
|
37
|
+
color: #b8b8b8;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.active .step-title {
|
|
41
|
+
font-weight: 600;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.active .step-title,
|
|
45
|
+
.active .step-desc {
|
|
46
|
+
color: #6622aa;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.active .step-dot {
|
|
50
|
+
background-color: #6622aa;
|
|
51
|
+
color: #fff;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.finished .step-dot {
|
|
55
|
+
background-color: #30bf67;
|
|
56
|
+
color: #fff;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.finished .step-title {
|
|
60
|
+
font-weight: 600;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.finished .step-title,
|
|
64
|
+
.finished .step-desc {
|
|
65
|
+
color: #000000;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.finished .step-line {
|
|
69
|
+
border-bottom: 4rpx solid #30bf67;
|
|
70
|
+
border-color: #30bf67;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.step-title {
|
|
74
|
+
font-size: 34rpx;
|
|
75
|
+
font-family: PingFang SC-Regular, PingFang SC;
|
|
76
|
+
font-weight: 400;
|
|
77
|
+
color: #999999;
|
|
78
|
+
line-height: 48rpx;
|
|
79
|
+
margin-top: 16rpx;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.step-desc {
|
|
83
|
+
font-size: 28rpx;
|
|
84
|
+
font-family: PingFang SC-Regular, PingFang SC;
|
|
85
|
+
font-weight: 400;
|
|
86
|
+
color: #999999;
|
|
87
|
+
line-height: 40rpx;
|
|
88
|
+
margin-top: 8rpx;
|
|
89
|
+
text-align: center;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.step-line,
|
|
93
|
+
.step-line-brief {
|
|
94
|
+
border-bottom: 4rpx dotted #b8b8b8;
|
|
95
|
+
flex-grow: 1;
|
|
96
|
+
position: absolute;
|
|
97
|
+
width: calc(100% - 24rpx);
|
|
98
|
+
top: 24rpx;
|
|
99
|
+
left: calc(50% + 24rpx);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.step-line-brief {
|
|
103
|
+
top: 16rpx;
|
|
104
|
+
left: calc(50% + 16rpx);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.step-dot-brief {
|
|
108
|
+
width: 32rpx;
|
|
109
|
+
height: 32rpx;
|
|
110
|
+
border-radius: 50%;
|
|
111
|
+
background-color: #ededed;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.active .step-dot-brief {
|
|
115
|
+
background-color: #fff;
|
|
116
|
+
border: 8rpx solid #6722ab;
|
|
117
|
+
width: 16rpx;
|
|
118
|
+
height: 16rpx;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.finished .step-dot-brief {
|
|
122
|
+
background-color: #6722ab;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.text-box {
|
|
126
|
+
margin-left: 24rpx;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.xt-steps-column .xt-step {
|
|
130
|
+
align-items: start;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.xt-steps-column .step-title {
|
|
134
|
+
margin-top: 0;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
.xt-steps-column .xt-step:nth-of-type(n + 2) {
|
|
138
|
+
margin-top: 60rpx;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
.xt-steps-column-brief .xt-step:nth-of-type(n + 2) {
|
|
142
|
+
margin-top: 48rpx;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
.xt-steps-column .step-line,
|
|
146
|
+
.xt-steps-column .step-line-brief {
|
|
147
|
+
border-left: 4rpx dotted #b8b8b8;
|
|
148
|
+
width: 0rpx;
|
|
149
|
+
height: calc(100% + 24rpx);
|
|
150
|
+
left: 22rpx;
|
|
151
|
+
top: 48rpx;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
.xt-steps-column .finished .step-line {
|
|
155
|
+
border-left: 4rpx solid #30bf67;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
.xt-steps-column .step-dot-brief {
|
|
159
|
+
width: 16rpx;
|
|
160
|
+
height: 16rpx;
|
|
161
|
+
border-radius: 50%;
|
|
162
|
+
flex-shrink: 0;
|
|
163
|
+
flex-grow: 0;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
.xt-steps-column .active .step-dot-brief {
|
|
167
|
+
width: 12rpx;
|
|
168
|
+
height: 12rpx;
|
|
169
|
+
background-color: #fff;
|
|
170
|
+
border: 2rpx solid #6722ab;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
.xt-steps-column .step-line-brief {
|
|
174
|
+
left: 6rpx;
|
|
175
|
+
top: 16rpx;
|
|
176
|
+
height: calc(100% + 32rpx);
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
.xt-steps-column-brief .xt-step:nth-of-type(n + 2) {
|
|
180
|
+
margin-top: 48rpx;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
.xt-steps-column-brief .text-box {
|
|
184
|
+
margin-left: 16rpx;
|
|
185
|
+
margin-top: -12rpx;
|
|
186
|
+
}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
# Icon图标
|
|
2
|
+
|
|
3
|
+
### 介绍
|
|
4
|
+
选项卡组件,用于在不同的内容区域之间进行切换
|
|
5
|
+
|
|
6
|
+
###效果图
|
|
7
|
+

|
|
8
|
+
|
|
9
|
+
### 引入
|
|
10
|
+
在app.json或页面配置json中引入
|
|
11
|
+
```
|
|
12
|
+
"usingComponents": {
|
|
13
|
+
"xt-tabs": "@xtdev/xt-miniprogram-ui/xt-tabs",
|
|
14
|
+
}
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## 代码演示
|
|
18
|
+
|
|
19
|
+
### 基础用法
|
|
20
|
+
|
|
21
|
+
```
|
|
22
|
+
<xt-tabs list="{{list}}"></xt-tabs>
|
|
23
|
+
```
|
|
24
|
+
```
|
|
25
|
+
data: {
|
|
26
|
+
list: [
|
|
27
|
+
{
|
|
28
|
+
title: '标签一'
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
title: '标签二'
|
|
32
|
+
},
|
|
33
|
+
],
|
|
34
|
+
}
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### 带副标题
|
|
38
|
+
```
|
|
39
|
+
<xt-tabs list="{{subTitlelist}}"></xt-tabs>
|
|
40
|
+
```
|
|
41
|
+
```
|
|
42
|
+
data: {
|
|
43
|
+
subTitlelist: [
|
|
44
|
+
{
|
|
45
|
+
title: '标签一',
|
|
46
|
+
subTitle: '副标题'
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
title: '标签二',
|
|
50
|
+
subTitle: '副标题'
|
|
51
|
+
},
|
|
52
|
+
],
|
|
53
|
+
}
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### 卡片模式
|
|
57
|
+
支持两种样式风格:line和card,默认为line样式,可以通过type属性修改样式风格
|
|
58
|
+
```
|
|
59
|
+
<xt-tabs type="card" list="{{list}}"></xt-tabs>
|
|
60
|
+
```
|
|
61
|
+
```
|
|
62
|
+
data: {
|
|
63
|
+
list: [
|
|
64
|
+
{
|
|
65
|
+
title: '标签一'
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
title: '标签二'
|
|
69
|
+
},
|
|
70
|
+
],
|
|
71
|
+
}
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
##API
|
|
75
|
+
|
|
76
|
+
####xt-tabs props
|
|
77
|
+
|
|
78
|
+
| 参数 | 说明 | 类型 |
|
|
79
|
+
| ----------- | ----------- | ---------- |
|
|
80
|
+
| type | 样式风格,可选值`card`、`line`,默认值为`line` | `String` |
|
|
81
|
+
| active | 当前选中标签的标识符,默认值0 | `Number` |
|
|
82
|
+
| list | 数据源数组 | `ItemProps` |
|
|
83
|
+
| cardBgColor | tab背景色 | `String` |
|
|
84
|
+
| borderColor | tab边框颜色 | `String` |
|
|
85
|
+
|
|
86
|
+
#### ItemProps
|
|
87
|
+
|
|
88
|
+
| 参数 | 说明 | 类型 |
|
|
89
|
+
| ----------- | ----------- | ----------- |
|
|
90
|
+
| title | 卡片标题 | `String` |
|
|
91
|
+
| subTitle | 卡片副标题 | `String` |
|
|
92
|
+
| titleColor | 标题颜色 | `String` |
|
|
93
|
+
|
|
94
|
+
#### Tabs Event
|
|
95
|
+
|
|
96
|
+
| 事件名 | 说明 | 参数 |
|
|
97
|
+
| ----------- | ----------- | ----------- |
|
|
98
|
+
| bind:change | tab点击事件 | 当前激活项数据以及索引 |
|