@10yun/cv-mobile-ui 0.5.19 → 0.5.21
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/other/mpvue-picker/mpvuePicker.vue +402 -0
- package/{uni-ui/lib → other}/mpvue-picker/style.css +0 -1
- package/{uni-ui/lib → other}/tab-nvue/style.css +0 -1
- package/other/uParse/components/style.css +1 -0
- package/other/uParse/components/wxParseAudio.vue +1 -0
- package/other/uParse/components/wxParseImg.vue +86 -0
- package/other/uParse/components/wxParseTable.vue +54 -0
- package/other/uParse/components/wxParseTemplate0.vue +98 -0
- package/other/uParse/components/wxParseTemplate1.vue +81 -0
- package/other/uParse/components/wxParseTemplate10.vue +81 -0
- package/other/uParse/components/wxParseTemplate11.vue +79 -0
- package/other/uParse/components/wxParseTemplate2.vue +81 -0
- package/other/uParse/components/wxParseTemplate3.vue +81 -0
- package/other/uParse/components/wxParseTemplate4.vue +81 -0
- package/other/uParse/components/wxParseTemplate5.vue +81 -0
- package/other/uParse/components/wxParseTemplate6.vue +81 -0
- package/other/uParse/components/wxParseTemplate7.vue +81 -0
- package/other/uParse/components/wxParseTemplate8.vue +81 -0
- package/other/uParse/components/wxParseTemplate9.vue +81 -0
- package/other/uParse/components/wxParseVideo.vue +14 -0
- package/other/uParse/editor.css +495 -0
- package/{uni-ui/lib/uParse/src → other/uParse}/libs/html2json.js +19 -22
- package/{uni-ui/lib/uParse/src → other/uParse}/libs/htmlparser.js +12 -5
- package/{uni-ui/lib/uParse/src → other/uParse}/libs/wxDiscode.js +2 -2
- package/other/uParse/wxParse.vue +196 -0
- package/package.json +1 -1
- package/plugins/map/amqp-wx.js +173 -0
- package/{uni-ui/lib/mpvueGestureLock/index.vue → ui-cv/components/cv-draw-gesture-lock/cv-draw-gesture-lock.vue} +4 -1
- package/ui-cv/components/cv-draw-gesture-lock/gestureLock.js +169 -0
- package/{uni-ui/lib/mpvueGestureLock → ui-cv/components/cv-draw-gesture-lock}/style.css +0 -1
- package/{uni-ui/lib/mpvue-citypicker → ui-cv/components/cv-geo-region}/style.css +0 -1
- package/ui-cv/components/cv-grid-item/cv-grid-item.vue +1 -1
- package/uni-ui/lib/uni-badge/uni-badge.vue +150 -1
- package/uni-ui/lib/uni-breadcrumb/uni-breadcrumb.vue +37 -1
- package/uni-ui/lib/uni-breadcrumb-item/uni-breadcrumb-item.vue +83 -1
- package/uni-ui/lib/uni-calendar/uni-calendar-item.vue +122 -1
- package/uni-ui/lib/uni-calendar/uni-calendar.vue +366 -1
- package/uni-ui/lib/uni-card/uni-card.vue +124 -1
- package/uni-ui/lib/uni-col/uni-col.vue +1 -1
- package/uni-ui/lib/uni-collapse/uni-collapse.vue +135 -1
- package/uni-ui/lib/uni-collapse-item/uni-collapse-item.vue +266 -1
- package/uni-ui/lib/uni-combox/uni-combox.vue +1 -1
- package/uni-ui/lib/uni-countdown/uni-countdown.vue +239 -1
- package/uni-ui/lib/uni-data-checkbox/uni-data-checkbox.vue +487 -1
- package/uni-ui/lib/uni-data-picker/uni-data-picker.vue +530 -1
- package/uni-ui/lib/uni-data-pickerview/uni-data-picker.js +157 -150
- package/uni-ui/lib/uni-data-pickerview/uni-data-pickerview.vue +166 -1
- package/uni-ui/lib/uni-data-select/uni-data-select.vue +289 -1
- package/uni-ui/lib/uni-datetime-picker/calendar-item.vue +70 -1
- package/uni-ui/lib/uni-datetime-picker/calendar.vue +629 -1
- package/uni-ui/lib/uni-datetime-picker/time-picker.vue +741 -1
- package/uni-ui/lib/uni-datetime-picker/uni-datetime-picker.vue +847 -1
- package/uni-ui/lib/uni-drawer/uni-drawer.vue +115 -1
- package/uni-ui/lib/uni-easyinput/uni-easyinput.vue +515 -1
- package/uni-ui/lib/uni-fab/uni-fab.vue +257 -1
- package/uni-ui/lib/uni-fav/uni-fav.vue +123 -1
- package/uni-ui/lib/uni-file-picker/uni-file-picker.vue +642 -1
- package/uni-ui/lib/uni-file-picker/upload-file.vue +177 -1
- package/uni-ui/lib/uni-file-picker/upload-image.vue +176 -1
- package/uni-ui/lib/uni-forms/uni-forms.vue +375 -1
- package/uni-ui/lib/uni-forms-item/uni-forms-item.vue +429 -1
- package/uni-ui/lib/uni-goods-nav/uni-goods-nav.vue +129 -1
- package/uni-ui/lib/uni-grid/uni-grid.vue +115 -1
- package/uni-ui/lib/uni-grid-item/uni-grid-item.vue +78 -1
- package/uni-ui/lib/uni-group/uni-group.vue +85 -1
- package/uni-ui/lib/uni-icons/uni-icons.vue +85 -1
- package/uni-ui/lib/uni-indexed-list/uni-indexed-list-item.vue +68 -1
- package/uni-ui/lib/uni-indexed-list/uni-indexed-list.vue +294 -1
- package/uni-ui/lib/uni-list/uni-list.vue +81 -1
- package/uni-ui/lib/uni-list-ad/uni-list-ad.vue +77 -1
- package/uni-ui/lib/uni-list-chat/uni-list-chat.vue +294 -1
- package/uni-ui/lib/uni-list-item/uni-list-item.vue +346 -1
- package/uni-ui/lib/uni-load-more/uni-load-more.vue +172 -1
- package/uni-ui/lib/uni-nav-bar/uni-nav-bar.vue +205 -1
- package/uni-ui/lib/uni-nav-bar/uni-status-bar.vue +18 -1
- package/uni-ui/lib/uni-notice-bar/uni-notice-bar.vue +331 -1
- package/uni-ui/lib/uni-number-box/uni-number-box.vue +166 -1
- package/uni-ui/lib/uni-pagination/uni-pagination.vue +323 -1
- package/uni-ui/lib/uni-popup/uni-popup.vue +1 -1
- package/uni-ui/lib/uni-popup-dialog/uni-popup-dialog.vue +173 -1
- package/uni-ui/lib/uni-popup-message/uni-popup-message.vue +74 -1
- package/uni-ui/lib/uni-popup-share/uni-popup-share.vue +106 -1
- package/uni-ui/lib/uni-rate/uni-rate.vue +322 -1
- package/uni-ui/lib/uni-row/uni-row.vue +1 -1
- package/uni-ui/lib/uni-search-bar/uni-search-bar.vue +236 -1
- package/uni-ui/lib/uni-section/uni-section.vue +109 -1
- package/uni-ui/lib/uni-segmented-control/uni-segmented-control.vue +103 -1
- package/uni-ui/lib/uni-status-bar/uni-status-bar.vue +1 -1
- package/uni-ui/lib/uni-steps/uni-steps.vue +120 -1
- package/uni-ui/lib/uni-swipe-action-item/uni-swipe-action-item.vue +226 -3
- package/uni-ui/lib/uni-swiper-dot/uni-swiper-dot.vue +167 -1
- package/uni-ui/lib/uni-table/uni-table.vue +297 -1
- package/uni-ui/lib/uni-tag/uni-tag.vue +100 -1
- package/uni-ui/lib/uni-td/uni-td.vue +78 -1
- package/uni-ui/lib/uni-th/filter-dropdown.vue +1 -1
- package/uni-ui/lib/uni-th/uni-th.vue +224 -1
- package/uni-ui/lib/uni-thead/uni-thead.vue +77 -1
- package/uni-ui/lib/uni-tr/table-checkbox.vue +79 -1
- package/uni-ui/lib/uni-tr/uni-tr.vue +135 -1
- package/uni-ui/lib/amap-wx/js/util.js +0 -181
- package/uni-ui/lib/marked/index.js +0 -1
- package/uni-ui/lib/mpvue-citypicker/city-data/area.js +0 -12542
- package/uni-ui/lib/mpvue-citypicker/city-data/city.js +0 -1503
- package/uni-ui/lib/mpvue-citypicker/city-data/province.js +0 -139
- package/uni-ui/lib/mpvue-picker/mpvuePicker.vue +0 -3
- package/uni-ui/lib/mpvueGestureLock/gestureLock.js +0 -175
- package/uni-ui/lib/uParse/src/components/style.css +0 -2
- package/uni-ui/lib/uParse/src/components/wxParseAudio.vue +0 -1
- package/uni-ui/lib/uParse/src/components/wxParseImg.vue +0 -1
- package/uni-ui/lib/uParse/src/components/wxParseTable.vue +0 -3
- package/uni-ui/lib/uParse/src/components/wxParseTemplate0.vue +0 -1
- package/uni-ui/lib/uParse/src/components/wxParseTemplate1.vue +0 -1
- package/uni-ui/lib/uParse/src/components/wxParseTemplate10.vue +0 -1
- package/uni-ui/lib/uParse/src/components/wxParseTemplate11.vue +0 -1
- package/uni-ui/lib/uParse/src/components/wxParseTemplate2.vue +0 -1
- package/uni-ui/lib/uParse/src/components/wxParseTemplate3.vue +0 -1
- package/uni-ui/lib/uParse/src/components/wxParseTemplate4.vue +0 -1
- package/uni-ui/lib/uParse/src/components/wxParseTemplate5.vue +0 -1
- package/uni-ui/lib/uParse/src/components/wxParseTemplate6.vue +0 -1
- package/uni-ui/lib/uParse/src/components/wxParseTemplate7.vue +0 -1
- package/uni-ui/lib/uParse/src/components/wxParseTemplate8.vue +0 -1
- package/uni-ui/lib/uParse/src/components/wxParseTemplate9.vue +0 -1
- package/uni-ui/lib/uParse/src/components/wxParseVideo.vue +0 -1
- package/uni-ui/lib/uParse/src/editor.css +0 -495
- package/uni-ui/lib/uParse/src/wxParse.vue +0 -1
- /package/{uni-ui/lib → other}/api-set-tabbar.nvue +0 -0
- /package/{uni-ui/lib → other}/mpvue-echarts/src/echarts.vue +0 -0
- /package/{uni-ui/lib → other}/mpvue-echarts/src/style.css +0 -0
- /package/{uni-ui/lib → other}/mpvue-echarts/src/wx-canvas.js +0 -0
- /package/{uni-ui/lib → other}/product.vue +0 -0
- /package/{uni-ui/lib → other}/style.css +0 -0
- /package/{uni-ui/lib → other}/tab-nvue/mediaList.vue +0 -0
- /package/{uni-ui/lib → other}/u-charts/u-charts.js +0 -0
- /package/{uni-ui/lib/uParse/src → other/uParse}/wxParse.css +0 -0
- /package/{uni-ui/lib/amap-wx → plugins/map}/lib/amap-wx.js +0 -0
- /package/{uni-ui/lib/mpvue-citypicker → ui-cv/components/cv-geo-region}/mpvueCityPicker.vue +0 -0
- /package/{uni-ui/lib/marked → ui-cv/components/cv-markdown-show}/lib/marked.js +0 -0
|
@@ -1 +1,167 @@
|
|
|
1
|
-
<template>
|
|
2
1
|
<view class="uni-swiper__warp">
|
|
3
2
|
<slot />
|
|
4
3
|
<view v-if="mode === 'default'" :style="{ bottom: dots.bottom + 'px' }" class="uni-swiper__dots-box" key="default">
|
|
5
4
|
<view
|
|
6
5
|
v-for="(item, index) in info"
|
|
7
6
|
@click="clickItem(index)"
|
|
8
7
|
:style="{
|
|
9
8
|
width: (index === current ? dots.width * 2 : dots.width) + 'px',
|
|
10
9
|
height: dots.width / 2 + 'px',
|
|
11
10
|
'background-color': index !== current ? dots.backgroundColor : dots.selectedBackgroundColor,
|
|
12
11
|
'border-radius': '0px'
|
|
13
12
|
}"
|
|
14
13
|
:key="index"
|
|
15
14
|
class="uni-swiper__dots-item uni-swiper__dots-bar"
|
|
16
15
|
/>
|
|
17
16
|
</view>
|
|
18
17
|
<view v-if="mode === 'dot'" :style="{ bottom: dots.bottom + 'px' }" class="uni-swiper__dots-box" key="dot">
|
|
19
18
|
<view
|
|
20
19
|
v-for="(item, index) in info"
|
|
21
20
|
@click="clickItem(index)"
|
|
22
21
|
:style="{
|
|
23
22
|
width: dots.width + 'px',
|
|
24
23
|
height: dots.height + 'px',
|
|
25
24
|
'background-color': index !== current ? dots.backgroundColor : dots.selectedBackgroundColor,
|
|
26
25
|
border: index !== current ? dots.border : dots.selectedBorder
|
|
27
26
|
}"
|
|
28
27
|
:key="index"
|
|
29
28
|
class="uni-swiper__dots-item"
|
|
30
29
|
/>
|
|
31
30
|
</view>
|
|
32
31
|
<view v-if="mode === 'round'" :style="{ bottom: dots.bottom + 'px' }" class="uni-swiper__dots-box" key="round">
|
|
33
32
|
<view
|
|
34
33
|
v-for="(item, index) in info"
|
|
35
34
|
@click="clickItem(index)"
|
|
36
35
|
:class="[index === current && 'uni-swiper__dots-long']"
|
|
37
36
|
:style="{
|
|
38
37
|
width: (index === current ? dots.width * 3 : dots.width) + 'px',
|
|
39
38
|
height: dots.height + 'px',
|
|
40
39
|
'background-color': index !== current ? dots.backgroundColor : dots.selectedBackgroundColor,
|
|
41
40
|
border: index !== current ? dots.border : dots.selectedBorder
|
|
42
41
|
}"
|
|
43
42
|
:key="index"
|
|
44
43
|
class="uni-swiper__dots-item"
|
|
45
44
|
/>
|
|
46
45
|
</view>
|
|
47
46
|
<view
|
|
48
47
|
v-if="mode === 'nav'"
|
|
49
48
|
key="nav"
|
|
50
49
|
:style="{ 'background-color': dotsStyles.backgroundColor, bottom: '0' }"
|
|
51
50
|
class="uni-swiper__dots-box uni-swiper__dots-nav"
|
|
52
51
|
>
|
|
53
52
|
<text :style="{ color: dotsStyles.color }" class="uni-swiper__dots-nav-item">
|
|
54
53
|
{{ current + 1 + '/' + info.length + ' ' + info[current][field] }}
|
|
55
54
|
</text>
|
|
56
55
|
</view>
|
|
57
56
|
<view v-if="mode === 'indexes'" key="indexes" :style="{ bottom: dots.bottom + 'px' }" class="uni-swiper__dots-box">
|
|
58
57
|
<view
|
|
59
58
|
v-for="(item, index) in info"
|
|
60
59
|
@click="clickItem(index)"
|
|
61
60
|
:style="{
|
|
62
61
|
width: dots.width + 'px',
|
|
63
62
|
height: dots.height + 'px',
|
|
64
63
|
color: index === current ? dots.selectedColor : dots.color,
|
|
65
64
|
'background-color': index !== current ? dots.backgroundColor : dots.selectedBackgroundColor,
|
|
66
65
|
border: index !== current ? dots.border : dots.selectedBorder
|
|
67
66
|
}"
|
|
68
67
|
:key="index"
|
|
69
68
|
class="uni-swiper__dots-item uni-swiper__dots-indexes"
|
|
70
69
|
>
|
|
71
70
|
<text class="uni-swiper__dots-indexes-text">{{ index + 1 }}</text>
|
|
72
71
|
</view>
|
|
73
72
|
</view>
|
|
74
73
|
</view>
|
|
75
74
|
* SwiperDod 轮播图指示点
|
|
76
75
|
* @description 自定义轮播图指示点
|
|
77
76
|
* @tutorial https://ext.dcloud.net.cn/plugin?id=284
|
|
78
77
|
* @property {Number} current 当前指示点索引,必须是通过 `swiper` 的 `change` 事件获取到的 `e.detail.current`
|
|
79
78
|
* @property {String} mode = [default|round|nav|indexes] 指示点的类型
|
|
80
79
|
* @value defualt 默认指示点
|
|
81
80
|
* @value round 圆形指示点
|
|
82
81
|
* @value nav 条形指示点
|
|
83
82
|
* @value indexes 索引指示点
|
|
84
83
|
* @property {String} field mode 为 nav 时,显示的内容字段(mode = nav 时必填)
|
|
85
84
|
* @property {String} info 轮播图的数据,通过数组长度决定指示点个数
|
|
86
85
|
* @property {Object} dotsStyles 指示点样式
|
|
87
86
|
* @event {Function} clickItem 组件触发点击事件时触发,e={currentIndex}
|
|
88
87
|
*/
|
|
89
88
|
name: 'UniSwiperDot',
|
|
90
89
|
emits: ['clickItem'],
|
|
91
90
|
props: {
|
|
92
91
|
info: {
|
|
93
92
|
type: Array,
|
|
94
93
|
default() {
|
|
95
94
|
return [];
|
|
96
95
|
}
|
|
97
96
|
},
|
|
98
97
|
current: {
|
|
99
98
|
type: Number,
|
|
100
99
|
default: 0
|
|
101
100
|
},
|
|
102
101
|
dotsStyles: {
|
|
103
102
|
type: Object,
|
|
104
103
|
default() {
|
|
105
104
|
return {};
|
|
106
105
|
}
|
|
107
106
|
},
|
|
108
107
|
// 类型 :default(默认) indexes long nav
|
|
109
108
|
mode: {
|
|
110
109
|
type: String,
|
|
111
110
|
default: 'default'
|
|
112
111
|
},
|
|
113
112
|
// 只在 nav 模式下生效,变量名称
|
|
114
113
|
field: {
|
|
115
114
|
type: String,
|
|
116
115
|
default: ''
|
|
117
116
|
}
|
|
118
117
|
},
|
|
119
118
|
data() {
|
|
120
119
|
return {
|
|
121
120
|
dots: {
|
|
122
121
|
width: 6,
|
|
123
122
|
height: 6,
|
|
124
123
|
bottom: 10,
|
|
125
124
|
color: '#fff',
|
|
126
125
|
backgroundColor: 'rgba(0, 0, 0, .3)',
|
|
127
126
|
border: '1px rgba(0, 0, 0, .3) solid',
|
|
128
127
|
selectedBackgroundColor: '#333',
|
|
129
128
|
selectedBorder: '1px rgba(0, 0, 0, .9) solid'
|
|
130
129
|
}
|
|
131
130
|
};
|
|
132
131
|
},
|
|
133
132
|
watch: {
|
|
134
133
|
dotsStyles(newVal) {
|
|
135
134
|
this.dots = Object.assign(this.dots, this.dotsStyles);
|
|
136
135
|
},
|
|
137
136
|
mode(newVal) {
|
|
138
137
|
if (newVal === 'indexes') {
|
|
139
138
|
this.dots.width = 14;
|
|
140
139
|
this.dots.height = 14;
|
|
141
140
|
} else {
|
|
142
141
|
this.dots.width = 6;
|
|
143
142
|
this.dots.height = 6;
|
|
144
143
|
}
|
|
145
144
|
}
|
|
146
145
|
},
|
|
147
146
|
created() {
|
|
148
147
|
if (this.mode === 'indexes') {
|
|
149
148
|
this.dots.width = 12;
|
|
150
149
|
this.dots.height = 12;
|
|
151
150
|
}
|
|
152
151
|
this.dots = Object.assign(this.dots, this.dotsStyles);
|
|
153
152
|
},
|
|
154
153
|
methods: {
|
|
155
154
|
clickItem(index) {
|
|
156
155
|
this.$emit('clickItem', index);
|
|
157
156
|
}
|
|
158
157
|
}
|
|
158
|
+
<template>
|
|
159
|
+
<view class="uni-swiper__warp">
|
|
160
|
+
<slot />
|
|
161
|
+
<view v-if="mode === 'default'" :style="{ bottom: dots.bottom + 'px' }" class="uni-swiper__dots-box" key="default">
|
|
162
|
+
<view
|
|
163
|
+
v-for="(item, index) in info"
|
|
164
|
+
@click="clickItem(index)"
|
|
165
|
+
:style="{
|
|
166
|
+
width: (index === current ? dots.width * 2 : dots.width) + 'px',
|
|
167
|
+
height: dots.width / 2 + 'px',
|
|
168
|
+
'background-color': index !== current ? dots.backgroundColor : dots.selectedBackgroundColor,
|
|
169
|
+
'border-radius': '0px'
|
|
170
|
+
}"
|
|
171
|
+
:key="index"
|
|
172
|
+
class="uni-swiper__dots-item uni-swiper__dots-bar"
|
|
173
|
+
/>
|
|
174
|
+
</view>
|
|
175
|
+
<view v-if="mode === 'dot'" :style="{ bottom: dots.bottom + 'px' }" class="uni-swiper__dots-box" key="dot">
|
|
176
|
+
<view
|
|
177
|
+
v-for="(item, index) in info"
|
|
178
|
+
@click="clickItem(index)"
|
|
179
|
+
:style="{
|
|
180
|
+
width: dots.width + 'px',
|
|
181
|
+
height: dots.height + 'px',
|
|
182
|
+
'background-color': index !== current ? dots.backgroundColor : dots.selectedBackgroundColor,
|
|
183
|
+
border: index !== current ? dots.border : dots.selectedBorder
|
|
184
|
+
}"
|
|
185
|
+
:key="index"
|
|
186
|
+
class="uni-swiper__dots-item"
|
|
187
|
+
/>
|
|
188
|
+
</view>
|
|
189
|
+
<view v-if="mode === 'round'" :style="{ bottom: dots.bottom + 'px' }" class="uni-swiper__dots-box" key="round">
|
|
190
|
+
<view
|
|
191
|
+
v-for="(item, index) in info"
|
|
192
|
+
@click="clickItem(index)"
|
|
193
|
+
:class="[index === current && 'uni-swiper__dots-long']"
|
|
194
|
+
:style="{
|
|
195
|
+
width: (index === current ? dots.width * 3 : dots.width) + 'px',
|
|
196
|
+
height: dots.height + 'px',
|
|
197
|
+
'background-color': index !== current ? dots.backgroundColor : dots.selectedBackgroundColor,
|
|
198
|
+
border: index !== current ? dots.border : dots.selectedBorder
|
|
199
|
+
}"
|
|
200
|
+
:key="index"
|
|
201
|
+
class="uni-swiper__dots-item"
|
|
202
|
+
/>
|
|
203
|
+
</view>
|
|
204
|
+
<view
|
|
205
|
+
v-if="mode === 'nav'"
|
|
206
|
+
key="nav"
|
|
207
|
+
:style="{ 'background-color': dotsStyles.backgroundColor, bottom: '0' }"
|
|
208
|
+
class="uni-swiper__dots-box uni-swiper__dots-nav"
|
|
209
|
+
>
|
|
210
|
+
<text :style="{ color: dotsStyles.color }" class="uni-swiper__dots-nav-item">
|
|
211
|
+
{{ current + 1 + '/' + info.length + ' ' + info[current][field] }}
|
|
212
|
+
</text>
|
|
213
|
+
</view>
|
|
214
|
+
<view v-if="mode === 'indexes'" key="indexes" :style="{ bottom: dots.bottom + 'px' }" class="uni-swiper__dots-box">
|
|
215
|
+
<view
|
|
216
|
+
v-for="(item, index) in info"
|
|
217
|
+
@click="clickItem(index)"
|
|
218
|
+
:style="{
|
|
219
|
+
width: dots.width + 'px',
|
|
220
|
+
height: dots.height + 'px',
|
|
221
|
+
color: index === current ? dots.selectedColor : dots.color,
|
|
222
|
+
'background-color': index !== current ? dots.backgroundColor : dots.selectedBackgroundColor,
|
|
223
|
+
border: index !== current ? dots.border : dots.selectedBorder
|
|
224
|
+
}"
|
|
225
|
+
:key="index"
|
|
226
|
+
class="uni-swiper__dots-item uni-swiper__dots-indexes"
|
|
227
|
+
>
|
|
228
|
+
<text class="uni-swiper__dots-indexes-text">{{ index + 1 }}</text>
|
|
229
|
+
</view>
|
|
230
|
+
</view>
|
|
231
|
+
</view>
|
|
232
|
+
</template>
|
|
233
|
+
<script>
|
|
234
|
+
/**
|
|
235
|
+
* SwiperDod 轮播图指示点
|
|
236
|
+
* @description 自定义轮播图指示点
|
|
237
|
+
* @tutorial https://ext.dcloud.net.cn/plugin?id=284
|
|
238
|
+
* @property {Number} current 当前指示点索引,必须是通过 `swiper` 的 `change` 事件获取到的 `e.detail.current`
|
|
239
|
+
* @property {String} mode = [default|round|nav|indexes] 指示点的类型
|
|
240
|
+
* @value defualt 默认指示点
|
|
241
|
+
* @value round 圆形指示点
|
|
242
|
+
* @value nav 条形指示点
|
|
243
|
+
* @value indexes 索引指示点
|
|
244
|
+
* @property {String} field mode 为 nav 时,显示的内容字段(mode = nav 时必填)
|
|
245
|
+
* @property {String} info 轮播图的数据,通过数组长度决定指示点个数
|
|
246
|
+
* @property {Object} dotsStyles 指示点样式
|
|
247
|
+
* @event {Function} clickItem 组件触发点击事件时触发,e={currentIndex}
|
|
248
|
+
*/
|
|
249
|
+
export default {
|
|
250
|
+
name: 'UniSwiperDot',
|
|
251
|
+
emits: ['clickItem'],
|
|
252
|
+
props: {
|
|
253
|
+
info: {
|
|
254
|
+
type: Array,
|
|
255
|
+
default() {
|
|
256
|
+
return [];
|
|
257
|
+
}
|
|
258
|
+
},
|
|
259
|
+
current: {
|
|
260
|
+
type: Number,
|
|
261
|
+
default: 0
|
|
262
|
+
},
|
|
263
|
+
dotsStyles: {
|
|
264
|
+
type: Object,
|
|
265
|
+
default() {
|
|
266
|
+
return {};
|
|
267
|
+
}
|
|
268
|
+
},
|
|
269
|
+
// 类型 :default(默认) indexes long nav
|
|
270
|
+
mode: {
|
|
271
|
+
type: String,
|
|
272
|
+
default: 'default'
|
|
273
|
+
},
|
|
274
|
+
// 只在 nav 模式下生效,变量名称
|
|
275
|
+
field: {
|
|
276
|
+
type: String,
|
|
277
|
+
default: ''
|
|
278
|
+
}
|
|
279
|
+
},
|
|
280
|
+
data() {
|
|
281
|
+
return {
|
|
282
|
+
dots: {
|
|
283
|
+
width: 6,
|
|
284
|
+
height: 6,
|
|
285
|
+
bottom: 10,
|
|
286
|
+
color: '#fff',
|
|
287
|
+
backgroundColor: 'rgba(0, 0, 0, .3)',
|
|
288
|
+
border: '1px rgba(0, 0, 0, .3) solid',
|
|
289
|
+
selectedBackgroundColor: '#333',
|
|
290
|
+
selectedBorder: '1px rgba(0, 0, 0, .9) solid'
|
|
291
|
+
}
|
|
292
|
+
};
|
|
293
|
+
},
|
|
294
|
+
watch: {
|
|
295
|
+
dotsStyles(newVal) {
|
|
296
|
+
this.dots = Object.assign(this.dots, this.dotsStyles);
|
|
297
|
+
},
|
|
298
|
+
mode(newVal) {
|
|
299
|
+
if (newVal === 'indexes') {
|
|
300
|
+
this.dots.width = 14;
|
|
301
|
+
this.dots.height = 14;
|
|
302
|
+
} else {
|
|
303
|
+
this.dots.width = 6;
|
|
304
|
+
this.dots.height = 6;
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
},
|
|
308
|
+
created() {
|
|
309
|
+
if (this.mode === 'indexes') {
|
|
310
|
+
this.dots.width = 12;
|
|
311
|
+
this.dots.height = 12;
|
|
312
|
+
}
|
|
313
|
+
this.dots = Object.assign(this.dots, this.dotsStyles);
|
|
314
|
+
},
|
|
315
|
+
methods: {
|
|
316
|
+
clickItem(index) {
|
|
317
|
+
this.$emit('clickItem', index);
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
};
|
|
321
|
+
</script>
|
|
322
|
+
<style>
|
|
323
|
+
@import 'style.css';
|
|
324
|
+
</style>
|