wbspool hace 4 años
padre
commit
261737bcd5

+ 2 - 1
package.json

@@ -27,7 +27,8 @@
     "vue": "^2.7.8",
     "vue-awesome-swiper": "4.1.1",
     "vue-i18n": "8",
-    "vue-router": "^3.5.4"
+    "vue-router": "^3.5.4",
+    "vuex": "^4.1.0"
   },
   "devDependencies": {
     "@antfu/eslint-config": "^0.25.2",

+ 6 - 0
src/common/config/api.js

@@ -24,6 +24,12 @@ const api = {
         comment:`${root}/cms/comment`,
         listComments:`${root}/cms/listComments`,
         listVipMagazines:`${root}/cms/listVipMagazines`,
+        categorys:`${root}/cms/categorys`,
+        myCollectArticles:`${root}/cms/myCollectArticles`,
+        mySubArticles:`${root}/cms/mySubArticles`,
+        myLikeArticles:`${root}/cms/myLikeArticles`,
+        myViewArticles:`${root}/cms/myViewArticles`,
+        myCommentArticles:`${root}/cms/myCommentArticles`,
     },
     mzUser:{
         login:`${root}/mzUser/login`,

+ 9 - 1
src/pc/App.vue

@@ -6,13 +6,21 @@
 </template>
 <script>
   export default {
-    created() {
+    async created() {
+
+
 
       let $t = this.$t;
       this.$t = (e)=>{
           return $t(e) ? $t(e) : e;
       }
 
+      let resp = await this.$http.post(this.$api.mzUser.userinfo);
+
+      if (resp.data.status === 200) {
+         this.$store.commit('UPDATE_LOGIN_INFO',resp.data.data.mzUser)
+      }
+
     }
   }
 </script>

+ 5 - 5
src/pc/components/layout-user/layout-user-header.vue

@@ -12,18 +12,18 @@
           <div
             class="w-120px h-120px rounded-full border-white border-1px border-solid mr-20px"
           >
-            <img src="/imgs/avatar.png" class="object-cover w-full h-full" />
+            <img :src="$store.state.userinfo.avatarUrl" class="object-cover w-full h-full rounded-full" />
           </div>
 
           <div>
-            <div class="text-size-20px text-white">cyt</div>
+            <div class="text-size-20px text-white">{{$store.state.userinfo.nickname}}</div>
             <div class="h-26px"></div>
-            <div class="text-size-16px text-white">2342342332@qq.com</div>
+            <div class="text-size-16px text-white">{{$store.state.userinfo.email}}</div>
           </div>
         </div>
-        <div class="flex items-center">
+        <div v-if="$store.state.userinfo.exipreVip" class="flex items-center">
           <div class="text-white text-size-18px mr-19px">
-            {{ $t("当前为月会员,有效期至2022年9月28日") }}
+            {{ $t("当前为月会员,有效期至") + $store.state.userinfo.vipStopStr}}
           </div>
           <div
             class="text-size-14px text-white w-80px h-30px bg-primary flex items-center justify-center rounded-full"

+ 30 - 8
src/pc/components/ui-nav-bar/ui-nav-bar.vue

@@ -19,7 +19,7 @@
       </div>
       <div class="w-40px"></div>
       <div
-        @click="typeVisible = !typeVisible"
+        @mouseenter="typeVisible = true"
         :class="`menu-item ${currentPath === '/specific-article' ? 'selected' : ''}`"
       >
         {{ $t("分类浏览") }}
@@ -64,11 +64,23 @@
       </div>
       <div class="w-40px"></div>
       <div
-        @click="$router.push('/user/personal-center')"
+              v-if="!$store.state.userinfo"
+        @click="$router.push('/login')"
         :class="`menu-item ${currentPath === '/login' ? 'selected' : ''}`"
       >
         {{ $t("登录注册") }}
       </div>
+
+      <div
+              v-else
+              @click="$router.push('/user/personal-center')"
+              :class="`menu-item ${currentPath === '/login' ? 'selected' : ''}`"
+              class="-align-center"
+      >
+          <img class="w-40px h-40px rounded-full mr-12px" v-if="$store.state.userinfo.avatar" :src="$store.state.userinfo.avatarUrl">
+          <span class="font-size-20px">{{$store.state.userinfo.nickname}}</span>
+      </div>
+
       <div class="w-44px"></div>
       <div
         @click="changeLang"
@@ -79,20 +91,22 @@
     </div>
     <div
       v-if="typeVisible"
+      @mouseenter="typeVisible = true"
+      @mouseleave="typeVisible = false"
       class="min-h-272px w-screen bg-white absolute top-80px z-50 flex justify-center pb-30px"
     >
       <div class="w-1200px flex flex-wrap">
         <div
           @click="() => {
-            $router.push('/specific-article')
+            $router.push('/specific-article?category=' + item.code + '&name=' + item.name)
             typeVisible = false
           }"
-          :class="`type-tag ${index === 0 ? 'selected' : ''}`"
-          v-for="(item, index) in 20"
+          :class="`type-tag ${$route.query.category === item.code ? 'selected' : ''}`"
+          v-for="(item, index) in cmsCategorys"
           :key="item"
         >
-          <div class="name">军事</div>
-          <div class="count">1523篇文章</div>
+          <div class="name">{{item.name}}</div>
+          <div class="count">{{item.artcileNum}}篇文章</div>
         </div>
       </div>
     </div>
@@ -122,9 +136,17 @@ export default {
     return {
       typeVisible: false,
       currentPath: this.$route.path,
-      lang: ['zh-CN','zh-TW']
+      lang: ['zh-CN','zh-TW'],
+      cmsCategorys:[]
     };
   },
+  async created() {
+    let resp = await  this.$http.post(this.$api.cms.categorys);
+    if(resp.data.status === 200){
+       this.cmsCategorys = resp.data.data.cmsCategorys;
+    }
+
+  }
 };
 </script>
 

+ 1 - 1
src/pc/components/ui-vip-article/ui-vip-article.vue

@@ -1,5 +1,5 @@
 <template>
-  <div class="h-157px flex items-center " v-bind="$attrs" @click="$router.push('product-detail')">
+  <div class="h-157px flex items-center " v-bind="$attrs" @click="$router.push('vip-list?refMagazine=' + item.code + '&title=' + `${$t('VIP期刊') + '-' +item.name + item.num + '期' }`)">
     <!-- <div class="mr-12.5px">
       
     </div> -->

+ 2 - 1
src/pc/main.js

@@ -1,6 +1,7 @@
 import Vue from "vue";
 import App from "@pc/App.vue";
 import VueI18n from "vue-i18n";
+import store from './store'
 
 import 'virtual:windi.css'
 import router from "@pc/router";
@@ -12,7 +13,6 @@ import '@pc/assets/css/index.css'
 import axios from "axios";
 import qs from "qs";
 import api from "../common/config/api";
-
 Vue.use(ElementUI);
 
 Vue.config.productionTip = false;
@@ -33,6 +33,7 @@ const i18n = new VueI18n({
 /* eslint-disable no-new */
 new Vue({
   el: "#app",
+  store,
   router,
   render: (h) => h(App),
   i18n,

+ 2 - 0
src/pc/pages/auth/login.vue

@@ -248,6 +248,8 @@
                 let resp = await  this.$http.post(this.$api.mzUser.login,this.$qs.stringify(this.loginForm));
 
                 if(resp.data.status === 200){
+                    this.$store.commit('UPDATE_LOGIN_INFO',resp.data.data.mzUser);
+
                     this.$message.success(this.$t('登录成功'));
                     this.$router.push('/profile-complete')
                 }else{

+ 21 - 87
src/pc/pages/realtime-news/realtime-news.vue

@@ -10,98 +10,15 @@
       <div class="flex justify-between">
         <div class="left w-860px">
           <div class="h-20px"></div>
-          <div v-for="item in 5" :key="item">
-            <ui-main-article></ui-main-article>
-            <div class="h-20px"></div>
-          </div>
-          <ui-shadow-box class="w-full h-100px mb-20px">
-            <img src="/imgs/split-pic-1.png" class="w-full h-full object-cover" />
-          </ui-shadow-box>
-          <div v-for="item in 5" :key="item">
-            <ui-main-article></ui-main-article>
-            <div class="h-20px"></div>
-          </div>
-          <ui-shadow-box class="w-full h-100px mb-20px">
-            <img src="/imgs/split-pic-2.png" class="w-full h-full object-cover" />
-          </ui-shadow-box>
-          <div v-for="item in 5" :key="item">
-            <ui-main-article></ui-main-article>
+          <div v-for="latestArt in latestArts" >
+            <ui-main-article :item="latestArt"></ui-main-article>
             <div class="h-20px"></div>
           </div>
         </div>
         <div class="right w-320px">
-          <div class="px-20px bg-white">
-            <div class="h-17px"></div>
-            <div class="relative inline-flex mb-6.5px">
-              <img src="/imgs/hot.png" class="w-24px h-auto mr-4px" />
-              <div class="font-thin text-[#000] text-size-20px">{{ $t("热榜文章") }}</div>
-
-              <div
-                class="w-full h-3px absolute left-0 bottom-[-7.5px] bg-primary rounded-full"
-              ></div>
-            </div>
-            <ui-devider></ui-devider>
-            <div class="h-21px"></div>
-            <ui-swiper
-              class="mb-20px"
-              :items="[
-                { url: '/imgs/article_cover1.png', title: '这是标题' },
-              { url: '/imgs/article_cover1.png', title: '这是标题' },
-              ]"
-              titleClass="swiper-title"
-            ></ui-swiper>
-            <ui-devider></ui-devider>
-
-            <div v-for="item in 9" :key="item">
-              <ui-small-article></ui-small-article>
-              <ui-devider></ui-devider>
-            </div>
-          </div>
+          <ui-hot-article></ui-hot-article>
           <div class="h-20px"></div>
-          <div class="px-20px bg-white">
-            <div class="h-17px"></div>
-            <div class="relative flex mb-6.5px justify-between item-center">
-              <div class="inline-flex">
-                <img src="/imgs/vip.png" class="w-24px h-auto mr-4px" />
-                <div class="font-thin text-[#000] text-size-20px">
-                  {{ $t("VIP期刊") }}
-                </div>
-              </div>
-              <el-button
-                type="text"
-                class="!p-0 !text-size-14px !font-normal !text-[#686868]"
-                >查看更多</el-button
-              >
-
-              <div
-                class="w-full h-3px absolute left-0 bottom-[-7.5px] bg-primary rounded-full"
-              ></div>
-            </div>
-            <ui-devider></ui-devider>
-            <div class="h-21px"></div>
-
-            <ui-swiper
-              class="mb-20px"
-              :items="[
-                { url: 'imgs/article_cover1.png', title: '这是标题' },
-                { url: 'imgs/article_cover1.png', title: '这是标题' },
-              ]"
-              titleClass="swiper-title"
-            ></ui-swiper>
-            <ui-swiper
-              class="mb-20px"
-              :items="[
-                { url: 'imgs/article_cover1.png', title: '这是标题' },
-                { url: 'imgs/article_cover1.png', title: '这是标题' },
-              ]"
-              titleClass="swiper-title"
-            ></ui-swiper>
-            <ui-devider></ui-devider>
-            <div v-for="item in 10" :key="item">
-              <ui-vip-article></ui-vip-article>
-              <ui-devider></ui-devider>
-            </div>
-          </div>
+          <ui-vip-magazine></ui-vip-magazine>
         </div>
       </div>
     </div>
@@ -119,8 +36,25 @@ export default {
         { url: "/imgs/banner1.png", title: "這裏是輪播圖推薦內容標題" },
         { url: "/imgs/banner1.png", title: "這裏是輪播圖推薦內容標題" },
       ],
+      latestArts: [],
+      pageIndex: 1
     };
   },
+  methods: {
+    async loadLatestArts(pageIndex) {
+      let resp = await this.$http.post(this.$api.cms.articles, this.$qs.stringify(Object.assign(this.$route.query,{pageIndex: pageIndex,type:'2'})));
+      if (resp.data.status === 200) {
+        if(pageIndex === 1){
+          this.latestArts = resp.data.data.cmsArticles;
+        }else{
+          this.latestArts.push(...resp.data.data.cmsArticles);
+        }
+      }
+    }
+  },
+  async created() {
+    this.loadLatestArts(this.pageIndex);
+  }
 };
 </script>
 <style>

+ 32 - 88
src/pc/pages/specific-article/specific-article.vue

@@ -8,101 +8,19 @@
               class="w-80px h-3px absolute left-0 top--3px bg-primary rounded-full"
             ></div>
 
-            <div class="font-thin text-[#000] text-size-20px">{{ $t("军事") }}</div>
+            <div class="font-thin text-[#000] text-size-20px">{{ $route.query.name }}</div>
           </ui-shadow-box>
           <div class="h-20px"></div>
-          <div v-for="item in 5" :key="item">
-            <ui-main-article></ui-main-article>
-            <div class="h-20px"></div>
-          </div>
-          <ui-shadow-box class="w-full h-100px mb-20px">
-            <img src="/imgs/split-pic-1.png" class="w-full h-full object-cover" />
-          </ui-shadow-box>
-          <div v-for="item in 5" :key="item">
-            <ui-main-article></ui-main-article>
-            <div class="h-20px"></div>
-          </div>
-          <ui-shadow-box class="w-full h-100px mb-20px">
-            <img src="/imgs/split-pic-2.png" class="w-full h-full object-cover" />
-          </ui-shadow-box>
-          <div v-for="item in 5" :key="item">
-            <ui-main-article></ui-main-article>
+          <div v-for="item in latestArts" :key="item">
+            <ui-main-article :item="item"></ui-main-article>
             <div class="h-20px"></div>
           </div>
+
         </div>
         <div class="right w-320px">
-          <div class="px-20px bg-white">
-            <div class="h-17px"></div>
-            <div class="relative inline-flex mb-6.5px">
-              <img src="/imgs/hot.png" class="w-24px h-auto mr-4px" />
-              <div class="font-thin text-[#000] text-size-20px">{{ $t("热榜文章") }}</div>
-
-              <div
-                class="w-full h-3px absolute left-0 bottom-[-7.5px] bg-primary rounded-full"
-              ></div>
-            </div>
-            <ui-devider></ui-devider>
-            <div class="h-21px"></div>
-            <ui-swiper
-              class="mb-20px"
-              :items="[
-                { url: '/imgs/article_cover1.png', title: '这是标题' },
-              { url: '/imgs/article_cover1.png', title: '这是标题' },
-              ]"
-              titleClass="swiper-title"
-            ></ui-swiper>
-            <ui-devider></ui-devider>
-
-            <div v-for="item in 9" :key="item">
-              <ui-small-article></ui-small-article>
-              <ui-devider></ui-devider>
-            </div>
-          </div>
+          <ui-hot-article></ui-hot-article>
           <div class="h-20px"></div>
-          <div class="px-20px bg-white">
-            <div class="h-17px"></div>
-            <div class="relative flex mb-6.5px justify-between item-center">
-              <div class="inline-flex">
-                <img src="/imgs/vip.png" class="w-24px h-auto mr-4px" />
-                <div class="font-thin text-[#000] text-size-20px">
-                  {{ $t("VIP期刊") }}
-                </div>
-              </div>
-              <el-button
-                type="text"
-                class="!p-0 !text-size-14px !font-normal !text-[#686868]"
-                >查看更多</el-button
-              >
-
-              <div
-                class="w-full h-3px absolute left-0 bottom-[-7.5px] bg-primary rounded-full"
-              ></div>
-            </div>
-            <ui-devider></ui-devider>
-            <div class="h-21px"></div>
-
-            <ui-swiper
-              class="mb-20px"
-              :items="[
-                { url: 'imgs/article_cover1.png', title: '这是标题' },
-                { url: 'imgs/article_cover1.png', title: '这是标题' },
-              ]"
-              titleClass="swiper-title"
-            ></ui-swiper>
-            <ui-swiper
-              class="mb-20px"
-              :items="[
-                { url: 'imgs/article_cover1.png', title: '这是标题' },
-                { url: 'imgs/article_cover1.png', title: '这是标题' },
-              ]"
-              titleClass="swiper-title"
-            ></ui-swiper>
-            <ui-devider></ui-devider>
-            <div v-for="item in 10" :key="item">
-              <ui-vip-article></ui-vip-article>
-              <ui-devider></ui-devider>
-            </div>
-          </div>
+          <ui-vip-magazine></ui-vip-magazine>
         </div>
       </div>
     </div>
@@ -120,8 +38,34 @@ export default {
         { url: "/imgs/banner1.png", title: "這裏是輪播圖推薦內容標題" },
         { url: "/imgs/banner1.png", title: "這裏是輪播圖推薦內容標題" },
       ],
+      latestArts: [],
+      pageIndex: 1
     };
   },
+  watch:{
+     '$route.query.category':{
+         immediate:true,
+         handler(){
+            this.pageIndex = 1;
+            this.loadLatestArts(this.pageIndex);
+         }
+     }
+  },
+  methods: {
+    async loadLatestArts(pageIndex) {
+      let resp = await this.$http.post(this.$api.cms.articles, this.$qs.stringify(Object.assign(this.$route.query,{pageIndex: pageIndex})));
+      if (resp.data.status === 200) {
+         if(pageIndex === 1){
+           this.latestArts = resp.data.data.cmsArticles;
+         }else{
+           this.latestArts.push(...resp.data.data.cmsArticles);
+         }
+      }
+    }
+  },
+  async created() {
+    this.loadLatestArts(this.pageIndex);
+  }
 };
 </script>
 <style>

+ 39 - 6
src/pc/pages/user/user-collection.vue

@@ -4,18 +4,51 @@
     <ui-title-devider title="我的收藏"></ui-title-devider>
     <div class="px-40px">
       <div class="h-20px"></div>
-      <ui-main-article class="mb-20px">
-        <!-- <img src="/imgs/star.png" slot="right" class="w-28px right-19px bottom-10px absolute"/> -->
-        <img src="/imgs/star-blank.png" slot="right" class="w-28px right-19px bottom-10px absolute"/>
+      <ui-main-article v-for="item in articles" :item="item" class="mb-20px">
+         <img @click.stop="handleCancel(item)" v-if="item.collect" src="/imgs/star.png" slot="right" class="w-28px right-19px bottom-10px absolute"/>
+<!--          <img src="/imgs/star-blank.png" slot="right" class="w-28px right-19px bottom-10px absolute"/>-->
       </ui-main-article>
-      <ui-main-article class="mb-20px"></ui-main-article>
-      <ui-main-article class="mb-20px"></ui-main-article>
+
     </div>
   </div>
 </template>
 
 <script>
-export default {};
+export default {
+  data(){
+      return {
+        articles:[]
+      }
+  },
+  methods:{
+    handleCancel(){
+
+    },
+    async handleLoad(){
+      let resp = await this.$http.post(this.$api.cms.myCollectArticles,this.$qs.stringify({onPage:false}));
+      this.articles = resp.data.data.cmsArticles;
+
+    },
+    async handleCancel(item){
+
+      await this.$confirm('您现在正在进行取消收藏操作, 是否继续?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      });
+
+      let resp = await  this.$http.post(this.$api.cms.collect,this.$qs.stringify({refArticle:item.code}));
+      if(resp.data.status === 200){
+        this.handleLoad();
+      }
+
+    }
+  },
+  async created() {
+    this.handleLoad();
+  }
+
+};
 </script>
 
 <style lang="scss" scoped></style>

+ 52 - 18
src/pc/pages/user/user-comment.vue

@@ -1,20 +1,54 @@
 <template>
-    <div>
-      <div class="h-34px"></div>
-      <ui-title-devider title="我的评论"></ui-title-devider>
-      <div class="px-40px">
-        <div class="h-20px"></div>
-        <ui-main-article v-for="item in 4" class="mb-20px">
-          
-          
-        </ui-main-article>
-      </div>
+  <div>
+    <div class="h-34px"></div>
+    <ui-title-devider title="我的评论"></ui-title-devider>
+    <div class="px-40px">
+      <div class="h-20px"></div>
+      <ui-main-article v-for="item in articles" :item="item" class="mb-20px">
+<!--        <img @click.stop="handleCancel(item)" v-if="item.collect" src="/imgs/star.png" slot="right" class="w-28px right-19px bottom-10px absolute"/>-->
+        <!--          <img src="/imgs/star-blank.png" slot="right" class="w-28px right-19px bottom-10px absolute"/>-->
+      </ui-main-article>
+
     </div>
-  </template>
-  
-  <script>
-  export default {};
-  </script>
-  
-  <style lang="scss" scoped></style>
-  
+  </div>
+</template>
+
+<script>
+  export default {
+    data(){
+      return {
+        articles:[]
+      }
+    },
+    methods:{
+      handleCancel(){
+
+      },
+      async handleLoad(){
+        let resp = await this.$http.post(this.$api.cms.myCommentArticles,this.$qs.stringify({onPage:false}));
+        this.articles = resp.data.data.cmsArticles;
+
+      },
+      async handleCancel(item){
+
+        await this.$confirm('您现在正在进行取消收藏操作, 是否继续?', '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        });
+
+        let resp = await  this.$http.post(this.$api.cms.collect,this.$qs.stringify({refArticle:item.code}));
+        if(resp.data.status === 200){
+          this.handleLoad();
+        }
+
+      }
+    },
+    async created() {
+      this.handleLoad();
+    }
+
+  };
+</script>
+
+<style lang="scss" scoped></style>

+ 55 - 18
src/pc/pages/user/user-history.vue

@@ -1,20 +1,57 @@
 <template>
-    <div>
-      <div class="h-34px"></div>
-      <ui-title-devider title="我的收藏"></ui-title-devider>
-      <div class="px-40px">
-        <div class="h-20px"></div>
-        <ui-main-article v-for="item in 4" class="mb-20px">
-          
-          
-        </ui-main-article>
-      </div>
+  <div>
+    <div class="h-34px"></div>
+    <ui-title-devider title="我的浏览记录"></ui-title-devider>
+    <div class="px-40px">
+      <div class="h-20px"></div>
+      <ui-main-article v-for="item in articles" :item="item" class="mb-20px">
+<!--        <img @click.stop="handleCancel(item)" v-if="item.like" src="/imgs/like-button-checked.png" slot="right" class="w-28px right-19px bottom-10px absolute"/>-->
+        <!--          <img src="/imgs/star-blank.png" slot="right" class="w-28px right-19px bottom-10px absolute"/>-->
+      </ui-main-article>
+
     </div>
-  </template>
-  
-  <script>
-  export default {};
-  </script>
-  
-  <style lang="scss" scoped></style>
-  
+  </div>
+</template>
+
+<script>
+  export default {
+    data(){
+      return {
+        articles:[]
+      }
+    },
+    methods:{
+      handleCancel(){
+
+      },
+      async handleLoad(){
+        let resp = await this.$http.post(this.$api.cms.myViewArticles,this.$qs.stringify({onPage:false}));
+        this.articles = resp.data.data.cmsArticles;
+
+      },
+      async handleCancel(item){
+
+        await this.$confirm('您现在正在进行取消点赞操作, 是否继续?', '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        });
+
+        let resp = await  this.$http.post(this.$api.cms.like,this.$qs.stringify({refArticle:item.code}));
+        if(resp.data.status === 200){
+          this.handleLoad();
+        }
+
+      }
+    },
+    async created() {
+      this.handleLoad();
+    }
+
+  };
+</script>
+
+<style lang="scss" scoped></style>
+
+
+

+ 43 - 9
src/pc/pages/user/user-like.vue

@@ -1,23 +1,57 @@
 <template>
   <div>
     <div class="h-34px"></div>
-    <ui-title-devider title="我的收藏"></ui-title-devider>
+    <ui-title-devider title="我的点赞"></ui-title-devider>
     <div class="px-40px">
       <div class="h-20px"></div>
-      <ui-main-article v-for="item in 4" class="mb-20px">
-        
-        <img
-          src="/imgs/like-button-checked.png"
-          slot="right"
-          class="w-28px right-19px bottom-10px absolute"
-        />
+      <ui-main-article v-for="item in articles" :item="item" class="mb-20px">
+        <img @click.stop="handleCancel(item)" v-if="item.like" src="/imgs/like-button-checked.png" slot="right" class="w-28px right-19px bottom-10px absolute"/>
+        <!--          <img src="/imgs/star-blank.png" slot="right" class="w-28px right-19px bottom-10px absolute"/>-->
       </ui-main-article>
+
     </div>
   </div>
 </template>
 
 <script>
-export default {};
+  export default {
+    data(){
+      return {
+        articles:[]
+      }
+    },
+    methods:{
+      handleCancel(){
+
+      },
+      async handleLoad(){
+        let resp = await this.$http.post(this.$api.cms.myCollectArticles,this.$qs.stringify({onPage:false}));
+        this.articles = resp.data.data.cmsArticles;
+
+      },
+      async handleCancel(item){
+
+        await this.$confirm('您现在正在进行取消点赞操作, 是否继续?', '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        });
+
+        let resp = await  this.$http.post(this.$api.cms.like,this.$qs.stringify({refArticle:item.code}));
+        if(resp.data.status === 200){
+          this.handleLoad();
+        }
+
+      }
+    },
+    async created() {
+      this.handleLoad();
+    }
+
+  };
 </script>
 
 <style lang="scss" scoped></style>
+
+
+

+ 40 - 12
src/pc/pages/user/user-subscription.vue

@@ -1,26 +1,54 @@
 <template>
   <div>
     <div class="h-34px"></div>
-    <ui-title-devider title="我的收藏"></ui-title-devider>
+    <ui-title-devider title="我的订阅"></ui-title-devider>
     <div class="px-40px">
       <div class="h-20px"></div>
-      <ui-main-article v-for="item in 4" class="mb-20px">
-        <!-- <div slot="right" class="w-100px h-30px rounded-full flex items-center justify-center text-white text-size-14 bg-primary absolute right-26px bottom-12px">
-            {{$t("取消订阅")}}
-          </div> -->
-        <div
-          slot="right"
-          class="w-100px h-30px rounded-full flex items-center justify-center text-primary text-size-14 border-primary absolute right-26px bottom-12px border-1px border-solid"
-        >
-          {{ $t("取消订阅") }}
-        </div>
+      <ui-main-article v-for="item in articles" :item="item" class="mb-20px">
+        <img @click.stop="handleCancel(item)" v-if="item.subscribe" src="/imgs/star.png" slot="right" class="w-28px right-19px bottom-10px absolute"/>
+        <!--          <img src="/imgs/star-blank.png" slot="right" class="w-28px right-19px bottom-10px absolute"/>-->
       </ui-main-article>
+
     </div>
   </div>
 </template>
 
 <script>
-export default {};
+  export default {
+    data(){
+      return {
+        articles:[]
+      }
+    },
+    methods:{
+      handleCancel(){
+
+      },
+      async handleLoad(){
+        let resp = await this.$http.post(this.$api.cms.mySubArticles,this.$qs.stringify({onPage:false}));
+        this.articles = resp.data.data.cmsArticles;
+
+      },
+      async handleCancel(item){
+
+       await this.$confirm('您现在正在进行取消订阅操作, 是否继续?', '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        });
+
+        let resp = await  this.$http.post(this.$api.cms.subscribe,this.$qs.stringify({refArticle:item.code}));
+        if(resp.data.status === 200){
+          this.handleLoad();
+        }
+
+      }
+    },
+    async created() {
+      this.handleLoad();
+    }
+
+  };
 </script>
 
 <style lang="scss" scoped></style>

+ 87 - 0
src/pc/pages/vip-list/vip-list.vue

@@ -0,0 +1,87 @@
+<template>
+  <div>
+    <div class="w-1200px m-auto mt-20px">
+      <div class="flex justify-between">
+        <div class="left w-860px">
+          <ui-shadow-box class="relative h-50px flex items-center pl-16.5px ">
+            <div
+              class="w-80px h-3px absolute left-0 top--3px bg-primary rounded-full"
+            ></div>
+
+            <div class="font-thin text-[#000] text-size-20px">{{ $route.query.title }}</div>
+          </ui-shadow-box>
+          <div class="h-20px"></div>
+          <div v-for="item in latestArts" :key="item">
+            <ui-main-article :item="item"></ui-main-article>
+            <div class="h-20px"></div>
+          </div>
+
+        </div>
+        <div class="right w-320px">
+          <ui-hot-article></ui-hot-article>
+          <div class="h-20px"></div>
+          <ui-vip-magazine></ui-vip-magazine>
+        </div>
+      </div>
+    </div>
+  </div>
+</template>
+
+<script>
+export default {
+  data() {
+    return {
+      banner1: [
+        { url: "/imgs/banner1.png", title: "這裏是輪播圖推薦內容標題" },
+        { url: "/imgs/banner1.png", title: "這裏是輪播圖推薦內容標題" },
+        { url: "/imgs/banner1.png", title: "這裏是輪播圖推薦內容標題" },
+        { url: "/imgs/banner1.png", title: "這裏是輪播圖推薦內容標題" },
+        { url: "/imgs/banner1.png", title: "這裏是輪播圖推薦內容標題" },
+      ],
+      latestArts: [],
+      pageIndex: 1
+    };
+  },
+  watch:{
+     '$route.query.category':{
+         immediate:true,
+         handler(){
+            this.pageIndex = 1;
+            this.loadLatestArts(this.pageIndex);
+         }
+     }
+  },
+  methods: {
+    async loadLatestArts(pageIndex) {
+      let resp = await this.$http.post(this.$api.cms.articles, this.$qs.stringify(Object.assign({refMagazine:this.$route.query.refMagazine},{pageIndex: pageIndex})));
+      if (resp.data.status === 200) {
+         if(pageIndex === 1){
+           this.latestArts = resp.data.data.cmsArticles;
+         }else{
+           this.latestArts.push(...resp.data.data.cmsArticles);
+         }
+      }
+    }
+  },
+  async created() {
+    this.loadLatestArts(this.pageIndex);
+  }
+};
+</script>
+<style>
+.swiper-group {
+  display: grid;
+  grid-template-columns: repeat(2, 290px);
+  grid-template-rows: repeat(2, 163px);
+  grid-gap: 10px;
+}
+.swiper {
+  @apply w-290px;
+
+  /* align-items: end; */
+  /* @apply w-290px h-163px; */
+}
+.swiper-title {
+  @apply bottom-17px left-17px text-size-16px;
+}
+</style>

+ 42 - 8
src/pc/pages/vip/vip.vue

@@ -1,34 +1,68 @@
 <template>
   <div class="w-1200px">
-    <ui-shadow-box class="bg-white h-50px mt-30px flex items-center">
+    <ui-shadow-box class="bg-white mt-30px flex items-center nut-row-flex-wrap " style="flex-wrap: wrap">
       <div
-        class="w-100px h-full bg-primary bg-opacity-26 rounded-3px flex justify-center items-center"
+        class="w-100px h-full bg-primary bg-opacity-26 rounded-3px flex justify-center items-center  h-50px"
       >
         年份
       </div>
-      <div :class="`year-tag ${index === 0}` " v-for="(item,index) in 13" :key="index">{{2022 - index}}</div>
-      <img src="/imgs/year-arrow-down.png" class="w-16px h-auto ml-20px cursor-pointer"/>
+      <div class="w-1100px flex pt-12px " style="flex-wrap: wrap">
+        <div :class="`year-tag ${currentYear === item ? 'selected':''}`" @click="!currentYear && currentYear !== item ? currentYear=item : currentYear = ''" class="mb-12px"  v-for="(item,index) in years" :key="index">{{item}}</div>
+        <div v-if="years.length > 12" :class="`year-tag ${index === 0}`" class="!bg-white mb-12px "   :key="index">
+          <img @click="hideYear=!hideYear" src="/imgs/year-arrow-down.png"  class="w-16px h-auto ml-20px cursor-pointer transform" :class="{'rotate-180':!hideYear}"  style="object-fit: contain" />
+        </div>
+      </div>
     </ui-shadow-box>
     <div class="w-full flex flex-wrap justify-between">
       <ui-shadow-box
-        v-for="item in 21"
+        v-for="item in showVipMagazines"
         :key="item"
         class="px-50px pt-30px mt-40px w-390px h-221px"
       >
-        <ui-vip-article class="transform scale-110"></ui-vip-article>
+        <ui-vip-article :item="item" class="transform scale-110"></ui-vip-article>
       </ui-shadow-box>
     </div>
   </div>
 </template>
 
 <script>
-export default {};
+  export default {
+    data(){
+      return {
+        vipMagazines:[],
+        hideYear:true,
+        currentYear:''
+      }
+    },
+    computed:{
+        years(){
+            let years = [];
+            this.vipMagazines.forEach((e)=>{
+                if(years.indexOf(parseInt(e.dateStr.substr(0,4))) === -1) years.push(parseInt(e.dateStr.substr(0,4)));
+            })
+
+            return years.length > 12 && this.hideYear ? years.splice(0,12) : years;
+        },
+        showVipMagazines(){
+           return this.vipMagazines.filter(e=> (parseInt(e.dateStr.substr(0,4)) === this.currentYear || !this.currentYear));
+        }
+    },
+    async created() {
+
+      let resp = await  this.$http.post(this.$api.cms.listVipMagazines);
+
+      if(resp.data.status === 200){
+        this.vipMagazines = resp.data.data.vipMagazines;
+      }
+    }
+  }
 </script>
 <style>
 .year-tag {
   @apply w-60px h-24px bg-[#F7F7F7] flex items-center justify-center rounded-full ml-20px cursor-pointer;
 }
-.year-tag.selected {
+.selected {
   @apply bg-primary ;
+  color: #ffffff;
 }
 </style>

+ 2 - 0
src/pc/router/index.ts

@@ -21,6 +21,7 @@ import ProfileComplete from "@pc/pages/auth/profile-complete.vue";
 import ProductDetail from "@pc/pages/product/product-detail.vue";
 import OrderDetail from "@pc/pages/product/order-detail.vue";
 import SpecificArticle from "@pc/pages/specific-article/specific-article.vue";
+import VipList from "@pc/pages/vip-list/vip-list.vue";
 import Vip from "@pc/pages/vip/vip.vue";
 import Search from "@pc/pages/search/search.vue";
 import Aboutus from "@pc/pages/aboutus/aboutus.vue";
@@ -47,6 +48,7 @@ export const routes: RouteConfig[] = [
       { path: "/product-detail", component: ProductDetail },
       { path: "/order-detail", component: OrderDetail },
       { path: "/specific-article", component: SpecificArticle },
+      { path: "/vip-list", component: VipList },
       { path: "/vip", component: Vip },
       { path: "/search", component: Search },
       { path: "/aboutus", component: Aboutus },

+ 18 - 0
src/pc/store.js

@@ -0,0 +1,18 @@
+import Vue from 'vue'
+import Vuex from 'vuex'
+
+Vue.use(Vuex)
+
+export default new Vuex.Store({
+  state: {
+      userinfo:''
+  },
+  mutations: {
+      UPDATE_LOGIN_INFO(state,param){
+         state.userinfo = param;
+      }
+  },
+  actions: {
+
+  }
+})

+ 12 - 0
yarn.lock

@@ -453,6 +453,11 @@
     postcss "^8.4.14"
     source-map "^0.6.1"
 
+"@vue/devtools-api@^6.0.0-beta.11":
+  version "6.4.5"
+  resolved "https://registry.npmmirror.com/@vue/devtools-api/-/devtools-api-6.4.5.tgz#d54e844c1adbb1e677c81c665ecef1a2b4bb8380"
+  integrity sha512-JD5fcdIuFxU4fQyXUu3w2KpAJHzTVdN+p4iOX2lMWSHMOoQdMAcpFLZzm9Z/2nmsoZ1a96QEhZ26e50xLBsgOQ==
+
 "@vueuse/core@^9.0.0":
   version "9.0.0"
   resolved "https://registry.yarnpkg.com/@vueuse/core/-/core-9.0.0.tgz#2e3d37dc08e1e18ebe385c40a41a7d2b7eb2ae0c"
@@ -3278,6 +3283,13 @@ vue@^2.7.8:
     "@vue/compiler-sfc" "2.7.8"
     csstype "^3.1.0"
 
+vuex@^4.1.0:
+  version "4.1.0"
+  resolved "https://registry.npmmirror.com/vuex/-/vuex-4.1.0.tgz#aa1b3ea5c7385812b074c86faeeec2217872e36c"
+  integrity sha512-hmV6UerDrPcgbSy9ORAtNXDr9M4wlNP4pEFKye4ujJF8oqgFFuxDCdOLS3eNoRTtq5O3hoBDh9Doj1bQMYHRbQ==
+  dependencies:
+    "@vue/devtools-api" "^6.0.0-beta.11"
+
 webpack-sources@^3.2.3:
   version "3.2.3"
   resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-3.2.3.tgz#2d4daab8451fd4b240cc27055ff6a0c2ccea0cde"