all.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479
  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 4" :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'+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/bookcard-image.png'),
  109. name: "名称名称名称名称名称名称名称名称名称名称名称名称",
  110. price: "3.00",
  111. oldprice: "3.00",
  112. author: "作者",
  113. score: 3,
  114. progress: "90%",
  115. time:'2023/4/16 19:00'
  116. },
  117. {
  118. src: require('../../assets/bookcard-image.png'),
  119. name: "名称名称名称名称名称名称名称名称名称名称名称名称",
  120. price: "3.00",
  121. oldprice: "3.00",
  122. author: "作者",
  123. score: 3,
  124. time:'2023/4/16 19:00'
  125. },
  126. {
  127. src: require('../../assets/bookcard-image.png'),
  128. name: "名称名称名称名称名称名称名称名称名称名称名称名称",
  129. price: "3.00",
  130. oldprice: "3.00",
  131. author: "作者",
  132. score: 3,
  133. time:'2023/4/16 19:00'
  134. },
  135. {
  136. src: require('../../assets/bookcard-image.png'),
  137. name: "名称名称名称名称名称名称名称名称名称名称名称名称",
  138. price: "3.00",
  139. oldprice: "3.00",
  140. author: "作者",
  141. score: 3,
  142. time:'2023/4/16 19:00'
  143. },
  144. {
  145. src: require('../../assets/bookcard-image.png'),
  146. name: "名称名称名称名称名称名称名称名称名称名称名称名称",
  147. price: "3.00",
  148. oldprice: "3.00",
  149. author: "作者",
  150. score: 3,
  151. time:'2023/4/16 19:00'
  152. }
  153. ],
  154. name: '画刊',
  155. number: 96,
  156. numberstr: '共96期',
  157. study: 'value1'
  158. },
  159. Bookinfo2:{
  160. BookList: [{
  161. src: require('../../assets/bookcard-image.png'),
  162. name: "名称名称名称名称名称名称名称名称名称名称名称名称",
  163. price: "3.00",
  164. oldprice: "3.00",
  165. author: "作者",
  166. score: 3,
  167. progress: "90%",
  168. time:'2023/4/16 19:00'
  169. },
  170. {
  171. src: require('../../assets/bookcard-image.png'),
  172. name: "名称名称名称名称名称名称名称名称名称名称名称名称",
  173. price: "3.00",
  174. oldprice: "3.00",
  175. author: "作者",
  176. score: 3,
  177. time:'2023/4/16 19:00'
  178. },
  179. {
  180. src: require('../../assets/bookcard-image.png'),
  181. name: "名称名称名称名称名称名称名称名称名称名称名称名称",
  182. price: "3.00",
  183. oldprice: "3.00",
  184. author: "作者",
  185. score: 3,
  186. time:'2023/4/16 19:00'
  187. },
  188. {
  189. src: require('../../assets/bookcard-image.png'),
  190. name: "名称名称名称名称名称名称名称名称名称名称名称名称",
  191. price: "3.00",
  192. oldprice: "3.00",
  193. author: "作者",
  194. score: 3,
  195. time:'2023/4/16 19:00'
  196. },
  197. {
  198. src: require('../../assets/bookcard-image.png'),
  199. name: "名称名称名称名称名称名称名称名称名称名称名称名称",
  200. price: "3.00",
  201. oldprice: "3.00",
  202. author: "作者",
  203. score: 3,
  204. time:'2023/4/16 19:00'
  205. }
  206. ],
  207. name: '初一',
  208. number: 805,
  209. numberstr: '共805个',
  210. study: 'value2'
  211. },
  212. nameTypeCn: this.$route.query.name?decodeURIComponent(this.$route.query.name):'画刊',
  213. nameTypeList: ['画刊','报纸','练习册','课程'],
  214. yearList:[
  215. {
  216. value: '',
  217. label: '全部'
  218. },{
  219. value: '2023',
  220. label: '2023'
  221. },{
  222. value: '2022',
  223. label: '2022'
  224. },{
  225. value: '2021',
  226. label: '2021'
  227. },{
  228. value: '2020',
  229. label: '2020'
  230. },{
  231. value: '2019',
  232. label: '2019'
  233. },{
  234. value: '2018',
  235. label: '2018'
  236. },{
  237. value: '2017',
  238. label: '2017'
  239. },{
  240. value: '2016',
  241. label: '2016'
  242. },{
  243. value: '2015',
  244. label: '2015'
  245. },{
  246. value: '2014',
  247. label: '2014'
  248. },{
  249. value: '2013',
  250. label: '2013'
  251. },{
  252. value: '2012',
  253. label: '2012'
  254. },{
  255. value: '2011',
  256. label: '2011'
  257. },{
  258. value: '2010',
  259. label: '2010'
  260. },{
  261. value: '2009',
  262. label: '2009'
  263. },{
  264. value: '2008',
  265. label: '2008'
  266. },
  267. ],
  268. studyList:[
  269. {
  270. value: '',
  271. label: '全部'
  272. },{
  273. value: 'value1',
  274. label: '小学'
  275. },{
  276. value: 'value2',
  277. label: '初一'
  278. },{
  279. value: 'value3',
  280. label: '初二'
  281. },{
  282. value: 'value4',
  283. label: '初三'
  284. },{
  285. value: 'value5',
  286. label: '高一'
  287. },{
  288. value: 'value6',
  289. label: '高二'
  290. },
  291. ],
  292. typeList:[
  293. {
  294. value: 'value1',
  295. label: '单本'
  296. },
  297. {
  298. value: 'value2',
  299. label: '合刊'
  300. },
  301. ],
  302. form:{
  303. yearValue: '',
  304. studyValue: '',
  305. typeValue: 'value1',
  306. searchValue: ''
  307. }
  308. }
  309. },
  310. //计算属性 类似于data概念
  311. computed: {},
  312. //监控data中数据变化
  313. watch: {},
  314. //方法集合
  315. methods: {
  316. handleClick(file,value){
  317. this.form[file] = value
  318. this.handleData()
  319. },
  320. handleData(){
  321. },
  322. changeStudy(value){
  323. this.form.studyValue = value
  324. }
  325. },
  326. //生命周期 - 创建完成(可以访问当前this实例)
  327. created() {
  328. },
  329. //生命周期 - 挂载完成(可以访问DOM元素)
  330. mounted() {
  331. },
  332. //生命周期-创建之前
  333. beforeCreated() { },
  334. //生命周期-挂载之前
  335. beforeMount() { },
  336. //生命周期-更新之前
  337. beforUpdate() { },
  338. //生命周期-更新之后
  339. updated() { },
  340. //生命周期-销毁之前
  341. beforeDestory() { },
  342. //生命周期-销毁完成
  343. destoryed() { },
  344. //如果页面有keep-alive缓存功能,这个函数会触发
  345. activated() { }
  346. }
  347. </script>
  348. <style lang="scss" scoped>
  349. /* @import url(); 引入css类 */
  350. .bookCity {
  351. min-height: 100%;
  352. padding-bottom: 50px;
  353. .banner{
  354. width: 100%;
  355. font-size: 0;
  356. img{
  357. max-width: 100%;
  358. }
  359. .image{
  360. width: 100%;
  361. height: 100%;
  362. }
  363. }
  364. .filt-box{
  365. border-bottom: 1px solid #E5E6EB;
  366. background: #FFFFFF;
  367. .filt-inner{
  368. width: 1200px;
  369. margin: 0 auto;
  370. padding: 40px 0;
  371. h2{
  372. font-weight: 600;
  373. font-size: 16px;
  374. line-height: 24px;
  375. color: #2F3742;
  376. padding: 28px 0;
  377. margin: 0;
  378. }
  379. .filt-item{
  380. display: flex;
  381. margin-bottom: 8px;
  382. label{
  383. width: 52px;
  384. font-weight: 400;
  385. font-size: 16px;
  386. line-height: 32px;
  387. color: #2F3742;
  388. }
  389. ul{
  390. list-style: none;
  391. display: flex;
  392. flex-flow: wrap;
  393. padding: 0;
  394. margin: 0;
  395. li{
  396. margin: 0 8px 16px 0;
  397. background: #F2F3F5;
  398. border-radius: 2px;
  399. padding: 3px 11px;
  400. font-weight: 500;
  401. font-size: 16px;
  402. line-height: 24px;
  403. color: #2F3742;
  404. cursor: pointer;
  405. border: 1px solid #F2F3F5;
  406. height: 32px;
  407. box-sizing: border-box;
  408. display: flex;
  409. align-items: center;
  410. &:hover{
  411. color: #165DFF;
  412. }
  413. &.active{
  414. color: #165DFF;
  415. border-color: #165DFF;
  416. background: #FFFFFF;
  417. .el-icon-success{
  418. margin-right: 4px;
  419. font-size: 12px;
  420. margin-top: 2px;
  421. }
  422. }
  423. }
  424. }
  425. .el-input{
  426. width: 240px;
  427. height: 32px;
  428. background: #F2F3F5;
  429. border-radius: 2px;
  430. }
  431. }
  432. }
  433. }
  434. .main{
  435. width: 1200px;
  436. margin: 52px auto;
  437. }
  438. }
  439. </style>
  440. <style lang="scss">
  441. .bookCity{
  442. .el-breadcrumb__inner.is-link{
  443. color: #4E5969;
  444. &:hover{
  445. color: #165DFF;
  446. }
  447. }
  448. .el-breadcrumb__separator{
  449. color: #C9CDD4;
  450. }
  451. .el-breadcrumb__item:last-child .el-breadcrumb__inner{
  452. color: #1D2129;
  453. font-weight: 500;
  454. }
  455. .filt-box{
  456. input{
  457. height: 32px;
  458. line-height: 32px;
  459. background: #F2F3F5;
  460. border: none;
  461. }
  462. .el-input__icon{
  463. line-height: 32px;
  464. cursor: pointer;
  465. color: #4E5969 !important;
  466. }
  467. .el-input-group__append{
  468. background: #F2F3F5;
  469. border: none;
  470. }
  471. .el-button{
  472. padding: 9px 12px;
  473. }
  474. }
  475. }
  476. </style>