@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
@@ -1 +1,103 @@
1
- <template>
2
1
  <view
3
2
  :class="[styleType === 'text' ? 'segmented-control--text' : 'segmented-control--button']"
4
3
  :style="{ borderColor: styleType === 'text' ? '' : activeColor }"
5
4
  class="segmented-control"
6
5
  >
7
6
  <view
8
7
  v-for="(item, index) in values"
9
8
  :class="[
10
9
  styleType === 'text' ? '' : 'segmented-control__item--button',
11
10
  index === currentIndex && styleType === 'button' ? 'segmented-control__item--button--active' : '',
12
11
  index === 0 && styleType === 'button' ? 'segmented-control__item--button--first' : '',
13
12
  index === values.length - 1 && styleType === 'button' ? 'segmented-control__item--button--last' : ''
14
13
  ]"
15
14
  :key="index"
16
15
  :style="{
17
16
  backgroundColor: index === currentIndex && styleType === 'button' ? activeColor : '',
18
17
  borderColor: index === currentIndex && (styleType === 'text' || styleType === 'button') ? activeColor : '#d9d9d9'
19
18
  }"
20
19
  class="segmented-control__item"
21
20
  @click="_onClick(index)"
22
21
  >
23
22
  <view>
24
23
  <text
25
24
  :style="{
26
25
  color:
27
26
  index === currentIndex ? (styleType === 'text' ? activeColor : '#fff') : styleType === 'text' ? '#000' : activeColor
28
27
  }"
29
28
  class="segmented-control__text"
30
29
  :class="styleType === 'text' && index === currentIndex ? 'segmented-control__item--text' : ''"
31
30
  >
32
31
  {{ item }}
33
32
  </text>
34
33
  </view>
35
34
  </view>
36
35
  </view>
37
36
  * SegmentedControl 分段器
38
37
  * @description 用作不同视图的显示
39
38
  * @tutorial https://ext.dcloud.net.cn/plugin?id=54
40
39
  * @property {Number} current 当前选中的tab索引值,从0计数
41
40
  * @property {String} styleType = [button|text] 分段器样式类型
42
41
  * @value button 按钮类型
43
42
  * @value text 文字类型
44
43
  * @property {String} activeColor 选中的标签背景色与边框颜色
45
44
  * @property {Array} values 选项数组
46
45
  * @event {Function} clickItem 组件触发点击事件时触发,e={currentIndex}
47
46
  */
48
47
  name: 'UniSegmentedControl',
49
48
  emits: ['clickItem'],
50
49
  props: {
51
50
  current: {
52
51
  type: Number,
53
52
  default: 0
54
53
  },
55
54
  values: {
56
55
  type: Array,
57
56
  default() {
58
57
  return [];
59
58
  }
60
59
  },
61
60
  activeColor: {
62
61
  type: String,
63
62
  default: '#2979FF'
64
63
  },
65
64
  styleType: {
66
65
  type: String,
67
66
  default: 'button'
68
67
  }
69
68
  },
70
69
  data() {
71
70
  return {
72
71
  currentIndex: 0
73
72
  };
74
73
  },
75
74
  watch: {
76
75
  current(val) {
77
76
  if (val !== this.currentIndex) {
78
77
  this.currentIndex = val;
79
78
  }
80
79
  }
81
80
  },
82
81
  created() {
83
82
  this.currentIndex = this.current;
84
83
  },
85
84
  methods: {
86
85
  _onClick(index) {
87
86
  if (this.currentIndex !== index) {
88
87
  this.currentIndex = index;
89
88
  this.$emit('clickItem', {
90
89
  currentIndex: index
91
90
  });
92
91
  }
93
92
  }
94
93
  }
94
+ <template>
95
+ <view
96
+ :class="[styleType === 'text' ? 'segmented-control--text' : 'segmented-control--button']"
97
+ :style="{ borderColor: styleType === 'text' ? '' : activeColor }"
98
+ class="segmented-control"
99
+ >
100
+ <view
101
+ v-for="(item, index) in values"
102
+ :class="[
103
+ styleType === 'text' ? '' : 'segmented-control__item--button',
104
+ index === currentIndex && styleType === 'button' ? 'segmented-control__item--button--active' : '',
105
+ index === 0 && styleType === 'button' ? 'segmented-control__item--button--first' : '',
106
+ index === values.length - 1 && styleType === 'button' ? 'segmented-control__item--button--last' : ''
107
+ ]"
108
+ :key="index"
109
+ :style="{
110
+ backgroundColor: index === currentIndex && styleType === 'button' ? activeColor : '',
111
+ borderColor: index === currentIndex && (styleType === 'text' || styleType === 'button') ? activeColor : '#d9d9d9'
112
+ }"
113
+ class="segmented-control__item"
114
+ @click="_onClick(index)"
115
+ >
116
+ <view>
117
+ <text
118
+ :style="{
119
+ color:
120
+ index === currentIndex ? (styleType === 'text' ? activeColor : '#fff') : styleType === 'text' ? '#000' : activeColor
121
+ }"
122
+ class="segmented-control__text"
123
+ :class="styleType === 'text' && index === currentIndex ? 'segmented-control__item--text' : ''"
124
+ >
125
+ {{ item }}
126
+ </text>
127
+ </view>
128
+ </view>
129
+ </view>
130
+ </template>
131
+ <script>
132
+ /**
133
+ * SegmentedControl 分段器
134
+ * @description 用作不同视图的显示
135
+ * @tutorial https://ext.dcloud.net.cn/plugin?id=54
136
+ * @property {Number} current 当前选中的tab索引值,从0计数
137
+ * @property {String} styleType = [button|text] 分段器样式类型
138
+ * @value button 按钮类型
139
+ * @value text 文字类型
140
+ * @property {String} activeColor 选中的标签背景色与边框颜色
141
+ * @property {Array} values 选项数组
142
+ * @event {Function} clickItem 组件触发点击事件时触发,e={currentIndex}
143
+ */
144
+ export default {
145
+ name: 'UniSegmentedControl',
146
+ emits: ['clickItem'],
147
+ props: {
148
+ current: {
149
+ type: Number,
150
+ default: 0
151
+ },
152
+ values: {
153
+ type: Array,
154
+ default() {
155
+ return [];
156
+ }
157
+ },
158
+ activeColor: {
159
+ type: String,
160
+ default: '#2979FF'
161
+ },
162
+ styleType: {
163
+ type: String,
164
+ default: 'button'
165
+ }
166
+ },
167
+ data() {
168
+ return {
169
+ currentIndex: 0
170
+ };
171
+ },
172
+ watch: {
173
+ current(val) {
174
+ if (val !== this.currentIndex) {
175
+ this.currentIndex = val;
176
+ }
177
+ }
178
+ },
179
+ created() {
180
+ this.currentIndex = this.current;
181
+ },
182
+ methods: {
183
+ _onClick(index) {
184
+ if (this.currentIndex !== index) {
185
+ this.currentIndex = index;
186
+ this.$emit('clickItem', {
187
+ currentIndex: index
188
+ });
189
+ }
190
+ }
191
+ }
192
+ };
193
+ </script>
194
+ <style>
195
+ @import 'style.css';
196
+ </style>
@@ -15,5 +15,5 @@ export default {
15
15
  };
16
16
  </script>
17
17
  <style scoped>
18
- @import './style.css';
18
+ @import 'style.css';
19
19
  </style>
@@ -1 +1,120 @@
1
- <template>
2
1
  <view class="uni-steps">
3
2
  <view :class="[direction === 'column' ? 'uni-steps__column' : 'uni-steps__row']">
4
3
  <view :class="[direction === 'column' ? 'uni-steps__column-text-container' : 'uni-steps__row-text-container']">
5
4
  <view
6
5
  v-for="(item, index) in options"
7
6
  :key="index"
8
7
  :class="[direction === 'column' ? 'uni-steps__column-text' : 'uni-steps__row-text']"
9
8
  >
10
9
  <text
11
10
  :style="{ color: index === active ? activeColor : deactiveColor }"
12
11
  :class="[direction === 'column' ? 'uni-steps__column-title' : 'uni-steps__row-title']"
13
12
  >
14
13
  {{ item.title }}
15
14
  </text>
16
15
  <text
17
16
  :style="{ color: deactiveColor }"
18
17
  :class="[direction === 'column' ? 'uni-steps__column-desc' : 'uni-steps__row-desc']"
19
18
  >
20
19
  {{ item.desc }}
21
20
  </text>
22
21
  </view>
23
22
  </view>
24
23
  <view :class="[direction === 'column' ? 'uni-steps__column-container' : 'uni-steps__row-container']">
25
24
  <view
26
25
  :class="[direction === 'column' ? 'uni-steps__column-line-item' : 'uni-steps__row-line-item']"
27
26
  v-for="(item, index) in options"
28
27
  :key="index"
29
28
  >
30
29
  <view
31
30
  :class="[
32
31
  direction === 'column' ? 'uni-steps__column-line' : 'uni-steps__row-line',
33
32
  direction === 'column' ? 'uni-steps__column-line--before' : 'uni-steps__row-line--before'
34
33
  ]"
35
34
  :style="{
36
35
  backgroundColor: index <= active && index !== 0 ? activeColor : index === 0 ? 'transparent' : deactiveColor
37
36
  }"
38
37
  ></view>
39
38
  <view :class="[direction === 'column' ? 'uni-steps__column-check' : 'uni-steps__row-check']" v-if="index === active">
40
39
  <uni-icons :color="activeColor" :type="activeIcon" size="14"></uni-icons>
41
40
  </view>
42
41
  <view
43
42
  v-else
44
43
  :class="[direction === 'column' ? 'uni-steps__column-circle' : 'uni-steps__row-circle']"
45
44
  :style="{ backgroundColor: index < active ? activeColor : deactiveColor }"
46
45
  ></view>
47
46
  <view
48
47
  :class="[
49
48
  direction === 'column' ? 'uni-steps__column-line' : 'uni-steps__row-line',
50
49
  direction === 'column' ? 'uni-steps__column-line--after' : 'uni-steps__row-line--after'
51
50
  ]"
52
51
  :style="{
53
52
  backgroundColor:
54
53
  index < active && index !== options.length - 1
55
54
  ? activeColor
56
55
  : index === options.length - 1
57
56
  ? 'transparent'
58
57
  : deactiveColor
59
58
  }"
60
59
  ></view>
61
60
  </view>
62
61
  </view>
63
62
  </view>
64
63
  </view>
65
64
  * Steps 步骤条
66
65
  * @description 评分组件
67
66
  * @tutorial https://ext.dcloud.net.cn/plugin?id=34
68
67
  * @property {Number} active 当前步骤
69
68
  * @property {String} direction = [row|column] 当前步骤
70
69
  * @value row 横向
71
70
  * @value column 纵向
72
71
  * @property {String} activeColor 选中状态的颜色
73
72
  * @property {Array} options 数据源,格式为:[{title:'xxx',desc:'xxx'},{title:'xxx',desc:'xxx'}]
74
73
  */
75
74
  name: 'UniSteps',
76
75
  props: {
77
76
  direction: {
78
77
  // 排列方向 row column
79
78
  type: String,
80
79
  default: 'row'
81
80
  },
82
81
  activeColor: {
83
82
  // 激活状态颜色
84
83
  type: String,
85
84
  default: '#2979FF'
86
85
  },
87
86
  deactiveColor: {
88
87
  // 未激活状态颜色
89
88
  type: String,
90
89
  default: '#B7BDC6'
91
90
  },
92
91
  active: {
93
92
  // 当前步骤
94
93
  type: Number,
95
94
  default: 0
96
95
  },
97
96
  activeIcon: {
98
97
  // 当前步骤
99
98
  type: String,
100
99
  default: 'checkbox-filled'
101
100
  },
102
101
  options: {
103
102
  type: Array,
104
103
  default() {
105
104
  return [];
106
105
  }
107
106
  } // 数据
108
107
  },
109
108
  data() {
110
109
  return {};
111
110
  }
111
+ <template>
112
+ <view class="uni-steps">
113
+ <view :class="[direction === 'column' ? 'uni-steps__column' : 'uni-steps__row']">
114
+ <view :class="[direction === 'column' ? 'uni-steps__column-text-container' : 'uni-steps__row-text-container']">
115
+ <view
116
+ v-for="(item, index) in options"
117
+ :key="index"
118
+ :class="[direction === 'column' ? 'uni-steps__column-text' : 'uni-steps__row-text']"
119
+ >
120
+ <text
121
+ :style="{ color: index === active ? activeColor : deactiveColor }"
122
+ :class="[direction === 'column' ? 'uni-steps__column-title' : 'uni-steps__row-title']"
123
+ >
124
+ {{ item.title }}
125
+ </text>
126
+ <text
127
+ :style="{ color: deactiveColor }"
128
+ :class="[direction === 'column' ? 'uni-steps__column-desc' : 'uni-steps__row-desc']"
129
+ >
130
+ {{ item.desc }}
131
+ </text>
132
+ </view>
133
+ </view>
134
+ <view :class="[direction === 'column' ? 'uni-steps__column-container' : 'uni-steps__row-container']">
135
+ <view
136
+ :class="[direction === 'column' ? 'uni-steps__column-line-item' : 'uni-steps__row-line-item']"
137
+ v-for="(item, index) in options"
138
+ :key="index"
139
+ >
140
+ <view
141
+ :class="[
142
+ direction === 'column' ? 'uni-steps__column-line' : 'uni-steps__row-line',
143
+ direction === 'column' ? 'uni-steps__column-line--before' : 'uni-steps__row-line--before'
144
+ ]"
145
+ :style="{
146
+ backgroundColor: index <= active && index !== 0 ? activeColor : index === 0 ? 'transparent' : deactiveColor
147
+ }"
148
+ ></view>
149
+ <view :class="[direction === 'column' ? 'uni-steps__column-check' : 'uni-steps__row-check']" v-if="index === active">
150
+ <uni-icons :color="activeColor" :type="activeIcon" size="14"></uni-icons>
151
+ </view>
152
+ <view
153
+ v-else
154
+ :class="[direction === 'column' ? 'uni-steps__column-circle' : 'uni-steps__row-circle']"
155
+ :style="{ backgroundColor: index < active ? activeColor : deactiveColor }"
156
+ ></view>
157
+ <view
158
+ :class="[
159
+ direction === 'column' ? 'uni-steps__column-line' : 'uni-steps__row-line',
160
+ direction === 'column' ? 'uni-steps__column-line--after' : 'uni-steps__row-line--after'
161
+ ]"
162
+ :style="{
163
+ backgroundColor:
164
+ index < active && index !== options.length - 1
165
+ ? activeColor
166
+ : index === options.length - 1
167
+ ? 'transparent'
168
+ : deactiveColor
169
+ }"
170
+ ></view>
171
+ </view>
172
+ </view>
173
+ </view>
174
+ </view>
175
+ </template>
176
+ <script>
177
+ /**
178
+ * Steps 步骤条
179
+ * @description 评分组件
180
+ * @tutorial https://ext.dcloud.net.cn/plugin?id=34
181
+ * @property {Number} active 当前步骤
182
+ * @property {String} direction = [row|column] 当前步骤
183
+ * @value row 横向
184
+ * @value column 纵向
185
+ * @property {String} activeColor 选中状态的颜色
186
+ * @property {Array} options 数据源,格式为:[{title:'xxx',desc:'xxx'},{title:'xxx',desc:'xxx'}]
187
+ */
188
+ export default {
189
+ name: 'UniSteps',
190
+ props: {
191
+ direction: {
192
+ // 排列方向 row column
193
+ type: String,
194
+ default: 'row'
195
+ },
196
+ activeColor: {
197
+ // 激活状态颜色
198
+ type: String,
199
+ default: '#2979FF'
200
+ },
201
+ deactiveColor: {
202
+ // 未激活状态颜色
203
+ type: String,
204
+ default: '#B7BDC6'
205
+ },
206
+ active: {
207
+ // 当前步骤
208
+ type: Number,
209
+ default: 0
210
+ },
211
+ activeIcon: {
212
+ // 当前步骤
213
+ type: String,
214
+ default: 'checkbox-filled'
215
+ },
216
+ options: {
217
+ type: Array,
218
+ default() {
219
+ return [];
220
+ }
221
+ } // 数据
222
+ },
223
+ data() {
224
+ return {};
225
+ }
226
+ };
227
+ </script>
228
+ <style>
229
+ @import 'style.css';
230
+ </style>
@@ -1,3 +1,226 @@
1
- <template>
2
- @import './style.css';
3
- </style>
1
+ <template>
2
+ <!-- 在微信小程序 app vue端 h5 使用wxs 实现-->
3
+ <!-- #ifdef APP-VUE || MP-WEIXIN || H5 -->
4
+ <view class="uni-swipe">
5
+ <!-- #ifdef MP-WEIXIN || VUE3 -->
6
+ <view class="uni-swipe_box" :change:prop="wxsswipe.showWatch" :prop="is_show" :data-threshold="threshold"
7
+ :data-disabled="disabled" @touchstart="wxsswipe.touchstart" @touchmove="wxsswipe.touchmove"
8
+ @touchend="wxsswipe.touchend">
9
+ <!-- #endif -->
10
+ <!-- #ifndef MP-WEIXIN || VUE3 -->
11
+ <view class="uni-swipe_box" :change:prop="renderswipe.showWatch" :prop="is_show" :data-threshold="threshold"
12
+ :data-disabled="disabled+''" @touchstart="renderswipe.touchstart" @touchmove="renderswipe.touchmove"
13
+ @touchend="renderswipe.touchend">
14
+ <!-- #endif -->
15
+ <!-- 在微信小程序 app vue端 h5 使用wxs 实现-->
16
+ <view class="uni-swipe_button-group button-group--left">
17
+ <slot name="left">
18
+ <view v-for="(item,index) in leftOptions" :key="index" :style="{
19
+ backgroundColor: item.style && item.style.backgroundColor ? item.style.backgroundColor : '#C7C6CD'
20
+ }" class="uni-swipe_button button-hock" @touchstart="appTouchStart"
21
+ @touchend="appTouchEnd($event,index,item,'left')"
22
+ @click.stop="onClickForPC(index,item,'left')">
23
+ <text class="uni-swipe_button-text"
24
+ :style="{color: item.style && item.style.color ? item.style.color : '#FFFFFF',fontSize: item.style && item.style.fontSize ? item.style.fontSize : '16px'}">{{ item.text }}</text>
25
+ </view>
26
+ </slot>
27
+ </view>
28
+ <view class="uni-swipe_text--center">
29
+ <slot></slot>
30
+ </view>
31
+ <view class="uni-swipe_button-group button-group--right">
32
+ <slot name="right">
33
+ <view v-for="(item,index) in rightOptions" :key="index" :style="{
34
+ backgroundColor: item.style && item.style.backgroundColor ? item.style.backgroundColor : '#C7C6CD'
35
+ }" class="uni-swipe_button button-hock" @touchstart="appTouchStart"
36
+ @touchend="appTouchEnd($event,index,item,'right')"
37
+ @click.stop="onClickForPC(index,item,'right')"><text class="uni-swipe_button-text"
38
+ :style="{color: item.style && item.style.color ? item.style.color : '#FFFFFF',fontSize: item.style && item.style.fontSize ? item.style.fontSize : '16px'}">{{ item.text }}</text>
39
+ </view>
40
+ </slot>
41
+ </view>
42
+ </view>
43
+ </view>
44
+ <!-- #endif -->
45
+ <!-- app nvue端 使用 bindingx -->
46
+ <!-- #ifdef APP-NVUE -->
47
+ <view ref="selector-box--hock" class="uni-swipe" @horizontalpan="touchstart" @touchend="touchend">
48
+ <view ref='selector-left-button--hock' class="uni-swipe_button-group button-group--left">
49
+ <slot name="left">
50
+ <view v-for="(item,index) in leftOptions" :key="index" :style="{
51
+ backgroundColor: item.style && item.style.backgroundColor ? item.style.backgroundColor : '#C7C6CD'
52
+ }" class="uni-swipe_button button-hock" @click.stop="onClick(index,item,'left')"><text
53
+ class="uni-swipe_button-text"
54
+ :style="{color: item.style && item.style.color ? item.style.color : '#FFFFFF', fontSize: item.style && item.style.fontSize ? item.style.fontSize : '16px'}">{{ item.text }}</text>
55
+ </view>
56
+ </slot>
57
+ </view>
58
+ <view ref='selector-right-button--hock' class="uni-swipe_button-group button-group--right">
59
+ <slot name="right">
60
+ <view v-for="(item,index) in rightOptions" :key="index" :style="{
61
+ backgroundColor: item.style && item.style.backgroundColor ? item.style.backgroundColor : '#C7C6CD'
62
+ }" class="uni-swipe_button button-hock" @click.stop="onClick(index,item,'right')"><text
63
+ class="uni-swipe_button-text"
64
+ :style="{color: item.style && item.style.color ? item.style.color : '#FFFFFF',fontSize: item.style && item.style.fontSize ? item.style.fontSize : '16px'}">{{ item.text }}</text>
65
+ </view>
66
+ </slot>
67
+ </view>
68
+ <view ref='selector-content--hock' class="uni-swipe_box">
69
+ <slot></slot>
70
+ </view>
71
+ </view>
72
+ <!-- #endif -->
73
+ <!-- 其他平台使用 js ,长列表性能可能会有影响-->
74
+ <!-- #ifdef MP-ALIPAY || MP-BAIDU || MP-TOUTIAO || MP-QQ -->
75
+ <view class="uni-swipe">
76
+ <view class="uni-swipe_box" @touchstart="touchstart" @touchmove="touchmove" @touchend="touchend"
77
+ :style="{transform:moveLeft}" :class="{ani:ani}">
78
+ <view class="uni-swipe_button-group button-group--left" :class="[elClass]">
79
+ <slot name="left">
80
+ <view v-for="(item,index) in leftOptions" :key="index" :style="{
81
+ backgroundColor: item.style && item.style.backgroundColor ? item.style.backgroundColor : '#C7C6CD',
82
+ fontSize: item.style && item.style.fontSize ? item.style.fontSize : '16px'
83
+ }" class="uni-swipe_button button-hock" @touchstart="appTouchStart"
84
+ @touchend="appTouchEnd($event,index,item,'left')"><text class="uni-swipe_button-text"
85
+ :style="{color: item.style && item.style.color ? item.style.color : '#FFFFFF',}">{{ item.text }}</text>
86
+ </view>
87
+ </slot>
88
+ </view>
89
+ <slot></slot>
90
+ <view class="uni-swipe_button-group button-group--right" :class="[elClass]">
91
+ <slot name="right">
92
+ <view v-for="(item,index) in rightOptions" :key="index" :style="{
93
+ backgroundColor: item.style && item.style.backgroundColor ? item.style.backgroundColor : '#C7C6CD',
94
+ fontSize: item.style && item.style.fontSize ? item.style.fontSize : '16px'
95
+ }" @touchstart="appTouchStart" @touchend="appTouchEnd($event,index,item,'right')"
96
+ class="uni-swipe_button button-hock"><text class="uni-swipe_button-text"
97
+ :style="{color: item.style && item.style.color ? item.style.color : '#FFFFFF',}">{{ item.text }}</text>
98
+ </view>
99
+ </slot>
100
+ </view>
101
+ </view>
102
+ </view>
103
+ <!-- #endif -->
104
+ </template>
105
+ <script src="./wx.wxs" module="wxsswipe" lang="wxs"></script>
106
+ <script module="renderswipe" lang="renderjs">
107
+ import render from './render.js'
108
+ export default {
109
+ mounted(e, ins, owner) {
110
+ this.state = {}
111
+ },
112
+ methods: {
113
+ showWatch(newVal, oldVal, ownerInstance, instance) {
114
+ render.showWatch(newVal, oldVal, ownerInstance, instance, this)
115
+ },
116
+ touchstart(e, ownerInstance) {
117
+ render.touchstart(e, ownerInstance, this)
118
+ },
119
+ touchmove(e, ownerInstance) {
120
+ render.touchmove(e, ownerInstance, this)
121
+ },
122
+ touchend(e, ownerInstance) {
123
+ render.touchend(e, ownerInstance, this)
124
+ }
125
+ }
126
+ }
127
+ </script>
128
+ <script>
129
+ import mpwxs from './mpwxs'
130
+ import bindingx from './bindingx.js'
131
+ import mpother from './mpother'
132
+ /**
133
+ * SwipeActionItem 滑动操作子组件
134
+ * @description 通过滑动触发选项的容器
135
+ * @tutorial https://ext.dcloud.net.cn/plugin?id=181
136
+ * @property {Boolean} show = [left|right|none] 开启关闭组件,auto-close = false 时生效
137
+ * @property {Boolean} disabled = [true|false] 是否禁止滑动
138
+ * @property {Boolean} autoClose = [true|false] 滑动打开当前组件,是否关闭其他组件
139
+ * @property {Number} threshold 滑动缺省值
140
+ * @property {Array} leftOptions 左侧选项内容及样式
141
+ * @property {Array} rgihtOptions 右侧选项内容及样式
142
+ * @event {Function} click 点击选项按钮时触发事件,e = {content,index} ,content(点击内容)、index(下标)
143
+ * @event {Function} change 组件打开或关闭时触发,left\right\none
144
+ */
145
+ export default {
146
+ mixins: [mpwxs, bindingx, mpother],
147
+ emits: ['click', 'change'],
148
+ props: {
149
+ // 控制开关
150
+ show: {
151
+ type: String,
152
+ default: 'none'
153
+ },
154
+ // 禁用
155
+ disabled: {
156
+ type: Boolean,
157
+ default: false
158
+ },
159
+ // 是否自动关闭
160
+ autoClose: {
161
+ type: Boolean,
162
+ default: true
163
+ },
164
+ // 滑动缺省距离
165
+ threshold: {
166
+ type: Number,
167
+ default: 20
168
+ },
169
+ // 左侧按钮内容
170
+ leftOptions: {
171
+ type: Array,
172
+ default () {
173
+ return []
174
+ }
175
+ },
176
+ // 右侧按钮内容
177
+ rightOptions: {
178
+ type: Array,
179
+ default () {
180
+ return []
181
+ }
182
+ }
183
+ },
184
+ // #ifndef VUE3
185
+ // TODO vue2
186
+ destroyed() {
187
+ if (this.__isUnmounted) return
188
+ this.uninstall()
189
+ },
190
+ // #endif
191
+ // #ifdef VUE3
192
+ // TODO vue3
193
+ unmounted() {
194
+ this.__isUnmounted = true
195
+ this.uninstall()
196
+ },
197
+ // #endif
198
+ methods: {
199
+ uninstall() {
200
+ if (this.swipeaction) {
201
+ this.swipeaction.children.forEach((item, index) => {
202
+ if (item === this) {
203
+ this.swipeaction.children.splice(index, 1)
204
+ }
205
+ })
206
+ }
207
+ },
208
+ /**
209
+ * 获取父元素实例
210
+ */
211
+ getSwipeAction(name = 'uniSwipeAction') {
212
+ let parent = this.$parent;
213
+ let parentName = parent.$options.name;
214
+ while (parentName !== name) {
215
+ parent = parent.$parent;
216
+ if (!parent) return false;
217
+ parentName = parent.$options.name;
218
+ }
219
+ return parent;
220
+ }
221
+ }
222
+ }
223
+ </script>
224
+ <style>
225
+ @import 'style.css';
226
+ </style>