敢为人鲜小程序前端代码仓库
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.

205 lines
4.5 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
  1. <template>
  2. <view class="page">
  3. <!-- 导航栏 -->
  4. <navbar title="提现记录" leftClick @leftClick="$utils.navigateBack" color="#fff" />
  5. <!-- <view class="tools">
  6. <uv-datetime-picker
  7. ref="datetimePicker"
  8. v-model="selectedTime"
  9. mode="year-month"
  10. confirmColor="#84A73F"
  11. @confirm="onTimeChange"
  12. ></uv-datetime-picker>
  13. </view> -->
  14. <view class="card list">
  15. <template v-if="list.length">
  16. <view class="flex list-item"
  17. v-for="(item, index) in list"
  18. :key="index"
  19. >
  20. <!-- <image class="list-item-icon" src="../static/runningWater/icon-commission.png" mode="widthFix"></image> -->
  21. <view class="list-item-info">
  22. <view class="highlight">佣金提现</view>
  23. <view class="time">{{ item.createTime }}</view>
  24. </view>
  25. <view class="list-item-value">{{ `-${item.amount}` }}</view>
  26. <view class="withdraw-btn"
  27. @click="withdraw(item)"
  28. v-if="item.status == 0">领取</view>
  29. </view>
  30. </template>
  31. <template v-else>
  32. <uv-empty mode="history" textSize="28rpx" iconSize="100rpx" />
  33. </template>
  34. </view>
  35. </view>
  36. </template>
  37. <script>
  38. import mixinsList from "@/mixins/list.js"
  39. export default {
  40. mixins: [mixinsList],
  41. data() {
  42. return {
  43. selectedTime: new Date(),
  44. x: ['+', '-', '-', '+'],
  45. mixinsListApi: "queryCashoutLog",//getWaterPageList
  46. beforeDate: new Date(), //开始日期
  47. afterDate: new Date(), //结束日期
  48. totalMoney : 0,
  49. totalWithdraw : 0,
  50. }
  51. },
  52. computed: {
  53. displaySelectedTime() {
  54. return this.$dayjs(this.selectedTime).format("YYYY年M月")
  55. }
  56. },
  57. methods: {
  58. //打开日历
  59. openCalendars() {
  60. if (this?.$refs?.calendars) {
  61. this.$refs.calendars.open();
  62. }
  63. },
  64. getDataThen(list, total, result){
  65. this.totalMoney = result.totalMoney
  66. this.totalWithdraw = result.totalWithdraw
  67. this.list = result.page.records
  68. this.total = result.page.total
  69. },
  70. openTimePicker() {
  71. this.$refs.datetimePicker.open();
  72. },
  73. onTimeChange(e) {
  74. // todo
  75. console.log('--onTimeChange', e)
  76. },
  77. withdraw(item){
  78. // 拉起微信收款确认页面
  79. if (!wx.canIUse('requestMerchantTransfer')) {
  80. wx.showModal({
  81. content: '你的微信版本过低,请更新至最新版本。',
  82. showCancel: false,
  83. });
  84. return
  85. }
  86. // 在真机环境中,调用API
  87. wx.requestMerchantTransfer({
  88. mchId: this.$config.mchId,
  89. appId: wx.getAccountInfoSync().miniProgram.appId,
  90. package: item.packageInfo,
  91. success: (res) => {
  92. uni.showToast({
  93. title: '提现申请已提交',
  94. icon: 'success'
  95. })
  96. this.$store.commit('getUserInfo')
  97. this.$store.commit('getRiceInfo')
  98. this.$api('getMoney', {
  99. id : item.id,
  100. }).then(res => {
  101. this.getData()
  102. })
  103. },
  104. fail: (res) => {
  105. console.log('fail:', res);
  106. uni.showToast({
  107. title: '提现失败,请稍后再试',
  108. icon: 'none'
  109. })
  110. },
  111. complete: (res) => {
  112. console.log('requestMerchantTransfer完成:', res);
  113. }
  114. });
  115. },
  116. }
  117. }
  118. </script>
  119. <style lang="scss" scoped>
  120. .page {
  121. background-color: #f5f6fa;
  122. min-height: 100vh;
  123. /deep/ .nav-bar__view {
  124. background-image: linear-gradient(135deg, #84A73F, #D8FF8F);
  125. box-shadow: 0 2px 8px rgba(132, 167, 63, 0.2);
  126. }
  127. }
  128. .withdraw-btn {
  129. padding: 12rpx 32rpx;
  130. margin: 0;
  131. font-size: 26rpx;
  132. margin-left: 20rpx;
  133. background: linear-gradient(135deg, #84A73F, #D8FF8F);
  134. color: #fff;
  135. border-radius: 30rpx;
  136. box-shadow: 0 2px 6px rgba(132, 167, 63, 0.2);
  137. transition: all 0.3s ease;
  138. &:active {
  139. transform: scale(0.95);
  140. opacity: 0.9;
  141. }
  142. }
  143. .list {
  144. margin: 20rpx;
  145. padding: 30rpx;
  146. background: #fff;
  147. border-radius: 16rpx;
  148. box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
  149. &-item {
  150. padding: 24rpx 0;
  151. border-bottom: 1rpx solid #f0f0f0;
  152. margin-bottom: 20rpx;
  153. font-size: 28rpx;
  154. display: flex;
  155. align-items: center;
  156. transition: all 0.3s ease;
  157. &:last-child {
  158. border-bottom: none;
  159. margin-bottom: 0;
  160. }
  161. &:active {
  162. background-color: #f9f9f9;
  163. }
  164. &-info {
  165. flex: 1;
  166. color: #666;
  167. .highlight {
  168. color: #333;
  169. font-weight: 500;
  170. margin-bottom: 8rpx;
  171. }
  172. .time {
  173. font-size: 24rpx;
  174. color: #999;
  175. }
  176. }
  177. &-value {
  178. color: #FF2A2A;
  179. font-weight: 500;
  180. margin: 0 20rpx;
  181. }
  182. }
  183. }
  184. </style>