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

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