|
@@ -5,9 +5,7 @@
|
|
|
<div class="cahtText">你好!</div>
|
|
|
</div>
|
|
|
<div class="chat chatRight">
|
|
|
- <div class="cahtText">
|
|
|
- 你好!
|
|
|
- </div>
|
|
|
+ <div class="cahtText">你好!</div>
|
|
|
<van-image width="35px" height="35px" fit="contain" :src="user" />
|
|
|
</div>
|
|
|
<van-field
|
|
@@ -30,6 +28,8 @@
|
|
|
import robot from '../../assets/img/chat/robot_2.png';
|
|
|
import user from '../../assets/img/chat/user.png';
|
|
|
import { ref } from 'vue';
|
|
|
+
|
|
|
+import { ChartGpt } from '@/api/chatGpt';
|
|
|
// import { onMounted, reactive } from "vue";
|
|
|
// import { isIpad, isIpod, isIphone } from "../../utils/isTerminal";
|
|
|
/**
|
|
@@ -40,7 +40,13 @@ import { ref } from 'vue';
|
|
|
console.log(window.$originData);
|
|
|
const inputText = ref('');
|
|
|
function saveText() {
|
|
|
+ if (!inputText.value) return;
|
|
|
console.log(inputText.value);
|
|
|
+ ChartGpt({
|
|
|
+ prompt: inputText.value,
|
|
|
+ }).then(r => {
|
|
|
+ console.log(r);
|
|
|
+ });
|
|
|
}
|
|
|
</script>
|
|
|
<style lang="scss">
|
|
@@ -60,7 +66,7 @@ function saveText() {
|
|
|
left: 0;
|
|
|
.van-field__control {
|
|
|
background-color: #ffffff;
|
|
|
- padding: .4em;
|
|
|
+ padding: 0.4em;
|
|
|
}
|
|
|
}
|
|
|
|