代码提交
This commit is contained in:
@ -3,6 +3,7 @@
|
||||
ref="popupRef"
|
||||
:showCloseable="false"
|
||||
@close="emit('close')"
|
||||
@maskClick="clickMask"
|
||||
>
|
||||
<template v-if="couponList.length>0">
|
||||
<view
|
||||
@ -22,6 +23,7 @@
|
||||
@change="radioChage"
|
||||
>
|
||||
<CouponItem
|
||||
class="select-coupon"
|
||||
:coupons="item"
|
||||
:type="'noType'"
|
||||
/>
|
||||
@ -39,6 +41,7 @@
|
||||
>
|
||||
暂无可用的优惠券
|
||||
</Empty>
|
||||
<view class="action-height"></view>
|
||||
<view class="button-action">
|
||||
<view
|
||||
class="animation-button"
|
||||
@ -71,6 +74,7 @@ const popupRef = ref(false)
|
||||
const currentCoupon = ref({})
|
||||
const visible = ref(false)
|
||||
const couponItem = ref(props.currentCouponId ? props.currentCouponId : -1)
|
||||
const oldCoupon = ref(props.currentCouponId ? props.currentCouponId : -1)
|
||||
const num = ref(0)
|
||||
const radioValue = ref('')
|
||||
const selectCouponPanel = ref(false)
|
||||
@ -86,6 +90,7 @@ const handleSubmit = () => {
|
||||
close()
|
||||
return
|
||||
}
|
||||
oldCoupon.value = couponItem.value
|
||||
emit('submitCoupon', {
|
||||
couponId: couponItem.value
|
||||
})
|
||||
@ -100,6 +105,12 @@ const groupChange = (n) => {
|
||||
}
|
||||
}
|
||||
|
||||
const clickMask = () => {
|
||||
if (oldCoupon.value !== couponItem.value) {
|
||||
couponItem.value = oldCoupon.value
|
||||
}
|
||||
}
|
||||
|
||||
const radioChage = (n) => {
|
||||
radioValue.value = n
|
||||
num.value = 0
|
||||
@ -142,8 +153,7 @@ defineExpose({
|
||||
|
||||
.select-box {
|
||||
width: 100%;
|
||||
margin-bottom: 20rpx;
|
||||
|
||||
margin-bottom: 30rpx;
|
||||
.select-icon {
|
||||
width: 20rpx;
|
||||
height: 20rpx;
|
||||
@ -153,15 +163,26 @@ defineExpose({
|
||||
margin-bottom: 0 !important;
|
||||
padding: 0 60rpx;
|
||||
}
|
||||
.select-coupon {
|
||||
flex: 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.action-height{
|
||||
width: 100%;
|
||||
height: 80rpx;
|
||||
}
|
||||
|
||||
.button-action {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
left: 0;
|
||||
.animation-button {
|
||||
width: 100%;
|
||||
height: 80rpx;
|
||||
line-height: 80rpx;
|
||||
border-radius: 80rpx;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
|
||||
@ -14,6 +14,7 @@ import UvRadio from "@/uni_modules/uv-radio/components/uv-radio/uv-radio.vue";
|
||||
import { doPayment, PayType } from "@/utils/paymentUtils";
|
||||
import CouponSelect from "@/pages/submitOrder/components/coupon-select.vue";
|
||||
import Header from "@/components/Header/index.vue"
|
||||
import { useScroll } from "@/hooks/useScroll";
|
||||
|
||||
const {getParams, push, goBack} = useRouter()
|
||||
const {toast, loading, hideLoading} = useInterface();
|
||||
@ -117,16 +118,15 @@ async function handleConfirm() {
|
||||
subLoading.value = true
|
||||
try {
|
||||
const payInfo = await doCreateServiceOrder()
|
||||
debugger
|
||||
// 去拉取支付
|
||||
await doPayment({type: payType.value, payInfo})
|
||||
// #ifndef H5
|
||||
push({url: '/pages/payStatus/index?type=1'}, {type: 'redirectTo'})
|
||||
push({url: '/pages/payStatus/index'}, {type: 'redirectTo'})
|
||||
// #endif
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
toast({title: '支付失败'})
|
||||
push({url: '/pages/payStatus/index?type=2'}, {type: 'redirectTo'})
|
||||
push({url: '/pages/payStatus/index'}, {type: 'redirectTo'})
|
||||
} finally {
|
||||
subLoading.value = false
|
||||
mainStore.cartId = null
|
||||
@ -159,12 +159,7 @@ async function doCreateServiceOrder() {
|
||||
}
|
||||
}
|
||||
|
||||
const scrollTop = ref(0)
|
||||
|
||||
onPageScroll(e => {
|
||||
scrollTop.value = e.scrollTop
|
||||
})
|
||||
|
||||
useScroll()
|
||||
|
||||
/**
|
||||
* 检查路由参数
|
||||
@ -192,7 +187,7 @@ onLoad(async options => {
|
||||
<template>
|
||||
<view class="order-confirm">
|
||||
<!-- header -->
|
||||
<Header :scroll-top="scrollTop">
|
||||
<Header>
|
||||
提交订单
|
||||
</Header>
|
||||
<!-- 地址 -->
|
||||
|
||||
Reference in New Issue
Block a user