applywithdraw.vue 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261
  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: {
  69. icon_person: 'https://horastar.obs.cn-east-3.myhuaweicloud.com/youngee/talent_upload/icon-person.png',
  70. icon_location: 'https://horastar.obs.cn-east-3.myhuaweicloud.com/youngee/talent_upload/icon-location.png',
  71. icon_account: 'https://horastar.obs.cn-east-3.myhuaweicloud.com/youngee/talent_upload/icon-account.png',
  72. icon_rmb: 'https://horastar.obs.cn-east-3.myhuaweicloud.com/youngee/talent_upload/icon-rmb.png',
  73. icon_message: 'https://horastar.obs.cn-east-3.myhuaweicloud.com/youngee/talent_upload/icon-message.png',
  74. icon_right: 'https://horastar.obs.cn-east-3.myhuaweicloud.com/talent_upload/icon-arrow-right.png',
  75. defaultavatarUrl: 'https://horastar.obs.cn-east-3.myhuaweicloud.com/talent/logoxin01.png',
  76. },
  77. bankType: 1,
  78. taskIdList: [],
  79. totalAmount: 0,
  80. realAmount: 0,
  81. showRealAmount: 0,
  82. showTotalAmount: 0,
  83. activeRadio: "银行卡",
  84. radioGroup: ['支付宝', '银行卡'],
  85. formData: {},
  86. mysNavConfig: {
  87. /* 开启单页显示首页图标 */
  88. isHome: true,
  89. /* 固定导航 */
  90. navFixed: true,
  91. /* 标题 (屏幕中心居中 两边图标中心居中使用slot center1) */
  92. navTitle: {
  93. text: "申请提现",
  94. color: "",
  95. fontSize: "32rpx", // px upx rpx
  96. fontWeight: "normal", // 100 - 700
  97. },
  98. btnType: "type2",
  99. onLeftClick: "",
  100. /* type2 按钮 */
  101. type2Config: {
  102. // 左图标
  103. leftPath: "/static/img/png2.png",
  104. // 右图标
  105. rightPath: "/static/img/png4.png",
  106. // 圆角
  107. radius: "40rpx",
  108. },
  109. },
  110. }
  111. },
  112. onLoad(options) {
  113. let data = options.textObj.replace(/""/g, "");
  114. data = JSON.parse(decodeURIComponent(data))
  115. this.taskIdList = data.taskIdList
  116. this.totalAmount = data.totalAmount
  117. this.realAmount = (data.totalAmount * 0.95).toFixed(2)
  118. this.showTotalAmount = money(this.totalAmount)
  119. this.showRealAmount = money(this.realAmount)
  120. },
  121. onShow() {
  122. this.getInfo()
  123. },
  124. methods: {
  125. chan(e) {
  126. if (e.detail.value == "支付宝")
  127. this.bankType = 1
  128. else
  129. this.bankType = 2
  130. this.activeRadio = e.detail.value;
  131. console.log(this.activeRadio);
  132. },
  133. // 默认信息表,获取平台logo
  134. getInfo() {
  135. this.$https.get('/youngee/c/g/get-info-tables')
  136. .then(res => {
  137. this.array1 = res.data.data.Bank
  138. })
  139. this.getBankInfo()
  140. },
  141. getBankInfo() {
  142. this.$https.get('/youngee/c/t/g/get-talent-bank-info')
  143. .then(res => {
  144. console.log(res)
  145. if (res.data.data != null) {
  146. this.binded = true
  147. this.formData = res.data.data
  148. }else{
  149. this.binded = false
  150. }
  151. })
  152. },
  153. withdraw() {
  154. if(!this.binded){
  155. uni.showToast({
  156. title: "请先绑定银行卡信息",
  157. icon: 'none'
  158. })
  159. return
  160. }
  161. this.$https.post('/youngee/c/t/p/withdraw', {
  162. task_id_list: this.taskIdList,
  163. total_amount: this.totalAmount,
  164. real_amount: this.realAmount,
  165. bank_type: 2,
  166. })
  167. .then(res => {
  168. console.log(res)
  169. let pages = getCurrentPages(); // 当前页面
  170. let beforePage = pages[pages.length - 2]; // 上一页
  171. setTimeout(() => {
  172. uni.navigateBack({
  173. success: function() {
  174. beforePage
  175. .onLoad(); // 执行上一页的onLoad方法
  176. }
  177. })
  178. uni.navigateBack()
  179. })
  180. })
  181. },
  182. toModifyBank() {
  183. uni.navigateTo({
  184. url: '/pages/mycenter/myinformation/mybank'
  185. });
  186. },
  187. toModifyZhifubao() {
  188. uni.navigateTo({
  189. url: '/pages/mycenter/myinformation/myzhifubao'
  190. });
  191. }
  192. }
  193. }
  194. </script>
  195. <style lang="scss" scoped>
  196. p {
  197. font-size: 32rpx;
  198. }
  199. .show-form {
  200. margin: 0 25rpx;
  201. }
  202. .show-form-cell {
  203. display: flex;
  204. justify-content: space-between;
  205. align-items: center;
  206. }
  207. .show-form-cell-left {
  208. display: flex;
  209. margin: 30rpx 0;
  210. }
  211. .show-form-cell-left1 {
  212. width: 150rpx;
  213. }
  214. .tips {
  215. margin: 30rpx 0;
  216. padding: 30rpx 20rpx;
  217. background-color: #eaeaea;
  218. border-radius: 15rpx;
  219. }
  220. .tips p {
  221. font-size: 28rpx;
  222. }
  223. .withdraw-btn {
  224. display: flex;
  225. align-items: center;
  226. width: 100%;
  227. position: fixed;
  228. bottom: 0rpx;
  229. display: flex;
  230. height: 100rpx;
  231. padding-top: 2%;
  232. }
  233. .btn1 {
  234. width: 60%;
  235. background-color: #f2d22d;
  236. color: #000;
  237. border-color: #ffffff;
  238. border-radius: 10rpx;
  239. font-size: 36rpx;
  240. line-height: 240%;
  241. letter-spacing: 10rpx;
  242. font-weight: 500;
  243. height: 80%;
  244. }
  245. .show-body1-icon {
  246. width: 30rpx;
  247. height: 30rpx;
  248. }
  249. </style>