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

290 lines
6.4 KiB

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