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

195 lines
4.3 KiB

11 months ago
11 months ago
10 months ago
11 months ago
10 months ago
  1. <template>
  2. <view class="promotionRecord">
  3. <!--顶部导航栏-->
  4. <navbar leftClick @leftClick="$utils.navigateBack" title="我的推广" />
  5. <!--主页面-->
  6. <view class="frame">
  7. <!--标题-->
  8. <view class="title">
  9. <span>推广记录</span>
  10. </view>
  11. <!--搜索条件-->
  12. <view class="search">
  13. <!--搜索框-->
  14. <view style="width:30%;height:100%">
  15. <uv-input v-model="queryParams.keyWord" placeholder="请输入内容" border="surround" clearable
  16. @change="keyWordChange"></uv-input>
  17. </view>
  18. <!--开始时间-->
  19. <view class="dateTimeCls">
  20. <view class="date" @click="startDateOpen">
  21. {{ queryParams.startDate }}
  22. <uv-datetime-picker ref="startDateRef" v-model="queryParams.startDate" mode="date"
  23. @confirm="startDateChange"></uv-datetime-picker>
  24. </view>
  25. <view class="image">
  26. <image src="../static/promotionRecord/2.svg" style="width: 100%;height: 100%"></image>
  27. </view>
  28. </view>
  29. <!--结束时间-->
  30. <view class="dateTimeCls">
  31. <view class="date" @click="endDateOpen">
  32. {{ queryParams.endDate }}
  33. <uv-datetime-picker ref="endDateRef" v-model="queryParams.endDate" mode="date"
  34. @confirm="endDateChange">
  35. </uv-datetime-picker>
  36. </view>
  37. <view class="image">
  38. <image src="../static/promotionRecord/2.svg" style="width: 100%;height: 100%"></image>
  39. </view>
  40. </view>
  41. </view>
  42. <!--发布列表-->
  43. <view style="" class="publishListClass">
  44. <PromotionRecordList :list="promotionRecordList" />
  45. </view>
  46. </view>
  47. </view>
  48. </template>
  49. <script>
  50. import PromotionRecordList from "./sonPage/promotion/promotionRecordList.vue";
  51. import dayjs from "dayjs";
  52. export default {
  53. components: {
  54. PromotionRecordList
  55. },
  56. data() {
  57. return {
  58. promotionRecordList: [],
  59. queryParams: {
  60. pageNo: 1,
  61. pageSize: 10,
  62. startDate: dayjs(new Date()).subtract(30,'day').format('YYYY-MM-DD'),
  63. endDate: dayjs(new Date()).format('YYYY-MM-DD'),
  64. keyWord: '',
  65. },
  66. }
  67. },
  68. onReachBottom() {
  69. console.log("=====")
  70. let allTotal = this.queryParams.pageNo * this.queryParams.pageSize
  71. if (allTotal < this.total) {
  72. //当前条数小于总条数 则增加请求数
  73. this.queryParams.pageSize += 10
  74. this.getData() //调用加载数据方法
  75. }
  76. },
  77. mounted() {
  78. console.log("====")
  79. this.getData()
  80. },
  81. methods: {
  82. getData() {
  83. this.$api('infoGetPromotionPage', {
  84. pageNo: this.queryParams.pageNo,
  85. pageSize: this.queryParams.pageSize,
  86. startDate: this.queryParams.startDate,
  87. endDate: this.queryParams.endDate,
  88. keyWord: this.queryParams.keyWord
  89. }, res => {
  90. if (res.code == 200) {
  91. this.promotionRecordList = res.result.records
  92. this.total = res.result.total
  93. }
  94. })
  95. },
  96. keyWordChange(val) {
  97. this.queryParams.keyWord = val
  98. this.getData()
  99. },
  100. startDateChange(val) {
  101. this.$nextTick(() => {
  102. this.queryParams.startDate = dayjs(val.value).format("YYYY-MM-DD")
  103. this.getData()
  104. });
  105. },
  106. startDateOpen() {
  107. this.$refs.startDateRef.open();
  108. },
  109. endDateChange(val) {
  110. this.$nextTick(() => {
  111. this.queryParams.endDate = dayjs(val.value).format("YYYY-MM-DD")
  112. this.getData()
  113. });
  114. },
  115. endDateOpen() {
  116. this.$refs.endDateRef.open();
  117. },
  118. }
  119. }
  120. </script>
  121. <style lang="scss" scoped>
  122. * {
  123. box-sizing: border-box;
  124. margin: 0;
  125. padding: 0;
  126. }
  127. .promotionRecord {
  128. width: 100vw;
  129. height: 100vh;
  130. .frame {
  131. width: 100%;
  132. //height: calc(100vh - 220rpx);
  133. padding: 28rpx 28rpx 0 28rpx;
  134. .title {
  135. font-size: 34rpx;
  136. color: #333;
  137. font-weight: 700
  138. }
  139. .search {
  140. display: flex;
  141. align-items: center;
  142. gap: 10rpx;
  143. width: 100%;
  144. height: 80rpx;
  145. margin-top: 20rpx;
  146. .dateTimeCls {
  147. display: flex;
  148. align-items: center;
  149. justify-content: space-between;
  150. width: 30%;
  151. height: 80%;
  152. border: 1px solid #b0b2b3;
  153. padding: 5rpx;
  154. border-radius: 20rpx;
  155. .date {
  156. font-size: 25rpx;
  157. display: flex;
  158. align-items: center;
  159. width: 80%;
  160. height: 100%;
  161. color: #b0b2b3;
  162. }
  163. .image {
  164. width: 20%;
  165. height: 100%;
  166. }
  167. }
  168. }
  169. .publishListClass {
  170. margin-top: 10rpx;
  171. height: 78vh;
  172. overflow: auto;
  173. width: 100%;
  174. }
  175. }
  176. }
  177. </style>