yc-ui2 0.2.2-beta2 → 0.2.2-beta4

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 (47) hide show
  1. package/package.json +1 -1
  2. package/.env +0 -7
  3. package/babel.config.js +0 -5
  4. package/jsconfig.json +0 -19
  5. package/public/favicon.ico +0 -0
  6. package/public/index.html +0 -20
  7. package/src/App.vue +0 -70
  8. package/src/api/customerService.js +0 -56
  9. package/src/assets/ca/ca-bg.png +0 -0
  10. package/src/assets/ca/caBg.png +0 -0
  11. package/src/assets/customerService/admin.jpg +0 -0
  12. package/src/assets/customerService/chatTop.png +0 -0
  13. package/src/assets/customerService/ellipticalWenh.png +0 -0
  14. package/src/assets/customerService/enlarge.png +0 -0
  15. package/src/assets/customerService/personal.jpg +0 -0
  16. package/src/assets/customerService/personal1.jpg +0 -0
  17. package/src/assets/customerService/personal2.jpg +0 -0
  18. package/src/assets/slideVerify/1.jpg +0 -0
  19. package/src/assets/slideVerify/2.jpg +0 -0
  20. package/src/assets/slideVerify/3.jpg +0 -0
  21. package/src/assets/slideVerify/4.jpg +0 -0
  22. package/src/assets/slideVerify/5.jpg +0 -0
  23. package/src/assets/slideVerify/6.jpg +0 -0
  24. package/src/assets/slideVerify/7.jpg +0 -0
  25. package/src/assets/slideVerify/8.jpg +0 -0
  26. package/src/components/YcCA/index.vue +0 -536
  27. package/src/components/YcCustomerService/chat.vue +0 -337
  28. package/src/components/YcCustomerService/chatMixin.js +0 -128
  29. package/src/components/YcCustomerService/index.vue +0 -272
  30. package/src/components/YcQuestion/index.vue +0 -535
  31. package/src/components/YcSlideVerify/index.vue +0 -104
  32. package/src/main.js +0 -19
  33. package/src/packages/index.js +0 -29
  34. package/src/router/index.js +0 -20
  35. package/src/utils/auth.js +0 -6
  36. package/src/utils/mTokenPlugin/base64.js +0 -148
  37. package/src/utils/mTokenPlugin/base64_backups.js +0 -146
  38. package/src/utils/mTokenPlugin/hunca_mToken_core.js +0 -1447
  39. package/src/utils/mTokenPlugin/hunca_mToken_core2.js +0 -1455
  40. package/src/utils/mTokenPlugin/hunca_mToken_core_backups.js +0 -1425
  41. package/src/utils/mTokenPlugin/mToken.js +0 -3211
  42. package/src/utils/mTokenPlugin/mToken_backups.js +0 -3202
  43. package/src/utils/mTokenPluginBeijin/formateTime.js +0 -10
  44. package/src/utils/mTokenPluginBeijin/xtxasyn.js +0 -1156
  45. package/src/utils/request.js +0 -50
  46. package/src/views/question.vue +0 -32
  47. package/vue.config.js +0 -41
@@ -1,535 +0,0 @@
1
- <template>
2
- <div class="YcQuestion">
3
- <div class="chatPage">
4
- <header
5
- style="
6
- background: url(/cloud-img/customerService/chatTop.png) center
7
- no-repeat cover;
8
- background-size: cover;
9
- "
10
- >
11
- <div>
12
- <h3>{{ title }}</h3>
13
- <span>Problem Help</span>
14
- </div>
15
- <p>{{ commit }}</p>
16
- </header>
17
- <div class="main">
18
- <div>
19
- <main ref="main">
20
- <p>今天{{ currData }}</p>
21
- <div
22
- v-for="(item, index) in messagelist"
23
- :key="index"
24
- :class="['message', item.id]"
25
- >
26
- <img
27
- class="avatar"
28
- :src="require(`assets/customerService/${item.id}.jpg`)"
29
- />
30
- <div class="content" :data-before="`${title}【${id}号为您服务】`">
31
- <span
32
- v-for="({ msg, id, answerType }, index) in item.msg"
33
- :key="index"
34
- v-html="
35
- (item.msg.length > 1 ? 1 + index + '. ' : ' ') +
36
- msg +
37
- (answerType ? `《${answerType}》` : '')
38
- "
39
- :class="item.msg.length > 1 ? 'href' : ''"
40
- @click="item.msg.length > 1 && regularClick(msg, id)"
41
- ></span>
42
- <div
43
- class="based"
44
- v-if="item.based"
45
- @click.prevent="handExpand(item)"
46
- >
47
- <span>依据</span
48
- ><span :class="{ 'is-active': item.isActive }"
49
- >{{ item.based }}<i class="el-icon-d-arrow-right"></i
50
- ></span>
51
- </div>
52
- </div>
53
- </div>
54
- </main>
55
- <footer>
56
- <el-input
57
- type="textarea"
58
- maxlength="500"
59
- :autosize="{ minRows: 6, maxRows: 6 }"
60
- autofocus="true"
61
- resize="none"
62
- placeholder="请输入你要咨询的问题"
63
- v-model="textareaValue"
64
- @keyup.enter.native="carriageReturn"
65
- >
66
- </el-input>
67
- <el-button
68
- type="primary"
69
- :disabled="!textareaValue"
70
- :style="
71
- !textareaValue
72
- ? 'background-color: #F7F7F9;color: #FF575F;border-color: transparent;'
73
- : ''
74
- "
75
- @click="send"
76
- >发送</el-button
77
- >
78
- </footer>
79
- </div>
80
- <aside>
81
- <el-collapse v-model="activeNames" accordion>
82
- <el-collapse-item
83
- v-for="{
84
- discourseVoList,
85
- answerTypeId,
86
- answerType,
87
- } in questionsList"
88
- :key="answerTypeId"
89
- :name="answerTypeId"
90
- >
91
- <template slot="title">
92
- <img
93
- :src="require(`assets/customerService/ellipticalWenh.png`)"
94
- />{{ answerType }}
95
- </template>
96
- <div
97
- v-for="{ problem, problemId } in discourseVoList"
98
- :key="problemId"
99
- v-html="problem"
100
- @click="regularClick(problem, problemId)"
101
- ></div>
102
- </el-collapse-item>
103
- </el-collapse>
104
- </aside>
105
- </div>
106
- </div>
107
- </div>
108
- </template>
109
- <script>
110
- import { getProblemTypeAndProblem } from "api/customerService";
111
- import chatMixin from "comp/YcCustomerService/chatMixin";
112
- export default {
113
- name: "YcQuestion",
114
- mixins: [chatMixin],
115
- props: {
116
- tokenName: String,
117
- },
118
- data() {
119
- return {
120
- activeNames: [1],
121
- questionsList: [],
122
- };
123
- },
124
- computed: {
125
- currData() {
126
- const currData = new Date();
127
- return `${currData.getHours()}:${currData.getMinutes()}`;
128
- },
129
- // questionsList() {
130
- // return this.questions.reduce((prev, curr) => {
131
- // // eslint-disable-next-line no-prototype-builtins
132
- // if (prev.hasOwnProperty(curr.type)) {
133
- // prev[curr.type].push(curr.faq)
134
- // } else {
135
- // prev[curr.type] = [curr.faq]
136
- // }
137
- // return prev
138
- // }, {})
139
- // },
140
- },
141
- watch: {
142
- id(newVal) {
143
- this.getProblemTypeAndProblem(newVal);
144
- },
145
- },
146
- created() {
147
- sessionStorage.setItem(process.env.VUE_APP_TOKEN_NAME, this.tokenName);
148
- this.getProblemTypeAndProblem(this.id);
149
- },
150
- methods: {
151
- getProblemTypeAndProblem(id) {
152
- if (id)
153
- getProblemTypeAndProblem(id).then(({ data }) => {
154
- this.questionsList = data;
155
- });
156
- },
157
- },
158
- };
159
- </script>
160
- <style lang="scss" scoped>
161
- .YcQuestion {
162
- // min-width: auto;
163
- // overflow: hidden;
164
- // height: 100vh;
165
- ::v-deep .chatPage {
166
- background-color: #ffffff;
167
-
168
- > header {
169
- height: 8vw;
170
- display: flex;
171
- justify-content: flex-start;
172
- align-items: center;
173
- gap: 5vw;
174
- padding-left: 8vw;
175
- // background: url("~assets/customerService/chatTop.png");
176
- // background-position: center center;
177
- // background-repeat: no-repeat;
178
- // background-size: cover;
179
-
180
- > div {
181
- display: flex;
182
- flex-direction: column;
183
- justify-content: center;
184
- align-items: center;
185
-
186
- // flex-direction: row-reverse;
187
- h3 {
188
- height: 1vw;
189
- margin-top: 0px;
190
- font-size: 2.125rem;
191
- font-weight: bold;
192
- color: #191a2c;
193
- font-family: Source Han Sans CN-Bold, Source Han Sans CN;
194
- }
195
-
196
- span {
197
- font-size: 1rem;
198
- font-family: LXGW New Clear Gothic-Regular, LXGW New Clear Gothic;
199
- font-weight: 400;
200
- color: #666;
201
- }
202
- }
203
-
204
- p {
205
- font-size: 1rem;
206
- font-family: Source Han Sans CN-Regular, Source Han Sans CN;
207
- font-weight: 400;
208
- color: #2e2f42;
209
- }
210
- }
211
-
212
- .main {
213
- display: flex;
214
-
215
- > div {
216
- width: 74vw;
217
- position: relative;
218
-
219
- > main {
220
- height: 62vh;
221
- overflow-y: auto;
222
- padding-bottom: 2vw;
223
- background-color: #f7f7f9;
224
-
225
- // 滚动条宽度
226
- &::-webkit-scrollbar {
227
- width: 6px;
228
- }
229
-
230
- // 滚动条轨道
231
- &::-webkit-scrollbar-track {
232
- background: rgb(239, 239, 239);
233
- border-radius: 2px;
234
- }
235
-
236
- // 小滑块
237
- &::-webkit-scrollbar-thumb {
238
- background: #ff8879;
239
- border-radius: 10px;
240
- }
241
-
242
- &::-webkit-scrollbar-thumb:hover {
243
- background: #ff755d;
244
- }
245
-
246
- > p {
247
- text-align: center;
248
- font-size: 0.875rem;
249
- font-family: Source Han Sans CN-Regular, Source Han Sans CN;
250
- font-weight: 400;
251
- color: #909399;
252
- }
253
-
254
- .message {
255
- display: flex;
256
- gap: 15px;
257
- margin: 1.5vw 1.5vw 0px 1.5vw;
258
- opacity: 0;
259
-
260
- .avatar {
261
- width: 2.5vw;
262
- height: 2.5vw;
263
- min-width: 35px;
264
- min-height: 35px;
265
- border-radius: 50%;
266
- transition: all 0.3s linear;
267
- &:focus,
268
- &:hover {
269
- transform: scale(1.2, 1.2) rotate(15deg);
270
- }
271
- }
272
-
273
- .content {
274
- width: fit-content;
275
- max-width: 50vw;
276
- font-weight: 400;
277
- font-size: 1rem;
278
- color: #4c4c4d;
279
- padding: 10px;
280
- border-radius: 10px;
281
- position: relative;
282
- background-color: #ffffff;
283
-
284
- .href {
285
- cursor: pointer;
286
- display: block;
287
- color: #ff575f;
288
-
289
- &:not(:last-child) {
290
- margin-bottom: 1.5rem;
291
- }
292
-
293
- &:hover {
294
- text-decoration: underline;
295
- }
296
- }
297
-
298
- > .based {
299
- cursor: pointer;
300
- font-size: 1rem;
301
- font-weight: 400;
302
- color: #909399;
303
- display: flex;
304
- align-items: flex-start;
305
- justify-content: flex-start;
306
- border-top: 1px solid #ebebed;
307
- padding-top: 0.625rem;
308
- margin-top: 0.625rem;
309
- gap: 0.625rem;
310
-
311
- & > span:first-child {
312
- white-space: nowrap;
313
- color: #4c4c4d;
314
- border-radius: 18px;
315
- background-color: #eeeef0;
316
- padding: 0.1875rem 0.625rem;
317
- margin-top: -0.1875rem;
318
- }
319
-
320
- & > span:last-child {
321
- width: 100%;
322
- position: relative;
323
- display: inline-block;
324
- overflow: hidden;
325
- white-space: nowrap;
326
- text-overflow: ellipsis;
327
- padding-right: 12px;
328
-
329
- .el-icon-d-arrow-right {
330
- position: absolute;
331
- right: 0px;
332
- bottom: 0px;
333
- transform: rotate(90deg);
334
- transition: all 0.35s linear;
335
- }
336
- &.is-active {
337
- overflow: visible;
338
- white-space: normal;
339
- .el-icon-d-arrow-right {
340
- transform: rotate(270deg);
341
- }
342
- }
343
-
344
- &:hover {
345
- color: #ff575f;
346
- }
347
- }
348
- }
349
- }
350
-
351
- &.admin {
352
- animation: animation01 0.3s linear 1.5s forwards;
353
-
354
- .content {
355
- margin-top: 20px;
356
-
357
- &::before {
358
- content: "";
359
- position: absolute;
360
- top: 2px;
361
- left: -10px;
362
- transform: rotate(-45deg);
363
- border-width: 10px;
364
- border-style: solid;
365
- border-color: transparent transparent transparent #fff;
366
- }
367
-
368
- &::after {
369
- content: attr(data-before);
370
- width: 200px;
371
- font-size: 0.875rem;
372
- font-family: Source Han Sans CN-Medium, Source Han Sans CN;
373
- font-weight: 500;
374
- color: #8b8c8f;
375
- position: absolute;
376
- left: 0px;
377
- top: -20px;
378
- }
379
- }
380
- }
381
-
382
- &.personal {
383
- animation: animation01 0.3s linear 0.3s forwards;
384
- flex-direction: row-reverse;
385
-
386
- .content::after {
387
- content: "";
388
- position: absolute;
389
- top: 2px;
390
- right: -10px;
391
- transform: rotate(-45deg);
392
- border-width: 10px;
393
- border-style: solid;
394
- border-color: transparent transparent #ffffff transparent;
395
- }
396
- }
397
-
398
- @keyframes animation01 {
399
- 0% {
400
- transform: translateY(20px);
401
- opacity: 0;
402
- }
403
-
404
- 100% {
405
- transform: translateY(0px);
406
- opacity: 1;
407
- }
408
- }
409
- }
410
- }
411
-
412
- footer {
413
- height: 30vh;
414
- border: 1px solid #e7e7ea;
415
-
416
- > .el-textarea {
417
- border-color: transparent;
418
-
419
- textarea {
420
- overflow-y: hidden;
421
- // padding-right: 65px;
422
- font-weight: 400;
423
- color: #19191a;
424
- font-size: 1rem;
425
- font-family: Source Han Sans CN-Regular, Source Han Sans CN;
426
- }
427
-
428
- textarea,
429
- textarea:focus {
430
- border-color: transparent;
431
- }
432
- }
433
-
434
- > .el-button {
435
- float: right;
436
- // position: absolute;
437
- // bottom: 40px;
438
- // right: 40px;
439
- z-index: 1;
440
- font-size: 0.875rem;
441
- font-family: Source Han Sans CN-Regular, Source Han Sans CN;
442
- font-weight: 400;
443
- border-radius: 4px;
444
- margin-right: 2vw;
445
- width: 5vw;
446
- min-width: 92px;
447
- }
448
- }
449
- }
450
-
451
- aside {
452
- width: 26vw;
453
- height: calc(100vh - 8vw);
454
- padding: 1vw;
455
- overflow-y: auto;
456
- background-color: #ffffff;
457
-
458
- .el-collapse-item__header {
459
- color: #373a3c;
460
- font-size: 1.5rem;
461
- font-weight: 500;
462
- font-family: Source Han Sans CN-Medium, Source Han Sans CN;
463
- padding: 2rem;
464
- background-color: #f00;
465
- background: linear-gradient(#ffdad4, #ffa9a3);
466
-
467
- &.is-active {
468
- color: #ffffff;
469
- background: linear-gradient(#ff897a, #ff645a);
470
-
471
- i {
472
- color: #ffffff;
473
- }
474
- }
475
-
476
- img {
477
- width: 2.25rem;
478
- height: 2.25rem;
479
- float: left;
480
- margin-left: -0.5rem;
481
- margin-right: 0.5rem;
482
- }
483
-
484
- i {
485
- font-size: 2rem;
486
- color: #ff575f;
487
- font-weight: 900;
488
- }
489
- }
490
-
491
- .el-collapse-item__content {
492
- font-size: 1rem;
493
- font-family: Source Han Sans CN-Regular, Source Han Sans CN;
494
- font-weight: 400;
495
- padding: 20px 20px 20px 40px;
496
- color: #000000;
497
- background-color: #f7f7f9;
498
-
499
- > div {
500
- position: relative;
501
- margin-top: 1rem;
502
- cursor: pointer;
503
- transition: all 0.3s linear;
504
-
505
- &:first-child {
506
- margin-top: 0px;
507
- }
508
-
509
- &::before {
510
- content: "";
511
- position: absolute;
512
- top: 5px;
513
- left: -15px;
514
- // transform: rotate(-45deg);
515
- // float: left;
516
- border-width: 10px;
517
- border-style: solid;
518
- border-color: transparent transparent transparent #ffa9a3;
519
- }
520
-
521
- &:hover {
522
- color: #ff575f;
523
- transform: translate(0.5rem);
524
-
525
- &::before {
526
- border-color: transparent transparent transparent #ff575f;
527
- }
528
- }
529
- }
530
- }
531
- }
532
- }
533
- }
534
- }
535
- </style>
@@ -1,104 +0,0 @@
1
- <template>
2
- <el-dialog
3
- :title="title"
4
- :visible="isShow"
5
- width="350px"
6
- :append-to-body="true"
7
- @close="handleClose"
8
- >
9
- <slide-verify
10
- ref="slideblock"
11
- :l="42"
12
- :r="10"
13
- :w="310"
14
- :h="155"
15
- :imgs="imgs"
16
- :accuracy="accuracy"
17
- :slider-text="sliderText"
18
- @success="onSuccess"
19
- @fail="onFail"
20
- @again="onAgain"
21
- @refresh="onRefresh"
22
- @fulfilled="onFulfilled"
23
- ></slide-verify>
24
- </el-dialog>
25
- </template>
26
-
27
- <script>
28
- import SlideVerify from "vue-monoplasty-slide-verify/src/lib/slide-verify";
29
- export default {
30
- name: "YcSlideVerify",
31
- components: {
32
- SlideVerify,
33
- },
34
- props: {
35
- title: {
36
- type: String,
37
- default: "滑动验证",
38
- },
39
- isShow: {
40
- type: Boolean,
41
- default: true,
42
- },
43
- },
44
- data() {
45
- return {
46
- accuracy: 5,
47
- sliderText: "拖动完成上方拼图",
48
- countDownNum: 120,
49
- };
50
- },
51
- computed: {
52
- imgs() {
53
- const list = [];
54
- for (let i = 1; i < 9; i++) {
55
- list.push(`/cloud-img/${i}.jpg`);
56
- }
57
- return list;
58
- },
59
- },
60
- watch: {
61
- isShow(newVal) {
62
- // 这里第三方引用,ref没有渲染完成,reset报错,还不能用?号
63
- newVal &&
64
- this.$refs.slideblock &&
65
- this.$refs.slideblock.reset &&
66
- this.$refs.slideblock.reset();
67
- },
68
- },
69
- created() {},
70
- methods: {
71
- onSuccess() {
72
- this.$emit("success");
73
- this.$emit("update:isShow", false);
74
- },
75
- onFail() {},
76
- onAgain() {},
77
- onRefresh() {},
78
- onFulfilled() {},
79
- handleClose() {
80
- this.$emit("update:isShow", false);
81
- this.$emit("close");
82
- },
83
- },
84
- };
85
- </script>
86
- <style lang="scss" scoped>
87
- .el-dialog__wrapper {
88
- display: flex;
89
- justify-content: center;
90
- align-items: center;
91
- }
92
- ::v-deep .el-dialog {
93
- margin-top: 0 !important;
94
- border-radius: 8px;
95
- }
96
- ::v-deep .el-dialog__header {
97
- background-color: #f2f6fc;
98
- border-radius: 8px 8px 0 0;
99
- }
100
- .el-dialog__body {
101
- display: flex;
102
- justify-content: center;
103
- }
104
- </style>
package/src/main.js DELETED
@@ -1,19 +0,0 @@
1
- import "core-js"; // IE
2
- // import "current-script-polyfill"; // IE
3
- import Vue from "vue";
4
- import App from "./App.vue";
5
- import router from "./router";
6
-
7
- // import SlideVerify from "vue-monoplasty-slide-verify"
8
- import ElementUI from "element-ui";
9
- import "element-ui/lib/theme-chalk/index.css";
10
-
11
- Vue.config.productionTip = false;
12
-
13
- // Vue.use(SlideVerify)
14
- Vue.use(ElementUI);
15
-
16
- new Vue({
17
- render: (h) => h(App),
18
- router,
19
- }).$mount("#yc-ui2");
@@ -1,29 +0,0 @@
1
- import YcSlideVerify from 'comp/YcSlideVerify'
2
- import YcCustomerService from 'comp/YcCustomerService'
3
- import YcQuestion from 'comp/YcQuestion'
4
- import YcCA from 'comp/YcCA'
5
-
6
-
7
- const components = [
8
- YcSlideVerify,
9
- YcCustomerService,
10
- YcQuestion,
11
- YcCA
12
- ]
13
- // 定义 install 方法,接收 Vue 作为参数。如果使用 use 注册插件,则所有的组件都将被注册
14
- const install = function (Vue) {
15
- // 遍历注册全局组件
16
- components.forEach(component => {
17
- Vue.component(component.name, component)
18
- })
19
-
20
- // 判断是否是直接引入文件,如果是,就不用调用 Vue.use()
21
- if (typeof window !== 'undefined' && window.Vue) {
22
- install(window.Vue)
23
- }
24
- }
25
-
26
- // 导出的对象必须具有 install,才能被 Vue.use() 方法安装
27
- export default {
28
- install
29
- }
@@ -1,20 +0,0 @@
1
- import Vue from "vue"
2
- import VueRouter from "vue-router"
3
-
4
- Vue.use(VueRouter)
5
-
6
- const routes = [
7
- {
8
- path: "/question",
9
- component: (resolve) => require(['views/question.vue'], resolve),
10
- hidden: true,
11
- },
12
- ]
13
-
14
- const router = new VueRouter({
15
- routes,
16
- mode: "history", // 去掉url中的#
17
- scrollBehavior: () => ({ y: 0 })
18
- })
19
-
20
- export default router
package/src/utils/auth.js DELETED
@@ -1,6 +0,0 @@
1
- export function getCookie(name) {
2
- const value = `; ${document.cookie}`
3
- const parts = value.split(`; ${name}=`)
4
- if (parts.length === 2) return parts.pop().split(";").shift()
5
- return null
6
- }