珠宝小程序前端代码
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.

238 lines
5.4 KiB

5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
  1. <template>
  2. <view class="running-water">
  3. <!-- 导航栏 -->
  4. <navbar title="金额记录" leftClick @leftClick="$utils.navigateBack" bgColor="#E3441A" color="#fff" />
  5. <view class="bg"></view>
  6. <view class="money-info-wrapper">
  7. <view class="money-info">
  8. <view class="total-brokerage">
  9. <view class="title">总佣金</view>
  10. <view class="total-money">1240.00</view>
  11. <view class="btn">
  12. <view @click="$utils.navigateTo('/pages_order/mine/withdraw')" class="">
  13. 提现
  14. </view>
  15. </view>
  16. </view>
  17. <view class="total-withdraw">
  18. <view class="title">累计提现</view>
  19. <view class="total-money">15300.00</view>
  20. <view class="btn">
  21. <view class="">
  22. 提现记录
  23. </view>
  24. </view>
  25. </view>
  26. </view>
  27. </view>
  28. <view class="date-select">
  29. <view class="select-title">
  30. 金额明细
  31. </view>
  32. <view class="year-info">
  33. <view @click="openCalendars" class="time-unit">
  34. {{ beforeYear }}
  35. <uv-icon name="arrow-down-fill"></uv-icon>
  36. </view>
  37. <view @click="openCalendars" class="time-unit">
  38. {{ beforeMonth }}
  39. <uv-icon name="arrow-down-fill"></uv-icon>
  40. </view>
  41. <text class="interval"></text>
  42. <view @click="openCalendars" class="time-unit">
  43. {{ afterYear }}
  44. <uv-icon name="arrow-down-fill"></uv-icon>
  45. </view>
  46. <view @click="openCalendars" class="time-unit">
  47. {{ afterMonth }}
  48. <uv-icon name="arrow-down-fill"></uv-icon>
  49. </view>
  50. </view>
  51. </view>
  52. <view class="tab-box">
  53. <view class="tab-box1" v-if="list && total">
  54. <uv-cell center border :title="item.title" v-for="(item, index) in list" :key="index"
  55. :value="x[item.type] + item.money" :label="item.createTime" />
  56. </view>
  57. <view style="padding: 100rpx 0;" v-else>
  58. <uv-empty mode="history" textSize="28rpx" iconSize="100rpx" />
  59. </view>
  60. </view>
  61. <Calendars ref="calendars" @select="handleSelectCalendars"></Calendars>
  62. </view>
  63. </template>
  64. <script>
  65. import mixinsList from "@/mixins/list.js"
  66. import Calendars from "@/components/calendars/index.vue"
  67. export default {
  68. mixins: [mixinsList],
  69. components: {
  70. Calendars
  71. },
  72. data() {
  73. return {
  74. x: ['+', '-', '-', '+'],
  75. mixinsListApi: "getWaterPageList",
  76. beforeYear: new Date().getFullYear(), //开始年
  77. afterYear: new Date().getFullYear(), //结束年
  78. beforeMonth: new Date().getMonth() + 1 < 9 ? '' + new Date().getMonth() + 1 : new Date().getMonth() +
  79. 1, //开始月
  80. afterMonth: new Date().getMonth() + 1 < 9 ? '' + new Date().getMonth() + 1 : new Date().getMonth() +
  81. 1, //开始月, //结束月
  82. }
  83. },
  84. methods: {
  85. //打开日历
  86. openCalendars() {
  87. if (this?.$refs?.calendars) {
  88. this.$refs.calendars.open();
  89. }
  90. },
  91. // 选择了日期
  92. handleSelectCalendars(day) {
  93. let beforeDate = this.getYearMonth(day?.range?.before)
  94. let afterDate = this.getYearMonth(day?.range?.after)
  95. this.beforeYear = beforeDate.year;
  96. this.beforeMonth = beforeDate.month;
  97. this.afterYear = afterDate.year;
  98. this.afterMonth = afterDate.month;
  99. },
  100. //获取开始年、月
  101. getYearMonth(time) {
  102. if (!time) {
  103. time = new Date().toString()
  104. }
  105. let data = new Date(time.replace(/-/g, '/'));
  106. let year = data.getFullYear();
  107. let month = data.getMonth() + 1;
  108. return {
  109. year: data.getFullYear(),
  110. month: month < 9 ? '0' + month : month
  111. }
  112. },
  113. }
  114. }
  115. </script>
  116. <style lang="scss" scoped>
  117. .running-water {
  118. width: 750rpx;
  119. background: #F5F5F5;
  120. margin: 0 auto;
  121. min-height: 100vh;
  122. .bg {
  123. background: $uni-color;
  124. padding: 100rpx 0rpx;
  125. box-sizing: border-box;
  126. }
  127. .money-info-wrapper {
  128. padding: 0rpx 20rpx;
  129. box-sizing: border-box;
  130. background: white;
  131. height: 130rpx;
  132. .money-info {
  133. display: flex;
  134. flex-wrap: wrap;
  135. background: white;
  136. border-radius: 20rpx;
  137. overflow: hidden;
  138. transform: translateY(-60%);
  139. box-shadow: 0rpx 0rpx 10rpx rgba(0, 0, 0, .1);
  140. .total-brokerage,
  141. .total-withdraw {
  142. width: 50%;
  143. text-align: center;
  144. padding: 20rpx 0rpx;
  145. .title {
  146. font-size: 34rpx;
  147. }
  148. .total-money {
  149. color: $uni-color;
  150. font-size: 36rpx;
  151. margin: 20rpx 0rpx;
  152. }
  153. .btn {
  154. display: flex;
  155. justify-content: center;
  156. align-items: center;
  157. view {
  158. width: 40%;
  159. border: 1px solid $uni-color;
  160. padding: 10rpx;
  161. color: $uni-color;
  162. border-radius: 10rpx;
  163. }
  164. }
  165. }
  166. }
  167. }
  168. .date-select {
  169. padding: 0rpx 20rpx;
  170. box-sizing: border-box;
  171. background: white;
  172. padding-bottom: 20rpx;
  173. display: flex;
  174. justify-content: space-between;
  175. .select-title {}
  176. .year-info {
  177. display: flex;
  178. color: $uni-color;
  179. font-size: 26rpx;
  180. .time-unit {
  181. display: flex;
  182. align-items: center;
  183. justify-content: space-between;
  184. border: 1px solid $uni-color;
  185. margin: 0rpx 10rpx;
  186. border-radius: 10rpx;
  187. box-sizing: border-box;
  188. padding: 7rpx 12rpx;
  189. &::v-deep .uv-icon {
  190. display: flex;
  191. align-items: center;
  192. }
  193. &::v-deep .uv-icon__icon {
  194. color: $uni-color !important;
  195. margin-left: 5rpx;
  196. font-size: 20rpx !important;
  197. }
  198. }
  199. .interval {
  200. display: flex;
  201. align-items: center;
  202. }
  203. }
  204. }
  205. .tab-box {
  206. margin: 20rpx;
  207. background-color: #fff;
  208. border-radius: 20rpx;
  209. overflow: hidden;
  210. }
  211. }
  212. </style>