移动端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

189 lines
5.6 KiB

  1. <template>
  2. <div class="app-container">
  3. <navBar title="个人供求" background="0" positionType="fixed"></navBar>
  4. <van-tabs animated :swipeable="true">
  5. <van-tab title="供应信息">
  6. <van-list
  7. v-model="loading"
  8. :finished="finished"
  9. finished-text="没有更多了"
  10. style="margin-top: 10px;"
  11. @load="getList"
  12. >
  13. <van-cell v-for="(item,index) in supplyList" :key="index" :to="{path:'/supply/supplyDetail',query:{id:item.id}}" >
  14. <template #title>
  15. {{item.location}}
  16. </template>
  17. <template #label>
  18. <div style="display: flex;align-items: center;justify-content: space-between;">
  19. <p style="color:#2D87E8;display: flex;align-items: center;"><img src="../../../static/images/transaction_new/supply/supply_icon_01.png" alt="">{{item.phone}}</p>
  20. <p style="float: right;"><van-icon name="clock-o" color="#AAB1B5" style="margin-right: 5px;" />{{item.logintime}}</p>
  21. </div>
  22. </template>
  23. <template #right-icon>
  24. <div style="width: 5%;">
  25. <img src="../../../static/images/transaction_new/supply/supply_icon_02.png" style="position:absolute;right: 0;top: 0;" alt="">
  26. </div>
  27. </template>
  28. </van-cell>
  29. </van-list>
  30. </van-tab>
  31. <van-tab title="需求信息">
  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 v-for="(item,index) in supplySecondList" :key="index" :to="{path:'/supply/supplyDetail',query:{id:item.id}}">
  40. <template #title>
  41. {{item.location}}
  42. </template>
  43. <template #label>
  44. <div style="display: flex;align-items: center;justify-content: space-between;">
  45. <p style="color:#2D87E8;display: flex;align-items: center;"><img src="../../../static/images/transaction_new/supply/supply_icon_01.png" alt="">{{item.phone}}</p>
  46. <p style="float: right;"><van-icon name="clock-o" color="#AAB1B5" style="margin-right: 5px;" />{{item.logintime}}</p>
  47. </div>
  48. </template>
  49. <template #right-icon>
  50. <div style="width: 5%;">
  51. <img src="../../../static/images/transaction_new/supply/supply_icon_03.png" style="position:absolute;right: 0;top: 0;" alt="">
  52. </div>
  53. </template>
  54. </van-cell>
  55. </van-list>
  56. </van-tab>
  57. </van-tabs>
  58. </div>
  59. </template>
  60. <script>
  61. import { supplyList } from "@/api/supply/index";
  62. import navBar from "@/components/common/nav_bar.vue";
  63. export default {
  64. name: "supply",
  65. components: { navBar },
  66. data() {
  67. return {
  68. //是否显示加载
  69. loading: false,
  70. //是否滚动到底部
  71. finished: false,
  72. //是否显示加载
  73. loadingSecond: false,
  74. //是否滚动到底部
  75. finishedSecond: false,
  76. //查询参数
  77. queryParams: {
  78. deptId:100,
  79. pageNum:1,
  80. pageSize:10,
  81. supplyDemandType:1
  82. },
  83. //查询参数
  84. querySecondParams: {
  85. deptId:100,
  86. pageNum:1,
  87. pageSize:10,
  88. supplyDemandType:2
  89. },
  90. //数据集合
  91. supplyList:[],
  92. //数据集合
  93. supplySecondList:[],
  94. };
  95. },
  96. created() {},
  97. methods: {
  98. getList(){
  99. this.loading = true;
  100. supplyList(this.queryParams).then(response => {
  101. console.log(response)
  102. this.supplyList = response.rows;
  103. if(this.supplyList.length >= response.total){
  104. this.finished = true;
  105. return;
  106. }
  107. this.queryParams.pageNum += 1 ;
  108. this.loading = false;
  109. });
  110. },
  111. getSecondList(){
  112. this.loadingSecond = true;
  113. supplyList(this.querySecondParams).then(response => {
  114. console.log(response)
  115. this.supplySecondList = response.rows;
  116. if(this.supplySecondList.length >= response.total){
  117. this.finishedSecond = true;
  118. return;
  119. }
  120. this.queryParams.pageNum += 1 ;
  121. this.loadingSecond = false;
  122. });
  123. },
  124. },
  125. };
  126. </script>
  127. <style scoped lang="scss">
  128. .app-container {
  129. height: 100vh;
  130. background: #F4F8FB;
  131. }
  132. /deep/ .van-tabs__content{
  133. background: transparent;
  134. /*border-radius: 20PX;*/
  135. }
  136. /deep/ .van-tabs__nav{
  137. /*background: transparent;*/
  138. padding-bottom: 0;
  139. }
  140. /deep/ .van-tab--active{
  141. background: #fff;
  142. }
  143. /deep/ .van-tab::after{
  144. display: none;
  145. }
  146. /deep/ .van-tabs__wrap{
  147. overflow: initial;
  148. }
  149. /deep/ .van-tabs__line{
  150. /*background: linear-gradient(to right, #5166f5, #97eedc);*/
  151. background: url("../../../static/images/transaction_new/tab_border.png") no-repeat center;
  152. height: 0.35rem;
  153. bottom: 0;
  154. }
  155. /deep/ .van-tab:nth-child(1)::before{
  156. content: "";
  157. position: absolute;
  158. left: auto;
  159. top: 0;
  160. right: -19%;
  161. bottom: 0;
  162. background: url("../../../static/images/yinnong/login_tab_icon.png") no-repeat center;
  163. background-size: 100% 100%;
  164. width: 20%;
  165. }
  166. /deep/ .van-tab:nth-child(2)::before{
  167. content: "";
  168. position: absolute;
  169. left: -19%;
  170. top: 0;
  171. right: auto;
  172. bottom: 0;
  173. /*background: url("../../../static/images/yinnong/login_tab_icon_right.png") no-repeat center;*/
  174. /*background-size: 100% 100%;*/
  175. width: 20%;
  176. }
  177. .van-cell{
  178. border-radius: 10Px;
  179. overflow: hidden;
  180. position: relative;
  181. width: 94%;
  182. margin: 0 auto 1vh;
  183. }
  184. </style>