feedback.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. <template>
  2. <div class="main">
  3. <div class="content">
  4. <sub-header />
  5. <div class="left">
  6. <hero-sub-title />
  7. <div class="detail">
  8. <div class="back" @click="$router.go(-1)"></div>
  9. <div class="info">
  10. <n-input
  11. v-model:value="feedBackContent"
  12. type="textarea"
  13. autosize
  14. placeholder="请填入内容,5-500字"
  15. style="min-height: 400px"
  16. />
  17. <n-space align="center" style="padding: 20px" justify="center">
  18. <n-input
  19. v-model:value="nickName"
  20. size="large"
  21. type="text"
  22. placeholder="昵称"
  23. />
  24. <n-input
  25. v-model:value="contact"
  26. size="large"
  27. type="text"
  28. placeholder="联系方式"
  29. />
  30. <n-input
  31. v-model:value="verifyCode"
  32. size="large"
  33. type="text"
  34. placeholder="请填入图形验证码"
  35. />
  36. </n-space>
  37. <n-space align="center" justify="center" style="padding: 20px">
  38. <n-button
  39. class="submit"
  40. size="large"
  41. :disabled="
  42. feedBackContent.length === 0 ||
  43. nickName.length === 0 ||
  44. contact.length === 0 ||
  45. verifyCode.length === 0
  46. "
  47. type="primary"
  48. @click="submit"
  49. >
  50. 提交
  51. </n-button>
  52. </n-space>
  53. </div>
  54. </div>
  55. </div>
  56. <side-menu />
  57. </div>
  58. </div>
  59. </template>
  60. <script setup>
  61. import { watchEffect, ref } from "vue";
  62. import subHeader from "../components/subHeader";
  63. import sideMenu from "../components/sideMenu";
  64. import heroSubTitle from "../components/heroSubTitle";
  65. import { useInfoStore } from "../store/info";
  66. import { useRouter } from "vue-router";
  67. const router = useRouter();
  68. const title = ref("detail");
  69. const feedBackContent = ref("");
  70. const nickName = ref("");
  71. const contact = ref("");
  72. const verifyCode = ref("");
  73. watchEffect(() => {
  74. document.title = title.value;
  75. });
  76. const submit = () => {
  77. //to submit
  78. const data = {
  79. name: nickName.value,
  80. content: feedBackContent.value,
  81. contact: contact.value,
  82. code: verifyCode.value,
  83. };
  84. console.log("data", data);
  85. router.go(-1);
  86. };
  87. </script>
  88. <style lang="scss" scoped>
  89. :deep(.n-input) {
  90. font-size: 16px;
  91. }
  92. .detail {
  93. --main-show-case-background: #ddd5d5;
  94. --main-detail-margin: 1.875rem;
  95. --main-detail-padding: 1.875rem;
  96. // box-shadow: var(--main-box-shadow);
  97. margin: var(--main-detail-margin);
  98. margin-bottom: 0;
  99. flex: 1;
  100. border-radius: 0.8125rem;
  101. background-color: transparent;
  102. padding: 2rem 3rem 4rem 3rem;
  103. background-image: var(--main-detail-background-img);
  104. background-size: cover;
  105. background-position: top 100%;
  106. background-repeat: no-repeat;
  107. overflow-y: scroll;
  108. &::-webkit-scrollbar {
  109. display: none;
  110. }
  111. .back {
  112. background-image: url("/img/back_arrow.png");
  113. width: 7.5rem;
  114. height: 1.875rem;
  115. background-repeat: no-repeat;
  116. background-size: contain;
  117. margin-bottom: 0.75rem;
  118. }
  119. .info {
  120. max-width: 66.8125rem;
  121. margin: 0 auto;
  122. font-size: 1.25rem;
  123. }
  124. .show-case {
  125. max-width: 66.8125rem;
  126. height: 34.1875rem;
  127. background: var(--main-show-case-background);
  128. }
  129. .submit {
  130. font-size: 20px;
  131. padding: 1.5625rem 3.125rem;
  132. border-radius: 3.75rem;
  133. }
  134. }
  135. :deep(.detail .info .n-input--textarea) {
  136. --n-font-size: 20px !important;
  137. padding: 1.25rem;
  138. border-radius: 1.875rem;
  139. }
  140. </style>