|
|
@@ -18,8 +18,17 @@ const remarks = ref('')
|
|
|
const initialCouponId = ref<string | undefined>(undefined)
|
|
|
const confirmedCouponId = ref<string | undefined>(undefined)
|
|
|
const draftCouponId = ref<string | undefined>(undefined)
|
|
|
-
|
|
|
+const list = ref<string[]>(['即时配送', '自提'])
|
|
|
+const current = ref('即时配送')
|
|
|
+const model = reactive<{
|
|
|
+ value1: string
|
|
|
+ value2: string
|
|
|
+}>({
|
|
|
+ value1: '',
|
|
|
+ value2: '',
|
|
|
+})
|
|
|
const deliveryType = ref(1)
|
|
|
+const isMemberGiftOrder = computed(() => !!orderInfo.value?.memberGiftItems?.length)
|
|
|
|
|
|
// 优惠券选择
|
|
|
const couponPopup = ref(false)
|
|
|
@@ -124,6 +133,16 @@ async function handlePay() {
|
|
|
}
|
|
|
isPay.value = true
|
|
|
try {
|
|
|
+ if (isMemberGiftOrder.value) {
|
|
|
+ await Apis.sys.giftsReceive({
|
|
|
+ data: {
|
|
|
+ addressId: selectedAddress.value.id,
|
|
|
+ items: orderInfo.value.memberGiftItems,
|
|
|
+ },
|
|
|
+ })
|
|
|
+ await useUserStore().paySuccess('xsb-order', 'subPack-xsb/commonTab/index')
|
|
|
+ return
|
|
|
+ }
|
|
|
const orderItemList = orderInfo.value?.skuList.map((it) => {
|
|
|
return {
|
|
|
prodCount: it.num,
|
|
|
@@ -164,8 +183,10 @@ async function handlePay() {
|
|
|
|
|
|
<template>
|
|
|
<view class="page px20rpx py20rpx">
|
|
|
+ <wd-segmented v-model:value="current" :options="list" />
|
|
|
<view
|
|
|
- class="mb20rpx rounded-16rpx bg-white p24rpx"
|
|
|
+ v-if="current === '即时配送'"
|
|
|
+ class="my20rpx rounded-16rpx bg-white p24rpx"
|
|
|
@click="router.push({ name: 'common-addressList', params: { type: 'select' } })"
|
|
|
>
|
|
|
<view class="flex items-center justify-between">
|
|
|
@@ -197,6 +218,45 @@ async function handlePay() {
|
|
|
</view>
|
|
|
</view>
|
|
|
|
|
|
+ <view v-else class="my20rpx rounded-16rpx bg-white p24rpx">
|
|
|
+ <view class="flex items-center gap-50rpx">
|
|
|
+ <view>
|
|
|
+ <view class="text-28rpx font-semibold">
|
|
|
+ 自提点:星闪豹(贵阳店)
|
|
|
+ </view>
|
|
|
+ <view class="mt-20rpx text-24rpx text-#AAAAAA">
|
|
|
+ 贵州省贵阳市贵阳市观山湖区金麦安置小区12组团26号-28号门面
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view>
|
|
|
+ <view class="mb-20rpx text-24rpx text-#AAAAAA">
|
|
|
+ 距你XXkm
|
|
|
+ </view>
|
|
|
+ <wd-icon name="location" size="22px" color="#9ED605" />
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view>
|
|
|
+ <wd-input
|
|
|
+ v-model="model.value1"
|
|
|
+ label="联系人"
|
|
|
+ label-width="80px"
|
|
|
+ prop="value1"
|
|
|
+ clearable
|
|
|
+ placeholder="请输入联系人"
|
|
|
+ :rules="[{ required: true, message: '请填写联系人' }]"
|
|
|
+ />
|
|
|
+ <wd-input
|
|
|
+ v-model="model.value2"
|
|
|
+ label="预留电话"
|
|
|
+ label-width="80px"
|
|
|
+ prop="value1"
|
|
|
+ clearable
|
|
|
+ placeholder="请输入预留电话"
|
|
|
+ :rules="[{ required: true, pattern: /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/, message: '请输入正确的手机号' }]"
|
|
|
+ />
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+
|
|
|
<view class="rounded-16rpx bg-white p24rpx">
|
|
|
<view class="flex items-center text-28rpx font-semibold">
|
|
|
{{ orderInfo?.shopName }}
|
|
|
@@ -244,7 +304,7 @@ async function handlePay() {
|
|
|
¥{{ orderInfo?.transfee }}
|
|
|
</view>
|
|
|
</view>
|
|
|
- <view class="mb28rpx flex items-center justify-between text-28rpx" @click="openCouponPopup">
|
|
|
+ <view v-if="!isMemberGiftOrder" class="mb28rpx flex items-center justify-between text-28rpx" @click="openCouponPopup">
|
|
|
<view>优惠券</view>
|
|
|
<view class="flex items-center">
|
|
|
<view v-if="currentCouponDiscount > 0" class="text-[#FF4D3A] font-semibold">
|
|
|
@@ -256,7 +316,7 @@ async function handlePay() {
|
|
|
<wd-icon name="arrow-right" size="18px" color="#aaa" class="ml10rpx" />
|
|
|
</view>
|
|
|
</view>
|
|
|
- <view class="flex items-center justify-between text-28rpx">
|
|
|
+ <view v-if="!isMemberGiftOrder" class="flex items-center justify-between text-28rpx">
|
|
|
<view>积分({{ offsetPoints }})</view>
|
|
|
<view class="text-#FF4D3A font-semibold">
|
|
|
- ¥{{ offsetPoints / 100 }}
|
|
|
@@ -272,12 +332,18 @@ async function handlePay() {
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
+ <view v-if="isMemberGiftOrder" class="mt20rpx flex items-center gap-20rpx rounded-16rpx bg-white p24rpx">
|
|
|
+ <wd-icon name="warning" size="16px" color="#FF4D3A" />
|
|
|
+ <text class="text-24rpx">
|
|
|
+ 本商品为会员权益赠品,购买后不支持售后
|
|
|
+ </text>
|
|
|
+ </view>
|
|
|
<view class="mt20rpx flex items-center rounded-16rpx bg-white p24rpx">
|
|
|
<view class="w80rpx">
|
|
|
备注
|
|
|
</view>
|
|
|
<view class="flex-1">
|
|
|
- <wd-input v-model="remarks" placeholder="选填,请先和商家协商一致,付款后商家可见" no-border clearable />
|
|
|
+ <wd-input v-model="remarks" placeholder="选填,请先和商家协商一致,付款后商家可见" clearable no-border />
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="h250rpx" />
|
|
|
@@ -356,7 +422,7 @@ async function handlePay() {
|
|
|
</view>
|
|
|
</template>
|
|
|
</Zpopup>
|
|
|
- <view class="ios footer fixed bottom-0 left-0 box-border w-full rounded-t-16rpx bg-white px24rpx">
|
|
|
+ <view class="ios footer fixed bottom-0 left-0 z-1000 box-border w-full rounded-t-16rpx bg-white px24rpx">
|
|
|
<view class="box-border w-full flex items-center justify-between py20rpx">
|
|
|
<view class="flex items-center text-#FF4D3A">
|
|
|
<view class="font-semibold10 flex items-baseline text-36rpx">
|