@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,139 +0,0 @@
|
|
|
1
|
-
/* eslint-disable */
|
|
2
|
-
var provinceData = [{
|
|
3
|
-
"label": "北京市",
|
|
4
|
-
"value": "11"
|
|
5
|
-
},
|
|
6
|
-
{
|
|
7
|
-
"label": "天津市",
|
|
8
|
-
"value": "12"
|
|
9
|
-
},
|
|
10
|
-
{
|
|
11
|
-
"label": "河北省",
|
|
12
|
-
"value": "13"
|
|
13
|
-
},
|
|
14
|
-
{
|
|
15
|
-
"label": "山西省",
|
|
16
|
-
"value": "14"
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
"label": "内蒙古自治区",
|
|
20
|
-
"value": "15"
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
"label": "辽宁省",
|
|
24
|
-
"value": "21"
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
"label": "吉林省",
|
|
28
|
-
"value": "22"
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
"label": "黑龙江省",
|
|
32
|
-
"value": "23"
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
"label": "上海市",
|
|
36
|
-
"value": "31"
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
"label": "江苏省",
|
|
40
|
-
"value": "32"
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
"label": "浙江省",
|
|
44
|
-
"value": "33"
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
"label": "安徽省",
|
|
48
|
-
"value": "34"
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
"label": "福建省",
|
|
52
|
-
"value": "35"
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
"label": "江西省",
|
|
56
|
-
"value": "36"
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
"label": "山东省",
|
|
60
|
-
"value": "37"
|
|
61
|
-
},
|
|
62
|
-
{
|
|
63
|
-
"label": "河南省",
|
|
64
|
-
"value": "41"
|
|
65
|
-
},
|
|
66
|
-
{
|
|
67
|
-
"label": "湖北省",
|
|
68
|
-
"value": "42"
|
|
69
|
-
},
|
|
70
|
-
{
|
|
71
|
-
"label": "湖南省",
|
|
72
|
-
"value": "43"
|
|
73
|
-
},
|
|
74
|
-
{
|
|
75
|
-
"label": "广东省",
|
|
76
|
-
"value": "44"
|
|
77
|
-
},
|
|
78
|
-
{
|
|
79
|
-
"label": "广西壮族自治区",
|
|
80
|
-
"value": "45"
|
|
81
|
-
},
|
|
82
|
-
{
|
|
83
|
-
"label": "海南省",
|
|
84
|
-
"value": "46"
|
|
85
|
-
},
|
|
86
|
-
{
|
|
87
|
-
"label": "重庆市",
|
|
88
|
-
"value": "50"
|
|
89
|
-
},
|
|
90
|
-
{
|
|
91
|
-
"label": "四川省",
|
|
92
|
-
"value": "51"
|
|
93
|
-
},
|
|
94
|
-
{
|
|
95
|
-
"label": "贵州省",
|
|
96
|
-
"value": "52"
|
|
97
|
-
},
|
|
98
|
-
{
|
|
99
|
-
"label": "云南省",
|
|
100
|
-
"value": "53"
|
|
101
|
-
},
|
|
102
|
-
{
|
|
103
|
-
"label": "西藏自治区",
|
|
104
|
-
"value": "54"
|
|
105
|
-
},
|
|
106
|
-
{
|
|
107
|
-
"label": "陕西省",
|
|
108
|
-
"value": "61"
|
|
109
|
-
},
|
|
110
|
-
{
|
|
111
|
-
"label": "甘肃省",
|
|
112
|
-
"value": "62"
|
|
113
|
-
},
|
|
114
|
-
{
|
|
115
|
-
"label": "青海省",
|
|
116
|
-
"value": "63"
|
|
117
|
-
},
|
|
118
|
-
{
|
|
119
|
-
"label": "宁夏回族自治区",
|
|
120
|
-
"value": "64"
|
|
121
|
-
},
|
|
122
|
-
{
|
|
123
|
-
"label": "新疆维吾尔自治区",
|
|
124
|
-
"value": "65"
|
|
125
|
-
},
|
|
126
|
-
{
|
|
127
|
-
"label": "台湾",
|
|
128
|
-
"value": "66"
|
|
129
|
-
},
|
|
130
|
-
{
|
|
131
|
-
"label": "香港",
|
|
132
|
-
"value": "67"
|
|
133
|
-
},
|
|
134
|
-
{
|
|
135
|
-
"label": "澳门",
|
|
136
|
-
"value": "68"
|
|
137
|
-
}
|
|
138
|
-
]
|
|
139
|
-
export default provinceData;
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
<view class="mpvue-picker">
|
|
3
1
|
<view :class="{ pickerMask: showPicker }" @click="maskClick" catchtouchmove="true"></view>
|
|
4
2
|
<view class="mpvue-picker-content" :class="{ 'mpvue-picker-view-show': showPicker }">
|
|
5
3
|
<view class="mpvue-picker__hd" catchtouchmove="true">
|
|
6
4
|
<view class="mpvue-picker__action" @click="pickerCancel">取消</view>
|
|
7
5
|
<view class="mpvue-picker__action" :style="{ color: themeColor }" @click="pickerConfirm">确定</view>
|
|
8
6
|
</view>
|
|
9
7
|
<!-- 单列 -->
|
|
10
8
|
<picker-view
|
|
11
9
|
indicator-style="height: 40px;"
|
|
12
10
|
class="mpvue-picker-view"
|
|
13
11
|
:value="pickerValue"
|
|
14
12
|
@change="pickerChange"
|
|
15
13
|
v-if="mode === 'selector' && pickerValueSingleArray.length > 0"
|
|
16
14
|
>
|
|
17
15
|
<picker-view-column>
|
|
18
16
|
<view class="picker-item" v-for="(item, index) in pickerValueSingleArray" :key="index">{{ item.label }}</view>
|
|
19
17
|
</picker-view-column>
|
|
20
18
|
</picker-view>
|
|
21
19
|
<!-- 时间选择器 -->
|
|
22
20
|
<picker-view
|
|
23
21
|
indicator-style="height: 40px;"
|
|
24
22
|
class="mpvue-picker-view"
|
|
25
23
|
:value="pickerValue"
|
|
26
24
|
@change="pickerChange"
|
|
27
25
|
v-if="mode === 'timeSelector'"
|
|
28
26
|
>
|
|
29
27
|
<picker-view-column>
|
|
30
28
|
<view class="picker-item" v-for="(item, index) in pickerValueHour" :key="index">{{ item.label }}</view>
|
|
31
29
|
</picker-view-column>
|
|
32
30
|
<picker-view-column>
|
|
33
31
|
<view class="picker-item" v-for="(item, index) in pickerValueMinute" :key="index">{{ item.label }}</view>
|
|
34
32
|
</picker-view-column>
|
|
35
33
|
</picker-view>
|
|
36
34
|
<!-- 多列选择 -->
|
|
37
35
|
<picker-view
|
|
38
36
|
indicator-style="height: 40px;"
|
|
39
37
|
class="mpvue-picker-view"
|
|
40
38
|
:value="pickerValue"
|
|
41
39
|
@change="pickerChange"
|
|
42
40
|
v-if="mode === 'multiSelector'"
|
|
43
41
|
>
|
|
44
42
|
<!-- #ifdef VUE3 -->
|
|
45
43
|
<template v-for="(n, index) in pickerValueMulArray.length" :key="index">
|
|
46
44
|
<picker-view-column>
|
|
47
45
|
<view class="picker-item" v-for="(item, index1) in pickerValueMulArray[n]" :key="index1">
|
|
48
46
|
{{ item.label }}
|
|
49
47
|
</view>
|
|
50
48
|
</picker-view-column>
|
|
51
49
|
</template>
|
|
52
50
|
<!-- #endif -->
|
|
53
51
|
<!-- #ifndef VUE3 -->
|
|
54
52
|
<block v-for="(n, index) in pickerValueMulArray.length" :key="index">
|
|
55
53
|
<picker-view-column>
|
|
56
54
|
<view class="picker-item" v-for="(item, index1) in pickerValueMulArray[n]" :key="index1">
|
|
57
55
|
{{ item.label }}
|
|
58
56
|
</view>
|
|
59
57
|
</picker-view-column>
|
|
60
58
|
</block>
|
|
61
59
|
<!-- #endif -->
|
|
62
60
|
</picker-view>
|
|
63
61
|
<!-- 二级联动 -->
|
|
64
62
|
<picker-view
|
|
65
63
|
indicator-style="height: 40px;"
|
|
66
64
|
class="mpvue-picker-view"
|
|
67
65
|
:value="pickerValue"
|
|
68
66
|
@change="pickerChangeMul"
|
|
69
67
|
v-if="mode === 'multiLinkageSelector' && deepLength === 2"
|
|
70
68
|
>
|
|
71
69
|
<picker-view-column>
|
|
72
70
|
<view class="picker-item" v-for="(item, index) in pickerValueMulTwoOne" :key="index">{{ item.label }}</view>
|
|
73
71
|
</picker-view-column>
|
|
74
72
|
<picker-view-column>
|
|
75
73
|
<view class="picker-item" v-for="(item, index) in pickerValueMulTwoTwo" :key="index">{{ item.label }}</view>
|
|
76
74
|
</picker-view-column>
|
|
77
75
|
</picker-view>
|
|
78
76
|
<!-- 三级联动 -->
|
|
79
77
|
<picker-view
|
|
80
78
|
indicator-style="height: 40px;"
|
|
81
79
|
class="mpvue-picker-view"
|
|
82
80
|
:value="pickerValue"
|
|
83
81
|
@change="pickerChangeMul"
|
|
84
82
|
v-if="mode === 'multiLinkageSelector' && deepLength === 3"
|
|
85
83
|
>
|
|
86
84
|
<picker-view-column>
|
|
87
85
|
<view class="picker-item" v-for="(item, index) in pickerValueMulThreeOne" :key="index">{{ item.label }}</view>
|
|
88
86
|
</picker-view-column>
|
|
89
87
|
<picker-view-column>
|
|
90
88
|
<view class="picker-item" v-for="(item, index) in pickerValueMulThreeTwo" :key="index">{{ item.label }}</view>
|
|
91
89
|
</picker-view-column>
|
|
92
90
|
<picker-view-column>
|
|
93
91
|
<view class="picker-item" v-for="(item, index) in pickerValueMulThreeThree" :key="index">
|
|
94
92
|
{{ item.label }}
|
|
95
93
|
</view>
|
|
96
94
|
</picker-view-column>
|
|
97
95
|
</picker-view>
|
|
98
96
|
</view>
|
|
99
97
|
</view>
|
|
100
98
|
data() {
|
|
101
99
|
return {
|
|
102
100
|
pickerChangeValue: [],
|
|
103
101
|
pickerValue: [],
|
|
104
102
|
pickerValueArrayChange: true,
|
|
105
103
|
modeChange: false,
|
|
106
104
|
pickerValueSingleArray: [],
|
|
107
105
|
pickerValueHour: [],
|
|
108
106
|
pickerValueMinute: [],
|
|
109
107
|
pickerValueMulArray: [],
|
|
110
108
|
pickerValueMulTwoOne: [],
|
|
111
109
|
pickerValueMulTwoTwo: [],
|
|
112
110
|
pickerValueMulThreeOne: [],
|
|
113
111
|
pickerValueMulThreeTwo: [],
|
|
114
112
|
pickerValueMulThreeThree: [],
|
|
115
113
|
/* 是否显示控件 */
|
|
116
114
|
showPicker: false
|
|
117
115
|
};
|
|
118
116
|
},
|
|
119
117
|
props: {
|
|
120
118
|
/* mode */
|
|
121
119
|
mode: {
|
|
122
120
|
type: String,
|
|
123
121
|
default: 'selector'
|
|
124
122
|
},
|
|
125
123
|
/* picker 数值 */
|
|
126
124
|
pickerValueArray: {
|
|
127
125
|
type: Array,
|
|
128
126
|
default() {
|
|
129
127
|
return [];
|
|
130
128
|
}
|
|
131
129
|
},
|
|
132
130
|
/* 默认值 */
|
|
133
131
|
pickerValueDefault: {
|
|
134
132
|
type: Array,
|
|
135
133
|
default() {
|
|
136
134
|
return [];
|
|
137
135
|
}
|
|
138
136
|
},
|
|
139
137
|
/* 几级联动 */
|
|
140
138
|
deepLength: {
|
|
141
139
|
type: Number,
|
|
142
140
|
default: 2
|
|
143
141
|
},
|
|
144
142
|
/* 主题色 */
|
|
145
143
|
themeColor: String
|
|
146
144
|
},
|
|
147
145
|
watch: {
|
|
148
146
|
pickerValueArray(oldVal, newVal) {
|
|
149
147
|
this.pickerValueArrayChange = true;
|
|
150
148
|
},
|
|
151
149
|
mode(oldVal, newVal) {
|
|
152
150
|
this.modeChange = true;
|
|
153
151
|
},
|
|
154
152
|
pickerValueArray(val) {
|
|
155
153
|
this.initPicker(val);
|
|
156
154
|
}
|
|
157
155
|
},
|
|
158
156
|
methods: {
|
|
159
157
|
initPicker(valueArray) {
|
|
160
158
|
let pickerValueArray = valueArray;
|
|
161
159
|
this.pickerValue = this.pickerValueDefault;
|
|
162
160
|
// 初始化多级联动
|
|
163
161
|
if (this.mode === 'selector') {
|
|
164
162
|
this.pickerValueSingleArray = valueArray;
|
|
165
163
|
} else if (this.mode === 'timeSelector') {
|
|
166
164
|
this.modeChange = false;
|
|
167
165
|
let hourArray = [];
|
|
168
166
|
let minuteArray = [];
|
|
169
167
|
for (let i = 0; i < 24; i++) {
|
|
170
168
|
hourArray.push({
|
|
171
169
|
value: i,
|
|
172
170
|
label: i > 9 ? `${i} 时` : `0${i} 时`
|
|
173
171
|
});
|
|
174
172
|
}
|
|
175
173
|
for (let i = 0; i < 60; i++) {
|
|
176
174
|
minuteArray.push({
|
|
177
175
|
value: i,
|
|
178
176
|
label: i > 9 ? `${i} 分` : `0${i} 分`
|
|
179
177
|
});
|
|
180
178
|
}
|
|
181
179
|
this.pickerValueHour = hourArray;
|
|
182
180
|
this.pickerValueMinute = minuteArray;
|
|
183
181
|
} else if (this.mode === 'multiSelector') {
|
|
184
182
|
this.pickerValueMulArray = valueArray;
|
|
185
183
|
} else if (this.mode === 'multiLinkageSelector' && this.deepLength === 2) {
|
|
186
184
|
// 两级联动
|
|
187
185
|
let pickerValueMulTwoOne = [];
|
|
188
186
|
let pickerValueMulTwoTwo = [];
|
|
189
187
|
// 第一列
|
|
190
188
|
for (let i = 0, length = pickerValueArray.length; i < length; i++) {
|
|
191
189
|
pickerValueMulTwoOne.push(pickerValueArray[i]);
|
|
192
190
|
}
|
|
193
191
|
// 渲染第二列
|
|
194
192
|
// 如果有设定的默认值
|
|
195
193
|
if (this.pickerValueDefault.length === 2) {
|
|
196
194
|
let num = this.pickerValueDefault[0];
|
|
197
195
|
for (let i = 0, length = pickerValueArray[num].children.length; i < length; i++) {
|
|
198
196
|
pickerValueMulTwoTwo.push(pickerValueArray[num].children[i]);
|
|
199
197
|
}
|
|
200
198
|
} else {
|
|
201
199
|
for (let i = 0, length = pickerValueArray[0].children.length; i < length; i++) {
|
|
202
200
|
pickerValueMulTwoTwo.push(pickerValueArray[0].children[i]);
|
|
203
201
|
}
|
|
204
202
|
}
|
|
205
203
|
this.pickerValueMulTwoOne = pickerValueMulTwoOne;
|
|
206
204
|
this.pickerValueMulTwoTwo = pickerValueMulTwoTwo;
|
|
207
205
|
} else if (this.mode === 'multiLinkageSelector' && this.deepLength === 3) {
|
|
208
206
|
let pickerValueMulThreeOne = [];
|
|
209
207
|
let pickerValueMulThreeTwo = [];
|
|
210
208
|
let pickerValueMulThreeThree = [];
|
|
211
209
|
// 第一列
|
|
212
210
|
for (let i = 0, length = pickerValueArray.length; i < length; i++) {
|
|
213
211
|
pickerValueMulThreeOne.push(pickerValueArray[i]);
|
|
214
212
|
}
|
|
215
213
|
// 渲染第二列
|
|
216
214
|
this.pickerValueDefault = this.pickerValueDefault.length === 3 ? this.pickerValueDefault : [0, 0, 0];
|
|
217
215
|
if (this.pickerValueDefault.length === 3) {
|
|
218
216
|
let num = this.pickerValueDefault[0];
|
|
219
217
|
for (let i = 0, length = pickerValueArray[num].children.length; i < length; i++) {
|
|
220
218
|
pickerValueMulThreeTwo.push(pickerValueArray[num].children[i]);
|
|
221
219
|
}
|
|
222
220
|
// 第三列
|
|
223
221
|
let numSecond = this.pickerValueDefault[1];
|
|
224
222
|
for (let i = 0, length = pickerValueArray[num].children[numSecond].children.length; i < length; i++) {
|
|
225
223
|
pickerValueMulThreeThree.push(pickerValueArray[num].children[numSecond].children[i]);
|
|
226
224
|
}
|
|
227
225
|
}
|
|
228
226
|
this.pickerValueMulThreeOne = pickerValueMulThreeOne;
|
|
229
227
|
this.pickerValueMulThreeTwo = pickerValueMulThreeTwo;
|
|
230
228
|
this.pickerValueMulThreeThree = pickerValueMulThreeThree;
|
|
231
229
|
}
|
|
232
230
|
},
|
|
233
231
|
show() {
|
|
234
232
|
setTimeout(() => {
|
|
235
233
|
if (this.pickerValueArrayChange || this.modeChange) {
|
|
236
234
|
this.initPicker(this.pickerValueArray);
|
|
237
235
|
this.showPicker = true;
|
|
238
236
|
this.pickerValueArrayChange = false;
|
|
239
237
|
this.modeChange = false;
|
|
240
238
|
} else {
|
|
241
239
|
this.showPicker = true;
|
|
242
240
|
}
|
|
243
241
|
}, 0);
|
|
244
242
|
},
|
|
245
243
|
maskClick() {
|
|
246
244
|
this.pickerCancel();
|
|
247
245
|
},
|
|
248
246
|
pickerCancel() {
|
|
249
247
|
this.showPicker = false;
|
|
250
248
|
this._initPickerVale();
|
|
251
249
|
let pickObj = {
|
|
252
250
|
index: this.pickerValue,
|
|
253
251
|
value: this._getPickerLabelAndValue(this.pickerValue, this.mode).value,
|
|
254
252
|
label: this._getPickerLabelAndValue(this.pickerValue, this.mode).label
|
|
255
253
|
};
|
|
256
254
|
this.$emit('onCancel', pickObj);
|
|
257
255
|
},
|
|
258
256
|
pickerConfirm(e) {
|
|
259
257
|
this.showPicker = false;
|
|
260
258
|
this._initPickerVale();
|
|
261
259
|
let pickObj = {
|
|
262
260
|
index: this.pickerValue,
|
|
263
261
|
value: this._getPickerLabelAndValue(this.pickerValue, this.mode).value,
|
|
264
262
|
label: this._getPickerLabelAndValue(this.pickerValue, this.mode).label
|
|
265
263
|
};
|
|
266
264
|
this.$emit('onConfirm', pickObj);
|
|
267
265
|
},
|
|
268
266
|
showPickerView() {
|
|
269
267
|
this.showPicker = true;
|
|
270
268
|
},
|
|
271
269
|
pickerChange(e) {
|
|
272
270
|
this.pickerValue = e.mp.detail.value;
|
|
273
271
|
let pickObj = {
|
|
274
272
|
index: this.pickerValue,
|
|
275
273
|
value: this._getPickerLabelAndValue(this.pickerValue, this.mode).value,
|
|
276
274
|
label: this._getPickerLabelAndValue(this.pickerValue, this.mode).label
|
|
277
275
|
};
|
|
278
276
|
this.$emit('onChange', pickObj);
|
|
279
277
|
},
|
|
280
278
|
pickerChangeMul(e) {
|
|
281
279
|
if (this.deepLength === 2) {
|
|
282
280
|
let pickerValueArray = this.pickerValueArray;
|
|
283
281
|
let changeValue = e.mp.detail.value;
|
|
284
282
|
// 处理第一列滚动
|
|
285
283
|
if (changeValue[0] !== this.pickerValue[0]) {
|
|
286
284
|
let pickerValueMulTwoTwo = [];
|
|
287
285
|
// 第一列滚动第二列数据更新
|
|
288
286
|
for (let i = 0, length = pickerValueArray[changeValue[0]].children.length; i < length; i++) {
|
|
289
287
|
pickerValueMulTwoTwo.push(pickerValueArray[changeValue[0]].children[i]);
|
|
290
288
|
}
|
|
291
289
|
this.pickerValueMulTwoTwo = pickerValueMulTwoTwo;
|
|
292
290
|
// 第二列初始化为 0
|
|
293
291
|
changeValue[1] = 0;
|
|
294
292
|
}
|
|
295
293
|
this.pickerValue = changeValue;
|
|
296
294
|
} else if (this.deepLength === 3) {
|
|
297
295
|
let pickerValueArray = this.pickerValueArray;
|
|
298
296
|
let changeValue = e.mp.detail.value;
|
|
299
297
|
let pickerValueMulThreeTwo = [];
|
|
300
298
|
let pickerValueMulThreeThree = [];
|
|
301
299
|
// 重新渲染第二列
|
|
302
300
|
// 如果是第一列滚动
|
|
303
301
|
if (changeValue[0] !== this.pickerValue[0]) {
|
|
304
302
|
this.pickerValueMulThreeTwo = [];
|
|
305
303
|
for (let i = 0, length = pickerValueArray[changeValue[0]].children.length; i < length; i++) {
|
|
306
304
|
pickerValueMulThreeTwo.push(pickerValueArray[changeValue[0]].children[i]);
|
|
307
305
|
}
|
|
308
306
|
// 重新渲染第三列
|
|
309
307
|
for (let i = 0, length = pickerValueArray[changeValue[0]].children[0].children.length; i < length; i++) {
|
|
310
308
|
pickerValueMulThreeThree.push(pickerValueArray[changeValue[0]].children[0].children[i]);
|
|
311
309
|
}
|
|
312
310
|
changeValue[1] = 0;
|
|
313
311
|
changeValue[2] = 0;
|
|
314
312
|
this.pickerValueMulThreeTwo = pickerValueMulThreeTwo;
|
|
315
313
|
this.pickerValueMulThreeThree = pickerValueMulThreeThree;
|
|
316
314
|
} else if (changeValue[1] !== this.pickerValue[1]) {
|
|
317
315
|
// 第二列滚动
|
|
318
316
|
// 重新渲染第三列
|
|
319
317
|
this.pickerValueMulThreeThree = [];
|
|
320
318
|
pickerValueMulThreeTwo = this.pickerValueMulThreeTwo;
|
|
321
319
|
for (let i = 0, length = pickerValueArray[changeValue[0]].children[changeValue[1]].children.length; i < length; i++) {
|
|
322
320
|
pickerValueMulThreeThree.push(pickerValueArray[changeValue[0]].children[changeValue[1]].children[i]);
|
|
323
321
|
}
|
|
324
322
|
changeValue[2] = 0;
|
|
325
323
|
this.pickerValueMulThreeThree = pickerValueMulThreeThree;
|
|
326
324
|
}
|
|
327
325
|
this.pickerValue = changeValue;
|
|
328
326
|
}
|
|
329
327
|
let pickObj = {
|
|
330
328
|
index: this.pickerValue,
|
|
331
329
|
value: this._getPickerLabelAndValue(this.pickerValue, this.mode).value,
|
|
332
330
|
label: this._getPickerLabelAndValue(this.pickerValue, this.mode).label
|
|
333
331
|
};
|
|
334
332
|
this.$emit('onChange', pickObj);
|
|
335
333
|
},
|
|
336
334
|
// 获取 pxikerLabel
|
|
337
335
|
_getPickerLabelAndValue(value, mode) {
|
|
338
336
|
let pickerLable;
|
|
339
337
|
let pickerGetValue = [];
|
|
340
338
|
// selector
|
|
341
339
|
if (mode === 'selector') {
|
|
342
340
|
pickerLable = this.pickerValueSingleArray[value].label;
|
|
343
341
|
pickerGetValue.push(this.pickerValueSingleArray[value].value);
|
|
344
342
|
} else if (mode === 'timeSelector') {
|
|
345
343
|
pickerLable = `${this.pickerValueHour[value[0]].label}-${this.pickerValueMinute[value[1]].label}`;
|
|
346
344
|
pickerGetValue.push(this.pickerValueHour[value[0]].value);
|
|
347
345
|
pickerGetValue.push(this.pickerValueHour[value[1]].value);
|
|
348
346
|
} else if (mode === 'multiSelector') {
|
|
349
347
|
for (let i = 0; i < value.length; i++) {
|
|
350
348
|
if (i > 0) {
|
|
351
349
|
pickerLable += this.pickerValueMulArray[i][value[i]].label + (i === value.length - 1 ? '' : '-');
|
|
352
350
|
} else {
|
|
353
351
|
pickerLable = this.pickerValueMulArray[i][value[i]].label + '-';
|
|
354
352
|
}
|
|
355
353
|
pickerGetValue.push(this.pickerValueMulArray[i][value[i]].value);
|
|
356
354
|
}
|
|
357
355
|
} else if (mode === 'multiLinkageSelector') {
|
|
358
356
|
/* eslint-disable indent */
|
|
359
357
|
pickerLable =
|
|
360
358
|
this.deepLength === 2
|
|
361
359
|
? `${this.pickerValueMulTwoOne[value[0]].label}-${this.pickerValueMulTwoTwo[value[1]].label}`
|
|
362
360
|
: `${this.pickerValueMulThreeOne[value[0]].label}-${this.pickerValueMulThreeTwo[value[1]].label}-${
|
|
363
361
|
this.pickerValueMulThreeThree[value[2]].label
|
|
364
362
|
}`;
|
|
365
363
|
if (this.deepLength === 2) {
|
|
366
364
|
pickerGetValue.push(this.pickerValueMulTwoOne[value[0]].value);
|
|
367
365
|
pickerGetValue.push(this.pickerValueMulTwoTwo[value[1]].value);
|
|
368
366
|
} else {
|
|
369
367
|
pickerGetValue.push(this.pickerValueMulThreeOne[value[0]].value);
|
|
370
368
|
pickerGetValue.push(this.pickerValueMulThreeTwo[value[1]].value);
|
|
371
369
|
pickerGetValue.push(this.pickerValueMulThreeThree[value[2]].value);
|
|
372
370
|
}
|
|
373
371
|
/* eslint-enable indent */
|
|
374
372
|
}
|
|
375
373
|
return {
|
|
376
374
|
label: pickerLable,
|
|
377
375
|
value: pickerGetValue
|
|
378
376
|
};
|
|
379
377
|
},
|
|
380
378
|
// 初始化 pickerValue 默认值
|
|
381
379
|
_initPickerVale() {
|
|
382
380
|
if (this.pickerValue.length === 0) {
|
|
383
381
|
if (this.mode === 'selector') {
|
|
384
382
|
this.pickerValue = [0];
|
|
385
383
|
} else if (this.mode === 'multiSelector') {
|
|
386
384
|
this.pickerValue = new Int8Array(this.pickerValueArray.length);
|
|
387
385
|
} else if (this.mode === 'multiLinkageSelector' && this.deepLength === 2) {
|
|
388
386
|
this.pickerValue = [0, 0];
|
|
389
387
|
} else if (this.mode === 'multiLinkageSelector' && this.deepLength === 3) {
|
|
390
388
|
this.pickerValue = [0, 0, 0];
|
|
391
389
|
}
|
|
392
390
|
}
|
|
393
391
|
}
|
|
394
392
|
}
|
|
395
|
-
@import './style.css';
|
|
396
|
-
</style>
|