My.vue 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. <template>
  2. <view>
  3. <view class="align-items" style="margin-top: 80rpx;">
  4. <back></back>
  5. </view>
  6. <view v-for="(item,index) in list" :key="index">
  7. <view @click="gotopage(item)">
  8. <view class="type">
  9. <view class="justify-content">
  10. <view class="font-forty blue" >
  11. 类别:{{name}}
  12. </view>
  13. <view class="font-twenty-eight gray">
  14. {{item.time}}
  15. </view>
  16. </view>
  17. <view class="font-thirty-six black" style="margin: 30rpx 0;">
  18. {{item.house}}
  19. </view>
  20. <view class="font-thirty-six black" style="margin: 30rpx 0;">
  21. 备注:
  22. <text v-if="item.remark != null">
  23. {{item.remark}}
  24. </text>
  25. <text v-else>
  26. </text>
  27. </view>
  28. </view>
  29. </view>
  30. <view class="main-list-icon"></view>
  31. </view>
  32. </view>
  33. </template>
  34. <script>
  35. import service from '@/api/index.js'
  36. export default {
  37. data(){
  38. return {
  39. list:[],
  40. name:'',
  41. params: {
  42. pageNum: 1,
  43. pageSize: 10,
  44. },
  45. }
  46. },
  47. onLoad(e) {
  48. console.log('e',e)
  49. this.id = e.id;
  50. this.name = e.name;
  51. this.address = e.address;
  52. this.getListAll();
  53. },
  54. onReachBottom() {
  55. this.getNextListFn()
  56. },
  57. onPullDownRefresh() {
  58. this.getListAll();
  59. setTimeout(function () {
  60. uni.stopPullDownRefresh();
  61. }, 1000);
  62. },
  63. methods:{
  64. getListAll() {
  65. let that = this;
  66. let params ={
  67. serviceType: this.id,
  68. pageSize: 10,
  69. pageNum: 1,
  70. }
  71. service.getListAll(params).then(res => {
  72. this.list = res.records;
  73. that.total = res.total || 0;
  74. that.params.pageNum = res.current + 1;
  75. })
  76. },
  77. getNextListFn() {
  78. let that = this;
  79. let params ={
  80. serviceType: this.id,
  81. pageSize: this.params.pageSize,
  82. pageNum: this.params.pageNum,
  83. }
  84. if (this.list.length < this.total) {
  85. service.getListAll(params).then(response => {
  86. that.params.pageNum = response.current + 1
  87. response.records.forEach(item =>{
  88. that.list.push(item)
  89. })
  90. })
  91. }
  92. },
  93. gotopage(item){
  94. uni.navigateTo({
  95. url:`/pages/noLogin/Myphoto?id=${item.id}`,
  96. })
  97. }
  98. }
  99. }
  100. </script>
  101. <style lang="scss" scoped>
  102. .type {
  103. margin: 20rpx;
  104. padding: 20rpx;
  105. background: #FFFFFF;
  106. box-shadow: 0rpx 8rpx 17rpx 0rpx rgba(0, 0, 0, 0.04);
  107. border-radius: 10rpx;
  108. }
  109. </style>