transfer.vue 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350
  1. <template>
  2. <view class="content">
  3. <view class="content-money">
  4. <view class="flex">
  5. <view class="buttom">
  6. <view class="icon">{{ userInfo.brokerage_price | getMoneyStyle }}</view>
  7. <text class="text">可转账金额</text>
  8. </view>
  9. </view>
  10. </view>
  11. <view class="row-box">
  12. <view class="title">收款人账户</view>
  13. <view class="row"><input class="input" type="number" v-model="phone" placeholder="请输入收款人账户"
  14. placeholder-class="placeholder" /></view>
  15. </view>
  16. <view class="row-box">
  17. <view class="title">转账数量</view>
  18. <view class="row">
  19. <!-- <text class="tit">¥</text> -->
  20. <input class="input" type="number" v-model="withdrawal" placeholder="请输入转账金额"
  21. placeholder-class="placeholder" />
  22. <!-- <view class="buttom" @click="withdrawal = userInfo.now_money*1">全部转账</view> -->
  23. <!-- <view class="buttom" @click="withdrawal = userInfo.dynamic_integral" v-if="type== 2">全部转账</view> -->
  24. </view>
  25. </view>
  26. <button class="add-btn up" :class="{ action: loding }" @click="!loding ? confirm() : ''" style="background: #FF4C4C ;">提交申请</button>
  27. </view>
  28. </template>
  29. <script>
  30. import {
  31. getMoneyStyle
  32. } from '@/utils/rocessor.js';
  33. import {
  34. getUserInfo,
  35. jfzz
  36. } from '@/api/user.js';
  37. import {
  38. mapMutations,
  39. mapState
  40. } from 'vuex';
  41. export default {
  42. filters: {
  43. getMoneyStyle
  44. },
  45. data() {
  46. return {
  47. phone: '',
  48. money: '0.00', //可提现金额
  49. withdrawal: '', //提现金额
  50. password: '', //支付密码
  51. card: '', //转账卡号
  52. name: '',
  53. // #ifdef H5
  54. weichatBsrowser: false,
  55. // #endif
  56. loding: false,
  57. type: 0
  58. };
  59. },
  60. onLoad(options) {
  61. // #ifdef H5
  62. this.weichatBsrowser = uni.getStorageSync('weichatBrowser');
  63. // #endif
  64. this.dataUp();
  65. if (options.type) {
  66. this.type = options.type;
  67. }
  68. },
  69. computed: {
  70. ...mapState('user', ['userInfo'])
  71. },
  72. methods: {
  73. ...mapMutations('user', ['setUserInfo', 'login']),
  74. // 更新数据
  75. dataUp() {
  76. let obj = this;
  77. getUserInfo({})
  78. .then(e => {
  79. obj.setUserInfo(e.data);
  80. })
  81. .catch(e => {
  82. console.log(e);
  83. });
  84. },
  85. // 切换选中对象
  86. tabRadio(e) {
  87. this.type = e.detail.value;
  88. },
  89. // 提交
  90. confirm() {
  91. let obj = this;
  92. obj.loding = true;
  93. if (obj.withdrawal == 0) {
  94. obj.loding = false;
  95. uni.showModal({
  96. title: '提示',
  97. content: '转账金额不要为0'
  98. });
  99. return;
  100. }
  101. if (obj.phone == '') {
  102. return obj.$api.msg('请输入用户UID')
  103. }
  104. let data = {
  105. uid: obj.phone, //编号
  106. num: obj.withdrawal, //金额
  107. // uid: obj.userInfo.uid
  108. // type: obj.type
  109. };
  110. jfzz(data)
  111. .then(e => {
  112. // 允许按钮点击
  113. obj.loding = false;
  114. // 初始化提现金额
  115. uni.showToast({
  116. title: '转账成功',
  117. duration: 2000,
  118. position: 'top'
  119. });
  120. obj.dataUp();
  121. })
  122. .catch(e => {
  123. obj.$api.msg(e.msg);
  124. obj.loding = false;
  125. console.log();
  126. });
  127. },
  128. boblack() {
  129. uni.navigateBack({
  130. fail() {
  131. uni.switchTab({
  132. url: '/pages/index/index'
  133. })
  134. }
  135. })
  136. },
  137. }
  138. };
  139. </script>
  140. <style lang="scss">
  141. page {
  142. height: 100%;
  143. }
  144. .content-money {
  145. padding: 30rpx 0;
  146. background: #ffffff;
  147. }
  148. .item {
  149. padding: 0 $page-row-spacing;
  150. background-color: #ffffff;
  151. }
  152. .flex {
  153. background-color: #ffffff;
  154. text-align: center;
  155. margin: 0 30rpx;
  156. border-radius: $border-radius-sm;
  157. justify-content: center;
  158. .buttom {
  159. font-size: $font-lg;
  160. width: 50%;
  161. }
  162. .interval {
  163. width: 2px;
  164. height: 60rpx;
  165. background-color: #eeeeee;
  166. }
  167. .icon {
  168. background-size: 100%;
  169. font-size: 42rpx;
  170. color: $font-color-dark;
  171. font-weight: bold;
  172. background-repeat: no-repeat;
  173. background-position: center;
  174. }
  175. .text {
  176. color: $font-color-light;
  177. }
  178. }
  179. .row-box {
  180. margin-top: 30rpx;
  181. padding: 20rpx 30rpx;
  182. background: #fff;
  183. .title {
  184. font-size: $font-base + 2rpx;
  185. color: $font-color-dark;
  186. }
  187. .row {
  188. display: flex;
  189. align-items: center;
  190. position: relative;
  191. height: 80rpx;
  192. .tit {
  193. flex-shrink: 0;
  194. width: 40rpx;
  195. font-size: 30rpx;
  196. color: $font-color-dark;
  197. }
  198. .input {
  199. flex: 1;
  200. font-size: 30rpx;
  201. color: $font-color-dark;
  202. }
  203. .iconlocation {
  204. font-size: 36rpx;
  205. color: $font-color-light;
  206. }
  207. .buttom {
  208. color: #a9000b;
  209. font-size: $font-base;
  210. }
  211. }
  212. }
  213. .add-btn {
  214. width: 520rpx;
  215. height: 80rpx;
  216. border-radius: 20rpx;
  217. margin: 140rpx auto 0;
  218. font-size: 36rpx;
  219. font-weight: bold;
  220. color: #ffffff;
  221. background-color: #a9000b;
  222. }
  223. .back-btn {
  224. width: 520rpx;
  225. height: 80rpx;
  226. border-radius: 20rpx;
  227. margin: 40rpx auto;
  228. font-size: 36rpx;
  229. font-weight: bold;
  230. color: #303030;
  231. background-color: #F8DABA;
  232. }
  233. .name {
  234. background: #fff;
  235. padding: 30rpx;
  236. }
  237. .list {
  238. padding-left: 30rpx;
  239. margin-top: 30rpx;
  240. background-color: #ffffff;
  241. .box {
  242. display: flex;
  243. align-items: center;
  244. width: 100%;
  245. height: 120rpx;
  246. border-bottom: 1px solid $border-color-light;
  247. .icon {
  248. font-size: 48rpx;
  249. padding-right: 20rpx;
  250. .icon-img {
  251. height: 50rpx;
  252. width: 50rpx;
  253. }
  254. }
  255. .iconweixin1 {
  256. color: #18bf16;
  257. }
  258. .iconzhifubao {
  259. color: #08aaec;
  260. }
  261. .title-box {
  262. flex-grow: 1;
  263. text-align: left;
  264. .title {
  265. font-size: $font-base + 2rpx;
  266. color: $font-color-base;
  267. }
  268. .node {
  269. font-size: $font-sm;
  270. color: $font-color-light;
  271. }
  272. }
  273. }
  274. }
  275. .tip {
  276. padding: 20rpx;
  277. color: #ff0000;
  278. }
  279. /deep/ .uni-radio-input {
  280. width: 45rpx;
  281. height: 45rpx;
  282. }
  283. .psw-wrapper {
  284. width: 548rpx;
  285. height: 344rpx;
  286. background-color: #FFFFFF;
  287. border-radius: 15rpx 15rpx;
  288. .psw-title {
  289. width: 100%;
  290. font-size: 35rpx;
  291. padding: 43rpx 0 49rpx;
  292. text-align: center;
  293. font-weight: 800;
  294. }
  295. .psw-ipt {
  296. display: block;
  297. background-color: #dce3ed;
  298. height: 90rpx;
  299. width: 464rpx;
  300. padding-left: 30rpx;
  301. margin: 0 auto;
  302. font-size: 80rpx;
  303. }
  304. .psw-btn text {
  305. display: inline-block;
  306. text-align: center;
  307. width: 50%;
  308. padding-top: 29rpx;
  309. font-size: 35rpx;
  310. }
  311. .psw-qd {
  312. color: #5771DF;
  313. }
  314. }
  315. </style>