发表于: 2019-10-22 23:35:36

1 881


今天完成的事情:

把另一个页面写出来了:

<template>
  <div class="search">
    <nav>
      <img src="../assets/images/热门推荐/u538.svg" alt class="navImgLeft" />
      <p class="navWord">搜索结果</p>
      <img src="../assets/images/首页-视频1/u10.svg" alt class="navImgRight" />
    </nav>
    <div class="choice">
      <p>课程视频</p>
      <p>教辅资料</p>
    </div>
    <main>
      <div class="sort">
        <p>默认</p>
        <p>最热</p>
        <p>销量</p>
        <p>免费</p>
      </div>
      <div v-for="source in resource" :key="source.idclass="source">
        <div class="sourceContent">
          <img src="../assets/images/首页-视频1/u57.svg" alt />
          <div class="sourceName">
            <p>{{source.name}}</p>
            <span>{{source.label.one}}</span>
            <span>{{source.label.two}}</span>
            <span>{{source.label.thr}}</span>
          </div>
        </div>
        <div class="sourcePrice">
          <p>{{source.price}}</p>
          <p class="oldPrice" v-if="oldPrice">{{source.oldPrice}}</p>
        </div>
      </div>
    </main>
    <footer>
      <div class="foot">
        <img src="../assets/images/首页-视频1/u15.svg" alt />
        <p>首页</p>
      </div>
      <div class="foot">
        <img src="../assets/images/首页-视频1/u20.svg" alt />
        <p>学习</p>
      </div>
      <div class="foot">
        <img src="../assets/images/首页-视频1/u19.svg" alt />
        <p>论坛</p>
      </div>
      <div class="foot">
        <img src="../assets/images/首页-视频1/u18.svg" alt />
        <p>我的</p>
      </div>
    </footer>
  </div>
</template>

<script>
export default {
  name: "search",
  data() {
    return {
      sorry: true,
      oldPrice: true,
      resource: [
        {
          id: "",
          img: "",
          name: "《气体摩尔体积》",
          label: {
            one: "1",
            two: "2",
            thr: "3"
          },
          price: "¥10",
          oldPrice: "¥30"
        },
        {
          id: "",
          img: "",
          name: "《商品的含义和气体基本属性(第一课)》",
          label: {
            one: "1",
            two: "2",
            thr: "3"
          },
          price: "¥15",
          oldPrice: "¥40"
        }
      ],
      searchRecord: [
        "名师提优",
        "名师提优",
        "名师提优",
        "名师提优",
        "名师提优",
        "名师提优",
        "名师提优",
        "名师提优",
        "名师提优",
        "名师提优",
        "名师提优",
        "名师提优"
      ]
    };
  }
};
</script>

<style lang="scss" scope>
.search {
  nav {
    positionfixed;
    displayflex;
    justify-contentspace-between;
    align-itemscenter;
    top50px;
    width100%;
    height44px;
    background-color#e9e516;
    .navImgLeft {
      margin-left10px;
    }
    .navImgRight {
      margin-right10px;
    }
  }
  .choice {
    margin-top70px;
    displayflex;
    justify-contentcenter;
    align-itemscenter;
    p {
      margin0 10px;
      border-bottom1px solid #fff;
      &:hover {
        border-bottom1px solid #000;
      }
    }
  }
  main {
    .sort {
      displayflex;
      p {
        font-size12px;
        margin10px 5px;
        border-radius5px;
        padding0 2px;
        &:hover {
          background-color#000;
          color#fff;
        }
      }
    }
    .source {
      displayflex;
      justify-contentspace-between;
      align-itemscenter;
      padding10px 15px;
      .sourceContent {
        displayflex;
        img {
          width91px;
          height60px;
        }
        .sourceName {
          padding0 10px;
          span {
            font-size8px;
            margin5px;
            padding0 5px;
            color#7f7f7f;
            background-color#e3e3e3;
            border1px solid #7f7f7f;
            border-radius5px;
          }
        }
      }
      p {
        font-size10px;
      }
      .sourcePrice {
        .oldPrice {
          border-bottom1px solid #000;
        }
      }
    }
  }
  footer {
    positionfixed;
    bottom0;
    height49px;
    displayflex;
    justify-contentspace-between;
    align-itemscenter;
    width90%;
    padding0 5%;
    background-color#e3e3e3;
    .foot {
      displayflex;
      flex-flowcolumn nowrap;
      justify-contentcenter;
      align-itemscenter;
      p {
        margin0;
        font-size12px;
      }
    }
  }
}
</style>


明天计划:

没有达到要求,明天要两页


返回列表 返回列表
评论

    分享到