book.vue 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. <template>
  2. <view class="main">
  3. <view class="indexswiper" style="margin-top: 10rpx;">
  4. <u-swiper :list="lunbolist" mode="none"></u-swiper>
  5. </view>
  6. <view class="tltleStyle">
  7. 推荐文章
  8. </view>
  9. <u-card :show-head="false" :show-foot="false" :border="false">
  10. <view class="" slot="body" v-for="(item,index) in list" :key="index" @click="bookinfo(item.id,item.title)">
  11. <view class="u-border-bottom padding-bottom-sm">
  12. <view class="u-body-item u-flex u-col-between u-p-t-0">
  13. <view class="u-body-item-title u-line-2">{{item.title}}</view>
  14. <image :src="item.banner_url"></image>
  15. </view>
  16. <!-- <u-tag text="情感咨询" size="mini" shape="circle" mode="dark" type="info" /> -->
  17. </view>
  18. </view>
  19. </u-card>
  20. <view class="margin-tb padding-tb-xs">
  21. <u-loadmore :status="nomore" :icon-type="flower" />
  22. </view>
  23. </view>
  24. </template>
  25. <script>
  26. export default {
  27. onLoad(options) {
  28. },
  29. mounted() {
  30. this.getbook()
  31. },
  32. data() {
  33. return {
  34. list: [],
  35. lunbolist: [{
  36. image: 'https://cdn.uviewui.com/uview/swiper/1.jpg',
  37. title: '昨夜星辰昨夜风,画楼西畔桂堂东'
  38. },
  39. {
  40. image: 'https://cdn.uviewui.com/uview/swiper/2.jpg',
  41. title: '身无彩凤双飞翼,心有灵犀一点通'
  42. },
  43. {
  44. image: 'https://cdn.uviewui.com/uview/swiper/3.jpg',
  45. title: '谁念西风独自凉,萧萧黄叶闭疏窗,沉思往事立残阳'
  46. }
  47. ],
  48. }
  49. },
  50. methods: {
  51. getbook: async function() {
  52. let res = await this.$request.post("/api/v1/article/articleList")
  53. if (res.status == 0) {
  54. this.list = res.data.data
  55. }
  56. },
  57. bookinfo(id, title) {
  58. uni.navigateTo({
  59. url: "../common_tools/collection/collection_details?id=" + id + "&title=" + title
  60. })
  61. }
  62. }
  63. };
  64. </script>
  65. <style scoped lang="scss">
  66. .main {
  67. padding-top: 10rpx;
  68. padding-left: 20rpx;
  69. padding-right: 20rpx;
  70. }
  71. .tltleStyle {
  72. padding: 30rpx 30rpx 15rpx 15rpx;
  73. font-weight: bold;
  74. font-size: 40rpx;
  75. background-color: #fff;
  76. }
  77. .u-card-wrap {
  78. background-color: $u-bg-color;
  79. padding: 1px;
  80. }
  81. .u-body-item {
  82. font-size: 32rpx;
  83. color: #333;
  84. padding: 20rpx 10rpx;
  85. }
  86. .u-body-item image {
  87. width: 120rpx;
  88. flex: 0 0 120rpx;
  89. height: 120rpx;
  90. border-radius: 8rpx;
  91. margin-left: 12rpx;
  92. }
  93. </style>