withdrawal.vue 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336
  1. <template>
  2. <view class="content">
  3. <template v-if="!isUp">
  4. <view class="content-money">
  5. <view class="flex ">
  6. <view class="buttom">
  7. <view class="icon">{{ money | getMoneyStyle }}</view>
  8. <text class="text">可提现佣金</text>
  9. </view>
  10. </view>
  11. </view>
  12. <view class="row-box" style="margin-bottom: 20rpx;">
  13. <view class="title">提现金额</view>
  14. <view class="row">
  15. <text class="tit">¥</text>
  16. <input class="input" type="number" v-model="withdrawal" placeholder="请输入提现金额"
  17. placeholder-class="placeholder" />
  18. <view class="buttom" @click="withdrawal = money">全部提现</view>
  19. </view>
  20. </view>
  21. <view class="row b-b">
  22. <text class="tit">姓名</text>
  23. <input class="input" v-model="name" type="text" placeholder="提款人姓名" placeholder-class="placeholder" />
  24. </view>
  25. <view class="row b-b">
  26. <text class="tit">银行卡号</text>
  27. <input class="input" v-model="bankno" type="text" placeholder="请输入银行卡号"
  28. placeholder-class="placeholder" />
  29. </view>
  30. <view class="row b-b">
  31. <text class="tit">所属银行</text>
  32. <input class="input" v-model="bankname" type="text" placeholder="请输入所属银行"
  33. placeholder-class="placeholder" />
  34. </view>
  35. <button class="add-btn up" @click="confirm">提交申请</button>
  36. </template>
  37. </view>
  38. </template>
  39. <script>
  40. import {
  41. getStoreCms,
  42. cash
  43. } from '@/api/user.js'
  44. import {
  45. getMoneyStyle
  46. } from '@/utils/rocessor.js';
  47. import {
  48. extractCash,
  49. extractBank,
  50. aliInfo,
  51. bankInfo
  52. } from '@/api/wallet.js';
  53. import {
  54. mapState,
  55. mapMutations
  56. } from 'vuex';
  57. export default {
  58. filters: {
  59. getMoneyStyle
  60. },
  61. components: {
  62. // uniNoticeBar
  63. },
  64. data() {
  65. return {
  66. name: '',
  67. bankname: '',
  68. bankno: '',
  69. money: '0.00', //可提现金额
  70. // freeze: '0.0', //冻结金额
  71. withdrawal: 0, //提现金额
  72. // minPrice: 0, //最少提现金额
  73. };
  74. },
  75. onLoad(options) {
  76. if (this.isUp) {
  77. uni.switchTab({
  78. url: '/pages/index/index'
  79. })
  80. }
  81. this.loadData();
  82. },
  83. computed: {
  84. ...mapState(['isUp']),
  85. },
  86. methods: {
  87. // 加载余额信息
  88. async loadData() {
  89. let obj = this
  90. getStoreCms().then(({
  91. data
  92. }) => {
  93. obj.money = data.all
  94. })
  95. },
  96. // 跳转
  97. navTo(url) {
  98. uni.navigateTo({
  99. url: url
  100. });
  101. },
  102. // 切换选中对象
  103. tabRadio(e) {
  104. this.type = e.detail.value;
  105. },
  106. // 提交
  107. confirm() {
  108. let obj = this
  109. if (obj.withdrawal == 0) {
  110. return obj.$api.msg('提现金额不能为0')
  111. }
  112. if (obj.withdrawal < 0) {
  113. return obj.$api.msg('请输入正确的提现金额')
  114. }
  115. if (obj.name == '') {
  116. return obj.$api.msg('请输入提款人姓名')
  117. }
  118. if (obj.bankno == '') {
  119. return obj.$api.msg('请输入银行卡号')
  120. }
  121. if (obj.bankname == '') {
  122. return obj.$api.msg('请输入所属银行')
  123. }
  124. let data = {
  125. // extract_type: obj.type, //bank -银行卡 alipay-支付宝 weixin-微信
  126. money: obj.withdrawal, //金额
  127. bankname: obj.bankname,
  128. cardnum: obj.bankno,
  129. name: obj.name
  130. };
  131. cash(data)
  132. .then(e => {
  133. uni.showToast({
  134. title: '提交成功',
  135. duration: 2000,
  136. position: 'top'
  137. });
  138. // obj.name = ''
  139. // obj.bankname = ''
  140. // obj.bankno = ''
  141. obj.money = '0.00' //可提现金额
  142. obj.withdrawal = 0 //提现金额
  143. obj.loadData()
  144. })
  145. .catch(e => {
  146. console.log();
  147. });
  148. }
  149. }
  150. };
  151. </script>
  152. <style lang="scss">
  153. page {
  154. height: 100%;
  155. }
  156. .content-money {
  157. padding: 30rpx 0;
  158. background: #ffffff;
  159. }
  160. .flex {
  161. background-color: #ffffff;
  162. text-align: center;
  163. margin: 0 30rpx;
  164. border-radius: $border-radius-sm;
  165. .buttom {
  166. font-size: $font-lg;
  167. width: 100%;
  168. }
  169. .interval {
  170. width: 2px;
  171. height: 60rpx;
  172. background-color: #eeeeee;
  173. }
  174. .icon {
  175. background-size: 100%;
  176. font-size: 42rpx;
  177. color: $font-color-dark;
  178. font-weight: bold;
  179. background-repeat: no-repeat;
  180. background-position: center;
  181. }
  182. .text {
  183. color: $font-color-light;
  184. }
  185. }
  186. .row-box {
  187. margin-top: 30rpx;
  188. padding: 20rpx 30rpx;
  189. background: #fff;
  190. .title {
  191. font-size: $font-base + 2rpx;
  192. color: $font-color-dark;
  193. }
  194. .row {
  195. display: flex;
  196. align-items: center;
  197. position: relative;
  198. height: 80rpx;
  199. .tit {
  200. flex-shrink: 0;
  201. width: 40rpx;
  202. font-size: 30rpx;
  203. color: $font-color-dark;
  204. }
  205. .input {
  206. flex: 1;
  207. font-size: 30rpx;
  208. color: $font-color-dark;
  209. }
  210. .iconlocation {
  211. font-size: 36rpx;
  212. color: $font-color-light;
  213. }
  214. .buttom {
  215. color: #901b21;
  216. font-size: $font-base;
  217. }
  218. }
  219. }
  220. .add-btn {
  221. &.modified {
  222. color: $base-color;
  223. }
  224. &.up {
  225. background-color: $base-color;
  226. color: #fff;
  227. }
  228. display: flex;
  229. align-items: center;
  230. justify-content: center;
  231. width: 690rpx;
  232. height: 80rpx;
  233. margin: 0 auto;
  234. margin-top: 30rpx;
  235. font-size: $font-lg;
  236. border-radius: 10rpx;
  237. // box-shadow: 1px 2px 5px rgba(219, 63, 96, 0.4);
  238. }
  239. .list {
  240. padding-left: 30rpx;
  241. margin-top: 30rpx;
  242. background-color: #ffffff;
  243. .box {
  244. display: flex;
  245. align-items: center;
  246. width: 100%;
  247. height: 120rpx;
  248. border-bottom: 1px solid $border-color-light;
  249. .icon {
  250. font-size: 48rpx;
  251. padding-right: 20rpx;
  252. .icon-img {
  253. height: 50rpx;
  254. width: 50rpx;
  255. }
  256. }
  257. .iconweixin1 {
  258. color: #18bf16;
  259. }
  260. .iconzhifubao {
  261. color: #08aaec;
  262. }
  263. .title-box {
  264. flex-grow: 1;
  265. text-align: left;
  266. .title {
  267. font-size: $font-base + 2rpx;
  268. color: $font-color-base;
  269. }
  270. .node {
  271. font-size: $font-sm;
  272. color: $font-color-light;
  273. }
  274. }
  275. }
  276. }
  277. /deep/ .uni-radio-input {
  278. width: 45rpx;
  279. height: 45rpx;
  280. }
  281. .row {
  282. display: flex;
  283. align-items: center;
  284. position: relative;
  285. padding: 0 30rpx;
  286. height: 110rpx;
  287. background: #fff;
  288. .tit {
  289. flex-shrink: 0;
  290. width: 140rpx;
  291. font-size: 30rpx;
  292. color: $font-color-dark;
  293. }
  294. .input {
  295. flex: 1;
  296. font-size: 30rpx;
  297. color: $font-color-dark;
  298. }
  299. .iconlocation {
  300. font-size: 36rpx;
  301. color: $font-color-light;
  302. }
  303. }
  304. </style>