rongYu.vue 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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="openBuildingInfo(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.type_text }}
  16. </view>
  17. </view>
  18. <u-badge type="primary" max="99" :value="item.honor_title" :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.getUserHonor();
  33. },
  34. methods: {
  35. getUserHonor() {
  36. this.isLoading = true;
  37. this.$api.getUserHonor({ main_body_id: 1, page: this.page, pageSize: '10' }, function (res) {
  38. // console.log(res, 77);
  39. if (res.code == 1) {
  40. that.isLoading = false;
  41. that.list = [...that.list, ...res.data];
  42. }
  43. });
  44. }
  45. },
  46. /* 页面触底 */
  47. onReachBottom() {
  48. if (this.isLoading) {
  49. return;
  50. } else {
  51. this.page++;
  52. this.getUserHonor();
  53. }
  54. }
  55. };
  56. </script>
  57. <style>
  58. .box {
  59. width: 100%;
  60. padding-bottom: 50rpx;
  61. background-image: url('https://huli-app.wenlvti.net/app_static/WenWuGuanJia/image/xbg_2.png');
  62. background-size: 100% 100%;
  63. background-attachment: fixed;
  64. background-repeat: repeat-y;
  65. height: 100%;
  66. }
  67. .rw_box {
  68. width: 100%;
  69. margin: auto;
  70. margin-top: 30rpx;
  71. display: flex;
  72. flex-wrap: wrap;
  73. padding-bottom: 20rpx;
  74. justify-content: space-around;
  75. border-radius: 10rpx;
  76. }
  77. .ww_tit {
  78. /* width: 260rpx; */
  79. font-size: 30rpx;
  80. color: #444444;
  81. white-space: nowrap;
  82. overflow: hidden;
  83. text-overflow: ellipsis;
  84. }
  85. .zj_box {
  86. margin-top: 20rpx;
  87. }
  88. </style>