natasha 1 år sedan
förälder
incheckning
ba547bd1dc

+ 4 - 0
src/components/Header.vue

@@ -94,6 +94,10 @@ export default {
           name: '词典',
           url: '/dictionary'
         },
+        {
+          name: '小记者',
+          url: '/reporter'
+        }
       ],
       userMessage: null,
       userShow: true,

+ 5 - 0
src/router/index.js

@@ -129,6 +129,11 @@ export const constantRoutes = [{
         component: () =>
             import ('@/views/bookShelf/magazineDetail.vue')
     },
+    {
+        path: '/reporter',
+        component: () =>
+            import ('@/views/reporter/index.vue')
+    },
     // 404 page must be placed at the end !!!
     { path: '*', redirect: '/', hidden: true }
 ]

+ 55 - 1
src/views/bookShelf/bookItem.vue

@@ -42,10 +42,40 @@
                         {{ '# ' + itemL }}
                     </label>
                 </div>
-                <div class="book-describe">
+                <!-- <div class="book-describe">
                     <h2 class="title">{{data.describe.title}}</h2>
                     <span class="author">{{'BY '+data.describe.author}}</span>
                     <p class="describe">{{data.describe.describe}}</p>
+                </div> -->
+                <div class="info-box">
+                    <div class="info-item">
+                        <label>出版社</label>
+                        <span>二十一世纪英文报</span>
+                    </div>
+                    <div class="info-item">
+                        <label>字数</label>
+                        <span>78291</span>
+                    </div>
+                    <div class="info-item">
+                        <label>发行时间</label>
+                        <span>2023-01-12</span>
+                    </div>
+                    <div class="info-item">
+                        <label>中英双语</label>
+                        <span>中英双语</span>
+                    </div>
+                    <div class="info-item">
+                        <label>期数</label>
+                        <span>804 期</span>
+                    </div>
+                    <div class="info-item">
+                        <label>学段</label>
+                        <span>高中</span>
+                    </div>
+                    <div class="info-item">
+                        <label>版本</label>
+                        <span>基础版</span>
+                    </div>
                 </div>
                 <div class="price-box">
                     <span class="price">¥{{data.price|cutMoneyFiter}}</span>
@@ -469,6 +499,30 @@ export default {
                     text-decoration-line: line-through;
                 }
             }
+            .info-box{
+                display: flex;
+                flex-flow: wrap;
+                border-bottom: 1px solid #EBEBEB;
+                .info-item{
+                    width: 50%;
+                    margin-bottom: 15px;
+                    font-size: 14px;
+                    line-height: 22px;
+                    display: flex;
+                    label{
+                        color: #C2C2C2;
+                        font-weight: 400;
+                        margin-right: 16px;
+                        width: 58px;
+                        display: block;
+                        text-align:justify;
+                        text-justify:distribute-all-lines;
+                        text-align-last:justify;
+                        -moz-text-align-last:justify;
+                        -webkit-text-align-last:justify;
+                    }
+                }
+            }
             .btn-box{
                 .el-button{
                     width: 180px;

+ 2 - 4
src/views/bookStore/all.vue

@@ -10,16 +10,14 @@
         <el-carousel height="320px" trigger="click" arrow="never">
             <el-carousel-item v-for="item in 4" :key="item">
                 <!-- 如果有跳转链接 则跳转 否则只展示 -->
-                <a v-if="item" href="#" target="_blank">
+                <!-- <a v-if="item" href="#" target="_blank">
                     <el-image
                         class="image"
                         :src="require('../../assets/banner'+item+'.png')"
                         :fit="'cover'">
                     </el-image>
-                    <!-- <img :src="require('../../assets/banner'+item+'.png')" /> -->
-                </a>
+                </a> -->
                 <el-image
-                    v-else
                     class="image"
                     :src="require('../../assets/banner'+item+'.png')"
                     :fit="'cover'">

+ 2 - 4
src/views/bookStore/index.vue

@@ -10,16 +10,14 @@
         <el-carousel height="320px" trigger="click" arrow="never">
             <el-carousel-item v-for="item in 4" :key="item">
                 <!-- 如果有跳转链接 则跳转 否则只展示 -->
-                <a v-if="item" href="#" target="_blank">
+                <!-- <a v-if="item" href="#" target="_blank">
                     <el-image
                         class="image"
                         :src="require('../../assets/banner'+item+'.png')"
                         :fit="'cover'">
                     </el-image>
-                    <!-- <img :src="require('../../assets/banner'+item+'.png')" /> -->
-                </a>
+                </a> -->
                 <el-image
-                    v-else
                     class="image"
                     :src="require('../../assets/banner'+item+'.png')"
                     :fit="'cover'">

+ 381 - 0
src/views/reporter/index.vue

@@ -0,0 +1,381 @@
+<template>
+  <div class="bookShelf">
+    <Header
+      :headerBg="'#1F1F1F'"
+      :headerBorder="'#5C5C5C'"
+      :userBg="'rgba(0, 0, 0, 0.24)'"
+      :LoginNavIndex="4"
+    />
+    <ul class="option">
+        <li class="option-item" :class="[typeValue===indexo?'active':'']" v-for="(itemo,indexo) in optionList" :key="indexo" @click="handleClick(indexo)">
+            <span>{{itemo.label}}</span>
+        </li>
+    </ul>
+  </div>
+</template>
+
+<script>
+//这里可以导入其它文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
+//例如:import 《组件名称》from ‘《组件路径》';
+import Header from "../../components/Header.vue";
+
+export default {
+  //import引入的组件需要注入到对象中才能使用
+  components: { Header },
+  props: {},
+  data() {
+    //这里存放数据
+    return {
+      optionList: [
+        {
+            label: '栏目 1',
+        },
+        {
+            label: '栏目 2',
+        },
+        {
+            label: '栏目 3',
+        },
+        {
+            label: '栏目 4',
+        },
+        {
+            label: '栏目 5',
+        }
+        // ,
+        // {
+        //     label: '合刊',
+        //     img: 'hekan',
+        //     number: '6'
+        // }
+      ],
+      typeValue: 0,
+      changeList: [
+        {
+          name: "按购买时间",
+          sort: "down",
+          sortName: "gmsj",
+        },
+        {
+          name: "按名称",
+          sort: "",
+          sortName: "fbsj",
+        },
+        {
+          name: "最近使用",
+          sort: "",
+          sortName: "zjsy",
+        },
+      ],
+      sortField: "gmsj",
+      searchNameValue: '', // 搜索名称值
+      loading: false,
+      noMore: false
+    }
+  },
+  //计算属性 类似于data概念
+  computed: {
+    disabled () {
+        return this.loading || this.noMore
+    }
+  },
+  //监控data中数据变化
+  watch: {},
+  //方法集合
+  methods: {
+    handleClick(value){
+        this.typeValue = value
+        $(".list").animate({
+            scrollTop: 0
+        }, 200);
+    },
+    // 搜索查询
+    getSearch(){
+        $(".list").animate({
+            scrollTop: 0
+        }, 200);
+        this.getList()
+    },
+    SortEvent(type, name, sortName) {
+      let sort = "";
+      this.changeList.forEach((item) => {
+        if (item.name == name) {
+        //   if (!item.sort || item.sort == "up") {
+        //     item.sort = "down";
+        //     sort = "down";
+        //   } else if (item.sort == "down") {
+        //     item.sort = "up";
+        //     sort = "up";
+        //   }
+            item.sort = type;
+            sort = type;
+        } else {
+          item.sort = "";
+        }
+      });
+      if (sort == "down") {
+        this.sortType = 1;
+      } else {
+        this.sortType = 0;
+      }
+      this.sortField = sortName;
+      $(".list").animate({
+        scrollTop: 0
+      }, 200);
+      this.getList()
+    },
+    // 查询列表
+    getList(){
+        let arr = [{
+        src: require('../../assets/bookcard-image.png'),
+        name: "名称名称名称名称名称名称名称名称名称名称名称名称",
+        date: "2012-03-15",
+      },
+      {
+        src: require('../../assets/bookcard-image.png'),
+        name: "练习册练习册",
+        typeName: '初三提高级'
+      },
+      {
+        src: require('../../assets/bookcard-image.png'),
+        name: "课程课程",
+        classperiod: '45节'
+      },
+      {
+        src: require('../../assets/bookcard-image.png'),
+        name: "名称名称名称名称名称名称名称名称名称名称名称名称",
+        date: "2012-03-15",
+      },
+      {
+        src: require('../../assets/bookcard-image.png'),
+        name: "名称名称名称名称名称名称名称名称名称名称名称名称",
+        date: "2012-03-15",
+      },
+      {
+        src: require('../../assets/bookcard-image.png'),
+        name: "名称名称名称名称名称名称名称名称名称名称名称名称",
+        date: "2012-03-15",
+      }
+      ]
+        if(this.BookList.length<100){
+            this.BookList = this.BookList.concat(arr)
+        }else{
+            this.noMore = true
+        }
+    },
+    load () {
+      this.loading = true
+      setTimeout(() => {
+        this.getList()
+        this.loading = false
+      }, 2000)
+    }
+  },
+  //生命周期 - 创建完成(可以访问当前this实例)
+  created() {
+
+  },
+  //生命周期 - 挂载完成(可以访问DOM元素)
+  mounted() {
+
+  },
+  //生命周期-创建之前
+  beforeCreated() { },
+  //生命周期-挂载之前
+  beforeMount() { },
+  //生命周期-更新之前
+  beforUpdate() { },
+  //生命周期-更新之后
+  updated() { },
+  //生命周期-销毁之前
+  beforeDestory() { },
+  //生命周期-销毁完成
+  destoryed() { },
+  //如果页面有keep-alive缓存功能,这个函数会触发
+  activated() { }
+}
+</script>
+<style lang="scss" scoped>
+/* @import url(); 引入css类 */
+.bookShelf {
+  background: #F7F8FA;
+  height: calc(100vh - 64px);
+  .option{
+    list-style: none;
+    display: flex;
+    justify-content: center;
+    margin: 0;
+    padding: 0;
+    background: #17171A;
+    li{
+        display: flex;
+        align-items: center;
+        border-radius: 30px;
+        height: 36px;
+        padding: 7px 20px;
+        margin: 8px 4px;
+        cursor: pointer;
+        &:hover{
+            background: rgba(255, 255, 255, 0.08);
+        }
+        &.active{
+            background: rgba(255, 255, 255, 0.08);
+            .icon-img,span,b{
+                color: rgba(255, 255, 255, 0.9);
+            }
+        }
+        .icon-img{
+            width: 14px;
+            height: 14px;
+            margin: 1px 8px 0 0;
+            color: rgba(255, 255, 255, 0.5);
+        }
+        span{
+            color: rgba(255, 255, 255, 0.5);
+            font-size: 14px;
+            line-height: 22px;
+        }
+        b{
+            font-weight: 400;
+            font-size: 14px;
+            line-height: 22px;
+            color: rgba(255, 255, 255, 0.5);
+            margin-left: 5px;
+        }
+    }
+  }
+  .main {
+    width: 1200px;
+    margin: 0 auto;
+    padding: 24px 0 0 0;
+    .searchChangebox{
+        display: flex;
+        justify-content: space-between;
+        .searchChange-box{
+            display: flex;
+        }
+        .searchChange {
+            display: flex;
+            align-items: center;
+            justify-content: space-between;
+            padding: 4px 12px;
+            height: 32px;
+            margin-right: 16px;
+            border: 1px solid #E5E6EB;
+            border-radius: 20px;
+            &.active{
+                background: #175DFF;
+                > span{
+                    color: #FFFFFF;
+                }
+                .sort {
+                    > div {
+                        svg{
+                            color: #5E89EF;
+                            &.active{
+                                color: #FFFFFF;
+                            }
+                        }
+                    }
+                }
+            }
+            > span{
+                font-weight: 400;
+                font-size: 16px;
+                line-height: 22px;
+                color: #000;
+                margin-right: 4px;
+            }
+            .sort {
+                cursor: pointer;
+                height: 20px;
+                > div {
+                    font-size: 0;
+                    svg {
+                        width: 11px;
+                        height: 11px;
+                        color: #C2C2C2;
+                        padding: 3px 2px 2px 2px;
+                        &.icon-down{
+                            height: 9px;
+                            padding: 0 2px 2px 2px;
+                        }
+                    }
+                }
+            }
+        }
+        .input-search{
+            width: 220px;
+        }
+    }
+    .show-title{
+        color: #1F2C5C;
+        margin: 24px 0 0 0;
+        font-weight: 500;
+        font-size: 24px;
+        line-height: 32px;
+        b{
+            margin-left: 16px;
+            color: #ED5F00;
+        }
+    }
+    .list {
+        margin-top: 28px;
+        display: flex;
+        flex-wrap: wrap;
+        height: calc(100vh - 256px);
+        overflow-y: scroll;
+        &::-webkit-scrollbar {
+            display: none;
+        }
+        > div {
+            width: 200px;
+            border-radius: 8px;
+            overflow: hidden;
+            background: #ffffff;
+            margin-bottom: 24px;
+        }
+        .tips{
+            width: 100%;
+            text-align: center;
+            font-size: 12px;
+            color: #929CA8;
+        }
+    }
+  }
+  
+}
+</style>
+<style lang="scss">
+.bookShelf{
+    .searchChangebox{
+        .input-search{
+            .el-input__inner{
+                height: 32px;
+                color: #1D2129;
+                background: #F2F3F5;
+                border: none;
+                line-height: 32px;
+            }
+            .el-input-group__append{
+                border: none;
+                width: 32px;
+                height: 32px;
+                background: #165DFF;
+                text-align: center;
+                cursor: pointer;
+                &:hover{
+                    background: #4080FF;
+                }
+                &:focus{
+                    background: #0E42D2;
+                }
+            }
+            .el-button{
+                padding: 0;
+                color: #ffffff;
+            }
+        }
+    }
+}
+</style>