collect_amount.vue 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. <template>
  2. <view class="page">
  3. <view class="page-content">
  4. <view class="page-title">
  5. <text>收款金额</text>
  6. </view>
  7. <view class="page-content-input">
  8. <text class="page-money-fuhao">¥</text>
  9. <input class="uni-input-collect" @input="getAmount" type="text" placeholder=""/>
  10. </view>
  11. <view class="footer-button">
  12. <button class="withdraw" type="submit" @tap="collectAmount">确定</button>
  13. </view>
  14. </view>
  15. </view>
  16. </template>
  17. <script>
  18. import _hook from '../../../common/_hook';
  19. import _data from '../../../common/_data';
  20. import _get from '../../../common/_get';
  21. export default {
  22. data() {
  23. return {
  24. pageParams:{
  25. amount:''
  26. },
  27. user_info:{
  28. id:0
  29. },
  30. user_id:0
  31. }
  32. },
  33. onShow() {
  34. let _this = this;
  35. _hook.routeSonHook();
  36. _get.getUserInfo({user_id:_this.user_id},function(ret){
  37. _this.user_info = ret;
  38. uni.setNavigationBarTitle({
  39. title:'向'+ret.username+'收款'
  40. })
  41. });
  42. uni.$on('pay_amount_after',function(ret){
  43. uni.$emit('data_user_info',ret);
  44. _data.data('user_info',ret);
  45. uni.hideLoading();
  46. uni.showToast({
  47. title:'交易成功',
  48. icon:'none'
  49. })
  50. setTimeout(function(){
  51. uni.redirectTo({
  52. url:'/pages/my/wallet/capital'
  53. })
  54. },1000)
  55. })
  56. },
  57. onLoad(options){
  58. this.user_id = options.user_id;
  59. },
  60. methods: {
  61. getAmount(e){
  62. return this.pageParams.amount = e.detail.value;
  63. },
  64. collectAmount(){
  65. uni.showLoading({
  66. title:'请求中...'
  67. });
  68. _get.collectAmount({amount:this.pageParams.amount,to_user_id:this.user_id},function(){
  69. uni.showLoading({
  70. title:'等待用户输入交易密码...'
  71. });
  72. })
  73. }
  74. }
  75. }
  76. </script>
  77. <style>
  78. .withdraw{
  79. width: 90%;
  80. background-color: #51a938;
  81. color: white;
  82. height: 90upx;
  83. line-height: 90upx !important;
  84. border-radius: 15upx;
  85. font-size: 36upx;
  86. cursor: pointer;
  87. }
  88. .footer-button{
  89. padding: 50upx;
  90. }
  91. .page-title{
  92. padding: 40upx 0;
  93. }
  94. .page-money-fuhao{
  95. font-size: 22px;
  96. font-weight: 800;
  97. }
  98. .page-content-input{
  99. display: flex;
  100. }
  101. page{
  102. background-color: #f1f0f5;
  103. }
  104. .page{
  105. margin-top: 30rpx;
  106. padding: 0 30rpx;
  107. }
  108. .page-money-fuhao{
  109. margin-bottom: 50upx;
  110. }
  111. .page-content{
  112. background-color: white;
  113. border-radius: 5rpx;
  114. padding-left: 40rpx;
  115. }
  116. .uni-input-collect{
  117. border-bottom: 1px solid #bcbcbc;
  118. padding: 10px;
  119. font-size: 30px;
  120. font-weight: 800;
  121. width: 80% ;
  122. }
  123. </style>