Files
xdd-uniapp-new/pkg_user/views/gift/components/PayPicker.vue
T

107 lines
2.1 KiB
Vue

<template>
<u-popup
:show="show"
mode="bottom"
round="20rpx"
@close="close"
:customStyle="{height: '400rpx', padding: '30rpx'}"
closeable
safeAreaInsetBottom
>
<view class="pay-picker">
<view class="title">选择支付方式</view>
<view class="pay-item" :class="{ active: activeType === 'weixin' }" @click="handleSelect('weixin')">
<text class="label">微信支付</text>
<radio :checked="activeType === 'weixin'" color="#09BB07"></radio>
</view>
<view class="pay-item" :class="{ active: activeType === 'yue' }" @click="handleSelect('yue')">
<text class="label">余额支付</text>
<radio :checked="activeType === 'yue'" color="#09BB07"></radio>
</view>
<view class="confirm-btn" @click="confirm">确定</view>
</view>
</u-popup>
</template>
<script>
export default {
props: {
show: {
type: Boolean,
default: false
}
},
data() {
return {
activeType: 'weixin' // 默认选中微信支付
}
},
methods: {
close() {
this.$emit('update:show', false)
},
handleSelect(type) {
this.activeType = type
},
confirm() {
this.$emit('confirm', this.activeType)
this.close()
}
}
}
</script>
<style lang="less" scoped>
.pay-picker {
.title {
font-size: 32rpx;
font-weight: bold;
text-align: center;
margin-bottom: 40rpx;
}
.pay-item {
display: flex;
align-items: center;
padding: 20rpx;
margin-bottom: 20rpx;
border-radius: 10rpx;
background-color: #f5f5f5;
&.active {
background-color: #e8f5e9;
}
.icon {
width: 40rpx;
height: 40rpx;
margin-right: 20rpx;
}
.label {
flex: 1;
font-size: 28rpx;
color: #333;
}
radio {
transform: scale(0.8);
}
}
.confirm-btn {
margin-top: 40rpx;
height: 80rpx;
line-height: 80rpx;
text-align: center;
background-color: #C52733;
color: #fff;
border-radius: 40rpx;
font-size: 32rpx;
}
}
</style>