ai-chat-bot-interface 1.4.1 → 1.4.3

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ai-chat-bot-interface",
3
3
  "private": false,
4
- "version": "1.4.1",
4
+ "version": "1.4.3",
5
5
  "type": "module",
6
6
  "main": "index.js",
7
7
  "description": "A AI chat bot interface. (private)",
package/src/App.vue CHANGED
@@ -5,7 +5,7 @@ import ChatUi from './ChatUi.vue';
5
5
  <template>
6
6
  <div style="width: 100vw; height: 100vh">
7
7
  <chat-ui
8
- bot-id="555"
8
+ bot-id="5555"
9
9
  token="pat_88888"
10
10
  uid="262598"
11
11
  :def-msg="{ placeholder: '发消息...' }"
@@ -1,6 +1,11 @@
1
1
  <template>
2
2
  <div class="dishes_wrap" @click.stop="testFunc">
3
- <img class="img" :src="info.primaryImgUrl" alt="img" />
3
+ <img
4
+ class="img"
5
+ :src="info.primaryImgUrl"
6
+ alt="img"
7
+ @click.stop="previewImg(info.primaryImgUrl)"
8
+ />
4
9
  <div>
5
10
  <div class="name">
6
11
  <span>{{ info.skuname }}</span>
@@ -13,6 +18,8 @@
13
18
 
14
19
  <script setup>
15
20
  import { computed } from 'vue';
21
+ import { api as viewerApi } from 'v-viewer';
22
+ import 'viewerjs/dist/viewer.css';
16
23
 
17
24
  const props = defineProps({
18
25
  info: {
@@ -24,6 +31,12 @@ const props = defineProps({
24
31
  const subStr = computed(() => {
25
32
  return `熱量${props.info.energy}kcal,蛋白質${props.info.protein}g,脂肪${props.info.fat}g,碳水${props.info.carbonwater}g`;
26
33
  });
34
+
35
+ const previewImg = (url) => {
36
+ viewerApi({
37
+ images: [url],
38
+ });
39
+ };
27
40
  </script>
28
41
 
29
42
  <style scoped lang="less">
@@ -40,6 +53,7 @@ const subStr = computed(() => {
40
53
  margin: 10px 0;
41
54
 
42
55
  .img {
56
+ cursor: pointer;
43
57
  width: 100%;
44
58
  border-radius: 8px;
45
59
  }
@@ -61,22 +61,6 @@ const previewImg = ({ url }) => {
61
61
  images.value = [url];
62
62
  viewerApi({
63
63
  images: images.value,
64
- options: {
65
- navbar: false,
66
- toolbar: {
67
- flipHorizontal: false,
68
- flipVertical: false,
69
- next: false,
70
- prev: false,
71
- play: false,
72
- reset: true,
73
- oneToOne: true,
74
- rotateLeft: true,
75
- rotateRight: true,
76
- zoomIn: true,
77
- zoomOut: true,
78
- },
79
- },
80
64
  });
81
65
  };
82
66
  </script>
@@ -7,17 +7,27 @@
7
7
  width="100%"
8
8
  :src="info.file_url"
9
9
  :alt="info.name"
10
+ @click.stop="previewImg"
10
11
  />
11
12
  </div>
12
13
  </template>
13
14
 
14
15
  <script setup>
16
+ import { api as viewerApi } from 'v-viewer';
17
+ import 'viewerjs/dist/viewer.css';
18
+
15
19
  const props = defineProps({
16
20
  list: {
17
21
  type: Array,
18
22
  required: true,
19
23
  },
20
24
  });
25
+
26
+ const previewImg = () => {
27
+ viewerApi({
28
+ images: props.list.map((item) => item.file_url),
29
+ });
30
+ };
21
31
  </script>
22
32
 
23
33
  <style scoped lang="less">
@@ -27,6 +37,7 @@ const props = defineProps({
27
37
  justify-content: right;
28
38
  padding: 10px 0;
29
39
  .img {
40
+ cursor: pointer;
30
41
  }
31
42
  &.grid_1 {
32
43
  grid-template-columns: 200px;
package/src/main.js CHANGED
@@ -1,5 +1,25 @@
1
- import { createApp } from 'vue';
2
- import './style.css';
3
- import App from './App.vue';
4
-
5
- createApp(App).mount('#app');
1
+ import { createApp } from 'vue';
2
+ import './style.css';
3
+ import App from './App.vue';
4
+ import VueViewer from 'v-viewer';
5
+
6
+ createApp(App)
7
+ .use(VueViewer, {
8
+ defaultOptions: {
9
+ navbar: false,
10
+ toolbar: {
11
+ flipHorizontal: false,
12
+ flipVertical: false,
13
+ next: false,
14
+ prev: false,
15
+ play: false,
16
+ reset: true,
17
+ oneToOne: true,
18
+ rotateLeft: true,
19
+ rotateRight: true,
20
+ zoomIn: true,
21
+ zoomOut: true,
22
+ },
23
+ },
24
+ })
25
+ .mount('#app');