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

221 lines
5.3 KiB

11 months ago
10 months ago
11 months ago
10 months ago
11 months ago
10 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:40%;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()).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. console.log("val", val)
  98. this.queryParams.keyWord = val
  99. this.getData()
  100. },
  101. startDateChange(val) {
  102. this.$nextTick(() => {
  103. this.queryParams.startDate = dayjs(val.value).format("YYYY-MM-DD")
  104. this.getData()
  105. });
  106. },
  107. startDateOpen() {
  108. this.$refs.startDateRef.open();
  109. },
  110. endDateChange(val) {
  111. this.$nextTick(() => {
  112. this.queryParams.endDate = dayjs(val.value).format("YYYY-MM-DD")
  113. this.getData()
  114. });
  115. },
  116. endDateOpen() {
  117. this.$refs.endDateRef.open();
  118. },
  119. // startDateFormatter(type, value) {
  120. // if (type === 'year') {
  121. // return `${value}年`
  122. // }
  123. // if (type === 'month') {
  124. // return `${value}月`
  125. // }
  126. // if (type === 'day') {
  127. // return `${value}日`
  128. // }
  129. // return value
  130. // },
  131. // endDateFormatter(type, value) {
  132. // console.log(type, value, "======endDateFormatter=======")
  133. // if (type === 'year') {
  134. // return `${value}年`
  135. // }
  136. // if (type === 'month') {
  137. // return `${value}月`
  138. // }
  139. // if (type === 'day') {
  140. // return `${value}日`
  141. // }
  142. // return value
  143. // }
  144. }
  145. }
  146. </script>
  147. <style lang="scss" scoped>
  148. * {
  149. box-sizing: border-box;
  150. margin: 0;
  151. padding: 0;
  152. }
  153. .promotionRecord {
  154. width: 100vw;
  155. height: 100vh;
  156. .frame {
  157. width: 100%;
  158. //height: calc(100vh - 220rpx);
  159. padding: 28rpx 28rpx 0 28rpx;
  160. .title {
  161. font-size: 34rpx;
  162. color: #333;
  163. font-weight: 700
  164. }
  165. .search {
  166. display: flex;
  167. align-items: center;
  168. gap: 10rpx;
  169. width: 100%;
  170. height: 80rpx;
  171. margin-top: 20rpx;
  172. .dateTimeCls {
  173. display: flex;
  174. align-items: center;
  175. justify-content: space-between;
  176. width: 25%;
  177. height: 80%;
  178. border: 1px solid #b0b2b3;
  179. padding: 5rpx;
  180. border-radius: 20rpx;
  181. .date {
  182. font-size: 25rpx;
  183. display: flex;
  184. align-items: center;
  185. width: 80%;
  186. height: 100%;
  187. color: #b0b2b3;
  188. }
  189. .image {
  190. width: 20%;
  191. height: 100%;
  192. }
  193. }
  194. }
  195. .publishListClass {
  196. margin-top: 10rpx;
  197. height: 78vh;
  198. overflow: auto;
  199. width: 100%;
  200. }
  201. }
  202. }
  203. </style>