ai-chat-bot-interface 1.6.10 → 1.6.12

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.6.10",
4
+ "version": "1.6.12",
5
5
  "type": "module",
6
6
  "main": "index.js",
7
7
  "description": "A AI chat bot interface. (private)",
package/src/App.vue CHANGED
@@ -10,7 +10,7 @@ const handleLog = (log) => {
10
10
  <chat-ui
11
11
  bot-id="7574379096097439754"
12
12
  token="sat_cSmj7ZyuePbkEpOKR7F259YuIfp2fjX9rJ3Om2O0gB9JzrGjAk8pSL269rbu8kzr"
13
- uid="262598"
13
+ uid="0"
14
14
  :def-msg="{ placeholder: '发消息...' }"
15
15
  :show-header="false"
16
16
  :card-list="{ dishes: true, personalForm: true }"
@@ -68,6 +68,9 @@
68
68
  {{ materialText }}
69
69
  </div>
70
70
  <div class="title">制作工艺</div>
71
+ <div v-if="info.skuVideo">
72
+ <video :src="info.skuVideo" width="100%" controls="true" />
73
+ </div>
71
74
  <div
72
75
  v-for="(item, index) in info.makeCraftList"
73
76
  :key="index"
@@ -77,8 +80,16 @@
77
80
  <div class="num">第{{ index + 1 }}步</div>
78
81
  <div class="desc">{{ item.content }}</div>
79
82
  </div>
83
+ <div>
84
+ <img
85
+ v-for="(img, index) in getImageList(item.craftImg)"
86
+ :key="index"
87
+ :src="img"
88
+ width="100%"
89
+ alt="step image"
90
+ />
91
+ </div>
80
92
  </div>
81
-
82
93
  <div class="collapse_btn" @click.stop="isOpen = false">收起</div>
83
94
  </div>
84
95
  </div>
@@ -108,9 +119,13 @@ const contentRef = ref(null); // 用于引用内容 DOM 元素
108
119
  const contentHeight = ref(0); // 存储内容的实际高度
109
120
 
110
121
  onMounted(() => {
111
- contentHeight.value = hasDetails.value ? contentRef.value.scrollHeight : 0;
122
+ getContentHeight();
112
123
  });
113
124
 
125
+ const getContentHeight = () => {
126
+ contentHeight.value = hasDetails.value ? contentRef.value.scrollHeight : 0;
127
+ };
128
+
114
129
  // const Emits = defineEmits(['update:open']);
115
130
 
116
131
  const subStr = computed(() => {
@@ -140,8 +155,22 @@ const previewImg = (url) => {
140
155
  };
141
156
 
142
157
  const switchOpen = () => {
158
+ if (!isOpen.value) {
159
+ getContentHeight();
160
+ }
143
161
  isOpen.value = !isOpen.value;
144
162
  };
163
+
164
+ const getImageList = (str) => {
165
+ let list = [];
166
+ try {
167
+ list = JSON.parse(str);
168
+ } catch (e) {
169
+ console.warn('====== get image list error =======', e);
170
+ }
171
+
172
+ return list;
173
+ };
145
174
  </script>
146
175
 
147
176
  <style scoped lang="less">