yc-ui2 0.2.2-beta2 → 0.2.2-beta3

Sign up to get free protection for your applications and to get access to all the features.
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,337 +0,0 @@
1
- <template>
2
- <div class="chat" v-show="visible">
3
- <header>
4
- <img :src="require('assets/customerService/admin.jpg')" />
5
- <span>{{ title }}</span>
6
- <el-tooltip content="点击跳转至客服页面" placement="top" effect="light">
7
- <i class="icon-enlarge" v-if="jumpPage" @click="enlarge"
8
- ><img :src="require('assets/customerService/enlarge.png')"
9
- /></i>
10
- </el-tooltip>
11
- <i class="el-icon-close" @click="close"></i>
12
- </header>
13
- <main ref="main">
14
- <div
15
- v-for="(item, index) in messagelist"
16
- :key="index"
17
- :class="['message', item.id]"
18
- >
19
- <img
20
- class="avatar"
21
- :src="require(`assets/customerService/${item.id}.jpg`)"
22
- />
23
- <div class="content">
24
- <span
25
- v-for="({ msg, id, answerType }, index) in item.msg"
26
- :key="index"
27
- v-html="(item.msg.length > 1 ? 1 + index + '. ' : ' ') + msg + (answerType ? `《${answerType}》`: '')"
28
- :class="item.msg.length > 1 ? 'href' : ''"
29
- @click="item.msg.length > 1 && regularClick(msg, id)"
30
- ></span>
31
- <div class="based" v-if="item.based" @click="handExpand(item)">
32
- <span>依据</span
33
- ><span :class="{ 'is-active': item.isActive }"
34
- >{{ item.based }}<i class="el-icon-d-arrow-right"></i
35
- ></span>
36
- </div>
37
- </div>
38
- </div>
39
- </main>
40
- <nav>
41
- <el-button
42
- size="mini"
43
- round
44
- v-for="(item, index) in regular"
45
- :key="item + index"
46
- @click="regularClick(item)"
47
- >{{ item }}</el-button
48
- >
49
- </nav>
50
- <el-input
51
- type="textarea"
52
- maxlength="500"
53
- :autosize="{ minRows: 2, maxRows: 3 }"
54
- autofocus="true"
55
- resize="none"
56
- placeholder="请反馈您的问题,我们将尽快回复"
57
- v-model="textareaValue"
58
- @keyup.enter.native="carriageReturn"
59
- >
60
- </el-input>
61
- <!-- <el-button size="mini" type="primary">发送</el-button> -->
62
- <el-button
63
- type="primary"
64
- size="mini"
65
- :disabled="!textareaValue"
66
- @click="send"
67
- >发送</el-button
68
- >
69
- </div>
70
- </template>
71
- <script>
72
- import { findMaxNumData } from "api/customerService"
73
- import chatMixin from "./chatMixin"
74
- export default {
75
- name: "ChatMini",
76
- mixins: [chatMixin],
77
- watch: {
78
- id(newValue) {
79
- this.findMaxNumData(newValue)
80
- },
81
- },
82
- created() {
83
- this.findMaxNumData(this.id)
84
- },
85
- methods: {
86
- findMaxNumData(id) {
87
- if (id)
88
- findMaxNumData(id).then(({ data }) => {
89
- this.regular = data.map((item) => item.problem)
90
- })
91
- },
92
- },
93
- }
94
- </script>
95
- <style lang="scss" scoped>
96
- .chat {
97
- width: 350px;
98
- height: 480px;
99
- position: fixed;
100
- bottom: 10px;
101
- right: 55px;
102
- z-index: 2001;
103
- background-color: #ffffff;
104
- border-radius: 12px;
105
- border: 1px solid #e6ebf5;
106
- box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12), 0 0 6px rgba(0, 0, 0, 0.04);
107
- overflow: hidden;
108
- > header {
109
- display: flex;
110
- justify-content: flex-start;
111
- align-items: center;
112
- background-color: #ff575f;
113
- font-size: 16px;
114
- padding: 10px;
115
- font-weight: 400;
116
- color: #fafdff;
117
- > img {
118
- width: 44px;
119
- height: 44px;
120
- border-radius: 50%;
121
- margin-right: 10px;
122
- transition: all 0.3s linear;
123
- &:focus,
124
- &:hover {
125
- transform: scale(1.2, 1.2) rotate(15deg);
126
- }
127
- }
128
- i {
129
- cursor: pointer;
130
- position: absolute;
131
- top: 5px;
132
- width: 20px;
133
- height: 20px;
134
- border-radius: 6px;
135
- display: flex;
136
- justify-content: center;
137
- align-items: center;
138
- transition: all 0.3s linear;
139
- &:focus,
140
- &:hover {
141
- transform: scale(1.2, 1.2);
142
- background-color: rgba(255, 137, 122, 0.8);
143
- }
144
- &.el-icon-close {
145
- right: 10px;
146
- }
147
- &.icon-enlarge {
148
- right: 35px;
149
- }
150
- > img {
151
- width: 12px;
152
- }
153
- }
154
- }
155
-
156
- > main {
157
- width: 100%;
158
- height: 60%;
159
- overflow-y: auto;
160
- padding-bottom: 20px;
161
- background-color: #f7f7f9;
162
- // 滚动条宽度
163
- &::-webkit-scrollbar {
164
- width: 6px;
165
- }
166
- // 滚动条轨道
167
- &::-webkit-scrollbar-track {
168
- background: rgb(239, 239, 239);
169
- border-radius: 2px;
170
- }
171
- // 小滑块
172
- &::-webkit-scrollbar-thumb {
173
- background: #ff8879;
174
- border-radius: 10px;
175
- }
176
- &::-webkit-scrollbar-thumb:hover {
177
- background: #ff755d;
178
- }
179
- .message {
180
- display: flex;
181
- gap: 15px;
182
- position: relative;
183
- margin: 20px 5px 0px 5px;
184
- opacity: 0;
185
- .avatar {
186
- width: 30px;
187
- height: 30px;
188
- border-radius: 50%;
189
- }
190
- .content {
191
- width: fit-content;
192
- max-width: 250px;
193
- font-weight: 400;
194
- font-size: 12px;
195
- color: #4c4c4d;
196
- line-height: 20px;
197
- padding: 10px;
198
- border-radius: 10px;
199
- background-color: #ffffff;
200
- .href {
201
- cursor: pointer;
202
- display: block;
203
- color: #ff575f;
204
- &:not(:last-child) {
205
- margin-bottom: 0.5rem;
206
- }
207
- &:hover {
208
- text-decoration: underline;
209
- }
210
- }
211
-
212
- > .based {
213
- cursor: pointer;
214
- color: #909399;
215
- display: flex;
216
- align-items: flex-start;
217
- justify-content: flex-start;
218
- border-top: 1px solid #ebebed;
219
- padding-top: 5px;
220
- margin-top: 5px;
221
- gap: 5px;
222
-
223
- & > span:first-child {
224
- white-space: nowrap;
225
- color: #4c4c4d;
226
- border-radius: 10px;
227
- background-color: #eeeef0;
228
- padding: 0px 7px;
229
- }
230
-
231
- & > span:last-child {
232
- width: 100%;
233
- position: relative;
234
- display: inline-block;
235
- overflow: hidden;
236
- white-space: nowrap;
237
- text-overflow: ellipsis;
238
- padding-right: 12px;
239
-
240
- .el-icon-d-arrow-right {
241
- position: absolute;
242
- right: 0px;
243
- bottom: 5px;
244
- transform: rotate(90deg);
245
- transition: all 0.35s linear;
246
- }
247
- &.is-active {
248
- overflow: visible;
249
- white-space: normal;
250
- .el-icon-d-arrow-right {
251
- transform: rotate(270deg);
252
- }
253
- }
254
-
255
- &:hover {
256
- color: #ff575f;
257
- }
258
- }
259
- }
260
- }
261
- &.admin {
262
- animation: animation01 0.3s linear 1.5s forwards;
263
- .content::before {
264
- content: "";
265
- position: absolute;
266
- top: 2px;
267
- left: 37px;
268
- transform: rotate(-45deg);
269
- border-width: 10px;
270
- border-style: solid;
271
- border-color: transparent transparent transparent #ffffff;
272
- }
273
- }
274
- &.personal {
275
- animation: animation01 0.3s linear 0.3s forwards;
276
- flex-direction: row-reverse;
277
- .content::after {
278
- content: "";
279
- position: absolute;
280
- top: 2px;
281
- right: 37px;
282
- transform: rotate(-45deg);
283
- border-width: 10px;
284
- border-style: solid;
285
- border-color: transparent transparent #ffffff transparent;
286
- }
287
- }
288
- @keyframes animation01 {
289
- 0% {
290
- transform: translateY(20px);
291
- opacity: 0;
292
- }
293
-
294
- 100% {
295
- transform: translateY(0px);
296
- opacity: 1;
297
- }
298
- }
299
- }
300
- }
301
- > nav {
302
- overflow-x: auto;
303
- background-color: #f7f7f9;
304
- border-bottom: 1px solid #e7e7ea;
305
- padding: 5px 10px;
306
- display: flex;
307
- .el-button {
308
- font-size: 12px;
309
- font-weight: 400;
310
- color: #4c4c4d;
311
- background-color: #fff !important;
312
- border: 1px solid #e7e7ea;
313
- padding: 5px 8px;
314
- }
315
- }
316
- > .el-textarea {
317
- border-color: transparent;
318
- textarea {
319
- overflow-y: hidden;
320
- padding-right: 65px;
321
- font-weight: 400;
322
- color: #19191a;
323
- font-size: 12px;
324
- font-family: Source Han Sans CN-Regular, Source Han Sans CN;
325
- }
326
- textarea,
327
- textarea:focus {
328
- border-color: transparent;
329
- }
330
- }
331
- > .el-button {
332
- position: absolute;
333
- bottom: 10px;
334
- right: 10px;
335
- }
336
- }
337
- </style>
@@ -1,128 +0,0 @@
1
- import { findDataByProblem } from "api/customerService";
2
- export default {
3
- props: {
4
- visible: Boolean,
5
- jumpPage: String,
6
- title: String,
7
- commit: String,
8
- id: {
9
- default: 0,
10
- type: Number,
11
- },
12
- },
13
- data() {
14
- return {
15
- textareaValue: "",
16
- regular: [
17
- /*'发票增值税率', '城市维护建设税', '教育费附加征收率'*/
18
- ],
19
- messagelist: [
20
- {
21
- id: "admin",
22
- msg: [
23
- {
24
- msg: `您好,很高兴为你服务!`,
25
- },
26
- ],
27
- isActive: false,
28
- },
29
- // {id: 'personal', msg: ['消费税?']}
30
- ],
31
- isActive: false,
32
- };
33
- },
34
- computed: {
35
- questions() {
36
- return JSON.parse(this.json);
37
- },
38
- },
39
- methods: {
40
- close() {
41
- this.$emit("update:visible", false);
42
- },
43
- carriageReturn() {
44
- let e = window.event || arguments[0];
45
- if (
46
- (e.key == "Enter" || e.code == "Enter" || e.keyCode == 13) &&
47
- this.textareaValue
48
- ) {
49
- this.send();
50
- }
51
- },
52
- send() {
53
- if (!this.textareaValue.replace(/[^\w\u4E00-\u9FA5]/g, "")) return;
54
-
55
- this.add(this.textareaValue, "personal", () => {
56
- this.textareaValue = "";
57
- });
58
- this.search(this.textareaValue);
59
- },
60
- regularClick(msg, id) {
61
- this.add([{ msg, id }]);
62
- this.search(msg, id);
63
- },
64
- search(msg, id) {
65
- const parameter = {
66
- aiServiceId: 1,
67
- problem: msg.replace(/\n/g, ""),
68
- };
69
- id && (parameter["id"] = id);
70
- findDataByProblem(parameter).then(({ data }) => {
71
- this.add(
72
- (() => {
73
- if (data) {
74
- return data.length > 1
75
- ? data.reduce(
76
- (prev, { problem, id, answerType }) => [
77
- ...prev,
78
- {
79
- msg: problem,
80
- id,
81
- answerType,
82
- },
83
- ],
84
- []
85
- )
86
- : data[0].answer || "您好";
87
- } else {
88
- return "您好";
89
- }
90
- })(),
91
- "admin",
92
- null,
93
- (() => {
94
- if (data && data.length == 1) {
95
- return data[0].based;
96
- } else {
97
- return "";
98
- }
99
- })()
100
- );
101
- });
102
- },
103
- add(msg, id = "personal", fun, based = "") {
104
- this.messagelist.push({
105
- id,
106
- msg: Array.isArray(msg) ? msg : [{ msg }],
107
- based,
108
- isActive: false,
109
- });
110
- this.$nextTick(() => {
111
- fun && fun();
112
- // this.$refs.main.scrollTop += 70
113
- this.$refs.main.scrollTop = this.$refs.main.scrollHeight;
114
- // console.log(this.$refs.main.scrollTop, this.$refs.main.scrollHeight)
115
- });
116
- },
117
- enlarge() {
118
- // this.$router.resolve({
119
- // name: this.jumpPage
120
- // })
121
-
122
- window.open(this.jumpPage, "_blank");
123
- },
124
- handExpand(item) {
125
- item.isActive = !item.isActive;
126
- },
127
- },
128
- };