book.vue 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  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. <u-no-network></u-no-network>
  24. </view>
  25. </template>
  26. <script>
  27. export default {
  28. onLoad(options) {
  29. },
  30. mounted() {
  31. this.getbook()
  32. },
  33. data() {
  34. return {
  35. list: [],
  36. lunbolist: [{
  37. image: 'https://cdn.uviewui.com/uview/swiper/1.jpg',
  38. title: '昨夜星辰昨夜风,画楼西畔桂堂东'
  39. },
  40. {
  41. image: 'https://cdn.uviewui.com/uview/swiper/2.jpg',
  42. title: '身无彩凤双飞翼,心有灵犀一点通'
  43. },
  44. {
  45. image: 'https://cdn.uviewui.com/uview/swiper/3.jpg',
  46. title: '谁念西风独自凉,萧萧黄叶闭疏窗,沉思往事立残阳'
  47. }
  48. ],
  49. }
  50. },
  51. methods: {
  52. getbook: async function() {
  53. let res = await this.$request.post("/api/v1/article/articleList")
  54. if (res.status == 0) {
  55. this.list = res.data.data
  56. }
  57. },
  58. bookinfo(id, title) {
  59. uni.navigateTo({
  60. url: "../common_tools/collection/collection_details?id=" + id + "&title=" + title
  61. })
  62. }
  63. }
  64. };
  65. </script>
  66. <style scoped lang="scss">
  67. .main {
  68. padding-top: 10rpx;
  69. padding-left: 20rpx;
  70. padding-right: 20rpx;
  71. }
  72. .tltleStyle {
  73. padding: 30rpx 30rpx 15rpx 15rpx;
  74. font-weight: bold;
  75. font-size: 40rpx;
  76. background-color: #fff;
  77. }
  78. .u-card-wrap {
  79. background-color: $u-bg-color;
  80. padding: 1px;
  81. }
  82. .u-body-item {
  83. font-size: 32rpx;
  84. color: #333;
  85. padding: 20rpx 10rpx;
  86. }
  87. .u-body-item image {
  88. width: 120rpx;
  89. flex: 0 0 120rpx;
  90. height: 120rpx;
  91. border-radius: 8rpx;
  92. margin-left: 12rpx;
  93. }
  94. </style>