|
@@ -1,5 +1,6 @@
|
|
|
<script setup lang="ts">
|
|
<script setup lang="ts">
|
|
|
-import type { GasStationDetailVO, QueryCalPriceResponse } from '@/api/globals'
|
|
|
|
|
|
|
+import type { AppMemberCouponOrderVO, GasStationDetailVO, QueryCalPriceResponse } from '@/api/globals'
|
|
|
|
|
+import router from '@/router'
|
|
|
|
|
|
|
|
definePage({ name: 'confimOrder', islogin: true, style: { navigationBarTitleText: '下单', navigationStyle: 'custom' } })
|
|
definePage({ name: 'confimOrder', islogin: true, style: { navigationBarTitleText: '下单', navigationStyle: 'custom' } })
|
|
|
const showModel = ref(false)
|
|
const showModel = ref(false)
|
|
@@ -13,6 +14,8 @@ const refuelMoney = ref(null)
|
|
|
const showModelReful = ref(false)
|
|
const showModelReful = ref(false)
|
|
|
const { lat, lng } = storeToRefs(useUserStore())
|
|
const { lat, lng } = storeToRefs(useUserStore())
|
|
|
const ThreePrice = ref<QueryCalPriceResponse>()
|
|
const ThreePrice = ref<QueryCalPriceResponse>()
|
|
|
|
|
+const dkList = ref<AppMemberCouponOrderVO>()
|
|
|
|
|
+const isSeletDk = ref(false)
|
|
|
onLoad(async (options: any) => {
|
|
onLoad(async (options: any) => {
|
|
|
await getData(options.storeId)
|
|
await getData(options.storeId)
|
|
|
})
|
|
})
|
|
@@ -62,6 +65,20 @@ async function handleBlur() {
|
|
|
// if (Number(refuelMoney.value) < 10) {
|
|
// if (Number(refuelMoney.value) < 10) {
|
|
|
// return useGlobalToast().show('最小金额为10元')
|
|
// return useGlobalToast().show('最小金额为10元')
|
|
|
// }
|
|
// }
|
|
|
|
|
+ if (!storeDetail.value)
|
|
|
|
|
+ return
|
|
|
|
|
+ if (!storeDetail.value.allowanceClientScheme) {
|
|
|
|
|
+ const res = await Apis.app.get_smqjh_system_app_api_membercoupon_findplaceorderlist({
|
|
|
|
|
+ params: {
|
|
|
|
|
+ storeId: storeDetail.value?.storeId,
|
|
|
|
|
+ orderAmount: Number(refuelMoney.value) * 100,
|
|
|
|
|
+ },
|
|
|
|
|
+ })
|
|
|
|
|
+
|
|
|
|
|
+ dkList.value = res.data
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+async function getMoney() {
|
|
|
if (!storeDetail.value)
|
|
if (!storeDetail.value)
|
|
|
return
|
|
return
|
|
|
const nams = storeDetail.value?.itemInfoList?.find(item => item.itemId === refuelNumber.value)?.itemName
|
|
const nams = storeDetail.value?.itemInfoList?.find(item => item.itemId === refuelNumber.value)?.itemName
|
|
@@ -72,16 +89,9 @@ async function handleBlur() {
|
|
|
openChannel: 0,
|
|
openChannel: 0,
|
|
|
outUserId: '',
|
|
outUserId: '',
|
|
|
mobile: '',
|
|
mobile: '',
|
|
|
|
|
+ promotionInfo: selectDk.value === 'nodk' ? [] : [{ allowanceId: selectDk.value }],
|
|
|
} })
|
|
} })
|
|
|
ThreePrice.value = data
|
|
ThreePrice.value = data
|
|
|
- console.log(data)
|
|
|
|
|
- const res = await Apis.app.get_smqjh_system_app_api_membercoupon_findplaceorderlist({
|
|
|
|
|
- params: {
|
|
|
|
|
- storeId: storeDetail.value?.storeId,
|
|
|
|
|
- orderAmount: Number(refuelMoney.value) * 100,
|
|
|
|
|
- },
|
|
|
|
|
- })
|
|
|
|
|
- console.log(res)
|
|
|
|
|
}
|
|
}
|
|
|
async function goPay() {
|
|
async function goPay() {
|
|
|
uni.showLoading({ mask: true })
|
|
uni.showLoading({ mask: true })
|
|
@@ -102,10 +112,11 @@ async function goPay() {
|
|
|
storePrice: Number(priceData.value?.storePrice),
|
|
storePrice: Number(priceData.value?.storePrice),
|
|
|
storeId: storeDetail.value?.storeId,
|
|
storeId: storeDetail.value?.storeId,
|
|
|
itemName: priceData.value?.itemName,
|
|
itemName: priceData.value?.itemName,
|
|
|
|
|
+ promotionInfo: selectDk.value === 'nodk' ? [] : [{ allowanceId: selectDk.value }],
|
|
|
} })
|
|
} })
|
|
|
- const url = `${res.data}&redirectUrl=https://smqjh.admin.zswlgz.com/h5`
|
|
|
|
|
|
|
+ console.log(res, '===============================================支付')
|
|
|
// #ifdef H5
|
|
// #ifdef H5
|
|
|
- window.location.href = url
|
|
|
|
|
|
|
+ useUserStore().handleCommonPath(res.data as string)
|
|
|
// #endif
|
|
// #endif
|
|
|
uni.hideLoading()
|
|
uni.hideLoading()
|
|
|
}
|
|
}
|
|
@@ -113,6 +124,24 @@ async function goPay() {
|
|
|
uni.hideLoading()
|
|
uni.hideLoading()
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+function handleSelectDk() {
|
|
|
|
|
+ console.log(selectDk.value, '==============')
|
|
|
|
|
+ if (selectDk.value === 'nodk') {
|
|
|
|
|
+ return '不使用抵扣券'
|
|
|
|
|
+ }
|
|
|
|
|
+ if (dkList.value?.appCouponOrderOptimalVO?.allowanceId === selectDk.value) {
|
|
|
|
|
+ return `${getSelectDkInfo()?.discountMoney}元`
|
|
|
|
|
+ }
|
|
|
|
|
+ else {
|
|
|
|
|
+ return `${getSelectDkInfo()?.discountMoney}元`
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+function getSelectDkInfo() {
|
|
|
|
|
+ if (dkList.value?.appCouponOrderOptimalVO?.allowanceId === selectDk.value) {
|
|
|
|
|
+ return dkList.value?.appCouponOrderOptimalVO
|
|
|
|
|
+ }
|
|
|
|
|
+ return dkList.value?.appCouponOrderVOList?.find(item => item.allowanceId === selectDk.value)
|
|
|
|
|
+}
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
|
<template>
|
|
<template>
|
|
@@ -177,28 +206,30 @@ async function goPay() {
|
|
|
最小金额10元
|
|
最小金额10元
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
- <view class="mt20rpx rounded-16rpx bg-white px24rpx py28rpx">
|
|
|
|
|
|
|
+ <view v-if="refuelMoney" class="mt20rpx rounded-16rpx bg-white px24rpx py28rpx">
|
|
|
<view class="flex items-center">
|
|
<view class="flex items-center">
|
|
|
<view class="mr20rpx text-28rpx font-semibold">
|
|
<view class="mr20rpx text-28rpx font-semibold">
|
|
|
抵扣券
|
|
抵扣券
|
|
|
</view>
|
|
</view>
|
|
|
- <wd-button size="small">
|
|
|
|
|
|
|
+ <wd-button size="small" @click="router.push({ name: 'activityList' })">
|
|
|
去兑换
|
|
去兑换
|
|
|
</wd-button>
|
|
</wd-button>
|
|
|
</view>
|
|
</view>
|
|
|
- <view class="mt24rpx flex items-center justify-between rounded-8rpx bg-#F9F9F9 px24rpx py20rpx" @click="showModelJf = true">
|
|
|
|
|
|
|
+ <view class="mt24rpx flex items-center justify-between rounded-8rpx bg-#F9F9F9 px24rpx py20rpx" @click="showModelJf = true && !storeDetail.allowanceClientScheme">
|
|
|
<view class="text-28rpx text-#aaa">
|
|
<view class="text-28rpx text-#aaa">
|
|
|
- 暂无抵扣券
|
|
|
|
|
|
|
+ {{ storeDetail.allowanceClientScheme ? '该加油站不可使用抵扣券' : isSeletDk && selectDk ? handleSelectDk() : '暂无抵扣券' }}
|
|
|
</view>
|
|
</view>
|
|
|
<wd-icon name="arrow-down" size="32rpx" color="#aaa" />
|
|
<wd-icon name="arrow-down" size="32rpx" color="#aaa" />
|
|
|
</view>
|
|
</view>
|
|
|
- <view class="mt16rpx">
|
|
|
|
|
- 已选:满200元可抵扣100元(最优)
|
|
|
|
|
- </view>
|
|
|
|
|
- <view class="mt16rpx">
|
|
|
|
|
- 抵扣金额:-¥100
|
|
|
|
|
- </view>
|
|
|
|
|
- <template v-if="ThreePrice && refuelMoney">
|
|
|
|
|
|
|
+ <template v-if="selectDk !== 'nodk' && isSeletDk">
|
|
|
|
|
+ <view class="mt16rpx">
|
|
|
|
|
+ 已选:满{{ getSelectDkInfo()?.amountMoney }}元可抵扣{{ getSelectDkInfo()?.discountMoney }}元 {{ dkList?.appCouponOrderOptimalVO?.allowanceId === selectDk ? '(最优)' : '' }}
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <view class="mt16rpx">
|
|
|
|
|
+ 抵扣金额:-¥{{ getSelectDkInfo()?.discountMoney }}
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ <template v-if="selectDk && ThreePrice && refuelMoney">
|
|
|
<view class="mb20rpx mt24rpx text-32rpx font-semibold">
|
|
<view class="mb20rpx mt24rpx text-32rpx font-semibold">
|
|
|
价格明细
|
|
价格明细
|
|
|
</view>
|
|
</view>
|
|
@@ -212,13 +243,13 @@ async function goPay() {
|
|
|
<view class="text-#aaa">
|
|
<view class="text-#aaa">
|
|
|
抵扣券
|
|
抵扣券
|
|
|
</view>
|
|
</view>
|
|
|
- <view>-¥100</view>
|
|
|
|
|
|
|
+ <view>-¥{{ getSelectDkInfo()?.discountMoney || 0 }}</view>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="mt20rpx flex items-center justify-between text-28rpx">
|
|
<view class="mt20rpx flex items-center justify-between text-28rpx">
|
|
|
<view class="text-#aaa">
|
|
<view class="text-#aaa">
|
|
|
服务费
|
|
服务费
|
|
|
</view>
|
|
</view>
|
|
|
- <view>+¥{{ ThreePrice.promotionAmount ? ThreePrice.promotionAmount / 100 : 0 }}</view>
|
|
|
|
|
|
|
+ <view>+¥{{ ThreePrice.serviceFee ? ThreePrice.serviceFee / 100 : 0 }}</view>
|
|
|
</view>
|
|
</view>
|
|
|
|
|
|
|
|
<view class="my24rpx h2rpx w-full bg-#F0F0F0" />
|
|
<view class="my24rpx h2rpx w-full bg-#F0F0F0" />
|
|
@@ -284,9 +315,9 @@ async function goPay() {
|
|
|
<view class="text-28rpx">
|
|
<view class="text-28rpx">
|
|
|
不使用抵扣券
|
|
不使用抵扣券
|
|
|
</view>
|
|
</view>
|
|
|
- <wd-radio :value="1" />
|
|
|
|
|
|
|
+ <wd-radio value="nodk" />
|
|
|
</view>
|
|
</view>
|
|
|
- <view class="mt24rpx">
|
|
|
|
|
|
|
+ <view v-if="dkList?.appCouponOrderOptimalVO" class="mt24rpx">
|
|
|
<view class="text-28rpx">
|
|
<view class="text-28rpx">
|
|
|
自动推荐
|
|
自动推荐
|
|
|
</view>
|
|
</view>
|
|
@@ -296,10 +327,10 @@ async function goPay() {
|
|
|
<view class="text-40rpx text-#ff4d3a font-semibold">
|
|
<view class="text-40rpx text-#ff4d3a font-semibold">
|
|
|
<text class="text-24rpx">
|
|
<text class="text-24rpx">
|
|
|
¥
|
|
¥
|
|
|
- </text> 100
|
|
|
|
|
|
|
+ </text> {{ dkList.appCouponOrderOptimalVO.discountMoney }}
|
|
|
</view>
|
|
</view>
|
|
|
<view class="ml20rpx text-32rpx font-semibold">
|
|
<view class="ml20rpx text-32rpx font-semibold">
|
|
|
- 满200元可用
|
|
|
|
|
|
|
+ {{ dkList.appCouponOrderOptimalVO.amountMoney ? `满${dkList.appCouponOrderOptimalVO.amountMoney}元可用` : '无使用门槛' }}
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="mt24rpx flex items-center text-#aaa">
|
|
<view class="mt24rpx flex items-center text-#aaa">
|
|
@@ -307,30 +338,95 @@ async function goPay() {
|
|
|
可抵扣
|
|
可抵扣
|
|
|
</view>
|
|
</view>
|
|
|
<view class="ml20rpx text-24rpx font-semibold">
|
|
<view class="ml20rpx text-24rpx font-semibold">
|
|
|
- 有效期:2022-01-01至2022-01-01
|
|
|
|
|
|
|
+ 有效期:{{ dkList.appCouponOrderOptimalVO.expirationTime }}
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="h-full w134rpx flex items-center justify-center border-l-2rpx border-l-#FF4D3A border-l-dashed">
|
|
<view class="h-full w134rpx flex items-center justify-center border-l-2rpx border-l-#FF4D3A border-l-dashed">
|
|
|
- <wd-radio :value="1" />
|
|
|
|
|
|
|
+ <wd-radio :value="dkList.appCouponOrderOptimalVO.allowanceId as string" />
|
|
|
</view>
|
|
</view>
|
|
|
<view class="absolute right-150rpx h30rpx w30rpx rounded-full bg-white -top-10rpx" />
|
|
<view class="absolute right-150rpx h30rpx w30rpx rounded-full bg-white -top-10rpx" />
|
|
|
<view class="absolute right-150rpx h30rpx w30rpx rounded-full bg-white -bottom-10rpx" />
|
|
<view class="absolute right-150rpx h30rpx w30rpx rounded-full bg-white -bottom-10rpx" />
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
|
|
+ <scroll-view scroll-y class="h600rpx pb40rpx">
|
|
|
|
|
+ <view v-if="dkList?.appCouponOrderVOList" class="mt24rpx">
|
|
|
|
|
+ <view class="text-28rpx">
|
|
|
|
|
+ 其他可用券
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <view v-for="item in dkList.appCouponOrderVOList" :key="item.allowanceId" class="relative mt20rpx box-border h144rpx flex items-center justify-between rounded-16rpx bg-[rgba(255,77,58,0.1)] px28rpx py24rpx">
|
|
|
|
|
+ <view class="flex-1">
|
|
|
|
|
+ <view class="flex items-center">
|
|
|
|
|
+ <view class="text-40rpx text-#ff4d3a font-semibold">
|
|
|
|
|
+ <text class="text-24rpx">
|
|
|
|
|
+ ¥
|
|
|
|
|
+ </text> {{ item.discountMoney }}
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <view class="ml20rpx text-32rpx font-semibold">
|
|
|
|
|
+ {{ item.amountMoney ? `满${item.amountMoney}元可用` : '无使用门槛' }}
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <view class="mt24rpx flex items-center text-#aaa">
|
|
|
|
|
+ <view class="text-center text-20rpx">
|
|
|
|
|
+ 可抵扣
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <view class="ml20rpx text-24rpx font-semibold">
|
|
|
|
|
+ 有效期:{{ item.expirationTime }}
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <view class="h-full w134rpx flex items-center justify-center border-l-2rpx border-l-#FF4D3A border-l-dashed">
|
|
|
|
|
+ <wd-radio :value="item.allowanceId as string" />
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <view class="absolute right-150rpx h30rpx w30rpx rounded-full bg-white -top-10rpx" />
|
|
|
|
|
+ <view class="absolute right-150rpx h30rpx w30rpx rounded-full bg-white -bottom-10rpx" />
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <view v-if="dkList?.appCouponNoOrderVOList" class="mt24rpx">
|
|
|
|
|
+ <view class="text-28rpx">
|
|
|
|
|
+ 不可用
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <view v-for="item in dkList.appCouponNoOrderVOList" :key="item.allowanceId" class="relative mt20rpx box-border h144rpx flex items-center justify-between rounded-16rpx bg-[#E6E6E6] px28rpx py24rpx">
|
|
|
|
|
+ <view class="flex-1">
|
|
|
|
|
+ <view class="flex items-center">
|
|
|
|
|
+ <view class="text-40rpx text-#AAAAAA font-semibold">
|
|
|
|
|
+ <text class="text-24rpx">
|
|
|
|
|
+ ¥
|
|
|
|
|
+ </text> {{ item.discountMoney }}
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <view class="ml20rpx text-32rpx text-#646464 font-semibold">
|
|
|
|
|
+ {{ item.amountMoney ? `满${item.amountMoney}元可用` : '无使用门槛' }}
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <view class="mt24rpx flex items-center text-#aaa">
|
|
|
|
|
+ <view class="text-center text-20rpx">
|
|
|
|
|
+ 可抵扣
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <view class="ml20rpx text-24rpx font-semibold">
|
|
|
|
|
+ 有效期:{{ item.expirationTime }}
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <view class="h-full w134rpx flex items-center justify-center border-l-2rpx border-l-#AAAAAA border-l-dashed">
|
|
|
|
|
+ <wd-radio :value="item.allowanceId as string" disabled />
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <view class="absolute right-150rpx h30rpx w30rpx rounded-full bg-white -top-10rpx" />
|
|
|
|
|
+ <view class="absolute right-150rpx h30rpx w30rpx rounded-full bg-white -bottom-10rpx" />
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </scroll-view>
|
|
|
</wd-radio-group>
|
|
</wd-radio-group>
|
|
|
</view>
|
|
</view>
|
|
|
- <view class="h200rpx" />
|
|
|
|
|
<template #footer>
|
|
<template #footer>
|
|
|
<view class="my24rpx h2rpx w-full bg-#F0F0F0" />
|
|
<view class="my24rpx h2rpx w-full bg-#F0F0F0" />
|
|
|
- <wd-button block size="large">
|
|
|
|
|
|
|
+ <wd-button block size="large" @click="showModelJf = false, isSeletDk = true, getMoney()">
|
|
|
确认选择
|
|
确认选择
|
|
|
</wd-button>
|
|
</wd-button>
|
|
|
</template>
|
|
</template>
|
|
|
</Zpopup>
|
|
</Zpopup>
|
|
|
<FixedLayout>
|
|
<FixedLayout>
|
|
|
- <view :class="[ThreePrice && refuelMoney && 'justify-between flex items-center']">
|
|
|
|
|
- <view v-if="ThreePrice && refuelMoney" class="text-32rpx text-#FF4A39 font-semibold">
|
|
|
|
|
|
|
+ <view :class="[selectDk && ThreePrice && refuelMoney && 'justify-between flex items-center']">
|
|
|
|
|
+ <view v-if="selectDk && ThreePrice && refuelMoney" class="text-32rpx text-#FF4A39 font-semibold">
|
|
|
<text class="text-24rpx">
|
|
<text class="text-24rpx">
|
|
|
¥
|
|
¥
|
|
|
</text><text>{{ ThreePrice?.realPrice ? ThreePrice?.realPrice / 100 : 0 }}</text>
|
|
</text><text>{{ ThreePrice?.realPrice ? ThreePrice?.realPrice / 100 : 0 }}</text>
|