|
@@ -0,0 +1,74 @@
|
|
|
|
|
+<template>
|
|
|
|
|
+ <div class="pay-methods">
|
|
|
|
|
+ <div
|
|
|
|
|
+ v-for="item in methods"
|
|
|
|
|
+ :key="item.value"
|
|
|
|
|
+ class="pay-method"
|
|
|
|
|
+ :class="{ active: modelValue === item.value }"
|
|
|
|
|
+ @click="$emit('update:modelValue', item.value)"
|
|
|
|
|
+ >
|
|
|
|
|
+ <component :is="item.icon" :size="28" />
|
|
|
|
|
+ <span>{{ item.label }}</span>
|
|
|
|
|
+ <icon-check-circle-fill v-if="modelValue === item.value" class="check" />
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+</template>
|
|
|
|
|
+
|
|
|
|
|
+<script setup>
|
|
|
|
|
+import {
|
|
|
|
|
+ IconAlipayCircle,
|
|
|
|
|
+ IconWechatpay,
|
|
|
|
|
+ IconCheckCircleFill
|
|
|
|
|
+} from '@arco-design/web-vue/es/icon'
|
|
|
|
|
+
|
|
|
|
|
+defineProps({
|
|
|
|
|
+ modelValue: { type: String, default: '' }
|
|
|
|
|
+})
|
|
|
|
|
+
|
|
|
|
|
+defineEmits(['update:modelValue'])
|
|
|
|
|
+
|
|
|
|
|
+const methods = [
|
|
|
|
|
+ { value: 'alipay', label: '支付宝', icon: IconAlipayCircle },
|
|
|
|
|
+ { value: 'wxpay', label: '微信支付', icon: IconWechatpay }
|
|
|
|
|
+]
|
|
|
|
|
+</script>
|
|
|
|
|
+
|
|
|
|
|
+<style scoped lang="less">
|
|
|
|
|
+@import '@/styles/store-theme.less';
|
|
|
|
|
+
|
|
|
|
|
+.pay-methods {
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ flex-direction: column;
|
|
|
|
|
+ gap: 12px;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.pay-method {
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ gap: 12px;
|
|
|
|
|
+ padding: 14px 16px;
|
|
|
|
|
+ border: 2px solid @store-card-border;
|
|
|
|
|
+ border-radius: @store-radius-sm;
|
|
|
|
|
+ cursor: pointer;
|
|
|
|
|
+ transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
|
|
|
|
|
+ position: relative;
|
|
|
|
|
+ color: @store-primary;
|
|
|
|
|
+
|
|
|
|
|
+ &:hover {
|
|
|
|
|
+ border-color: fade(@store-accent, 50%);
|
|
|
|
|
+ background: fade(@store-accent, 6%);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ &.active {
|
|
|
|
|
+ border-color: @store-accent;
|
|
|
|
|
+ background: fade(@store-accent, 10%);
|
|
|
|
|
+ box-shadow: 0 0 0 1px fade(@store-accent, 20%);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .check {
|
|
|
|
|
+ margin-left: auto;
|
|
|
|
|
+ color: @store-accent;
|
|
|
|
|
+ font-size: 20px;
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+</style>
|