建材商城系统20241014
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.

286 lines
6.4 KiB

7 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
7 months ago
6 months ago
6 months ago
7 months ago
6 months ago
7 months ago
6 months ago
7 months ago
6 months ago
6 months ago
7 months ago
6 months ago
7 months ago
7 months ago
7 months ago
6 months ago
7 months ago
6 months ago
7 months ago
6 months ago
7 months ago
6 months ago
6 months ago
6 months ago
7 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
7 months ago
6 months ago
  1. <template>
  2. <view class="running-water">
  3. <navbar :title="title[status]" leftClick @leftClick="leftClick"
  4. bgColor="#DC2828"
  5. color="#fff"
  6. />
  7. <view style="background-color: #DC2828;height: 150rpx;">
  8. </view>
  9. <view class="card-wrapper">
  10. <view class="card">
  11. <view class="card-section">
  12. <view class="amount-title">总佣金()</view>
  13. <view class="amount-value">¥ {{ info.lj_money }}</view>
  14. <!-- <view class="action-btn" @click="goWithdraw">提现</view> -->
  15. </view>
  16. <view class="card-divider"></view>
  17. <view class="card-section">
  18. <view class="amount-title">累计提现()</view>
  19. <view class="amount-value">¥ {{ info.lj_price }}</view>
  20. </view>
  21. </view>
  22. </view>
  23. <view class="date-filter">
  24. <text class="filter-title">金额明细</text>
  25. <view class="filter-actions">
  26. <view class="date-select" @click="openCalendar">
  27. <text class="date-text">{{queryParams.year || '全部'}} {{queryParams.month || ''}}</text>
  28. <uv-icon name="calendar" size="32rpx" color="#666"></uv-icon>
  29. </view>
  30. <view v-if="queryParams.year" class="reset-btn" @click="resetFilter">
  31. <uv-icon name="trash" size="28rpx" color="#999"></uv-icon>
  32. </view>
  33. </view>
  34. </view>
  35. <view class="tab-box">
  36. <view class="tab-box1" v-if="agentFlow.records.length>0 && agentFlow.total>0">
  37. <uv-cell center border :title="item.title" v-for="(item, index) in agentFlow.records" :key="item.id"
  38. :value="x[item.type] + item.money" :label="item.createTime" />
  39. </view>
  40. <view style="padding: 100rpx 0;" v-else>
  41. <uv-empty mode="history" textSize="28rpx" iconSize="100rpx" />
  42. </view>
  43. </view>
  44. <!-- 日历选择器 -->
  45. <uv-calendars
  46. ref="calendar"
  47. :insert="false"
  48. mode="year-month"
  49. color="#DC2828"
  50. @confirm="calendarConfirm"
  51. ></uv-calendars>
  52. </view>
  53. </template>
  54. <script>
  55. export default {
  56. data() {
  57. return {
  58. queryParams: {
  59. pageNo: 1,
  60. pageSize: 10,
  61. year: '',
  62. month: ''
  63. },
  64. title: ['余额记录', '提现记录', '佣金记录'],
  65. agentFlow: {
  66. total: 1,
  67. records: []
  68. },
  69. x: ['+', '-', '-', '+'],
  70. status: 0,
  71. info : {},
  72. }
  73. },
  74. onPullDownRefresh() {
  75. this.getAgentFlow()
  76. },
  77. onReachBottom() {
  78. this.loadMoreData()
  79. },
  80. onLoad(e) {
  81. this.status = e.status || 0;
  82. // 加载数据
  83. this.getAgentFlow();
  84. this.$store.commit('getUserInfo');
  85. this.getTeamInfo();
  86. },
  87. methods: {
  88. // 获取团队信息
  89. getTeamInfo() {
  90. this.$api('getTeamHeader', res => {
  91. if (res.code == 200) {
  92. this.info = res.result;
  93. }
  94. })
  95. },
  96. loadMoreData(){
  97. if(this.queryParams.pageSize < this.total){
  98. this.queryParams.pageSize += 10
  99. this.getAgentFlow()
  100. }
  101. },
  102. leftClick() { //返回钱包
  103. uni.navigateBack(-1)
  104. },
  105. getAgentFlow() { //获取流水记录
  106. let type = this.status;
  107. const params = {
  108. type,
  109. pageNo: this.queryParams.pageNo,
  110. pageSize: this.queryParams.pageSize
  111. };
  112. // 只有当年份有值时才添加年份筛选
  113. if (this.queryParams.year) {
  114. // 提取数字部分
  115. const year = this.queryParams.year.replace('年', '');
  116. params.year = year;
  117. // 如果月份有值,添加月份筛选
  118. if (this.queryParams.month) {
  119. const month = this.queryParams.month.replace('月', '');
  120. params.month = month;
  121. }
  122. }
  123. this.$api('getLogList', params, res => {
  124. if (res.code == 200) {
  125. this.agentFlow = res.result;
  126. }
  127. })
  128. },
  129. goWithdraw() {
  130. // 跳转到提现页面
  131. uni.navigateTo({
  132. url: '/pages_order/mine/withdraw'
  133. });
  134. },
  135. // 日历选择器相关方法
  136. openCalendar() {
  137. this.$refs.calendar.open();
  138. },
  139. calendarConfirm(e) {
  140. // 判断是否有值
  141. if (e.year && e.month) {
  142. this.queryParams.year = e.year + '年';
  143. this.queryParams.month = e.month + '月';
  144. } else {
  145. // 重置为全部
  146. this.queryParams.year = '';
  147. this.queryParams.month = '';
  148. }
  149. // 重置页码
  150. this.queryParams.pageNo = 1;
  151. // 更新数据
  152. this.getAgentFlow();
  153. },
  154. // 重置筛选
  155. resetFilter() {
  156. this.queryParams.year = '';
  157. this.queryParams.month = '';
  158. this.queryParams.pageNo = 1;
  159. this.getAgentFlow();
  160. }
  161. }
  162. }
  163. </script>
  164. <style lang="scss" scoped>
  165. .running-water {
  166. width: 750rpx;
  167. margin: 0 auto;
  168. min-height: 100vh;
  169. position: relative;
  170. background: #F5F5F5;
  171. .card-wrapper {
  172. position: relative;
  173. padding: 0 30rpx;
  174. margin-top: -90rpx;
  175. z-index: 10;
  176. .card {
  177. display: flex;
  178. background-color: #fff;
  179. border-radius: 20rpx;
  180. box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.08);
  181. overflow: hidden;
  182. .card-section {
  183. flex: 1;
  184. display: flex;
  185. flex-direction: column;
  186. align-items: center;
  187. padding: 30rpx 0;
  188. .amount-title {
  189. font-size: 28rpx;
  190. color: #666;
  191. margin-bottom: 16rpx;
  192. }
  193. .amount-value {
  194. font-size: 42rpx;
  195. font-weight: bold;
  196. color: #DC2828;
  197. margin-bottom: 30rpx;
  198. }
  199. .action-btn {
  200. width: 160rpx;
  201. height: 70rpx;
  202. line-height: 70rpx;
  203. text-align: center;
  204. border: 1px solid #DC2828;
  205. color: #DC2828;
  206. font-size: 28rpx;
  207. border-radius: 35rpx;
  208. }
  209. }
  210. .card-divider {
  211. width: 1px;
  212. background-color: #eee;
  213. }
  214. }
  215. }
  216. .date-filter {
  217. display: flex;
  218. align-items: center;
  219. justify-content: space-between;
  220. margin: 0 20rpx;
  221. margin-top: 30rpx;
  222. padding: 30rpx;
  223. background-color: #fff;
  224. border-radius: 10rpx;
  225. .filter-title {
  226. font-size: 28rpx;
  227. color: #333;
  228. font-weight: 500;
  229. }
  230. .filter-actions {
  231. display: flex;
  232. align-items: center;
  233. }
  234. .date-select {
  235. display: flex;
  236. align-items: center;
  237. padding: 12rpx 20rpx;
  238. border: 1px solid #ddd;
  239. border-radius: 8rpx;
  240. .date-text {
  241. margin-right: 10rpx;
  242. font-size: 26rpx;
  243. color: #333;
  244. }
  245. }
  246. .reset-btn {
  247. margin-left: 20rpx;
  248. padding: 12rpx;
  249. }
  250. }
  251. .tab-box {
  252. margin: 20rpx;
  253. background-color: #fff;
  254. border-radius: 20rpx;
  255. overflow: hidden;
  256. }
  257. }
  258. </style>