account-type-select.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  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/bank.png',
  63. title: '银行卡转账',
  64. value: '2',
  65. },
  66. {
  67. icon: '/static/img/shop/pay/wechat.png',
  68. title: '微信零钱',
  69. value: '3',
  70. },
  71. {
  72. icon: '/static/img/shop/pay/alipay.png',
  73. title: '支付宝账户',
  74. value: '4',
  75. },
  76. {
  77. icon: '/static/img/shop/pay/wechat.png',
  78. title: '微信零钱',
  79. value: '5',
  80. }
  81. ];
  82. function onChange(e) {
  83. state.currentValue = e.detail.value;
  84. }
  85. const onConfirm = async () => {
  86. if (state.currentValue === '') {
  87. sheep.$helper.toast('请选择提现方式');
  88. return;
  89. }
  90. // 赋值
  91. emits('update:modelValue', {
  92. type: state.currentValue
  93. });
  94. // 关闭弹窗
  95. emits('close');
  96. };
  97. const hideModal = () => {
  98. emits('close');
  99. };
  100. </script>
  101. <style lang="scss" scoped>
  102. .ss-modal-box {
  103. border-radius: 30rpx 30rpx 0 0;
  104. max-height: 1000rpx;
  105. .modal-header {
  106. position: relative;
  107. padding: 60rpx 40rpx 40rpx;
  108. .modal-title {
  109. font-size: 32rpx;
  110. font-weight: bold;
  111. }
  112. .close-icon {
  113. position: absolute;
  114. top: 10rpx;
  115. right: 20rpx;
  116. font-size: 46rpx;
  117. opacity: 0.2;
  118. }
  119. }
  120. .modal-content {
  121. overflow-y: auto;
  122. .container-list {
  123. height: 96rpx;
  124. border-bottom: 2rpx solid rgba(#dfdfdf, 0.5);
  125. font-size: 28rpx;
  126. font-weight: 500;
  127. color: #333333;
  128. .container-icon {
  129. width: 36rpx;
  130. height: 36rpx;
  131. }
  132. }
  133. }
  134. .modal-footer {
  135. height: 120rpx;
  136. .save-btn {
  137. width: 710rpx;
  138. height: 80rpx;
  139. border-radius: 40rpx;
  140. background: linear-gradient(90deg, var(--ui-BG-Main), var(--ui-BG-Main-gradient));
  141. color: $white;
  142. }
  143. }
  144. }
  145. image {
  146. width: 100%;
  147. height: 100%;
  148. }
  149. </style>