information.vue 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. <template>
  2. <view>
  3. <scroll-view style="height: 100vh;" class="floor-list"
  4. :scroll-top="scrollTop" scroll-y="true" v-if="list.length > 0" @scroll="scroll" @scrolltoupper="upper" @scrolltolower="lower"
  5. refresher-enabled="true">
  6. <view class="hotelcontent" v-for="(item,index) in getlist" :key="index">
  7. <view class="contentleft">
  8. <image style="width: 100%;height: 100%;"></image>
  9. </view>
  10. <view class="contentitle">
  11. <view v-if="item.types == 0">催单信息</view>
  12. <view v-if="item.types == 1">联系酒店</view>
  13. <view v-if="item.types == 2">客户退货</view>
  14. <view>{{item.content}}</view>
  15. <view>订单号:{{item.order_sn}}</view>
  16. <view style="text-align: right;">{{item.add_time}}</view>
  17. </view>
  18. </view>
  19. </scroll-view>
  20. <view v-if="list.length == 0" style="text-align: center;margin-top: 300upx;">
  21. 暂无消息通知哦
  22. </view>
  23. </view>
  24. </template>
  25. <script>
  26. export default {
  27. data() {
  28. return{
  29. list:[],
  30. page: 1,
  31. scrollTop: 0,
  32. old: {
  33. scrollTop: 0
  34. }
  35. }
  36. },
  37. onLoad() {
  38. this.getlist();
  39. },
  40. methods: {
  41. // 滚动到顶部
  42. upper(e) {
  43. console.log("顶部")
  44. },
  45. // 滚到底部
  46. lower(e) {
  47. this.page = this.page + 1;
  48. if(this.ispull) {
  49. this.getlist();
  50. }
  51. },
  52. // 滚动时触发
  53. scroll(e) {
  54. this.old.scrollTop = e.detail.scrollTop
  55. },
  56. getlist() {
  57. this.request({
  58. url: '/v2/shop/msg_list',
  59. method: 'POST',
  60. data: {
  61. page: this.page,
  62. page_size: 10
  63. },
  64. success: (res) => {
  65. this.list = this.list.concat(res.data.data.msg_list);
  66. }
  67. })
  68. }
  69. }
  70. }
  71. </script>
  72. <style lang="scss">
  73. .hotelcontent {
  74. display: flex;
  75. flex-direction: row;
  76. padding: 18upx 32upx;
  77. border-bottom: 10upx solid #F5F5F5;
  78. .contentleft {
  79. width: 200upx;
  80. height: 180upx;
  81. background-color: red;
  82. }
  83. .contentitle {
  84. width: 100%;
  85. padding-left: 35upx;
  86. color: #909399;
  87. view {
  88. padding-bottom: 12upx;
  89. }
  90. .contentip {
  91. float: left;
  92. color: #909399;
  93. padding-top: 15upx;
  94. font-size: 24upx;
  95. }
  96. }
  97. }
  98. </style>