公众号项目
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.

118 lines
2.5 KiB

1 year ago
  1. <template>
  2. <view class="home-pages">
  3. <view class="home-content">
  4. <card v-for="(item,i) in list" :item="item" :key="i" :i="i" @seeDetail="seeDetail"></card>
  5. </view>
  6. </view>
  7. </template>
  8. <script>
  9. import card from '@/components/active-card/order-list.vue'
  10. export default{
  11. components:{
  12. card,
  13. },
  14. data(){
  15. return{
  16. params:{
  17. pageNo:1,
  18. state:'0',
  19. pageSize:10,
  20. total: null,
  21. isLock: true
  22. },
  23. current:0,
  24. list:[{tranNo: "69732894782348932"},{tranNo: "69732894782348931"}],
  25. }
  26. },
  27. onLoad() {
  28. this.params.state = "0";
  29. this.params.pageNo = 1;
  30. this.params.total = null;
  31. this.params.isLock = true;
  32. this.queryPageListJobRelease();
  33. },
  34. onReady() {
  35. this.$com.displayNav()
  36. },
  37. onPullDownRefresh() {
  38. this.list = [];
  39. this.params.pageNo = 1;
  40. this.params.total = null;
  41. this.params.isLock = true;
  42. this.queryPageListJobRelease()
  43. },
  44. onReachBottom() {
  45. if(this.params.isLock){
  46. this.params.isLock = false;
  47. if(this.params.total !== null && this.params.pageNo * this.params.pageSize >= this.params.total){
  48. this.$Toast('没有更多数据了哦!');
  49. setTimeout(()=>{
  50. this.params.isLock = true;
  51. },3000)
  52. return
  53. }
  54. this.params.pageNo+=1;
  55. this.$Toast('数据加载成功!');
  56. this.queryPageListJobRelease();
  57. }
  58. },
  59. methods:{
  60. queryPageListJobRelease(){//学习列表
  61. // if(this.pageNo>1){
  62. // uni.showLoading({})
  63. // }
  64. // this.$api('getOrderList',this.params)
  65. // .then(res=>{
  66. // if(res.code == 200){
  67. // if(this.params.total== null) {
  68. // this.params.total = res.result.total
  69. // }
  70. // if(this.params.pageNo>1){
  71. // uni.hideLoading();
  72. // }
  73. // this.list = this.list.concat(res.result.records);
  74. // this.params.isLock = true;
  75. // }else {
  76. // if(this.params.pageNo>1){
  77. // uni.hideLoading();
  78. // }
  79. // this.params.isLock = true;
  80. // }
  81. // })
  82. },
  83. tabClick(e){
  84. // this.params.state = e.id;
  85. // this.params.pageNo =1;
  86. // this.list = [];
  87. // this.queryPageListJobRelease();
  88. },
  89. seeDetail(item){
  90. uni.navigateTo({
  91. url:`/pages/my/orderdetails`
  92. })
  93. }
  94. }
  95. }
  96. </script>
  97. <style lang="scss" scoped>
  98. .home-pages {
  99. padding: 28rpx 29rpx 0;
  100. background-color: #F7F7F7;
  101. min-height: 80vh;
  102. .home-content {
  103. min-height: 80vh;
  104. .active-card{
  105. margin-top: 20rpx;;
  106. border-radius: 0;
  107. border: none;
  108. border-style: none;
  109. box-shadow: none;
  110. }
  111. }
  112. }
  113. </style>