account-type-select.vue 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. <template>
  2. <su-popup :show="show" class="ss-checkout-counter-wrap" @close="hideModal">
  3. <view class="ss-modal-box bg-white ss-flex-col">
  4. <view class="modal-header ss-flex-col ss-col-left">
  5. <text class="modal-title ss-m-b-20">选择提现方式</text>
  6. </view>
  7. <view class="modal-content ss-flex-1 ss-p-b-100">
  8. <radio-group @change="onChange">
  9. <label
  10. class="container-list ss-p-l-34 ss-p-r-24 ss-flex ss-col-center ss-row-center"
  11. v-for="(item, index) in typeList"
  12. :key="index"
  13. >
  14. <view class="container-icon ss-flex ss-m-r-20">
  15. <image :src="sheep.$url.static(item.icon)" />
  16. </view>
  17. <view class="ss-flex-1">{{ item.title }}</view>
  18. <radio
  19. :value="item.value"
  20. color="var(--ui-BG-Main)"
  21. :checked="item.value === state.currentValue"
  22. :disabled="!methods.includes(parseInt(item.value))"
  23. />
  24. </label>
  25. </radio-group>
  26. </view>
  27. <view class="modal-footer ss-flex ss-row-center ss-col-center">
  28. <button class="ss-reset-button save-btn" @tap="onConfirm">确定</button>
  29. </view>
  30. </view>
  31. </su-popup>
  32. </template>
  33. <script setup>
  34. import { reactive } from 'vue';
  35. import sheep from '@/sheep';
  36. const props = defineProps({
  37. modelValue: {
  38. type: Object,
  39. default() {},
  40. },
  41. show: {
  42. type: Boolean,
  43. default: false,
  44. },
  45. methods: { // 开启的提现方式
  46. type: Array,
  47. default: [],
  48. },
  49. });
  50. const emits = defineEmits(['update:modelValue', 'change', 'close']);
  51. const state = reactive({
  52. currentValue: '',
  53. });
  54. const typeList = [
  55. {
  56. // icon: '/static/img/shop/pay/wechat.png', // TODO 芋艿:后续给个 icon
  57. title: '钱包余额',
  58. value: '1',
  59. },
  60. {
  61. icon: '/static/img/shop/pay/wechat.png',
  62. title: '微信零钱',
  63. value: '2',
  64. },
  65. {
  66. icon: '/static/img/shop/pay/alipay.png',
  67. title: '支付宝账户',
  68. value: '3',
  69. },
  70. {
  71. icon: '/static/img/shop/pay/bank.png',
  72. title: '银行卡转账',
  73. value: '4',
  74. },
  75. ];
  76. function onChange(e) {
  77. state.currentValue = e.detail.value;
  78. }
  79. const onConfirm = async () => {
  80. if (state.currentValue === '') {
  81. sheep.$helper.toast('请选择提现方式');
  82. return;
  83. }
  84. // 赋值
  85. emits('update:modelValue', {
  86. type: state.currentValue
  87. });
  88. // 关闭弹窗
  89. emits('close');
  90. };
  91. const hideModal = () => {
  92. emits('close');
  93. };
  94. </script>
  95. <style lang="scss" scoped>
  96. .ss-modal-box {
  97. border-radius: 30rpx 30rpx 0 0;
  98. max-height: 1000rpx;
  99. .modal-header {
  100. position: relative;
  101. padding: 60rpx 40rpx 40rpx;
  102. .modal-title {
  103. font-size: 32rpx;
  104. font-weight: bold;
  105. }
  106. .close-icon {
  107. position: absolute;
  108. top: 10rpx;
  109. right: 20rpx;
  110. font-size: 46rpx;
  111. opacity: 0.2;
  112. }
  113. }
  114. .modal-content {
  115. overflow-y: auto;
  116. .container-list {
  117. height: 96rpx;
  118. border-bottom: 2rpx solid rgba(#dfdfdf, 0.5);
  119. font-size: 28rpx;
  120. font-weight: 500;
  121. color: #333333;
  122. .container-icon {
  123. width: 36rpx;
  124. height: 36rpx;
  125. }
  126. }
  127. }
  128. .modal-footer {
  129. height: 120rpx;
  130. .save-btn {
  131. width: 710rpx;
  132. height: 80rpx;
  133. border-radius: 40rpx;
  134. background: linear-gradient(90deg, var(--ui-BG-Main), var(--ui-BG-Main-gradient));
  135. color: $white;
  136. }
  137. }
  138. }
  139. image {
  140. width: 100%;
  141. height: 100%;
  142. }
  143. </style>