BookAllListModule.vue 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224
  1. <template>
  2. <div class="BookListModule" v-if="Bookinfo">
  3. <div class="module">
  4. <div class="title" v-if="!this.$route.query.from">
  5. <div class="title-left">
  6. <span>
  7. {{Bookinfo.name}}
  8. </span>
  9. <b>{{Bookinfo.numberstr}}</b>
  10. </div>
  11. <!-- <div class="title-right" v-if="showAll">
  12. <a class="lookmore" @click="lookmore"><span>查看全部</span><i class="el-icon-arrow-right"></i></a>
  13. </div> -->
  14. </div>
  15. <div class="peruselist" v-if="Bookinfo.bookType==='jingdu'">
  16. <div
  17. v-for="(item,index) in Bookinfo.BookList"
  18. :key="index+'todayNew'"
  19. :style="{
  20. marginLeft:index==0||index%4==0?'0':'24px',
  21. }"
  22. >
  23. <BookPeruseCard
  24. :item="item"
  25. :headerBg="headerBg"
  26. :headerBorder="headerBorder"
  27. :userBg="userBg"
  28. :LoginNavIndex="LoginNavIndex"
  29. :previousPage="Bookinfo.name"
  30. />
  31. </div>
  32. </div>
  33. <div class="listlive" v-else-if="Bookinfo.bookType==='ZB'">
  34. <div
  35. v-for="(item,index) in Bookinfo.BookList"
  36. :key="index+'todayNew'"
  37. :style="{
  38. marginLeft:index==0||index%4==0?'0':'24px',
  39. }"
  40. >
  41. <BookLiveCard
  42. :item="item"
  43. :headerBg="headerBg"
  44. :headerBorder="headerBorder"
  45. :userBg="userBg"
  46. :LoginNavIndex="LoginNavIndex"
  47. :previousPage="Bookinfo.name"
  48. />
  49. </div>
  50. </div>
  51. <div class="list" v-else>
  52. <div
  53. v-for="(item,index) in Bookinfo.BookList"
  54. :key="index+'todayNew'"
  55. :style="{
  56. marginLeft:index==0||index%5==0?'0':'50px',
  57. }"
  58. >
  59. <BookCard
  60. :item="item"
  61. :headerBg="headerBg"
  62. :headerBorder="headerBorder"
  63. :userBg="userBg"
  64. :LoginNavIndex="LoginNavIndex"
  65. :previousPage="Bookinfo.name"
  66. />
  67. </div>
  68. </div>
  69. <div class="nodata" v-if="Bookinfo.BookList.length===0">
  70. <img src="../../assets/nodata.png" />
  71. <p>找不到文件</p>
  72. </div>
  73. </div>
  74. </div>
  75. </template>
  76. <script>
  77. //这里可以导入其它文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
  78. //例如:import 《组件名称》from ‘《组件路径》';
  79. import BookCard from "./BookCard.vue"
  80. import BookLiveCard from "./BookLiveCard.vue"
  81. import BookPeruseCard from "./BookPeruseCard.vue"
  82. export default {
  83. //import引入的组件需要注入到对象中才能使用
  84. components: {
  85. BookCard,
  86. BookLiveCard,
  87. BookPeruseCard
  88. },
  89. props: ["Bookinfo","showAll","showPage","LoginNavIndex","userBg","headerBorder","headerBg","previousPage"],
  90. data() {
  91. //这里存放数据
  92. return {
  93. typeList: {
  94. huakan: {
  95. name: '画刊',
  96. },
  97. baozhi: {
  98. name: '报纸',
  99. },
  100. xiti: {
  101. name: '练习册',
  102. },
  103. kecheng: {
  104. name: '课程',
  105. },
  106. },
  107. }
  108. },
  109. //计算属性 类似于data概念
  110. computed: {},
  111. //监控data中数据变化
  112. watch: {},
  113. //方法集合
  114. methods: {
  115. // 查看全部
  116. lookmore(){
  117. this.$emit("changeStudy",this.Bookinfo.study)
  118. },
  119. },
  120. //生命周期 - 创建完成(可以访问当前this实例)
  121. created() {
  122. },
  123. //生命周期 - 挂载完成(可以访问DOM元素)
  124. mounted() {
  125. },
  126. //生命周期-创建之前
  127. beforeCreated() { },
  128. //生命周期-挂载之前
  129. beforeMount() { },
  130. //生命周期-更新之前
  131. beforUpdate() { },
  132. //生命周期-更新之后
  133. updated() { },
  134. //生命周期-销毁之前
  135. beforeDestory() { },
  136. //生命周期-销毁完成
  137. destoryed() { },
  138. //如果页面有keep-alive缓存功能,这个函数会触发
  139. activated() { }
  140. }
  141. </script>
  142. <style lang="scss" scoped>
  143. /* @import url(); 引入css类 */
  144. .module {
  145. margin-top: -12px;
  146. .title {
  147. display: flex;
  148. justify-content: space-between;
  149. align-items: flex-end;
  150. &-left{
  151. display: flex;
  152. align-items: center;
  153. span{
  154. font-weight: 500;
  155. font-size: 24px;
  156. line-height: 32px;
  157. color: #1F2C5C;
  158. }
  159. b{
  160. font-weight: 400;
  161. font-size: 16px;
  162. line-height: 32px;
  163. color: #929CA8;
  164. margin-left: 16px;
  165. }
  166. }
  167. &-right{
  168. display: flex;
  169. align-items: center;
  170. }
  171. div.title-button {
  172. width: 48px;
  173. height: 24px;
  174. background: #d4e3fc;
  175. border-radius: 40px;
  176. display: flex;
  177. justify-content: center;
  178. align-items: center;
  179. img {
  180. width: 16px;
  181. height: 16px;
  182. margin: 0 4px;
  183. cursor: pointer;
  184. }
  185. }
  186. .lookmore{
  187. display: flex;
  188. align-items: center;
  189. margin-left: 24px;
  190. font-weight: 400;
  191. font-size: 16px;
  192. line-height: 24px;
  193. .el-icon-arrow-right{
  194. margin-left: 4px;
  195. color: #C1C5CD;
  196. height: 24px;
  197. line-height: 24px;
  198. }
  199. }
  200. }
  201. .list,.listlive,.peruselist {
  202. margin-top: 24px;
  203. display: flex;
  204. flex-wrap: wrap;
  205. > div {
  206. width: 200px;
  207. border-radius: 8px;
  208. overflow: hidden;
  209. background: #ffffff;
  210. margin-bottom: 40px;
  211. &:hover{
  212. box-shadow: 0px 0px 30px rgba(0,0,0,0.1);
  213. }
  214. }
  215. }
  216. .listlive,.peruselist{
  217. >div{
  218. width: 282px;
  219. }
  220. }
  221. }
  222. </style>