Bladeren bron

feat: 保存

gemercheung 1 jaar geleden
bovenliggende
commit
ce5a0e5d95
7 gewijzigde bestanden met toevoegingen van 51 en 13 verwijderingen
  1. 1 0
      .env.development
  2. 1 0
      .env.production
  3. 1 6
      README.md
  4. 9 3
      src/components/noticeBox.vue
  5. 15 2
      src/store/info.js
  6. 16 0
      src/views/feedback.vue
  7. 8 2
      src/views/home.vue

+ 1 - 0
.env.development

@@ -0,0 +1 @@
+VITE_DOMAIN_URL="http://192.168.20.61:8059/api/"

+ 1 - 0
.env.production

@@ -0,0 +1 @@
+VITE_DOMAIN_URL="http://192.168.20.61:8059/api/"

+ 1 - 6
README.md

@@ -1,7 +1,2 @@
-# Vue 3 + Vite
+# 秋收项目展示端
 
-This template should help get you started developing with Vue 3 in Vite. The template uses Vue 3 `<script setup>` SFCs, check out the [script setup docs](https://v3.vuejs.org/api/sfc-script-setup.html#sfc-script-setup) to learn more.
-
-## Recommended IDE Setup
-
-- [VS Code](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur) + [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin).

+ 9 - 3
src/components/noticeBox.vue

@@ -45,12 +45,18 @@ const handleDetail = () => {
 .n-card.notice-box {
   --n-title-font-weight: 600 !important;
   --n-title-font-size: 1.75rem !important;
+  --n-padding-top: 1.875rem !important;
   border-radius: 1.875rem;
-  box-shadow: var(--main-box-shadow);
-  // background-image: url("/img/notice_list_bg.png");
   background-size: contain;
   background-repeat: no-repeat;
   cursor: pointer;
-  // background-color: transparent;
+  background-color: transparent;
+  background-image: var(--main-sub-list-bg);
+  background-position: top right;
+  background-size: cover;
+  background-repeat: no-repeat;
+  height: 15.75rem;
+  border: none;
+  overflow: hidden;
 }
 </style>

+ 15 - 2
src/store/info.js

@@ -1,15 +1,18 @@
+import { unref } from "vue";
 import { defineStore } from "pinia";
 import axios from "axios";
 import { useAxios } from "@vueuse/integrations/useAxios";
 
+const baseURL = import.meta.env.VITE_DOMAIN_URL;
 const instance = axios.create({
-  baseURL: "https://test.4dkankan.com/api",
+  baseURL: baseURL,
 });
 
 export const useInfoStore = defineStore({
   id: "info",
   state: () => {
     return {
+      poster: [],
       exhibition: [],
       activity: [],
       news: [],
@@ -18,9 +21,19 @@ export const useInfoStore = defineStore({
   },
   getters: {},
   actions: {
+    async getPoster() {
+      const { data } = useAxios(
+        "/show/poster/getList",
+        { method: "get" },
+        instance
+      );
+      console.log("data", data);
+
+      this.poster = data;
+    },
     getData() {
       const { data, isFinished } = useAxios(
-        "/test",
+        "/show/poster/getList",
         { method: "get" },
         instance
       );

+ 16 - 0
src/views/feedback.vue

@@ -35,6 +35,11 @@
                 type="text"
                 placeholder="请填入图形验证码"
               />
+              <img
+                class="txt-code"
+                :src="imageCode"
+                @click="handleCodeReload"
+              />
             </n-space>
             <n-space align="center" justify="center" style="padding: 20px">
               <n-button
@@ -69,6 +74,9 @@ import { useInfoStore } from "../store/info";
 import { useRouter } from "vue-router";
 const router = useRouter();
 
+const imageCode = ref(
+  "http://192.168.20.61:8059/api/show/getRandCode?t=" + Date.now()
+);
 const title = ref("detail");
 const feedBackContent = ref("");
 const nickName = ref("");
@@ -89,6 +97,10 @@ const submit = () => {
   console.log("data", data);
   router.go(-1);
 };
+const handleCodeReload = () => {
+  const url = imageCode.value.split("?");
+  imageCode.value = url[0] + "?=" + Date.now();
+};
 </script>
 
 <style lang="scss" scoped>
@@ -139,6 +151,10 @@ const submit = () => {
     padding: 1.5625rem 3.125rem;
     border-radius: 3.75rem;
   }
+  .txt-code {
+    vertical-align: middle;
+    cursor: pointer;
+  }
 }
 :deep(.detail .info .n-input--textarea) {
   --n-font-size: 20px !important;

+ 8 - 2
src/views/home.vue

@@ -2,6 +2,7 @@
   <div class="main">
     <div class="left">
       <!-- post -->
+      {{ posters }}
       <n-carousel
         dot-placement="bottom"
         style="width: 100%; height: 100%"
@@ -56,13 +57,18 @@
 </template>
 
 <script setup>
+import { computed } from "vue";
 import { useFullscreen } from "@vueuse/core";
 import { useRoute, useRouter } from "vue-router";
+import { useInfoStore } from "../store/info";
 
 const { push } = useRouter();
+const InfoStore = useInfoStore();
 
-const { isFullscreen, enter, exit, toggle } = useFullscreen();
-// console.log("isFullscreen", isFullscreen);
+const posters = computed(() => InfoStore.poster);
+onMounted(() => {
+  InfoStore.getPoster();
+});
 </script>
 <style>
 .main {