瀏覽代碼

搜索模块对接接口

natasha 1 年之前
父節點
當前提交
7284ace3c6

+ 23 - 6
src/views/bookShelf/articleDetail.vue

@@ -210,7 +210,12 @@
           </div>
           <el-collapse-transition>
             <div v-if="showGlossary">
-              <template v-if="articleInfo.art_voc_data.length > 0">
+              <template
+                v-if="
+                  articleInfo.art_voc_data &&
+                  articleInfo.art_voc_data.length > 0
+                "
+              >
                 <h4
                   :style="{ color: bgColorList[activeIndex].glossarySubtitle }"
                 >
@@ -226,7 +231,12 @@
                   ref="newWordList"
                 ></new-word-list>
               </template>
-              <template v-if="articleInfo.art_phrase_data.length > 0">
+              <template
+                v-if="
+                  articleInfo.art_phrase_data &&
+                  articleInfo.art_phrase_data.length > 0
+                "
+              >
                 <h4
                   :style="{ color: bgColorList[activeIndex].glossarySubtitle }"
                 >
@@ -242,7 +252,12 @@
                   ref="phraseList"
                 ></phrase-list>
               </template>
-              <template v-if="articleInfo.art_explain_data.length > 0">
+              <template
+                v-if="
+                  articleInfo.art_explain_data &&
+                  articleInfo.art_explain_data.length > 0
+                "
+              >
                 <h4
                   :style="{ color: bgColorList[activeIndex].glossarySubtitle }"
                 >
@@ -1289,9 +1304,11 @@ export default {
                   item = Object.assign(item, this.vocabularyType[item.vlId]);
                 }
               );
-              this.articleInfo.art_voc_data.forEach((item) => {
-                item.collect = false;
-              });
+              if (this.articleInfo.art_voc_data) {
+                this.articleInfo.art_voc_data.forEach((item) => {
+                  item.collect = false;
+                });
+              }
             }
             let articleArr =
               this.articleInfo.art_content.split('<p class="para"');

+ 37 - 35
src/views/evaluation/evaluDetail.vue

@@ -13,7 +13,7 @@
         >
       </div>
     </div>
-    <div class="content" v-if="question_list">
+    <div class="content" v-if="question_list && question_list.length > 0">
       <template v-if="progress === 'answer'">
         <div class="content-top">
           <span class="chapter">
@@ -23,46 +23,48 @@
         </div>
         <!-- <template v-for="(item,index) in evaluData"> -->
         <!-- <div class="content-center" :key="index" v-if="activeIndex===index"> -->
-        <div class="content-center" v-if="questionDetailList[activeIndex]">
-          <!-- <template v-if="item.type==='single'"> -->
-          <div class="title-box">
-            <b>{{ activeIndex + 1 }}.</b>
-            <div>
-              <div
-                class="aduioLine-content aduioLine-box"
-                v-if="questionDetailList[activeIndex].content.file_url"
-              >
-                <AudioLine
-                  audioId="artNormalAudio"
-                  :mp3="questionDetailList[activeIndex].content.file_url"
-                  :getCurTime="getCurTime"
-                  ref="audioLine"
-                  :mp3Source="'mp3'"
-                  :colorObj="colorObj"
-                />
+        <div class="content-center">
+          <template v-if="questionDetailList[activeIndex]">
+            <!-- <template v-if="item.type==='single'"> -->
+            <div class="title-box">
+              <b>{{ activeIndex + 1 }}.</b>
+              <div>
+                <div
+                  class="aduioLine-content aduioLine-box"
+                  v-if="questionDetailList[activeIndex].content.file_url"
+                >
+                  <AudioLine
+                    audioId="artNormalAudio"
+                    :mp3="questionDetailList[activeIndex].content.file_url"
+                    :getCurTime="getCurTime"
+                    ref="audioLine"
+                    :mp3Source="'mp3'"
+                    :colorObj="colorObj"
+                  />
+                </div>
+                <h5>{{ questionDetailList[activeIndex].content.content }}</h5>
               </div>
-              <h5>{{ questionDetailList[activeIndex].content.content }}</h5>
             </div>
-          </div>
-          <el-radio-group v-model="userSelect[activeIndex]">
-            <el-radio
-              :label="items.num"
-              v-for="(items, indexs) in questionDetailList[activeIndex]
-                .option_list"
-              :key="indexs"
-            >
-              <b v-if="items.label">{{ items.label }}.</b>
-              <span>{{ items.content }}</span>
-            </el-radio>
-          </el-radio-group>
-          <!-- </template> -->
+            <el-radio-group v-model="userSelect[activeIndex]">
+              <el-radio
+                :label="items.num"
+                v-for="(items, indexs) in questionDetailList[activeIndex]
+                  .option_list"
+                :key="indexs"
+              >
+                <b v-if="items.label">{{ items.label }}.</b>
+                <span>{{ items.content }}</span>
+              </el-radio>
+            </el-radio-group>
+            <!-- </template> -->
+          </template>
         </div>
         <!-- </template> -->
         <div class="btn-box">
           <el-button size="small" @click="handlePrev">上一题</el-button>
-          <el-button type="primary" size="small" @click="handleNext"
-            >下一题</el-button
-          >
+          <el-button type="primary" size="small" @click="handleNext">{{
+            activeIndex + 1 === question_list.length ? "提交" : "下一题"
+          }}</el-button>
         </div>
       </template>
       <template v-if="progress === 'result'">

+ 297 - 235
src/views/evaluation/index.vue

@@ -8,39 +8,83 @@
       ref="header"
     />
     <ul>
-        <li v-for="(item,index) in dataList" :key="index" :style="{background:bgList[index%3].bg}">
-            <div class="item-left">
-                <div class="item-top">
-                    <h2 :style="{color:bgList[index%3].color}">{{item.title}}</h2>
-                    <template v-for="(itemA,indexA) in 3">
-                        <img class="avatar" :src="avatarList[indexA]" :key="indexA" v-if="avatarList[indexA]" />
-                    </template>
-                    <span class="avatar-number" v-if="avatarList.length>3">{{avatarList.length>99?'99+':avatarList.length}}</span>
-                    <p :style="{color:bgList[index%3].color==='#FFFFFF'?'#F7F8FA':bgList[index%3].color}">{{item.totleNumber}}人做过</p>
-                </div>
-                
-                <div class="item-center">
-                        <label v-for="items in $studyType" :key="items.study_phase" :class="[item.studyType===items.study_phase?'active':'']" @click="item.studyType=items.study_phase">
-                            {{items.study_phase_name}}
-                        </label>
-                </div>
-                <div class="item-bottom">
-                    <a @click="handleStart(item)" :loading="createOrderLoading">开始测评  ¥{{price}}</a>
-                    <i class="el-icon-success" v-if="item.date" :style="{color:bgList[index%3].color}"></i>
-                    <span v-if="item.date" :style="{color:bgList[index%3].color}">{{item.date}} 做过</span>
-                </div>
-            </div>
-            <img :src="item.src" />
-        </li>
+      <li
+        v-for="(item, index) in dataList"
+        :key="index"
+        :style="{ background: bgList[index % 3].bg }"
+      >
+        <div class="item-left">
+          <div class="item-top">
+            <h2 :style="{ color: bgList[index % 3].color }">
+              {{ item.title }}
+            </h2>
+            <template v-for="(itemA, indexA) in 3">
+              <img
+                class="avatar"
+                :src="avatarList[indexA]"
+                :key="indexA"
+                v-if="avatarList[indexA]"
+              />
+            </template>
+            <span class="avatar-number" v-if="avatarList.length > 3">{{
+              avatarList.length > 99 ? "99+" : avatarList.length
+            }}</span>
+            <p
+              :style="{
+                color:
+                  bgList[index % 3].color === '#FFFFFF'
+                    ? '#F7F8FA'
+                    : bgList[index % 3].color,
+              }"
+            >
+              {{ item.totleNumber }}人做过
+            </p>
+          </div>
+
+          <div class="item-center">
+            <label
+              v-for="items in $studyType"
+              :key="items.study_phase"
+              :class="[item.studyType === items.study_phase ? 'active' : '']"
+              @click="item.studyType = items.study_phase"
+            >
+              {{ items.study_phase_name }}
+            </label>
+          </div>
+          <div class="item-bottom">
+            <a @click="handleStart(item)" :loading="createOrderLoading"
+              >开始测评 ¥{{ price }}</a
+            >
+            <i
+              class="el-icon-success"
+              v-if="item.date"
+              :style="{ color: bgList[index % 3].color }"
+            ></i>
+            <span v-if="item.date" :style="{ color: bgList[index % 3].color }"
+              >{{ item.date }} 做过</span
+            >
+          </div>
+        </div>
+        <img :src="item.src" />
+      </li>
     </ul>
     <el-dialog
-        :visible.sync="paymentShow"
-        :show-close="false"
-        :close-on-click-modal="false"
-        width="712px"
-        class="bookItem-dialog"
-        v-if="paymentShow">
-        <Payment :data="info" :payWay="payWay" @handleClose="handleClose" :orderId="orderId" :qr_code_url="qr_code_url" :order_amount="order_amount" @handleSuccess="handleSuccess" />
+      :visible.sync="paymentShow"
+      :show-close="false"
+      :close-on-click-modal="false"
+      width="712px"
+      class="bookItem-dialog"
+      v-if="paymentShow"
+    >
+      <Payment
+        :data="info"
+        :payWay="payWay"
+        @handleClose="handleClose"
+        :orderId="orderId"
+        :qr_code_url="qr_code_url"
+        :order_amount="order_amount"
+        @handleSuccess="handleSuccess"
+      />
     </el-dialog>
   </div>
 </template>
@@ -49,10 +93,10 @@
 //这里可以导入其它文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
 //例如:import 《组件名称》from ‘《组件路径》';
 import Header from "../../components/Header.vue";
-import { mapState } from 'vuex';
+import { mapState } from "vuex";
 import { getLogin } from "@/api/ajax";
-import Payment from "../bookShelf/components/Payment.vue"
-import { getToken } from '@/utils/auth'
+import Payment from "../bookShelf/components/Payment.vue";
+import { getToken } from "@/utils/auth";
 export default {
   //import引入的组件需要注入到对象中才能使用
   components: { Header, Payment },
@@ -60,262 +104,280 @@ export default {
   data() {
     //这里存放数据
     return {
-      dataList:[
+      dataList: [
         {
-            title:'词汇测试',
-            totleNumber:34,
-            date:'2023/03/02',
-            src:require('../../assets/evaluation1.png'),
-            studyType: 11,
-            test_type: 0
+          title: "词汇测试",
+          totleNumber: 34,
+          date: "2023/03/02",
+          src: require("../../assets/evaluation1.png"),
+          studyType: 11,
+          test_type: 0,
         },
         {
-            title:'听力测试',
-            totleNumber:46,
-            date:'2023/09/02',
-            src:require('../../assets/evaluation2.png'),
-            studyType: 11,
-            test_type: 1
+          title: "听力测试",
+          totleNumber: 46,
+          date: "2023/09/02",
+          src: require("../../assets/evaluation2.png"),
+          studyType: 11,
+          test_type: 1,
         },
         {
-            title:'阅读测试',
-            totleNumber:580,
-            date:'2023/09/20',
-            src:require('../../assets/evaluation3.png'),
-            studyType: 11,
-            test_type: 2
-        }
+          title: "阅读测试",
+          totleNumber: 580,
+          date: "2023/09/20",
+          src: require("../../assets/evaluation3.png"),
+          studyType: 11,
+          test_type: 2,
+        },
       ],
-      bgList:[
+      bgList: [
         {
-            bg:'linear-gradient(125.8deg, #265FCF 3.3%, #B7D4FF 102.29%)',
-            color:'#FFFFFF',
+          bg: "linear-gradient(125.8deg, #265FCF 3.3%, #B7D4FF 102.29%)",
+          color: "#FFFFFF",
         },
         {
-            bg:'linear-gradient(118.48deg, #AE52C5 14.09%, #FFF2CC 97.82%)',
-            color:'#FFFFFF'
+          bg: "linear-gradient(118.48deg, #AE52C5 14.09%, #FFF2CC 97.82%)",
+          color: "#FFFFFF",
         },
         {
-            bg:'linear-gradient(122.04deg, #CADEFF -1.1%, #EAE7FF 48.2%, #F1DFFF 101.79%)',
-            color:'#1D2129'
-        }
+          bg: "linear-gradient(122.04deg, #CADEFF -1.1%, #EAE7FF 48.2%, #F1DFFF 101.79%)",
+          color: "#1D2129",
+        },
+      ],
+      avatarList: [
+        require("../../assets/login/Group3214.png"),
+        require("../../assets/login/Group3214.png"),
+        require("../../assets/login/Group3214.png"),
+        require("../../assets/login/Group3214.png"),
+        require("../../assets/login/Group3214.png"),
       ],
-      avatarList:[require('../../assets/login/Group3214.png'),require('../../assets/login/Group3214.png'),require('../../assets/login/Group3214.png'),require('../../assets/login/Group3214.png'),require('../../assets/login/Group3214.png')],
       price: null,
       paymentShow: false, // 支付弹窗
-      payWay:this.$route.query.paywei?this.$route.query.paywei:'wei',
+      payWay: this.$route.query.paywei ? this.$route.query.paywei : "wei",
       info: null, // 信息
-      orderId: '',
-      qr_code_url: '',
+      orderId: "",
+      qr_code_url: "",
       order_amount: null,
       createOrderLoading: false,
-      userMessage: getToken()?JSON.parse(getToken()):null,
-    }
+      userMessage: getToken() ? JSON.parse(getToken()) : null,
+    };
   },
   //计算属性 类似于data概念
   computed: {
-    ...mapState(['$studyType']),
+    ...mapState(["$studyType"]),
   },
   //监控data中数据变化
   watch: {},
   //方法集合
   methods: {
     // 跳转开始测评
-    handleStart(obj){
-        if(!this.userMessage){
-            this.$refs.header.handleLogin('/evaluation','url')
-            return false
-        }
-        this.info = {
-            name: obj.title,
-            price_discount: this.price,
-            goods_study_phase: obj.studyType,
-            test_type: obj.test_type
-        }
-        this.handleOrder()
+    handleStart(obj) {
+      if (!this.userMessage) {
+        this.$refs.header.handleLogin("/evaluation", "url");
+        return false;
+      }
+      this.info = {
+        name: obj.title,
+        price_discount: this.price,
+        goods_study_phase: obj.studyType,
+        test_type: obj.test_type,
+      };
+      this.handleOrder();
     },
     // 获取测评价格
-    getPrice(){
-        getLogin('/OrgServer/Client/SysConfigQuery/GetSysConfig_Test', {})
-        .then((res) => {
-            if(res.status===1){
-                this.price = res.test_order_price
-            }
-        })
+    getPrice() {
+      getLogin("/OrgServer/Client/SysConfigQuery/GetSysConfig_Test", {}).then(
+        (res) => {
+          if (res.status === 1) {
+            this.price = res.test_order_price;
+          }
+        }
+      );
     },
     // 生成订单
-    handleOrder(){
-        this.createOrderLoading = true
-        let MethodName = "/ShopServer/Client/OrderManager/CreateOrder_Test";
-        let data = {
-            test_type: this.info.test_type,
-            study_phase: this.info.goods_study_phase,
-            pay_type: this.payWay==='wei'?3:this.payWay==='zhi'?4:this.payWay==='dui'?5:null
-        }
-        getLogin(MethodName, data)
+    handleOrder() {
+      this.createOrderLoading = true;
+      let MethodName = "/ShopServer/Client/OrderManager/CreateOrder_Test";
+      let data = {
+        test_type: this.info.test_type,
+        study_phase: this.info.goods_study_phase,
+        pay_type:
+          this.payWay === "wei"
+            ? 3
+            : this.payWay === "zhi"
+            ? 4
+            : this.payWay === "dui"
+            ? 5
+            : null,
+      };
+      getLogin(MethodName, data)
         .then((res) => {
-            this.createOrderLoading = false
-            if(res.status === 1){
-                this.order_amount = res.order_amount
-                if(this.order_amount<=0){
-                    
-                }else{
-                    this.orderId = res.id
-                    this.qr_code_url = res.qr_code_url
-                    this.paymentShow = true;
-                }
+          this.createOrderLoading = false;
+          if (res.status === 1) {
+            this.order_amount = res.order_amount;
+            if (this.order_amount <= 0) {
+              this.orderId = res.id;
+              this.handleSuccess();
+            } else {
+              this.orderId = res.id;
+              this.qr_code_url = res.qr_code_url;
+              this.paymentShow = true;
             }
-        }).catch(()=>{
-            this.createOrderLoading = false
+          }
         })
-        // this.paymentShow = true;
+        .catch(() => {
+          this.createOrderLoading = false;
+        });
+      // this.paymentShow = true;
     },
     // 关闭弹窗
-    handleClose(){
-        this.paymentShow = false
+    handleClose() {
+      this.paymentShow = false;
     },
     // 支付成功跳转
-    handleSuccess(){
-        this.paymentShow = false
-        this.$router.push({
-            path: '/evaluDetail',
-            query: {
-               title:this.info.name,
-               order: this.orderId
-            },
-        }); 
-    }
+    handleSuccess() {
+      this.paymentShow = false;
+      this.$router.push({
+        path: "/evaluDetail",
+        query: {
+          title: this.info.name,
+          order: this.orderId,
+        },
+      });
+    },
   },
   //生命周期 - 创建完成(可以访问当前this实例)
   created() {
-    this.getPrice()
+    this.getPrice();
   },
   //生命周期 - 挂载完成(可以访问DOM元素)
-  mounted() {
-  },
+  mounted() {},
   //生命周期-创建之前
-  beforeCreated() { },
+  beforeCreated() {},
   //生命周期-挂载之前
-  beforeMount() { },
+  beforeMount() {},
   //生命周期-更新之前
-  beforUpdate() { },
+  beforUpdate() {},
   //生命周期-更新之后
-  updated() { },
+  updated() {},
   //生命周期-销毁之前
-  beforeDestory() { },
+  beforeDestory() {},
   //生命周期-销毁完成
-  destoryed() { },
+  destoryed() {},
   //如果页面有keep-alive缓存功能,这个函数会触发
-  activated() { }
-}
+  activated() {},
+};
 </script>
 <style lang="scss" scoped>
 /* @import url(); 引入css类 */
-ul{
-    list-style: none;
-    width: 1200px;
-    margin: 0 auto;
-    padding-bottom: 40px;
-    li{
-        padding: 24px 40px;
-        display: flex;
-        height: 240px;
-        border-radius: 8px;
-        margin: 24px 0;
-        .item-left{
-            flex: 1;
-        }
-        img{
-            width: 320px;
-            height: 100%;
-        }
-        h2{
-            font-weight: 700;
-            font-size: 36px;
-            line-height: 51px;
-            margin: 0 24px 0 0;
-        }
-        .item-top{
-            display: flex;
-            align-items: center;
-            .avatar{
-                width: 24px;
-                height: 24px;
-                border: 1px solid #FFFFFF;
-                border-radius: 50%;
-                margin-right: -12px;
-            }
-            .avatar-number{
-                background: #D9E2FC;
-                border: 1px solid #FFFFFF;
-                border-radius: 40px;
-                padding: 2px 9px;
-                font-weight: 500;
-                font-size: 12px;
-                line-height: 20px;
-                color: #3459D2;
-                height: 26px;
-            }
-            p{
-                font-size: 14px;
-                line-height: 22px;
-                margin: 0 8px;
-            }
-        }
-        .item-center{
-            margin: 16px 0 51px 0;
-            display: flex;
-            align-items: center;
-            label{
-                border-radius: 20px;
-                margin-right: 8px;
-                color: #FFF;
-                font-size: 14px;
-                font-weight: 500;
-                line-height: 22px;
-                padding: 4px 16px;
-                display: inline-block;
-                cursor: pointer;
-                &.active{
-                    background: rgba(0, 0, 0, 0.24);
-                }
-            }
-        }
-        .item-bottom{
-            display: flex;
-            align-items: center;
-            a{
-                // width: 96px;
-                padding: 0 20px;
-                height: 36px;
-                line-height: 36px;
-                text-align: center;
-                background: #232324;
-                border-radius: 2px;
-                font-size: 14px;
-                color: #FFFFFF;
-                margin-right: 16px;
-            }
-            span{
-                font-weight: 500;
-                font-size: 14px;
-                line-height: 22px;
-                margin-left: 5px;
-            }
+ul {
+  list-style: none;
+  width: 1200px;
+  margin: 0 auto;
+  padding-bottom: 40px;
+  li {
+    padding: 24px 40px;
+    display: flex;
+    height: 240px;
+    border-radius: 8px;
+    margin: 24px 0;
+    .item-left {
+      flex: 1;
+    }
+    img {
+      width: 320px;
+      height: 100%;
+    }
+    h2 {
+      font-weight: 700;
+      font-size: 36px;
+      line-height: 51px;
+      margin: 0 24px 0 0;
+    }
+    .item-top {
+      display: flex;
+      align-items: center;
+      .avatar {
+        width: 24px;
+        height: 24px;
+        border: 1px solid #ffffff;
+        border-radius: 50%;
+        margin-right: -12px;
+      }
+      .avatar-number {
+        background: #d9e2fc;
+        border: 1px solid #ffffff;
+        border-radius: 40px;
+        padding: 2px 9px;
+        font-weight: 500;
+        font-size: 12px;
+        line-height: 20px;
+        color: #3459d2;
+        height: 26px;
+      }
+      p {
+        font-size: 14px;
+        line-height: 22px;
+        margin: 0 8px;
+      }
+    }
+    .item-center {
+      margin: 16px 0 51px 0;
+      display: flex;
+      align-items: center;
+      label {
+        border-radius: 20px;
+        margin-right: 8px;
+        color: #fff;
+        font-size: 14px;
+        font-weight: 500;
+        line-height: 22px;
+        padding: 4px 16px;
+        display: inline-block;
+        cursor: pointer;
+        &.active {
+          background: rgba(0, 0, 0, 0.24);
         }
+      }
     }
+    .item-bottom {
+      display: flex;
+      align-items: center;
+      a {
+        // width: 96px;
+        padding: 0 20px;
+        height: 36px;
+        line-height: 36px;
+        text-align: center;
+        background: #232324;
+        border-radius: 2px;
+        font-size: 14px;
+        color: #ffffff;
+        margin-right: 16px;
+      }
+      span {
+        font-weight: 500;
+        font-size: 14px;
+        line-height: 22px;
+        margin-left: 5px;
+      }
+    }
+  }
 }
 </style>
 <style lang="scss">
-.bookItem-dialog{
-    .el-dialog__header,.el-dialog__body{
-        padding: 0;
-    }
-    .el-dialog{
-        border: 1px solid #EBEBEB;
-        box-shadow: 0px 6px 30px 5px rgba(0, 0, 0, 0.05), 0px 16px 24px 2px rgba(0, 0, 0, 0.04), 0px 8px 10px -5px rgba(0, 0, 0, 0.08);
-        border-radius: 8px;
-        overflow: hidden;
-    }
+.bookItem-dialog {
+  .el-dialog__header,
+  .el-dialog__body {
+    padding: 0;
+  }
+  .el-dialog {
+    border: 1px solid #ebebeb;
+    box-shadow: 0px 6px 30px 5px rgba(0, 0, 0, 0.05),
+      0px 16px 24px 2px rgba(0, 0, 0, 0.04),
+      0px 8px 10px -5px rgba(0, 0, 0, 0.08);
+    border-radius: 8px;
+    overflow: hidden;
+  }
 }
-</style>
+</style>

+ 187 - 161
src/views/search/components/SearchInput.vue

@@ -1,192 +1,218 @@
 <template>
   <div class="search-box searchInput-compent">
-        <div class="search-top">
-            <el-select v-model="selectIndex" placeholder="请选择">
-                <el-option
-                    v-for="item in selectList"
-                    :key="item.value"
-                    :label="item.label"
-                    :value="item.value">
-                </el-option>
-            </el-select>
-            <el-input placeholder="输入关键字" v-model="searchInput" @input="handleSearchInput" @focus="handleSearchInput" @keyup.enter.native="handleSearch" maxlength="100"></el-input>
-            <a class="search-btn" @click="handleSearch">搜索</a>
-        </div>
+    <div class="search-top">
+      <el-select
+        v-model="selectIndexs"
+        placeholder="请选择"
+        @change="changeSelectIndexs"
+      >
+        <el-option
+          v-for="item in selectList"
+          :key="item.value"
+          :label="item.label"
+          :value="item.value"
+        >
+        </el-option>
+      </el-select>
+      <el-input
+        placeholder="输入关键字"
+        v-model="searchInput"
+        @input="handleSearchInput"
+        @focus="handleSearchInput"
+        @keyup.enter.native="handleSearch"
+        maxlength="100"
+      ></el-input>
+      <a class="search-btn" @click="handleSearch">搜索</a>
     </div>
+  </div>
 </template>
 
 <script>
 export default {
-  name: 'searchInput',
-  props:["searchQuery"],
-  data(){
-    return{
-        searchInput: this.searchQuery ? this.searchQuery : '', // 搜索内容
-        finalList: [], // 最终搜索结果
-        finalIndex: null,
-        selectIndex: this.$route.query.LoginNavIndex&&this.$route.query.LoginNavIndex*1<2?this.$route.query.LoginNavIndex*1:0,
-        selectList: [
-            {
-                label: '商城',
-                value: 0
-            },
-            {
-                label: '书架',
-                value: 1
-            },
-        ]
-    }
-  },
-  computed: {
-    
+  name: "searchInput",
+  props: ["searchQuery", "selectIndex", "isIndex"],
+  data() {
+    return {
+      searchInput: this.searchQuery ? this.searchQuery : "", // 搜索内容
+      finalList: [], // 最终搜索结果
+      finalIndex: null,
+      selectIndexs: this.selectIndex,
+      selectList: [
+        {
+          label: "商城",
+          value: 0,
+        },
+        {
+          label: "书架",
+          value: 1,
+        },
+      ],
+    };
   },
-  components: {
-  },
-  methods:{
+  computed: {},
+  components: {},
+  methods: {
     // 筛选内容
-    handleSearchInput(){
-        // 因为要搜索短语 所以前端不去除空格
-        let searchValue = this.searchInput.trim()
-        this.finalIndex = null
-        this.finalList = []
+    handleSearchInput() {
+      // 因为要搜索短语 所以前端不去除空格
+      let searchValue = this.searchInput.trim();
+      this.finalIndex = null;
+      this.finalList = [];
     },
     // 点击选择搜索内容
-    handleClickSelect(item){
-        this.searchInput = item.value
+    handleClickSelect(item) {
+      this.searchInput = item.value;
     },
     // 点击查询 保留最近10条
-    handleSearch(e){
-        // console.log(e)
-        // if((e.isComposing && e.type == 'keyup') || e.type == 'click'){
-        //     console.log(e)
-            // this.lastSearchList.push(this.searchInput.trim())
-            // this.lastSearchList = this.lastSearchList.slice(-10)
-            if(this.searchInput.trim()){
-                this.goto(this.searchInput.trim())
-            }else{
-                this.$message.warning('请先输入要查询的内容');
-            }
-        // }
+    handleSearch(e) {
+      if (this.searchInput.trim()) {
+        this.goto(this.searchInput.trim());
+      } else {
+        this.$message.warning("请先输入要查询的内容");
+      }
     },
-    goto(content){
+    goto(content) {
+      if (this.isIndex) {
         this.$router.push({
-            path: "/dictionary/detail",
-            query: {
-                content: content
-            },
+          path: "/search/detail",
+          query: {
+            content: content,
+            selectIndex: this.selectIndexs,
+          },
+        });
+      } else {
+        this.$router.replace({
+          path: "/search/detail",
+          query: {
+            content: content,
+            selectIndex: this.selectIndexs,
+          },
         });
+        window.location.reload();
+      }
     },
     // 监听上下键
-    keyDownUp(){
-        document.onkeydown =  (e) => {
-          //事件对象兼容
-          let e1 = e || event || window.event || arguments.callee.caller.arguments[0]
-          //键盘按键判断:左箭头-37;上箭头-38;右箭头-39;下箭头-40
-          if (e1 && e1.keyCode == 38) {
-            // 按下上箭头
-            if(this.finalList.length>0&&this.finalIndex){
-                this.finalIndex--
-            }
-            e.preventDefault()
-          } else if (e1 && e1.keyCode == 40) {
-            // 按下下箭头
-            if(this.finalList.length>0&&this.finalIndex!==null&&this.finalIndex<this.finalList.length-1){
-                this.finalIndex++
-            }else if(this.finalList.length>0&&this.finalIndex===null){
-                this.finalIndex = 0
-            }
-            e.preventDefault()
+    keyDownUp() {
+      document.onkeydown = (e) => {
+        //事件对象兼容
+        let e1 =
+          e || event || window.event || arguments.callee.caller.arguments[0];
+        //键盘按键判断:左箭头-37;上箭头-38;右箭头-39;下箭头-40
+        if (e1 && e1.keyCode == 38) {
+          // 按下上箭头
+          if (this.finalList.length > 0 && this.finalIndex) {
+            this.finalIndex--;
           }
-          if(this.finalIndex!==null) this.searchInput = this.finalList[this.finalIndex].value
+          e.preventDefault();
+        } else if (e1 && e1.keyCode == 40) {
+          // 按下下箭头
+          if (
+            this.finalList.length > 0 &&
+            this.finalIndex !== null &&
+            this.finalIndex < this.finalList.length - 1
+          ) {
+            this.finalIndex++;
+          } else if (this.finalList.length > 0 && this.finalIndex === null) {
+            this.finalIndex = 0;
+          }
+          e.preventDefault();
         }
-    }
+        if (this.finalIndex !== null)
+          this.searchInput = this.finalList[this.finalIndex].value;
+      };
+    },
+    // 改变书架或者书城
+    changeSelectIndexs(val) {
+      this.$emit("changeSelectIndex", val);
+    },
   },
-  mounted(){
-    this.keyDownUp()
-  }
-}
+  mounted() {
+    this.keyDownUp();
+  },
+};
 </script>
 
 <style lang="scss" scoped>
-.search-box{
-    background: #FFFFFF;
-    border-radius: 30px;
-    width: 740px;
-    padding: 4px;
-    .search-top{
-        display: flex;
-        .el-select{
-            width: 104px;
-            flex-shrink: 0;
-            border-right: 1px solid #E7E7E7;
-        }
+.search-box {
+  background: #ffffff;
+  border-radius: 30px;
+  width: 740px;
+  padding: 4px;
+  .search-top {
+    display: flex;
+    .el-select {
+      width: 104px;
+      flex-shrink: 0;
+      border-right: 1px solid #e7e7e7;
     }
-    .search-bottom{
-        max-height: 200px;
-        overflow-y: auto;
-        margin-top: 4px;
-        &::-webkit-scrollbar { 
-            display: none;
-        }
-        >div{
-            padding: 8px 24px;
-            overflow: hidden;
-            font-size: 16px;
-            line-height: 24px;
-            display: flex;
-            cursor: pointer;
-            &:hover,&.active{
-                background: #f5f5f5;
-            }
-            a{
-                color: rgba(141, 164, 239, 1);
-            }
-            b{
-                color: rgba(52, 89, 210, 1);
-            }
-            .para{
-                color: rgba(0, 0, 0, 0.48);
-                margin-left: 8px;
-                flex: 1;
-                overflow:hidden;
-                text-overflow:ellipsis;
-                white-space: nowrap;
-            }
-        }
+  }
+  .search-bottom {
+    max-height: 200px;
+    overflow-y: auto;
+    margin-top: 4px;
+    &::-webkit-scrollbar {
+      display: none;
     }
-    .search-btn{
-        width: 116px;
-        height: 48px;
-        display: block;
-        background: #E9F7F2;
-        border-radius: 30px;
-        cursor: pointer;
-        text-align: center;
-        line-height: 48px;
-        font-size: 16px;
-        color: #299764;
+    > div {
+      padding: 8px 24px;
+      overflow: hidden;
+      font-size: 16px;
+      line-height: 24px;
+      display: flex;
+      cursor: pointer;
+      &:hover,
+      &.active {
+        background: #f5f5f5;
+      }
+      a {
+        color: rgba(141, 164, 239, 1);
+      }
+      b {
+        color: rgba(52, 89, 210, 1);
+      }
+      .para {
+        color: rgba(0, 0, 0, 0.48);
+        margin-left: 8px;
+        flex: 1;
+        overflow: hidden;
+        text-overflow: ellipsis;
+        white-space: nowrap;
+      }
     }
+  }
+  .search-btn {
+    width: 116px;
+    height: 48px;
+    display: block;
+    background: #e9f7f2;
+    border-radius: 30px;
+    cursor: pointer;
+    text-align: center;
+    line-height: 48px;
+    font-size: 16px;
+    color: #299764;
+  }
 }
 </style>
 <style lang="scss">
-.searchInput-compent{
-    overflow: hidden;
-    input{
-        border: none;
-        padding-left: 24px;
-        height: 48px;
-        line-height: 48px;
-        font-size: 16px;
-        color: rgba(0, 0, 0, 0.88);
-    }
-    .el-select .el-input .el-select__caret{
-        color: #000;
-    }
-    .el-select .el-input input{
-        color: #000;
-    }
-    .el-input__suffix{
-        right: 15px;
-    }
+.searchInput-compent {
+  overflow: hidden;
+  input {
+    border: none;
+    padding-left: 24px;
+    height: 48px;
+    line-height: 48px;
+    font-size: 16px;
+    color: rgba(0, 0, 0, 0.88);
+  }
+  .el-select .el-input .el-select__caret {
+    color: #000;
+  }
+  .el-select .el-input input {
+    color: #000;
+  }
+  .el-input__suffix {
+    right: 15px;
+  }
 }
-</style>
+</style>

+ 209 - 171
src/views/search/index.vue

@@ -4,30 +4,42 @@
       :headerBg="'#299772'"
       :headerBorder="'#30A47D'"
       :userBg="'rgba(0, 0, 0, 0.08)'"
-      :LoginNavIndex="LoginNavIndex"
+      :LoginNavIndex="-1"
     />
     <div class="banner">
-        <a class="goback" @click="$router.go(-1)"><i class="el-icon-arrow-left"></i>返回</a>
-        <img src="../../assets/search-big.png" />
+      <a class="goback" @click="$router.go(-1)"
+        ><i class="el-icon-arrow-left"></i>返回</a
+      >
+      <img src="../../assets/search-big.png" />
     </div>
-    <SearchInput class="search-compent" :restaurants="restaurants" />
+    <SearchInput
+      class="search-compent"
+      :selectIndex="selectIndex"
+      @changeSelectIndex="changeSelectIndex"
+      :isIndex="true"
+    />
     <div class="main">
-      <div v-if="lastSearchList.length>0">
+      <div v-if="lastSearchList.length > 0">
         <h2>搜索历史</h2>
         <ul>
-            <li v-for="(item,index) in lastSearchList" :key="index">
-                <b @click="goto(item)">{{item}}</b>
-                <i class="el-icon-close" @click="handleDelete(index)"></i>
-            </li>
+          <li v-for="(item, index) in lastSearchList" :key="index">
+            <b @click="goto(item)">{{ item }}</b>
+            <i class="el-icon-close" @click="handleDelete(index)"></i>
+          </li>
         </ul>
       </div>
-      <div v-if="hotSearchList.length>0">
+      <div v-if="hotSearchList.length > 0">
         <h2>热门搜索</h2>
         <ul class="hotSearch">
-            <li v-for="(item,index) in hotSearchList" :key="index" :class="[index%3==2?'noMargin':'']" @click="goto(item)">
-                <span :class="['xuhao_'+index]">{{index+1}}</span>
-                <b :title="item">{{item}}</b>
-            </li>
+          <li
+            v-for="(item, index) in hotSearchList"
+            :key="index"
+            :class="[index % 3 == 2 ? 'noMargin' : '']"
+            @click="goto(item)"
+          >
+            <span :class="['xuhao_' + index]">{{ index + 1 }}</span>
+            <b :title="item">{{ item }}</b>
+          </li>
         </ul>
       </div>
     </div>
@@ -38,7 +50,8 @@
 //这里可以导入其它文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
 //例如:import 《组件名称》from ‘《组件路径》';
 import Header from "../../components/Header.vue";
-import SearchInput from "./components/SearchInput.vue"
+import SearchInput from "./components/SearchInput.vue";
+import { getLogin } from "@/api/ajax";
 
 export default {
   //import引入的组件需要注入到对象中才能使用
@@ -47,23 +60,17 @@ export default {
   data() {
     //这里存放数据
     return {
-      restaurants: [
-          { "value": "co", "para": "abbr. 一氧化碳" },
-          { "value": "comco", "para": "abbr. 一氧化碳1111" },
-          { "value": "come in", "para": "abbr. 组件对象模型" },
-          { "value": "content", "para": "adj. 满足的,满意的,甘愿的" },
-          { "value": "cogent", "para": "adj. 有说服力的,令人信服的adj. 有说服力的,令人信服的adj. 有说服力的,令人信服的adj. 有说服力的,令人信服的adj. 有说服力的,令人信服的adj. 有说服力的,令人信服的adj. 有说服力的,令人信服的" },
-        ],
-      hotSearchList: [ // 热门查询列表
-        'ChartGpt','Covid-19','AI','Roman','FIFA','Messi','the three body','Encanto','Premier'
-      ],
-      lastSearchList: ['891期','理性与神秘','局外人'], // 查询记录列表
-      config: this.$route.query.headerConfig?decodeURIComponent(this.$route.query.headerConfig):'',
+      selectIndex: 0,
+      hotSearchList: [],
+      lastSearchList: [], // 查询记录列表
+      config: this.$route.query.headerConfig
+        ? decodeURIComponent(this.$route.query.headerConfig)
+        : "",
       LoginNavIndex: 0,
-      userBg: 'rgba(0, 0, 0, 0.24)',
-      headerBorder: '#5C5C5C',
-      headerBg: '#1F1F1F'
-    }
+      userBg: "rgba(0, 0, 0, 0.24)",
+      headerBorder: "#5C5C5C",
+      headerBg: "#1F1F1F",
+    };
   },
   //计算属性 类似于data概念
   computed: {},
@@ -72,171 +79,202 @@ export default {
   //方法集合
   methods: {
     // 删除热门查询某条
-    handleDelete(index){
-        this.lastSearchList.splice(index,1)
+    handleDelete(index) {
+      this.lastSearchList.splice(index, 1);
+    },
+    goto(content) {
+      this.$router.push({
+        path: "/search/detail",
+        query: {
+          content: content,
+          headerConfig: encodeURIComponent(this.config),
+        },
+      });
+    },
+    // 查询系统搜索关键热词
+    getHotWordList() {
+      let MethodName = "/PaperServer/Client/Search/QueryHotWordList";
+      let data = {
+        limit: 9,
+      };
+      getLogin(MethodName, data).then((res) => {
+        if (res.status === 1) {
+          this.hotSearchList = res.data;
+        }
+      });
+    },
+    // 查询用户最近搜索的单词
+    getUserSearchList() {
+      let MethodName = "/PaperServer/Client/Dict/QueryUserSearchWordList";
+      let data = {
+        limit: 9,
+      };
+      getLogin(MethodName, data).then((res) => {
+        if (res.status === 1) {
+          this.lastSearchList = res.data;
+        }
+      });
     },
-    goto(content){
-        this.$router.push({
-            path: "/search/detail",
-            query: {
-                content: content,
-                headerConfig: encodeURIComponent(this.config)
-            },
-        });
+    changeSelectIndex(val) {
+      this.selectIndex = val;
     },
   },
   //生命周期 - 创建完成(可以访问当前this实例)
   created() {
-    if(this.config){
-        let arr = this.config.split('&&&')
-        this.LoginNavIndex = arr[0] * 1
-        this.userBg = arr[1]
-        this.headerBorder = arr[2]
-        this.headerBg = arr[3]
+    if (this.config) {
+      let arr = this.config.split("&&&");
+      this.LoginNavIndex = arr[0] * 1;
+      this.userBg = arr[1];
+      this.headerBorder = arr[2];
+      this.headerBg = arr[3];
+      this.selectIndex = arr[0] * 1 < 2 ? arr[0] * 1 : 0;
     }
+    this.getHotWordList();
+    this.getUserSearchList();
   },
   //生命周期 - 挂载完成(可以访问DOM元素)
-  mounted() {
-  },
+  mounted() {},
   //生命周期-创建之前
-  beforeCreated() { },
+  beforeCreated() {},
   //生命周期-挂载之前
-  beforeMount() { },
+  beforeMount() {},
   //生命周期-更新之前
-  beforUpdate() { },
+  beforUpdate() {},
   //生命周期-更新之后
-  updated() { },
+  updated() {},
   //生命周期-销毁之前
-  beforeDestory() { },
+  beforeDestory() {},
   //生命周期-销毁完成
-  destoryed() { },
+  destoryed() {},
   //如果页面有keep-alive缓存功能,这个函数会触发
-  activated() { }
-}
+  activated() {},
+};
 </script>
 <style lang="scss" scoped>
 /* @import url(); 引入css类 */
-.search{
+.search {
+  position: relative;
+  .banner {
+    background: #299772;
+    height: 209px;
+    text-align: center;
     position: relative;
-    .banner{
-        background: #299772;
-        height: 209px;
+    .goback {
+      position: absolute;
+      left: 24px;
+      top: 24px;
+      width: 96px;
+      height: 40px;
+      display: block;
+      text-align: center;
+      cursor: pointer;
+      color: #ffffff;
+      line-height: 40px;
+      .el-icon-arrow-left {
+        width: 24px;
+        height: 24px;
         text-align: center;
-        position: relative;
-        .goback{
-            position: absolute;
-            left: 24px;
-            top: 24px;
-            width: 96px;
-            height: 40px;
-            display: block;
-            text-align: center;
-            cursor: pointer;
-            color: #FFFFFF;
-            line-height: 40px;
-            .el-icon-arrow-left{
-                width: 24px;
-                height: 24px;
-                text-align: center;
-                line-height: 24px;
-                margin: 0 4px;
-            }
+        line-height: 24px;
+        margin: 0 4px;
+      }
+    }
+    img {
+      height: 64px;
+      margin-top: 73px;
+    }
+  }
+  .search-compent {
+    box-shadow: 0px 6px 30px 5px rgba(0, 0, 0, 0.05),
+      0px 16px 24px 2px rgba(0, 0, 0, 0.04),
+      0px 8px 10px -5px rgba(0, 0, 0, 0.08);
+    width: 740px;
+    position: absolute;
+    top: 181px;
+    left: 50%;
+    margin-left: -370px;
+  }
+  .main {
+    width: 740px;
+    margin: 0 auto;
+    padding-top: 36px;
+    h2 {
+      font-weight: 500;
+      font-size: 16px;
+      line-height: 24px;
+      color: rgba(0, 0, 0, 0.45);
+      margin-top: 32px;
+      margin-bottom: 0;
+    }
+    ul {
+      list-style: none;
+      display: flex;
+      flex-flow: wrap;
+      margin: 0;
+      padding: 8px 0 0 0;
+      li {
+        padding: 8px 12px 8px;
+        background: #e9f7f2;
+        border-radius: 20px;
+        display: flex;
+        align-items: center;
+        margin: 8px 7px 8px 0;
+        b {
+          color: #299772;
+          font-weight: 400;
+          font-size: 16px;
+          line-height: 24px;
+          cursor: pointer;
         }
-        img{
-            height: 64px;
-            margin-top: 73px;
+        .el-icon-close {
+          color: #299772;
+          cursor: pointer;
+          margin-left: 8px;
         }
+      }
     }
-    .search-compent{
-        box-shadow: 0px 6px 30px 5px rgba(0, 0, 0, 0.05), 0px 16px 24px 2px rgba(0, 0, 0, 0.04), 0px 8px 10px -5px rgba(0, 0, 0, 0.08);
-        width: 740px;
-        position: absolute;
-        top: 181px;
-        left: 50%;
-        margin-left: -370px;
-    }
-    .main{
-        width: 740px;
-        margin: 0 auto;
-        padding-top: 36px;
-        h2{
-            font-weight: 500;
-            font-size: 16px;
-            line-height: 24px;
-            color: rgba(0, 0, 0, 0.45);
-            margin-top: 32px;
-            margin-bottom: 0;
+    .hotSearch {
+      li {
+        width: 240px;
+        height: 56px;
+        background: #ffffff;
+        border-radius: 8px;
+        cursor: pointer;
+        margin-right: 10px;
+        padding: 16px 26px;
+        &.noMargin {
+          margin-right: 0;
         }
-        ul{
-            list-style: none;
-            display: flex;
-            flex-flow: wrap;
-            margin: 0;
-            padding: 8px 0 0 0;
-            li{
-                padding: 8px 12px 8px;
-                background: #E9F7F2;
-                border-radius: 20px;
-                display: flex;
-                align-items: center;
-                margin: 8px 7px 8px 0;
-                b{
-                    color: #299772;
-                    font-weight: 400;
-                    font-size: 16px;
-                    line-height: 24px;
-                    cursor: pointer;
-                }
-                .el-icon-close{
-                    color: #299772;
-                    cursor: pointer;
-                    margin-left: 8px;
-                }
-            }
+        span {
+          display: block;
+          background: #7796c4;
+          border-radius: 2px;
+          width: 18px;
+          height: 18px;
+          font-weight: 400;
+          font-size: 14px;
+          line-height: 18px;
+          text-align: center;
+          color: #ffffff;
+          &.xuhao_0 {
+            background: #ea1e1e;
+          }
+          &.xuhao_1 {
+            background: #ff8e4f;
+          }
+          &.xuhao_2 {
+            background: #f0a432;
+          }
         }
-        .hotSearch{
-            li{
-                width: 240px;
-                height: 56px;
-                background: #FFFFFF;
-                border-radius: 8px;
-                cursor: pointer;
-                margin-right: 10px;
-                padding: 16px 26px;
-                &.noMargin{
-                    margin-right: 0;
-                }
-                span{
-                    display: block;
-                    background: #7796C4;
-                    border-radius: 2px;
-                    width: 18px;
-                    height: 18px;
-                    font-weight: 400;
-                    font-size: 14px;
-                    line-height: 18px;
-                    text-align: center;
-                    color: #FFFFFF;
-                    &.xuhao_0{
-                        background: #EA1E1E;
-                    }
-                    &.xuhao_1{
-                        background: #FF8E4F;
-                    }
-                    &.xuhao_2{
-                        background: #F0A432;
-                    }
-                }
-                b{
-                    color: #000;
-                    margin-left: 10px;
-                    flex: 1;
-                    overflow: hidden;
-                    text-overflow:ellipsis;
-                    white-space: nowrap;
-                }
-            }
+        b {
+          color: #000;
+          margin-left: 10px;
+          flex: 1;
+          overflow: hidden;
+          text-overflow: ellipsis;
+          white-space: nowrap;
         }
+      }
     }
+  }
 }
-</style>
+</style>

+ 565 - 616
src/views/search/searchDetail.vue

@@ -1,111 +1,141 @@
 <template>
-  <div class="search-detail">
+  <div class="search-detail" v-loading="loading">
     <Header
       :headerBg="'#299772'"
       :headerBorder="'#30A47D'"
       :userBg="'rgba(0, 0, 0, 0.08)'"
-      :LoginNavIndex="LoginNavIndex"
+      :LoginNavIndex="-1"
     />
     <div class="banner">
-        <a class="goback" @click="$router.go(-1)"><i class="el-icon-arrow-left"></i>返回</a>
-        <div class="banner-inner">
-            <img src="../../assets/icon-search-small.png" />
-            <SearchInput class="search-compent" :searchQuery="searchQuery" />
-        </div>
+      <a class="goback" @click="$router.go(-1)"
+        ><i class="el-icon-arrow-left"></i>返回</a
+      >
+      <div class="banner-inner">
+        <img src="../../assets/icon-search-small.png" />
+        <SearchInput
+          class="search-compent"
+          :searchQuery="searchQuery"
+          :selectIndex="selectIndex"
+          @changeSelectIndex="changeSelectIndex"
+        />
+      </div>
     </div>
     <div class="main">
-        <!-- <ul class="typelist">
+      <!-- <ul class="typelist">
             <li class="typeitem" :class="[typeIndex===indexT?'active':'']" v-for="(itemT,indexT) in typeList" :key="indexT" @click="handleTypeIndex('typeIndex',indexT)">
                 <svg-icon :icon-class="itemT.img" className="icon-img"></svg-icon>
                 <span class="OPPOSans">{{itemT.name}}</span>
                 <b class="OPPOSans">{{itemT.value}}</b>
             </li>
         </ul> -->
-        <div class="main-inner">
-            <ul v-if="typeList&&typeList.length>0" class="gradelist">
-                <li :class="['gradeitem',indeG===typeIndex?'active':'']" v-for="(itemG,indeG) in typeList" :key="indeG" @click="handleTypeIndex('typeIndex',indeG)">
-                    {{itemG.name+' '+itemG.value}}
-                </li>
-            </ul>
-            <ul v-if="gradeList&&gradeList.length>0" class="gradelist">
-                <li :class="['gradeitem',indeG===gradeIndex?'active':'']" v-for="(itemG,indeG) in gradeList" :key="indeG" @click="handleTypeIndex('gradeIndex',indeG)">
-                    {{itemG.name}}
-                </li>
-            </ul>
-            <ul v-if="yearList&&yearList.length>0" class="gradelist">
-                <li :class="['gradeitem',indeG===yearIndex?'active':'']" v-for="(itemG,indeG) in yearList" :key="indeG" @click="handleTypeIndex('yearIndex',indeG)">
-                    {{itemG.label}}
-                </li>
-            </ul>
-            <p class="timeconsume">982条结果,耗时 300ms。</p>
-            <div class="searchChangebox">
-                <div class="searchChange" :class="[item.sortName==sortField?'active':'']" v-for="(item,indexC) in changeList" :key="indexC">
-                    <span>
-                        {{
-                            item.name
-                        }}
-                    </span>
-                    <div :class="['sort']">
-                        <div>
-                            <svg-icon icon-class="up" className="icon-up" :class="[item.sort=='up'?'active':'']" @click="SortEvent('up', item.name, item.sortName)"></svg-icon>
-                        </div>
-                        <div>
-                            <svg-icon icon-class="down" className="icon-down" :class="[item.sort=='down'?'active':'']" @click="SortEvent('down', item.name, item.sortName)"></svg-icon>
-                        </div>
-                    </div>
-                </div>
+      <div class="main-inner">
+        <!-- <ul v-if="typeList && typeList.length > 0" class="gradelist">
+          <li
+            :class="['gradeitem', indeG === typeIndex ? 'active' : '']"
+            v-for="(itemG, indeG) in typeList"
+            :key="indeG"
+            @click="handleTypeIndex('typeIndex', indeG)"
+          >
+            {{ itemG.name + " " + itemG.value }}
+          </li>
+        </ul> -->
+        <ul v-if="gradeList && gradeList.length > 0" class="gradelist">
+          <li
+            :class="[
+              'gradeitem',
+              itemG.study_phase === gradeIndex ? 'active' : '',
+            ]"
+            v-for="(itemG, indeG) in gradeList"
+            :key="indeG"
+            @click="handleTypeIndex('gradeIndex', itemG.study_phase)"
+          >
+            {{ itemG.study_phase_name }}
+          </li>
+        </ul>
+        <ul v-if="yearList && yearList.length > 0" class="gradelist">
+          <li
+            :class="['gradeitem', itemG.value === yearIndex ? 'active' : '']"
+            v-for="(itemG, indeG) in yearList"
+            :key="indeG"
+            @click="handleTypeIndex('yearIndex', itemG.value)"
+          >
+            {{ itemG.label }}
+          </li>
+        </ul>
+        <p class="timeconsume">
+          {{ courseTotal }}条结果,耗时
+          {{ takeTime >= 1000 ? takeTime / 1000 + "s" : takeTime + "ms" }}。
+        </p>
+        <div class="searchChangebox">
+          <div
+            class="searchChange"
+            :class="[item.sortName == sortField ? 'active' : '']"
+            v-for="(item, indexC) in changeList"
+            :key="indexC"
+          >
+            <span>
+              {{ item.name }}
+            </span>
+            <div :class="['sort']">
+              <div>
+                <svg-icon
+                  icon-class="up"
+                  className="icon-up"
+                  :class="[item.sort == 'up' ? 'active' : '']"
+                  @click="SortEvent('up', item.name, item.sortName)"
+                ></svg-icon>
+              </div>
+              <div>
+                <svg-icon
+                  icon-class="down"
+                  className="icon-down"
+                  :class="[item.sort == 'down' ? 'active' : '']"
+                  @click="SortEvent('down', item.name, item.sortName)"
+                ></svg-icon>
+              </div>
             </div>
-            <template v-if="searchList&&searchList.length>0">
-                <div class="search-item" v-for="(itemS,indexS) in searchList" :key="indexS" @click="handleLink(itemS)">
-                    <el-image
-                        :src="itemS.src"
-                        :fit="'cover'">
-                    </el-image>
-                    <div class="search-inner">
-                        <div class="top">
-                            <h2 v-html="itemS.title"></h2>
-                            <span v-html="itemS.author"></span>
-                        </div>
-                        <div class="content" v-html="itemS.content"></div>
-                        <div class="bottom">
-                            <span v-if="itemS.periodicalNumber">{{itemS.periodicalNumber}}</span>
-                            <span v-if="itemS.gradetype">{{itemS.gradetype}}</span>
-                            <span v-if="itemS.wordLength">长度:{{itemS.wordLength}}</span>
-                            <span v-if="itemS.wordNumber">词数:{{itemS.wordNumber}}</span>
-                            <span v-if="itemS.difficulty">难度:{{itemS.difficulty}}</span>
-                            <span v-if="itemS.approximation">近似度{{itemS.approximation}}</span>
-                        </div>
-                    </div>
-                </div>
-                <el-pagination
-                    background
-                    :current-page="currentPage"
-                    :page-size="page_capacity"
-                    :page-sizes="[10, 20, 30, 40, 50]"
-                    :total="courseTotal"
-                    layout="sizes, prev, pager, next, jumper"
-                    @current-change="handleCurrentChange"
-                    @size-change="handleSizeChange"
-                />
-
-            </template>
-            <div class="search-list" v-if="searchList2&&searchList2.length>0">
-                <div
-                    v-for="(item,index) in searchList2"
-                    :key="index+'todayNew'"
-                    :class="['search-items',index%5==4?'margin0':'']"
-                >
-                <BookCard
-                    :item="item"
-                    :headerBg="headerBg"
-                    :headerBorder="headerBorder"
-                    :userBg="userBg"
-                    :LoginNavIndex="LoginNavIndex"
-                    :previousPage="'搜索'"
-                />
-                </div>
+          </div>
+        </div>
+        <template v-if="searchList && searchList.length > 0">
+          <div
+            class="search-item"
+            v-for="(itemS, indexS) in searchList"
+            :key="indexS"
+            @click="handleLink(itemS)"
+          >
+            <el-image :src="itemS.src" :fit="'cover'"> </el-image>
+            <div class="search-inner">
+              <div class="top">
+                <h2 v-html="itemS.title"></h2>
+                <span v-html="itemS.author"></span>
+              </div>
+              <div class="content" v-html="itemS.content"></div>
+              <div class="bottom">
+                <span v-if="itemS.iss_no">{{ itemS.iss_no }}</span>
+                <span v-if="itemS.study_phase_name">{{
+                  itemS.study_phase_name
+                }}</span>
+                <span v-if="itemS.wc">长度:{{ itemS.wc }}</span>
+                <span v-if="itemS.wdc">词数:{{ itemS.wdc }}</span>
+              </div>
             </div>
+          </div>
+          <el-pagination
+            background
+            :current-page="currentPage"
+            :page-size="page_capacity"
+            :page-sizes="[10, 20, 30, 40, 50]"
+            :total="courseTotal"
+            layout="sizes, prev, pager, next, jumper"
+            @current-change="handleCurrentChange"
+            @size-change="handleSizeChange"
+          />
+        </template>
+        <div class="nodata" v-else>
+          <img src="../../assets/nodata.png" />
+          <p>找不到文件</p>
         </div>
+      </div>
     </div>
   </div>
 </template>
@@ -114,8 +144,8 @@
 //这里可以导入其它文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
 //例如:import 《组件名称》from ‘《组件路径》';
 import Header from "../../components/Header.vue";
-import SearchInput from "./components/SearchInput.vue"
-import BookCard from "@/components/common/BookCard.vue"
+import SearchInput from "./components/SearchInput.vue";
+import BookCard from "@/components/common/BookCard.vue";
 import { getLogin } from "@/api/ajax";
 export default {
   //import引入的组件需要注入到对象中才能使用
@@ -124,226 +154,78 @@ export default {
   data() {
     //这里存放数据
     return {
-      searchQuery: this.$route.query.content?this.$route.query.content:'',
-      config: this.$route.query.headerConfig?decodeURIComponent(this.$route.query.headerConfig):'',
+      searchQuery: this.$route.query.content ? this.$route.query.content : "",
+      config: this.$route.query.headerConfig
+        ? decodeURIComponent(this.$route.query.headerConfig)
+        : "",
       LoginNavIndex: 0,
-      userBg: 'rgba(0, 0, 0, 0.24)',
-      headerBorder: '#5C5C5C',
-      headerBg: '#1F1F1F',
-      typeList: [
-        {
-            name:'全部',
-            value:'',
-            img:'quanbu'
-        },
-        {
-            name:'画刊',
-            value:'24',
-            img:'huakan'
-        },
-        {
-            name:'报纸',
-            value:'156',
-            img:'baozhi'
-        },
-        {
-            name:'合刊',
-            value:'47',
-            img:'hekan'
-        },
-        {
-            name:'练习册',
-            value:'2',
-            img:'xiti'
-        },
-        {
-            name:'课程',
-            value:'5',
-            img:'kecheng'
-        }
-      ],
+      userBg: "rgba(0, 0, 0, 0.24)",
+      headerBorder: "#5C5C5C",
+      headerBg: "#1F1F1F",
+      selectIndex: this.$route.query.selectIndex
+        ? this.$route.query.selectIndex * 1
+        : 0,
       typeIndex: 0,
-      gradeList:[
-        {
-            name:'全部',
-            value: ''
-        },
-        {
-            name:'少儿画刊',
-            value: '1'
-        },
-        {
-            name:'小学版',
-            value: '2'
-        },
-        {
-            name:'初一版',
-            value: '3'
-        },
-        {
-            name:'初二版',
-            value: '4'
-        },
-        {
-            name:'初三版',
-            value: '5'
-        },
-        {
-            name:'高一版',
-            value: '6'
-        },
+      gradeList: [],
+      yearList: [
         {
-            name:'高二版',
-            value: '7'
+          label: "全部",
+          value: null,
         },
       ],
-      yearList:[
-        {
-            label:'全部',
-            value: -1
-        }
-      ],
-      gradeIndex: 0,
-      yearIndex: 0,
+      gradeIndex: null,
+      yearIndex: null,
       sortType: 0,
-      sortField: "level_id",
+      sortField: "",
       changeList: [
         {
           name: "长度",
           sort: "",
-          sortName: "cd",
+          sortName: "wc",
         },
         {
           name: "词数",
           sort: "",
-          sortName: "cs",
-        },
-        {
-          name: "语篇难度",
-          sort: "",
-          sortName: "ypnd",
-        },
-        {
-          name: "近似度",
-          sort: "",
-          sortName: "jsd",
-        }
-      ],
-      searchList: [
-        {
-            src: require('../../assets/bookcard-image.png'),
-            title: 'Recognizing key scientists',
-            author: 'Teens',
-            content: "Every year, <span class='lightbg'>China's</span> top science award draws public attention to great scientists and their outstanding contributions to scientific and technological innovation. It's the State Preeminent Science and Technology Award.",
-            periodicalNumber: '第381期', // 期刊数
-            gradetype: '小学版',
-            wordLength: '245',
-            wordNumber: '43',
-            difficulty: '2.13',
-            approximation: '98%'
+          sortName: "wdc",
         },
-        {
-            src: require('../../assets/bookcard-image.png'),
-            title: '2023 年画刊合刊',
-            author: 'Teead',
-            content: "There were perfectly cogent reasons why Julian Cavendish should be told of the Maior's impending return.",
-            periodicalNumber: '第349期', // 期刊数
-            gradetype: '高一版',
-            wordLength: '256',
-            wordNumber: '27',
-            difficulty: '3.52',
-            approximation: '70%'
-        }
       ],
+      searchList: [],
       currentPage: 1, // 当前页码
       page_capacity: 10, // 每页条数
-      courseTotal: 20, // 数据总条数
-      searchList2: [
-        {
-            src: require('../../assets/bookcard-image.png'),
-            name: "名称名称名称名称名称名称名称名称名称名称名称名称",
-            price: "3.00",
-            oldprice: "3.00",
-            author: "作者",
-            score: 3,
-            progress: "90%",
-            time:'2023/4/16 19:00'
-        },
-        {
-            src: require('../../assets/bookcard-image.png'),
-            name: "名称名称名称名称名称名称名称名称名称名称名称名称",
-            price: "3.00",
-            oldprice: "3.00",
-            author: "作者",
-            score: 3,
-            progress: "90%",
-            time:'2023/4/16 19:00'
-        },
-        {
-            src: require('../../assets/bookcard-image.png'),
-            name: "名称名称名称名称名称名称名称名称名称名称名称名称",
-            price: "3.00",
-            oldprice: "3.00",
-            author: "作者",
-            score: 3,
-            progress: "90%",
-            time:'2023/4/16 19:00'
-        },
-        {
-            src: require('../../assets/bookcard-image.png'),
-            name: "名称名称名称名称名称名称名称名称名称名称名称名称",
-            price: "3.00",
-            oldprice: "3.00",
-            author: "作者",
-            score: 3,
-            progress: "90%",
-            time:'2023/4/16 19:00'
-        },
-        {
-            src: require('../../assets/bookcard-image.png'),
-            name: "名称名称名称名称名称名称名称名称名称名称名称名称",
-            price: "3.00",
-            oldprice: "3.00",
-            author: "作者",
-            score: 3,
-            progress: "90%",
-            time:'2023/4/16 19:00'
-        },
-        {
-            src: require('../../assets/bookcard-image.png'),
-            name: "名称名称名称名称名称名称名称名称名称名称名称名称",
-            price: "3.00",
-            oldprice: "3.00",
-            author: "作者",
-            score: 3,
-            progress: "90%",
-            time:'2023/4/16 19:00'
-        },
-      ],
-    }
+      courseTotal: 0, // 数据总条数
+      timer: null,
+      takeTime: 0, //耗时
+      loading: false,
+    };
   },
   //计算属性 类似于data概念
   computed: {},
   //监控data中数据变化
-  watch: {},
+  watch: {
+    searchQuery: {
+      handler(val, oldVal) {
+        if (val !== oldVal) {
+          this.currentPage = 1;
+          this.searchArticle();
+        }
+      },
+      // 深度观察监听
+      deep: true,
+    },
+  },
   //方法集合
   methods: {
-    handleTypeIndex(type,index){
-        this[type] = index
+    handleTypeIndex(type, index) {
+      this[type] = index;
+      this.currentPage = 1;
+      this.searchArticle();
     },
     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;
+          item.sort = type;
+          sort = type;
         } else {
           item.sort = "";
         }
@@ -354,389 +236,456 @@ export default {
         this.sortType = 0;
       }
       this.sortField = sortName;
+      this.currentPage = 1;
+      this.searchArticle();
     },
     // 跳转文章
-    handleLink(item){
-        let url = this.config + '&&&搜索'
-        this.$router.push({
-            path: "/bookItem",
-            query: {
-                headerConfig: encodeURIComponent(url)
-            },
-        });
+    handleLink(item) {
+      let url = this.config + "&&&搜索";
+      this.$router.push({
+        path: "/articleDetail",
+        query: {
+          headerConfig: encodeURIComponent(url),
+          iss_id: item.iss_id,
+          id: item.art_id,
+        },
+      });
     },
     // 切换每页条数
     handleSizeChange(val) {
       this.currentPage = 1;
       this.page_capacity = val;
+      this.searchArticle();
     },
     // 切换页码
     handleCurrentChange(val) {
       this.currentPage = val;
+      this.searchArticle();
+    },
+    // 学段列表
+    getStudyList() {
+      let MethodName = "/OrgServer/DictManager/GetStudyPhaseList";
+      getLogin(MethodName, {})
+        .then((res) => {
+          if (res.status === 1) {
+            let gradeList = [
+              {
+                study_phase: null,
+                study_phase_name: "全部",
+              },
+            ];
+            this.gradeList = gradeList.concat(res.study_phase_list);
+          }
+        })
+        .catch(() => {});
     },
     // 获取年份列表
-    getYearList(){
-        this.yearList = [
-            {
-                value: -1,
-                label: '全部'
-            }
-        ]
-        let yearList = []
-        let MethodName = "/ShopServer/Client/ShopHomeQuery/GetIssueYearLabelList"
-        getLogin(MethodName, {})
+    getYearList() {
+      this.yearList = [
+        {
+          value: null,
+          label: "全部",
+        },
+      ];
+      let yearList = [];
+      let MethodName = "/ShopServer/Client/ShopHomeQuery/GetIssueYearLabelList";
+      getLogin(MethodName, {
+        goods_type: 2,
+      })
         .then((res) => {
-            if(res.status===1){
-                res.year_label_list.forEach(nowYear => {
-                    let obj = {
-                        value: nowYear,
-                        label: nowYear
-                    }
-                    yearList.push(obj)
-                })
-                this.yearList = this.yearList.concat(yearList)
-            }
+          if (res.status === 1) {
+            res.year_label_list.forEach((nowYear) => {
+              let obj = {
+                value: nowYear,
+                label: nowYear,
+              };
+              yearList.push(obj);
+            });
+            this.yearList = this.yearList.concat(yearList);
+          }
+        })
+        .catch(() => {});
+    },
+    // 查询搜索内容
+    searchArticle() {
+      this.loading = true;
+      this.takeTime = 0;
+      this.timer = setInterval(() => {
+        this.takeTime += 20;
+      }, 20);
+      let orderObj = null;
+      if (this.sortField) {
+        orderObj = {
+          name: this.sortField,
+          asc: !this.sortType,
+        };
+      }
+      let MethodName = "/PaperServer/Client/Search/SearchArticle";
+      let data = {
+        word: this.searchQuery,
+        page_size: this.page_capacity,
+        page_no: this.currentPage,
+        only_my_bought: this.selectIndex,
+        study_phase: this.gradeIndex,
+        release_year: this.yearIndex,
+        order_bys: orderObj ? [orderObj] : [],
+      };
+      getLogin(MethodName, data)
+        .then((res) => {
+          clearInterval(this.timer);
+          this.loading = false;
+          if (res.status === 1) {
+            this.courseTotal = res.data.total;
+            this.searchList = res.data.results;
+          }
         })
         .catch(() => {
-            this.loading = false
+          this.loading = false;
+          clearInterval(this.timer);
         });
-        
-    }
+    },
+    changeSelectIndex(val) {
+      this.selectIndex = val;
+    },
   },
   //生命周期 - 创建完成(可以访问当前this实例)
   created() {
-    if(this.config){
-        let arr = this.config.split('&&&')
-        this.LoginNavIndex = arr[0] * 1
-        this.userBg = arr[1]
-        this.headerBorder = arr[2]
-        this.headerBg = arr[3]
+    if (this.config) {
+      let arr = this.config.split("&&&");
+      this.LoginNavIndex = arr[0] * 1;
+      this.userBg = arr[1];
+      this.headerBorder = arr[2];
+      this.headerBg = arr[3];
     }
-    this.getYearList()
+    this.getStudyList();
+    this.getYearList();
+    this.searchArticle();
   },
   //生命周期 - 挂载完成(可以访问DOM元素)
-  mounted() {
-  },
+  mounted() {},
   //生命周期-创建之前
-  beforeCreated() { },
+  beforeCreated() {},
   //生命周期-挂载之前
-  beforeMount() { },
+  beforeMount() {},
   //生命周期-更新之前
-  beforUpdate() { },
+  beforUpdate() {},
   //生命周期-更新之后
-  updated() { },
+  updated() {},
   //生命周期-销毁之前
-  beforeDestory() { },
+  beforeDestory() {
+    clearInterval(this.timer);
+  },
   //生命周期-销毁完成
-  destoryed() { },
+  destoryed() {},
   //如果页面有keep-alive缓存功能,这个函数会触发
-  activated() { }
-}
+  activated() {},
+};
 </script>
 <style lang="scss" scoped>
 /* @import url(); 引入css类 */
-.search-detail{
+.search-detail {
+  width: 100%;
+  .banner {
     width: 100%;
-    .banner{
-        width: 100%;
-        height: 88px;
-        background: #299772;
-        position: relative;
-        .goback{
-            position: absolute;
-            left: 24px;
-            top: 24px;
-            width: 96px;
-            height: 40px;
-            display: block;
-            text-align: center;
-            cursor: pointer;
-            color: #FFFFFF;
-            line-height: 40px;
-            .el-icon-arrow-left{
-                width: 24px;
-                height: 24px;
-                text-align: center;
-                line-height: 24px;
-                margin: 0 4px;
-            }
+    height: 88px;
+    background: #299772;
+    position: relative;
+    .goback {
+      position: absolute;
+      left: 24px;
+      top: 24px;
+      width: 96px;
+      height: 40px;
+      display: block;
+      text-align: center;
+      cursor: pointer;
+      color: #ffffff;
+      line-height: 40px;
+      .el-icon-arrow-left {
+        width: 24px;
+        height: 24px;
+        text-align: center;
+        line-height: 24px;
+        margin: 0 4px;
+      }
+    }
+    .banner-inner {
+      width: 868px;
+      height: 100%;
+      display: flex;
+      align-items: center;
+      justify-content: center;
+      margin: 0 auto;
+      position: relative;
+      > img {
+        width: 40px;
+        margin-right: 24px;
+        position: absolute;
+        left: 50%;
+        top: 24px;
+        margin-left: -434px;
+      }
+      .search-compent {
+        position: absolute;
+        top: 16px;
+      }
+    }
+  }
+  .main {
+    width: 100%;
+    background: #ffffff;
+    max-height: calc(100vh - 160px);
+    overflow-y: scroll;
+    &::-webkit-scrollbar {
+      display: none;
+    }
+    .typelist {
+      margin: 32px 0;
+      padding: 0;
+      list-style: none;
+      display: flex;
+      justify-content: space-between;
+      li {
+        width: 200px;
+        height: 48px;
+        border-radius: 30px;
+        padding: 12px 24px;
+        display: flex;
+        align-items: center;
+        cursor: pointer;
+        border: 1px solid #e5e6eb;
+        &.active {
+          border-color: #3459d2;
+          background: #eef3ff;
+          .icon-img,
+          span {
+            color: #175dff;
+          }
+          b {
+            color: #ed5f00;
+          }
         }
-        .banner-inner{
-            width: 868px;
-            height: 100%;
-            display: flex;
-            align-items: center;
-            justify-content: center;
-            margin: 0 auto;
-            position: relative;
-            > img{
-                width: 40px;
-                margin-right: 24px;
-                position: absolute;
-                left: 50%;
-                top: 24px;
-                margin-left: -434px;
-            }
-            .search-compent{
-                position: absolute;
-                top: 16px;
-            }
+        svg {
+          width: 24px;
+          height: 24px;
+          margin-right: 16px;
+        }
+        span {
+          color: #2f3742;
+          font-weight: 700;
+          font-size: 16px;
+          line-height: 24px;
+          flex: 1;
         }
+        b {
+          color: #929ca8;
+          font-weight: 700;
+          font-size: 16px;
+          line-height: 24px;
+        }
+      }
     }
-    .main{
-        width: 100%;
-        background: #FFFFFF;
-        max-height: calc(100vh - 160px);
-        overflow-y: scroll;
-        &::-webkit-scrollbar {
-            display: none;
+    .main-inner {
+      width: 1200px;
+      margin: 0 auto;
+      // border-radius: 8px;
+      padding: 34px 40px;
+      ul {
+        list-style: none;
+        display: flex;
+        flex-flow: wrap;
+        padding: 0;
+        margin: 0;
+        li {
+          padding: 8px 15px;
+          cursor: pointer;
+          margin: 6px 16px 6px 0;
+          font-weight: 400;
+          font-size: 16px;
+          line-height: 22px;
+          color: #2f3742;
+          &.active {
+            background: #e7eeff;
+            border-radius: 4px;
+            color: #175dff;
+          }
         }
-        .typelist{
-            margin: 32px 0;
-            padding: 0;
-            list-style: none;
-            display: flex;
-            justify-content: space-between;
-            li{
-                width: 200px;
-                height: 48px;
-                border-radius: 30px;
-                padding: 12px 24px;
-                display: flex;
-                align-items: center;
-                cursor: pointer;
-                border: 1px solid #E5E6EB;
-                &.active{
-                    border-color: #3459D2;
-                    background: #EEF3FF;
-                    .icon-img,span{
-                        color: #175DFF;
-                    }
-                    b{
-                        color: #ED5F00;
-                    }
-                }
-                svg{
-                    width: 24px;
-                    height: 24px;
-                    margin-right: 16px;
-                }
-                span{
-                    color: #2F3742;
-                    font-weight: 700;
-                    font-size: 16px;
-                    line-height: 24px;
-                    flex: 1;
+      }
+      .searchChangebox {
+        margin-top: 13px;
+        display: flex;
+        > div {
+          display: flex;
+          align-items: center;
+          justify-content: space-between;
+          padding: 8px 15px;
+          height: 38px;
+          margin-right: 16px;
+          border-radius: 4px;
+          &.active {
+            background: #e7eeff;
+            > span {
+              color: #175dff;
+            }
+            .sort {
+              > div {
+                svg {
+                  &.active {
+                    color: #175dff;
+                  }
                 }
-                b{
-                    color: #929CA8;
-                    font-weight: 700;
-                    font-size: 16px;
-                    line-height: 24px;
+              }
+            }
+          }
+          > span {
+            font-weight: 400;
+            font-size: 16px;
+            line-height: 22px;
+            color: #2f3742;
+            margin-right: 8px;
+          }
+          .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;
                 }
+              }
             }
+          }
         }
-        .main-inner{
-            width: 1200px;
-            margin: 0 auto;
-            // border-radius: 8px;
-            padding: 34px 40px;
-            ul{
-                list-style: none;
-                display: flex;
-                flex-flow: wrap;
-                padding: 0;
-                margin: 0;
-                li{
-                    padding: 8px 15px;
-                    cursor: pointer;
-                    margin: 6px 16px 6px 0;
-                    font-weight: 400;
-                    font-size: 16px;
-                    line-height: 22px;
-                    color: #2F3742;
-                    &.active{
-                        background: #E7EEFF;
-                        border-radius: 4px;
-                        color: #175DFF;
-                    }
-                }
+      }
+      .timeconsume {
+        margin: 21px 0 0;
+        font-weight: 400;
+        font-size: 14px;
+        line-height: 22px;
+        color: rgba(0, 0, 0, 0.4);
+      }
+      .search-item {
+        margin: 24px 0 50px 0;
+        width: 100%;
+        display: flex;
+        cursor: pointer;
+        .el-image {
+          width: 110px;
+          height: 110px;
+          margin-right: 24px;
+        }
+        .search-inner {
+          flex: 1;
+          .top {
+            display: flex;
+            h2 {
+              font-weight: 700;
+              font-size: 16px;
+              line-height: 24px;
+              color: #2f3742;
+              margin: 0 16px 0 0;
+              font-family: "Rubik";
             }
-            .searchChangebox{
-                margin-top: 13px;
-                display: flex;
-                > div {
-                    display: flex;
-                    align-items: center;
-                    justify-content: space-between;
-                    padding: 8px 15px;
-                    height: 38px;
-                    margin-right: 16px;
-                    border-radius: 4px;
-                    &.active{
-                        background: #E7EEFF;
-                        > span{
-                            color: #175DFF;
-                        }
-                        .sort {
-                            > div {
-                                svg{
-                                    &.active{
-                                        color: #175DFF;
-                                    }
-                                }
-                            }
-                        }
-                    }
-                    > span{
-                        font-weight: 400;
-                        font-size: 16px;
-                        line-height: 22px;
-                        color: #2F3742;
-                        margin-right: 8px;
-                    }
-                    .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;
-                                }
-                            }
-                        }
-                    }
-                }
+            span {
+              font-weight: 400;
+              font-size: 16px;
+              line-height: 24px;
+              color: #929ca8;
             }
-            .timeconsume{
-                margin: 21px 0 0;
-                font-weight: 400;
-                font-size: 14px;
-                line-height: 22px;
-                color: rgba(0, 0, 0, 0.4);
+          }
+          .content {
+            margin: 8px 0;
+            word-break: break-word;
+            text-overflow: ellipsis;
+            display: -webkit-box;
+            -webkit-box-orient: vertical;
+            -webkit-line-clamp: 2; /* 超出几行省略 */
+            overflow: hidden;
+            color: #2f3742;
+            font-weight: 400;
+            font-size: 16px;
+            line-height: 24px;
+            height: 48px;
+          }
+          .bottom {
+            span {
+              font-weight: 400;
+              font-size: 16px;
+              line-height: 24px;
+              color: #929ca8;
+              margin-right: 16px;
             }
-            .search-item{
-                margin: 24px 0 50px 0;
-                width: 100%;
-                display: flex;
-                cursor: pointer;
-                .el-image{
-                    width: 110px;
-                    height: 110px;
-                    margin-right: 24px;
-                }
-                .search-inner{
-                    flex: 1;
-                    .top{
-                        display: flex;
-                        h2{
-                            font-weight: 700;
-                            font-size: 16px;
-                            line-height: 24px;
-                            color: #2F3742;
-                            margin: 0 16px 0 0;
-                            font-family: 'Rubik';
-                        }
-                        span{
-                            font-weight: 400;
-                            font-size: 16px;
-                            line-height: 24px;
-                            color: #929CA8;
-                        }
-                    }
-                    .content{
-                        margin: 8px 0;
-                        word-break: break-word;
-                        text-overflow: ellipsis;
-                        display: -webkit-box;
-                        -webkit-box-orient: vertical;
-                        -webkit-line-clamp: 2; /* 超出几行省略 */
-                        overflow: hidden;
-                        color: #2F3742;
-                        font-weight: 400;
-                        font-size: 16px;
-                        line-height: 24px;
-                        height: 48px;
-                    }
-                    .bottom{
-                        span{
-                            font-weight: 400;
-                            font-size: 16px;
-                            line-height: 24px;
-                            color: #929CA8;
-                            margin-right: 16px;
-                        }
-                    }
-                }
+          }
+        }
+      }
+      .search-list {
+        display: flex;
+        flex-flow: wrap;
+        width: 100%;
+        .search-items {
+          width: 200px;
+          margin: 24px 30px 24px 0;
+          flex-shrink: 0;
+          &.margin0 {
+            margin-right: 0;
+          }
+          .el-image {
+            width: 200px;
+            height: 280px;
+            flex-shrink: 0;
+            margin: 0;
+          }
+          .periodicalNumber {
+            font-weight: 400;
+            font-size: 14px;
+            line-height: 22px;
+            color: #2f3742;
+            margin: 12px 12px 4px 12px;
+            white-space: nowrap;
+            overflow: hidden;
+            text-overflow: ellipsis;
+          }
+          .date {
+            font-size: 12px;
+            line-height: 20px;
+            color: #929ca8;
+            margin: 0 12px 12px 12px;
+          }
+          .price {
+            margin: 0 12px;
+            align-items: flex-end;
+            display: flex;
+            :nth-child(1) {
+              font-weight: 700;
+              font-size: 14px;
+              line-height: 22px;
+              color: #ec5e41;
             }
-            .search-list{
-                display: flex;
-                flex-flow: wrap;
-                width: 100%;
-                .search-items{
-                    width: 200px;
-                    margin: 24px 30px 24px 0;
-                    flex-shrink: 0;
-                    &.margin0{
-                        margin-right: 0;
-                    }
-                    .el-image{
-                        width: 200px;
-                        height: 280px;
-                        flex-shrink: 0;
-                        margin: 0;
-                    }
-                    .periodicalNumber{
-                        font-weight: 400;
-                        font-size: 14px;
-                        line-height: 22px;
-                        color: #2F3742;
-                        margin: 12px 12px 4px 12px;
-                        white-space: nowrap;
-                        overflow: hidden;
-                        text-overflow: ellipsis;
-                    }
-                    .date{
-                        font-size: 12px;
-                        line-height: 20px;
-                        color: #929CA8;
-                        margin: 0 12px 12px 12px;
-                    }
-                    .price {
-                        margin: 0 12px;
-                        align-items: flex-end;
-                        display: flex;
-                        :nth-child(1) {
-                            font-weight: 700;
-                            font-size: 14px;
-                            line-height: 22px;
-                            color: #EC5E41;
-                        }
-                        :nth-child(2) {
-                            font-weight: 400;
-                            font-size: 12px;
-                            line-height: 20px;
-                            text-decoration-line: line-through;
-                            color: #929CA8;
-                            margin-left: 8px;
-                        }
-                    }
-                }
+            :nth-child(2) {
+              font-weight: 400;
+              font-size: 12px;
+              line-height: 20px;
+              text-decoration-line: line-through;
+              color: #929ca8;
+              margin-left: 8px;
             }
+          }
         }
+      }
     }
+  }
 }
 </style>
 <style lang="scss">
-.search-detail{
-    .lightbg{
-        background: #FFF500;
-    }
+.search-detail {
+  .lightbg {
+    background: #fff500;
+  }
 }
-</style>
+</style>