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

114 lines
2.0 KiB

11 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 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. v-model="queryParams.title"
  19. />
  20. <view class="text"
  21. @click="indexGetTrendsPage">
  22. 搜索
  23. </view>
  24. </view>
  25. <postList :list="postList"/>
  26. </view>
  27. </view>
  28. </template>
  29. <script>
  30. import postList from '@/components/post/postList.vue'
  31. export default {
  32. components : {
  33. postList
  34. },
  35. data() {
  36. return {
  37. postList : [],
  38. total : 0,
  39. queryParams : {
  40. pageNo : 1,
  41. pageSize : 10,
  42. title : '',
  43. },
  44. }
  45. },
  46. onShow() {
  47. this.queryParams.pageNo = 1
  48. this.indexGetTrendsPage(res => {
  49. this.postList = res.result.records
  50. })
  51. },
  52. //滚动到屏幕底部
  53. onReachBottom() {
  54. let total = this.queryParams.pageNo * this.queryParams.pageSize
  55. if(total < this.total){
  56. this.queryParams.pageSize += 10
  57. this.indexGetTrendsPage(res => {
  58. this.postList.push(...res.result.records)
  59. })
  60. }
  61. },
  62. methods: {
  63. indexGetTrendsPage(fn){
  64. this.$api('indexGetTrendsPage',
  65. this.queryParams, res => {
  66. if(res.code == 200){
  67. // fn && fn(res)
  68. this.postList = res.result.records
  69. this.total = res.result.total
  70. }
  71. })
  72. },
  73. }
  74. }
  75. </script>
  76. <style lang="scss" scoped>
  77. .postList{
  78. .title{
  79. padding-top: 20rpx;
  80. padding-left: 30rpx;
  81. font-size: 32rpx;
  82. }
  83. .box{
  84. padding: 30rpx;
  85. .search{
  86. background-color: #fff;
  87. height: 70rpx;
  88. width: 100%;
  89. margin: 20rpx 0;
  90. display: flex;
  91. justify-content: center;
  92. align-items: center;
  93. font-size: 28rpx;
  94. border-radius: 10rpx;
  95. .icon{
  96. margin: 0 20rpx;
  97. }
  98. input{
  99. }
  100. .text{
  101. margin-left: auto;
  102. margin-right: 20rpx;
  103. }
  104. }
  105. }
  106. }
  107. </style>