all.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515
  1. <template>
  2. <div class="bookCity">
  3. <Header
  4. :headerBg="'#1F1F1F'"
  5. :headerBorder="'#5C5C5C'"
  6. :userBg="'rgba(0, 0, 0, 0.24)'"
  7. :LoginNavIndex="0"
  8. />
  9. <div class="banner">
  10. <el-carousel height="320px" trigger="click" arrow="never">
  11. <el-carousel-item v-for="item in 2" :key="item">
  12. <!-- 如果有跳转链接 则跳转 否则只展示 -->
  13. <!-- <a v-if="item" href="#" target="_blank">
  14. <el-image
  15. class="image"
  16. :src="require('../../assets/banner'+item+'.png')"
  17. :fit="'cover'">
  18. </el-image>
  19. </a> -->
  20. <el-image
  21. class="image"
  22. :src="require('../../assets/banner'+(2+item)+'.png')"
  23. :fit="'cover'">
  24. </el-image>
  25. </el-carousel-item>
  26. </el-carousel>
  27. </div>
  28. <div class="filt-box">
  29. <div class="filt-inner">
  30. <el-breadcrumb separator="/">
  31. <el-breadcrumb-item :to="{ path: '/' }">商城</el-breadcrumb-item>
  32. <el-breadcrumb-item>全部{{nameTypeCn}}</el-breadcrumb-item>
  33. </el-breadcrumb>
  34. <h2>筛选:</h2>
  35. <div class="filt-item">
  36. <label>年份</label>
  37. <ul>
  38. <li :class="[itemy.value===form.yearValue?'active':'']" v-for="(itemy,indexy) in yearList" :key="indexy" @click="handleClick('yearValue',itemy.value)">
  39. <i v-if="itemy.value===form.yearValue" class="el-icon-success"></i>
  40. {{itemy.label}}
  41. </li>
  42. </ul>
  43. </div>
  44. <div class="filt-item">
  45. <label>学段</label>
  46. <ul>
  47. <li :class="[items.value===form.studyValue?'active':'']" v-for="(items,indexs) in studyList" :key="indexs" @click="handleClick('studyValue',items.value)">
  48. <i v-if="items.value===form.studyValue" class="el-icon-success"></i>
  49. {{items.label}}
  50. </li>
  51. </ul>
  52. </div>
  53. <div class="filt-item">
  54. <label>类型</label>
  55. <ul>
  56. <li :class="[itemt.value===form.typeValue?'active':'']" v-for="(itemt,indext) in typeList" :key="indext" @click="handleClick('typeValue',itemt.value)">
  57. <i v-if="itemt.value===form.typeValue" class="el-icon-success"></i>
  58. {{itemt.label}}
  59. </li>
  60. </ul>
  61. </div>
  62. <div class="filt-item">
  63. <label>搜索</label>
  64. <el-input placeholder="搜索" v-model="form.searchValue">
  65. <el-button slot="append" icon="el-icon-search" @click="handleData"></el-button>
  66. </el-input>
  67. </div>
  68. </div>
  69. </div>
  70. <div class="main">
  71. <BookListModule
  72. :Bookinfo="Bookinfo"
  73. :showAll="false"
  74. :showPage="form.studyValue==Bookinfo.study"
  75. v-if="!form.studyValue||form.studyValue==Bookinfo.study"
  76. @changeStudy="changeStudy"
  77. :headerBg="'#1F1F1F'"
  78. :headerBorder="'#5C5C5C'"
  79. :userBg="'rgba(0, 0, 0, 0.24)'"
  80. :LoginNavIndex="0"
  81. />
  82. <BookListModule
  83. :Bookinfo="Bookinfo2"
  84. :showAll="false"
  85. v-if="false"
  86. :headerBg="'#1F1F1F'"
  87. :headerBorder="'#5C5C5C'"
  88. :userBg="'rgba(0, 0, 0, 0.24)'"
  89. :LoginNavIndex="0"
  90. />
  91. </div>
  92. </div>
  93. </template>
  94. <script>
  95. //这里可以导入其它文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
  96. //例如:import 《组件名称》from ‘《组件路径》';
  97. import Header from "../../components/Header.vue";
  98. import BookListModule from "@/components/common/BookAllListModule.vue"
  99. export default {
  100. //import引入的组件需要注入到对象中才能使用
  101. components: { Header, BookListModule },
  102. props: {},
  103. data() {
  104. //这里存放数据
  105. return {
  106. Bookinfo:{
  107. BookList: [{
  108. src: require('../../assets/baozhi2.png'),
  109. name: "第96期",
  110. price: "23.00",
  111. oldprice: "33.00",
  112. author: "TEENS",
  113. score: 3,
  114. progress: "90%"
  115. },
  116. {
  117. src: require('../../assets/baozhi1.png'),
  118. name: "第87期",
  119. price: "27.00",
  120. oldprice: "43.00",
  121. author: "2022-04-15",
  122. score: 3,
  123. },
  124. {
  125. src: require('../../assets/baozhi1.png'),
  126. name: "第86期 ",
  127. price: "19.00",
  128. oldprice: "27.00",
  129. author: "TEENS",
  130. score: 3,
  131. },
  132. {
  133. src: require('../../assets/baozhi1.png'),
  134. name: "第85期",
  135. price: "28.90",
  136. oldprice: "39.00",
  137. author: "TEENS",
  138. score: 3,
  139. },
  140. {
  141. src: require('../../assets/baozhi2.png'),
  142. name: "第84期",
  143. price: "23.00",
  144. oldprice: "30.00",
  145. author: "TEENS",
  146. score: 3,
  147. },
  148. {
  149. src: require('../../assets/baozhi2.png'),
  150. name: "第96期",
  151. price: "23.00",
  152. oldprice: "33.00",
  153. author: "TEENS",
  154. score: 3,
  155. progress: "90%"
  156. },
  157. {
  158. src: require('../../assets/baozhi1.png'),
  159. name: "第87期",
  160. price: "27.00",
  161. oldprice: "43.00",
  162. author: "2022-04-15",
  163. score: 3,
  164. },
  165. {
  166. src: require('../../assets/baozhi2.png'),
  167. name: "第86期 ",
  168. price: "19.00",
  169. oldprice: "27.00",
  170. author: "TEENS",
  171. score: 3,
  172. },
  173. {
  174. src: require('../../assets/baozhi2.png'),
  175. name: "第85期",
  176. price: "28.90",
  177. oldprice: "39.00",
  178. author: "TEENS",
  179. score: 3,
  180. },
  181. {
  182. src: require('../../assets/baozhi1.png'),
  183. name: "第84期",
  184. price: "23.00",
  185. oldprice: "30.00",
  186. author: "TEENS",
  187. score: 3,
  188. }
  189. ],
  190. name: '报纸',
  191. number: 96,
  192. numberstr: '共96期',
  193. study: 'value1'
  194. },
  195. Bookinfo2:{
  196. BookList: [{
  197. src: require('../../assets/bookcard-image.png'),
  198. name: "名称名称名称名称名称名称名称名称名称名称名称名称",
  199. price: "3.00",
  200. oldprice: "3.00",
  201. author: "作者",
  202. score: 3,
  203. progress: "90%",
  204. time:'2023/4/16 19:00'
  205. },
  206. {
  207. src: require('../../assets/bookcard-image.png'),
  208. name: "名称名称名称名称名称名称名称名称名称名称名称名称",
  209. price: "3.00",
  210. oldprice: "3.00",
  211. author: "作者",
  212. score: 3,
  213. time:'2023/4/16 19:00'
  214. },
  215. {
  216. src: require('../../assets/bookcard-image.png'),
  217. name: "名称名称名称名称名称名称名称名称名称名称名称名称",
  218. price: "3.00",
  219. oldprice: "3.00",
  220. author: "作者",
  221. score: 3,
  222. time:'2023/4/16 19:00'
  223. },
  224. {
  225. src: require('../../assets/bookcard-image.png'),
  226. name: "名称名称名称名称名称名称名称名称名称名称名称名称",
  227. price: "3.00",
  228. oldprice: "3.00",
  229. author: "作者",
  230. score: 3,
  231. time:'2023/4/16 19:00'
  232. },
  233. {
  234. src: require('../../assets/bookcard-image.png'),
  235. name: "名称名称名称名称名称名称名称名称名称名称名称名称",
  236. price: "3.00",
  237. oldprice: "3.00",
  238. author: "作者",
  239. score: 3,
  240. time:'2023/4/16 19:00'
  241. }
  242. ],
  243. name: '初一',
  244. number: 805,
  245. numberstr: '共805个',
  246. study: 'value2'
  247. },
  248. nameTypeCn: this.$route.query.name?decodeURIComponent(this.$route.query.name):'画刊',
  249. nameTypeList: ['画刊','报纸','练习册','课程'],
  250. yearList:[
  251. {
  252. value: '',
  253. label: '全部'
  254. },{
  255. value: '2023',
  256. label: '2023'
  257. },{
  258. value: '2022',
  259. label: '2022'
  260. },{
  261. value: '2021',
  262. label: '2021'
  263. },{
  264. value: '2020',
  265. label: '2020'
  266. },{
  267. value: '2019',
  268. label: '2019'
  269. },{
  270. value: '2018',
  271. label: '2018'
  272. },{
  273. value: '2017',
  274. label: '2017'
  275. },{
  276. value: '2016',
  277. label: '2016'
  278. },{
  279. value: '2015',
  280. label: '2015'
  281. },{
  282. value: '2014',
  283. label: '2014'
  284. },{
  285. value: '2013',
  286. label: '2013'
  287. },{
  288. value: '2012',
  289. label: '2012'
  290. },{
  291. value: '2011',
  292. label: '2011'
  293. },{
  294. value: '2010',
  295. label: '2010'
  296. },{
  297. value: '2009',
  298. label: '2009'
  299. },{
  300. value: '2008',
  301. label: '2008'
  302. },
  303. ],
  304. studyList:[
  305. {
  306. value: '',
  307. label: '全部'
  308. },{
  309. value: 'value1',
  310. label: '小学'
  311. },{
  312. value: 'value2',
  313. label: '初一'
  314. },{
  315. value: 'value3',
  316. label: '初二'
  317. },{
  318. value: 'value4',
  319. label: '初三'
  320. },{
  321. value: 'value5',
  322. label: '高一'
  323. },{
  324. value: 'value6',
  325. label: '高二'
  326. },
  327. ],
  328. typeList:[
  329. {
  330. value: 'value1',
  331. label: '单本'
  332. },
  333. {
  334. value: 'value2',
  335. label: '合刊'
  336. },
  337. ],
  338. form:{
  339. yearValue: '',
  340. studyValue: '',
  341. typeValue: 'value1',
  342. searchValue: ''
  343. }
  344. }
  345. },
  346. //计算属性 类似于data概念
  347. computed: {},
  348. //监控data中数据变化
  349. watch: {},
  350. //方法集合
  351. methods: {
  352. handleClick(file,value){
  353. this.form[file] = value
  354. this.handleData()
  355. },
  356. handleData(){
  357. },
  358. changeStudy(value){
  359. this.form.studyValue = value
  360. }
  361. },
  362. //生命周期 - 创建完成(可以访问当前this实例)
  363. created() {
  364. },
  365. //生命周期 - 挂载完成(可以访问DOM元素)
  366. mounted() {
  367. },
  368. //生命周期-创建之前
  369. beforeCreated() { },
  370. //生命周期-挂载之前
  371. beforeMount() { },
  372. //生命周期-更新之前
  373. beforUpdate() { },
  374. //生命周期-更新之后
  375. updated() { },
  376. //生命周期-销毁之前
  377. beforeDestory() { },
  378. //生命周期-销毁完成
  379. destoryed() { },
  380. //如果页面有keep-alive缓存功能,这个函数会触发
  381. activated() { }
  382. }
  383. </script>
  384. <style lang="scss" scoped>
  385. /* @import url(); 引入css类 */
  386. .bookCity {
  387. min-height: 100%;
  388. padding-bottom: 50px;
  389. .banner{
  390. width: 100%;
  391. font-size: 0;
  392. img{
  393. max-width: 100%;
  394. }
  395. .image{
  396. width: 100%;
  397. height: 100%;
  398. }
  399. }
  400. .filt-box{
  401. border-bottom: 1px solid #E5E6EB;
  402. background: #FFFFFF;
  403. .filt-inner{
  404. width: 1200px;
  405. margin: 0 auto;
  406. padding: 40px 0;
  407. h2{
  408. font-weight: 600;
  409. font-size: 16px;
  410. line-height: 24px;
  411. color: #2F3742;
  412. padding: 28px 0;
  413. margin: 0;
  414. }
  415. .filt-item{
  416. display: flex;
  417. margin-bottom: 8px;
  418. label{
  419. width: 52px;
  420. font-weight: 400;
  421. font-size: 16px;
  422. line-height: 32px;
  423. color: #2F3742;
  424. }
  425. ul{
  426. list-style: none;
  427. display: flex;
  428. flex-flow: wrap;
  429. padding: 0;
  430. margin: 0;
  431. li{
  432. margin: 0 8px 16px 0;
  433. background: #F2F3F5;
  434. border-radius: 2px;
  435. padding: 3px 11px;
  436. font-weight: 500;
  437. font-size: 16px;
  438. line-height: 24px;
  439. color: #2F3742;
  440. cursor: pointer;
  441. border: 1px solid #F2F3F5;
  442. height: 32px;
  443. box-sizing: border-box;
  444. display: flex;
  445. align-items: center;
  446. &:hover{
  447. color: #165DFF;
  448. }
  449. &.active{
  450. color: #165DFF;
  451. border-color: #165DFF;
  452. background: #FFFFFF;
  453. .el-icon-success{
  454. margin-right: 4px;
  455. font-size: 12px;
  456. margin-top: 2px;
  457. }
  458. }
  459. }
  460. }
  461. .el-input{
  462. width: 240px;
  463. height: 32px;
  464. background: #F2F3F5;
  465. border-radius: 2px;
  466. }
  467. }
  468. }
  469. }
  470. .main{
  471. width: 1200px;
  472. margin: 52px auto;
  473. }
  474. }
  475. </style>
  476. <style lang="scss">
  477. .bookCity{
  478. .el-breadcrumb__inner.is-link{
  479. color: #4E5969;
  480. &:hover{
  481. color: #165DFF;
  482. }
  483. }
  484. .el-breadcrumb__separator{
  485. color: #C9CDD4;
  486. }
  487. .el-breadcrumb__item:last-child .el-breadcrumb__inner{
  488. color: #1D2129;
  489. font-weight: 500;
  490. }
  491. .filt-box{
  492. input{
  493. height: 32px;
  494. line-height: 32px;
  495. background: #F2F3F5;
  496. border: none;
  497. }
  498. .el-input__icon{
  499. line-height: 32px;
  500. cursor: pointer;
  501. color: #4E5969 !important;
  502. }
  503. .el-input-group__append{
  504. background: #F2F3F5;
  505. border: none;
  506. }
  507. .el-button{
  508. padding: 9px 12px;
  509. }
  510. }
  511. }
  512. </style>