|
@@ -1,19 +1,26 @@
|
|
|
<script setup>
|
|
|
import { ref } from "vue";
|
|
|
+import { useRouter } from "vue-router";
|
|
|
import axios from "axios";
|
|
|
import Footer from "../components/Footer.vue";
|
|
|
|
|
|
+let router = useRouter();
|
|
|
let loading = ref(false);
|
|
|
let inputValue = ref("");
|
|
|
let skyImageUrl = ref("");
|
|
|
|
|
|
-function getValue() {
|
|
|
+function getValue(state) {
|
|
|
loading.value = true;
|
|
|
axios
|
|
|
.post(`https://cmm.ai:9101/tendentest?client_message=${inputValue.value}`)
|
|
|
.then((response) => {
|
|
|
loading.value = false;
|
|
|
- skyImageUrl.value = response.data.url;
|
|
|
+
|
|
|
+ if (state) {
|
|
|
+ skyImageUrl.value = response.data.url;
|
|
|
+ } else {
|
|
|
+ window.location = "https://cmm.ai/skylantern/";
|
|
|
+ }
|
|
|
})
|
|
|
.catch((error) => {
|
|
|
loading.value = false;
|
|
@@ -51,17 +58,21 @@ function getValue() {
|
|
|
|
|
|
<h3 class="title">寫下你的願望</h3>
|
|
|
<input v-model="inputValue" type="text" />
|
|
|
- <div class="d-flex flex-column align-center mt-15">
|
|
|
- <button @click="getValue()" class="main-btn mb-5">預覽</button>
|
|
|
- <button class="main-btn">送出</button>
|
|
|
+
|
|
|
+ <div class="d-flex flex-column align-center my-15">
|
|
|
+ <button @click="getValue(true)" class="main-btn mb-5">預覽</button>
|
|
|
+ <button @click="getValue(false)" class="main-btn mb-5">送出</button>
|
|
|
</div>
|
|
|
- </div>
|
|
|
|
|
|
- <Footer url="/interact_step1" back="/interacthome" />
|
|
|
+ <Footer url="/interact_step1" back="/interacthome" />
|
|
|
+ </div>
|
|
|
</template>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
.lartern-content {
|
|
|
+ height: 100%;
|
|
|
+ padding-top: 8rem;
|
|
|
+
|
|
|
input {
|
|
|
padding: 10px;
|
|
|
background-color: transparent;
|
|
@@ -78,6 +89,10 @@ function getValue() {
|
|
|
img {
|
|
|
max-width: 300px;
|
|
|
height: auto;
|
|
|
+
|
|
|
+ @media (max-width: 600px) {
|
|
|
+ max-width: 250px;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|