add_account.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. <template>
  2. <view class="page">
  3. <view class="content">
  4. <form @submit="addBank" @reset="">
  5. <view class="uni-form-item">
  6. <text class="title"><text style="margin-right: 10px;">*</text>姓名</text>
  7. <input class="uni-input" @input="fullname" type="text" placeholder="请输入姓名"/>
  8. </view>
  9. <view class="uni-form-item">
  10. <text class="title"><text style="margin-right: 10px;">*</text>身份证号</text>
  11. <input class="uni-input" @input="idCard" type="idcard" placeholder="请输入身份证号"/>
  12. </view>
  13. <view class="uni-form-item">
  14. <text class="title"><text style="margin-right: 10px;">*</text>支付宝账号</text>
  15. <input class="uni-input" @input="account" type="text" placeholder="请输入支付宝账号"/>
  16. </view>
  17. <button class="withdraw" form-type="submit" type="submit">绑定</button>
  18. </form>
  19. </view>
  20. </view>
  21. </template>
  22. <script>
  23. import _get from '../../../common/_get';
  24. import _hook from '../../../common/_hook';
  25. export default {
  26. data() {
  27. return {
  28. requestParams:{
  29. 'fullname':'',
  30. 'id_card':'',
  31. 'account':'',
  32. 'bank_type':1
  33. }
  34. }
  35. },
  36. onShow(){
  37. _hook.routeSonHook();
  38. },
  39. methods: {
  40. fullname(e){
  41. return this.requestParams.fullname = e.detail.value.trim();
  42. },
  43. idCard(e){
  44. return this.requestParams.id_card = e.detail.value.trim();
  45. },
  46. account(e){
  47. return this.requestParams.account = e.detail.value.trim();
  48. },
  49. bank_type(e){
  50. return this.requestParams.bank_type = e.detail.value.trim();
  51. },
  52. addBank(e){
  53. if(this.requestParams.account == ''){
  54. return this.showToast('请输入账号!');
  55. }
  56. if(this.requestParams.id_card == ''){
  57. return this.showToast('请输入身份证号!');
  58. }
  59. if(this.requestParams.fullname == ''){
  60. return this.showToast('请输入姓名!');
  61. }
  62. _get.addUserBank(this.requestParams,function (res) {
  63. uni.navigateBack();
  64. });
  65. },
  66. showToast(msg){
  67. return uni.showToast({title:msg,icon:'none'});
  68. }
  69. }
  70. }
  71. </script>
  72. <style>
  73. page{
  74. background-color: white;
  75. }
  76. .page{
  77. border-top: 1px solid #e3e3e3;
  78. }
  79. .uni-input{
  80. border: none;
  81. text-align: right;
  82. }
  83. .uni-form-item{
  84. border-bottom: 1px solid #e3e3e3;
  85. }
  86. .content .withdraw{
  87. margin-top: 70upx;
  88. width: 90%;
  89. background-color: #5693ee;
  90. color: white;
  91. height: 70upx;
  92. line-height: 70upx !important;
  93. border-radius: 40upx;
  94. font-size: 36upx;
  95. cursor: pointer;
  96. }
  97. </style>