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

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