withdraw.vue 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212
  1. <template>
  2. <view>
  3. <u-navbar title="提现"></u-navbar>
  4. <view class="withdraw">
  5. <view class="withdraw-head">
  6. <b>提现至</b><span>{{code}}</span>
  7. </view>
  8. <view class="withdraw-head">
  9. <b>上次提现时间</b><span>{{info.startTime}}</span>
  10. </view>
  11. <view class="withdraw-head">
  12. <b>本次提现时间</b><span>{{info.endTime}}</span>
  13. </view>
  14. <view class="withdraw-head">
  15. <b>此期间累计产生订单数</b><span>{{info.total}}笔</span>
  16. </view>
  17. <view class="withdraw-head">
  18. <b>此期间总分润金额</b><span>{{info.amount?info.amount:0}}元</span>
  19. </view>
  20. <view class="withdraw-main" v-if="false">
  21. <p>申请提现金额(元)</p>
  22. <view class="withdraw-input">
  23. <span>¥</span>
  24. <u-input v-model="value" :type="type" placeholder-style="font-size:28px;height:40px;line-height:40px;color:#ccc;" />
  25. </view>
  26. </view>
  27. <view class="withdraw-foot" v-if="false">
  28. <p>可提现余额 ¥{{home.accountBalance}}</p>
  29. <span @click="value=home.accountBalance">全部提现</span>
  30. </view>
  31. </view>
  32. <view class="applyBtn">
  33. <u-button :class="{
  34. 'applyBtn-btn':!info.amount
  35. }" @click="submit()" type="primary">申请提现,7日内到账</u-button>
  36. </view>
  37. <view class="withdraw-tips">
  38. <h4>提现说明:</h4>
  39. <p>由于银行清算,提现申请将于次日内到账。如遇高峰期,可能延时到账,请耐心等待。</p>
  40. </view>
  41. </view>
  42. </template>
  43. <script>
  44. import * as API from '@/apis/finance.js'
  45. import {
  46. parseUnixTime,
  47. substrMb
  48. } from '@/utils'
  49. export default {
  50. data() {
  51. return {
  52. info:{},
  53. code:"",
  54. value: '',
  55. type: 'number',
  56. nowTime:"",
  57. home:{
  58. accountBalance:0
  59. },
  60. }
  61. },
  62. onReady() {
  63. //this.getHomePage()
  64. },
  65. onShow(){
  66. this.nowTime=parseUnixTime(new Date())
  67. this.getHomePage()
  68. },
  69. methods: {
  70. submit(){
  71. //this.value=this.info.amount
  72. if(!this.info.amount){
  73. uni.showToast({
  74. title: "可提现金额为0"
  75. })
  76. return
  77. }
  78. uni.showLoading({
  79. title: "加载中",
  80. mask: true,
  81. })
  82. API.applyWithdraw(this.info).then((res) => {
  83. uni.redirectTo({
  84. url:"/pagesFinance/user/applyResult?value="+this.value
  85. })
  86. }).catch(error => {
  87. uni.showToast({
  88. title: error
  89. })
  90. })
  91. },
  92. queryWithdrawInfo(){
  93. uni.showLoading({
  94. title: "加载中",
  95. mask: true,
  96. })
  97. API.queryWithdrawInfo().then((res) => {
  98. this.info=res.data;
  99. uni.hideLoading()
  100. }).catch(error => {
  101. uni.showToast({
  102. title: error
  103. })
  104. })
  105. },
  106. getHomePage(){
  107. uni.showLoading({
  108. title: "加载中",
  109. mask: true,
  110. })
  111. API.homePage().then((res) => {
  112. this.home = res.data
  113. var bankCard="";
  114. if(this.home.bankCard){
  115. bankCard=substrMb(this.home.bankCard,0,4)+"****"+substrMb(this.home.bankCard,8,4)
  116. }
  117. this.code=this.home.bank+":"+bankCard;
  118. if(this.home.bank==null&&this.home.bankCard==null){
  119. this.code="未绑定"
  120. }
  121. uni.hideLoading()
  122. this.queryWithdrawInfo()
  123. }).catch(error => {
  124. uni.showToast({
  125. title: error
  126. })
  127. })
  128. }
  129. }
  130. }
  131. </script>
  132. <style>
  133. page{
  134. background-color: #F7F7F7;
  135. }
  136. </style>
  137. <style lang="scss" scoped>
  138. .withdraw-tips{
  139. margin:24px 16px;
  140. p{
  141. color:#999;
  142. margin-top: 4px;
  143. }
  144. }
  145. .withdraw{
  146. margin: 16px;
  147. background-color: #fff;
  148. padding: 16px;
  149. .withdraw-head{
  150. // margin: 16px 0;
  151. padding: 16px 0;
  152. border-bottom: 1px solid #f7f7f7;
  153. align-items: center;
  154. b{
  155. color:#999;
  156. }
  157. span{
  158. margin-left: 12px;
  159. float: right;
  160. }
  161. }
  162. .withdraw-main{
  163. border-top: 1px solid #f7f7f7;
  164. border-bottom: 1px solid #f7f7f7;
  165. margin: 16px 0;
  166. padding: 16px 0;
  167. .withdraw-input{
  168. margin-top: 32px;
  169. display: flex;
  170. align-items: center;
  171. font-size: 28px;
  172. /deep/.uni-input-input{
  173. font-size: 28px;
  174. }
  175. }
  176. }
  177. .withdraw-foot{
  178. display: flex;
  179. align-items: center;
  180. p{
  181. color:#999
  182. }
  183. span{
  184. color:#2979FF;
  185. margin-left: 16px;
  186. }
  187. }
  188. }
  189. .applyBtn{
  190. margin: 16px;
  191. }
  192. .applyBtn-btn{
  193. background-color: #185AC6;
  194. opacity: 0.5;
  195. border-color:#185AC6 ;
  196. border-radius: 8px;
  197. }
  198. </style>