ai-chat-bot-interface 1.7.8 → 1.7.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.
- package/dist/ai-chat-bot-interface.css +9 -0
- package/dist/ai-chat-bot-interface.es.js +13340 -0
- package/dist/ai-chat-bot-interface.umd.js +111 -0
- package/dist/src/index.d.ts +0 -0
- package/package.json +26 -5
- package/.prettierignore +0 -5
- package/.prettierrc.cjs +0 -37
- package/.vscode/extensions.json +0 -3
- package/index.html +0 -13
- package/index.js +0 -11
- package/src/App.vue +0 -39
- package/src/ChatUi.less +0 -301
- package/src/ChatUi.vue +0 -1087
- package/src/assets/styles/public.less +0 -152
- package/src/assets/vue.svg +0 -1
- package/src/components/DishesCard.vue +0 -369
- package/src/components/DishesList.vue +0 -218
- package/src/components/MarkdownPlan/MarkdownViewer.vue +0 -34
- package/src/components/OperateModule.less +0 -186
- package/src/components/OperateModule.vue +0 -392
- package/src/components/PlanCard.vue +0 -114
- package/src/components/StoreList/StoreCard.vue +0 -72
- package/src/components/StoreList/StoreList.vue +0 -27
- package/src/components/StoreList/mock.js +0 -411
- package/src/components/assistantReplay/assistantReplay.vue +0 -78
- package/src/components/icons/ArrowDown.vue +0 -26
- package/src/components/icons/ArrowRight.vue +0 -19
- package/src/components/icons/BackIcon.vue +0 -19
- package/src/components/icons/ClearIcon.vue +0 -18
- package/src/components/icons/CloseIcon.vue +0 -17
- package/src/components/icons/NewSessionIcon.vue +0 -20
- package/src/components/icons/OkIcon.vue +0 -26
- package/src/components/icons/SendIcon.vue +0 -22
- package/src/components/icons/ThinkingIcon.vue +0 -28
- package/src/components/icons/addIcon.vue +0 -18
- package/src/components/icons/cameraIcon.vue +0 -22
- package/src/components/icons/closeBorderIcon.vue +0 -35
- package/src/components/icons/fileIcon.vue +0 -18
- package/src/components/icons/loadingIcon.vue +0 -76
- package/src/components/icons/loadingIcon2.vue +0 -88
- package/src/components/icons/newChat.vue +0 -18
- package/src/components/icons/pictureIcon.vue +0 -22
- package/src/components/icons/processBar.vue +0 -115
- package/src/components/icons/progressRing.vue +0 -63
- package/src/components/icons/sendLoadingIcon.vue +0 -35
- package/src/components/icons/tagIcon.vue +0 -18
- package/src/components/imgeList.vue +0 -63
- package/src/components/personalForm/personalForm.vue +0 -634
- package/src/components/popup/popup.vue +0 -178
- package/src/main.js +0 -26
- package/src/style.css +0 -4
- package/src/utils/imagesViewer.js +0 -8
- package/src/utils/request.js +0 -52
- package/src/utils/tools.js +0 -20
- package/vite.config.js +0 -33
- /package/{public → dist}/vite.svg +0 -0
|
@@ -1,178 +0,0 @@
|
|
|
1
|
-
<script setup>
|
|
2
|
-
import { computed, ref, watch } from 'vue';
|
|
3
|
-
import ArrowDown from '../icons/ArrowDown.vue';
|
|
4
|
-
|
|
5
|
-
const props = defineProps({
|
|
6
|
-
show: {
|
|
7
|
-
type: Boolean,
|
|
8
|
-
default: false,
|
|
9
|
-
},
|
|
10
|
-
height: {
|
|
11
|
-
type: String,
|
|
12
|
-
default: '50vh',
|
|
13
|
-
},
|
|
14
|
-
title: {
|
|
15
|
-
type: String,
|
|
16
|
-
default: '',
|
|
17
|
-
},
|
|
18
|
-
});
|
|
19
|
-
const emit = defineEmits(['update:show', 'confirm', 'close']);
|
|
20
|
-
|
|
21
|
-
const visibleEle = ref(false);
|
|
22
|
-
const bottomPosi = ref(`-${props.height}`);
|
|
23
|
-
const animationInfo = ref({
|
|
24
|
-
delay: 300,
|
|
25
|
-
bottom: `-${props.height}`,
|
|
26
|
-
opacity: 0,
|
|
27
|
-
});
|
|
28
|
-
const handleAnimation = (type) => {
|
|
29
|
-
if (type) {
|
|
30
|
-
animationInfo.value.bottom = '0';
|
|
31
|
-
animationInfo.value.opacity = 0.5;
|
|
32
|
-
} else {
|
|
33
|
-
animationInfo.value.bottom = `-${props.height}`;
|
|
34
|
-
animationInfo.value.opacity = 0;
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
const handleConfirm = () => {
|
|
38
|
-
emit('confirm', {});
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
watch(
|
|
42
|
-
() => props.show,
|
|
43
|
-
(newVal, oldValue) => {
|
|
44
|
-
if (newVal) {
|
|
45
|
-
bottomPosi.value = `-${props.height}`;
|
|
46
|
-
visibleEle.value = true;
|
|
47
|
-
setTimeout(() => {
|
|
48
|
-
handleAnimation(true);
|
|
49
|
-
}, 0);
|
|
50
|
-
} else {
|
|
51
|
-
handleAnimation(false);
|
|
52
|
-
setTimeout(() => {
|
|
53
|
-
visibleEle.value = false;
|
|
54
|
-
}, 300);
|
|
55
|
-
}
|
|
56
|
-
},
|
|
57
|
-
);
|
|
58
|
-
const handleClose = () => {
|
|
59
|
-
emit('update:show', false);
|
|
60
|
-
handleAnimation(false);
|
|
61
|
-
setTimeout(() => {
|
|
62
|
-
visibleEle.value = false;
|
|
63
|
-
}, 300);
|
|
64
|
-
};
|
|
65
|
-
</script>
|
|
66
|
-
|
|
67
|
-
<template>
|
|
68
|
-
<div
|
|
69
|
-
v-if="visibleEle"
|
|
70
|
-
class="pup_mask"
|
|
71
|
-
:style="{
|
|
72
|
-
backgroundColor: `rgba(0, 0, 0, ${animationInfo.opacity})`,
|
|
73
|
-
}"
|
|
74
|
-
@click.stop="handleClose"
|
|
75
|
-
>
|
|
76
|
-
<div
|
|
77
|
-
class="pup_wrap"
|
|
78
|
-
:style="{ height: height, bottom: animationInfo.bottom }"
|
|
79
|
-
@click.stop="() => {}"
|
|
80
|
-
>
|
|
81
|
-
<div class="pup_header">
|
|
82
|
-
<div class="left">
|
|
83
|
-
<div class="icon_down" @click.stop="handleClose">
|
|
84
|
-
<arrow-down />
|
|
85
|
-
</div>
|
|
86
|
-
</div>
|
|
87
|
-
<div class="title">{{ title }}</div>
|
|
88
|
-
<div class="right">
|
|
89
|
-
<div class="btn" @click="handleConfirm">确定</div>
|
|
90
|
-
</div>
|
|
91
|
-
</div>
|
|
92
|
-
<div class="pup_content" :style="{ height: `calc(height - 56px)` }">
|
|
93
|
-
<slot />
|
|
94
|
-
</div>
|
|
95
|
-
</div>
|
|
96
|
-
</div>
|
|
97
|
-
</template>
|
|
98
|
-
|
|
99
|
-
<style scoped lang="less">
|
|
100
|
-
@delay: 200ms;
|
|
101
|
-
@headerHeight: 56px;
|
|
102
|
-
.pup {
|
|
103
|
-
&_mask {
|
|
104
|
-
transition: background-color @delay ease-in-out;
|
|
105
|
-
width: 100vw;
|
|
106
|
-
height: 100vh;
|
|
107
|
-
position: fixed;
|
|
108
|
-
top: 0;
|
|
109
|
-
left: 0;
|
|
110
|
-
z-index: 899;
|
|
111
|
-
}
|
|
112
|
-
&_wrap {
|
|
113
|
-
transition: bottom @delay ease-in-out;
|
|
114
|
-
width: 100%;
|
|
115
|
-
height: 50vh;
|
|
116
|
-
background: #fff;
|
|
117
|
-
border-radius: 16px 16px 0 0;
|
|
118
|
-
overflow: hidden;
|
|
119
|
-
position: absolute;
|
|
120
|
-
bottom: 0;
|
|
121
|
-
left: 0;
|
|
122
|
-
z-index: 900;
|
|
123
|
-
}
|
|
124
|
-
&_header {
|
|
125
|
-
display: flex;
|
|
126
|
-
flex-direction: row;
|
|
127
|
-
align-items: center;
|
|
128
|
-
justify-content: space-between;
|
|
129
|
-
height: @headerHeight;
|
|
130
|
-
line-height: @headerHeight;
|
|
131
|
-
background-color: #fff;
|
|
132
|
-
position: relative;
|
|
133
|
-
|
|
134
|
-
.icon_down {
|
|
135
|
-
padding: 0 16px;
|
|
136
|
-
font-size: 24px;
|
|
137
|
-
}
|
|
138
|
-
.title {
|
|
139
|
-
width: 100%;
|
|
140
|
-
text-align: center;
|
|
141
|
-
font-size: 16px;
|
|
142
|
-
font-weight: 600;
|
|
143
|
-
}
|
|
144
|
-
.left {
|
|
145
|
-
height: @headerHeight;
|
|
146
|
-
display: flex;
|
|
147
|
-
flex-direction: row;
|
|
148
|
-
align-items: center;
|
|
149
|
-
justify-content: flex-start;
|
|
150
|
-
position: absolute;
|
|
151
|
-
left: 0;
|
|
152
|
-
top: 0;
|
|
153
|
-
z-index: 5;
|
|
154
|
-
}
|
|
155
|
-
.right {
|
|
156
|
-
height: @headerHeight;
|
|
157
|
-
display: flex;
|
|
158
|
-
flex-direction: row;
|
|
159
|
-
align-items: center;
|
|
160
|
-
justify-content: flex-end;
|
|
161
|
-
position: absolute;
|
|
162
|
-
right: 0;
|
|
163
|
-
top: 0;
|
|
164
|
-
z-index: 5;
|
|
165
|
-
}
|
|
166
|
-
.btn {
|
|
167
|
-
cursor: pointer;
|
|
168
|
-
padding: 0 16px;
|
|
169
|
-
height: 32px;
|
|
170
|
-
line-height: 32px;
|
|
171
|
-
margin-right: 16px;
|
|
172
|
-
text-align: center;
|
|
173
|
-
border-radius: 16px;
|
|
174
|
-
background-color: #00dc4e;
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
</style>
|
package/src/main.js
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { createApp } from 'vue';
|
|
2
|
-
import './style.css';
|
|
3
|
-
import App from './App.vue';
|
|
4
|
-
import VueViewer from 'v-viewer';
|
|
5
|
-
import 'vant/lib/index.css';
|
|
6
|
-
|
|
7
|
-
createApp(App)
|
|
8
|
-
.use(VueViewer, {
|
|
9
|
-
defaultOptions: {
|
|
10
|
-
navbar: false,
|
|
11
|
-
toolbar: {
|
|
12
|
-
flipHorizontal: false,
|
|
13
|
-
flipVertical: false,
|
|
14
|
-
next: false,
|
|
15
|
-
prev: false,
|
|
16
|
-
play: false,
|
|
17
|
-
reset: true,
|
|
18
|
-
oneToOne: true,
|
|
19
|
-
rotateLeft: true,
|
|
20
|
-
rotateRight: true,
|
|
21
|
-
zoomIn: true,
|
|
22
|
-
zoomOut: true,
|
|
23
|
-
},
|
|
24
|
-
},
|
|
25
|
-
})
|
|
26
|
-
.mount('#app');
|
package/src/style.css
DELETED
package/src/utils/request.js
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
// 封装 fetch 函数
|
|
2
|
-
function customFetch(url, options = {}) {
|
|
3
|
-
// 默认配置
|
|
4
|
-
const defaultOptions = {
|
|
5
|
-
method: 'GET', // 默认为 GET 请求
|
|
6
|
-
headers: {
|
|
7
|
-
'Content-Type': 'application/json',
|
|
8
|
-
Accept: 'application/json',
|
|
9
|
-
},
|
|
10
|
-
body: null, // 默认没有请求体
|
|
11
|
-
credentials: 'same-origin', // 默认同源策略
|
|
12
|
-
mode: 'cors', // 默认跨域模式
|
|
13
|
-
cache: 'default', // 默认缓存策略
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
// 合并用户传入的选项和默认选项
|
|
17
|
-
const finalOptions = { ...defaultOptions, ...options };
|
|
18
|
-
|
|
19
|
-
console.log('====finalOptions====', finalOptions);
|
|
20
|
-
// 如果是 POST 请求,确保有 body
|
|
21
|
-
if (finalOptions.method.toUpperCase() === 'POST' && !finalOptions.body) {
|
|
22
|
-
throw new Error('POST request must have a body');
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
// 发送 fetch 请求
|
|
26
|
-
return fetch(url, finalOptions)
|
|
27
|
-
.then((response) => {
|
|
28
|
-
if (!response.ok) {
|
|
29
|
-
// 如果响应状态码不是 2xx,抛出错误
|
|
30
|
-
throw new Error(`HTTP error! status: ${response.status}`);
|
|
31
|
-
}
|
|
32
|
-
return response.json(); // 默认解析为 JSON
|
|
33
|
-
})
|
|
34
|
-
.catch((error) => {
|
|
35
|
-
console.error('Fetch error:', error);
|
|
36
|
-
throw error; // 向外抛出错误
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
// 使用封装的 fetch 函数发送 GET 请求
|
|
41
|
-
export function get(url, options = {}) {
|
|
42
|
-
return customFetch(url, { ...options, method: 'GET' });
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
// 使用封装的 fetch 函数发送 POST 请求
|
|
46
|
-
export function post(url, data = {}, options = {}) {
|
|
47
|
-
return customFetch(url, {
|
|
48
|
-
...options,
|
|
49
|
-
method: 'POST',
|
|
50
|
-
body: JSON.stringify(data),
|
|
51
|
-
});
|
|
52
|
-
}
|
package/src/utils/tools.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
export const useDeviceDetect = () => {
|
|
2
|
-
const device = {
|
|
3
|
-
isMobile: false,
|
|
4
|
-
isIOS: false,
|
|
5
|
-
isAndroid: false,
|
|
6
|
-
isPC: false,
|
|
7
|
-
};
|
|
8
|
-
const ua = navigator.userAgent;
|
|
9
|
-
const mobileRegex =
|
|
10
|
-
/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i;
|
|
11
|
-
const iosRegex = /iPhone|iPad|iPod/i;
|
|
12
|
-
// 移动端检测
|
|
13
|
-
device.isMobile = mobileRegex.test(ua);
|
|
14
|
-
// iOS检测
|
|
15
|
-
device.isIOS = iosRegex.test(ua) && !ua.match(/CriOS/);
|
|
16
|
-
// Android检测
|
|
17
|
-
device.isAndroid = /Android/i.test(ua);
|
|
18
|
-
device.isPC = !device.isMobile;
|
|
19
|
-
return device;
|
|
20
|
-
};
|
package/vite.config.js
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { defineConfig } from 'vite';
|
|
2
|
-
import vue from '@vitejs/plugin-vue';
|
|
3
|
-
import path from 'path';
|
|
4
|
-
|
|
5
|
-
// https://vite.dev/config/
|
|
6
|
-
export default defineConfig({
|
|
7
|
-
plugins: [vue()],
|
|
8
|
-
resolve: {
|
|
9
|
-
alias: {
|
|
10
|
-
'@': path.resolve(__dirname, 'src'),
|
|
11
|
-
},
|
|
12
|
-
},
|
|
13
|
-
css: {
|
|
14
|
-
preprocessorOptions: {
|
|
15
|
-
less: {
|
|
16
|
-
charset: false,
|
|
17
|
-
additionalData: ['@import "./src/assets/styles/public.less";'],
|
|
18
|
-
},
|
|
19
|
-
},
|
|
20
|
-
},
|
|
21
|
-
server: {
|
|
22
|
-
host: '0.0.0.0',
|
|
23
|
-
hmr: true,
|
|
24
|
-
proxy: {
|
|
25
|
-
'/api': {
|
|
26
|
-
// target: 'https://prodapi.weis1606.cn',
|
|
27
|
-
target: 'https://api.weis1606.cn/',
|
|
28
|
-
changeOrigin: true,
|
|
29
|
-
rewrite: (path) => path.replace(/^\/api/, '/api'),
|
|
30
|
-
},
|
|
31
|
-
},
|
|
32
|
-
},
|
|
33
|
-
});
|
|
File without changes
|