look.vue 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. <template>
  2. <view>
  3. <view class="page">
  4. <view class="list u-flex" v-for="(item,index) in list" :key="item.id" @click="todetails(item.id)">
  5. <view class="u-flex">
  6. <image style="width: 84rpx;height: 84rpx;border-radius: 50%;margin-right: 20rpx;" :src="item.user.avatar" mode=""></image>
  7. <view class="">
  8. <view class="u-flex font u-row-between" style="width: 520rpx;">
  9. <view class="">
  10. <text class="left">{{item.user.name}}</text>
  11. <text class="center">{{item.user.job_text}}</text>
  12. </view>
  13. <text class="right">{{item.updatetime_text}}</text>
  14. </view>
  15. <text class="bottom">{{item.user.company_text}}</text>
  16. </view>
  17. </view>
  18. </view>
  19. </view>
  20. </view>
  21. </template>
  22. <script>
  23. import {
  24. browse_get_list
  25. } from "@/units/inquire.js"
  26. export default {
  27. data() {
  28. return {
  29. page: 1,
  30. list: [],
  31. total:0
  32. }
  33. },
  34. onLoad() {
  35. this.slist()
  36. },
  37. onReachBottom() {
  38. if(this.list.length != this.total){
  39. this.page++
  40. this.slist()
  41. }
  42. },
  43. methods: {
  44. slist() {
  45. browse_get_list({
  46. page: this.page
  47. }).then(res => {
  48. console.log(res);
  49. this.total = res.data.total
  50. if(this.page == 1){
  51. this.list = res.data.data
  52. }else{
  53. this.list = this.list.concat(res.data.data)
  54. }
  55. })
  56. },
  57. todetails(id) {
  58. uni.navigateTo({
  59. url: "/pagesB/details?id=" + id
  60. })
  61. }
  62. }
  63. }
  64. </script>
  65. <style lang="scss" scoped>
  66. .page {
  67. background-color: #f3f3f3;
  68. padding:0 24rpx;
  69. height: calc(100vh );
  70. border:2rpx solid transparent;
  71. .list {
  72. background: #FFFFFF;
  73. border-radius: 16rpx;
  74. padding:24rpx 32rpx;
  75. height: 148rpx;
  76. box-sizing: border-box;
  77. margin-top: 20rpx;
  78. }
  79. .font{
  80. height: 44rpx;
  81. .left{
  82. font-size: 32rpx;
  83. font-family: PingFangSC-Medium, PingFang SC;
  84. font-weight: 500;
  85. color: #222222;
  86. }
  87. .center{
  88. margin-left: 20rpx;
  89. font-size: 20rpx;
  90. font-family: PingFangSC-Regular, PingFang SC;
  91. font-weight: 400;
  92. color: #777777;
  93. }
  94. .right{
  95. font-size: 20rpx;
  96. font-family: SFPro-Regular, SFPro;
  97. font-weight: 400;
  98. color: #777777;
  99. }
  100. }
  101. .bottom{
  102. margin-top: 20rpx;
  103. font-size: 20rpx;
  104. font-family: PingFangSC-Regular, PingFang SC;
  105. font-weight: 400;
  106. color: #555555;
  107. }
  108. }
  109. </style>