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

110 lines
2.2 KiB

1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
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. pageSize:10,
  19. total: null,
  20. isLock: true
  21. },
  22. current:0,
  23. list:[],
  24. }
  25. },
  26. onLoad() {
  27. this.params.pageNo = 1;
  28. this.params.total = null;
  29. this.params.isLock = true;
  30. this.queryPageListJobRelease();
  31. },
  32. onReady() {
  33. this.$com.displayNav()
  34. },
  35. onPullDownRefresh() {
  36. this.list = [];
  37. this.params.pageNo = 1;
  38. this.params.total = null;
  39. this.params.isLock = true;
  40. this.queryPageListJobRelease()
  41. },
  42. onReachBottom() {
  43. if(this.params.isLock){
  44. this.params.isLock = false;
  45. if(this.params.total !== null && this.params.pageNo * this.params.pageSize >= this.params.total){
  46. this.$Toast('没有更多数据了哦!');
  47. setTimeout(()=>{
  48. this.params.isLock = true;
  49. },3000)
  50. return
  51. }
  52. this.params.pageNo+=1;
  53. this.$Toast('数据加载成功!');
  54. this.queryPageListJobRelease();
  55. }
  56. },
  57. methods:{
  58. queryPageListJobRelease(){//学习列表
  59. if(this.pageNo>1){
  60. uni.showLoading({})
  61. }
  62. this.$api('getOrderList',this.params)
  63. .then(res=>{
  64. if(res.code == 200){
  65. if(this.params.total== null) {
  66. this.params.total = res.result.total
  67. }
  68. if(this.params.pageNo>1){
  69. uni.hideLoading();
  70. }
  71. this.list = this.list.concat(res.result.records);
  72. this.params.isLock = true;
  73. }else {
  74. if(this.params.pageNo>1){
  75. uni.hideLoading();
  76. }
  77. this.params.isLock = true;
  78. }
  79. })
  80. },
  81. seeDetail(item){
  82. uni.navigateTo({
  83. url:`/pages/my/orderdetails?id=`+item.id
  84. })
  85. }
  86. }
  87. }
  88. </script>
  89. <style lang="scss" scoped>
  90. .home-pages {
  91. padding: 28rpx 29rpx 0;
  92. background-color: #F7F7F7;
  93. min-height: 80vh;
  94. .home-content {
  95. min-height: 80vh;
  96. .active-card{
  97. margin-top: 20rpx;;
  98. border-radius: 0;
  99. border: none;
  100. border-style: none;
  101. box-shadow: none;
  102. }
  103. }
  104. }
  105. </style>