移动端
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

127 行
3.3 KiB

  1. <template>
  2. <div class="app-container">
  3. <van-nav-bar
  4. title="个人供求"
  5. left-arrow
  6. fixed
  7. placeholder
  8. @click-left="onClickLeft"
  9. />
  10. <van-tabs animated color="#007b76" type="card" style="margin-top: 10px;">
  11. <van-tab>
  12. <template #title><van-icon name="label" size="18" style="top: 4px"/>供应信息</template>
  13. <van-list
  14. v-model="loading"
  15. :finished="finished"
  16. finished-text="没有更多了"
  17. style="margin-top: 10px;"
  18. @load="getList"
  19. >
  20. <van-cell icon="play" v-for="(item,index) in supplyList" :key="index" >
  21. <template #title>
  22. {{item.location}}
  23. </template>
  24. <template #label>
  25. 联系电话:{{item.phone}} <p style="float: right;">发布时间:{{item.logintime}}</p>
  26. </template>
  27. </van-cell>
  28. </van-list>
  29. </van-tab>
  30. <van-tab title="选项">
  31. <template #title><van-icon name="bookmark" size="18" style="top: 4px"/>需求信息</template>
  32. <van-list
  33. v-model="loadingSecond"
  34. :finished="finishedSecond"
  35. finished-text="没有更多了"
  36. style="margin-top: 10px;"
  37. @load="getSecondList"
  38. >
  39. <van-cell icon="play" v-for="(item,index) in supplySecondList" :key="index">
  40. <template #title>
  41. {{item.location}}
  42. </template>
  43. <template #label>
  44. 联系电话:{{item.phone}} <p style="float: right;">发布时间:{{item.logintime}}</p>
  45. </template>
  46. </van-cell>
  47. </van-list>
  48. </van-tab>
  49. </van-tabs>
  50. </div>
  51. </template>
  52. <script>
  53. import { supplyList } from "@/api/supply/index";
  54. export default {
  55. name: "supply",
  56. data() {
  57. return {
  58. //是否显示加载
  59. loading: false,
  60. //是否滚动到底部
  61. finished: false,
  62. //是否显示加载
  63. loadingSecond: false,
  64. //是否滚动到底部
  65. finishedSecond: false,
  66. //查询参数
  67. queryParams: {
  68. deptId:100,
  69. pageNum:1,
  70. pageSize:10,
  71. supplyDemandType:1
  72. },
  73. //查询参数
  74. querySecondParams: {
  75. deptId:100,
  76. pageNum:1,
  77. pageSize:10,
  78. supplyDemandType:2
  79. },
  80. //数据集合
  81. supplyList:[],
  82. //数据集合
  83. supplySecondList:[],
  84. };
  85. },
  86. created() {},
  87. methods: {
  88. getList(){
  89. this.loading = true;
  90. supplyList(this.queryParams).then(response => {
  91. console.log(response)
  92. this.supplyList = response.rows;
  93. if(this.supplyList.length >= response.total){
  94. this.finished = true;
  95. return;
  96. }
  97. this.queryParams.pageNum += 1 ;
  98. this.loading = false;
  99. });
  100. },
  101. getSecondList(){
  102. this.loadingSecond = true;
  103. supplyList(this.querySecondParams).then(response => {
  104. console.log(response)
  105. this.supplySecondList = response.rows;
  106. if(this.supplySecondList.length >= response.total){
  107. this.finishedSecond = true;
  108. return;
  109. }
  110. this.queryParams.pageNum += 1 ;
  111. this.loadingSecond = false;
  112. });
  113. },
  114. },
  115. };
  116. </script>
  117. <style scoped lang="scss">
  118. .app-container {
  119. }
  120. .titleClass{
  121. }
  122. </style>