新增营销系统、分销系统、会员功能、门店、提现功能
This commit is contained in:
@ -5,7 +5,7 @@
|
||||
* @description:index.data
|
||||
* @update: 2023-11-08 11:08
|
||||
* */
|
||||
import { wechatIcon } from "@/utils/images";
|
||||
import { balanceIcon, wechatIcon } from "@/utils/images";
|
||||
import { PayType } from "@/utils/paymentUtils";
|
||||
import { aliIcon } from "@/utils/images";
|
||||
|
||||
@ -16,7 +16,13 @@ export const payRows = [
|
||||
icon: wechatIcon,
|
||||
type: PayType["0"],
|
||||
disabled: false
|
||||
|
||||
},
|
||||
{
|
||||
label: '余额支付',
|
||||
eLabel: 'Balance Pay',
|
||||
icon: balanceIcon,
|
||||
type: PayType["1"],
|
||||
disabled: false
|
||||
},
|
||||
{
|
||||
label: '支付宝支付',
|
||||
|
@ -15,11 +15,12 @@ import { doPayment, PayType } from "@/utils/paymentUtils";
|
||||
import { orderInfo as orderInfoRequest } from "@/api/order";
|
||||
import { useInterface } from "@/hooks/useInterface";
|
||||
import { useRouter } from "@/hooks/useRouter";
|
||||
import {useMainStore} from "@/store/store";
|
||||
|
||||
const {toast} = useInterface()
|
||||
const {push} = useRouter()
|
||||
const emits = defineEmits(['confirm', 'close']);
|
||||
|
||||
const mainStore = useMainStore()
|
||||
const popupRef = ref()
|
||||
|
||||
async function show(orderId) {
|
||||
@ -36,9 +37,16 @@ defineExpose({show})
|
||||
const payType = ref(PayType["0"]) // 支付方式
|
||||
|
||||
const orderInfo = ref({}) // 订单信息
|
||||
|
||||
const zeroPrice = ref(false) // 本单金额是否为0
|
||||
async function doGetOrderDetail(orderId) {
|
||||
orderInfo.value = await orderInfoRequest({key: orderId});
|
||||
if (orderInfo.value.totalPrice <= 0) {
|
||||
payType.value = PayType["1"]
|
||||
zeroPrice.value = true
|
||||
toast({title: '支付金额为0.00,自动选择余额支付', icon: 'none', duration: 3000})
|
||||
} else {
|
||||
zeroPrice.value = false
|
||||
}
|
||||
}
|
||||
|
||||
const subLoading = ref(false)
|
||||
@ -46,13 +54,13 @@ const subLoading = ref(false)
|
||||
async function handleSubmit() {
|
||||
try {
|
||||
subLoading.value = true
|
||||
await doPayment({type: payType.value, payInfo: orderInfo.value})
|
||||
await doPayment({type: payType.value, payInfo: orderInfo.value,isGroup:orderInfo.value.campaignType===1})
|
||||
subLoading.value = false
|
||||
emits('confirm')
|
||||
close()
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
push({url: '/pages/payStatus/index'},{data:{type:2}})
|
||||
push({url: '/pages/payStatus/index'}, {data: {type: 2}})
|
||||
toast({title: '支付失败了'})
|
||||
close()
|
||||
}
|
||||
@ -81,7 +89,7 @@ async function handleSubmit() {
|
||||
>
|
||||
<uv-radio
|
||||
:name="pay.type"
|
||||
:disabled="pay.disabled"
|
||||
:disabled="pay.disabled|| (pay.type===PayType['0']&&zeroPrice) || (mainStore.user.nowMoney===0 &&!zeroPrice&&pay.type===PayType['1'])"
|
||||
>
|
||||
<view class="pay-row flex flex-ai__center">
|
||||
<image
|
||||
@ -89,8 +97,11 @@ async function handleSubmit() {
|
||||
:src="pay.icon"
|
||||
/>
|
||||
<view class="info">
|
||||
<view class="label">
|
||||
<view class="label flex flex-nowrap flex-ai__end" style="white-space: nowrap">
|
||||
{{ pay.label }}
|
||||
<span v-if="pay.type===PayType['1']" style="font-size: 16rpx;white-space: nowrap;">
|
||||
({{mainStore.user.nowMoney}}元)
|
||||
</span>
|
||||
</view>
|
||||
<view>
|
||||
{{ pay.eLabel }}
|
||||
|
Reference in New Issue
Block a user