新增微信支付、Native支付
This commit is contained in:
56
src/components/PayMethod/index.vue
Normal file
56
src/components/PayMethod/index.vue
Normal file
@@ -0,0 +1,56 @@
|
||||
<!-- 选择下拉框 -->
|
||||
<template>
|
||||
<a-select
|
||||
:allow-clear="true"
|
||||
:show-search="true"
|
||||
optionFilterProp="label"
|
||||
:options="options"
|
||||
:value="value"
|
||||
:placeholder="placeholder"
|
||||
@update:value="updateValue"
|
||||
:style="`width: 200px`"
|
||||
@blur="onBlur"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref } from 'vue';
|
||||
import { SelectProps } from 'ant-design-vue';
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: 'update:value', value: string, item: any): void;
|
||||
(e: 'blur'): void;
|
||||
}>();
|
||||
|
||||
const props = withDefaults(
|
||||
defineProps<{
|
||||
value?: any;
|
||||
type?: any;
|
||||
placeholder?: string;
|
||||
dictCode?: string;
|
||||
}>(),
|
||||
{
|
||||
placeholder: '请选择服务器厂商'
|
||||
}
|
||||
);
|
||||
|
||||
// 字典数据
|
||||
const options = ref<SelectProps['options']>([
|
||||
{ value: 'wxPay', label: '微信支付', icon: 'WechatOutlined' },
|
||||
{ value: 'aliPay', label: '支付宝支付', icon: 'AlipayCircleOutlined' },
|
||||
{ value: 'balancePay', label: '余额支付', icon: 'PayCircleOutlined' },
|
||||
{ value: 'yearCardPay', label: '年卡支付', icon: 'IdcardOutlined' },
|
||||
{ value: 'icCardPay', label: 'IC卡支付', icon: 'IdcardOutlined' }
|
||||
]);
|
||||
|
||||
/* 更新选中数据 */
|
||||
const updateValue = (value: string) => {
|
||||
const item = options.value?.find((d) => d.value == value);
|
||||
console.log(item);
|
||||
emit('update:value', value, item);
|
||||
};
|
||||
/* 失去焦点 */
|
||||
const onBlur = () => {
|
||||
emit('blur');
|
||||
};
|
||||
</script>
|
||||
Reference in New Issue
Block a user