@10yun/cv-mobile-ui 0.5.8 → 0.5.10

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 (76) 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-editor-parse/components/wxParseAudio.vue +14 -5
  6. package/ui-cv/cv-editor-parse/components/wxParseImg.vue +26 -36
  7. package/ui-cv/cv-editor-parse/components/wxParseTable.vue +7 -7
  8. package/ui-cv/cv-editor-parse/components/wxParseTemplate0.vue +105 -88
  9. package/ui-cv/cv-editor-parse/components/wxParseTemplate1.vue +96 -88
  10. package/ui-cv/cv-editor-parse/components/wxParseTemplate10.vue +95 -88
  11. package/ui-cv/cv-editor-parse/components/wxParseTemplate11.vue +84 -82
  12. package/ui-cv/cv-editor-parse/components/wxParseTemplate2.vue +95 -88
  13. package/ui-cv/cv-editor-parse/components/wxParseTemplate3.vue +95 -88
  14. package/ui-cv/cv-editor-parse/components/wxParseTemplate4.vue +95 -88
  15. package/ui-cv/cv-editor-parse/components/wxParseTemplate5.vue +95 -88
  16. package/ui-cv/cv-editor-parse/components/wxParseTemplate6.vue +95 -88
  17. package/ui-cv/cv-editor-parse/components/wxParseTemplate7.vue +95 -88
  18. package/ui-cv/cv-editor-parse/components/wxParseTemplate8.vue +95 -88
  19. package/ui-cv/cv-editor-parse/components/wxParseTemplate9.vue +95 -88
  20. package/ui-cv/cv-editor-parse/components/wxParseVideo.vue +15 -15
  21. package/ui-cv/cv-editor-parse/cv-editor-parse.vue +1 -3
  22. package/ui-cv/cv-editor-parse/libs/html2json.js +15 -18
  23. package/ui-cv/cv-editor-parse/libs/htmlparser.js +12 -5
  24. package/ui-cv/cv-editor-parse/libs/wxDiscode.js +1 -1
  25. package/ui-cv/cv-editor-parse/readme.md +6 -0
  26. package/ui-cv/cv-editor-parse/u-parse.css +52 -95
  27. package/ui-cv/cv-geo-local/cv-geo-local.vue +0 -1
  28. package/ui-cv/cv-layout-topbar/cv-layout-topbar.vue +238 -0
  29. package/ui-cv/cv-markdown-show/cv-markdown-show.vue +109 -0
  30. package/ui-cv/cv-markdown-show/lib/highlight/atom-one-dark.css +1 -0
  31. package/ui-cv/cv-markdown-show/lib/highlight/atom-one-light.css +1 -0
  32. package/ui-cv/cv-markdown-show/lib/highlight/github-dark.min.css +10 -0
  33. package/ui-cv/cv-markdown-show/lib/highlight/uni-highlight.min.js +9122 -0
  34. package/ui-cv/cv-markdown-show/lib/html-parser.js +352 -0
  35. package/ui-cv/cv-markdown-show/lib/markdown-it.min.js +2 -0
  36. package/ui-cv/cv-markdown-show/markdown.css +340 -0
  37. package/ui-cv/cv-markdown-show/package.json +18 -0
  38. package/ui-cv/cv-markdown-show/readme.md +45 -0
  39. package/ui-cv/cv-nav-col/cv-nav-col.vue +2 -1
  40. package/ui-sdks/sdk-app-update/img/logo.png +0 -0
  41. package/ui-sdks/sdk-app-update/img/update_bg.png +0 -0
  42. package/ui-sdks/sdk-app-update/img/update_bg_top.png +0 -0
  43. package/{ui-cv/cv-update-app/cv-update-app.vue → ui-sdks/sdk-app-update/sdk-app-update.vue} +2 -2
  44. package/ui-sdks/sdk-app-update/xxxx +62 -0
  45. package/ui-sdks/sdk-privacy-policy/sdk-privacy-policy.vue +113 -0
  46. package/ui-sdks/sdk-u-charts/app-echarts.min.js +23 -0
  47. package/ui-sdks/sdk-u-charts/config-echarts.js +420 -0
  48. package/ui-sdks/sdk-u-charts/config-ucharts.js +630 -0
  49. package/ui-sdks/sdk-u-charts/h5-echarts.min.js +23 -0
  50. package/ui-sdks/sdk-u-charts/u-charts.js +7398 -0
  51. package/ui-sdks/sdk-u-charts/u-charts.min.js +1 -0
  52. package/ui-sdks/sdk-webview-main/WebViewMain.vue +1 -0
  53. package/ui-sdks/sdk-webview-main/main.js +0 -0
  54. package/ui-sdks/sdk-webview-main/mixin.js +0 -0
  55. package/ui-uni/uParse/src/components/wxParseAudio.vue +26 -0
  56. package/ui-uni/uParse/src/components/wxParseImg.vue +94 -0
  57. package/ui-uni/uParse/src/components/wxParseTable.vue +55 -0
  58. package/ui-uni/uParse/src/components/wxParseTemplate0.vue +103 -0
  59. package/ui-uni/uParse/src/components/wxParseTemplate1.vue +88 -0
  60. package/ui-uni/uParse/src/components/wxParseTemplate10.vue +88 -0
  61. package/ui-uni/uParse/src/components/wxParseTemplate11.vue +86 -0
  62. package/ui-uni/uParse/src/components/wxParseTemplate2.vue +88 -0
  63. package/ui-uni/uParse/src/components/wxParseTemplate3.vue +88 -0
  64. package/ui-uni/uParse/src/components/wxParseTemplate4.vue +88 -0
  65. package/ui-uni/uParse/src/components/wxParseTemplate5.vue +88 -0
  66. package/ui-uni/uParse/src/components/wxParseTemplate6.vue +88 -0
  67. package/ui-uni/uParse/src/components/wxParseTemplate7.vue +88 -0
  68. package/ui-uni/uParse/src/components/wxParseTemplate8.vue +88 -0
  69. package/ui-uni/uParse/src/components/wxParseTemplate9.vue +88 -0
  70. package/ui-uni/uParse/src/components/wxParseVideo.vue +15 -0
  71. package/ui-uni/uParse/src/editor.css +495 -0
  72. package/ui-uni/uParse/src/libs/html2json.js +261 -0
  73. package/ui-uni/uParse/src/libs/htmlparser.js +156 -0
  74. package/ui-uni/uParse/src/libs/wxDiscode.js +195 -0
  75. package/ui-uni/uParse/src/wxParse.css +270 -0
  76. package/ui-uni/uParse/src/wxParse.vue +206 -0
@@ -4,7 +4,6 @@
4
4
  <textarea
5
5
  class="cv-geo-local-content"
6
6
  v-model="localVal"
7
- :value="localVal"
8
7
  :maxlength="maxlength"
9
8
  :placeholder="placeholder"
10
9
  placeholder-class="cv-geo-local-placeholder"
@@ -0,0 +1,238 @@
1
+ <template>
2
+ <view>
3
+ <view class="cv-topbar-wrap">
4
+ <text class="cv-topbar-bg"></text>
5
+ <view class="cv-topbar-main">
6
+ <view class="cv-topbar-lt" @tap="bindLeftFunc">
7
+ <text v-if="leftText">{{ leftText }}</text>
8
+ <cv-icons v-if="leftIcon" :type="leftIcon" size="18" color="#fff" />
9
+ </view>
10
+ <view class="cv-topbar-center">
11
+ <view class="cv-topbar-title">{{ centerText }}</view>
12
+ </view>
13
+ <view class="cv-topbar-rt" @tap="bindRightFunc">
14
+ <cv-icons v-if="rightIcon" :type="rightIcon" size="18" color="#fff" />
15
+ <text v-if="rightText">{{ rightText }}</text>
16
+ </view>
17
+ </view>
18
+ </view>
19
+ <view class="cv-topbar-fixhold">
20
+ <view></view>
21
+ <view></view>
22
+ </view>
23
+ </view>
24
+ </template>
25
+ <script>
26
+ export default {
27
+ // emits: {
28
+ // leftFunc: (value) => {
29
+ // if (typeof value === 'string') {
30
+ // return true;
31
+ // } else {
32
+ // return false;
33
+ // }
34
+ // },
35
+ // rightFunc: (value) => {
36
+ // console.log('value---', value);
37
+ // if (typeof value === 'string') {
38
+ // return true;
39
+ // } else {
40
+ // return false;
41
+ // }
42
+ // }
43
+ // },
44
+ emits: ['leftFunc', 'rightFunc'],
45
+ props: {
46
+ leftText: '',
47
+ leftIcon: '',
48
+ centerText: '',
49
+ rightText: '',
50
+ rightIcon: ''
51
+ // rightFunc: {
52
+ // type: Function,
53
+ // default: () => {}
54
+ // }
55
+ },
56
+ data() {
57
+ return {};
58
+ },
59
+ created() {
60
+ console.log('----onRightFunc----', this.$attrs.onRightFunc);
61
+ },
62
+ methods: {
63
+ bindLeftFunc() {
64
+ const result = this.$emit('leftFunc');
65
+ // if (!result) {
66
+ // uni.navigateBack({
67
+ // // 返回
68
+ // delta: 1
69
+ // });
70
+ // }
71
+ },
72
+ bindRightFunc() {
73
+ try {
74
+ this.$emit('rightFunc');
75
+ } catch (e) {
76
+ console.log('--222--');
77
+ }
78
+ }
79
+ }
80
+ };
81
+ </script>
82
+ <style>
83
+ .cv-topbar-wrap {
84
+ width: 100%;
85
+ top: -1px;
86
+ right: 0px;
87
+ display: flex;
88
+ flex-direction: column;
89
+ position: fixed;
90
+ height: auto;
91
+ z-index: 20;
92
+ /* #ifdef H5 */
93
+ margin-top: 44px;
94
+ /* #endif */
95
+ margin-top: 0 !important;
96
+ }
97
+ .cv-topbar-bg {
98
+ display: block;
99
+ width: 100%;
100
+ height: var(--status-bar-height);
101
+ background: #409eff;
102
+ }
103
+ .cv-topbar-main {
104
+ box-sizing: border-box;
105
+ width: 100%;
106
+ height: 44px;
107
+ padding-right: 16rpx;
108
+ display: flex;
109
+ align-items: center;
110
+ background: #409eff;
111
+ }
112
+ .cv-topbar-main > image {
113
+ width: 25px;
114
+ height: 25px;
115
+ margin-left: 16rpx;
116
+ }
117
+ .cv-topbar-main > text {
118
+ width: 35px;
119
+ height: 35px;
120
+ margin-left: 16rpx;
121
+ color: #f6f6f6;
122
+ font-size: 56rpx;
123
+ display: flex;
124
+ align-items: center;
125
+ justify-content: center;
126
+ }
127
+ .cv-topbar-main > view.item {
128
+ margin: 0;
129
+ margin-left: 16rpx;
130
+ height: 35px;
131
+ width: 35px;
132
+ display: flex;
133
+ flex-direction: column;
134
+ align-items: center;
135
+ justify-content: center;
136
+ color: #f1f1f1;
137
+ }
138
+ .cv-topbar-main > view.item > text {
139
+ display: block;
140
+ font-size: 12px;
141
+ line-height: 100%;
142
+ color: #ececec;
143
+ }
144
+ .cv-topbar-main > view.search-input {
145
+ height: 30px;
146
+ flex: 1;
147
+ background-color: rgba(255, 255, 255, 0.5);
148
+ border-radius: 12rpx;
149
+ font-size: 28rpx;
150
+ margin: 0;
151
+ margin-left: 16rpx;
152
+ padding-right: 16rpx;
153
+ padding-left: 16rpx;
154
+ display: flex;
155
+ flex-direction: row;
156
+ align-items: center;
157
+ }
158
+ .cv-topbar-main > view.search-input > input {
159
+ flex: 1;
160
+ border: none;
161
+ min-height: auto;
162
+ display: inline-block;
163
+ color: #fff;
164
+ font-size: 15px;
165
+ }
166
+ .cv-topbar-main > view.search-input > image {
167
+ width: 16px;
168
+ height: 16px;
169
+ margin-right: 5px;
170
+ }
171
+ .cv-topbar-main > view.item > image {
172
+ width: 25px;
173
+ height: 25px;
174
+ }
175
+
176
+ /* 占位 */
177
+ .cv-topbar-fixhold {
178
+ width: 100%;
179
+ display: flex;
180
+ flex-direction: column;
181
+ }
182
+ .cv-topbar-fixhold > view:nth-of-type(1) {
183
+ width: 100%;
184
+ height: var(--status-bar-height);
185
+ }
186
+ .cv-topbar-fixhold > view:nth-of-type(2) {
187
+ width: 100%;
188
+ height: 44px;
189
+ }
190
+
191
+ .cv-topbar-center {
192
+ color: #fff;
193
+ font-weight: 700;
194
+ font-size: 16px;
195
+ text-align: center;
196
+ height: 20px;
197
+ }
198
+
199
+ .cv-topbar-title {
200
+ position: absolute;
201
+ left: 70px;
202
+ right: 70px;
203
+ min-width: 0;
204
+ user-select: auto;
205
+ }
206
+ .cv-topbar-lt {
207
+ position: absolute;
208
+ left: 10px;
209
+ flex-direction: row-reverse;
210
+ font-size: 28rpx;
211
+ color: #fff;
212
+ font-weight: normal;
213
+ display: flex;
214
+ }
215
+
216
+ .cv-topbar-lt text {
217
+ flex: 1;
218
+ font-size: 15px;
219
+ text-align: center;
220
+ height: 20px;
221
+ }
222
+ .cv-topbar-rt {
223
+ position: absolute;
224
+ right: 10px;
225
+ flex-direction: row-reverse;
226
+ font-size: 28rpx;
227
+ color: #fff;
228
+ font-weight: normal;
229
+ display: flex;
230
+ }
231
+
232
+ .cv-topbar-rt text {
233
+ flex: 1;
234
+ font-size: 15px;
235
+ text-align: center;
236
+ height: 20px;
237
+ }
238
+ </style>
@@ -0,0 +1,109 @@
1
+ <!-- uniapp vue3 markdown解析 -->
2
+ <template>
3
+ <view class="ua__markdown">
4
+ <rich-text space="nbsp" :nodes="parseNodes(source)" @itemclick="handleItemClick"></rich-text>
5
+ </view>
6
+ </template>
7
+
8
+ <script setup>
9
+ import { ref, computed } from 'vue';
10
+ import MarkdownIt from './lib/markdown-it.min.js';
11
+ import hljs from './lib/highlight/uni-highlight.min.js';
12
+ import './lib/highlight/atom-one-dark.css';
13
+ import parseHtml from './lib/html-parser.js';
14
+ const props = defineProps({
15
+ // 解析内容
16
+ source: String,
17
+ showLine: { type: [Boolean, String], default: true }
18
+ });
19
+
20
+ let copyCodeData = [];
21
+ const markdown = MarkdownIt({
22
+ html: true,
23
+ highlight: function (str, lang) {
24
+ let preCode = '';
25
+ try {
26
+ preCode = hljs.highlightAuto(str).value;
27
+ } catch (err) {
28
+ preCode = markdown.utils.escapeHtml(str);
29
+ }
30
+ const lines = preCode.split(/\n/).slice(0, -1);
31
+ // 添加自定义行号
32
+ let html = lines
33
+ .map((item, index) => {
34
+ if (item == '') {
35
+ return '';
36
+ }
37
+ return '<li><span class="line-num" data-line="' + (index + 1) + '"></span>' + item + '</li>';
38
+ })
39
+ .join('');
40
+ if (props.showLine) {
41
+ html = '<ol style="padding: 0px 30px;">' + html + '</ol>';
42
+ } else {
43
+ html = '<ol style="padding: 0px 7px;list-style:none;">' + html + '</ol>';
44
+ }
45
+ copyCodeData.push(str);
46
+ let htmlCode = `<div class="markdown-wrap">`;
47
+ // #ifndef MP-WEIXIN
48
+ htmlCode += `<div style="color: #aaa;text-align: right;font-size: 12px;padding:8px;">`;
49
+ htmlCode += `${lang}<a class="copy-btn" code-data-index="${copyCodeData.length - 1}" style="margin-left: 8px;">复制代码</a>`;
50
+ htmlCode += `</div>`;
51
+ // #endif
52
+ htmlCode += `<pre class="hljs" style="padding:10px 8px 0;margin-bottom:5px;overflow: auto;display: block;border-radius: 5px;"><code>${html}</code></pre>`;
53
+ htmlCode += '</div>';
54
+ return htmlCode;
55
+ }
56
+ });
57
+ const parseNodes = (value) => {
58
+ if (!value) return;
59
+ // 解析<br />到\n
60
+ value = value.replace(/<br>|<br\/>|<br \/>/g, '\n');
61
+ value = value.replace(/&nbsp;/g, ' ');
62
+ let htmlString = '';
63
+ if (value.split('```').length % 2) {
64
+ let mdtext = value;
65
+ if (mdtext[mdtext.length - 1] != '\n') {
66
+ mdtext += '\n';
67
+ }
68
+ htmlString = markdown.render(mdtext);
69
+ } else {
70
+ htmlString = markdown.render(value);
71
+ }
72
+ // 解决小程序表格边框型失效问题
73
+ htmlString = htmlString.replace(/<table/g, `<table class="table"`);
74
+ htmlString = htmlString.replace(/<tr/g, `<tr class="tr"`);
75
+ htmlString = htmlString.replace(/<th>/g, `<th class="th">`);
76
+ htmlString = htmlString.replace(/<td/g, `<td class="td"`);
77
+ htmlString = htmlString.replace(/<hr>|<hr\/>|<hr \/>/g, `<hr class="hr">`);
78
+
79
+ // #ifndef APP-NVUE
80
+ return htmlString;
81
+ // #endif
82
+
83
+ // 将htmlString转成htmlArray,反之使用rich-text解析
84
+ // #ifdef APP-NVUE
85
+ return parseHtml(htmlString);
86
+ // #endif
87
+ };
88
+
89
+ // 复制代码
90
+ const handleItemClick = (e) => {
91
+ let { attrs } = e.detail.node;
92
+ let { 'code-data-index': codeDataIndex, class: className } = attrs;
93
+ if (className == 'copy-btn') {
94
+ uni.setClipboardData({
95
+ data: copyCodeData[codeDataIndex],
96
+ showToast: false,
97
+ success() {
98
+ uni.showToast({
99
+ title: '复制成功',
100
+ icon: 'none'
101
+ });
102
+ }
103
+ });
104
+ }
105
+ };
106
+ </script>
107
+ <style scoped>
108
+ @import url('./markdown.css');
109
+ </style>
@@ -0,0 +1 @@
1
+ pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{color:#abb2bf;background:#282c34}.hljs-comment,.hljs-quote{color:#5c6370;font-style:italic}.hljs-doctag,.hljs-formula,.hljs-keyword{color:#c678dd}.hljs-deletion,.hljs-name,.hljs-section,.hljs-selector-tag,.hljs-subst{color:#e06c75}.hljs-literal{color:#56b6c2}.hljs-addition,.hljs-attribute,.hljs-meta .hljs-string,.hljs-regexp,.hljs-string{color:#98c379}.hljs-attr,.hljs-number,.hljs-selector-attr,.hljs-selector-class,.hljs-selector-pseudo,.hljs-template-variable,.hljs-type,.hljs-variable{color:#d19a66}.hljs-bullet,.hljs-link,.hljs-meta,.hljs-selector-id,.hljs-symbol,.hljs-title{color:#61aeee}.hljs-built_in,.hljs-class .hljs-title,.hljs-title.class_{color:#e6c07b}.hljs-emphasis{font-style:italic}.hljs-strong{font-weight:700}.hljs-link{text-decoration:underline}
@@ -0,0 +1 @@
1
+ pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{color:#383a42;background:#fafafa}.hljs-comment,.hljs-quote{color:#a0a1a7;font-style:italic}.hljs-doctag,.hljs-formula,.hljs-keyword{color:#a626a4}.hljs-deletion,.hljs-name,.hljs-section,.hljs-selector-tag,.hljs-subst{color:#e45649}.hljs-literal{color:#0184bb}.hljs-addition,.hljs-attribute,.hljs-meta .hljs-string,.hljs-regexp,.hljs-string{color:#50a14f}.hljs-attr,.hljs-number,.hljs-selector-attr,.hljs-selector-class,.hljs-selector-pseudo,.hljs-template-variable,.hljs-type,.hljs-variable{color:#986801}.hljs-bullet,.hljs-link,.hljs-meta,.hljs-selector-id,.hljs-symbol,.hljs-title{color:#4078f2}.hljs-built_in,.hljs-class .hljs-title,.hljs-title.class_{color:#c18401}.hljs-emphasis{font-style:italic}.hljs-strong{font-weight:700}.hljs-link{text-decoration:underline}
@@ -0,0 +1,10 @@
1
+ pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}/*!
2
+ Theme: GitHub Dark
3
+ Description: Dark theme as seen on github.com
4
+ Author: github.com
5
+ Maintainer: @Hirse
6
+ Updated: 2021-05-15
7
+
8
+ Outdated base version: https://github.com/primer/github-syntax-dark
9
+ Current colors taken from GitHub's CSS
10
+ */.hljs{color:#c9d1d9;background:#0d1117}.hljs-doctag,.hljs-keyword,.hljs-meta .hljs-keyword,.hljs-template-tag,.hljs-template-variable,.hljs-type,.hljs-variable.language_{color:#ff7b72}.hljs-title,.hljs-title.class_,.hljs-title.class_.inherited__,.hljs-title.function_{color:#d2a8ff}.hljs-attr,.hljs-attribute,.hljs-literal,.hljs-meta,.hljs-number,.hljs-operator,.hljs-selector-attr,.hljs-selector-class,.hljs-selector-id,.hljs-variable{color:#79c0ff}.hljs-meta .hljs-string,.hljs-regexp,.hljs-string{color:#a5d6ff}.hljs-built_in,.hljs-symbol{color:#ffa657}.hljs-code,.hljs-comment,.hljs-formula{color:#8b949e}.hljs-name,.hljs-quote,.hljs-selector-pseudo,.hljs-selector-tag{color:#7ee787}.hljs-subst{color:#c9d1d9}.hljs-section{color:#1f6feb;font-weight:700}.hljs-bullet{color:#f2cc60}.hljs-emphasis{color:#c9d1d9;font-style:italic}.hljs-strong{color:#c9d1d9;font-weight:700}.hljs-addition{color:#aff5b4;background-color:#033a16}.hljs-deletion{color:#ffdcd7;background-color:#67060c}