帧视界壹通告,付费看视频的微信小程序
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.

103 lines
1.7 KiB

11 months ago
11 months ago
  1. <template>
  2. <view class="postList">
  3. <navbar
  4. leftClick
  5. @leftClick="$utils.navigateBack"
  6. title="动态列表"/>
  7. <view class="title">
  8. 动态列表
  9. </view>
  10. <view class="box">
  11. <view class="search">
  12. <view class="icon">
  13. <uv-icon
  14. size="40rpx"
  15. name="search"></uv-icon>
  16. </view>
  17. <input type="text" placeholder="搜索相关..."/>
  18. <view class="text">
  19. 搜索
  20. </view>
  21. </view>
  22. <postList :list="postList"/>
  23. </view>
  24. </view>
  25. </template>
  26. <script>
  27. import postList from '@/components/post/postList.vue'
  28. export default {
  29. components : {
  30. postList
  31. },
  32. data() {
  33. return {
  34. postList : [],
  35. total : 0,
  36. queryParams : {
  37. pageNo : 1,
  38. pageSize : 10,
  39. }
  40. }
  41. },
  42. onShow() {
  43. this.getData()
  44. },
  45. onReachBottom(){
  46. let allTotal = this.queryParams.pageNo * this.queryParams.pageSize
  47. if(allTotal < this.total){
  48. //当前条数小于总条数 则增加请求数
  49. this.queryParams.pageSize += 10
  50. this.getData() //调用加载数据方法
  51. }
  52. },
  53. methods: {
  54. getData(){
  55. this.$api('indexGetTrendsPage', this.queryParams, res => {
  56. if(res.code == 200){
  57. this.postList = res.result.records
  58. this.total = res.result.total
  59. }
  60. })
  61. },
  62. }
  63. }
  64. </script>
  65. <style lang="scss" scoped>
  66. .postList{
  67. .title{
  68. padding-top: 20rpx;
  69. padding-left: 30rpx;
  70. font-size: 32rpx;
  71. }
  72. .box{
  73. padding: 30rpx;
  74. .search{
  75. background-color: #fff;
  76. height: 70rpx;
  77. width: 100%;
  78. margin: 20rpx 0;
  79. display: flex;
  80. justify-content: center;
  81. align-items: center;
  82. font-size: 28rpx;
  83. border-radius: 10rpx;
  84. .icon{
  85. margin: 0 20rpx;
  86. }
  87. input{
  88. }
  89. .text{
  90. margin-left: auto;
  91. margin-right: 20rpx;
  92. }
  93. }
  94. }
  95. }
  96. </style>