shaogen1995 vor 3 Jahren
Ursprung
Commit
a8abcbd5d7

+ 7 - 5
new_backstage/src/pages/info/statistics/index.vue

@@ -111,7 +111,7 @@ export default {
         {
           name: "各模块浏览量统计",
           time: [],
-          txt: ["数字史馆", "精品典藏", "纪念扫", "学习园地", "我要留言"],
+          txt: ["数字史馆", "精品典藏", "纪念扫", "学习园地", "我要留言"],
           title: "浏览量(次)",
           className: "ech_one",
         },
@@ -142,7 +142,7 @@ export default {
       if(Number(temp2[0])>Number(temp1[0])&&Number(temp2[1])>Number(temp1[1])){
         return this.$message.warning('时间范围不能超过1年');
       } 
-      this.getReportVote(this.timeLast[0],this.timeLast[1])
+      this.getReportVote(this.timeLast[0]+' 00:00:00',this.timeLast[1]+' 23:59:59')
       // this.$message.success('查询成功')
     },
     // 点击查询
@@ -155,11 +155,11 @@ export default {
         return this.$message.warning('时间范围不能超过1年');
       } 
       if (index === 0) {
-        this.getReportVisit(item.time[0],item.time[1]);
+        this.getReportVisit(item.time[0]+' 00:00:00',item.time[1]+' 23:59:59');
       } else if (index === 1) {
-        this.getReportUser(item.time[0],item.time[1]);
+        this.getReportUser(item.time[0]+' 00:00:00',item.time[1]+' 23:59:59');
       } else if (index === 2) {
-        this.getReportInteract(item.time[0],item.time[1]);
+        this.getReportInteract(item.time[0]+' 00:00:00',item.time[1]+' 23:59:59');
       }
       // this.$message.success('查询成功')
     },
@@ -324,10 +324,12 @@ export default {
     });
     //  当前时间 格式2022-02-10
     let nowTime = moment(new Date()).format("YYYY-MM-DD");
+    nowTime=nowTime+' 23:59:59'
     // 一个月之前 格式2022-01-10
     let nowTimeBefore = moment(new Date())
       .subtract(1, "months")
       .format("YYYY-MM-DD");
+      nowTimeBefore=nowTimeBefore+' 00:00:00'
     // console.log(nowTime, nowTimeBefore);
     // 设置初始时间为当前时间和前一个月
     this.ecBox.forEach((v) => {

+ 65 - 2
web/package-lock.json

@@ -2149,6 +2149,14 @@
       "integrity": "sha1-3TeelPDbgxCwgpH51kwyCXZmF/0=",
       "dev": true
     },
+    "async-validator": {
+      "version": "1.8.5",
+      "resolved": "https://registry.npmmirror.com/async-validator/-/async-validator-1.8.5.tgz",
+      "integrity": "sha512-tXBM+1m056MAX0E8TL2iCjg8WvSyXu0Zc8LNtYqrVeyoL3+esHRZ4SieE9fKQyyU09uONjnMEjrNBMqT0mbvmA==",
+      "requires": {
+        "babel-runtime": "6.x"
+      }
+    },
     "asynckit": {
       "version": "0.4.0",
       "resolved": "http://registry.npm.taobao.org/asynckit/download/asynckit-0.4.0.tgz",
@@ -2233,6 +2241,11 @@
         "resolve": "^1.12.0"
       }
     },
+    "babel-helper-vue-jsx-merge-props": {
+      "version": "2.0.3",
+      "resolved": "https://registry.npmmirror.com/babel-helper-vue-jsx-merge-props/-/babel-helper-vue-jsx-merge-props-2.0.3.tgz",
+      "integrity": "sha512-gsLiKK7Qrb7zYJNgiXKpXblxbV5ffSwR0f5whkPAaBAR4fhi6bwRZxX9wBlIc5M/v8CCkXUbXZL4N/nSE97cqg=="
+    },
     "babel-loader": {
       "version": "8.1.0",
       "resolved": "https://registry.npm.taobao.org/babel-loader/download/babel-loader-8.1.0.tgz?cache=0&sync_timestamp=1584715910722&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fbabel-loader%2Fdownload%2Fbabel-loader-8.1.0.tgz",
@@ -2255,6 +2268,27 @@
         "object.assign": "^4.1.0"
       }
     },
+    "babel-runtime": {
+      "version": "6.26.0",
+      "resolved": "https://registry.npmmirror.com/babel-runtime/-/babel-runtime-6.26.0.tgz",
+      "integrity": "sha512-ITKNuq2wKlW1fJg9sSW52eepoYgZBggvOAHC0u/CYu/qxQ9EVzThCgR69BnSXLHjy2f7SY5zaQ4yt7H9ZVxY2g==",
+      "requires": {
+        "core-js": "^2.4.0",
+        "regenerator-runtime": "^0.11.0"
+      },
+      "dependencies": {
+        "core-js": {
+          "version": "2.6.12",
+          "resolved": "https://registry.npmmirror.com/core-js/-/core-js-2.6.12.tgz",
+          "integrity": "sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ=="
+        },
+        "regenerator-runtime": {
+          "version": "0.11.1",
+          "resolved": "https://registry.npmmirror.com/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz",
+          "integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg=="
+        }
+      }
+    },
     "balanced-match": {
       "version": "1.0.0",
       "resolved": "http://registry.npm.taobao.org/balanced-match/download/balanced-match-1.0.0.tgz",
@@ -3876,8 +3910,7 @@
     "deepmerge": {
       "version": "1.5.2",
       "resolved": "https://registry.npm.taobao.org/deepmerge/download/deepmerge-1.5.2.tgz?cache=0&sync_timestamp=1572279720382&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fdeepmerge%2Fdownload%2Fdeepmerge-1.5.2.tgz",
-      "integrity": "sha1-EEmdhohEza1P7ghC34x/bwyVp1M=",
-      "dev": true
+      "integrity": "sha1-EEmdhohEza1P7ghC34x/bwyVp1M="
     },
     "default-gateway": {
       "version": "5.0.5",
@@ -4332,6 +4365,26 @@
       "integrity": "sha1-R6riOulTwuyyKY4XaETP15wpsjg=",
       "dev": true
     },
+    "element-ui": {
+      "version": "2.15.6",
+      "resolved": "https://registry.npmmirror.com/element-ui/-/element-ui-2.15.6.tgz",
+      "integrity": "sha512-rcYXEKd/j2G0AgficAOk1Zd1AsnHRkhmrK4yLHmNOiimU2JfsywgfKUjMoFuT6pQx0luhovj8lFjpE4Fnt58Iw==",
+      "requires": {
+        "async-validator": "~1.8.1",
+        "babel-helper-vue-jsx-merge-props": "^2.0.0",
+        "deepmerge": "^1.2.0",
+        "normalize-wheel": "^1.0.1",
+        "resize-observer-polyfill": "^1.5.0",
+        "throttle-debounce": "^1.0.1"
+      },
+      "dependencies": {
+        "throttle-debounce": {
+          "version": "1.1.0",
+          "resolved": "https://registry.npmmirror.com/throttle-debounce/-/throttle-debounce-1.1.0.tgz",
+          "integrity": "sha512-XH8UiPCQcWNuk2LYePibW/4qL97+ZQ1AN3FNXwZRBNPPowo/NRU5fAlDCSNBJIYCKbioZfuYtMhG4quqoJhVzg=="
+        }
+      }
+    },
     "elliptic": {
       "version": "6.5.3",
       "resolved": "https://registry.npm.taobao.org/elliptic/download/elliptic-6.5.3.tgz?cache=0&sync_timestamp=1592493064833&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Felliptic%2Fdownload%2Felliptic-6.5.3.tgz",
@@ -7383,6 +7436,11 @@
       "integrity": "sha1-suHE3E98bVd0PfczpPWXjRhlBVk=",
       "dev": true
     },
+    "normalize-wheel": {
+      "version": "1.0.1",
+      "resolved": "https://registry.npmmirror.com/normalize-wheel/-/normalize-wheel-1.0.1.tgz",
+      "integrity": "sha512-1OnlAPZ3zgrk8B91HyRj+eVv+kS5u+Z0SCsak6Xil/kmgEia50ga7zfkumayonZrImffAxPU/5WcyGhzetHNPA=="
+    },
     "npm-run-path": {
       "version": "2.0.2",
       "resolved": "https://registry.npm.taobao.org/npm-run-path/download/npm-run-path-2.0.2.tgz?cache=0&sync_timestamp=1577053500910&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fnpm-run-path%2Fdownload%2Fnpm-run-path-2.0.2.tgz",
@@ -9026,6 +9084,11 @@
       "integrity": "sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8=",
       "dev": true
     },
+    "resize-observer-polyfill": {
+      "version": "1.5.1",
+      "resolved": "https://registry.npmmirror.com/resize-observer-polyfill/-/resize-observer-polyfill-1.5.1.tgz",
+      "integrity": "sha512-LwZrotdHOo12nQuZlHEmtuXdqGoOD0OhaxopaNFxWzInpEgaLWoVuAMbTzixuosCx2nEG58ngzW3vxdWoxIgdg=="
+    },
     "resolve": {
       "version": "1.17.0",
       "resolved": "https://registry.npm.taobao.org/resolve/download/resolve-1.17.0.tgz",

+ 4 - 3
web/package.json

@@ -10,13 +10,14 @@
   "dependencies": {
     "axios": "^0.19.2",
     "core-js": "^3.6.5",
+    "element-ui": "^2.15.6",
     "js-base64": "^3.6.1",
-    "vue": "^2.6.11",
-    "vue-chat-scroll": "^1.4.0",
-    "vue-router": "^3.2.0",
     "swiper": "^5.3.8",
     "v-viewer": "^1.6.4",
+    "vue": "^2.6.11",
     "vue-awesome-swiper": "^4.1.1",
+    "vue-chat-scroll": "^1.4.0",
+    "vue-router": "^3.2.0",
     "vuex": "^3.5.1"
   },
   "devDependencies": {

BIN
web/src/assets/dianzan/dianzan.png


BIN
web/src/assets/dianzan/ganlanlvT.png


BIN
web/src/assets/dianzan/ganlanlvZ.png


BIN
web/src/assets/dianzan/huyangjinT.png


BIN
web/src/assets/dianzan/huyangjinZ.png


BIN
web/src/assets/dianzan/jiyinhongT.png


BIN
web/src/assets/dianzan/jiyinhongZ.png


BIN
web/src/assets/dianzan/toupiao.png


+ 48 - 0
web/src/config/api.js

@@ -282,4 +282,52 @@ export function getNewsDetail(data, cb=()=>{}) {
   }).then((res) => {
     cb(res);
   });
+}
+
+// 获取精品典藏tab列表
+export const getTabList = () => {
+  return axios({
+    method: 'post',
+    url: 'api/web/goods/module/list',
+  })
+}
+
+// 保存网站访问量 数字史馆 精品典藏 ……
+export const setVisit = (type) => {
+  return axios({
+    method: 'get',
+    url: `api/web/visit/${type}`,
+  })
+}
+
+// 精品典藏的
+// 点赞
+export const goodsLikeApi = (data) => {
+  return axios({
+    method: 'post',
+    url: 'cms/web/manage/goods/like',
+    data
+  })
+}
+// 取消点赞
+export const goodsLikeDelApi = (goodsId) => {
+  return axios({
+    method: 'get',
+    url: `cms/web/manage/goods/like/del/${goodsId}`,
+  })
+}
+// 投票
+export const goodsVoteApi = (data) => {
+  return axios({
+    method: 'post',
+    url: 'cms/web/manage/goods/vote',
+    data
+  })
+}
+// 取消投票
+export const goodsVoteDelApi = (goodsId) => {
+  return axios({
+    method: 'get',
+    url: `cms/web/manage/goods/vote/del/${goodsId}`,
+  })
 }

+ 2 - 1
web/src/config/http.js

@@ -2,7 +2,8 @@ import axios from 'axios'
 
 var isProduction = process.env.NODE_ENV === 'production'
 
-const serverName = isProduction ? '/' : 'http://192.168.0.245:8003/'
+// const serverName = isProduction ? '/' : 'http://192.168.0.245:8003/'
+const serverName = isProduction ? "/" : "http://192.168.0.135:8003/"
 
 const orginLink = window.location.origin
 

+ 1 - 0
web/src/main.js

@@ -5,6 +5,7 @@ import vuex from 'vuex'
 import VueChatScroll from "vue-chat-scroll";
 import 'viewerjs/dist/viewer.css'
 import Viewer from 'v-viewer'
+
 Vue.use(Viewer,{
   defaultOptions: {
     navbar:false,

+ 175 - 50
web/src/views/collection/Collection.vue

@@ -1,18 +1,74 @@
 <template>
   <div class="collection">
-    <div class="d-body" v-if="paging.total>0">
+    <div class="d-body" v-if="paging.total > 0">
       <ul>
-        <li class="collectionHover" @click="clickItem(item)" v-for="(item,i) in tableData" :key="i">
+        <li
+          class="collectionHover"
+          @mouseenter="moveLike=i"
+          @mouseleave="moveLike=null"
+          @click="clickItem($event, item)"
+          v-for="(item, i) in tableData"
+          :key="i"
+        >
           <div>
-            <img :src="item.thumb" :alt="item.title">
+            <!-- 点赞和投票 -->
+            <i class="like" v-show="moveLike===i">
+              <img
+                v-if="item.isLike"
+                v-show="likeOFF.isLike"
+                class="like_img"
+                :src="require(`@/assets/dianzan/${theme}Z.png`)"
+                alt=""
+                title="取消点赞"
+                @click="praiseNo(item.id)"
+              />
+              <img
+                v-else
+                v-show="likeOFF.isLike"
+                class="like_img"
+                src="../../assets/dianzan/dianzan.png"
+                alt=""
+                title="点赞"
+                @click="praise(item.id)"
+              />
+              <img
+                v-if="item.isVote"
+                v-show="likeOFF.isVote"
+                class="like_img"
+                :src="require(`@/assets/dianzan/${theme}T.png`)"
+                alt=""
+                title="取消投票"
+                @click="voteNo(item.id)"
+              />
+              <img
+                v-else
+                v-show="likeOFF.isVote"
+                class="like_img"
+                src="../../assets/dianzan/toupiao.png"
+                alt=""
+                title="投票"
+                @click="vote(item.id)"
+              />
+            </i>
+            <img :src="item.thumb" :alt="item.title" />
           </div>
           <div>
-            <span :title="item.name">{{item.name||'-'}}</span>
-            <img :src="require('@/assets/images/xinjiang/enter.png')" alt="">
+            <span :title="item.name">{{ item.name || "-" }}</span>
+            <img :src="require('@/assets/images/xinjiang/enter.png')" alt="" />
           </div>
         </li>
       </ul>
-      <Paging class="paging" @changeCurrent="data=>{this.$emit('changeCurrent',data)}" v-if="paging.total>0" :paging="paging" />
+      <Paging
+        :key="likeOFF.id"
+        class="paging"
+        @changeCurrent="
+          (data) => {
+            this.$emit('changeCurrent', data);
+          }
+        "
+        v-if="paging.total > 0"
+        :paging="paging"
+      />
     </div>
 
     <div class="norecord" v-else>暂无数据</div>
@@ -20,40 +76,95 @@
 </template>
 
 <script>
-import Paging from '@/components/Paging'
+import "element-ui/lib/theme-chalk/index.css";
+import { Notification } from "element-ui";
+import { goodsLikeApi, goodsLikeDelApi, goodsVoteApi,goodsVoteDelApi } from "@/config/api";
+import Paging from "@/components/Paging";
 
 export default {
-  props:{
-    tableData:Array,
-    paging:Object
+  name: "GOODSLIKE",
+  props: {
+    tableData: Array,
+    paging: Object,
+    likeOFF: {
+      type: Object,
+      default: () => {},
+    },
   },
-  components:{
-    Paging
+  components: {
+    Paging,
   },
-  data(){
+  data() {
     return {
-      
-    }
-    
+      moveLike:null
+    };
   },
-  mounted(){
-  },
-  watch:{
-  
-  },
-  methods:{
-    clickItem(item){
+  mounted() {},
+  watch: {},
+  methods: {
+    clickItem(e, item) {
+      if (
+        e.path[0] &&
+        (e.path[0].className === "like_img" || e.path[0].className === "like")
+      )
+        return;
       this.$showBroadcast({
         item,
-        zhuti:this.theme
-      })
+        zhuti: this.theme,
+      });
     },
-  }
-}
+    // 点击点赞
+    async praise(id) {
+      let res = await goodsLikeApi({
+        goodsId: id,
+        goodsModuleId: this.likeOFF.id,
+      });
+      if (res.code === 0) {
+        this.infoTitle("点赞成功", "success");
+        this.$emit('upLike')
+      }
+    },
+    //点击取消点赞
+    async praiseNo(id) {
+      let res = await goodsLikeDelApi(id);
+      if (res.code === 0) {
+        this.infoTitle("取消点赞成功", "success");
+        this.$emit('upLike')
+      }
+    },
+    // 点击投票
+    async vote(id) {
+      let res = await goodsVoteApi({
+        goodsId: id,
+        goodsModuleId: this.likeOFF.id,
+      });
+      if (res.code === 0) {
+        this.infoTitle("投票成功", "success");
+        this.$emit('upLike')
+      }
+    },
+    // 点击取消投票
+   async voteNo(id) {
+      let res = await goodsVoteDelApi(id);
+      if (res.code === 0) {
+        this.infoTitle("取消投票成功", "success");
+        this.$emit('upLike')
+      }
+    },
+    // 封装消息提示信息
+    infoTitle(title, type) {
+      Notification({
+        title,
+        type,
+        position: "bottom-right",
+      });
+    },
+  },
+};
 </script>
 
 <style lang="less" scoped>
-.collection{
+.collection {
   position: relative;
   margin: 0 auto;
   width: 100%;
@@ -61,17 +172,17 @@ export default {
   justify-content: space-between;
   align-items: flex-start;
   min-height: 30vh;
-  
-  .d-body{
+
+  .d-body {
     width: 100%;
     text-align: center;
     position: relative;
     padding-bottom: 30px;
-    >ul{
+    > ul {
       width: 100%;
       min-height: 70vh;
       text-align: left;
-      >li{
+      > li {
         font-size: 0;
         display: inline-block;
         width: 310px;
@@ -79,25 +190,25 @@ export default {
         text-align: center;
         margin-bottom: 18px;
         cursor: pointer;
-        &:nth-child(3n){
+        &:nth-child(3n) {
           margin-right: 0;
         }
-        >div{
-          background: linear-gradient(180deg, #A2A2A2 0%, #606060 100%);
-          &:first-child{
+        > div {
+          background: linear-gradient(180deg, #a2a2a2 0%, #606060 100%);
+          &:first-child {
             height: 200px;
             position: relative;
             overflow: hidden;
-            >img{
+            > img {
               position: absolute;
               top: 50%;
               left: 50%;
-              transform: translate(-50%,-50%);
+              transform: translate(-50%, -50%);
               width: 100%;
             }
           }
 
-          &:last-child{
+          &:last-child {
             height: 50px;
             padding: 0 12px;
             display: flex;
@@ -106,7 +217,7 @@ export default {
             background: #fff;
             color: #333;
             box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.16);
-            >span{
+            > span {
               width: calc(100% - 40px);
               white-space: nowrap;
               text-overflow: ellipsis;
@@ -115,17 +226,16 @@ export default {
               font-weight: bold;
               text-align: left;
             }
-            >img{
+            > img {
               width: 30px;
               height: 30px;
             }
           }
-          
         }
-        &:hover{
-          >div{
-            &:last-child{
-              >span{
+        &:hover {
+          > div {
+            &:last-child {
+              > span {
                 color: #fff;
               }
             }
@@ -133,19 +243,34 @@ export default {
         }
       }
     }
-    .paging{
+    .paging {
       margin-top: 40px;
       font-weight: normal;
     }
   }
-  
-  .norecord{
+
+  .norecord {
     position: absolute;
     top: 50%;
     left: 50%;
-    transform: translate(-50%,-50%);
+    transform: translate(-50%, -50%);
     font-size: 16px;
     color: #000;
   }
+  .collectionHover {
+    position: relative;
+    .like {
+      padding: 5px;
+      z-index: 999;
+      position: absolute;
+      right: 0;
+      top: 0px;
+      & > img {
+        width: 24px;
+        height: 24px;
+        margin-right: 5px;
+      }
+    }
+  }
 }
 </style>

+ 76 - 41
web/src/views/collection/index.vue

@@ -10,9 +10,9 @@
         <ul slot="content" class="content">
           <li
             v-for="(item, i) in type"
-            @click="acitve = item.id"
+            @click="cutTab(item)"
             class="liparimary"
-            :class="{ active: acitve == item.id }"
+            :class="{ active: acitveId == item.id }"
             :key="i"
           >
             <span>{{ item.name }}</span>
@@ -20,7 +20,13 @@
         </ul>
       </maside>
       <div slot="rcon" class="c-body">
-        <Collection :tableData="data" @changeCurrent="changeCurrent" :paging="paging" />
+        <Collection
+          :likeOFF="likeOFF"
+          :tableData="data"
+          @changeCurrent="changeCurrent"
+          :paging="paging"
+          @upLike='upLike'
+        />
       </div>
     </lrLayout>
   </div>
@@ -28,77 +34,103 @@
 
 <script>
 import Collection from "./Collection";
-import { getList } from "@/config/api";
+import { getList, getTabList } from "@/config/api";
 import lrLayout from "@/components/lrLayout";
 
-let type = [
-  {
-    name: "实物模型",
-    en: "Shi Wu Mo Xing",
-    id: "model",
-    default: "type1.png",
-    active: "model.jpg",
-  },
-  {
-    name: "专题图库",
-    en: "Zhuan Ti Tu Ku",
-    id: "img",
-    default: "type2.png",
-    active: "img.jpg",
-  },
-  {
-    name: "视频档案",
-    en: "Shi Pin Dang An",
-    id: "video",
-    default: "type3.png",
-    active: "video.jpg",
-  },
-];
+// let type = [
+//   {
+//     name: "实物模型",
+//     en: "Shi Wu Mo Xing",
+//     id: "model",
+//     default: "type1.png",
+//     active: "model.jpg",
+//   },
+//   {
+//     name: "专题图库",
+//     en: "Zhuan Ti Tu Ku",
+//     id: "img",
+//     default: "type2.png",
+//     active: "img.jpg",
+//   },
+//   {
+//     name: "视频档案",
+//     en: "Shi Pin Dang An",
+//     id: "video",
+//     default: "type3.png",
+//     active: "video.jpg",
+//   },
+// ];
 export default {
+  name: "JPDC",
   components: {
     Collection,
-    lrLayout
+    lrLayout,
   },
   data() {
     return {
       data: [],
+      acitveId: 1,
       acitve: "model",
       title: {
         zh: "精品典藏",
         pinyin: "Jing Pin Dian Cang",
       },
-      type,
+      type: [],
       paging: {
-        pageSize: 12,
+        pageSize: 1,
         pageNum: 1,
         total: 0,
         showSize: 8,
         current: 1,
       },
-      searchKey:''
+      searchKey: "",
+      // 控制点赞和投票的开关
+      likeOFF: {},
     };
   },
   watch: {
-    acitve() {
+    acitveId() {
       this.paging.pageNum == 1
         ? this.getCollection()
         : (this.paging.pageNum = 1);
     },
-    "paging.pageNum": function(newVal) {
+    "paging.pageNum": function (newVal) {
       console.log(newVal);
       this.getCollection();
     },
   },
-  mounted() {
+  async mounted() {
     this.getCollection();
+    //一进来页面先把控制点赞和投票的消息传给右边的列表
+    this.$nextTick(()=>{
+      setTimeout(() => {
+        this.likeOFF = this.type[0]
+      }, 100);
+    })
+    // 获取经典检查tab栏列表
+    let res = await getTabList();
+    // console.log(998,res);
+    this.type = res.data;
   },
   methods: {
-    changeCurrent(data){
-      this.paging.pageNum = data
+    // 点赞和投票成功了,重新发请求更新页面
+    upLike(){
+      this.getCollection();
     },
-    handleSearch(data){
-      this.searchKey = data
-      this.getCollection()
+    // 点击左侧TAB栏
+    cutTab(item) {
+      this.acitve = item.type;
+      this.acitveId = item.id;
+      // 把点赞和投票的开关传给列表
+      this.likeOFF = item;
+    },
+
+    changeCurrent(data) {
+      this.paging.pageNum = data;
+    },
+    handleSearch(data) {
+      this.searchKey = data;
+      this.getCollection();
     },
     async getCollection(key = null) {
       getList(
@@ -107,7 +139,8 @@ export default {
           pageNum: this.paging.pageNum,
           pageSize: this.paging.pageSize,
           type: this.acitve,
-          searchKey: key||this.searchKey,
+          goodsModuleId: this.acitveId,
+          searchKey: key || this.searchKey,
         },
         (result) => {
           this.data = result.data.list;
@@ -136,7 +169,9 @@ export default {
     .content {
       background: #fff;
       width: 100%;
-     
+      max-height: 480px;
+      overflow-y: auto;
+
       > li {
         height: 80px;
         line-height: 80px;

+ 9 - 2
web/src/views/layout/header.vue

@@ -79,7 +79,7 @@ import { mapState } from "vuex";
 
 import { formatDate } from "@/config/utils.js";
 
-import { getUserInfo,logout } from "@/config/api";
+import { getUserInfo,logout,setVisit } from "@/config/api";
 
 
 const navs = [
@@ -87,26 +87,31 @@ const navs = [
     name: "数字史馆",
     link: "/",
     id: 1,
+    type:'scene'
   },
   {
     name: "精品典藏",
     link: "/collection",
     id: 2,
+    type:'goods'
   },
   {
     name: "纪念祭扫",
     link: "/spirit",
     id: 3,
+    type:'martyr'
   },
   {
     name: "学习园地",
     link: "/dynamic/list/info/none",
     id: 4,
+    type:'news'
   },
   {
     name: "我要留言",
     link: "/message",
     id: 5,
+    type:'comment'
   },
 ];
 
@@ -191,11 +196,13 @@ export default {
       this.$store.dispatch("changeTheme", id);
       document.getElementById("app").className = "theme" + id;
     },
-    navigateTo(item) {
+   async navigateTo(item) {
       this.activeIdx = item.id;
       this.$router.push({
         path:item.link
       })
+      // 记录点击次数
+    await setVisit(item.type)
     },
   },
   mounted() {