ai-chat-bot-interface 1.1.5 → 1.1.7

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.1.5",
4
+ "version": "1.1.7",
5
5
  "type": "module",
6
6
  "main": "index.js",
7
7
  "description": "A AI chat bot interface. (private)",
package/src/App.vue CHANGED
@@ -4,7 +4,7 @@ import ChatUi from './ChatUi.vue';
4
4
 
5
5
  <template>
6
6
  <div style="width: 100vw; height: 100vh">
7
- <chat-ui bot-id="0000" token="pat_888" uid="262598" />
7
+ <chat-ui bot-id="00" token="pat_08888" uid="262598" />
8
8
  </div>
9
9
  </template>
10
10
  <style></style>
package/src/ChatUi.less CHANGED
@@ -244,3 +244,29 @@
244
244
  text-align: center;
245
245
  }
246
246
  }
247
+
248
+ .btn {
249
+ cursor: pointer;
250
+ width: 100%;
251
+ line-height: 22px;
252
+ box-sizing: border-box;
253
+ background-color: #e6f5eb;
254
+ border-radius: 19px;
255
+ text-align: center;
256
+ font-weight: 600;
257
+ font-size: 13px;
258
+ color: #039938;
259
+ margin-top: 15px;
260
+
261
+ &_2 {
262
+ color: #fff;
263
+ background-color: #039938;
264
+ }
265
+
266
+ &_group {
267
+ display: grid;
268
+ grid-template-columns: 1fr;
269
+ grid-column-gap: 10px;
270
+ margin-top: 20px;
271
+ }
272
+ }
package/src/ChatUi.vue CHANGED
@@ -63,27 +63,37 @@
63
63
  <div class="box">
64
64
  <template v-if="conv.content">
65
65
  <p class="text" v-html="conv.content"></p>
66
- <div v-if="conv.extra.length && !isAnswering">
67
- <template v-for="(comp, idx) in conv.extra" :key="idx">
68
- <!-- <p
69
- v-if="comp.showType === 'plan' && comp.planParse"
70
- class="text"
71
- style="margin-top: 1em"
66
+ <template v-if="!isAnswering">
67
+ <div v-if="conv.extra.length">
68
+ <template v-for="(comp, idx) in conv.extra" :key="idx">
69
+ <!-- <p
70
+ v-if="comp.showType === 'plan' && comp.planParse"
71
+ class="text"
72
+ style="margin-top: 1em"
73
+ >
74
+ {{ comp.planParse }}
75
+ </p>-->
76
+ <dishes-list
77
+ v-if="comp.showType === 'card'"
78
+ :sku-list="comp.skuList"
79
+ @select="(data) => handleCardTap(data, comp)"
80
+ />
81
+ <plan-card
82
+ v-if="comp.showType === 'plan'"
83
+ :info="comp"
84
+ @select="handleCardTap({ type: 'match' }, comp)"
85
+ />
86
+ </template>
87
+ </div>
88
+ <div v-else-if="handleTextNeedBtn(conv.content)">
89
+ <div
90
+ class="btn btn_2"
91
+ @click.stop="handleCardTap({ type: 'match' }, {})"
72
92
  >
73
- {{ comp.planParse }}
74
- </p>-->
75
- <dishes-list
76
- v-if="comp.showType === 'card'"
77
- :sku-list="comp.skuList"
78
- @select="(data) => handleCardTap(data, comp)"
79
- />
80
- <plan-card
81
- v-if="comp.showType === 'plan'"
82
- :info="comp"
83
- @select="handleCardTap({ type: 'match' }, comp)"
84
- />
85
- </template>
86
- </div>
93
+ 用該方案配餐
94
+ </div>
95
+ </div>
96
+ </template>
87
97
  </template>
88
98
  <loading-icon2 v-else />
89
99
  </div>
@@ -571,6 +581,11 @@ const scrollToEnd = () => {
571
581
  endTarget.value.scrollIntoView();
572
582
  });
573
583
  };
584
+
585
+ const handleTextNeedBtn = (str) => {
586
+ const regExp = /#全日總熱量:(\d*?)kcal/g;
587
+ return regExp.test(str);
588
+ };
574
589
  </script>
575
590
 
576
591
  <style scoped lang="less">