withdrawal.vue 9.2 KB

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