| | |
| | | <div class="classificationBox"> |
| | | <div style="width: 100px">分类:</div> |
| | | <div class="classificaListBox"> |
| | | <div class="classificaItem" v-for="(item, index) in classfeild" :key="index"> |
| | | <div |
| | | class="classificaItem" |
| | | :class="{ active: currentLevel == item.value }" |
| | | v-for="(item, index) in classfeild" |
| | | :key="index" |
| | | @click="changeLevel(item)" |
| | | > |
| | | {{ item.name }} |
| | | </div> |
| | | </div> |
| | |
| | | <div class="bookList"> |
| | | <div class="bookfilterList"> |
| | | <div class="listTitle"> |
| | | <div>结果:共计***条</div> |
| | | <div>结果:共计{{ total }}条</div> |
| | | <div style="width: 300px"> |
| | | <el-input |
| | | v-model="input3" |
| | |
| | | class="input-with-select" |
| | | > |
| | | <template #append> |
| | | <el-button :icon="Search" /> |
| | | <el-button :icon="Search" @click="getBookList" /> |
| | | </template> |
| | | </el-input> |
| | | </div> |
| | |
| | | <div class="recommendBox"> |
| | | <div class="recommendTitle">推荐教材</div> |
| | | <div class="newRecommendList"> |
| | | <div class="recommendItem" v-for="item in bookListData" :key="item.id"> |
| | | <div class="recommendItem" v-for="item in recommendBookListData" :key="item.id"> |
| | | <div class="recommendItemImg"> |
| | | <img class="autoImg" :src="item.icon" /> |
| | | </div> |
| | |
| | | import { Search } from '@element-plus/icons-vue' |
| | | const input3 = ref('') |
| | | let bookListData = ref([]) |
| | | const total = ref(50) |
| | | let recommendBookListData = ref([]) |
| | | const total = ref(0) |
| | | const currentPage1 = ref(1) |
| | | const router = useRouter() |
| | | let currentLevel = ref('all') |
| | | |
| | | const toDetail = (item) => { |
| | | router.push({ |
| | |
| | | }) |
| | | } |
| | | |
| | | const changeLevel = (item) => { |
| | | currentLevel.value = item.value |
| | | getBookList() |
| | | } |
| | | |
| | | const getBanner = () => { |
| | | MG.resource |
| | | .getItem({ |
| | | path: 'banner\\educationPublishing', |
| | | fields: { link: [] }, |
| | | paging: { start: 0, size: 9 }, |
| | | paging: { start: 0, size: 20 }, |
| | | }) |
| | | .then((res) => { |
| | | banner.push(...res.datas) |
| | |
| | | getBookList() |
| | | } |
| | | |
| | | const getBookList = () => { |
| | | const getRecommendBookList = () => { |
| | | MG.store |
| | | .getProductList({ |
| | | path: 'recommendedTextbooks', |
| | |
| | | }) |
| | | .then((res) => { |
| | | console.log(res, '推荐教材') |
| | | bookListData.value = res.datas |
| | | recommendBookListData.value = res.datas |
| | | }) |
| | | } |
| | | |
| | | const getBookList = () => { |
| | | const query = { |
| | | path: '*', |
| | | queryType: '*', |
| | | storeInfo: 'defaultGoodsStore1', |
| | | paging: { |
| | | start: (currentPage1.value - 1) * 20, |
| | | size: 20, |
| | | }, |
| | | fields: {}, |
| | | } |
| | | if (currentLevel.value !== 'all') { |
| | | query.fields['teachingLevel='] = currentLevel.value |
| | | } |
| | | if (input3.value) { |
| | | query.fields['Name*'] = input3.value |
| | | } |
| | | MG.store.getProductList(query).then((res) => { |
| | | console.log(res, '11111111111') |
| | | bookListData.value = res.datas |
| | | total.value = res.total |
| | | }) |
| | | } |
| | | |
| | | const classifList = () => { |
| | |
| | | getBanner() |
| | | classifList() |
| | | getBookList() |
| | | getRecommendBookList() |
| | | }) |
| | | </script> |
| | | |
| | |
| | | margin: 20px 0; |
| | | padding-bottom: 30px; |
| | | } |
| | | |
| | | .active { |
| | | background-color: #ebf8f8; |
| | | border: 1px solid #144941; |
| | | color: #144941; |
| | | } |
| | | </style> |