earningsList.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368
  1. <template>
  2. <view class="page">
  3. <!-- #ifdef H5-->
  4. <uni-nav-bar v-if="!$isWxBrowser()" :fixed="true" background-color="#FFE05C" :border="false" :statusBar="false"
  5. left-icon="left" title="收益记录" @clickLeft="back"/>
  6. <!-- #endif -->
  7. <mescroll-uni ref="mescrollRef" @init="mescrollInit" :height="height" :down="downOption" @down="downCallback"
  8. :up="upOption" @up="upCallback" @emptyclick="emptyClick">
  9. <view class="flex-col statistics">
  10. <view class="flex-row grid">
  11. <view class="flex-col gridItem">
  12. <view class="title flex-row justify-center">
  13. <text>累计奖励</text>
  14. </view>
  15. <view class="number flex-row justify-center">
  16. <text>{{ withdrawStaticsData.totalIncome }}</text>
  17. </view>
  18. </view>
  19. <view class="flex-col gridItem leftBorder">
  20. <view class="title flex-row justify-center">
  21. <text>累计提现</text>
  22. </view>
  23. <view class="number flex-row justify-center">
  24. <text>{{ withdrawStaticsData.totalWithdraw }}</text>
  25. </view>
  26. </view>
  27. <view class="flex-col gridItem leftBorder">
  28. <view class="title flex-row justify-center">
  29. <text>可提现</text>
  30. </view>
  31. <view class="number flex-row justify-center">
  32. <text>{{ withdrawStaticsData.canWithdraw }}</text>
  33. </view>
  34. </view>
  35. </view>
  36. <view class="flex-row justify-around">
  37. <view class="flex-row justify-center tixian" @click="navigateTo('/pages/withdraw/withdraw')">
  38. <text>去提现</text>
  39. <u-icon name="arrow-right" color="#000" size="14"></u-icon>
  40. </view>
  41. <view class="flex-row justify-center tixian" @click="navigateTo('/pages/withdrawalRecord/withdrawalRecord')">
  42. <text>提现记录</text>
  43. <u-icon name="arrow-right" color="#000" size="14"></u-icon>
  44. </view>
  45. </view>
  46. </view>
  47. <view class="bgColor">
  48. <view class="flex-row grid1">
  49. <view class="flex-col justify-evenly gridItem1">
  50. <view class="title flex-row justify-center">
  51. <text>累计拓客</text>
  52. </view>
  53. <view class="number1 flex-row justify-center">
  54. <text>{{ expandAppTotalData.totalExpand }}</text>
  55. </view>
  56. </view>
  57. <view class="flex-col justify-evenly gridItem1 leftBorder1">
  58. <view class="title flex-row justify-center">
  59. <text>用券人数</text>
  60. </view>
  61. <view class="number1 flex-row justify-center">
  62. <text>{{ expandAppTotalData.useCouponTotal }}</text>
  63. </view>
  64. </view>
  65. <view class="flex-col justify-evenly gridItem1 leftBorder1">
  66. <view class="title flex-row justify-center">
  67. <text>充值人数</text>
  68. </view>
  69. <view class="number1 flex-row justify-center">
  70. <text>{{ expandAppTotalData.rechargeTotal }}</text>
  71. </view>
  72. </view>
  73. <view class="flex-col justify-evenly gridItem1 leftBorder1">
  74. <view class="title flex-row justify-center">
  75. <text>消费次数累计</text>
  76. </view>
  77. <view class="number1 flex-row justify-center">
  78. <text>{{ expandAppTotalData.consume }}</text>
  79. </view>
  80. </view>
  81. </view>
  82. <view class="title-h1">
  83. <text>拓客数据(今日)</text>
  84. </view>
  85. <view class="flex-row grid1">
  86. <view class="flex-col justify-evenly gridItem1">
  87. <view class="title flex-row justify-center">
  88. <text>累计拓客</text>
  89. </view>
  90. <view class="number1 flex-row justify-center">
  91. <text>{{ expandAppTodayData.totalExpand }}</text>
  92. </view>
  93. </view>
  94. <view class="flex-col justify-evenly gridItem1 leftBorder1">
  95. <view class="title flex-row justify-center">
  96. <text>用券人数</text>
  97. </view>
  98. <view class="number1 flex-row justify-center">
  99. <text>{{ expandAppTodayData.useCouponTotal }}</text>
  100. </view>
  101. </view>
  102. <view class="flex-col justify-evenly gridItem1 leftBorder1">
  103. <view class="title flex-row justify-center">
  104. <text>充值人数</text>
  105. </view>
  106. <view class="number1 flex-row justify-center">
  107. <text>{{ expandAppTodayData.rechargeTotal }}</text>
  108. </view>
  109. </view>
  110. <view class="flex-col justify-evenly gridItem1 leftBorder1">
  111. <view class="title flex-row justify-center">
  112. <text>消费次数累计</text>
  113. </view>
  114. <view class="number1 flex-row justify-center">
  115. <text>{{ expandAppTodayData.consume }}</text>
  116. </view>
  117. </view>
  118. </view>
  119. <view class="title-h1">
  120. <text>间接拓客数据(今日)</text>
  121. </view>
  122. <view class="flex-row grid1">
  123. <view class="flex-col justify-evenly gridItem1">
  124. <view class="title flex-row justify-center">
  125. <text>累计拓客</text>
  126. </view>
  127. <view class="number1 flex-row justify-center">
  128. <text>{{ expandAppIndirectData.totalExpand }}</text>
  129. </view>
  130. </view>
  131. <view class="flex-col justify-evenly gridItem1 leftBorder1">
  132. <view class="title flex-row justify-center">
  133. <text>用券人数</text>
  134. </view>
  135. <view class="number1 flex-row justify-center">
  136. <text>{{ expandAppIndirectData.useCouponTotal }}</text>
  137. </view>
  138. </view>
  139. <view class="flex-col justify-evenly gridItem1 leftBorder1">
  140. <view class="title flex-row justify-center">
  141. <text>充值人数</text>
  142. </view>
  143. <view class="number1 flex-row justify-center">
  144. <text>{{ expandAppIndirectData.rechargeTotal }}</text>
  145. </view>
  146. </view>
  147. <view class="flex-col justify-evenly gridItem1 leftBorder1">
  148. <view class="title flex-row justify-center">
  149. <text>消费次数累计</text>
  150. </view>
  151. <view class="number1 flex-row justify-center">
  152. <text>{{ expandAppIndirectData.consume }}</text>
  153. </view>
  154. </view>
  155. </view>
  156. <view v-for="(key,index) in mapListCopy.keys()" :key="index">
  157. <view class="title-h1 flex-row" @click="clickKey(key)">
  158. <text>{{ key }}</text>
  159. <u-icon name="arrow-down" color="#000" size="16" v-if="selectDate == key"></u-icon>
  160. <u-icon name="arrow-right" color="#000" size="16" v-else></u-icon>
  161. </view>
  162. <view class="listItem" v-if="selectDate == key" v-for="(item,index) in mapListCopy.get(key)">
  163. <view class="flex-col listItemMsg">
  164. <view class="flex-row justify-between">
  165. <text class="memberNo">会员编号:{{ item.memberNo }}</text>
  166. <view class="flex-row justify-between msg" >
  167. <text>{{ item.remake }}</text>
  168. <text>{{ item.amount }}</text>
  169. </view>
  170. </view>
  171. <view class="flex-row justify-between">
  172. <text class="time">{{ item.createTime }}</text>
  173. <view v-if="item.remake == '充值'" class="time">当前可提现:{{ item.canWithdrawAmount }}</view>
  174. </view>
  175. </view>
  176. </view>
  177. </view>
  178. </view>
  179. <!-- <view class="flex-row justify-center seeMore">-->
  180. <!-- <text>查看更多</text>-->
  181. <!-- </view>-->
  182. </mescroll-uni>
  183. <!--#ifdef H5-->
  184. <liu-drag-button v-if="$isWxBrowser()" @clickBtn="back">返回</liu-drag-button>
  185. <!--#endif-->
  186. </view>
  187. </template>
  188. <script>
  189. import MescrollMixin from "@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js";
  190. import MescrollMoreItemMixin from "@/uni_modules/mescroll-uni/components/mescroll-uni/mixins/mescroll-more-item.js"
  191. export default {
  192. mixins: [MescrollMixin, MescrollMoreItemMixin], // 注意此处还需使用MescrollMoreItemMixin (必须写在MescrollMixin后面)
  193. components: {},
  194. data() {
  195. return {
  196. mapList: new Map(),
  197. mapListCopy: new Map(),
  198. selectDate: '',
  199. height: '',
  200. withdrawStaticsData: {},
  201. expandAppTotalData: {},
  202. expandAppTodayData: {},
  203. expandAppIndirectData: {},
  204. downOption: {
  205. auto: true // 不自动加载 (mixin已处理第一个tab触发downCallback)
  206. },
  207. upOption: {
  208. auto: true, // 自动加载
  209. // page: {
  210. // num: 0, // 当前页码,默认0,回调之前会加1,即callback(page)会从1开始
  211. // size: 10 // 每页数据的数量
  212. // },
  213. noMoreSize: 4, //如果列表已无数据,可设置列表的总数量要大于半页才显示无更多数据;避免列表数据过少(比如只有一条数据),显示无更多数据会不好看; 默认5
  214. empty: {
  215. icon: '/static/dataNull.png',
  216. tip: '暂无内容', // 提示
  217. // btnText: '去看看'
  218. },
  219. textNoMore: '没有更多了'
  220. },
  221. }
  222. },
  223. onLoad(e) {
  224. let sysInfo = uni.getSystemInfoSync()
  225. this.height = sysInfo.windowHeight - 70 + 'px' //除标题栏栏外的屏幕可用高度
  226. this.downCallback()
  227. },
  228. onShow() {
  229. this.withdrawStatics()
  230. this.expandAppTotal()
  231. this.expandAppToday()
  232. this.expandAppIndirect()
  233. },
  234. methods: {
  235. clickKey(key) {
  236. if (this.selectDate === key) {
  237. this.selectDate = ''
  238. } else {
  239. this.selectDate = key
  240. }
  241. },
  242. withdrawStatics() {
  243. this.$api.service.withdrawStatics().then(res => {
  244. this.withdrawStaticsData = res.data.data
  245. })
  246. },
  247. expandAppTotal() {
  248. this.$api.service.expandAppTotal().then(res => {
  249. this.expandAppTotalData = res.data.data
  250. })
  251. },
  252. expandAppToday() {
  253. this.$api.service.expandAppToday().then(res => {
  254. this.expandAppTodayData = res.data.data
  255. })
  256. },
  257. expandAppIndirect() {
  258. this.$api.service.expandAppIndirect().then(res => {
  259. this.expandAppIndirectData = res.data.data
  260. })
  261. },
  262. navigateTo(url) {
  263. uni.navigateTo({
  264. url: url
  265. })
  266. },
  267. back() {
  268. let pages = getCurrentPages()
  269. if (pages.length > 1) {
  270. uni.navigateBack({
  271. delta: 1,
  272. fail: err => {
  273. console.log(err)
  274. }
  275. })
  276. } else {
  277. uni.switchTab({
  278. url: '/pages/my/my'
  279. });
  280. }
  281. },
  282. /*下拉刷新的回调 */
  283. downCallback() {
  284. // 这里加载你想下拉刷新的数据, 比如刷新轮播数据
  285. // loadSwiper();
  286. // 下拉刷新的回调,默认重置上拉加载列表为第一页 (自动执行 page.num=1, 再触发upCallback方法 )
  287. this.mescroll.resetUpScroll()
  288. },
  289. /*上拉加载的回调: 其中page.num:当前页 从1开始, page.size:每页数据条数,默认10 */
  290. upCallback(page) {
  291. //联网加载数据
  292. let httpData = {
  293. pageNum: page.num,
  294. pageSize: 100
  295. }
  296. this.$api.service.getRecord(httpData).then((res) => {
  297. //联网成功的回调,隐藏下拉刷新和上拉加载的状态;
  298. this.mescroll.endSuccess(res.data.data.length, res.data.data.length === 100);
  299. //设置列表数据
  300. if (page.num === 1) this.mapList = new Map(); //如果是第一页需手动制空列表
  301. res.data.data.forEach(item => {
  302. let date = item.createTime.substring(0, 7)
  303. if (this.mapList.has(date)) {
  304. //键已存在
  305. this.mapList.get(date).push(item)
  306. } else {
  307. //键不存在
  308. this.mapList.set(date, [item])
  309. }
  310. })
  311. this.mapListCopy = new Map()
  312. this.mapListCopy = this.mapList
  313. if (page.num === 1) {
  314. const keys = Array.from(this.mapListCopy.keys());
  315. this.selectDate = keys[0];
  316. }
  317. console.log('++++++++++++++++++++++++', this.mapListCopy)
  318. }).catch((err) => {
  319. //联网失败, 结束加载
  320. this.mescroll.endErr();
  321. })
  322. },
  323. //点击空布局按钮的回调
  324. emptyClick() {
  325. uni.showToast({
  326. title: '点击了按钮,具体逻辑自行实现'
  327. })
  328. },
  329. }
  330. }
  331. </script>
  332. <style lang="scss" scoped>
  333. @import './index.rpx.css';
  334. </style>