account-type-select.vue 3.7 KB

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