applywithdraw.vue 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253
  1. <template>
  2. <view style="position: relative;">
  3. <!-- 胶囊 -->
  4. <mvBar :mysNavConfig="mysNavConfig"></mvBar>
  5. <view :style="{marginTop:navH}"></view>
  6. <view class="show-form">
  7. <view class="show-form-cell" v-if="activeRadio == '银行卡'">
  8. <view class="show-form-cell-left">
  9. <p>银行卡号</p>
  10. </view>
  11. <view style="display: flex;justify-content: space-between;width: 550rpx;">
  12. <view>
  13. <p>{{formData.bank_card_number}}</p>
  14. </view>
  15. <view style="display: flex;align-items: center;justify-content: center;" @click="toModifyBank()">
  16. <p v-if="!binded">前往绑定</p>
  17. <p v-else>前往修改</p>
  18. <image class="show-body1-icon" :src="picture.icon_right"></image>
  19. </view>
  20. </view>
  21. </view>
  22. <view class="show-form-cell">
  23. <view class="show-form-cell-left">
  24. <view class="show-form-cell-left1">
  25. <p>提现金额</p>
  26. </view>
  27. <p>{{showTotalAmount}}</p>
  28. </view>
  29. <view>
  30. <p>元</p>
  31. </view>
  32. </view>
  33. <view class="show-form-cell">
  34. <view class="show-form-cell-left">
  35. <view class="show-form-cell-left1">
  36. <p>实际金额</p>
  37. </view>
  38. <p>{{showRealAmount}}</p>
  39. </view>
  40. <view>
  41. <p>元</p>
  42. </view>
  43. </view>
  44. <view class="tips">
  45. <p>*根据国家法规,平台需代扣代缴5%个人所得税</p>
  46. <p>*预计5个工作日到账,法定节假日顺延</p>
  47. </view>
  48. <view class="withdraw-btn">
  49. <button type="default" class="btn1" @click="withdraw()">
  50. 确认提现</button>
  51. </view>
  52. </view>
  53. </view>
  54. </template>
  55. <script>
  56. import mvBar from "@/components/mys_navBar/mysNavBar";
  57. import {
  58. money
  59. } from '@/components/utils.js';
  60. export default {
  61. components: {
  62. mvBar,
  63. },
  64. data() {
  65. return {
  66. binded: false,
  67. navH: getApp().globalData.navHeight,
  68. picture: getApp().globalData.picture,
  69. bankType: 1,
  70. incomeIdList: [],
  71. totalAmount: 0,
  72. realAmount: 0,
  73. showRealAmount: 0,
  74. showTotalAmount: 0,
  75. activeRadio: "银行卡",
  76. radioGroup: ['支付宝', '银行卡'],
  77. formData: {},
  78. mysNavConfig: {
  79. /* 开启单页显示首页图标 */
  80. isHome: true,
  81. /* 固定导航 */
  82. navFixed: true,
  83. /* 标题 (屏幕中心居中 两边图标中心居中使用slot center1) */
  84. navTitle: {
  85. text: "申请提现",
  86. color: "",
  87. fontSize: "32rpx", // px upx rpx
  88. fontWeight: "normal", // 100 - 700
  89. },
  90. btnType: "type2",
  91. onLeftClick: "",
  92. /* type2 按钮 */
  93. type2Config: {
  94. // 左图标
  95. leftPath: "/static/img/png2.png",
  96. // 右图标
  97. rightPath: "/static/img/png4.png",
  98. // 圆角
  99. radius: "40rpx",
  100. },
  101. },
  102. }
  103. },
  104. onLoad(options) {
  105. let data = options.textObj.replace(/""/g, "");
  106. data = JSON.parse(decodeURIComponent(data))
  107. this.incomeIdList = data.incomeIdList
  108. this.totalAmount = data.totalAmount
  109. this.realAmount = (data.totalAmount * 0.95).toFixed(2)
  110. this.showTotalAmount = money(this.totalAmount)
  111. this.showRealAmount = money(this.realAmount)
  112. },
  113. async onShow() {
  114. await this.getInfo()
  115. this.getBankInfo()
  116. },
  117. methods: {
  118. chan(e) {
  119. if (e.detail.value == "支付宝")
  120. this.bankType = 1
  121. else
  122. this.bankType = 2
  123. this.activeRadio = e.detail.value;
  124. console.log(this.activeRadio);
  125. },
  126. // 默认信息表,获取平台logo
  127. getInfo() {
  128. return this.$https.get('/youngee/c/g/get-info-tables')
  129. .then(res => {
  130. this.array1 = res.data.data.Bank
  131. })
  132. },
  133. getBankInfo() {
  134. this.$https.get('/youngee/c/t/g/get-talent-bank-info')
  135. .then(res => {
  136. console.log(res)
  137. if (res.data.data != null) {
  138. this.binded = true
  139. this.formData = res.data.data
  140. }else{
  141. this.binded = false
  142. }
  143. })
  144. },
  145. withdraw() {
  146. if(!this.binded){
  147. uni.showToast({
  148. title: "请先绑定银行卡信息",
  149. icon: 'none'
  150. })
  151. return
  152. }
  153. this.$https.post('/youngee/c/t/p/withdraw', {
  154. income_id_list: this.incomeIdList,
  155. total_amount: this.totalAmount,
  156. real_amount: this.realAmount,
  157. bank_type: 2,
  158. })
  159. .then(res => {
  160. console.log(res)
  161. let pages = getCurrentPages(); // 当前页面
  162. let beforePage = pages[pages.length - 2]; // 上一页
  163. setTimeout(() => {
  164. uni.navigateBack({
  165. success: function() {
  166. beforePage
  167. .onLoad(); // 执行上一页的onLoad方法
  168. }
  169. })
  170. uni.navigateBack()
  171. })
  172. })
  173. },
  174. toModifyBank() {
  175. uni.navigateTo({
  176. url: '/page_mycenter/myinformation/mybank'
  177. });
  178. },
  179. toModifyZhifubao() {
  180. uni.navigateTo({
  181. url: '/page_mycenter/myinformation/myzhifubao'
  182. });
  183. }
  184. }
  185. }
  186. </script>
  187. <style lang="scss" scoped>
  188. p {
  189. font-size: 32rpx;
  190. }
  191. .show-form {
  192. margin: 0 25rpx;
  193. }
  194. .show-form-cell {
  195. display: flex;
  196. justify-content: space-between;
  197. align-items: center;
  198. }
  199. .show-form-cell-left {
  200. display: flex;
  201. margin: 30rpx 0;
  202. }
  203. .show-form-cell-left1 {
  204. width: 150rpx;
  205. }
  206. .tips {
  207. margin: 30rpx 0;
  208. padding: 30rpx 20rpx;
  209. background-color: #eaeaea;
  210. border-radius: 15rpx;
  211. }
  212. .tips p {
  213. font-size: 28rpx;
  214. }
  215. .withdraw-btn {
  216. display: flex;
  217. align-items: center;
  218. width: 100%;
  219. position: fixed;
  220. bottom: 0rpx;
  221. display: flex;
  222. height: 100rpx;
  223. padding-top: 2%;
  224. }
  225. .btn1 {
  226. width: 60%;
  227. background-color: #f2d22d;
  228. color: #000;
  229. border-color: #ffffff;
  230. border-radius: 10rpx;
  231. font-size: 36rpx;
  232. line-height: 240%;
  233. letter-spacing: 10rpx;
  234. font-weight: 500;
  235. height: 80%;
  236. }
  237. .show-body1-icon {
  238. width: 30rpx;
  239. height: 30rpx;
  240. }
  241. </style>