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

112 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 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. name:"语文学习报+试卷",
  30. text:"【人教版】每学期20期彩色周报及4张单元试卷"
  31. },
  32. {
  33. name:"数学学习报+试卷",
  34. text:"【湘教版】每学期20期彩色周报及4张单元试卷"
  35. },{
  36. name:"英语学习报+试卷",
  37. text:"【北大师版】每学期26期彩色周报及14张单元试卷"
  38. }
  39. ]
  40. }
  41. },
  42. onLoad() {
  43. this.params.pageNo = 1;
  44. this.params.total = null;
  45. this.params.isLock = true;
  46. },
  47. onReady() {
  48. this.$com.displayNav()
  49. },
  50. onPullDownRefresh() {
  51. this.list = [];
  52. this.params.pageNo = 1;
  53. this.params.total = null;
  54. this.params.isLock = true;
  55. },
  56. onReachBottom() {
  57. if(this.params.isLock){
  58. this.params.isLock = false;
  59. if(this.params.total !== null && this.params.pageNo * this.params.pageSize >= this.params.total){
  60. this.$Toast('没有更多数据了哦!');
  61. setTimeout(()=>{
  62. this.params.isLock = true;
  63. },3000)
  64. return
  65. }
  66. this.params.pageNo+=1;
  67. this.$Toast('数据加载成功!');
  68. }
  69. },
  70. methods:{
  71. seeDetail(item){
  72. uni.navigateTo({
  73. url:`/pages/my/kanwudetails`
  74. })
  75. }
  76. }
  77. }
  78. </script>
  79. <style lang="scss" scoped>
  80. .home-pages {
  81. padding: 28rpx 29rpx 0;
  82. min-height: 80vh;
  83. background-color: #F7F7F7;
  84. .swiper{
  85. position: relative;
  86. height: calc(100% -7vh);
  87. width: 100%;
  88. height: 1800px;
  89. }
  90. .scroll-Y {
  91. height: calc(300vh - 660rpx);
  92. padding-top: 20rpx;
  93. }
  94. .home-content {
  95. .active-card{
  96. margin-top: 20rpx;;
  97. border-radius: 0;
  98. border: none;
  99. border-style: none;
  100. box-shadow: none;
  101. }
  102. }
  103. }
  104. </style>