account-type-select.vue 3.8 KB

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