对接购物车
This commit is contained in:
@@ -142,7 +142,7 @@
|
||||
|
||||
<script setup>
|
||||
import { onMounted, ref, computed, watch, reactive } from 'vue'
|
||||
import { queryPayType, accountPay, cashPay, vipPay, buyerPage, payCreditPay } from '@/api/pay'
|
||||
import { queryPayType, accountPay, vipPay, buyerPage, payCreditPay } from '@/api/pay'
|
||||
import { queryMembermember, createMembermember, membermemberScanPay, accountPaymember } from '@/api/member/index.js'
|
||||
import { useUser } from "@/store/user.js"
|
||||
import { clearNoNum, formatDecimal } from '@/utils'
|
||||
@@ -151,7 +151,11 @@ import scanModal from '@/components/payCard/scanModal.vue'
|
||||
import { ElMessage } from "element-plus";
|
||||
import { useGlobal } from '@/store/global.js'
|
||||
import { staffPermission } from '@/api/user.js'
|
||||
import { fa } from 'element-plus/es/locale/index.mjs'
|
||||
import { cashPay } from '@/api/order.js'
|
||||
|
||||
import { useGoods } from '@/store/goods.js'
|
||||
|
||||
const goodsStore = useGoods()
|
||||
|
||||
const global = useGlobal()
|
||||
|
||||
@@ -304,6 +308,31 @@ async function payTypeChange(index, item) {
|
||||
// 结算支付
|
||||
async function confirmOrder() {
|
||||
try {
|
||||
payLoading.value = true
|
||||
// 暂时使用现金支付
|
||||
await cashPay({
|
||||
shopId: store.shopInfo.id,
|
||||
checkOrderPay: {
|
||||
orderId: goodsStore.orderInfo.id,
|
||||
userId: '',
|
||||
seatNum: 0, // 用餐人数
|
||||
originAmount: goodsStore.orderInfo.originAmount, // 订单原金额(包含打包费+餐位费) 不含折扣价格
|
||||
discountRatio: 1, // 折扣比例(计算时 向上取整保留 两位小数)
|
||||
discountAmount: 0, // 手动优惠金额
|
||||
productCouponDiscountAmount: 0, // 商品优惠券抵扣金额
|
||||
fullCouponDiscountAmount: 0, // 满减优惠券抵扣金额
|
||||
couponList: [], // 用户使用的卡券
|
||||
orderAmount: goodsStore.orderInfo.originAmount, // 订单金额
|
||||
roundAmount: 0, // 抹零金额 减免多少钱
|
||||
pointsDiscountAmount: 0, // 积分抵扣金额(tb_points_basic_setting表)
|
||||
pointsNum: 0 // 使用的积分数量 (扣除各类折扣 enable_deduction后使用)
|
||||
}
|
||||
})
|
||||
|
||||
payLoading.value = false
|
||||
ElMessage.success('支付成功')
|
||||
emit('paySuccess')
|
||||
return
|
||||
await staffPermission('yun_xu_shou_kuan')
|
||||
if (payLoading.value) return
|
||||
if (payActive.value == 'buyer') {
|
||||
@@ -477,7 +506,7 @@ function cancelDiscount() {
|
||||
|
||||
onMounted(() => {
|
||||
money.value = `${formatDecimal(props.amount)}`
|
||||
queryPayTypeAjax()
|
||||
// queryPayTypeAjax()
|
||||
})
|
||||
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user