@10yun/cv-mobile-ui 0.5.9 → 0.5.11

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 (46) hide show
  1. package/extend/permission.js +1 -2
  2. package/package.json +1 -1
  3. package/plugins/uni-richText.js +1 -1
  4. package/plugins/uni-socket.js +6 -8
  5. package/ui-cv/cv-base-audio/cv-base-audio.vue +278 -0
  6. package/ui-cv/cv-editor-parse/components/wxParseAudio.vue +2 -4
  7. package/ui-cv/cv-geo-local/cv-geo-local.vue +0 -1
  8. package/ui-cv/cv-layout-topbar/cv-layout-topbar.vue +238 -0
  9. package/ui-cv/cv-markdown-show/lib/highlight/uni-highlight.min.js +9001 -5133
  10. package/ui-sdks/sdk-app-update/img/logo.png +0 -0
  11. package/ui-sdks/sdk-app-update/img/update_bg.png +0 -0
  12. package/ui-sdks/sdk-app-update/img/update_bg_top.png +0 -0
  13. package/{ui-cv/cv-update-app/cv-update-app.vue → ui-sdks/sdk-app-update/sdk-app-update.vue} +2 -2
  14. package/ui-sdks/sdk-app-update/xxxx +62 -0
  15. package/ui-sdks/sdk-privacy-policy/sdk-privacy-policy.vue +113 -0
  16. package/ui-sdks/sdk-u-charts/app-echarts.min.js +23 -0
  17. package/ui-sdks/sdk-u-charts/config-echarts.js +420 -0
  18. package/ui-sdks/sdk-u-charts/config-ucharts.js +630 -0
  19. package/ui-sdks/sdk-u-charts/h5-echarts.min.js +23 -0
  20. package/ui-sdks/sdk-u-charts/u-charts.js +7398 -0
  21. package/ui-sdks/sdk-u-charts/u-charts.min.js +1 -0
  22. package/ui-sdks/sdk-webview-main/WebViewMain.vue +1 -0
  23. package/ui-sdks/sdk-webview-main/main.js +0 -0
  24. package/ui-sdks/sdk-webview-main/mixin.js +0 -0
  25. package/ui-uni/uParse/src/components/wxParseAudio.vue +26 -0
  26. package/ui-uni/uParse/src/components/wxParseImg.vue +94 -0
  27. package/ui-uni/uParse/src/components/wxParseTable.vue +55 -0
  28. package/ui-uni/uParse/src/components/wxParseTemplate0.vue +103 -0
  29. package/ui-uni/uParse/src/components/wxParseTemplate1.vue +88 -0
  30. package/ui-uni/uParse/src/components/wxParseTemplate10.vue +88 -0
  31. package/ui-uni/uParse/src/components/wxParseTemplate11.vue +86 -0
  32. package/ui-uni/uParse/src/components/wxParseTemplate2.vue +88 -0
  33. package/ui-uni/uParse/src/components/wxParseTemplate3.vue +88 -0
  34. package/ui-uni/uParse/src/components/wxParseTemplate4.vue +88 -0
  35. package/ui-uni/uParse/src/components/wxParseTemplate5.vue +88 -0
  36. package/ui-uni/uParse/src/components/wxParseTemplate6.vue +88 -0
  37. package/ui-uni/uParse/src/components/wxParseTemplate7.vue +88 -0
  38. package/ui-uni/uParse/src/components/wxParseTemplate8.vue +88 -0
  39. package/ui-uni/uParse/src/components/wxParseTemplate9.vue +88 -0
  40. package/ui-uni/uParse/src/components/wxParseVideo.vue +15 -0
  41. package/ui-uni/uParse/src/editor.css +495 -0
  42. package/ui-uni/uParse/src/libs/html2json.js +261 -0
  43. package/ui-uni/uParse/src/libs/htmlparser.js +156 -0
  44. package/ui-uni/uParse/src/libs/wxDiscode.js +195 -0
  45. package/ui-uni/uParse/src/wxParse.css +270 -0
  46. package/ui-uni/uParse/src/wxParse.vue +206 -0
@@ -0,0 +1,270 @@
1
+ /**
2
+ * author: Di (微信小程序开发工程师)
3
+ * organization: WeAppDev(微信小程序开发论坛)(http://weappdev.com)
4
+ * 垂直微信小程序开发交流社区
5
+ *
6
+ * github地址: https://github.com/icindy/wxParse
7
+ *
8
+ * for: 微信小程序富文本解析
9
+ * detail : http://weappdev.com/t/wxparse-alpha0-1-html-markdown/184
10
+ */
11
+ /**
12
+ * 请在全局下引入该文件,@import '/static/wxParse.css';
13
+ */
14
+ .wxParse {
15
+ user-select: none;
16
+ width: 100%;
17
+ font-family: Helvetica, 'PingFangSC', 'Microsoft Yahei', '微软雅黑', Arial, sans-serif;
18
+ color: #333;
19
+ line-height: 1.5;
20
+ font-size: 1em;
21
+ text-align: justify; /* //左右两端对齐 */
22
+ }
23
+ .wxParse view,
24
+ .wxParse uni-view {
25
+ word-break: break-word;
26
+ }
27
+ .wxParse .p {
28
+ padding-bottom: 0.5em;
29
+ clear: both;
30
+ /* letter-spacing: 0;//字间距 */
31
+ }
32
+ .wxParse .inline {
33
+ display: inline;
34
+ margin: 0;
35
+ padding: 0;
36
+ }
37
+
38
+ .wxParse .div {
39
+ margin: 0;
40
+ padding: 0;
41
+ display: block;
42
+ }
43
+
44
+ .wxParse .h1 {
45
+ font-size: 2em;
46
+ line-height: 1.2em;
47
+ margin: 0.67em 0;
48
+ }
49
+ .wxParse .h2 {
50
+ font-size: 1.5em;
51
+ margin: 0.83em 0;
52
+ }
53
+ .wxParse .h3 {
54
+ font-size: 1.17em;
55
+ margin: 1em 0;
56
+ }
57
+ .wxParse .h4 {
58
+ margin: 1.33em 0;
59
+ }
60
+ .wxParse .h5 {
61
+ font-size: 0.83em;
62
+ margin: 1.67em 0;
63
+ }
64
+ .wxParse .h6 {
65
+ font-size: 0.83em;
66
+ margin: 1.67em 0;
67
+ }
68
+
69
+ .wxParse .h1,
70
+ .wxParse .h2,
71
+ .wxParse .h3,
72
+ .wxParse .h4,
73
+ .wxParse .h5,
74
+ .wxParse .h6,
75
+ .wxParse .b,
76
+ .wxParse .strong {
77
+ font-weight: bolder;
78
+ }
79
+
80
+ .wxParse .i,
81
+ .wxParse .cite,
82
+ .wxParse .em,
83
+ .wxParse .var,
84
+ .wxParse .address {
85
+ font-style: italic;
86
+ }
87
+ .wxParse .spaceshow {
88
+ white-space: pre;
89
+ }
90
+ .wxParse .pre,
91
+ .wxParse .tt,
92
+ .wxParse .code,
93
+ .wxParse .kbd,
94
+ .wxParse .samp {
95
+ font-family: monospace;
96
+ }
97
+ .wxParse .pre {
98
+ overflow: auto;
99
+ background: #f5f5f5;
100
+ padding: 16rpx;
101
+ white-space: pre;
102
+ margin: 1em 0rpx;
103
+ font-size: 24rpx;
104
+ }
105
+ .wxParse .code {
106
+ overflow: auto;
107
+ padding: 16rpx;
108
+ white-space: pre;
109
+ margin: 1em 0rpx;
110
+ background: #f5f5f5;
111
+ font-size: 24rpx;
112
+ }
113
+
114
+ .wxParse .big {
115
+ font-size: 1.17em;
116
+ }
117
+
118
+ .wxParse .small,
119
+ .wxParse .sub,
120
+ .wxParse .sup {
121
+ font-size: 0.83em;
122
+ }
123
+
124
+ .wxParse .sub {
125
+ vertical-align: sub;
126
+ }
127
+ .wxParse .sup {
128
+ vertical-align: super;
129
+ }
130
+
131
+ .wxParse .s,
132
+ .wxParse .strike,
133
+ .wxParse .del {
134
+ text-decoration: line-through;
135
+ }
136
+
137
+ .wxParse .strong,
138
+ .wxParse .text,
139
+ .wxParse .span,
140
+ .wxParse .s {
141
+ display: inline;
142
+ }
143
+
144
+ .wxParse .a {
145
+ color: #576b95;
146
+ }
147
+
148
+ .wxParse .video {
149
+ text-align: center;
150
+ margin: 22rpx 0;
151
+ }
152
+
153
+ .wxParse .video-video {
154
+ width: 100%;
155
+ }
156
+ .wxParse .uni-image {
157
+ max-width: 100%;
158
+ }
159
+ .wxParse .img {
160
+ display: block;
161
+ max-width: 100%;
162
+ margin-bottom: 0em; /* //与p标签底部padding同时修改 */
163
+ overflow: hidden;
164
+ }
165
+
166
+ .wxParse .blockquote {
167
+ margin: 10rpx 0;
168
+ padding: 22rpx 0 22rpx 22rpx;
169
+ font-family: Courier, Calibri, '宋体';
170
+ background: #f5f5f5;
171
+ border-left: 6rpx solid #dbdbdb;
172
+ }
173
+ .wxParse .blockquote .p {
174
+ margin: 0;
175
+ }
176
+ .wxParse .ul,
177
+ .wxParse .ol {
178
+ display: block;
179
+ margin: 1em 0;
180
+ padding-left: 2em;
181
+ }
182
+ .wxParse .ol {
183
+ list-style-type: disc;
184
+ }
185
+ .wxParse .ol {
186
+ list-style-type: decimal;
187
+ }
188
+ .wxParse .ol > weixin-parse-template,
189
+ .wxParse .ul > weixin-parse-template {
190
+ display: list-item;
191
+ align-items: baseline;
192
+ text-align: match-parent;
193
+ }
194
+
195
+ .wxParse .ol > .li,
196
+ .wxParse .ul > .li {
197
+ display: list-item;
198
+ align-items: baseline;
199
+ text-align: match-parent;
200
+ }
201
+ .wxParse .ul .ul,
202
+ .wxParse .ol .ul {
203
+ list-style-type: circle;
204
+ }
205
+ .wxParse .ol .ol .ul,
206
+ .wxParse .ol .ul .ul,
207
+ .wxParse .ul .ol .ul,
208
+ .wxParse .ul .ul .ul {
209
+ list-style-type: square;
210
+ }
211
+
212
+ .wxParse .u {
213
+ text-decoration: underline;
214
+ }
215
+ .wxParse .hide {
216
+ display: none;
217
+ }
218
+ .wxParse .del {
219
+ display: inline;
220
+ }
221
+ .wxParse .figure {
222
+ overflow: hidden;
223
+ }
224
+ .wxParse .tablebox {
225
+ overflow: auto;
226
+ background-color: #f5f5f5;
227
+ background: #f5f5f5;
228
+ font-size: 13px;
229
+ padding: 8px;
230
+ }
231
+ .wxParse .table .table,
232
+ .wxParse .table {
233
+ border-collapse: collapse;
234
+ box-sizing: border-box;
235
+ /* 内边框 */
236
+ /* width: 100%; */
237
+ overflow: auto;
238
+ white-space: pre;
239
+ }
240
+ .wxParse .tbody {
241
+ border-collapse: collapse;
242
+ box-sizing: border-box;
243
+ /* 内边框 */
244
+ border: 1px solid #dadada;
245
+ }
246
+ .wxParse .table .thead,
247
+ .wxParse .table .tfoot,
248
+ .wxParse .table .th {
249
+ border-collapse: collapse;
250
+ box-sizing: border-box;
251
+ background: #ececec;
252
+ font-weight: 40;
253
+ }
254
+ .wxParse .table .tr {
255
+ border-collapse: collapse;
256
+ box-sizing: border-box;
257
+ /* border: 2px solid #F0AD4E; */
258
+ overflow: auto;
259
+ }
260
+ .wxParse .table .th,
261
+ .wxParse .table .td {
262
+ border-collapse: collapse;
263
+ box-sizing: border-box;
264
+ border: 2rpx solid #dadada;
265
+ overflow: auto;
266
+ }
267
+ .wxParse .audio,
268
+ .wxParse .uni-audio-default {
269
+ display: block;
270
+ }
@@ -0,0 +1,206 @@
1
+ <!--**
2
+ * forked from:https://github.com/F-loat/mpvue-wxParse
3
+ *
4
+ * github地址: https://github.com/dcloudio/uParse
5
+ *
6
+ * uni-app框架下 富文本解析
7
+ *
8
+ */-->
9
+
10
+ <template>
11
+
12
+ <!--基础元素-->
13
+ <div class="wxParse" :class="className" :style="'user-select:' + userSelect" v-if="!loading">
14
+ <block v-for="(node, index) of nodes" :key="index">
15
+ <wxParseTemplate :node="node" />
16
+ </block>
17
+ </div>
18
+ </template>
19
+
20
+ <script>
21
+ import HtmlToJson from './libs/html2json';
22
+ import wxParseTemplate from './components/wxParseTemplate0';
23
+
24
+
25
+ export default {
26
+ name: 'wxParse',
27
+ props: {
28
+ // user-select:none;
29
+ userSelect: {
30
+ type: String,
31
+ default: 'none' //none |text| all | element
32
+ },
33
+ imgOptions: {
34
+ type: [Object, Boolean],
35
+ default: function() {
36
+ return {
37
+ loop: false,
38
+ indicator: 'number',
39
+ longPressActions: false
40
+ }
41
+ }
42
+ },
43
+ loading: {
44
+ type: Boolean,
45
+ default: false
46
+ },
47
+ className: {
48
+ type: String,
49
+ default: ''
50
+ },
51
+ content: {
52
+ type: String,
53
+ default: ''
54
+ },
55
+ noData: {
56
+ type: String,
57
+ default: ''
58
+ },
59
+ startHandler: {
60
+ type: Function,
61
+ default () {
62
+ return node => {
63
+ node.attr.class = null;
64
+ node.attr.style = null;
65
+ };
66
+ }
67
+ },
68
+ endHandler: {
69
+ type: Function,
70
+ default: null
71
+ },
72
+ charsHandler: {
73
+ type: Function,
74
+ default: null
75
+ },
76
+ imageProp: {
77
+ type: Object,
78
+ default () {
79
+ return {
80
+ mode: 'aspectFit',
81
+ padding: 0,
82
+ lazyLoad: false,
83
+ domain: ''
84
+ };
85
+ }
86
+ }
87
+ },
88
+ components: {
89
+ wxParseTemplate
90
+ },
91
+ data() {
92
+ return {
93
+ nodes: {},
94
+ imageUrls: [],
95
+ wxParseWidth: {
96
+ value: 0
97
+ }
98
+ };
99
+ },
100
+ computed: {},
101
+ mounted() {
102
+ this.setHtml()
103
+ },
104
+ methods: {
105
+ setHtml() {
106
+ this.getWidth().then((data) => {
107
+ this.wxParseWidth.value = data;
108
+ })
109
+ let {
110
+ content,
111
+ noData,
112
+ imageProp,
113
+ startHandler,
114
+ endHandler,
115
+ charsHandler
116
+ } = this;
117
+ let parseData = content || noData;
118
+ let customHandler = {
119
+ start: startHandler,
120
+ end: endHandler,
121
+ chars: charsHandler
122
+ };
123
+ let results = HtmlToJson(parseData, customHandler, imageProp, this);
124
+
125
+ this.imageUrls = results.imageUrls;
126
+ // this.nodes = results.nodes;
127
+
128
+
129
+ this.nodes = [];
130
+ results.nodes.forEach((item) => {
131
+ setTimeout(() => {
132
+ this.nodes.push(item)
133
+ }, 0);
134
+ })
135
+ },
136
+ getWidth() {
137
+ return new Promise((res, rej) => {
138
+ // #ifndef MP-ALIPAY || MP-BAIDU
139
+ uni.createSelectorQuery()
140
+ .in(this)
141
+ .select('.wxParse')
142
+ .fields({
143
+ size: true,
144
+ scrollOffset: true
145
+ },
146
+ data => {
147
+ res(data.width);
148
+ }
149
+ ).exec();
150
+ // #endif
151
+ // #ifdef MP-BAIDU
152
+ return new Promise((res, rej) => {
153
+ swan.createSelectorQuery().select('.wxParse').boundingClientRect(function(rect) {
154
+ res(rect.width)
155
+ }).exec()
156
+ });
157
+ // #endif
158
+ // #ifdef MP-ALIPAY
159
+ my.createSelectorQuery()
160
+ .select('.wxParse')
161
+ .boundingClientRect().exec((ret) => {
162
+ res(ret[0].width);
163
+ });
164
+ // #endif
165
+ });
166
+ },
167
+ navigate(href, $event, attr) {
168
+ console.log(href, attr);
169
+ this.$emit('navigate', href, $event);
170
+ },
171
+ preview(src, $event) {
172
+ if (!this.imageUrls.length || typeof this.imgOptions === 'boolean') {
173
+
174
+ } else {
175
+ uni.previewImage({
176
+ current: src,
177
+ urls: this.imageUrls,
178
+ loop: this.imgOptions.loop,
179
+ indicator: this.imgOptions.indicator,
180
+ longPressActions: this.imgOptions.longPressActions
181
+ });
182
+ }
183
+ this.$emit('preview', src, $event);
184
+ },
185
+ removeImageUrl(src) {
186
+ const {
187
+ imageUrls
188
+ } = this;
189
+ imageUrls.splice(imageUrls.indexOf(src), 1);
190
+ }
191
+ },
192
+ // 父组件中提供
193
+ provide() {
194
+ return {
195
+ parseWidth: this.wxParseWidth,
196
+ parseSelect: this.userSelect
197
+ // 提示:provide 和 inject 绑定并不是可响应的。这是刻意为之的。然而,如果你传入了一个可监听的对象,那么其对象的属性还是可响应的。
198
+ };
199
+ },
200
+ watch: {
201
+ content() {
202
+ this.setHtml()
203
+ }
204
+ }
205
+ };
206
+ </script>