add-alipay.vue 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. <template>
  2. <ui-modal
  3. class="add-bank-wrap"
  4. name="walletAddAlipay"
  5. mask="40"
  6. align="bottom"
  7. ui="ss-r-t-30"
  8. :showCancel="false"
  9. :option="false"
  10. >
  11. <view class="ss-modal-box bg-white ss-flex-col">
  12. <view class="modal-header ss-flex-col ss-col-left">
  13. <text class="cicon-close-round close-icon" @tap="hideModal"></text>
  14. <text class="modal-title ss-m-b-20">添加支付宝</text>
  15. </view>
  16. <view class="modal-content ss-flex-1 ss-p-b-100">
  17. <ui-form
  18. ref="addAlipayFormRef"
  19. :model="state.model"
  20. :rules="state.rules"
  21. hasClear
  22. labelPosition="left"
  23. :labelStyle="{ fontWeight: 'bold' }"
  24. >
  25. <ui-form-item prop="real_name" title="真实姓名">
  26. <ui-input placeholder="请输入真实姓名" v-model="state.model.real_name"></ui-input>
  27. </ui-form-item>
  28. <ui-form-item prop="card_no" title="支付宝账号">
  29. <ui-input placeholder="请输入支付宝账号" v-model="state.model.card_no"></ui-input>
  30. </ui-form-item>
  31. </ui-form>
  32. </view>
  33. <view class="modal-footer ss-flex ss-row-center ss-col-center">
  34. <button class="ss-reset-button save-btn" @tap="onSave">确定</button>
  35. </view>
  36. </view>
  37. </ui-modal>
  38. </template>
  39. <script setup>
  40. import { ref, reactive, unref } from 'vue';
  41. import { realName, bankCode } from '@/sheep/common/validate/form';
  42. // 数据
  43. const addAlipayFormRef = ref(null);
  44. const state = reactive({
  45. model: {
  46. real_name: '',
  47. card_no: '',
  48. },
  49. rules: {
  50. real_name: realName,
  51. card_no: bankCode,
  52. },
  53. });
  54. const showModal = () => {
  55. hooksModal.showModal('walletAddAlipay');
  56. };
  57. const hideModal = () => {
  58. hooksModal.hideModal();
  59. };
  60. const onSave = async () => {
  61. const res = await unref(addAlipayFormRef).validate();
  62. };
  63. defineExpose({
  64. showModal,
  65. });
  66. </script>
  67. <style lang="scss" scoped>
  68. .ss-modal-box {
  69. border-radius: 30rpx 30rpx 0 0;
  70. max-height: 1000rpx;
  71. .modal-header {
  72. position: relative;
  73. padding: 60rpx 40rpx 40rpx;
  74. .modal-title {
  75. font-size: 32rpx;
  76. font-weight: bold;
  77. }
  78. .close-icon {
  79. position: absolute;
  80. top: 10rpx;
  81. right: 20rpx;
  82. font-size: 46rpx;
  83. opacity: 0.2;
  84. }
  85. }
  86. .modal-content {
  87. overflow-y: auto;
  88. }
  89. .modal-footer {
  90. height: 120rpx;
  91. .save-btn {
  92. width: 710rpx;
  93. height: 80rpx;
  94. border-radius: 40rpx;
  95. background: linear-gradient(90deg, var(--ui-BG-Main), var(--ui-BG-Main-gradient));
  96. color: $white;
  97. }
  98. }
  99. }
  100. </style>