shaogen1995 2 年之前
父節點
當前提交
af60125749

二進制
houtai/public/favicon.ico


+ 1 - 1
houtai/public/index.html

@@ -5,7 +5,7 @@
     <meta http-equiv="X-UA-Compatible" content="IE=edge">
     <meta name="viewport" content="width=device-width,initial-scale=1.0">
     <link rel="icon" href="<%= BASE_URL %>favicon.ico">
-    <title>河南博物院-文物展示平台后台</title>
+    <title>芜湖一房一册管理后台</title>
   </head>
   <body>
     <noscript>

+ 7 - 39
houtai/src/views/tab2/index.vue

@@ -23,44 +23,11 @@
                 }}
               </template>
             </el-table-column>
-            <el-table-column label="名称" prop="name"> </el-table-column>
-            <el-table-column label="总登记号">
-              <template #default="{ row }">
-                <span
-                  style="cursor: pointer"
-                  :title="row.registerNum"
-                  v-if="row.registerNum"
-                  >{{
-                    row.registerNum.length > 10
-                      ? row.registerNum.substring(0, 10) + "..."
-                      : row.registerNum
-                  }}</span
-                >
-                <span v-else>(空)</span>
-              </template>
-            </el-table-column>
-            <el-table-column label="类别">
-              <template #default="{ row }">
-                <span v-if="row.dictTextureName">{{
-                  row.dictTextureName
-                }}</span>
-                <span v-else>(空)</span>
-              </template>
-            </el-table-column>
-            <el-table-column label="年代">
-              <template #default="{ row }">
-                <span v-if="row.dictAgeFront">{{ row.dictAgeFront }}</span>
-                <span v-else>(空)</span>
-              </template>
-            </el-table-column>
-            <el-table-column label="级别">
-              <template #default="{ row }">
-                <span v-if="row.dictLevelName">{{ row.dictLevelName }}</span>
-                <span v-else>(空)</span>
-              </template>
-            </el-table-column>
+            <el-table-column label="标题" prop="name"> </el-table-column>
+            <el-table-column label="话题" prop="name"> </el-table-column>
+            <el-table-column label="位置" prop="name"> </el-table-column>
 
-            <el-table-column label="图片" width="120">
+            <el-table-column label="封面图片" width="120">
               <template #default="{ row }">
                 <img
                   class="table_img"
@@ -70,10 +37,11 @@
                 />
               </template>
             </el-table-column>
-            <el-table-column prop="day" label="日期"> </el-table-column>
+            <el-table-column prop="day" label="发布时间"> </el-table-column>
+            <el-table-column prop="day" label="审核状态"> </el-table-column>
             <el-table-column label="操作">
               <template #default="{ row }">
-                <el-button type="text">查看</el-button>
+                <el-button type="text">审核</el-button>
                 <el-button
                   type="text"
                   style="color: #d9001b"

+ 20 - 0
yfyc/src/App.vue

@@ -1,6 +1,10 @@
 <template>
   <div id="app">
     <Router-view />
+    <!-- 发送接口出现的loading -->
+    <div class="loadingApp">
+      <van-loading color="#1989fa" />
+    </div>
   </div>
 </template>
 <script>
@@ -28,5 +32,21 @@ export default {
   // max-width: 500px;
   margin: 0 auto;
   overflow: hidden;
+  .loadingApp {
+    display: none;
+    background-color: rgba(0, 0, 0, 0.4);
+    position: fixed;
+    top: 0;
+    left: 0;
+    width: 100%;
+    height: 100%;
+    z-index: 11;
+    .van-loading{
+      position: absolute;
+      top: 50%;
+      left: 50%;
+      transform: translate(-50%,-50%);
+    }
+  }
 }
 </style>

+ 17 - 2
yfyc/src/api/interact.js

@@ -10,7 +10,7 @@ export const getCodeAPI = (code) => {
 export const uploadImgAPI = (fd) => {
   return axios({
     method: 'post',
-    url: 'cms/comment/upload',
+    url: 'cms/share/upload',
     data:fd
   })
 }
@@ -18,7 +18,7 @@ export const uploadImgAPI = (fd) => {
 // 删除图片
 export const delImgAPI = (id) => {
   return axios({
-    url: `cms/comment/delFile/${id}`,
+    url: `cms/share/delFile/${id}`,
   })
 }
 
@@ -30,3 +30,18 @@ export const shareSaveAPI = (data) => {
     data
   })
 }
+
+// 获取话题列表
+export const getDictAPI = (type) => {
+  return axios({
+    url: `show/dict/getList/${type}`,
+  })
+}
+
+// 获取位置列表
+export const getLoctionAPI = () => {
+  return axios({
+    method: 'post',
+    url: 'show/position/list',
+  })
+}

二進制
yfyc/src/assets/img/IMGerror.png


二進制
yfyc/src/assets/img/loading.gif


+ 8 - 1
yfyc/src/main.js

@@ -12,6 +12,14 @@ import infiniteScroll from 'vue-infinite-scroll'
 import Vant from 'vant';
 import 'vant/lib/index.css';
 Vue.use(Vant);
+
+// 图片懒加载
+Vue.use(VueLazyload, {
+  error: require('@/assets/img/IMGerror.png'),
+  loading: require('@/assets/img/loading.gif')
+})
+
+
 // 初始样式
 import './assets/base.css'
 import "@/assets/my-reset.css"
@@ -25,7 +33,6 @@ console.log(`version: ${process.env.VUE_APP_VERSION}`)
 
 Vue.use(clickOutside)
 Vue.use(Viewer)
-Vue.use(VueLazyload)
 Vue.use(infiniteScroll)
 
 new Vue({

+ 12 - 6
yfyc/src/utils/request.js

@@ -1,14 +1,18 @@
 import axios from 'axios'
-import { Toast } from "vant";
-export const baseURL = process.env.NODE_ENV === 'development' ? 'http://192.168.20.55:8037/api' : ''
-//export const baseURL = process.env.NODE_ENV === 'development' ? 'http://192.168.20.55:8037/api' : ''
-
+import {
+  Toast
+} from "vant";
+export const baseURL = process.env.NODE_ENV === 'development' ? 'http://192.168.20.55:8037/api' : '/api'
+//export const baseURL = process.env.NODE_ENV === 'development' ? 'http://192.168.20.55:8037/api' : '/api'
+let axajInd = 0
 const service = axios.create({
   baseURL: baseURL,
   timeout: 5000
 })
 // 请求拦截器
 service.interceptors.request.use(function (config) {
+  document.querySelector('.loadingApp').style.display = 'block'
+  axajInd++
   // console.log('触发拦截器')
   // 在发送请求之前做些什么:看看有没有token,如果有通过请求头的方式传递token
   const token = localStorage.getItem('YFYC_token')
@@ -26,12 +30,14 @@ service.interceptors.request.use(function (config) {
 
 // 添加响应拦截器
 service.interceptors.response.use(function (response) {
+  axajInd--
   // console.log('触发相应拦截器', response)
   // 对响应数据做点什么--response就是发送每个请求的返回值
   if (response.data.code === 5001 || response.data.code === 5002) {
-    // Toast.fail('未登录,请先登录')
+    Toast.fail('未登录,请先登录!')
     localStorage.removeItem('YFYC_token')
   }
+  if (axajInd === 0) document.querySelector('.loadingApp').style.display = 'none'
   return response.data
 }, function (error) {
   Toast.fail(error.message);
@@ -39,4 +45,4 @@ service.interceptors.response.use(function (response) {
   return Promise.reject(error)
 })
 
-export default service
+export default service

+ 21 - 30
yfyc/src/views/Interact/components/InteractIssue.vue

@@ -86,7 +86,7 @@
       </Draggable>
     </div>
     <div class="imgUpTit">
-      可拖动图片调整顺序,首张图将作为封面。<br />最多可上传5张图片。
+      可拖动图片调整顺序,首张图将作为封面。<br />最大支持5M,最多可上传5张图片。
     </div>
     <!-- 发布按钮 -->
     <div class="issueBtn" @click="issueDone">发 布</div>
@@ -97,16 +97,17 @@
       @closeLoc="LocationShow = false"
       @setLocationInfo="setLocationInfo"
     />
-    <!-- 上传出现的loading -->
-    <div class="loading" v-show="loading">
-      <van-loading color="#1989fa" />
-    </div>
   </div>
 </template>
 
 <script>
 import { baseURL } from "@/utils/request";
-import { uploadImgAPI, shareSaveAPI,delImgAPI } from "@/api/interact.js";
+import {
+  uploadImgAPI,
+  shareSaveAPI,
+  delImgAPI,
+  getDictAPI,
+} from "@/api/interact.js";
 import Location from "./interactLocation.vue";
 import { Toast } from "vant";
 //导入draggable组件
@@ -121,16 +122,15 @@ export default {
       txt1: "",
       txt2: "",
       topicData: [
-        { id: 1, name: "景点" },
-        { id: 2, name: "美食" },
-        { id: 3, name: "游玩" },
-        { id: 4, name: "酒店" },
+        // { id: 1, name: "景点" },
+        // { id: 2, name: "美食" },
+        // { id: 3, name: "游玩" },
+        // { id: 4, name: "酒店" },
       ],
       topic: 1,
       locationInfo: {},
       LocationShow: false,
       // 上传相关
-      loading: false,
       imgList: [
         // {
         //   id: 65,
@@ -159,14 +159,12 @@ export default {
           e.target.value = "";
           return Toast.fail("最大支持5M!");
         }
-        this.loading = true;
         // 创建FormData对象
         const fd = new FormData();
         // 把files添加进FormData对象(‘photo’为后端需要的字段)
         fd.append("file", filesInfo);
         fd.append("type", "img");
         const res = await uploadImgAPI(fd);
-        this.loading = false;
         if (res.code === 0) {
           Toast.success("上传成功!");
         } else Toast.fail(res.msg);
@@ -194,7 +192,7 @@ export default {
         description: this.txt2
           .replaceAll("\n", "<br/>")
           .replaceAll(" ", "&ensp;"),
-        dictPlaceId: this.locationInfo.id,
+        positionId: this.locationInfo.id,
         dictTopicId: this.topic,
         fileIds: imgArr.join(","),
         name: this.txt1,
@@ -203,7 +201,7 @@ export default {
       const res = await shareSaveAPI(obj);
       if (res.code === 0) {
         Toast.success("发布成功!");
-        this.$router.push('/layout/interact')
+        this.$router.push("/layout/interact");
       } else Toast.fail(res.msg);
     },
     // 拖拽图片
@@ -219,9 +217,9 @@ export default {
     delImg(id) {
       Dialog.confirm({
         title: "确定删除吗?",
-        beforeClose: async(action, done) => {
+        beforeClose: async (action, done) => {
           if (action === "confirm") {
-            await delImgAPI(id)
+            await delImgAPI(id);
             // 点击了确定
             this.imgList = this.imgList.filter((v) => v.id !== id);
             Toast.success("删除成功!");
@@ -231,7 +229,11 @@ export default {
       });
     },
   },
-  created() {},
+  async created() {
+    // 获取话题列表
+    const res = await getDictAPI("topic");
+    this.topicData = res.data;
+  },
   mounted() {},
   beforeCreate() {}, //生命周期 - 创建之前
   beforeMount() {}, //生命周期 - 挂载之前
@@ -248,18 +250,7 @@ export default {
   height: 100%;
   padding: 20px 15px;
   overflow-y: auto;
-  .loading {
-    background-color: rgba(0, 0, 0, 0.4);
-    position: fixed;
-    top: 0;
-    left: 0;
-    width: 100%;
-    height: 100%;
-    z-index: 11;
-    display: flex;
-    justify-content: center;
-    align-items: center;
-  }
+
   /deep/.van-cell {
     width: 100%;
     height: 36px;

+ 28 - 25
yfyc/src/views/Interact/components/interactLocation.vue

@@ -1,7 +1,9 @@
 <template>
   <div class="interactLocation">
     <!-- 关闭按钮 -->
-    <div class="close" @click="$emit('closeLoc')"><van-icon name="cross" /></div>
+    <div class="close" @click="$emit('closeLoc')">
+      <van-icon name="cross" />
+    </div>
     <!-- 输入框 -->
     <div class="inputBox" @keydown.enter="searchFu()" v-show="0">
       <div class="searInco" @click="searchFu()">
@@ -10,11 +12,16 @@
       <van-field maxlength="20" v-model="txt" placeholder="搜索位置" />
     </div>
     <div class="locationBox">
-      <div class="row" v-for="item in locationData" :key="item.id" @click="$emit('setLocationInfo',item)">
-        <h3>{{item.name}}</h3>
+      <div
+        class="row"
+        v-for="item in locationData"
+        :key="item.id"
+        @click="$emit('setLocationInfo', item)"
+      >
+        <h3>{{ item.name }}</h3>
         <div class="row_floo">
-          <div class="row_flooLL">{{item.loc}}</div>
-          <div class="row_flooRR">{{item.num}}</div>
+          <div class="row_flooLL">{{ item.location }}</div>
+          <div class="row_flooRR">{{ item.num }}</div>
         </div>
       </div>
     </div>
@@ -22,23 +29,16 @@
 </template>
 
 <script>
+import { getLoctionAPI } from "@/api/interact.js";
 export default {
   name: "interactLocation",
   components: {},
   data() {
     return {
       txt: "",
-      locationData:[
-        {id:1,name:'芜湖市',loc:'中国安徽省芜湖市',num:''},
-        {id:2,name:'鸠兹广场',loc:'安徽省芜湖市镜湖区滨江路桥口',num:''},
-        {id:3,name:'中江塔',loc:'安徽省芜湖市镜湖区滨江路桥口',num:''},
-        {id:4,name:'方特旅游区',loc:'安徽省芜湖市镜湖区银湖北路80号',num:''},
-        {id:5,name:'芜湖滨江公园',loc:'芜湖市镜湖区新芜路7号',num:''},
-        {id:6,name:'芜湖长江三桥',loc:'安徽省芜湖市',num:''},
-        {id:7,name:'鸠兹古镇',loc:'安徽省芜湖市鸠江区陈棱路与徽州路交汇处西北角',num:''},
-        {id:8,name:'临江桥',loc:'安徽省芜湖市',num:''},
-        {id:9,name:'芜湖大剧院',loc:'安徽芜湖市镜湖区滨江路17号',num:''}
-      ]
+      locationData: [
+        // { id: 1, name: "芜湖市", location: "中国安徽省芜湖市", num: "" },
+      ],
     };
   },
   computed: {},
@@ -46,7 +46,10 @@ export default {
   methods: {
     searchFu() {},
   },
-  created() {},
+  async created() {
+    const res = await getLoctionAPI();
+    this.locationData=res.data
+  },
   mounted() {},
   beforeCreate() {}, //生命周期 - 创建之前
   beforeMount() {}, //生命周期 - 挂载之前
@@ -68,7 +71,7 @@ export default {
   padding: 10px 15px 40px;
   overflow-y: auto;
   background-color: #fff;
-  .close{
+  .close {
     position: absolute;
     right: 20px;
     top: 20px;
@@ -100,27 +103,27 @@ export default {
       height: 30px;
       line-height: 30px;
       padding: 0px 0 0px 36px;
-      background-color: #F9F9F9;
+      background-color: #f9f9f9;
       border-radius: 5px;
     }
   }
-  .locationBox{
+  .locationBox {
     margin-top: 20px;
-    .row{
+    .row {
       padding-bottom: 15px;
-      border-bottom: 1px solid #E5E5E5;
+      border-bottom: 1px solid #e5e5e5;
       padding-top: 15px;
-      &>h3{
+      & > h3 {
         font-size: 16px;
         color: #393939;
       }
-      .row_floo{
+      .row_floo {
         margin: 10px 0 0;
         display: flex;
         justify-content: space-between;
         font-size: 14px;
         color: #868686;
-        .row_flooLL{
+        .row_flooLL {
           max-width: 80%;
         }
       }

+ 40 - 16
yfyc/src/views/Interact/index.vue

@@ -26,12 +26,15 @@
         v-for="item in dataShow"
         :key="item.id"
       >
-        <img :src="require(`@/assets/img/interact/row${item.id}.png`)" alt="" />
+        <img
+          v-lazy="require(`@/assets/img/interact/row${item.id}.png`)"
+          alt=""
+        />
         <div class="name">{{ item.name }}</div>
         <div class="author">
           <div class="author_ll">
             <img src="../../assets/img/interact/user.png" alt="" />
-            <span>{{ item.author }}</span>
+            <p>{{ item.author }}</p>
           </div>
           <div class="author_rr">{{ item.time }}</div>
         </div>
@@ -49,23 +52,23 @@
 </template>
 
 <script>
-import { getCodeAPI } from "@/api/interact.js";
+import { getCodeAPI, getDictAPI } from "@/api/interact.js";
 export default {
   components: {},
   data() {
     return {
       txt: "",
       bsData: [
-        { id: 1, name: "景点" },
-        { id: 2, name: "美食" },
-        { id: 3, name: "游玩" },
-        { id: 4, name: "酒店" },
+        // { id: 1, name: "景点" },
+        // { id: 2, name: "美食" },
+        // { id: 3, name: "游玩" },
+        // { id: 4, name: "酒店" },
       ],
       spotData: [
         {
           id: 1,
-          name: "方特梦幻王国万圣夜",
-          author: "王大锤",
+          name: "方特梦幻王国万圣夜方特梦幻王国万圣夜圣夜",
+          author: "王大锤王大锤王大锤王大锤王大锤",
           time: "2022-11-16",
         },
         { id: 2, name: "芜湖老海关", author: "孔连顺", time: "2022-11-16" },
@@ -121,6 +124,10 @@ export default {
 
     this.getList();
 
+    // 获取话题列表
+    const res1 = await getDictAPI("topic");
+    this.bsData = res1.data;
+
     let code = this.getQueryCode();
     if (code) {
       let res = await getCodeAPI(code);
@@ -131,7 +138,7 @@ export default {
           JSON.stringify({ ...res.data.wxUser, time: Date.now() })
         );
         this.$router.push("/layout/interact/issue");
-      } 
+      }
       // else {
       //   Toast.fail("登录失败,请联系管理人员");
       // }
@@ -256,7 +263,6 @@ export default {
       background-color: #f7f8fa;
       border-radius: 4px;
       color: #333333;
-
       &:nth-of-type(2n) {
         margin-right: 0;
       }
@@ -268,28 +274,46 @@ export default {
       }
 
       .name {
-        padding: 10px 10px 5px;
+        overflow: hidden;
+        text-overflow: ellipsis;
+        white-space: nowrap;
+
+        padding: 10px 8px 5px;
         font-size: 14px;
         font-weight: 700;
       }
 
       .author {
-        margin-top: 12px;
-        padding: 0 10px;
+        margin-top: 10px;
+        height: 20px;
+        padding: 0 8px;
         display: flex;
         align-items: center;
         justify-content: space-between;
         font-size: 12px;
 
         .author_ll {
-          vertical-align: middle;
-
+          height: 100%;
+          width: calc(100% - 65px);
+          display: flex;
+          align-items: center;
           & > img {
+            margin-top: -3px;
             margin-right: 5px;
             width: 12px;
             height: 12px;
             border-radius: 50%;
           }
+          p {
+            overflow: hidden;
+            text-overflow: ellipsis;
+            white-space: nowrap;
+
+            width: calc(100% - 18px);
+          }
+        }
+        .author_rr {
+          width: 61px;
         }
       }
     }