|
@@ -13,10 +13,10 @@
|
|
|
type="textarea"
|
|
|
autosize
|
|
|
placeholder="请填入内容,5-500字"
|
|
|
- style="min-height: 400px"
|
|
|
+ style="min-height: 25rem"
|
|
|
/>
|
|
|
|
|
|
- <n-space align="center" style="padding: 20px" justify="center">
|
|
|
+ <n-space align="center" style="padding: 1.25rem" justify="center">
|
|
|
<n-input
|
|
|
v-model:value="nickName"
|
|
|
size="large"
|
|
@@ -41,7 +41,7 @@
|
|
|
@click="handleCodeReload"
|
|
|
/>
|
|
|
</n-space>
|
|
|
- <n-space align="center" justify="center" style="padding: 20px">
|
|
|
+ <n-space align="center" justify="center" style="padding: 1.25rem">
|
|
|
<n-button
|
|
|
class="submit"
|
|
|
size="large"
|
|
@@ -70,12 +70,16 @@ import { watchEffect, ref } from "vue";
|
|
|
import subHeader from "../components/subHeader";
|
|
|
import sideMenu from "../components/sideMenu";
|
|
|
import heroSubTitle from "../components/heroSubTitle";
|
|
|
-import { useInfoStore } from "../store/info";
|
|
|
+import { useFeedBackStore } from "../store/feedback";
|
|
|
import { useRouter } from "vue-router";
|
|
|
+import { useMessage } from "naive-ui";
|
|
|
+window.$message = useMessage();
|
|
|
+
|
|
|
const router = useRouter();
|
|
|
+const feedBackStore = useFeedBackStore();
|
|
|
|
|
|
const imageCode = ref(
|
|
|
- "http://192.168.20.61:8059/api/show/getRandCode?t=" + Date.now()
|
|
|
+ `${import.meta.env.VITE_API_URL}/show/getRandCode?t=` + Date.now()
|
|
|
);
|
|
|
const title = ref("detail");
|
|
|
const feedBackContent = ref("");
|
|
@@ -86,16 +90,23 @@ watchEffect(() => {
|
|
|
document.title = title.value;
|
|
|
});
|
|
|
|
|
|
-const submit = () => {
|
|
|
- //to submit
|
|
|
- const data = {
|
|
|
- name: nickName.value,
|
|
|
- content: feedBackContent.value,
|
|
|
- contact: contact.value,
|
|
|
- code: verifyCode.value,
|
|
|
- };
|
|
|
- console.log("data", data);
|
|
|
- router.go(-1);
|
|
|
+const submit = async () => {
|
|
|
+ try {
|
|
|
+ const data = {
|
|
|
+ name: nickName.value,
|
|
|
+ content: feedBackContent.value,
|
|
|
+ phone: contact.value,
|
|
|
+ randCode: verifyCode.value,
|
|
|
+ };
|
|
|
+ const res = await feedBackStore.sendFeedback(data);
|
|
|
+ console.log("res", res);
|
|
|
+ if (res.isOK) {
|
|
|
+ window.$message.success("提交成功!");
|
|
|
+ router.go(-1);
|
|
|
+ } else {
|
|
|
+ window.$message.warning(res.msg);
|
|
|
+ }
|
|
|
+ } catch (error) {}
|
|
|
};
|
|
|
const handleCodeReload = () => {
|
|
|
const url = imageCode.value.split("?");
|
|
@@ -105,19 +116,19 @@ const handleCodeReload = () => {
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
:deep(.n-input) {
|
|
|
- font-size: 16px;
|
|
|
+ font-size: 1rem;
|
|
|
}
|
|
|
.detail {
|
|
|
--main-show-case-background: #ddd5d5;
|
|
|
- --main-detail-margin: 1.875rem;
|
|
|
- --main-detail-padding: 1.875rem;
|
|
|
+ --main-detail-margin: 30px;
|
|
|
+ --main-detail-padding: 30px;
|
|
|
// box-shadow: var(--main-box-shadow);
|
|
|
margin: var(--main-detail-margin);
|
|
|
margin-bottom: 0;
|
|
|
flex: 1;
|
|
|
- border-radius: 0.8125rem;
|
|
|
+ border-radius: 13px;
|
|
|
background-color: transparent;
|
|
|
- padding: 2rem 3rem 4rem 3rem;
|
|
|
+ padding: 32px 48px 64px 48px;
|
|
|
background-image: var(--main-detail-background-img);
|
|
|
background-size: cover;
|
|
|
background-position: top 100%;
|
|
@@ -130,26 +141,26 @@ const handleCodeReload = () => {
|
|
|
|
|
|
.back {
|
|
|
background-image: url("/img/back_arrow.png");
|
|
|
- width: 7.5rem;
|
|
|
- height: 1.875rem;
|
|
|
+ width: 120px;
|
|
|
+ height: 30px;
|
|
|
background-repeat: no-repeat;
|
|
|
background-size: contain;
|
|
|
- margin-bottom: 0.75rem;
|
|
|
+ margin-bottom: 12px;
|
|
|
}
|
|
|
.info {
|
|
|
- max-width: 66.8125rem;
|
|
|
+ max-width: 1069px;
|
|
|
margin: 0 auto;
|
|
|
- font-size: 1.25rem;
|
|
|
+ font-size: 20px;
|
|
|
}
|
|
|
.show-case {
|
|
|
- max-width: 66.8125rem;
|
|
|
- height: 34.1875rem;
|
|
|
+ max-width: 1069px;
|
|
|
+ height: 547px;
|
|
|
background: var(--main-show-case-background);
|
|
|
}
|
|
|
.submit {
|
|
|
- font-size: 20px;
|
|
|
- padding: 1.5625rem 3.125rem;
|
|
|
- border-radius: 3.75rem;
|
|
|
+ font-size: 1.25rem;
|
|
|
+ padding: 25px 50px;
|
|
|
+ border-radius: 1.1875rem;
|
|
|
}
|
|
|
.txt-code {
|
|
|
vertical-align: middle;
|
|
@@ -157,8 +168,8 @@ const handleCodeReload = () => {
|
|
|
}
|
|
|
}
|
|
|
:deep(.detail .info .n-input--textarea) {
|
|
|
- --n-font-size: 20px !important;
|
|
|
- padding: 1.25rem;
|
|
|
- border-radius: 1.875rem;
|
|
|
+ --n-font-size: 1.25rem !important;
|
|
|
+ padding: 20px;
|
|
|
+ border-radius: 19px;
|
|
|
}
|
|
|
</style>
|