myTouGao.vue 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. <template>
  2. <view class="box">
  3. <u-navbar :autoBack="true" title="我的投稿" bgColor="rgba(255,255,255,0)" :placeholder="true" titleStyle="font-weight:bold;color:#000000"></u-navbar>
  4. <view class="rw_box" style="" v-if="list.length > 0">
  5. <view @click="$common.navigateTo('/user_fenbao/myTouGao/touGaoXiangQing?id=' + item.id)" class="zj_box" v-for="item in list" :key="item.id" style="position: relative">
  6. <view class="tx_box">
  7. <image style="border-radius: 15rpx; width: 300rpx; height: 185rpx" mode="aspectFill" :src="item.image"></image>
  8. </view>
  9. <view></view>
  10. <view class="ww_tit" style="display: flex; justify-content: space-between; align-items: center">
  11. <view class="" style="width: 160rpx; white-space: nowrap; overflow: hidden; text-overflow: ellipsis">
  12. {{ item.title }}
  13. </view>
  14. <view class="" style="width: 120rpx; white-space: nowrap; overflow: hidden; text-overflow: ellipsis">
  15. {{ item.publish_at.split(' ')[0] }}
  16. </view>
  17. </view>
  18. <u-badge v-if="item.region_text" type="primary" max="99" :value="item.region_text" :absolute="true" :offset="[5, 5]"></u-badge>
  19. </view>
  20. </view>
  21. <u-empty v-else text="暂无投稿" mode="data" icon="http://cdn.uviewui.com/uview/empty/data.png"></u-empty>
  22. </view>
  23. </template>
  24. <script>
  25. let that;
  26. export default {
  27. data() {
  28. return { isLoading: false, page: 1, list: [] };
  29. },
  30. onLoad() {
  31. that = this;
  32. this.getUserContribute();
  33. },
  34. methods: {
  35. getUserContribute() {
  36. this.isLoading = true;
  37. this.$api.getUserContribute({ main_body_id: 1, page: this.page, pageSize: '10' }, function (res) {
  38. if (res.code == 1) {
  39. that.isLoading = false;
  40. that.list = [...that.list, ...res.data];
  41. }
  42. });
  43. }
  44. },
  45. /* 页面触底 */
  46. onReachBottom() {
  47. if (this.isLoading) {
  48. return;
  49. } else {
  50. this.page++;
  51. this.getUserContribute();
  52. }
  53. }
  54. };
  55. </script>
  56. <style>
  57. .box {
  58. width: 100%;
  59. padding-bottom: 50rpx;
  60. background-image: url('https://huli-app.wenlvti.net/app_static/WenWuGuanJia/image/xbg_2.png');
  61. background-size: 100% 100%;
  62. background-attachment: fixed;
  63. background-repeat: repeat-y;
  64. height: 100%;
  65. }
  66. .rw_box {
  67. width: 92%;
  68. margin: auto;
  69. margin-top: 30rpx;
  70. display: flex;
  71. flex-wrap: wrap;
  72. padding-bottom: 20rpx;
  73. justify-content: space-between;
  74. border-radius: 10rpx;
  75. }
  76. .ww_tit {
  77. /* width: 260rpx; */
  78. font-size: 30rpx;
  79. color: #444444;
  80. white-space: nowrap;
  81. overflow: hidden;
  82. text-overflow: ellipsis;
  83. }
  84. .zj_box {
  85. margin-top: 20rpx;
  86. }
  87. </style>