@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.
Files changed (137) hide show
  1. package/other/mpvue-picker/mpvuePicker.vue +402 -0
  2. package/{uni-ui/lib → other}/mpvue-picker/style.css +0 -1
  3. package/{uni-ui/lib → other}/tab-nvue/style.css +0 -1
  4. package/other/uParse/components/style.css +1 -0
  5. package/other/uParse/components/wxParseAudio.vue +1 -0
  6. package/other/uParse/components/wxParseImg.vue +86 -0
  7. package/other/uParse/components/wxParseTable.vue +54 -0
  8. package/other/uParse/components/wxParseTemplate0.vue +98 -0
  9. package/other/uParse/components/wxParseTemplate1.vue +81 -0
  10. package/other/uParse/components/wxParseTemplate10.vue +81 -0
  11. package/other/uParse/components/wxParseTemplate11.vue +79 -0
  12. package/other/uParse/components/wxParseTemplate2.vue +81 -0
  13. package/other/uParse/components/wxParseTemplate3.vue +81 -0
  14. package/other/uParse/components/wxParseTemplate4.vue +81 -0
  15. package/other/uParse/components/wxParseTemplate5.vue +81 -0
  16. package/other/uParse/components/wxParseTemplate6.vue +81 -0
  17. package/other/uParse/components/wxParseTemplate7.vue +81 -0
  18. package/other/uParse/components/wxParseTemplate8.vue +81 -0
  19. package/other/uParse/components/wxParseTemplate9.vue +81 -0
  20. package/other/uParse/components/wxParseVideo.vue +14 -0
  21. package/other/uParse/editor.css +495 -0
  22. package/{uni-ui/lib/uParse/src → other/uParse}/libs/html2json.js +19 -22
  23. package/{uni-ui/lib/uParse/src → other/uParse}/libs/htmlparser.js +12 -5
  24. package/{uni-ui/lib/uParse/src → other/uParse}/libs/wxDiscode.js +2 -2
  25. package/other/uParse/wxParse.vue +196 -0
  26. package/package.json +1 -1
  27. package/plugins/map/amqp-wx.js +173 -0
  28. package/{uni-ui/lib/mpvueGestureLock/index.vue → ui-cv/components/cv-draw-gesture-lock/cv-draw-gesture-lock.vue} +4 -1
  29. package/ui-cv/components/cv-draw-gesture-lock/gestureLock.js +169 -0
  30. package/{uni-ui/lib/mpvueGestureLock → ui-cv/components/cv-draw-gesture-lock}/style.css +0 -1
  31. package/{uni-ui/lib/mpvue-citypicker → ui-cv/components/cv-geo-region}/style.css +0 -1
  32. package/ui-cv/components/cv-grid-item/cv-grid-item.vue +1 -1
  33. package/uni-ui/lib/uni-badge/uni-badge.vue +150 -1
  34. package/uni-ui/lib/uni-breadcrumb/uni-breadcrumb.vue +37 -1
  35. package/uni-ui/lib/uni-breadcrumb-item/uni-breadcrumb-item.vue +83 -1
  36. package/uni-ui/lib/uni-calendar/uni-calendar-item.vue +122 -1
  37. package/uni-ui/lib/uni-calendar/uni-calendar.vue +366 -1
  38. package/uni-ui/lib/uni-card/uni-card.vue +124 -1
  39. package/uni-ui/lib/uni-col/uni-col.vue +1 -1
  40. package/uni-ui/lib/uni-collapse/uni-collapse.vue +135 -1
  41. package/uni-ui/lib/uni-collapse-item/uni-collapse-item.vue +266 -1
  42. package/uni-ui/lib/uni-combox/uni-combox.vue +1 -1
  43. package/uni-ui/lib/uni-countdown/uni-countdown.vue +239 -1
  44. package/uni-ui/lib/uni-data-checkbox/uni-data-checkbox.vue +487 -1
  45. package/uni-ui/lib/uni-data-picker/uni-data-picker.vue +530 -1
  46. package/uni-ui/lib/uni-data-pickerview/uni-data-picker.js +157 -150
  47. package/uni-ui/lib/uni-data-pickerview/uni-data-pickerview.vue +166 -1
  48. package/uni-ui/lib/uni-data-select/uni-data-select.vue +289 -1
  49. package/uni-ui/lib/uni-datetime-picker/calendar-item.vue +70 -1
  50. package/uni-ui/lib/uni-datetime-picker/calendar.vue +629 -1
  51. package/uni-ui/lib/uni-datetime-picker/time-picker.vue +741 -1
  52. package/uni-ui/lib/uni-datetime-picker/uni-datetime-picker.vue +847 -1
  53. package/uni-ui/lib/uni-drawer/uni-drawer.vue +115 -1
  54. package/uni-ui/lib/uni-easyinput/uni-easyinput.vue +515 -1
  55. package/uni-ui/lib/uni-fab/uni-fab.vue +257 -1
  56. package/uni-ui/lib/uni-fav/uni-fav.vue +123 -1
  57. package/uni-ui/lib/uni-file-picker/uni-file-picker.vue +642 -1
  58. package/uni-ui/lib/uni-file-picker/upload-file.vue +177 -1
  59. package/uni-ui/lib/uni-file-picker/upload-image.vue +176 -1
  60. package/uni-ui/lib/uni-forms/uni-forms.vue +375 -1
  61. package/uni-ui/lib/uni-forms-item/uni-forms-item.vue +429 -1
  62. package/uni-ui/lib/uni-goods-nav/uni-goods-nav.vue +129 -1
  63. package/uni-ui/lib/uni-grid/uni-grid.vue +115 -1
  64. package/uni-ui/lib/uni-grid-item/uni-grid-item.vue +78 -1
  65. package/uni-ui/lib/uni-group/uni-group.vue +85 -1
  66. package/uni-ui/lib/uni-icons/uni-icons.vue +85 -1
  67. package/uni-ui/lib/uni-indexed-list/uni-indexed-list-item.vue +68 -1
  68. package/uni-ui/lib/uni-indexed-list/uni-indexed-list.vue +294 -1
  69. package/uni-ui/lib/uni-list/uni-list.vue +81 -1
  70. package/uni-ui/lib/uni-list-ad/uni-list-ad.vue +77 -1
  71. package/uni-ui/lib/uni-list-chat/uni-list-chat.vue +294 -1
  72. package/uni-ui/lib/uni-list-item/uni-list-item.vue +346 -1
  73. package/uni-ui/lib/uni-load-more/uni-load-more.vue +172 -1
  74. package/uni-ui/lib/uni-nav-bar/uni-nav-bar.vue +205 -1
  75. package/uni-ui/lib/uni-nav-bar/uni-status-bar.vue +18 -1
  76. package/uni-ui/lib/uni-notice-bar/uni-notice-bar.vue +331 -1
  77. package/uni-ui/lib/uni-number-box/uni-number-box.vue +166 -1
  78. package/uni-ui/lib/uni-pagination/uni-pagination.vue +323 -1
  79. package/uni-ui/lib/uni-popup/uni-popup.vue +1 -1
  80. package/uni-ui/lib/uni-popup-dialog/uni-popup-dialog.vue +173 -1
  81. package/uni-ui/lib/uni-popup-message/uni-popup-message.vue +74 -1
  82. package/uni-ui/lib/uni-popup-share/uni-popup-share.vue +106 -1
  83. package/uni-ui/lib/uni-rate/uni-rate.vue +322 -1
  84. package/uni-ui/lib/uni-row/uni-row.vue +1 -1
  85. package/uni-ui/lib/uni-search-bar/uni-search-bar.vue +236 -1
  86. package/uni-ui/lib/uni-section/uni-section.vue +109 -1
  87. package/uni-ui/lib/uni-segmented-control/uni-segmented-control.vue +103 -1
  88. package/uni-ui/lib/uni-status-bar/uni-status-bar.vue +1 -1
  89. package/uni-ui/lib/uni-steps/uni-steps.vue +120 -1
  90. package/uni-ui/lib/uni-swipe-action-item/uni-swipe-action-item.vue +226 -3
  91. package/uni-ui/lib/uni-swiper-dot/uni-swiper-dot.vue +167 -1
  92. package/uni-ui/lib/uni-table/uni-table.vue +297 -1
  93. package/uni-ui/lib/uni-tag/uni-tag.vue +100 -1
  94. package/uni-ui/lib/uni-td/uni-td.vue +78 -1
  95. package/uni-ui/lib/uni-th/filter-dropdown.vue +1 -1
  96. package/uni-ui/lib/uni-th/uni-th.vue +224 -1
  97. package/uni-ui/lib/uni-thead/uni-thead.vue +77 -1
  98. package/uni-ui/lib/uni-tr/table-checkbox.vue +79 -1
  99. package/uni-ui/lib/uni-tr/uni-tr.vue +135 -1
  100. package/uni-ui/lib/amap-wx/js/util.js +0 -181
  101. package/uni-ui/lib/marked/index.js +0 -1
  102. package/uni-ui/lib/mpvue-citypicker/city-data/area.js +0 -12542
  103. package/uni-ui/lib/mpvue-citypicker/city-data/city.js +0 -1503
  104. package/uni-ui/lib/mpvue-citypicker/city-data/province.js +0 -139
  105. package/uni-ui/lib/mpvue-picker/mpvuePicker.vue +0 -3
  106. package/uni-ui/lib/mpvueGestureLock/gestureLock.js +0 -175
  107. package/uni-ui/lib/uParse/src/components/style.css +0 -2
  108. package/uni-ui/lib/uParse/src/components/wxParseAudio.vue +0 -1
  109. package/uni-ui/lib/uParse/src/components/wxParseImg.vue +0 -1
  110. package/uni-ui/lib/uParse/src/components/wxParseTable.vue +0 -3
  111. package/uni-ui/lib/uParse/src/components/wxParseTemplate0.vue +0 -1
  112. package/uni-ui/lib/uParse/src/components/wxParseTemplate1.vue +0 -1
  113. package/uni-ui/lib/uParse/src/components/wxParseTemplate10.vue +0 -1
  114. package/uni-ui/lib/uParse/src/components/wxParseTemplate11.vue +0 -1
  115. package/uni-ui/lib/uParse/src/components/wxParseTemplate2.vue +0 -1
  116. package/uni-ui/lib/uParse/src/components/wxParseTemplate3.vue +0 -1
  117. package/uni-ui/lib/uParse/src/components/wxParseTemplate4.vue +0 -1
  118. package/uni-ui/lib/uParse/src/components/wxParseTemplate5.vue +0 -1
  119. package/uni-ui/lib/uParse/src/components/wxParseTemplate6.vue +0 -1
  120. package/uni-ui/lib/uParse/src/components/wxParseTemplate7.vue +0 -1
  121. package/uni-ui/lib/uParse/src/components/wxParseTemplate8.vue +0 -1
  122. package/uni-ui/lib/uParse/src/components/wxParseTemplate9.vue +0 -1
  123. package/uni-ui/lib/uParse/src/components/wxParseVideo.vue +0 -1
  124. package/uni-ui/lib/uParse/src/editor.css +0 -495
  125. package/uni-ui/lib/uParse/src/wxParse.vue +0 -1
  126. /package/{uni-ui/lib → other}/api-set-tabbar.nvue +0 -0
  127. /package/{uni-ui/lib → other}/mpvue-echarts/src/echarts.vue +0 -0
  128. /package/{uni-ui/lib → other}/mpvue-echarts/src/style.css +0 -0
  129. /package/{uni-ui/lib → other}/mpvue-echarts/src/wx-canvas.js +0 -0
  130. /package/{uni-ui/lib → other}/product.vue +0 -0
  131. /package/{uni-ui/lib → other}/style.css +0 -0
  132. /package/{uni-ui/lib → other}/tab-nvue/mediaList.vue +0 -0
  133. /package/{uni-ui/lib → other}/u-charts/u-charts.js +0 -0
  134. /package/{uni-ui/lib/uParse/src → other/uParse}/wxParse.css +0 -0
  135. /package/{uni-ui/lib/amap-wx → plugins/map}/lib/amap-wx.js +0 -0
  136. /package/{uni-ui/lib/mpvue-citypicker → ui-cv/components/cv-geo-region}/mpvueCityPicker.vue +0 -0
  137. /package/{uni-ui/lib/marked → ui-cv/components/cv-markdown-show}/lib/marked.js +0 -0
@@ -0,0 +1,402 @@
1
+ <template>
2
+ <view class="mpvue-picker">
3
+ <view :class="{ pickerMask: showPicker }" @click="maskClick" catchtouchmove="true"></view>
4
+ <view class="mpvue-picker-content" :class="{ 'mpvue-picker-view-show': showPicker }">
5
+ <view class="mpvue-picker__hd" catchtouchmove="true">
6
+ <view class="mpvue-picker__action" @click="pickerCancel">取消</view>
7
+ <view class="mpvue-picker__action" :style="{ color: themeColor }" @click="pickerConfirm">确定</view>
8
+ </view>
9
+ <!-- 单列 -->
10
+ <picker-view
11
+ indicator-style="height: 40px;"
12
+ class="mpvue-picker-view"
13
+ :value="pickerValue"
14
+ @change="pickerChange"
15
+ v-if="mode === 'selector' && pickerValueSingleArray.length > 0"
16
+ >
17
+ <picker-view-column>
18
+ <view class="picker-item" v-for="(item, index) in pickerValueSingleArray" :key="index">{{ item.label }}</view>
19
+ </picker-view-column>
20
+ </picker-view>
21
+ <!-- 时间选择器 -->
22
+ <picker-view
23
+ indicator-style="height: 40px;"
24
+ class="mpvue-picker-view"
25
+ :value="pickerValue"
26
+ @change="pickerChange"
27
+ v-if="mode === 'timeSelector'"
28
+ >
29
+ <picker-view-column>
30
+ <view class="picker-item" v-for="(item, index) in pickerValueHour" :key="index">{{ item.label }}</view>
31
+ </picker-view-column>
32
+ <picker-view-column>
33
+ <view class="picker-item" v-for="(item, index) in pickerValueMinute" :key="index">{{ item.label }}</view>
34
+ </picker-view-column>
35
+ </picker-view>
36
+ <!-- 多列选择 -->
37
+ <picker-view
38
+ indicator-style="height: 40px;"
39
+ class="mpvue-picker-view"
40
+ :value="pickerValue"
41
+ @change="pickerChange"
42
+ v-if="mode === 'multiSelector'"
43
+ >
44
+ <!-- #ifdef VUE3 -->
45
+ <template v-for="(n, index) in pickerValueMulArray.length" :key="index">
46
+ <picker-view-column>
47
+ <view class="picker-item" v-for="(item, index1) in pickerValueMulArray[n]" :key="index1">
48
+ {{ item.label }}
49
+ </view>
50
+ </picker-view-column>
51
+ </template>
52
+ <!-- #endif -->
53
+ <!-- #ifndef VUE3 -->
54
+ <block v-for="(n, index) in pickerValueMulArray.length" :key="index">
55
+ <picker-view-column>
56
+ <view class="picker-item" v-for="(item, index1) in pickerValueMulArray[n]" :key="index1">
57
+ {{ item.label }}
58
+ </view>
59
+ </picker-view-column>
60
+ </block>
61
+ <!-- #endif -->
62
+ </picker-view>
63
+ <!-- 二级联动 -->
64
+ <picker-view
65
+ indicator-style="height: 40px;"
66
+ class="mpvue-picker-view"
67
+ :value="pickerValue"
68
+ @change="pickerChangeMul"
69
+ v-if="mode === 'multiLinkageSelector' && deepLength === 2"
70
+ >
71
+ <picker-view-column>
72
+ <view class="picker-item" v-for="(item, index) in pickerValueMulTwoOne" :key="index">{{ item.label }}</view>
73
+ </picker-view-column>
74
+ <picker-view-column>
75
+ <view class="picker-item" v-for="(item, index) in pickerValueMulTwoTwo" :key="index">{{ item.label }}</view>
76
+ </picker-view-column>
77
+ </picker-view>
78
+ <!-- 三级联动 -->
79
+ <picker-view
80
+ indicator-style="height: 40px;"
81
+ class="mpvue-picker-view"
82
+ :value="pickerValue"
83
+ @change="pickerChangeMul"
84
+ v-if="mode === 'multiLinkageSelector' && deepLength === 3"
85
+ >
86
+ <picker-view-column>
87
+ <view class="picker-item" v-for="(item, index) in pickerValueMulThreeOne" :key="index">{{ item.label }}</view>
88
+ </picker-view-column>
89
+ <picker-view-column>
90
+ <view class="picker-item" v-for="(item, index) in pickerValueMulThreeTwo" :key="index">{{ item.label }}</view>
91
+ </picker-view-column>
92
+ <picker-view-column>
93
+ <view class="picker-item" v-for="(item, index) in pickerValueMulThreeThree" :key="index">
94
+ {{ item.label }}
95
+ </view>
96
+ </picker-view-column>
97
+ </picker-view>
98
+ </view>
99
+ </view>
100
+ </template>
101
+ <script>
102
+ export default {
103
+ data() {
104
+ return {
105
+ pickerChangeValue: [],
106
+ pickerValue: [],
107
+ pickerValueArrayChange: true,
108
+ modeChange: false,
109
+ pickerValueSingleArray: [],
110
+ pickerValueHour: [],
111
+ pickerValueMinute: [],
112
+ pickerValueMulArray: [],
113
+ pickerValueMulTwoOne: [],
114
+ pickerValueMulTwoTwo: [],
115
+ pickerValueMulThreeOne: [],
116
+ pickerValueMulThreeTwo: [],
117
+ pickerValueMulThreeThree: [],
118
+ /* 是否显示控件 */
119
+ showPicker: false
120
+ };
121
+ },
122
+ props: {
123
+ /* mode */
124
+ mode: {
125
+ type: String,
126
+ default: 'selector'
127
+ },
128
+ /* picker 数值 */
129
+ pickerValueArray: {
130
+ type: Array,
131
+ default() {
132
+ return [];
133
+ }
134
+ },
135
+ /* 默认值 */
136
+ pickerValueDefault: {
137
+ type: Array,
138
+ default() {
139
+ return [];
140
+ }
141
+ },
142
+ /* 几级联动 */
143
+ deepLength: {
144
+ type: Number,
145
+ default: 2
146
+ },
147
+ /* 主题色 */
148
+ themeColor: String
149
+ },
150
+ watch: {
151
+ pickerValueArray(oldVal, newVal) {
152
+ this.pickerValueArrayChange = true;
153
+ },
154
+ mode(oldVal, newVal) {
155
+ this.modeChange = true;
156
+ },
157
+ pickerValueArray(val) {
158
+ this.initPicker(val);
159
+ }
160
+ },
161
+ methods: {
162
+ initPicker(valueArray) {
163
+ let pickerValueArray = valueArray;
164
+ this.pickerValue = this.pickerValueDefault;
165
+ // 初始化多级联动
166
+ if (this.mode === 'selector') {
167
+ this.pickerValueSingleArray = valueArray;
168
+ } else if (this.mode === 'timeSelector') {
169
+ this.modeChange = false;
170
+ let hourArray = [];
171
+ let minuteArray = [];
172
+ for (let i = 0; i < 24; i++) {
173
+ hourArray.push({
174
+ value: i,
175
+ label: i > 9 ? `${i} 时` : `0${i} 时`
176
+ });
177
+ }
178
+ for (let i = 0; i < 60; i++) {
179
+ minuteArray.push({
180
+ value: i,
181
+ label: i > 9 ? `${i} 分` : `0${i} 分`
182
+ });
183
+ }
184
+ this.pickerValueHour = hourArray;
185
+ this.pickerValueMinute = minuteArray;
186
+ } else if (this.mode === 'multiSelector') {
187
+ this.pickerValueMulArray = valueArray;
188
+ } else if (this.mode === 'multiLinkageSelector' && this.deepLength === 2) {
189
+ // 两级联动
190
+ let pickerValueMulTwoOne = [];
191
+ let pickerValueMulTwoTwo = [];
192
+ // 第一列
193
+ for (let i = 0, length = pickerValueArray.length; i < length; i++) {
194
+ pickerValueMulTwoOne.push(pickerValueArray[i]);
195
+ }
196
+ // 渲染第二列
197
+ // 如果有设定的默认值
198
+ if (this.pickerValueDefault.length === 2) {
199
+ let num = this.pickerValueDefault[0];
200
+ for (let i = 0, length = pickerValueArray[num].children.length; i < length; i++) {
201
+ pickerValueMulTwoTwo.push(pickerValueArray[num].children[i]);
202
+ }
203
+ } else {
204
+ for (let i = 0, length = pickerValueArray[0].children.length; i < length; i++) {
205
+ pickerValueMulTwoTwo.push(pickerValueArray[0].children[i]);
206
+ }
207
+ }
208
+ this.pickerValueMulTwoOne = pickerValueMulTwoOne;
209
+ this.pickerValueMulTwoTwo = pickerValueMulTwoTwo;
210
+ } else if (this.mode === 'multiLinkageSelector' && this.deepLength === 3) {
211
+ let pickerValueMulThreeOne = [];
212
+ let pickerValueMulThreeTwo = [];
213
+ let pickerValueMulThreeThree = [];
214
+ // 第一列
215
+ for (let i = 0, length = pickerValueArray.length; i < length; i++) {
216
+ pickerValueMulThreeOne.push(pickerValueArray[i]);
217
+ }
218
+ // 渲染第二列
219
+ this.pickerValueDefault = this.pickerValueDefault.length === 3 ? this.pickerValueDefault : [0, 0, 0];
220
+ if (this.pickerValueDefault.length === 3) {
221
+ let num = this.pickerValueDefault[0];
222
+ for (let i = 0, length = pickerValueArray[num].children.length; i < length; i++) {
223
+ pickerValueMulThreeTwo.push(pickerValueArray[num].children[i]);
224
+ }
225
+ // 第三列
226
+ let numSecond = this.pickerValueDefault[1];
227
+ for (let i = 0, length = pickerValueArray[num].children[numSecond].children.length; i < length; i++) {
228
+ pickerValueMulThreeThree.push(pickerValueArray[num].children[numSecond].children[i]);
229
+ }
230
+ }
231
+ this.pickerValueMulThreeOne = pickerValueMulThreeOne;
232
+ this.pickerValueMulThreeTwo = pickerValueMulThreeTwo;
233
+ this.pickerValueMulThreeThree = pickerValueMulThreeThree;
234
+ }
235
+ },
236
+ show() {
237
+ setTimeout(() => {
238
+ if (this.pickerValueArrayChange || this.modeChange) {
239
+ this.initPicker(this.pickerValueArray);
240
+ this.showPicker = true;
241
+ this.pickerValueArrayChange = false;
242
+ this.modeChange = false;
243
+ } else {
244
+ this.showPicker = true;
245
+ }
246
+ }, 0);
247
+ },
248
+ maskClick() {
249
+ this.pickerCancel();
250
+ },
251
+ pickerCancel() {
252
+ this.showPicker = false;
253
+ this._initPickerVale();
254
+ let pickObj = {
255
+ index: this.pickerValue,
256
+ value: this._getPickerLabelAndValue(this.pickerValue, this.mode).value,
257
+ label: this._getPickerLabelAndValue(this.pickerValue, this.mode).label
258
+ };
259
+ this.$emit('onCancel', pickObj);
260
+ },
261
+ pickerConfirm(e) {
262
+ this.showPicker = false;
263
+ this._initPickerVale();
264
+ let pickObj = {
265
+ index: this.pickerValue,
266
+ value: this._getPickerLabelAndValue(this.pickerValue, this.mode).value,
267
+ label: this._getPickerLabelAndValue(this.pickerValue, this.mode).label
268
+ };
269
+ this.$emit('onConfirm', pickObj);
270
+ },
271
+ showPickerView() {
272
+ this.showPicker = true;
273
+ },
274
+ pickerChange(e) {
275
+ this.pickerValue = e.mp.detail.value;
276
+ let pickObj = {
277
+ index: this.pickerValue,
278
+ value: this._getPickerLabelAndValue(this.pickerValue, this.mode).value,
279
+ label: this._getPickerLabelAndValue(this.pickerValue, this.mode).label
280
+ };
281
+ this.$emit('onChange', pickObj);
282
+ },
283
+ pickerChangeMul(e) {
284
+ if (this.deepLength === 2) {
285
+ let pickerValueArray = this.pickerValueArray;
286
+ let changeValue = e.mp.detail.value;
287
+ // 处理第一列滚动
288
+ if (changeValue[0] !== this.pickerValue[0]) {
289
+ let pickerValueMulTwoTwo = [];
290
+ // 第一列滚动第二列数据更新
291
+ for (let i = 0, length = pickerValueArray[changeValue[0]].children.length; i < length; i++) {
292
+ pickerValueMulTwoTwo.push(pickerValueArray[changeValue[0]].children[i]);
293
+ }
294
+ this.pickerValueMulTwoTwo = pickerValueMulTwoTwo;
295
+ // 第二列初始化为 0
296
+ changeValue[1] = 0;
297
+ }
298
+ this.pickerValue = changeValue;
299
+ } else if (this.deepLength === 3) {
300
+ let pickerValueArray = this.pickerValueArray;
301
+ let changeValue = e.mp.detail.value;
302
+ let pickerValueMulThreeTwo = [];
303
+ let pickerValueMulThreeThree = [];
304
+ // 重新渲染第二列
305
+ // 如果是第一列滚动
306
+ if (changeValue[0] !== this.pickerValue[0]) {
307
+ this.pickerValueMulThreeTwo = [];
308
+ for (let i = 0, length = pickerValueArray[changeValue[0]].children.length; i < length; i++) {
309
+ pickerValueMulThreeTwo.push(pickerValueArray[changeValue[0]].children[i]);
310
+ }
311
+ // 重新渲染第三列
312
+ for (let i = 0, length = pickerValueArray[changeValue[0]].children[0].children.length; i < length; i++) {
313
+ pickerValueMulThreeThree.push(pickerValueArray[changeValue[0]].children[0].children[i]);
314
+ }
315
+ changeValue[1] = 0;
316
+ changeValue[2] = 0;
317
+ this.pickerValueMulThreeTwo = pickerValueMulThreeTwo;
318
+ this.pickerValueMulThreeThree = pickerValueMulThreeThree;
319
+ } else if (changeValue[1] !== this.pickerValue[1]) {
320
+ // 第二列滚动
321
+ // 重新渲染第三列
322
+ this.pickerValueMulThreeThree = [];
323
+ pickerValueMulThreeTwo = this.pickerValueMulThreeTwo;
324
+ for (let i = 0, length = pickerValueArray[changeValue[0]].children[changeValue[1]].children.length; i < length; i++) {
325
+ pickerValueMulThreeThree.push(pickerValueArray[changeValue[0]].children[changeValue[1]].children[i]);
326
+ }
327
+ changeValue[2] = 0;
328
+ this.pickerValueMulThreeThree = pickerValueMulThreeThree;
329
+ }
330
+ this.pickerValue = changeValue;
331
+ }
332
+ let pickObj = {
333
+ index: this.pickerValue,
334
+ value: this._getPickerLabelAndValue(this.pickerValue, this.mode).value,
335
+ label: this._getPickerLabelAndValue(this.pickerValue, this.mode).label
336
+ };
337
+ this.$emit('onChange', pickObj);
338
+ },
339
+ // 获取 pxikerLabel
340
+ _getPickerLabelAndValue(value, mode) {
341
+ let pickerLable;
342
+ let pickerGetValue = [];
343
+ // selector
344
+ if (mode === 'selector') {
345
+ pickerLable = this.pickerValueSingleArray[value].label;
346
+ pickerGetValue.push(this.pickerValueSingleArray[value].value);
347
+ } else if (mode === 'timeSelector') {
348
+ pickerLable = `${this.pickerValueHour[value[0]].label}-${this.pickerValueMinute[value[1]].label}`;
349
+ pickerGetValue.push(this.pickerValueHour[value[0]].value);
350
+ pickerGetValue.push(this.pickerValueHour[value[1]].value);
351
+ } else if (mode === 'multiSelector') {
352
+ for (let i = 0; i < value.length; i++) {
353
+ if (i > 0) {
354
+ pickerLable += this.pickerValueMulArray[i][value[i]].label + (i === value.length - 1 ? '' : '-');
355
+ } else {
356
+ pickerLable = this.pickerValueMulArray[i][value[i]].label + '-';
357
+ }
358
+ pickerGetValue.push(this.pickerValueMulArray[i][value[i]].value);
359
+ }
360
+ } else if (mode === 'multiLinkageSelector') {
361
+ /* eslint-disable indent */
362
+ pickerLable =
363
+ this.deepLength === 2
364
+ ? `${this.pickerValueMulTwoOne[value[0]].label}-${this.pickerValueMulTwoTwo[value[1]].label}`
365
+ : `${this.pickerValueMulThreeOne[value[0]].label}-${this.pickerValueMulThreeTwo[value[1]].label}-${
366
+ this.pickerValueMulThreeThree[value[2]].label
367
+ }`;
368
+ if (this.deepLength === 2) {
369
+ pickerGetValue.push(this.pickerValueMulTwoOne[value[0]].value);
370
+ pickerGetValue.push(this.pickerValueMulTwoTwo[value[1]].value);
371
+ } else {
372
+ pickerGetValue.push(this.pickerValueMulThreeOne[value[0]].value);
373
+ pickerGetValue.push(this.pickerValueMulThreeTwo[value[1]].value);
374
+ pickerGetValue.push(this.pickerValueMulThreeThree[value[2]].value);
375
+ }
376
+ /* eslint-enable indent */
377
+ }
378
+ return {
379
+ label: pickerLable,
380
+ value: pickerGetValue
381
+ };
382
+ },
383
+ // 初始化 pickerValue 默认值
384
+ _initPickerVale() {
385
+ if (this.pickerValue.length === 0) {
386
+ if (this.mode === 'selector') {
387
+ this.pickerValue = [0];
388
+ } else if (this.mode === 'multiSelector') {
389
+ this.pickerValue = new Int8Array(this.pickerValueArray.length);
390
+ } else if (this.mode === 'multiLinkageSelector' && this.deepLength === 2) {
391
+ this.pickerValue = [0, 0];
392
+ } else if (this.mode === 'multiLinkageSelector' && this.deepLength === 3) {
393
+ this.pickerValue = [0, 0, 0];
394
+ }
395
+ }
396
+ }
397
+ }
398
+ };
399
+ </script>
400
+ <style>
401
+ @import './style.css';
402
+ </style>
@@ -1,4 +1,3 @@
1
-
2
1
  .pickerMask {
3
2
  position: fixed;
4
3
  z-index: 1000;
@@ -1,4 +1,3 @@
1
-
2
1
  .view {
3
2
  display: flex;
4
3
  flex-direction: column;
@@ -0,0 +1 @@
1
+ @import url('../wxParse.css');
@@ -0,0 +1 @@
1
+ <template>
2
  <cv-base-audio
1
3
  :id="node.attr.id"
2
4
  :class="node.classStr"
3
5
  :style="node.styleStr"
4
6
  :src="node.attr.src"
5
7
  :loop="node.attr.loop"
6
8
  :poster="node.attr.poster"
7
9
  :name="node.attr.name"
8
10
  :author="node.attr.author"
9
11
  controls
10
12
  />
11
13
  name: 'wxParseAudio',
12
14
  props: {
13
15
  node: {
14
16
  type: Object,
15
17
  default() {
16
18
  return {};
17
19
  }
18
20
  }
19
21
  }
@@ -0,0 +1,86 @@
1
+ <template>
2
+ <image
3
+ :mode="node.attr.mode"
4
+ :lazy-load="node.attr.lazyLoad"
5
+ :class="node.classStr"
6
+ :style="newStyleStr || node.styleStr"
7
+ :data-src="node.attr.src"
8
+ :src="node.attr.src"
9
+ @tap="wxParseImgTap"
10
+ @load="wxParseImgLoad"
11
+ />
12
+ </template>
13
+ <script>
14
+ export default {
15
+ name: 'wxParseImg',
16
+ data() {
17
+ return {
18
+ newStyleStr: '',
19
+ preview: true
20
+ };
21
+ },
22
+ inject: ['parseWidth'],
23
+ mounted() {},
24
+ props: {
25
+ node: {
26
+ type: Object,
27
+ default() {
28
+ return {};
29
+ }
30
+ }
31
+ },
32
+ methods: {
33
+ wxParseImgTap(e) {
34
+ if (!this.preview) return;
35
+ const { src } = e.currentTarget.dataset;
36
+ if (!src) return;
37
+ let parent = this.$parent;
38
+ while (!parent.preview || typeof parent.preview !== 'function') {
39
+ // TODO 遍历获取父节点执行方法
40
+ parent = parent.$parent;
41
+ }
42
+ parent.preview(src, e);
43
+ },
44
+ // 图片视觉宽高计算函数区
45
+ wxParseImgLoad(e) {
46
+ const { src } = e.currentTarget.dataset;
47
+ if (!src) return;
48
+ let { width, height } = e.mp.detail;
49
+ const recal = this.wxAutoImageCal(width, height);
50
+ const { imageheight, imageWidth } = recal;
51
+ const { padding, mode } = this.node.attr; //删除padding
52
+ // const { mode } = this.node.attr;
53
+ const { styleStr } = this.node;
54
+ const imageHeightStyle = mode === 'widthFix' ? '' : `height: ${imageheight}px;`;
55
+ this.newStyleStr = `${styleStr}; ${imageHeightStyle}; width: ${imageWidth}px; padding: 0 ${+padding}px;`; //删除padding
56
+ // this.newStyleStr = `${styleStr}; ${imageHeightStyle}; width: ${imageWidth}px;`;
57
+ },
58
+ // 计算视觉优先的图片宽高
59
+ wxAutoImageCal(originalWidth, originalHeight) {
60
+ // 获取图片的原始长宽
61
+ const windowWidth = this.parseWidth.value;
62
+ const results = {};
63
+ if (originalWidth < 60 || originalHeight < 60) {
64
+ const { src } = this.node.attr;
65
+ let parent = this.$parent;
66
+ while (!parent.preview || typeof parent.preview !== 'function') {
67
+ parent = parent.$parent;
68
+ }
69
+ parent.removeImageUrl(src);
70
+ this.preview = false;
71
+ }
72
+ // 判断按照那种方式进行缩放
73
+ if (originalWidth > windowWidth) {
74
+ // 在图片width大于手机屏幕width时候
75
+ results.imageWidth = windowWidth;
76
+ results.imageheight = windowWidth * (originalHeight / originalWidth);
77
+ } else {
78
+ // 否则展示原来的数据
79
+ results.imageWidth = originalWidth;
80
+ results.imageheight = originalHeight;
81
+ }
82
+ return results;
83
+ }
84
+ }
85
+ };
86
+ </script>
@@ -0,0 +1,54 @@
1
+ <template>
2
+ <div class="tablebox">
3
+ <rich-text :nodes="nodes" :class="node.classStr" :style="'user-select:' + parseSelect"></rich-text>
4
+ </div>
5
+ </template>
6
+ <script>
7
+ export default {
8
+ name: 'wxParseTable',
9
+ props: {
10
+ node: {
11
+ type: Object,
12
+ default() {
13
+ return {};
14
+ }
15
+ }
16
+ },
17
+ inject: ['parseSelect'],
18
+ data() {
19
+ return {
20
+ nodes: []
21
+ };
22
+ },
23
+ mounted() {
24
+ this.nodes = this.loadNode([this.node]);
25
+ },
26
+ methods: {
27
+ loadNode(node) {
28
+ let obj = [];
29
+ for (let children of node) {
30
+ if (children.node == 'element') {
31
+ let t = {
32
+ name: children.tag,
33
+ attrs: {
34
+ class: children.classStr
35
+ // style: children.styleStr,
36
+ },
37
+ children: children.nodes ? this.loadNode(children.nodes) : []
38
+ };
39
+ obj.push(t);
40
+ } else if (children.node == 'text') {
41
+ obj.push({
42
+ type: 'text',
43
+ text: children.text
44
+ });
45
+ }
46
+ }
47
+ return obj;
48
+ }
49
+ }
50
+ };
51
+ </script>
52
+ <style>
53
+ @import './style.css';
54
+ </style>
@@ -0,0 +1,98 @@
1
+ <template>
2
+ <!--判断是否是标签节点-->
3
+ <block v-if="node.node == 'element'">
4
+ <!--button类型-->
5
+ <button v-if="node.tag == 'button'" type="default" size="mini" :class="node.classStr" :style="node.styleStr">
6
+ <wx-parse-template :node="node" />
7
+ </button>
8
+ <!--a类型-->
9
+ <view
10
+ v-else-if="node.tag == 'a'"
11
+ @click="wxParseATap(node.attr, $event)"
12
+ :class="node.classStr"
13
+ :data-href="node.attr.href"
14
+ :style="node.styleStr"
15
+ >
16
+ <block v-for="(node, index) of node.nodes" :key="index">
17
+ <wx-parse-template :node="node" />
18
+ </block>
19
+ </view>
20
+ <!--li类型-->
21
+ <view v-else-if="node.tag == 'li'" :class="node.classStr" :style="node.styleStr">
22
+ <block v-for="(node, index) of node.nodes" :key="index">
23
+ <wx-parse-template :node="node" />
24
+ </block>
25
+ </view>
26
+ <!--table类型-->
27
+ <wx-parse-table v-else-if="node.tag == 'table'" :class="node.classStr" :style="node.styleStr" :node="node" />
28
+ <!--br类型-->
29
+ <!-- #ifndef H5 -->
30
+ <text v-else-if="node.tag == 'br'">\n</text>
31
+ <!-- #endif -->
32
+ <!-- #ifdef H5 -->
33
+ <br v-else-if="node.tag == 'br'" />
34
+ <!-- #endif -->
35
+ <!--video类型-->
36
+ <wx-parse-video :node="node" v-else-if="node.tag == 'video'" />
37
+ <!--audio类型-->
38
+ <wx-parse-audio :node="node" v-else-if="node.tag == 'audio'" />
39
+ <!--img类型-->
40
+ <wx-parse-img :node="node" v-else-if="node.tag == 'img'" :style="node.styleStr" />
41
+ <!--其他标签-->
42
+ <view v-else :class="node.classStr" :style="node.styleStr">
43
+ <block v-for="(node, index) of node.nodes" :key="index">
44
+ <wx-parse-template :node="node" />
45
+ </block>
46
+ </view>
47
+ </block>
48
+ <!--判断是否是文本节点-->
49
+ <block v-else-if="node.node == 'text'">
50
+ <text decode="true">{{ textHandle(node.text) }}</text>
51
+ </block>
52
+ <!-- <block v-else-if="node.node == 'text'">{{node.text}}</block> -->
53
+ </template>
54
+ <script>
55
+ // #ifdef APP-PLUS | H5
56
+ import wxParseTemplate from './wxParseTemplate0';
57
+ // #endif
58
+ // #ifdef MP
59
+ import wxParseTemplate from './wxParseTemplate1';
60
+ // #endif
61
+ import wxParseImg from './wxParseImg';
62
+ import wxParseVideo from './wxParseVideo';
63
+ import wxParseAudio from './wxParseAudio';
64
+ import wxParseTable from './wxParseTable';
65
+ export default {
66
+ // #ifdef APP-PLUS | H5
67
+ name: 'wxParseTemplate',
68
+ // #endif
69
+ // #ifdef MP
70
+ name: 'wxParseTemplate0',
71
+ // #endif
72
+ props: {
73
+ node: {}
74
+ },
75
+ components: {
76
+ wxParseTemplate,
77
+ wxParseImg,
78
+ wxParseVideo,
79
+ wxParseAudio,
80
+ wxParseTable
81
+ },
82
+ methods: {
83
+ wxParseATap(attr, e) {
84
+ const { href } = e.currentTarget.dataset; // TODO currentTarget才有dataset
85
+ if (!href) return;
86
+ let parent = this.$parent;
87
+ while (!parent.preview || typeof parent.preview !== 'function') {
88
+ // TODO 遍历获取父节点执行方法
89
+ parent = parent.$parent;
90
+ }
91
+ parent.navigate(href, e, attr);
92
+ },
93
+ textHandle: function (text) {
94
+ return text ? text.replace(/\n/g, '\n') : '';
95
+ }
96
+ }
97
+ };
98
+ </script>