FeedBack.vue 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296
  1. <template>
  2. <div class="feed-back">
  3. <BtnClose
  4. @click="emit('close')"
  5. />
  6. <div class="paper-wrap">
  7. <article class="paper">
  8. <h1>用户反馈</h1>
  9. <h2>User feedback</h2>
  10. <div class="row">
  11. <div class="key">
  12. 您的称呼
  13. </div>
  14. <input
  15. v-model="name"
  16. aotufocus
  17. type="text"
  18. placeholder="请输入内容,20字以内"
  19. maxlength="20"
  20. >
  21. </div>
  22. <div class="row">
  23. <div class="key">
  24. 联系方式
  25. </div>
  26. <input
  27. v-model="contact"
  28. type="text"
  29. placeholder="请输入内容,20字以内"
  30. maxlength="20"
  31. >
  32. </div>
  33. <div class="row">
  34. <div class="key">
  35. 反馈内容
  36. </div>
  37. <textarea
  38. v-model="feedback"
  39. placeholder="请输入省市区街道,50字以内"
  40. maxlength="50"
  41. />
  42. </div>
  43. <div class="splitter" />
  44. <div class="row">
  45. <div class="key veri-code-key">
  46. 验证码
  47. </div>
  48. <input
  49. v-model="veriCode"
  50. class="veri-code-input"
  51. type="text"
  52. maxlength="20"
  53. placeholder="请输入内容"
  54. >
  55. <button
  56. class="get-veri-code"
  57. @click="onClickVerifiCode"
  58. >
  59. <img
  60. v-if="isShowVerifiCode"
  61. class=""
  62. :src="`${$env.VUE_APP_DEPLOY_ORIGIN}/api/show/getRandCode`"
  63. alt=""
  64. draggable="false"
  65. >
  66. </button>
  67. </div>
  68. <div class="btn-group">
  69. <button
  70. class="cancel"
  71. @click="emit('close')"
  72. >
  73. 取消
  74. </button>
  75. <button
  76. class="confirm"
  77. :disabled="!canSubmit"
  78. @click="onSubmit"
  79. >
  80. 提交
  81. </button>
  82. </div>
  83. </article>
  84. <div class="deco" />
  85. </div>
  86. </div>
  87. </template>
  88. <script setup>
  89. import { ref, computed, watch, onMounted, nextTick, inject } from "vue"
  90. import { useRoute, useRouter } from "vue-router"
  91. import { useStore } from "vuex"
  92. import BtnClose from "./BtnClose.vue"
  93. const route = useRoute()
  94. const router = useRouter()
  95. const store = useStore()
  96. const $env = inject('$env')
  97. const emit = defineEmits(['close'])
  98. const isShowVerifiCode = ref(true)
  99. const onClickVerifiCode = utils.throttle(() => {
  100. isShowVerifiCode.value = false
  101. nextTick(() => {
  102. isShowVerifiCode.value = true
  103. })
  104. }, 333)
  105. const name = ref('')
  106. const contact = ref('')
  107. const feedback = ref('')
  108. const veriCode = ref('')
  109. const canSubmit = computed(() => {
  110. return name.value && contact.value && feedback.value && veriCode.value
  111. })
  112. function onSubmit() {
  113. emit('close')
  114. }
  115. </script>
  116. <style lang="less" scoped>
  117. .feed-back{
  118. position: fixed;
  119. left: 0;
  120. top: 0;
  121. width: 100%;
  122. height: 100%;
  123. background: rgba(0,0,0,0.6);
  124. backdrop-filter: blur(10px);
  125. z-index: 10;
  126. overflow: auto;
  127. >div.paper-wrap{
  128. position: absolute;
  129. left: 50%;
  130. top: 60px;
  131. transform: translate(-50%, 0);
  132. width: 925px;
  133. height: 810px;
  134. z-index: 0;
  135. >article.paper{
  136. position: absolute;
  137. left: 0;
  138. top: 0;
  139. width: 100%;
  140. height: 100%;
  141. background: linear-gradient( 180deg, rgba(200,200,200, 1) 0%, rgba(100,100,100, 1) 100%);
  142. z-index: 1;
  143. display: flex;
  144. flex-direction: column;
  145. align-items: center;
  146. padding-top: 73px;
  147. padding-bottom: 64px;
  148. >h1{
  149. position: absolute;
  150. top: -37px;
  151. left: 36px;
  152. font-family: Source Han Serif CN, Source Han Serif CN;
  153. font-weight: bold;
  154. font-size: 32px;
  155. color: #FFFFFF;
  156. line-height: 38px;
  157. }
  158. >h2{
  159. position: absolute;
  160. top: 6px;
  161. left: 68px;
  162. font-family: Source Han Sans CN, Source Han Sans CN;
  163. font-weight: 400;
  164. font-size: 14px;
  165. color: #b0b0b0;
  166. line-height: 16px;
  167. }
  168. >.row{
  169. display: flex;
  170. align-items: center;
  171. margin-bottom: 37px;
  172. >.key{
  173. font-family: Source Han Serif CN, Source Han Serif CN;
  174. font-weight: bold;
  175. font-size: 24px;
  176. color: #424A4A;
  177. line-height: 28px;
  178. letter-spacing: 7px;
  179. margin-right: 34px;
  180. }
  181. >.key.veri-code-key{
  182. font-family: Source Han Serif CN, Source Han Serif CN;
  183. font-weight: bold;
  184. font-size: 24px;
  185. color: #FFFFFF;
  186. line-height: 1px;
  187. letter-spacing: 22px;
  188. margin-right: 15px;
  189. }
  190. >input, >textarea{
  191. width: 506px;
  192. background: rgba(213,221,215,0.5);
  193. box-shadow: 0px 1px 3px 0px rgba(255,255,255,0.25);
  194. border-radius: 3px 3px 3px 3px;
  195. border: 1px solid;
  196. border-image: linear-gradient(180deg, rgba(255, 255, 255, 1), rgba(255, 255, 255, 0.15)) 1 1;
  197. font-family: Source Han Sans CN, Source Han Sans CN;
  198. font-weight: 400;
  199. font-size: 16px;
  200. color: #000000;
  201. line-height: 19px;
  202. padding-left: 20px;
  203. padding-right: 2px;
  204. &::placeholder{
  205. opacity: 0.3;
  206. }
  207. }
  208. >input {
  209. height: 51px;
  210. }
  211. >textarea{
  212. width: 506px;
  213. height: 238px;
  214. resize: none;
  215. padding-top: 13px;
  216. padding-bottom: 13px;
  217. }
  218. >input.veri-code-input{
  219. width: 338px;
  220. margin-right: 15px;
  221. }
  222. >button.get-veri-code{
  223. width: 155px;
  224. height: 51px;
  225. border-radius: 3px;
  226. background-color: #fff;
  227. >img{
  228. height: 100%;
  229. width: 100%;
  230. object-fit: contain;
  231. }
  232. }
  233. }
  234. >.splitter{
  235. width: 830px;
  236. border: 1px solid #B5C2B9;
  237. opacity: 0.6;
  238. margin-bottom: 40px;
  239. }
  240. >.btn-group{
  241. >button.cancel{
  242. width: 194px;
  243. height: 94px;
  244. padding-bottom: 9px;
  245. font-family: Source Han Sans CN, Source Han Sans CN;
  246. font-weight: 400;
  247. font-size: 20px;
  248. color: #FFFFFF;
  249. line-height: 23px;
  250. background-image: url(@/assets/images/button-cancel-bg.png);
  251. background-size: cover;
  252. background-repeat: no-repeat;
  253. background-position: center center;
  254. }
  255. >button.confirm{
  256. width: 194px;
  257. height: 94px;
  258. padding-bottom: 9px;
  259. font-family: Source Han Sans CN, Source Han Sans CN;
  260. font-weight: 400;
  261. font-size: 20px;
  262. color: #9C6D42;
  263. line-height: 23px;
  264. background-image: url(@/assets/images/button-confirm-bg.png);
  265. background-size: cover;
  266. background-repeat: no-repeat;
  267. background-position: center center;
  268. &[disabled]{
  269. opacity: 0.7;
  270. cursor: not-allowed;
  271. }
  272. }
  273. }
  274. }
  275. >.deco{
  276. position: absolute;
  277. z-index: 0;
  278. width: 100%;
  279. height: 100%;
  280. left: -14px;
  281. top: 14px;
  282. border: 1px solid rgba(255, 255, 255, 0.5);
  283. }
  284. }
  285. }
  286. </style>