withdrawal.vue 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376
  1. <template>
  2. <view class="content">
  3. <!-- <uni-notice-bar single="true" text="实际到账98%"></uni-notice-bar> -->
  4. <view class="content-money">
  5. <view class="flex " style="width: 750rpx;justify-content: space-around;margin-left: 0;">
  6. <view class="buttom">
  7. <view class="icon">{{ userInfo.brokerage_price | getMoneyStyle }}</view>
  8. <text class="text">可提现现金</text>
  9. </view>
  10. </view>
  11. </view>
  12. <view class="row-box">
  13. <view class="title">提现金额</view>
  14. <view class="row">
  15. <text class="tit">¥</text>
  16. <input class="input" type="number" v-model="withdrawal" :placeholder="'最低提现金额' + minPrice + '元'" placeholder-class="placeholder" />
  17. <view class="buttom" @click="withdrawal = userInfo.brokerage_price">全部提现</view>
  18. </view>
  19. </view>
  20. <view class="list" >
  21. <radio-group @change="tabRadio">
  22. <!-- <label>
  23. <view class="box">
  24. <view class="icon iconfont iconweixin1"></view>
  25. <view class="title-box">
  26. <view class="title"><text>提现至微信</text></view>
  27. </view>
  28. <view class="right"><radio value="weixin" color="#01a6a8" :checked="type == 'weixin'" /></view>
  29. </view>
  30. </label> -->
  31. <label>
  32. <view class="box">
  33. <view class="icon iconfont iconzhifubao"></view>
  34. <view class="title-box">
  35. <view class="title">
  36. <text v-if="aliData.fullname">提现至支付宝</text>
  37. <text v-else>请创建支付宝账号</text>
  38. </view>
  39. <view class="node">
  40. <text v-if="aliData.fullname">真实姓名({{ aliData.fullname }})</text>
  41. </view>
  42. </view>
  43. <view class="right"><radio value="alipay" color="#01a6a8" :checked="type == 'alipay'" /></view>
  44. </view>
  45. </label>
  46. <label >
  47. <view class="box">
  48. <view class="icon iconfont"><image class="icon-img" src="/static/icon/i8.png" mode="aspectFit"></image></view>
  49. <view class="title-box">
  50. <view class="title">
  51. <text v-if="bankData.bankno">{{ bankData.bank + ' ' + bankData.bankno }}</text>
  52. <text v-else>请输入银行账号</text>
  53. </view>
  54. <view class="node">
  55. <text v-if="bankData.fullname">真实姓名({{ bankData.fullname }})</text>
  56. </view>
  57. </view>
  58. <view class="right"><radio value="bank" color="#01a6a8" :checked="type == 'bank'" /></view>
  59. </view>
  60. </label>
  61. </radio-group>
  62. </view>
  63. <view class="row b-b" v-if="type == 'alipay'">
  64. <text class="tit">支付宝账号</text>
  65. <input class="input" type="text" v-model="alipay_code" placeholder="请输入支付宝账号" placeholder-class="placeholder" />
  66. </view>
  67. <view class="row b-b" v-if="type == 'alipay'">
  68. <text class="tit">支付宝姓名</text>
  69. <input class="input" type="text" v-model="alipay_name" placeholder="请输入支付宝姓名" placeholder-class="placeholder" />
  70. </view>
  71. <template v-if="type == 'bank'">
  72. <view class="row b-b" >
  73. <text class="tit">银行卡号</text>
  74. <input class="input" type="text" v-model="bank_code" placeholder="请输入银行卡号" placeholder-class="placeholder" />
  75. </view>
  76. <view class="row b-b" >
  77. <text class="tit">姓名</text>
  78. <input class="input" type="text" v-model="bank_people" placeholder="请输入银行卡姓名" placeholder-class="placeholder" />
  79. </view>
  80. <view class="row b-b" >
  81. <text class="tit">所属银行</text>
  82. <input class="input" type="text" v-model="bank_name" placeholder="请输入所属银行" placeholder-class="placeholder" />
  83. </view>
  84. </template>
  85. <button class="add-btn up" @click="confirm">提交申请</button>
  86. <!-- <button class="add-btn modified" v-if="!weichatBsrowser" @click="navTo('/pages/money/account')">账号管理</button> -->
  87. </view>
  88. </template>
  89. <script>
  90. import { getMoneyStyle } from '@/utils/rocessor.js';
  91. import { extractCash, extractBank, aliInfo, bankInfo ,examine} from '@/api/wallet.js';
  92. import { orderData, getUserInfo } from '@/api/user.js';
  93. import { mapState, mapMutations } from 'vuex';
  94. import uniNoticeBar from '@/components/uni-notice-bar/uni-notice-bar.vue';
  95. export default {
  96. filters: {
  97. getMoneyStyle
  98. },
  99. components: {
  100. uniNoticeBar
  101. },
  102. computed: {
  103. ...mapState('user', ['userInfo', 'orderInfo', 'hasLogin'])
  104. },
  105. data() {
  106. return {
  107. type: 'bank', //提现方式
  108. money: '0.00', //可提现金额
  109. freeze: '0.0', //冻结金额
  110. withdrawal: '', //提现金额
  111. minPrice: '', //最少提现金额
  112. aliData: {},
  113. sxf:0,
  114. bank:0,
  115. bankData: {},
  116. alipay_code: '',
  117. alipay_name: '',
  118. bank_code: '',
  119. bank_people: '',
  120. bank_name: '',
  121. // #ifdef H5
  122. weichatBsrowser: false,
  123. // #endif
  124. sh: 1,
  125. };
  126. },
  127. onLoad(options) {
  128. this.bank_people = uni.getStorageSync('bank_people')
  129. this.bank_name = uni.getStorageSync('bank_name')
  130. this.bank_code = uni.getStorageSync('bank_code')
  131. // #ifdef H5
  132. this.weichatBsrowser = uni.getStorageSync('weichatBrowser');
  133. // #endif
  134. this.loadData()
  135. //加载提现信息
  136. // // 加载提款账号信息
  137. // this.loadAli();
  138. // this.loadBank();
  139. },
  140. methods: {
  141. ...mapMutations('user', ['setUserInfo', 'setOrderInfo']),
  142. // 加载余额信息
  143. async loadData() {
  144. extractBank({}).then(({ data }) => {
  145. this.minPrice = data.minPrice;
  146. });
  147. // examine({}).then(res => {
  148. // console.log(res)
  149. // this.sh = res.msg
  150. // })
  151. },
  152. // 跳转
  153. navTo(url) {
  154. uni.navigateTo({
  155. url: url
  156. });
  157. },
  158. // 切换选中对象
  159. tabRadio(e) {
  160. this.type = e.detail.value;
  161. console.log(this.type);
  162. },
  163. // 提交
  164. confirm() {
  165. let obj = this
  166. let data = {
  167. extract_type: this.type, //bank -银行卡 alipay-支付宝 weixin-微信
  168. money: this.withdrawal, //金额
  169. money_type: 0 //0佣金1余额
  170. };
  171. if (this.withdrawal < this.minPrice) {
  172. uni.showToast({
  173. title: '提现金额不可少于' + this.minPrice,
  174. duration: 2000,
  175. mask: false,
  176. icon: 'none'
  177. });
  178. return;
  179. }
  180. if (this.type == 'alipay') {
  181. console.log('alipay');
  182. data.name = this.alipay_name;
  183. data.alipay_code = this.alipay_code;
  184. }
  185. if (this.type == 'bank') {
  186. // console.log(bank,'bank');
  187. data.name = this.bank_people;
  188. data.bankname = this.bank_name;
  189. data.cardnum = this.bank_code;
  190. }
  191. extractCash(data)
  192. .then(e => {
  193. if(obj.type == 'bank') {
  194. uni.setStorageSync('bank_people', obj.bank_people)
  195. uni.setStorageSync('bank_name',obj.bank_name)
  196. uni.setStorageSync('bank_code',obj.bank_code)
  197. }
  198. getUserInfo({})
  199. .then(({ data }) => {
  200. this.setUserInfo(data);
  201. })
  202. .catch(e => {
  203. console.log(e);
  204. });
  205. uni.showToast({
  206. title: '申请成功!',
  207. duration: 2000,
  208. position: 'top'
  209. });
  210. })
  211. .catch(e => {
  212. console.log();
  213. });
  214. }
  215. }
  216. };
  217. </script>
  218. <style lang="scss">
  219. page {
  220. height: 100%;
  221. }
  222. .content-money {
  223. padding: 30rpx 0;
  224. background: #ffffff;
  225. }
  226. .flex {
  227. background-color: #ffffff;
  228. text-align: center;
  229. margin: 0 30rpx;
  230. border-radius: $border-radius-sm;
  231. .buttom {
  232. font-size: $font-lg;
  233. width: 50%;
  234. }
  235. .interval {
  236. width: 2px;
  237. height: 60rpx;
  238. background-color: #eeeeee;
  239. }
  240. .icon {
  241. background-size: 100%;
  242. font-size: 42rpx;
  243. color: $font-color-dark;
  244. font-weight: bold;
  245. background-repeat: no-repeat;
  246. background-position: center;
  247. }
  248. .text {
  249. color: $font-color-light;
  250. }
  251. }
  252. .row-box {
  253. margin-top: 30rpx;
  254. padding: 20rpx 30rpx;
  255. background: #fff;
  256. .title {
  257. font-size: $font-base + 2rpx;
  258. color: $font-color-dark;
  259. }
  260. .row {
  261. display: flex;
  262. align-items: center;
  263. position: relative;
  264. height: 80rpx;
  265. .tit {
  266. flex-shrink: 0;
  267. width: 40rpx;
  268. font-size: 30rpx;
  269. color: $font-color-dark;
  270. }
  271. .input {
  272. flex: 1;
  273. font-size: 30rpx;
  274. color: $font-color-dark;
  275. }
  276. .iconlocation {
  277. font-size: 36rpx;
  278. color: $font-color-light;
  279. }
  280. .buttom {
  281. color: #fff;
  282. font-size: $font-base;
  283. }
  284. }
  285. }
  286. .add-btn {
  287. background: linear-gradient(-90deg, #FAC545, #FFE000);
  288. border-radius: 10px;
  289. width: 690rpx;
  290. height: 80rpx;
  291. margin: 0 auto;
  292. margin-top: 30rpx;
  293. font-size: $font-lg;
  294. border-radius: 10rpx;
  295. color: #6B4216;
  296. }
  297. .list {
  298. padding-left: 30rpx;
  299. margin-top: 30rpx;
  300. background-color: #ffffff;
  301. .box {
  302. display: flex;
  303. align-items: center;
  304. width: 100%;
  305. height: 120rpx;
  306. border-bottom: 1px solid $border-color-light;
  307. .icon {
  308. font-size: 48rpx;
  309. padding-right: 20rpx;
  310. .icon-img {
  311. height: 50rpx;
  312. width: 50rpx;
  313. }
  314. }
  315. .iconweixin1 {
  316. color: #18bf16;
  317. }
  318. .iconzhifubao {
  319. color: #08aaec;
  320. }
  321. .title-box {
  322. flex-grow: 1;
  323. text-align: left;
  324. .title {
  325. font-size: $font-base + 2rpx;
  326. color: $font-color-base;
  327. }
  328. .node {
  329. font-size: $font-sm;
  330. color: $font-color-light;
  331. }
  332. }
  333. }
  334. }
  335. /deep/ .uni-radio-input {
  336. width: 45rpx;
  337. height: 45rpx;
  338. }
  339. .row {
  340. display: flex;
  341. align-items: center;
  342. position: relative;
  343. padding: 0 30upx;
  344. height: 110upx;
  345. background: #fff;
  346. .tit {
  347. flex-shrink: 0;
  348. width: 250upx;
  349. font-size: 30upx;
  350. color: $font-color-dark;
  351. }
  352. .input {
  353. flex: 1;
  354. font-size: 30upx;
  355. color: $font-color-dark;
  356. }
  357. .iconlocation {
  358. font-size: 36upx;
  359. color: $font-color-light;
  360. }
  361. }
  362. .tip {
  363. padding: 20rpx;
  364. color: #FD3B39;
  365. }
  366. </style>