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.

402 lines
8.3 KiB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
  1. <template>
  2. <view class="app-container" style="background-color: #f7f7f7;">
  3. <view class="agent-content">
  4. <view class="ag-sign" @click="cashManager">
  5. 提现历史
  6. </view>
  7. <view class="agent-top">
  8. <view class="ag-num">
  9. <view class="au-font">
  10. </view>
  11. <view class="au-num">
  12. {{accountInfo.wallet_balance}}
  13. </view>
  14. </view>
  15. <view class="age-font">
  16. 可提现
  17. </view>
  18. <view class="age-line">
  19. <img src="../../static/page/line-style.png" style="width: 200rpx;height: 2rpx;" alt="" srcset="" />
  20. </view>
  21. <view class="age-wait">
  22. 总提现{{accountInfo.withdraw_total}}
  23. </view>
  24. <view class="age-linemore">
  25. <img src="../../static/page/divider-style.png" style="width: 690rpx;height: 2rpx;" alt="" srcset="" />
  26. </view>
  27. <div class="age-mnum">
  28. <view class="mtext">
  29. 待入账{{accountInfo.waiting_amount}}
  30. </view>
  31. <view class="mline">
  32. </view>
  33. <view class="mtext">
  34. 提现中{{accountInfo.withdrawing_amount}}
  35. </view>
  36. </div>
  37. </view>
  38. <view class="ag-paylist">
  39. <view class="agp-item">
  40. <view class="agp-title">
  41. <view class="zhifubao">
  42. 支付宝账户
  43. </view>
  44. </view>
  45. <view class="agp-detail" v-if="!accountInfo.alipay_account">
  46. <view class="agp-make" @click="showInputForm(1)">
  47. 去开通
  48. </view>
  49. </view>
  50. </view>
  51. <template v-if="isInputForm">
  52. <view class="apt-main u-border-top u-border-bottom" v-if="isInputForm">
  53. <view class="apm-cell">
  54. <view class="am-title">
  55. 支付宝账号
  56. </view>
  57. <view class="am-value" style="width:70%;">
  58. <u--input placeholder="绑定的手机号或邮箱" border="surround" v-model="inputAlipayAccount"></u--input>
  59. </view>
  60. </view>
  61. <view class="apm-cell">
  62. <view class="am-title">
  63. 支付宝姓名
  64. </view>
  65. <view class="am-value" style="width:70%;">
  66. <u--input placeholder="账号真实姓名" border="surround" v-model="inputAlipayName"></u--input>
  67. </view>
  68. </view>
  69. </view>
  70. <view class="apt-btn">
  71. <view class="savebtn" @click="saveAlipayAccount">
  72. 保存
  73. </view>
  74. </view>
  75. </template>
  76. <template v-if="accountInfo.alipay_account && !isInputForm">
  77. <view class="apt-main u-border-top u-border-bottom">
  78. <view class="apm-cell">
  79. <view class="am-title">
  80. 提现账户
  81. </view>
  82. <view class="am-value">
  83. <view class="mphone">
  84. {{accountInfo.alipay_account}}
  85. </view>
  86. <view class="mlink" @click="showInputForm(2)">
  87. 修改
  88. </view>
  89. </view>
  90. </view>
  91. <view class="apm-cell">
  92. <view class="am-title">
  93. 可提现金额
  94. </view>
  95. <view class="am-value">
  96. <view class="mnum">
  97. {{accountInfo.wallet_balance}}
  98. </view>
  99. </view>
  100. </view>
  101. </view>
  102. <view class="apt-btn">
  103. <view class="cashbtn" @click="showWithdrawForm">
  104. 提现
  105. </view>
  106. </view>
  107. </template>
  108. </view>
  109. </view>
  110. <u-modal title="确认提现金额" :show="isWithdrawForm" :showCancelButton="true" @confirm="confirmWithdraw" @cancel="isWithdrawForm=false">
  111. <view class="slot-content">
  112. <u--input prefixIcon="¥" placeholder="提现金额" border="surround" v-model="withdrawAmount"></u--input>
  113. </view>
  114. </u-modal>
  115. </view>
  116. </template>
  117. <script>
  118. import {
  119. userAccountInfo,
  120. userFillAlipayAccount,
  121. userWithdraw
  122. } from '../../common/api.js'
  123. export default {
  124. data() {
  125. return {
  126. accountInfo: {},
  127. isInputForm: false,
  128. inputAlipayAccount: '',
  129. inputAlipayName: '',
  130. isWithdrawForm: false,
  131. withdrawAmount: ''
  132. }
  133. },
  134. onLoad() {
  135. this.getAccountInfo();
  136. },
  137. methods: {
  138. getAccountInfo() {
  139. userAccountInfo().then(data => this.accountInfo = data)
  140. },
  141. saveAlipayAccount() {
  142. userFillAlipayAccount({
  143. alipay_account: this.inputAlipayAccount,
  144. alipay_name: this.inputAlipayName,
  145. }).then(() => {
  146. this.getAccountInfo()
  147. this.isInputForm = false
  148. })
  149. },
  150. showInputForm(flag) {
  151. this.isInputForm = true
  152. if (flag == 2) {
  153. this.inputAlipayAccount = this.accountInfo.alipay_account
  154. this.inputAlipayName = this.accountInfo.alipay_name
  155. }
  156. // uni.navigateTo({
  157. // url: '/pages/account-opened/account-opened'
  158. // });
  159. },
  160. showWithdrawForm() {
  161. this.isWithdrawForm = true
  162. this.withdrawAmount = this.accountInfo.wallet_balance
  163. },
  164. confirmWithdraw() {
  165. userWithdraw({
  166. amount: this.accountInfo.wallet_balance
  167. }).then(() => {
  168. this.isWithdrawForm = false
  169. })
  170. },
  171. cashManager() {
  172. uni.navigateTo({
  173. url: '/pages/withdrawal-history/withdrawal-history'
  174. });
  175. }
  176. }
  177. }
  178. </script>
  179. <style lang="scss">
  180. .uni-page-body {
  181. background: #f7f7f7;
  182. }
  183. .agent-content {
  184. position: relative;
  185. width: 100%;
  186. height: 1400rpx;
  187. background: url(../../static/page/merchant-account-opening-bg.png) no-repeat top center;
  188. background-size: 100% 414rpx;
  189. box-sizing: border-box;
  190. .ag-sign {
  191. position: absolute;
  192. right: 0;
  193. top: 0;
  194. width: 150rpx;
  195. height: 60rpx;
  196. line-height: 60rpx;
  197. padding-left: 40rpx;
  198. border-top-left-radius: 30rpx;
  199. border-bottom-left-radius: 30rpx;
  200. color: #fff;
  201. font-size: 12px;
  202. background: #FCC565;
  203. box-sizing: border-box;
  204. cursor: pointer;
  205. }
  206. .agent-top {
  207. text-align: center;
  208. padding-top: 40rpx;
  209. .ag-num {
  210. display: flex;
  211. justify-content: center;
  212. padding-top: 20rpx;
  213. color: #fff;
  214. .au-font {
  215. margin-top: 40rpx;
  216. font-size: 14px;
  217. margin-right: 10rpx;
  218. line-height: 1.5;
  219. }
  220. .au-num {
  221. font-size: 30px;
  222. font-weight: bold;
  223. }
  224. }
  225. .age-font {
  226. margin-top: 10rpx;
  227. font-size: 16px;
  228. line-height: 1.5;
  229. color: #fff;
  230. }
  231. .age-line {
  232. margin: 20rpx auto 0;
  233. width: 200rpx;
  234. height: 2rpx;
  235. img {
  236. display: block;
  237. margin: 0 auto;
  238. }
  239. }
  240. .age-wait {
  241. margin-top: 20rpx;
  242. color: #fff;
  243. font-size: 14px;
  244. }
  245. .age-linemore {}
  246. .age-mnum {
  247. display: flex;
  248. justify-content: center;
  249. align-items: center;
  250. margin-top: 20rpx;
  251. .mtext {
  252. color: #fff;
  253. font-size: 14px;
  254. margin: 0 20rpx;
  255. line-height: 1.5;
  256. }
  257. .mline {
  258. height: 28rpx;
  259. width: 2rpx;
  260. background: #F86E78;
  261. }
  262. }
  263. }
  264. .ag-paylist {
  265. padding-left: 30rpx;
  266. padding-right: 30rpx;
  267. margin-top: 36rpx;
  268. background: #fff;
  269. .agp-item {
  270. display: flex;
  271. justify-content: space-between;
  272. height: 100rpx;
  273. .agp-title {
  274. .zhifubao {
  275. padding-left: 55rpx;
  276. height: 100rpx;
  277. line-height: 100rpx;
  278. color: #454545;
  279. font-size: 14px;
  280. font-weight: bold;
  281. background: url(../../static/page/payment-icon.png) no-repeat left center;
  282. background-size: 40rpx 40rpx;
  283. }
  284. }
  285. .agp-detail {
  286. .agp-make {
  287. padding-right: 30rpx;
  288. height: 100rpx;
  289. line-height: 100rpx;
  290. color: #999;
  291. font-size: 12px;
  292. background: url(../../static/page/open-icon.png) no-repeat right center;
  293. background-size: 14rpx 24rpx;
  294. cursor: pointer;
  295. }
  296. }
  297. }
  298. }
  299. .apt-main {
  300. padding: 10rpx 0;
  301. .apm-cell {
  302. display: flex;
  303. justify-content: space-between;
  304. .am-title {
  305. height: 70rpx;
  306. line-height: 70rpx;
  307. color: 454545;
  308. font-size: 12px;
  309. }
  310. .am-value {
  311. display: flex;
  312. justify-content: flex-end;
  313. height: 70rpx;
  314. line-height: 70rpx;
  315. .mphone {
  316. margin-right: 20rpx;
  317. font-size: 12px;
  318. color: #454545;
  319. }
  320. .mlink {
  321. font-size: 12px;
  322. color: #32A2FC;
  323. }
  324. .mnum {
  325. font-size: 14px;
  326. color: 454545;
  327. font-weight: bold;
  328. }
  329. }
  330. }
  331. }
  332. .u-border-bottom,
  333. .u-border-top {
  334. border-color: #eee !important;
  335. }
  336. .apt-btn {
  337. display: flex;
  338. justify-content: flex-end;
  339. padding: 30rpx 0;
  340. .cashbtn {
  341. width: 110rpx;
  342. height: 48rpx;
  343. text-align: center;
  344. line-height: 48rpx;
  345. color: #fff;
  346. font-size: 12px;
  347. background: #F52F3E;
  348. border-radius: 100rpx;
  349. }
  350. .savebtn {
  351. width: 110rpx;
  352. height: 48rpx;
  353. text-align: center;
  354. line-height: 48rpx;
  355. color: #fff;
  356. font-size: 12px;
  357. background: #00aaff;
  358. border-radius: 100rpx;
  359. }
  360. }
  361. }
  362. </style>