团购支付
This commit is contained in:
@@ -14,7 +14,7 @@
|
||||
<view class='divider' style='margin: 40rpx 0' />
|
||||
<view class='c-flex-row' @click.stop='doPayment(PAYMENT_TYPE_BALANCE)'>
|
||||
<image :src='assetsUrl("ic_balance.png")' />
|
||||
<text>余额(剩余¥100)</text>
|
||||
<text>余额(剩余¥{{ userInfo.balance }})</text>
|
||||
<image :src='assetsUrl(currentType===PAYMENT_TYPE_BALANCE?"ic_checkbox_active.png":"ic_checkbox_normal.png")' />
|
||||
</view>
|
||||
</view>
|
||||
@@ -23,11 +23,16 @@
|
||||
|
||||
<script lang='ts' setup>
|
||||
import { assetsUrl } from '@/utils/assets';
|
||||
import { useUserStore } from '@/store';
|
||||
|
||||
const popupRef = ref();
|
||||
const PAYMENT_TYPE_WECHAT = 0;
|
||||
const PAYMENT_TYPE_BALANCE = 1;
|
||||
const currentType = ref(PAYMENT_TYPE_WECHAT);
|
||||
const PAYMENT_TYPE_WECHAT = ref(0);
|
||||
const PAYMENT_TYPE_BALANCE = ref(1);
|
||||
const currentType = ref(PAYMENT_TYPE_WECHAT.value);
|
||||
|
||||
const userStore = useUserStore();
|
||||
|
||||
const { userInfo } = storeToRefs(userStore);
|
||||
|
||||
const emits = defineEmits(['change']);
|
||||
const show = () => {
|
||||
@@ -42,10 +47,10 @@ const doPayment = (paymentType: number) => {
|
||||
emits('change', paymentType);
|
||||
currentType.value = paymentType;
|
||||
switch (paymentType) {
|
||||
case PAYMENT_TYPE_WECHAT:
|
||||
case PAYMENT_TYPE_WECHAT.value:
|
||||
console.log('PAYMENT_TYPE_WECHAT');
|
||||
break;
|
||||
case PAYMENT_TYPE_BALANCE:
|
||||
case PAYMENT_TYPE_BALANCE.value:
|
||||
console.log('PAYMENT_TYPE_BALANCE');
|
||||
break;
|
||||
}
|
||||
|
Reference in New Issue
Block a user