Quellcode durchsuchen

移动端集成

wbspool vor 4 Jahren
Ursprung
Commit
b290fb9e37
31 geänderte Dateien mit 1334 neuen und 390 gelöschten Zeilen
  1. 25 1
      src/h5/App.vue
  2. 3 0
      src/h5/components.d.ts
  3. 8 8
      src/h5/components/layout-user/layout-user-header.vue
  4. 44 0
      src/h5/components/ui-article-list/ui-article-list.vue
  5. 34 0
      src/h5/components/ui-banner/ui-banner.vue
  6. 1 1
      src/h5/components/ui-input/ui-input.vue
  7. 50 0
      src/h5/components/ui-label-article-list/ui-label-article-list.vue
  8. 8 7
      src/h5/components/ui-main-article/ui-main-article.vue
  9. 2 2
      src/h5/components/ui-mask-picture/ui-mask-picture.vue
  10. 1 1
      src/h5/components/ui-page-layout/ui-page-layout.vue
  11. 1 1
      src/h5/components/ui-swiper/ui-swiper.vue
  12. 12 3
      src/h5/main.js
  13. 22 23
      src/h5/pages/aboutus/aboutus.vue
  14. 134 116
      src/h5/pages/article-detail/article-detail.vue
  15. 223 29
      src/h5/pages/article-detail/comment.vue
  16. 86 16
      src/h5/pages/auth/change-password.vue
  17. 104 9
      src/h5/pages/auth/login.vue
  18. 109 16
      src/h5/pages/auth/register.vue
  19. 36 40
      src/h5/pages/home/home.vue
  20. 34 16
      src/h5/pages/hot/hot.vue
  21. 22 23
      src/h5/pages/publish/publish.vue
  22. 36 16
      src/h5/pages/realtime-news/realtime-news.vue
  23. 82 33
      src/h5/pages/user/user-account-setting.vue
  24. 38 6
      src/h5/pages/user/user-collection.vue
  25. 36 3
      src/h5/pages/user/user-comment.vue
  26. 37 4
      src/h5/pages/user/user-history.vue
  27. 36 3
      src/h5/pages/user/user-like.vue
  28. 36 2
      src/h5/pages/user/user-subscription.vue
  29. 47 10
      src/h5/pages/vip/vip.vue
  30. 26 0
      src/h5/store.js
  31. 1 1
      src/pc/components/ui-main-article/ui-main-article.vue

+ 25 - 1
src/h5/App.vue

@@ -3,8 +3,32 @@
     <RouterView />
   </div>
 </template>
+<script>
+  export default {
+    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)
+      }
+
+
+      let br = await this.$http.post(this.$api.common.banners);
+      if (br.data.status === 200) {
+        this.$store.commit('UPDATE_BANNER', br.data.data.banners)
+      }
+    }
+  }
+</script>
 <style lang="scss">
 body {
-  @apply bg-[#F7F7F7] overflow-hidden h-screen;
+  @apply bg-[#ffffff] overflow-hidden h-screen;
 }
 </style>

+ 3 - 0
src/h5/components.d.ts

@@ -21,8 +21,11 @@ declare module '@vue/runtime-core' {
     OrderDetailInfoItem: typeof import('./pages/product/_components/order-detail-info-item.vue')['default']
     RouterLink: typeof import('vue-router')['RouterLink']
     RouterView: typeof import('vue-router')['RouterView']
+    UiArticleList: typeof import('./components/ui-article-list/ui-article-list.vue')['default']
+    UiBanner: typeof import('./components/ui-banner/ui-banner.vue')['default']
     UiDevider: typeof import('./components/ui-devider/ui-devider.vue')['default']
     UiInput: typeof import('./components/ui-input/ui-input.vue')['default']
+    UiLabelArticleList: typeof import('./components/ui-label-article-list/ui-label-article-list.vue')['default']
     UiMainArticle: typeof import('./components/ui-main-article/ui-main-article.vue')['default']
     UiMaskPicture: typeof import('./components/ui-mask-picture/ui-mask-picture.vue')['default']
     UiNavBar: typeof import('./components/ui-nav-bar/ui-nav-bar.vue')['default']

+ 8 - 8
src/h5/components/layout-user/layout-user-header.vue

@@ -4,24 +4,24 @@
     <div class=" w-full flex items-center justify-between px-24rem">
       <div @click="$router.push('/user/account-setting')" class="flex h-120rem">
         <div class="w-120rem h-120rem rounded-full border-white border-1rem border-solid mr-20rem">
-          <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 class="flex flex-col h-full justify-around">
           <div class="text-size-36rem font-300 text-white flex items-end">
-            <span>cyt</span>
-            <img src="/imgs/h5-vip.png" class="w-25rem h-auto ml-10rem" />
+            <span>{{$store.state.userinfo.nickname}}</span>
+            <img v-if="$store.state.userinfo.exipreVip"  src="/imgs/h5-vip.png" class="w-25rem h-auto ml-10rem" />
           </div>
-          <div class="text-size-36rem font-300 text-white">2342342332@qq.com</div>
-          <div class="text-white text-size-20rem font-300 mr-19rem">
-            {{ $t("当前为月会员,有效期至2022年9月28日") }}
+          <div class="text-size-36rem font-300 text-white">{{$store.state.userinfo.email}}</div>
+          <div v-if="$store.state.userinfo.exipreVip"  class="text-white text-size-20rem font-300 mr-19rem">
+            {{ $t("当前会员有效期至") + $store.state.userinfo.vipStopStr}}
           </div>
         </div>
       </div>
-      <div class="flex items-center">
+      <div v-if="$store.state.userinfo.exipreVip"  class="flex items-center">
         <div
           class="text-size-24rem text-primary w-120rem h-50rem bg-white flex items-center justify-center rounded-full">
-          续 费
+          {{ $t("续费")}}
         </div>
       </div>
     </div>

+ 44 - 0
src/h5/components/ui-article-list/ui-article-list.vue

@@ -0,0 +1,44 @@
+<template>
+    <div class="ui-label-article-list px-24rem pt-12rem">
+        <UiMainArticle v-for="article in articles" :item="article"></UiMainArticle>
+        <van-empty v-if="!articles.length" description="暂无数据" />
+    </div>
+</template>
+
+<script>
+    export default {
+        props:{
+            params:{
+                type:Object,
+                default(){
+                    return {}
+                }
+            }
+        },
+        data(){
+            return {
+                articles:[]
+            }
+        },
+        methods:{
+            async listArticles(pageIndex) {
+                let resp = await this.$http.post(this.$api.cms.articles, this.$qs.stringify(Object.assign({pageIndex: pageIndex},this.params)));
+                if (resp.data.status === 200) {
+                    if(pageIndex === 1){
+                        this.articles = resp.data.data.cmsArticles;
+                    }else{
+                        this.articles.push(...resp.data.data.cmsArticles);
+                    }
+                }
+            }
+        },
+        created() {
+            this.listArticles(1);
+        }
+
+    }
+</script>
+
+<style scoped>
+
+</style>

+ 34 - 0
src/h5/components/ui-banner/ui-banner.vue

@@ -0,0 +1,34 @@
+<template>
+    <ui-swiper v-bind="$attrs" v-on="$listeners" :items="banners" titleClass="swiper-title" :showPagination="showPagination" :paginationclass="paginationclass" :titleClass="titleClass" :class="`swiper ${bannerClass}`"
+               :class="bannerClass"></ui-swiper>
+</template>
+
+<script>
+    export default {
+        props: {
+            flag: '',
+            bannerClass: {
+                type: String,
+                default() {
+                    return {}
+                }
+            },
+            showPagination: {
+                default: false,
+            },
+            paginationclass:{
+                default: ''
+            } ,
+            titleClass: {},
+        },
+        computed: {
+            banners() {
+                return this.$store.state.banners.filter(e => e.position == this.flag);
+            }
+        }
+    }
+</script>
+
+<style scoped>
+
+</style>

+ 1 - 1
src/h5/components/ui-input/ui-input.vue

@@ -1,5 +1,5 @@
 <template>
-  <el-input v-bind="$attrs" class="!w-auto !rounded-full h-40rem ui-input">
+  <el-input v-bind="$attrs" v-on="$listeners" class="!w-auto !rounded-full h-40rem ui-input">
     <template v-for="slot in Object.entries(this.$slots)" :slot="slot[0]">
       <slot :name="slot[0]"></slot>
     </template>

+ 50 - 0
src/h5/components/ui-label-article-list/ui-label-article-list.vue

@@ -0,0 +1,50 @@
+<template>
+    <div class="ui-label-article-list px-24rem pt-12rem">
+        <UiMainArticle v-for="article in articles" :item="article"></UiMainArticle>
+        <van-empty v-if="!articles.length" description="暂无数据" />
+    </div>
+</template>
+
+<script>
+    export default {
+        name: "ui-label-article-list",
+        data(){
+            return {
+                articles:[]
+            }
+        },
+        props:{
+            label:{
+                type:Object,
+                default(){
+                    return ''
+                }
+            }
+        },
+        watch:{
+            label:{
+                immediate:true,
+                handler(){
+                    this.labelArticles(1);
+                }
+            }
+        },
+        methods:{
+            async labelArticles(pageIndex) {
+                let resp = await this.$http.post(this.$api.cms.articles, this.$qs.stringify({pageIndex: pageIndex,keywords:this.label.name}));
+                if (resp.data.status === 200) {
+                    if(pageIndex === 1){
+                        this.articles = resp.data.data.cmsArticles;
+                    }else{
+                        this.articles.push(...resp.data.data.cmsArticles);
+                    }
+                }
+            }
+        }
+
+    }
+</script>
+
+<style scoped>
+
+</style>

+ 8 - 7
src/h5/components/ui-main-article/ui-main-article.vue

@@ -1,29 +1,30 @@
 <template>
-  <div @click="$router.push('/article-detail')" v-bind="$attrs" class="relative border-b-1rem border-solid border-[#B8B8B8]">
-    <div class="flex mb-22rem  items-center h-165rem">
+  <div @click="$router.push('/article-detail?code=' + item.code)" v-bind="$attrs" class="relative border-b-1rem border-solid border-[#B8B8B8]">
+    <div class="flex mb-22rem mt-22rem  items-center h-165rem">
       <div class="relative">
-        <img class="w-270rem h-150rem object-cover" src="/imgs/article_cover1.png" />
-        <div class="absolute left-0 top-0 text-white text-size-20rem">
+        <img class="w-270rem h-160rem object-cover" :src="item.coverUrl" />
+        <div v-if="item.vip === '1'" class="absolute left-0 top-0 text-white text-size-20rem">
           <img class="w-100rem h-auto" src="/imgs/h5-vip-tag.png" />
           <span class="absolute top-0 h-full w-full flex items-center ml-6rem">VIP尊享</span>
         </div>
       </div>
       <div class="w-19rem"></div>
       <div class="flex flex-col flex-1 h-full justify-between">
-        <div class="h-18rem"></div>
+<!--        <div class="h-18rem"></div>-->
         <div class="text-size-30rem text-[#000A04] font-normal">
            {{item.title}}
         </div>
 
-        <div class="h-32rem"></div>
+        <div class="h-22rem"></div>
         <div class="text-[#B8B8B8] text-size-24rem font-normal">{{item.author ? item.author : $t("匿名")}}</div>
+<!--        <div class="h-10rem"></div>-->
         <div class="flex w-full items-center">
           <div class="flex items-center ">
             <img class="w-26rem h-auto" src="/imgs/time.png" />
             <div class="text-[#B8B8B8] text-size-24rem font-normal ml-5rem">{{item.publishTimeStr}}</div>
           </div>
           <div v-if="!$slots.right" class="text-[#B8B8B8] text-size-24rem font-normal ml-auto">
-            {{item.view}}浏览
+            {{item.viewNum ? item.viewNum : 0}} {{$t('浏览')}}
           </div>
           <slot name="right"></slot>
         </div>

+ 2 - 2
src/h5/components/ui-mask-picture/ui-mask-picture.vue

@@ -1,6 +1,6 @@
 <template>
-    <div v-bind="$attrs" class="relative">
-        <img src="/imgs/article_cover_small1.png" class="w-full h-full object-cover" />
+    <div v-bind="$attrs" v-on="$listeners" class="relative">
+        <ui-banner v-bind="$attrs"  class="w-full h-full object-cover"></ui-banner>
         <div class="w-full h-full absolute opacity-30 bg-[#010101] top-0">
 
         </div>

+ 1 - 1
src/h5/components/ui-page-layout/ui-page-layout.vue

@@ -6,7 +6,7 @@
       </template>
     </ui-nav-bar>
     <div v-bind="$attrs" class="page-body flex-1 overflow-hidden relative">
-      <ui-scroll-view>
+      <ui-scroll-view >
         <div v-if="showSlider" class="w-full h-full bg-[rgba(0,0,0,0.6)]   absolute flex justify-end z-50">
           <div @click="showSlider = false" class="h-full flex-1">
             

+ 1 - 1
src/h5/components/ui-swiper/ui-swiper.vue

@@ -2,7 +2,7 @@
   <div v-bind="$attrs" class="relative w-full">
     <swiper ref="swiper" class="relative w-full h-full" :options="swiperOption">
       <swiper-slide v-for="(item, index) in items" :key="index">
-        <div class="w-full h-full absolute bg-[rgba(0,0,0,0.3)]"></div>
+        <div class="w-full h-full absolute bg-[rgba(0,0,0,0)]"></div>
         <img class="w-full h-full object-cover" :src="item.bannerUrl" />
 
         <div

+ 12 - 3
src/h5/main.js

@@ -1,6 +1,7 @@
 import Vue from "vue";
 import App from "@h5/App.vue";
 import VueI18n from "vue-i18n";
+import store from './store'
 
 import 'virtual:windi.css'
 import router from "@h5/router";
@@ -10,13 +11,20 @@ import ElementUI from 'element-ui';
 import 'element-ui/lib/theme-chalk/index.css';
 import '@h5/assets/css/index.css'
 import Vant from 'vant';
+import {Toast,Dialog} from  'vant'
 import 'vant/lib/index.css';
-
+import axios from "axios";
+import qs from "qs";
+import api from "../common/config/api";
 import NutUI from '@nutui/nutui';
 import '@nutui/nutui/dist/nutui.css';
-
 NutUI.install(Vue);
-
+Vue.prototype.$api = api;
+Vue.prototype.$http = axios;
+Vue.prototype.$qs = qs;
+Vue.prototype.$toast = Toast;
+Vue.prototype.$dialog = Dialog;
+Vue.prototype.$store = store;
 Vue.use(Vant);
 Vue.use(ElementUI);
 
@@ -37,6 +45,7 @@ const i18n = new VueI18n({
 /* eslint-disable no-new */
 new Vue({
   el: "#app",
+  store,
   router,
   render: (h) => h(App),
   i18n,

Datei-Diff unterdrückt, da er zu groß ist
+ 22 - 23
src/h5/pages/aboutus/aboutus.vue


+ 134 - 116
src/h5/pages/article-detail/article-detail.vue

@@ -4,38 +4,35 @@
 
       <div class="w-full bg-white h-auto rem-30rem pt-30rem mb-14rem">
         <div class="text-size-40rem text-[#000]   mb-27rem">
-          这里是文章标题这里是文章标题,文章标题
-          这里是文章标题这里是文章标题,文章标题
+          {{article.title}}
         </div>
-        <div class="text-[#B8B8B8] text-size-24rem mb-19rem">香港特派员赵圆松</div>
+        <div class="text-[#B8B8B8] text-size-24rem mb-19rem">{{article.author}}</div>
         <div class="flex text-[#B8B8B8] text-size-14rem items-center justify-between mb-33rem">
           <div class="flex items-center">
 
             <div class=" flex items-center">
               <img class="w-18rem h-auto mr-8rem" src="/imgs/time.png" />
-              <span>2022-08-26</span>
+              <span>{{article.publishTimeStr}}</span>
             </div>
           </div>
           <div class="flex items-center text-size-20rem">
-            <div class="mr-24rem">5评论</div>
-            <div class="mr-24rem">10点赞</div>
-            <div class="mr-24rem">56收藏</div>
-            <div>36582浏览</div>
+            <div class="mr-24rem">{{article.commentNum}} {{$t('评论')}}</div>
+            <div class="mr-24rem">{{article.likeNum}} {{$t('点赞')}}</div>
+            <div class="mr-24rem">{{article.collectNum}} {{$t('收藏')}}</div>
+            <div>{{article.viewNum}} {{$t('浏览')}}</div>
           </div>
         </div>
         <div class="bg-[#F7F7F7] p-24rem text-[#686868] text-size-16rem leading-32rem whitespace-pre-wrap mb-30rem">
           <p class="indent-32rem">
-            这里是文章简介或摘要内容,这里是文章简介或摘要内容这里是文章简介或摘要内容,这里是文章简介
-            或摘容,这里是文章简介或摘要内容,这里是文章简介或摘要内容这里是文章简介或摘要内容。这里是文章
-            简介或摘要内容,这里是文章简介或摘要内容,这里是文章简介或摘要内容这里是文章简介或摘要内容。
+            {{article.description}}
           </p>
         </div>
-        <div class="content" v-html="html"></div>
-        <div class="p-24rem bg-[#f7f7f7] text-[#686868] leading-32rem text-size-16rem mb-30rem">
-          <p>作者:香港特派员赵圆松;期刊:尖瑞科技期刊(ID:business-data)</p>
-          <p>本文由 @商业数据派 原创发布于杂志期刊,未经许可,禁止转载。</p>
-          <p>题图来自 Unsplash,基于CC0协议</p>
-        </div>
+        <div class="content" v-html="article.content"></div>
+<!--        <div class="p-24rem bg-[#f7f7f7] text-[#686868] leading-32rem text-size-16rem mb-30rem">-->
+<!--          <p>作者:香港特派员赵圆松;期刊:尖瑞科技期刊(ID:business-data)</p>-->
+<!--          <p>本文由 @商业数据派 原创发布于杂志期刊,未经许可,禁止转载。</p>-->
+<!--          <p>题图来自 Unsplash,基于CC0协议</p>-->
+<!--        </div>-->
         <div class="flex justify-center mb-30rem">
           <div type="primary" round
             class="h-60rem w-500rem bg-primary flex justify-center items-center rounded-full text-white">成为会员,查看更多精彩内容!
@@ -44,7 +41,7 @@
         <ui-devider class="mb-30rem"></ui-devider>
         <div class="flex items-center justify-between">
           <div class="flex items-center">
-            <el-switch v-model="subscriped" inactive-color="#E1E1E1" class="mr-10rem">
+            <el-switch :value="article.subscribe" @change="handleSubscribe" inactive-color="#E1E1E1" class="mr-10rem">
             </el-switch>
 
             <div class="text-size-30rem text-[#282828]">开启订阅,将为您推荐同类精彩内容!</div>
@@ -59,26 +56,26 @@
         </div>
         <div class="h-46rem"></div>
 
-        <div class="rem-30rem pt-37rem pb-44rem">
-          <div class="text-size-30rem mb-16rem">全部评论</div>
+        <div class="rem-30rem pt-37rem pb-44rem" id="comment-list">
+          <div class="text-size-30rem mb-16rem">全部评论({{article.commentNum}})</div>
           <ui-devider></ui-devider>
-          <div v-for="item in 4" :key="item">
+          <div v-for="comment in comments" :key="item">
             <div class="flex items-start py-30rem">
-              <img class="w-60rem h-60rem round" src="/imgs/avatar.png" />
+              <img class="w-60rem h-60rem rounded-full" :src="comment.refUserAvatarUrl" />
               <div class="mt-8rem ml-14rem">
                 <div class="flex mb-14rem items-center">
-                  <div class=" text-size-30rem mr-30rem">用户名</div>
-                  <div class="text-size-24rem text-[#B8B8B8]">2022-08-26 06:53</div>
+                  <div class=" text-size-30rem mr-30rem">{{comment.refUserName}}</div>
+                  <div class="text-size-24rem text-[#B8B8B8]">{{comment.createTimeStr}}</div>
                 </div>
                 <div class="text-[#686868] leading-34rem text-size-24rem">
-                  评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容
+                  {{comment.content}}
                 </div>
               </div>
             </div>
             <ui-devider></ui-devider>
           </div>
           <div class="flex justify-center">
-            <el-button @click="$router.push('/article-comment')" type="text" class="!text-[#686868]">{{ $t("查看更多评论") }}</el-button>
+            <el-button @click="$router.push('/article-comment?code=' + article.code)" type="text" class="!text-[#686868]">{{ $t("查看更多评论") }}</el-button>
           </div>
         </div>
       </div>
@@ -110,17 +107,17 @@
             <div class=" text-primary text-size-36rem mb-72rem">
               {{ $t("杂志期刊") }}
             </div>
-            <img src="/imgs/export-cover.png" class="w-full h-328rem object-cover" />
+            <img :src="article.coverUrl" class="w-full h-328rem object-cover" />
             <div class="text-size-30rem leading-42rem text-[#000A04] mt-28rem ">
-              这里是轮播图推荐内容标题这里是轮播图推荐内容标题...
+              {{article.title}}
             </div>
             <div class="text-size-30rem text-[#686868] leading-30rem mt-36rem font-light">
-              这里是文章简介内容这里是文章简介内容这里是文章简介内容这里是文章简介内容这里是文这里是文章简介内容这里是文章简介内容这里是文章简介内容这......
+              {{article.description}}
             </div>
             <div class="flex items-center w-full justify-end mt-74rem">
               <div class="mr-10rem text-[#B8B8B8] text-size-14rem h-84rem flex flex-col justify-between">
-                <div class="mb-10rem">作者:香港特派员赵圆松</div>
-                <div class="text-right">时间:2022-08-26</div>
+                <div class="mb-10rem">{{$t('作者')}}:{{article.author}}</div>
+                <div class="text-right">{{$t('时间')}}:{{article.publishTimeStr}}</div>
               </div>
               <img src="/imgs/export-qrcode.png" class="w-120rem h-120rem" />
             </div>
@@ -138,16 +135,25 @@
       </van-overlay>
       <div class="absolute left-0 bottom-0 h-88rem w-full bg-[#f7f7f7] flex items-center">
         <div class="flex-1 flex pl-24rem items-center justify-between">
-          <img class="w-13rem " src="/imgs/comment-arrow-left.png" />
+          <img class="w-13rem mr-12rem" src="/imgs/comment-arrow-left.png" />
           <van-field
-            class="flex items-center !p-0 !pl-24rem bg-transparentborder-1rem border-[#707070] border-solid !w-308rem h-60rem rounded-full bg-white">
+                  v-model="comment"
+                  placeholder="发表评论"
+                  @focus="commentFocus=true"
+                  @blur="handleCommentInputBlur"
+            class="flex items-center !p-0 !pl-24rem bg-transparentborder-1rem border-[#707070] border-solid !flex-1 h-60rem rounded-full bg-white">
           </van-field>
+          <div class="pl-24rem pr-24rem" v-if="commentFocus">
+            <el-button @click="handleComment"   type="text" class="pl-24rem pr-24rem !text-[#686868]">{{ $t("发送") }}</el-button>
+          </div>
         </div>
 
-        <div class="flex items-center flex-1 justify-around">
-          <img src="/imgs/h5-message.png" class="w-37rem" />
-          <img src="/imgs/comment-collection.png" class="w-37rem" />
-          <img src="/imgs/comment-like.png" class="w-36rem" />
+        <div v-if="!commentFocus" class="flex items-center flex-1 justify-around">
+          <img @click="handleScrollToComment" src="/imgs/h5-message.png" class="w-37rem" />
+          <img v-if="!article.collect" @click="handleCollect" src="/imgs/comment-collection.png" class="w-37rem" />
+          <img v-else @click="handleCollect" src="/imgs/comment-collection-1.png" class="w-37rem" />
+          <img v-if="!article.like" @click="handleLike" src="/imgs/comment-like.png" class="w-36rem" />
+          <img v-else @click="handleLike" src="/imgs/comment-like-1.png" class="w-36rem" />
           <img @click="showShare = true" src="/imgs/comment-share.png" class="w-41rem" />
         </div>
       </div>
@@ -160,99 +166,111 @@ import FileSaver from "file-saver";
 import domtoimage from "dom-to-image";
 export default {
   methods: {
+    async handleCommentInputBlur(){
+        setTimeout(()=>{
+           this.commentFocus =false;
+        },1000);
+    },
     async exportPost() {
 
       const url = await domtoimage.toPng(this.$refs.post, { filter: false });
 
       FileSaver.saveAs(url, "post.png");
     },
-  },
-  data() {
-    return {
-      showShare:true,
-      exportVisible: false,
-      subscriped: true,
-      html: `<p><span style="font-size:16rem">据央视新闻7月22日消息,俄罗斯国防部发言人科纳申科夫21日通报说,俄军在尼古拉耶夫和克拉玛托尔斯克打击了乌军多个指挥所。</span></p>
-
-<p>&nbsp;</p>
-
-<p>&nbsp;</p>
-
-<p><span style="font-size:16rem"><img alt="" src="/imgs/article-detail-pic-1.png" style="width:100%" /></span></p>
-
-<p>&nbsp;</p>
-
-<p><span style="font-size:16rem">据央视新闻7月22日消息,俄罗斯国防部发言人科纳申科夫21日通报说,俄军在尼古拉耶夫和克拉玛托尔斯克打击了乌军多个指挥所。</span></p>
-
-<p>&nbsp;</p>
-
-<p>&nbsp;</p>
-
-<p><span style="font-size:16rem">另据央视新闻报道称,当地时间21日,欧洲理事会公布了针对俄罗斯的新制裁措施,包括禁止进口来自俄罗斯金和珠宝;增加了俄罗斯可用于军用的物资和技术禁运清单,增加了对俄罗斯个人和实体的制裁。俄军打击乌军指挥所 乌军击退俄军进攻</span></p>
-
-<p>&nbsp;</p>
-
-<p>&nbsp;</p>
-
-<p><span style="font-size:16rem">俄罗斯国防部发言人科纳申科夫21日通报说,俄军在尼古拉耶夫和克拉玛托尔斯克打击了乌军多个指挥所,在顿涅茨克和尼古拉耶夫等地摧毁了多个乌军弹药库。另外,俄军还击落乌空军1架苏-25战机、1架米-8直升机和5架军用无人机。</span></p>
-
-<p>&nbsp;</p>
-
-<p>&nbsp;</p>
-
-<p><span style="font-size:16rem">另据乌克兰国家通讯社21日援引乌各地军事部门的消息报道,俄军继续对苏梅、哈尔科夫、卢甘斯克、顿涅茨克等地区进行大规模炮击。在乌军阻击下,俄军未能在巴赫穆特方向取得突破,没有占领乌格列戈尔斯克发电厂。</span></p>
-
-<p>&nbsp;</p>
-
-<p>&nbsp;</p>
-
-<p><span style="font-size:16rem">俄外长称在乌军事目标发生变化,与西方向乌军提供武器有关。</span></p>
-
-<p>&nbsp;</p>
+  async handleCollect(){
 
-<p>&nbsp;</p>
+    let resp = await  this.$http.post(this.$api.cms.collect,this.$qs.stringify({refArticle:this.article.code}));
+    if(resp.data.status === 200){
+      this.handleLoadData();
+    }
 
-<p><span style="font-size:16rem"><img alt="" src="/imgs/article-detail-pic-1.png" style="width:100%" /></span></p>
+  },async handleLike(){
 
-<p>&nbsp;</p>
+    let resp = await  this.$http.post(this.$api.cms.like,this.$qs.stringify({refArticle:this.article.code}));
+    if(resp.data.status === 200){
+      this.handleLoadData();
+    }
 
-<p><span style="font-size:16rem">据央视新闻7月22日消息,俄罗斯国防部发言人科纳申科夫21日通报说,俄军在尼古拉耶夫和克拉玛托尔斯克打击了乌军多个指挥所。</span></p>
-
-<p>&nbsp;</p>
-
-<p>&nbsp;</p>
-
-<p><span style="font-size:16rem">另据央视新闻报道称,当地时间21日,欧洲理事会公布了针对俄罗斯的新制裁措施,包括禁止进口来自俄罗斯金和珠宝;增加了俄罗斯可用于军用的物资和技术禁运清单,增加了对俄罗斯个人和实体的制裁。俄军打击乌军指挥所 乌军击退俄军进攻</span></p>
-
-<p>&nbsp;</p>
-
-<p>&nbsp;</p>
-
-<p><span style="font-size:16rem">俄罗斯国防部发言人科纳申科夫21日通报说,俄军在尼古拉耶夫和克拉玛托尔斯克打击了乌军多个指挥所,在顿涅茨克和尼古拉耶夫等地摧毁了多个乌军弹药库。另外,俄军还击落乌空军1架苏-25战机、1架米-8直升机和5架军用无人机。</span></p>
-
-<p>&nbsp;</p>
-
-<p>&nbsp;</p>
-
-<p><span style="font-size:16rem">另据乌克兰国家通讯社21日援引乌各地军事部门的消息报道,俄军继续对苏梅、哈尔科夫、卢甘斯克、顿涅茨克等地区进行大规模炮击。在乌军阻击下,俄军未能在巴赫穆特方向取得突破,没有占领乌格列戈尔斯克发电厂。</span></p>
-
-<p>&nbsp;</p>
-
-<p>&nbsp;</p>
-
-<p><span style="font-size:16rem">俄外长称在乌军事目标发生变化,与西方向乌军提供武器有关。</span></p>
+  },
+  async handleLoadData(){
+    let res = await  this.$http.post(this.$api.cms.detail,this.$qs.stringify(this.$route.query));
+    if(res.data.status === 200){
+      this.article = res.data.data.cmsArticle;
+    }
+  },
+  async handleSubscribe(){
+    let resp = await  this.$http.post(this.$api.cms.subscribe,this.$qs.stringify({refArticle:this.article.code}));
+    if(resp.data.status === 200){
+      this.handleLoadData();
+    }
+  },
+  async handleCopyLink(){
+    var url =document.getElementById("share-link");
+    url.select(); // 选择对象
+    document.execCommand("Copy"); // 执行浏览器复制命令
+  },
+  async handleComment(){
 
-<p>&nbsp;</p>
+    let resp = await this.$http.post(this.$api.cms.comment,this.$qs.stringify({refArticle:this.article.code,content:this.comment}))
 
-<p>&nbsp;</p>
+    if(resp.data.status === 200){
+      this.$toast(this.$t('评论成功'));
+      this.handleLoadData();
+      this.handleLoadComments();
+      this.comment = '';
+    }else{
+      this.$toast(this.$t(resp.data.desc));
+    }
 
-<p><span style="font-size:16rem">作者:香港特派员赵圆松;期刊:尖瑞科技期刊(ID:business-data)<br />
-本文由 @商业数据派 原创发布于人人都是产品经理,未经许可,禁止转载。<br />
-题图来自 Unsplash,基于CC0协议</span></p>
-<p>&nbsp;</p>
+  },
+  async handleLoadComments(pageNum){
+
+    if(!pageNum){
+      pageNum = 1;
+    }
+
+    let resp = await this.$http.post(this.$api.cms.listComments,this.$qs.stringify({refArticle:this.$route.query.code,pageNum:pageNum}))
+
+    if(resp.data.status === 200){
+      if(pageNum === 1){
+        this.comments = resp.data.data.cmsArtComments;
+      }else{
+        this.comments = this.comments.concat(resp.data.data.cmsArtComments);
+        this.commentLast = (!resp.data.data.cmsArtComments.length)
+      }
+    }
+  }
+  ,  handleScrollToComment(){
+      let item = document.querySelector("#comment-list");
+      let parent = document.querySelector(".ui-scroll-view ");
+      parent.scrollTo({
+        top: item.offsetTop ,//需要父元素设置postion(relative、absolute、fixed)
+        behavior: "smooth"
+      })
+    },
+  },
 
-<p>&nbsp;</p>
-`,
+  computed:{
+    shareUrl(){
+      return window.location.href;
+    }
+  },
+  async created() {
+    this.handleLoadData();
+    this.handleLoadComments();
+  },
+  data() {
+    return {
+      exportVisible: false,
+      subscriped: true,
+      html: ``,
+      article:{},
+      comments:[],
+      comment:'',
+      commentPageNum:1,
+      commentLast:false,
+      commentFocus:false,
+      showShare:false
     };
   },
 };

+ 223 - 29
src/h5/pages/article-detail/comment.vue

@@ -1,46 +1,240 @@
 <template>
-    <ui-page-layout title="评论">
-        <div class="rem-30rem pt-37rem pb-108rem px-24rem bg-white">
-            <div class="text-size-30rem mb-16rem">全部评论</div>
+    <ui-page-layout title="文章详情">
+        <div class="px-24rem bg-white w-full pb-98rem">
 
-            <div v-for="item in 4" :key="item">
-                <div class="flex items-start py-30rem">
-                    <img class="w-60rem h-60rem round" src="/imgs/avatar.png" />
-                    <div class="mt-8rem ml-14rem">
-                        <div class="flex mb-14rem items-center">
-                            <div class=" text-size-30rem mr-30rem">用户名</div>
-                            <div class="text-size-24rem text-[#B8B8B8]">2022-08-26 06:53</div>
-                        </div>
-                        <div class="text-[#686868] leading-34rem text-size-24rem">
-                            评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容
+            <div class="w-full bg-white h-auto rem-30rem  mb-14rem">
+                <div class="rem-30rem pt-37rem pb-44rem" id="comment-list">
+                    <div class="text-size-30rem mb-16rem">全部评论({{article.commentNum}})</div>
+                    <ui-devider></ui-devider>
+                    <div v-for="comment in comments" :key="item">
+                        <div class="flex items-start py-30rem">
+                            <img class="w-60rem h-60rem rounded-full" :src="comment.refUserAvatarUrl" />
+                            <div class="mt-8rem ml-14rem">
+                                <div class="flex mb-14rem items-center">
+                                    <div class=" text-size-30rem mr-30rem">{{comment.refUserName}}</div>
+                                    <div class="text-size-24rem text-[#B8B8B8]">{{comment.createTimeStr}}</div>
+                                </div>
+                                <div class="text-[#686868] leading-34rem text-size-24rem">
+                                    {{comment.content}}
+                                </div>
+                            </div>
                         </div>
+                        <ui-devider></ui-devider>
                     </div>
+<!--                    <div class="flex justify-center">-->
+<!--                        <el-button @click="$router.push('/article-comment')" type="text" class="!text-[#686868]">{{ $t("查看更多评论") }}</el-button>-->
+<!--                    </div>-->
                 </div>
-                <ui-devider></ui-devider>
             </div>
+            <van-action-sheet v-model="showShare"   >
+                <div class="h-334rem bg-[#fff] flex justify-around items-center">
+                    <img @click="showShare = false" src="/imgs/h5-action-close.png"  class="w-32rem h-32rem absolute right-30rem top-30rem"/>
+                    <div @click="() => {
+            showShare = false
+            exportVisible = true
+          }" class="flex flex-col items-center">
+                        <img  src="/imgs/h5-share-post.png" class="w-70rem"/>
+                        <div class="font-light text-size-30rem text-primary mt-23rem">
+                            分享海报
+                        </div>
+                    </div>
+                    <div class="flex flex-col items-center">
+                        <img src="/imgs/h5-share-link.png" class="w-70rem"/>
+                        <div class="font-light text-size-30rem text-primary mt-23rem">
+                            分享链接
+                        </div>
+                    </div>
+                </div>
+            </van-action-sheet>
 
-        </div>
-        <div class="absolute bottom-0 h-88rem w-full bg-[#f7f7f7] flex items-center">
-            <div class="flex-1 flex pl-24rem items-center justify-between">
-                <img class="w-13rem " src="/imgs/comment-arrow-left.png"/>
-                <van-field
-                    class="flex items-center !p-0 !pl-24rem bg-transparentborder-1rem border-[#707070] border-solid !w-308rem h-60rem rounded-full bg-white">
-                </van-field>
-            </div>
+            <van-overlay :show="exportVisible">
+                <div class="w-screen h-full flex flex-col items-center justify-between ">
+                    <div ref="post"
+                         class="mt-24rem w-675rem h-1037rem  py-38rem flex flex-col items-center bg-white rounded-10rem px-45rem">
+                        <div class=" text-primary text-size-36rem mb-72rem">
+                            {{ $t("杂志期刊") }}
+                        </div>
+                        <img :src="article.coverUrl" class="w-full h-328rem object-cover" />
+                        <div class="text-size-30rem leading-42rem text-[#000A04] mt-28rem ">
+                            {{article.title}}
+                        </div>
+                        <div class="text-size-30rem text-[#686868] leading-30rem mt-36rem font-light">
+                            {{article.description}}
+                        </div>
+                        <div class="flex items-center w-full justify-end mt-74rem">
+                            <div class="mr-10rem text-[#B8B8B8] text-size-14rem h-84rem flex flex-col justify-between">
+                                <div class="mb-10rem">{{$t('作者')}}:{{article.author}}</div>
+                                <div class="text-right">{{$t('时间')}}:{{article.publishTimeStr}}</div>
+                            </div>
+                            <img src="/imgs/export-qrcode.png" class="w-120rem h-120rem" />
+                        </div>
+                    </div>
+                    <div class="w-full h-200rem bg-white flex justify-center items-center relative">
+                        <img @click="exportVisible = false" src="/imgs/h5-action-close.png"
+                             class="w-32rem absolute top-30rem right-30rem" />
+                        <div @click="exportPost"
+                             class="w-600rem h-88rem bg-primary flex justify-center items-center rounded-full text-white">
+                            {{ $t("保存海报") }}
+                        </div>
+                    </div>
+                </div>
 
-            <div class="flex items-center flex-1 justify-around">
-                <img src="/imgs/h5-message.png" class="w-37rem" />
-                <img src="/imgs/comment-collection.png" class="w-37rem" />
-                <img src="/imgs/comment-like.png" class="w-36rem" />
-                <img src="/imgs/comment-share.png" class="w-41rem" />
+            </van-overlay>
+            <div class="absolute left-0 bottom-0 h-88rem w-full bg-[#f7f7f7] flex items-center">
+                <div class="flex-1 flex pl-24rem items-center justify-between">
+                    <img class="w-13rem mr-12rem" src="/imgs/comment-arrow-left.png" />
+                    <van-field
+                            v-model="comment"
+                            placeholder="发表评论"
+                            @focus="commentFocus=true"
+                            @blur="handleCommentInputBlur"
+                            class="flex items-center !p-0 !pl-24rem bg-transparentborder-1rem border-[#707070] border-solid !flex-1 h-60rem rounded-full bg-white">
+                    </van-field>
+                    <div class="pl-24rem pr-24rem" v-if="commentFocus">
+                        <el-button @click="handleComment"   type="text" class="pl-24rem pr-24rem !text-[#686868]">{{ $t("发送") }}</el-button>
+                    </div>
+                </div>
+
+                <div v-if="!commentFocus" class="flex items-center flex-1 justify-around">
+                    <img @click="handleScrollToComment" src="/imgs/h5-message.png" class="w-37rem" />
+                    <img v-if="!article.collect" @click="handleCollect" src="/imgs/comment-collection.png" class="w-37rem" />
+                    <img v-else @click="handleCollect" src="/imgs/comment-collection-1.png" class="w-37rem" />
+                    <img v-if="!article.like" @click="handleLike" src="/imgs/comment-like.png" class="w-36rem" />
+                    <img v-else @click="handleLike" src="/imgs/comment-like-1.png" class="w-36rem" />
+                    <img @click="showShare = true" src="/imgs/comment-share.png" class="w-41rem" />
+                </div>
             </div>
         </div>
     </ui-page-layout>
 </template>
 
 <script>
-export default {
+    import FileSaver from "file-saver";
+    import domtoimage from "dom-to-image";
+    export default {
+        methods: {
+            async handleCommentInputBlur(){
+                setTimeout(()=>{
+                    this.commentFocus =false;
+                },1000);
+            },
+            async exportPost() {
+
+                const url = await domtoimage.toPng(this.$refs.post, { filter: false });
+
+                FileSaver.saveAs(url, "post.png");
+            },
+            async handleCollect(){
+
+                let resp = await  this.$http.post(this.$api.cms.collect,this.$qs.stringify({refArticle:this.article.code}));
+                if(resp.data.status === 200){
+                    this.handleLoadData();
+                }
+
+            },async handleLike(){
+
+                let resp = await  this.$http.post(this.$api.cms.like,this.$qs.stringify({refArticle:this.article.code}));
+                if(resp.data.status === 200){
+                    this.handleLoadData();
+                }
+
+            },
+            async handleLoadData(){
+                let res = await  this.$http.post(this.$api.cms.detail,this.$qs.stringify(this.$route.query));
+                if(res.data.status === 200){
+                    this.article = res.data.data.cmsArticle;
+                }
+            },
+            async handleSubscribe(){
+                let resp = await  this.$http.post(this.$api.cms.subscribe,this.$qs.stringify({refArticle:this.article.code}));
+                if(resp.data.status === 200){
+                    this.handleLoadData();
+                }
+            },
+            async handleCopyLink(){
+                var url =document.getElementById("share-link");
+                url.select(); // 选择对象
+                document.execCommand("Copy"); // 执行浏览器复制命令
+            },
+            async handleComment(){
+
+                let resp = await this.$http.post(this.$api.cms.comment,this.$qs.stringify({refArticle:this.article.code,content:this.comment}))
 
-}
+                if(resp.data.status === 200){
+                    this.$toast(this.$t('评论成功'));
+                    this.handleLoadData();
+                    this.handleLoadComments();
+                    this.comment = '';
+                }else{
+                    this.$toast(this.$t(resp.data.desc));
+                }
+
+            },
+            async handleLoadComments(pageNum){
+
+                if(!pageNum){
+                    pageNum = 1;
+                }
+
+                let resp = await this.$http.post(this.$api.cms.listComments,this.$qs.stringify({refArticle:this.$route.query.code,pageNum:pageNum,onPage:false}))
+
+                if(resp.data.status === 200){
+                    if(pageNum === 1){
+                        this.comments = resp.data.data.cmsArtComments;
+                    }else{
+                        this.comments = this.comments.concat(resp.data.data.cmsArtComments);
+                        this.commentLast = (!resp.data.data.cmsArtComments.length)
+                    }
+                }
+            }
+            ,  handleScrollToComment(){
+                let item = document.querySelector("#comment-list");
+                let parent = document.querySelector(".ui-scroll-view ");
+                parent.scrollTo({
+                    top: item.offsetTop ,//需要父元素设置postion(relative、absolute、fixed)
+                    behavior: "smooth"
+                })
+            },
+        },
+
+        computed:{
+            shareUrl(){
+                return window.location.href;
+            }
+        },
+        async created() {
+            this.handleLoadData();
+            this.handleLoadComments();
+        },
+        data() {
+            return {
+                exportVisible: false,
+                subscriped: true,
+                html: ``,
+                article:{},
+                comments:[],
+                comment:'',
+                commentPageNum:1,
+                commentLast:false,
+                commentFocus:false,
+                showShare:false
+            };
+        },
+    };
 </script>
 
+<style>
+    .detail .content {}
+
+    .detail .action-button {
+        @apply !font-light border-1rem !border-primary border-solid !text-primary ml-30rem;
+    }
+
+    .detail .action-button.done {
+        @apply bg-primary !text-white;
+    }
+
+    .detail .el-textarea textarea {
+        @apply h-full bg-[#F7F7F7];
+    }
+</style>

+ 86 - 16
src/h5/pages/auth/change-password.vue

@@ -12,39 +12,43 @@
 
           <div  class="flex flex-col items-center">
               
-              <ui-input class="!h-98rem !w-600rem mb-24rem" :placeholder="$t('请输入邮箱号码')">
+              <ui-input v-model="resetForm.email" class="!h-98rem !w-600rem mb-24rem" :placeholder="$t('请输入邮箱号码')">
                   <div slot="prefix" class="flex items-center h-full ml-20rem">
                       <img slot="prefix" src="/imgs/email_icon.png" class="w-37rem h-auto" />
                   </div>
               </ui-input>
-              <ui-input class="!h-98rem !w-600rem mb-24rem" :placeholder="$t('请输入新密码')">
+              <ui-input type="password" v-model="resetForm.password" class="!h-98rem !w-600rem mb-24rem" :placeholder="$t('请输入新密码')">
                   <div slot="prefix" class="flex items-center h-full ml-20rem">
                       <img slot="prefix" src="/imgs/password_icon.png" class="w-40rem h-auto" />
                   </div>
               </ui-input>
-              <ui-input class="!h-98rem !w-600rem mb-24rem" :placeholder="$t('请再次输入新密码')">
+              <ui-input type="password" v-model="resetForm.rePassword"  class="!h-98rem !w-600rem mb-24rem" :placeholder="$t('请再次输入新密码')">
                   <div slot="prefix" class="flex items-center h-full ml-20rem">
                       <img slot="prefix" src="/imgs/password_icon.png" class="w-40rem h-auto" />
                   </div>
               </ui-input>
-              <ui-input class="!h-98rem !w-600rem mb-24rem " :placeholder="$t('请输入邮箱验证码')">
+              <ui-input v-model="resetForm.verifyCode" class="!h-98rem !w-600rem mb-24rem " :placeholder="$t('请输入邮箱验证码')">
                   <div slot="prefix" class="flex items-center h-full ml-20rem">
                       <img src="/imgs/vcode_icon.png" class="w-40rem h-auto" />
                   </div>
 
-                  <div slot="suffix" class="flex items-center h-full">
-                      <div class="bg-primary rounded-full text-white flex justify-center items-center h-70rem w-200rem !text-size-30rem !font-light !px-0"
+                  <div @click="handleSendVerifyCode" slot="suffix" class="flex items-center h-full">
+                      <div v-if="verifyCount <= 0" class="bg-primary rounded-full text-white flex justify-center items-center h-70rem w-200rem !text-size-30rem !font-light !px-0"
                           type="primary" round>{{
                                   $t("获取验证码")
                           }}</div>
+                      <div v-else class="bg-primary rounded-full text-white flex justify-center items-center h-70rem w-200rem !text-size-30rem !font-light !px-0"
+                           type="primary" round>{{
+                         verifyCount
+                          }}S</div>
                   </div>
               </ui-input>
               
           </div>
 
 
-          <el-button class="h-88rem w-600rem !rounded-full !text-size-24rem !font-normal" type="primary" round>{{
-                  $t("登录")
+          <el-button @click="handleResetPwd" class="h-88rem w-600rem !rounded-full !text-size-24rem !font-normal" type="primary" round>{{
+                  $t("重置密码")
           }}</el-button>
 
       </div>
@@ -52,14 +56,80 @@
 </template>
 
 <script>
-export default {
-  data() {
-      return {
-          activeName: "first",
-          loginType: "email",
-      };
-  },
-};
+    export default {
+        data() {
+            return {
+                activeName: "first",
+                loginType: "email",
+                showPassword:false,
+                resetForm:{
+                    email:'',
+                    password:'',
+                    rePassword:'',
+                    verifyCode:'',
+                },
+                verifyCount:0
+            };
+        },
+        computed:{
+            resetFormValid(){
+                return this.resetForm.email && this.resetForm.password && this.resetForm.rePassword && this.resetForm.verifyCode;
+            }
+        },
+        created() {
+            this.resetForm.email = this.$route.query.email;
+
+        },
+        methods:{
+            async handleResetPwd(){
+                if(!this.resetFormValid){
+                    return ;
+                }
+
+                let resp = await  this.$http.post(this.$api.mzUser.resetPassword,this.$qs.stringify(this.resetForm));
+
+                if(resp.data.status === 200){
+                    this.$toast(this.$t('重置成功'));
+                    this.$router.push('/login');
+                }else{
+                    this.$toast(resp.data.desc);
+                }
+
+            },
+            async handleSendVerifyCode(){
+
+                if(this.verifyCount > 0){
+                    return ;
+                }
+
+                let email = this.resetForm.email;
+
+                if(!email){
+                    this.$toast('邮箱不能为空');
+                    return;
+                }
+
+
+                let resp = await this.$http.post(this.$api.mzUser.sendVerifyCode,this.$qs.stringify({email:email}));
+
+                if(resp.data.status === 200){
+                    this.$toast(this.$t('发送验证码成功'));
+
+                    this.verifyCount = 60;
+                    let inv = setInterval(()=>{
+                        this.verifyCount--;
+                        if(this.verifyCount <= 0){
+                            clearInterval(inv);
+                        }
+                    },1000);
+
+                }else{
+                    this.$toast(this.$t('发送验证码失败'));
+                }
+
+            },
+        }
+    };
 </script>
 
 <style>

+ 104 - 9
src/h5/pages/auth/login.vue

@@ -10,40 +10,47 @@
     <div class="flex flex-col items-center  bg-white login overflow-hidden">
 
       <div class="w-400rem h-56rem rounded-full border-[#E7E7E7] border-1rem border-solid mb-60rem flex">
-        <div @click="loginType = 'email'" :class="`custom-tab ${loginType === 'email' ? 'select' : ''}`">
+        <div @click="loginForm.loginType = '2'" :class="`custom-tab ${loginForm.loginType === '2' ? 'select' : ''}`">
           {{ $t("邮箱验证登录") }}
         </div>
-        <div @click="loginType = 'account'" :class="`custom-tab ${loginType === 'account' ? 'select' : ''}`">
+        <div @click="loginForm.loginType = '1'"  :class="`custom-tab ${loginForm.loginType === '1' ? 'select' : ''}`">
           {{ $t("账号密码登录") }}
         </div>
       </div>
-      <div v-if="loginType === 'email'" class="flex flex-col items-center">
-        <ui-input class="!h-98rem !w-600rem mb-60rem" :placeholder="$t('请输入邮箱号码')">
+      <div v-if="loginForm.loginType === '2'" class="flex flex-col items-center">
+        <ui-input v-model="loginForm.email" class="!h-98rem !w-600rem mb-60rem" :placeholder="$t('请输入邮箱号码')">
           <div slot="prefix" class="flex items-center h-full ml-20rem">
             <img slot="prefix" src="/imgs/email_icon.png" class="w-37rem h-auto" />
           </div>
         </ui-input>
-        <ui-input class="!h-98rem !w-600rem mb-60rem " :placeholder="$t('请输入邮箱验证码')">
+        <ui-input v-model="loginForm.verifyCode" class="!h-98rem !w-600rem mb-60rem " :placeholder="$t('请输入邮箱验证码')">
           <div slot="prefix" class="flex items-center h-full ml-20rem">
             <img src="/imgs/vcode_icon.png" class="w-40rem h-auto" />
           </div>
 
           <div slot="suffix" class="flex items-center h-full">
             <div
+                    v-if="verifyCount <= 0"
+                    @click="handleSendVerifyCode"
               class="bg-primary rounded-full text-white flex justify-center items-center h-70rem w-200rem !text-size-30rem !font-light !px-0"
               type="primary" round>{{
                   $t("获取验证码")
               }}</div>
+            <div
+                    v-else
+                    @click="handleSendVerifyCode"
+              class="bg-primary rounded-full text-white flex justify-center items-center h-70rem w-200rem !text-size-30rem !font-light !px-0"
+              type="primary" round>{{ verifyCount}}S</div>
           </div>
         </ui-input>
       </div>
-      <div v-if="loginType === 'account'" class="flex flex-col items-end">
-        <ui-input class="!h-98rem !w-600rem mb-60rem" :placeholder="$t('请输入账号')">
+      <div v-if="loginForm.loginType === '1'" class="flex flex-col items-end">
+        <ui-input v-model="loginForm.email" class="!h-98rem !w-600rem mb-60rem" :placeholder="$t('请输入账号')">
           <div slot="prefix" class="flex items-center h-full ml-20rem">
             <img slot="prefix" src="/imgs/email_icon.png" class="w-37rem h-auto" />
           </div>
         </ui-input>
-        <ui-input class="!h-98rem !w-600rem mb-15rem" :placeholder="$t('请输入账号密码')">
+        <ui-input v-model="loginForm.password" type="password" class="!h-98rem !w-600rem mb-15rem" :placeholder="$t('请输入账号密码')">
           <div slot="prefix" class="flex items-center h-full ml-20rem">
             <img src="/imgs/password_icon.png" class="w-40rem h-auto" />
           </div>
@@ -57,7 +64,7 @@
         </el-button>
       </div>
 
-      <el-button @click="$router.push('/home')" class="h-88rem w-600rem !rounded-full !text-size-24rem !font-normal" type="primary" round>{{
+      <el-button @click="handleLogin" class="h-88rem w-600rem !rounded-full !text-size-24rem !font-normal" type="primary" round>{{
           $t("登录")
       }}</el-button>
       <div @click="$router.push('/register')" class="mt-30rem">
@@ -78,8 +85,96 @@ export default {
     return {
       activeName: "first",
       loginType: "email",
+      regForm:{
+        nickname:'',
+        email:'',
+        verifyCode:'',
+        password:''
+      },
+      loginForm:{
+        loginType:'2',
+        email:'',
+        password:''
+      },
+      verifyCount:0,
+      showPassword:false
     };
   },
+methods:{
+  async handleSendVerifyCode(){
+
+    if(this.verifyCount > 0){
+      return ;
+    }
+    let email = "";
+    if(this.activeName === "first"){
+      email = this.loginForm.email;
+    }
+
+    if(this.activeName === "second"){
+      email = this.regForm.email;
+    }
+
+    if(!email){
+
+      this.$toast(this.$t('邮箱不能为空'));
+      return;
+    }
+
+
+
+    let resp = await this.$http.post(this.$api.mzUser.sendVerifyCode,this.$qs.stringify({email:email}));
+
+    if(resp.data.status === 200){
+      this.$toast(this.$t('发送验证码成功'));
+
+      this.verifyCount = 60;
+      let inv = setInterval(()=>{
+        this.verifyCount--;
+        if(this.verifyCount <= 0){
+          clearInterval(inv);
+        }
+      },1000);
+
+    }else{
+      this.$toast(this.$t('发送验证码失败'));
+    }
+
+  },
+  async handleRegister(){
+
+    let resp = await  this.$http.post(this.$api.mzUser.register,this.$qs.stringify(this.regForm));
+
+    if(resp.data.status === 200){
+      this.$toast(this.$t('注册成功'));
+    }else{
+      this.$toast(resp.data.desc);
+    }
+
+  },
+  async handleLogin(){
+    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.$toast(this.$t('登录成功'));
+
+      if(this.$route.query.routeBack){
+        this.$router.back();
+      }else{
+        this.$router.push('/home')
+      }
+
+    }else{
+      this.$toast(resp.data.desc);
+    }
+  }
+},
+computed:{
+  regValid(){
+    return this.regForm.nickname && this.regForm.email && this.regForm.verifyCode  && this.regForm.password;
+  }
+}
 };
 </script>
 

+ 109 - 16
src/h5/pages/auth/register.vue

@@ -11,29 +11,34 @@
 
 
             <div  class="flex flex-col items-center">
-                <ui-input class="!h-98rem !w-600rem mb-24rem" :placeholder="$t('请输入昵称')">
+                <ui-input v-model="regForm.nickname" class="!h-98rem !w-600rem mb-24rem" :placeholder="$t('请输入昵称')">
                     <div slot="prefix" class="flex items-center h-full ml-20rem">
                         <img slot="prefix" src="/imgs/user_icon.png" class="w-42rem h-auto" />
                     </div>
                 </ui-input>
-                <ui-input class="!h-98rem !w-600rem mb-24rem" :placeholder="$t('请输入邮箱号码')">
+                <ui-input v-model="regForm.email"  class="!h-98rem !w-600rem mb-24rem" :placeholder="$t('请输入邮箱号码')">
                     <div slot="prefix" class="flex items-center h-full ml-20rem">
                         <img slot="prefix" src="/imgs/email_icon.png" class="w-37rem h-auto" />
                     </div>
                 </ui-input>
-                <ui-input class="!h-98rem !w-600rem mb-24rem " :placeholder="$t('请输入邮箱验证码')">
+                <ui-input v-model="regForm.verifyCode" class="!h-98rem !w-600rem mb-24rem " :placeholder="$t('请输入邮箱验证码')">
                     <div slot="prefix" class="flex items-center h-full ml-20rem">
                         <img src="/imgs/vcode_icon.png" class="w-40rem h-auto" />
                     </div>
 
                     <div slot="suffix" class="flex items-center h-full">
-                        <div class="bg-primary rounded-full text-white flex justify-center items-center h-70rem w-200rem !text-size-30rem !font-light !px-0"
+                        <div v-if="verifyCount <= 0" @click="handleSendVerifyCode" class="bg-primary rounded-full text-white flex justify-center items-center h-70rem w-200rem !text-size-30rem !font-light !px-0"
                             type="primary" round>{{
                                     $t("获取验证码")
                             }}</div>
+
+                        <div v-else @click="handleSendVerifyCode" class="bg-primary rounded-full text-white flex justify-center items-center h-70rem w-200rem !text-size-30rem !font-light !px-0"
+                             type="primary" round>{{
+                            verifyCount
+                            }}S</div>
                     </div>
                 </ui-input>
-                <ui-input class="!h-98rem !w-600rem mb-24rem" :placeholder="$t('请设置密码')">
+                <ui-input type="password" v-model="regForm.password" class="!h-98rem !w-600rem mb-24rem" :placeholder="$t('请设置密码')">
                     <div slot="prefix" class="flex items-center h-full ml-20rem">
                         <img slot="prefix" src="/imgs/password_icon.png" class="w-40rem h-auto" />
                     </div>
@@ -41,23 +46,111 @@
             </div>
 
 
-            <el-button class="h-88rem w-600rem !rounded-full !text-size-24rem !font-normal" type="primary" round>{{
-                    $t("登录")
+            <el-button @click="handleRegister" class="h-88rem w-600rem !rounded-full !text-size-24rem !font-normal" type="primary" round>{{
+                    $t("注册")
             }}</el-button>
 
         </div>
     </ui-page-layout>
 </template>
-  
+
 <script>
-export default {
-    data() {
-        return {
-            activeName: "first",
-            loginType: "email",
-        };
-    },
-};
+    export default {
+        data() {
+            return {
+                activeName: "second",
+                loginType: "email",
+                regForm:{
+                    nickname:'',
+                    email:'',
+                    verifyCode:'',
+                    password:''
+                },
+                loginForm:{
+                    loginType:'2',
+                    email:'',
+                    password:''
+                },
+                verifyCount:0,
+                showPassword:false
+            };
+        },
+        methods:{
+            async handleSendVerifyCode(){
+
+                if(this.verifyCount > 0){
+                    return ;
+                }
+                let email = "";
+                if(this.activeName === "first"){
+                    email = this.loginForm.email;
+                }
+
+                if(this.activeName === "second"){
+                    email = this.regForm.email;
+                }
+
+                if(!email){
+
+                    this.$toast(this.$t('邮箱不能为空'));
+                    return;
+                }
+
+
+
+                let resp = await this.$http.post(this.$api.mzUser.sendVerifyCode,this.$qs.stringify({email:email}));
+
+                if(resp.data.status === 200){
+                    this.$toast(this.$t('发送验证码成功'));
+
+                    this.verifyCount = 60;
+                    let inv = setInterval(()=>{
+                        this.verifyCount--;
+                        if(this.verifyCount <= 0){
+                            clearInterval(inv);
+                        }
+                    },1000);
+
+                }else{
+                    this.$toast(this.$t('发送验证码失败'));
+                }
+
+            },
+            async handleRegister(){
+
+                let resp = await  this.$http.post(this.$api.mzUser.register,this.$qs.stringify(this.regForm));
+
+                if(resp.data.status === 200){
+                    this.$toast(this.$t('注册成功'));
+                }else{
+                    this.$toast(resp.data.desc);
+                }
+
+            },
+            async handleLogin(){
+                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.$toast(this.$t('登录成功'));
+
+                    if(this.$route.query.routeBack){
+                        this.$router.back();
+                    }else{
+                        this.$router.push('/home')
+                    }
+
+                }else{
+                    this.$toast(resp.data.desc);
+                }
+            }
+        },
+        computed:{
+            regValid(){
+                return this.regForm.nickname && this.regForm.email && this.regForm.verifyCode  && this.regForm.password;
+            }
+        }
+    };
 </script>
   
 <style>

+ 36 - 40
src/h5/pages/home/home.vue

@@ -16,9 +16,8 @@
       <van-tabs v-model="active" background="#FFFFFF" color="#124026" class="h-full">
         <van-tab :title="$t('首页')" class="h-full flex-1">
           <div class="px-24rem pt-12rem">
-            <div>
-              <ui-swiper :showPagination="true" :items="banner1" class="w-full h-390rem"></ui-swiper>
-            </div>
+            <ui-banner class="w-full h-390rem" flag="首页"></ui-banner>
+
             <div class="flex justify-around mt-24rem mb-24rem">
               <div class="type-item">
                 <img class="w-68rem h-68rem object-contain" src="/imgs/recommend-type.png" />
@@ -40,43 +39,20 @@
             <div class="home-pics-group mb-32rem">
 
 
-
-              <ui-mask-picture class="h-192rem"></ui-mask-picture>
-              <ui-mask-picture class="h-192rem"></ui-mask-picture>
-              <ui-mask-picture class="h-192rem"></ui-mask-picture>
-              <ui-mask-picture class="h-192rem"></ui-mask-picture>
+              <ui-mask-picture flag="首页1" class="h-192rem"></ui-mask-picture>
+              <ui-mask-picture flag="首页2" class="h-192rem"></ui-mask-picture>
+              <ui-mask-picture flag="首页3"  class="h-192rem"></ui-mask-picture>
+              <ui-mask-picture flag="首页4" class="h-192rem"></ui-mask-picture>
 
 
             </div>
             <home-new></home-new>
             <div class="h-24rem"></div>
-            <UiMainArticle v-for="index in 8"></UiMainArticle>
-            <div class="home-pics-group mb-32rem">
-
-
-
-              <ui-mask-picture class="h-192rem"></ui-mask-picture>
-              <ui-mask-picture class="h-192rem"></ui-mask-picture>
-              <ui-mask-picture class="h-192rem"></ui-mask-picture>
-              <ui-mask-picture class="h-192rem"></ui-mask-picture>
-
-
-            </div>
-
-            <UiMainArticle v-for="index in 8"></UiMainArticle>
-            <img src="/imgs/split-pic-2.png" />
-            <UiMainArticle v-for="index in 8"></UiMainArticle>
+            <ui-article-list></ui-article-list>
           </div>
         </van-tab>
-        <van-tab :key="index" v-for="index in 10" :title="'标签 ' + index" class="h-full flex-1">
-          <div class="px-24rem pt-12rem">
-
-
-
-
-            <UiMainArticle v-for="index in 18"></UiMainArticle>
-
-          </div>
+        <van-tab :key="category.code" v-for="category in categorys" :title="category.name" class="h-full flex-1">
+          <ui-article-list :params="{category:category.code}"></ui-article-list>
         </van-tab>
       </van-tabs>
     </ui-scroll-view>
@@ -86,18 +62,38 @@
 
 <script>
 export default {
+  components: {},
   data() {
     return {
       active: 0,
-      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: "這裏是輪播圖推薦內容標題" },
-      ],
+      categorys:[],
+      currentLabel:'',
+      labelArticles:{}
     };
   },
+  async created() {
+    let resp = await  this.$http.post(this.$api.cms.categorys);
+    if(resp.data.status === 200){
+      this.categorys = resp.data.data.cmsCategorys;
+    }
+  },
+  methods:{
+    async labelArticles(pageIndex) {
+      let resp = await this.$http.post(this.$api.cms.articles, this.$qs.stringify({pageIndex: pageIndex,keywords:this.keywords}));
+      if (resp.data.status === 200) {
+        if(pageIndex === 1){
+          this.latestArts = resp.data.data.cmsArticles;
+        }else{
+          this.latestArts.push(...resp.data.data.cmsArticles);
+        }
+      }
+    }
+  },
+  watch:{
+    active(){
+      console.log(this.active);
+    }
+  }
 };
 </script>
 <style>

+ 34 - 16
src/h5/pages/hot/hot.vue

@@ -2,26 +2,44 @@
     <ui-page-layout title="热榜文章">
 
 
-
-        <UiMainArticle v-for="index in 8"></UiMainArticle>
+        <div class="pl-22rem pr-22rem">
+            <UiMainArticle  v-for="art in latestArts" :item="art"></UiMainArticle>
+        </div>
 
     </ui-page-layout>
 </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: "這裏是輪播圖推薦內容標題" },
-            ],
-        };
-    },
-};
+    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
+            };
+        },
+        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>
 .swiper-group {

Datei-Diff unterdrückt, da er zu groß ist
+ 22 - 23
src/h5/pages/publish/publish.vue


+ 36 - 16
src/h5/pages/realtime-news/realtime-news.vue

@@ -11,27 +11,47 @@
         </van-field>
       </div>
     </template>
-    <ui-mask-picture class="w-full h-136rem"></ui-mask-picture>
-    
-    <UiMainArticle v-for="index in 8"></UiMainArticle>
+    <ui-mask-picture flag="实时新闻" bannerClass="w-full h-136rem"></ui-mask-picture>
+
+    <div class="pl-22rem pr-22rem">
+      <UiMainArticle v-for="art in latestArts" :item="art"></UiMainArticle>
+    </div>
+
 
   </ui-page-layout>
 </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: "這裏是輪播圖推薦內容標題" },
-      ],
-    };
-  },
-};
+  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
+      };
+    },
+    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>
 .swiper-group {

+ 82 - 33
src/h5/pages/user/user-account-setting.vue

@@ -8,66 +8,115 @@
 
 
         <user-account-setting-info-item label="头像">
-          <img src="/imgs/avatar.png" class="w-80rem h-80rem" />
+          <img @click="handleUpload" v-if="userinfo.avatar" :src="userinfo.avatarUrl" class="w-80rem h-80rem !rounded-full" />
         </user-account-setting-info-item>
-        <user-account-setting-info-item :value="nickName" label="昵称" text="cyt"></user-account-setting-info-item>
-        <user-account-setting-info-item :value="email" label="账号" text="15486323563@qq.com">
+        <user-account-setting-info-item :value="userinfo.nickname" label="昵称" text="cyt"></user-account-setting-info-item>
+        <user-account-setting-info-item :value="userinfo.email" label="账号" text="15486323563@qq.com">
         </user-account-setting-info-item>
         <user-account-setting-info-item label="密码">
           <div class=" flex items-center">
             <div class="mr-50rem">*********</div>
-            <div class="text-primary cursor-pointer">重置密码</div>
+            <div @click="$router.push(`/change-pass?email=${userinfo.email}`)" class="text-primary cursor-pointer">重置密码</div>
           </div>
         </user-account-setting-info-item>
-        <user-account-setting-info-item v-model="name" label="姓名">
+        <user-account-setting-info-item v-model="userinfo.name" label="姓名">
 
         </user-account-setting-info-item>
-        <user-account-setting-info-item v-model="phone" label="电话">
-          <!-- <ui-input v-model="phone" class="!w-345rem">
-            <div slot="suffix" class="flex items-center h-full">
-              <div class="text-black">+86</div>
-              <div class="w-12rem"></div>
-              <img src="/imgs/menu-arrow.png" class="w-6rem h-auto" />
-              <div class="w-16rem"></div>
-            </div>
-          </ui-input> -->
+        <user-account-setting-info-item v-model="userinfo.phone" label="电话">
+
         </user-account-setting-info-item>
         <user-account-setting-info-item label="性别">
-          <el-radio-group v-model="gender">
-            <el-radio :label="0">女</el-radio>
-            <el-radio :label="1">男</el-radio>
+          <el-radio-group v-model="userinfo.gender">
+            <el-radio label="女">女</el-radio>
+            <el-radio label="男">男</el-radio>
           </el-radio-group>
         </user-account-setting-info-item>
-        <user-account-setting-info-item v-model="job" label="职业">
+        <user-account-setting-info-item v-model="userinfo.job" label="职业">
 
         </user-account-setting-info-item>
-        <user-account-setting-info-item v-model="jobUnit" label="工作单位">
+        <user-account-setting-info-item v-model="userinfo.workOrg" label="工作单位">
 
         </user-account-setting-info-item>
-        <user-account-setting-info-item v-model="addr" label="地址">
+        <user-account-setting-info-item v-model="userinfo.address" label="地址">
 
         </user-account-setting-info-item>
       </div>
+
+      <div class="flex justify-center mt-80rem">
+        <div type="primary" @click="handleConfirm"  class="h-60rem w-280rem bg-primary flex justify-center items-center rounded-full text-white">保存信息</div>
+      </div>
+
     </ui-scroll-view>
   </ui-page-layout>
 </template>
 
 <script>
 
-export default {
-  data() {
-    return {
-      nickName: "cyt",
-      email: "15486323563@qq.com",
-      gender: 0,
-      name: "陈小婷",
-      phone: "18926145678",
-      job: "产品经理",
-      jobUnit: "广州量子互联科技有限公司",
-      addr: "广州市黄埔区联和街道黄埔科学大道112号绿地广场1710室"
+  export default {
+    data() {
+      return {
+
+        userinfo: {
+          avatarUrl: "",
+          avatar: "",
+          nickname: '',
+          email: '',
+          gender: "",
+          name: "",
+          phone: "",
+          job: "",
+          workOrg: "",
+          address: "",
+        },
+        vipSmeals: []
+      }
+    },
+    async created() {
+      let resp = await this.$http.post(this.$api.mzUser.userinfo);
+
+      if (resp.data.status === 200) {
+        for (let key in this.userinfo){
+          this.userinfo[key] = resp.data.data.mzUser[key];
+        }
+      }
+
+      let r = await this.$http.post(this.$api.common.vipSmeals);
+      if (r.data.status === 200) {
+        this.vipSmeals = r.data.data.vipSmeals;
+      }
+    },
+    methods: {
+      handleUpload() {
+
+        let input = document.createElement("input")
+        input.type = 'file';
+        input.onchange = async (e) => {
+          let formData = new FormData();
+          formData.append("file", input.files[0])
+          formData.append("category", 'AVATAR')
+          let resp = await this.$http.post(this.$api.common.uploadFile, formData);
+          if (resp.data.status === 200) {
+            this.userinfo.avatarUrl = resp.data.data.url;
+            this.userinfo.avatar = resp.data.data.code;
+          }
+        }
+        input.click();
+
+      },
+      async handleConfirm(){
+
+        let resp = await this.$http.post(this.$api.mzUser.perfectInfo,this.$qs.stringify(this.userinfo));
+
+        if(resp.data.status === 200){
+          this.$toast(this.$t('操作成功'));
+        }else{
+          this.$toast(this.$t(resp.data.desc))
+        }
+
+
+      }
     }
-  }
-};
+  };
 </script>
 
 <style>

+ 38 - 6
src/h5/pages/user/user-collection.vue

@@ -1,18 +1,50 @@
 <template>
-  <ui-page-layout class="bg-white" title="我的点赞">
+  <ui-page-layout class="bg-white" title="我的收藏">
     <div class="p-24rem">
-      <ui-main-article v-for="item in 4" class="mb-24rem">
+      <ui-main-article v-for="article in articles" :item="article" class="mb-24rem">
+
+        <img @click.stop="handleCancel(article)" v-if="article.collect" src="/imgs/star.png" slot="right"  class="w-40rem right-0 bottom-17rem absolute"/>
 
-        <img src="/imgs/star.png" slot="right" class="w-40rem right-0 bottom-17rem absolute"/>
-        <!-- <img src="/imgs/star-blank.png" slot="right" class="w-40rem right-0 bottom-17rem absolute"/> -->
-        
       </ui-main-article>
     </div>
   </ui-page-layout>
 </template>
 
 <script>
-export default {};
+  export default {
+    components: {},
+    data(){
+      return {
+        articles:[]
+      }
+    },
+    methods:{
+      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.$dialog.confirm( {
+          message:'您现在正在进行取消收藏操作, 是否继续?',
+          title:'提示',
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+        });
+
+        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>

+ 36 - 3
src/h5/pages/user/user-comment.vue

@@ -1,14 +1,47 @@
 <template>
   <ui-page-layout title="我的评论">
     <div class="p-24rem">
-      <ui-main-article v-for="item in 4" class="mb-20px"></ui-main-article>
+      <ui-main-article v-for="item in articles" :item="item" class="mb-20px"></ui-main-article>
     </div>
   </ui-page-layout>
 
 </template>
-  
+
 <script>
-export default {};
+  export default {
+    components: {},
+    data(){
+      return {
+        articles:[]
+      }
+    },
+    methods:{
+      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.$dialog.confirm( {
+          message:'您现在正在进行取消订阅操作, 是否继续?',
+          title:'提示',
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+        });
+
+        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>

+ 37 - 4
src/h5/pages/user/user-history.vue

@@ -1,14 +1,47 @@
 <template>
-  <ui-page-layout title="我的收藏">
+  <ui-page-layout title="浏览历史">
     <div class="p-24rem">
-      <ui-main-article v-for="item in 4" class="mb-20px"></ui-main-article>
+      <ui-main-article v-for="item in articles" :item="item" class="mb-20px"></ui-main-article>
     </div>
   </ui-page-layout>
 
 </template>
-  
+
 <script>
-export default {};
+  export default {
+    components: {},
+    data(){
+      return {
+        articles:[]
+      }
+    },
+    methods:{
+      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.$dialog.confirm( {
+          message:'您现在正在进行取消订阅操作, 是否继续?',
+          title:'提示',
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+        });
+
+        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>

+ 36 - 3
src/h5/pages/user/user-like.vue

@@ -1,17 +1,50 @@
 <template>
   <ui-page-layout class="bg-white" title="我的点赞">
     <div class="p-24rem">
-      <ui-main-article v-for="item in 4" class="mb-24rem">
+      <ui-main-article v-for="item in articles" :item="item" class="mb-24rem">
 
         <!-- <img src="/imgs/like-button-checked.png" slot="right" class="w-39rem right-0 bottom-17rem absolute" /> -->
-        <img src="/imgs/like-button-checked.png" slot="right" class="w-39rem right-0 bottom-17rem absolute" />
+        <img @click.stop="handleCancel(item)" src="/imgs/like-button-checked.png" slot="right" class="w-39rem right-0 bottom-17rem absolute" />
       </ui-main-article>
     </div>
   </ui-page-layout>
 </template>
 
 <script>
-export default {};
+  export default {
+    components: {},
+    data(){
+      return {
+        articles:[]
+      }
+    },
+    methods:{
+      async handleLoad(){
+        let resp = await this.$http.post(this.$api.cms.myLikeArticles,this.$qs.stringify({onPage:false}));
+        this.articles = resp.data.data.cmsArticles;
+
+      },
+      async handleCancel(item){
+
+        await this.$dialog.confirm( {
+          message:'您现在正在进行取消点赞操作, 是否继续?',
+          title:'提示',
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+        });
+
+        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>

+ 36 - 2
src/h5/pages/user/user-subscription.vue

@@ -1,7 +1,7 @@
 <template>
   <ui-page-layout title="我的订阅">
     <div class="p-24rem">
-      <ui-main-article v-for="item in 4" class="mb-24rem">
+      <ui-main-article v-for="item in articles" :item="item" class="mb-24rem">
         
         <!-- <div
           slot="right"
@@ -11,6 +11,7 @@
         </div> -->
         <div
           slot="right"
+          @click.stop="handleCancel(item)"
           class="w-120rem h-40rem rounded-full flex items-center justify-center text-primary text-size-14  absolute right-0 bottom-17rem border-1rem border-solid bg-primary !text-white"
         >
           {{ $t("取消订阅") }}
@@ -22,7 +23,40 @@
 </template>
 
 <script>
-export default {};
+  export default {
+    components: {},
+    data(){
+      return {
+        articles:[]
+      }
+    },
+    methods:{
+      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.$dialog.confirm( {
+          message:'您现在正在进行取消订阅操作, 是否继续?',
+          title:'提示',
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+        });
+
+        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>

+ 47 - 10
src/h5/pages/vip/vip.vue

@@ -1,24 +1,61 @@
 <template>
   <ui-page-layout title="VIP期刊">
-    <ui-mask-picture class="w-full h-136rem"></ui-mask-picture>
+    <ui-mask-picture flag="实时新闻" bannerClass="w-full h-136rem"></ui-mask-picture>
     <van-tabs v-model="active" background="#FFFFFF" color="#124026" class="h-full">
 
-      <van-tab :key="index" v-for="index in 10" :title="2022 - index" class="h-full flex-1">
-        <div class="px-24rem pt-12rem">
+      <van-tab key="year"  title="全部" class="h-full flex-1">
+      <van-tab :key="year" v-for="year in years" :title="year" class="h-full flex-1">
 
-
-
-
-          <ui-vip-article class="mb-24rem" v-for="index in 8"></ui-vip-article>
-
-        </div>
       </van-tab>
+
     </van-tabs>
+    <div class="px-24rem pt-12rem">
+      <ui-vip-article class="mb-24rem" v-for="m in showVipMagazines" :item="m"></ui-vip-article>
+    </div>
   </ui-page-layout>
 </template>
 
 <script>
-export default {};
+  export default {
+    data(){
+      return {
+        vipMagazines:[],
+        hideYear:true,
+        currentYear:'',
+        active:0
+      }
+    },
+    watch:{
+      active(){
+        if(this.active !== 0){
+          this.currentYear = this.years[this.active - 1];
+        }else{
+          this.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>
 

+ 26 - 0
src/h5/store.js

@@ -0,0 +1,26 @@
+import Vue from 'vue'
+import Vuex from 'vuex'
+
+Vue.use(Vuex)
+
+export default new Vuex.Store({
+  state: {
+      userinfo:'',
+      banners:[],
+      cart:[]
+  },
+  mutations: {
+      UPDATE_LOGIN_INFO(state,param){
+         state.userinfo = param;
+      },
+      UPDATE_BANNER(state,param){
+          state.banners = param;
+      },
+      ADD_CART(state,param){
+          state.cart.push(param);
+      }
+  },
+  actions: {
+
+  }
+})

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

@@ -72,7 +72,7 @@
                     return;
                 }
 
-                if (!this.$store.state.userinfo.exipreVip) {
+                if (this.$store.state.userinfo.exipreVip) {
                     this.$refs.vsb.open();
                     return;
                 }