book.vue 2.5 KB

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