feat: 增加现金支付
This commit is contained in:
@@ -10,3 +10,4 @@ package-lock.json
|
|||||||
*.keystore
|
*.keystore
|
||||||
pnpm-lock.yaml
|
pnpm-lock.yaml
|
||||||
.history
|
.history
|
||||||
|
/AGENTS.md
|
||||||
|
|||||||
@@ -1,222 +1,218 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="flex-center" :class="{
|
<view
|
||||||
|
class="flex-center"
|
||||||
|
:class="{
|
||||||
'ju-flex-end': props.type == 2,
|
'ju-flex-end': props.type == 2,
|
||||||
'ju-between': props.type != 2,
|
'ju-between': props.type != 2,
|
||||||
}">
|
}"
|
||||||
<view class="more size24" v-if="props.type != 2"></view>
|
>
|
||||||
<view class="flex-center ju-flex-end">
|
<view class="more size24" v-if="props.type != 2"></view>
|
||||||
|
<view class="flex-center ju-flex-end">
|
||||||
<view v-for="(item, index) in btns" :key="index">
|
<view v-for="(item, index) in btns" :key="index">
|
||||||
<view
|
<view
|
||||||
v-if="
|
v-if="
|
||||||
item.value.split(',').indexOf(String(props?.data?.status)) !== -1 &&
|
item.value.split(',').indexOf(String(props?.data?.status)) !== -1 &&
|
||||||
!(item.id === 3 && Number(props?.data?.type) === 5)
|
!(item.id === 3 && Number(props?.data?.type) === 5) &&
|
||||||
|
!(item.id === 3 && props?.data?.payChannelCode === 'cash_payment')
|
||||||
"
|
"
|
||||||
class="btn size28 f500"
|
class="btn size28 f500"
|
||||||
@click.stop="btnClick(item.id)"
|
@click.stop="btnClick(item.id)"
|
||||||
:style="{ color: item.color, background: item.background, border: item.border }"
|
:style="{ color: item.color, background: item.background, border: item.border }"
|
||||||
:class="{btn1: props.type == 2}">
|
:class="{ btn1: props.type == 2 }"
|
||||||
{{ item.name }}
|
>
|
||||||
</view>
|
{{ item.name }}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import {
|
import { ref, getCurrentInstance, defineProps, defineEmits } from 'vue';
|
||||||
ref,
|
import sheep from '@/sheep';
|
||||||
getCurrentInstance,
|
import OrderApi from '@/sheep/api/trade/order';
|
||||||
defineProps,
|
const { proxy } = getCurrentInstance();
|
||||||
defineEmits
|
|
||||||
} from 'vue';
|
|
||||||
import sheep from '@/sheep';
|
|
||||||
import OrderApi from '@/sheep/api/trade/order';
|
|
||||||
const {
|
|
||||||
proxy
|
|
||||||
} = getCurrentInstance();
|
|
||||||
|
|
||||||
let emit = defineEmits(['downData']);
|
let emit = defineEmits(['downData']);
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
data: {
|
data: {
|
||||||
type: Object,
|
type: Object,
|
||||||
default () {
|
default() {
|
||||||
return {};
|
return {};
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
type: {
|
type: {
|
||||||
type: String,
|
type: String,
|
||||||
default: '0', //0列表2订单详情
|
default: '0', //0列表2订单详情
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
let btns = ref([{
|
let btns = ref([
|
||||||
id: 1,
|
{
|
||||||
name: '取消订单',
|
id: 1,
|
||||||
value: '0',
|
name: '取消订单',
|
||||||
},
|
value: '0,70',
|
||||||
{
|
},
|
||||||
id: 2,
|
{
|
||||||
name: '去付款',
|
id: 2,
|
||||||
value: '0',
|
name: '去付款',
|
||||||
color: '#EE0A24',
|
value: '0',
|
||||||
background: 'rgba(238,10,36,0.2)',
|
color: '#EE0A24',
|
||||||
border: 'none'
|
background: 'rgba(238,10,36,0.2)',
|
||||||
},
|
border: 'none',
|
||||||
{ //在订单详情退货
|
},
|
||||||
id: 3,
|
{
|
||||||
name: '申请售后',
|
//在订单详情退货
|
||||||
value: '10,20',
|
id: 3,
|
||||||
},
|
name: '申请售后',
|
||||||
{
|
value: '10,20',
|
||||||
id: 4,
|
},
|
||||||
name: '确认收货',
|
{
|
||||||
value: '20,60',
|
id: 4,
|
||||||
color: '#EE0A24',
|
name: '确认收货',
|
||||||
background: 'rgba(238,10,36,0.2)',
|
value: '20,60',
|
||||||
border: 'none'
|
color: '#EE0A24',
|
||||||
},
|
background: 'rgba(238,10,36,0.2)',
|
||||||
{
|
border: 'none',
|
||||||
id: 5,
|
},
|
||||||
name: '再次购买',
|
{
|
||||||
value: '30,50,40',
|
id: 5,
|
||||||
color: '#FA9C31',
|
name: '再次购买',
|
||||||
},
|
value: '30,50,40',
|
||||||
{
|
color: '#FA9C31',
|
||||||
id: 6,
|
},
|
||||||
name: '取消售后',
|
{
|
||||||
value: '60',
|
id: 6,
|
||||||
},
|
name: '取消售后',
|
||||||
]);
|
value: '60',
|
||||||
const btnClick = (index) => {
|
},
|
||||||
let timestamp = new Date().getTime();
|
]);
|
||||||
let payExpireTime = props.data.payExpireTime
|
const btnClick = (index) => {
|
||||||
if (timestamp > payExpireTime && props.data.status == 0 && index == 2) {
|
let timestamp = new Date().getTime();
|
||||||
uni.showToast({
|
let payExpireTime = props.data.payExpireTime;
|
||||||
title: '订单已过期',
|
if (timestamp > payExpireTime && props.data.status == 0 && index == 2) {
|
||||||
icon: 'none'
|
uni.showToast({
|
||||||
});
|
title: '订单已过期',
|
||||||
return;
|
icon: 'none',
|
||||||
}
|
});
|
||||||
if (index === 3 && Number(props?.data?.type) === 5) {
|
return;
|
||||||
return;
|
}
|
||||||
}
|
if (index === 3 && Number(props?.data?.type) === 5) {
|
||||||
let id = props.data?.id;
|
return;
|
||||||
switch (index) {
|
}
|
||||||
case 1:
|
let id = props.data?.id;
|
||||||
cancelOrder();
|
switch (index) {
|
||||||
break;
|
case 1:
|
||||||
case 2:
|
cancelOrder();
|
||||||
payOrder(id);
|
break;
|
||||||
break;
|
case 2:
|
||||||
case 3:
|
payOrder(id);
|
||||||
applyAfterSale();
|
break;
|
||||||
break;
|
case 3:
|
||||||
case 4:
|
applyAfterSale();
|
||||||
confirmReceive();
|
break;
|
||||||
break;
|
case 4:
|
||||||
case 5:
|
confirmReceive();
|
||||||
buyAgain();
|
break;
|
||||||
break;
|
case 5:
|
||||||
case 6:
|
buyAgain();
|
||||||
cancelAfterSale();
|
break;
|
||||||
break;
|
case 6:
|
||||||
}
|
cancelAfterSale();
|
||||||
};
|
break;
|
||||||
// 取消订单
|
}
|
||||||
const cancelOrder = () => {
|
};
|
||||||
let orderId = props.data?.id;
|
// 取消订单
|
||||||
uni.showModal({
|
const cancelOrder = () => {
|
||||||
title: '提示',
|
let orderId = props.data?.id;
|
||||||
content: '确定要取消订单吗?',
|
uni.showModal({
|
||||||
confirmColor: '#FA7E31',
|
title: '提示',
|
||||||
success: async function(res) {
|
content: '确定要取消订单吗?',
|
||||||
if (!res.confirm) {
|
confirmColor: '#FA7E31',
|
||||||
return;
|
success: async function (res) {
|
||||||
}
|
if (!res.confirm) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
upData();
|
upData();
|
||||||
const {
|
const { code } = await OrderApi.cancelOrder(orderId);
|
||||||
code
|
if (code === 0) {
|
||||||
} = await OrderApi.cancelOrder(orderId);
|
uni.showToast({
|
||||||
if (code === 0) {
|
title: '订单已取消',
|
||||||
uni.showToast({
|
icon: 'none',
|
||||||
title: '订单已取消',
|
});
|
||||||
icon: 'none'
|
upData();
|
||||||
});
|
}
|
||||||
upData();
|
},
|
||||||
}
|
});
|
||||||
},
|
};
|
||||||
});
|
// 去付款
|
||||||
};
|
const payOrder = (id) => {
|
||||||
// 去付款
|
sheep.$router.go('/pages/pay/index', {
|
||||||
const payOrder = (id) => {
|
id: props.data.payOrderId,
|
||||||
sheep.$router.go('/pages/pay/index', {
|
});
|
||||||
id: props.data.payOrderId,
|
};
|
||||||
});
|
// 申请售后
|
||||||
};
|
const applyAfterSale = () => {
|
||||||
// 申请售后
|
sheep.$router.go('/pages/order/aftersale/apply', props.data);
|
||||||
const applyAfterSale = () => {
|
};
|
||||||
sheep.$router.go('/pages/order/aftersale/apply', props.data);
|
// 确认收货
|
||||||
};
|
const confirmReceive = () => {
|
||||||
// 确认收货
|
let change = false;
|
||||||
const confirmReceive = () => {
|
if (props.data?.items.length) {
|
||||||
let change = false
|
props.data.items.forEach((item) => {
|
||||||
if (props.data?.items.length) {
|
if (item.afterSaleStatus == 10) {
|
||||||
props.data.items.forEach(item => {
|
change = true;
|
||||||
if (item.afterSaleStatus == 10) {
|
return;
|
||||||
change = true
|
}
|
||||||
return
|
});
|
||||||
}
|
}
|
||||||
})
|
if (change) {
|
||||||
}
|
uni.showToast({
|
||||||
if (change) {
|
title: '有售后中的商品,请先处理完售后',
|
||||||
uni.showToast({
|
icon: 'none',
|
||||||
title: '有售后中的商品,请先处理完售后',
|
});
|
||||||
icon: 'none'
|
return;
|
||||||
})
|
}
|
||||||
return
|
uni.showModal({
|
||||||
}
|
title: '提示',
|
||||||
uni.showModal({
|
content: '确认收货吗?',
|
||||||
title: '提示',
|
confirmColor: '#FA7E31',
|
||||||
content: '确认收货吗?',
|
success: async function (res) {
|
||||||
confirmColor: '#FA7E31',
|
if (!res.confirm) {
|
||||||
success: async function(res) {
|
return;
|
||||||
if (!res.confirm) {
|
}
|
||||||
return;
|
// 正常的确认收货流程
|
||||||
}
|
const { code } = await OrderApi.receiveOrder(props.data?.id);
|
||||||
// 正常的确认收货流程
|
if (code === 0) {
|
||||||
const {
|
upData();
|
||||||
code
|
}
|
||||||
} = await OrderApi.receiveOrder(props.data?.id);
|
},
|
||||||
if (code === 0) {
|
});
|
||||||
upData();
|
};
|
||||||
}
|
// 再次购买
|
||||||
},
|
const buyAgain = () => {};
|
||||||
});
|
// 取消售后
|
||||||
};
|
const cancelAfterSale = () => {};
|
||||||
// 再次购买
|
const upData = () => {
|
||||||
const buyAgain = () => {};
|
emit('downData');
|
||||||
// 取消售后
|
};
|
||||||
const cancelAfterSale = () => {};
|
|
||||||
const upData = () => {
|
|
||||||
emit('downData');
|
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
.more {}
|
.more {
|
||||||
|
}
|
||||||
|
|
||||||
.btn {
|
.btn {
|
||||||
line-height: 24rpx;
|
line-height: 24rpx;
|
||||||
padding: 10rpx 24rpx;
|
padding: 10rpx 24rpx;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
border: 2rpx solid #999999;
|
border: 2rpx solid #999999;
|
||||||
border-radius: 10rpx;
|
border-radius: 10rpx;
|
||||||
margin-left: 12rpx;
|
margin-left: 12rpx;
|
||||||
color: #999999;
|
color: #999999;
|
||||||
}
|
}
|
||||||
|
|
||||||
.btn1 {
|
.btn1 {
|
||||||
// line-height: 74rpx;
|
// line-height: 74rpx;
|
||||||
// padding: 0 30rpx;
|
// padding: 0 30rpx;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -14,7 +14,11 @@
|
|||||||
>
|
>
|
||||||
立即发货
|
立即发货
|
||||||
</view>
|
</view>
|
||||||
<view class="ai-button3 w_144" v-if="props.showView" @tap.stop="emit('view')">
|
<view
|
||||||
|
class="ai-button3 w_144"
|
||||||
|
v-if="props.showView && props.status !== 70"
|
||||||
|
@tap.stop="emit('view')"
|
||||||
|
>
|
||||||
{{ props.viewText }}
|
{{ props.viewText }}
|
||||||
</view>
|
</view>
|
||||||
<view class="ai-button1 w_144 m-l-16" v-if="props.status === 20" @tap.stop="emit('confirm')">
|
<view class="ai-button1 w_144 m-l-16" v-if="props.status === 20" @tap.stop="emit('confirm')">
|
||||||
@@ -23,6 +27,12 @@
|
|||||||
<view class="ai-button1 w_144 m-l-16" v-if="props.status === 0" @tap.stop="emit('pay')">
|
<view class="ai-button1 w_144 m-l-16" v-if="props.status === 0" @tap.stop="emit('pay')">
|
||||||
去支付
|
去支付
|
||||||
</view>
|
</view>
|
||||||
|
<view class="ai-button1 w_144 m-l-16" v-if="props.status === 70" @tap.stop="emit('cancel')">
|
||||||
|
取消订单
|
||||||
|
</view>
|
||||||
|
<view class="ai-button1 w_144 m-l-16" v-if="props.status === 70" @tap.stop="emit('pay')">
|
||||||
|
切换支付
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -46,5 +56,5 @@
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const emit = defineEmits(['delay', 'now', 'view', 'confirm', 'pay']);
|
const emit = defineEmits(['delay', 'now', 'view', 'confirm', 'pay', 'cancel']);
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
+175
-147
@@ -1,168 +1,196 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="order_con" :class="{ bg24: props.theme == 2 }">
|
<view class="order_con" :class="{ bg24: props.theme == 2 }">
|
||||||
|
<view
|
||||||
|
class="flex-center ju-between m-b-28"
|
||||||
|
v-if="(props.type == 2 || props.type == 4) && props.data.logisticsNo"
|
||||||
|
>
|
||||||
|
<view>{{ props.data.logisticsName }} {{ props.data.logisticsNo }}</view>
|
||||||
|
<view class="flex-center">
|
||||||
|
<view @click.stop="onCopy(props.data.logisticsNo)">复制</view>
|
||||||
|
<truckLine
|
||||||
|
:data="props.data"
|
||||||
|
:code="2"
|
||||||
|
v-if="props.data.deliveryTime && props.data.logisticsNo"
|
||||||
|
></truckLine>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
<view class="flex-center ju-between m-b-28"
|
<view
|
||||||
v-if="(props.type == 2 || props.type == 4) && props.data.logisticsNo">
|
class="con_item flex-center ju-between"
|
||||||
<view>{{ props.data.logisticsName }} {{ props.data.logisticsNo }}</view>
|
v-for="(v, i) in props.data.items"
|
||||||
<view class="flex-center">
|
:key="i"
|
||||||
<view @click.stop="onCopy(props.data.logisticsNo)">复制</view>
|
:class="{ 'al-flex-start': props.type == 3 || props.type == 4 }"
|
||||||
<truckLine :data="props.data" :code="2" v-if="props.data.deliveryTime && props.data.logisticsNo"></truckLine>
|
>
|
||||||
</view>
|
<view class="order_img shrink" :class="{ 'm-r-16': props.type == 3 }">
|
||||||
</view>
|
<image :src="`${v.picUrl}`" mode="aspectFill" />
|
||||||
|
</view>
|
||||||
<view class="con_item flex-center ju-between" v-for="(v, i) in props.data.items" :key="i"
|
<view class="flex1">
|
||||||
:class="{ 'al-flex-start': props.type == 3 || props.type == 4 }">
|
<view class="flex-row ju-between m-b-6">
|
||||||
<view class="order_img shrink" :class="{ 'm-r-16': props.type == 3 }">
|
<view
|
||||||
<image :src="`${v.picUrl}`" mode="aspectFill" />
|
class="size28 spuName lineTwo"
|
||||||
</view>
|
:class="{ 'p-r-10': props.type == 3, c0: props.theme == 2 }"
|
||||||
<view class="flex1">
|
>
|
||||||
<view class="flex-row ju-between m-b-6">
|
{{ v.spuName }}
|
||||||
<view class="size28 spuName lineTwo" :class="{ 'p-r-10': props.type == 3, c0: props.theme == 2 }">
|
</view>
|
||||||
{{ v.spuName }}
|
<view class="shrink price" v-if="props.type != 4"
|
||||||
</view>
|
><span class="size24">¥</span
|
||||||
<view class="shrink price" v-if="props.type != 4"><span class="size24">¥</span><span class="size36"
|
><span class="size36" style="font-weight: 600">{{ fen2yuan(v.price) }}</span></view
|
||||||
style="font-weight: 600">{{ fen2yuan(v.price) }}</span></view>
|
>
|
||||||
</view>
|
</view>
|
||||||
<view v-if="props.type == 4">
|
<view v-if="props.type == 4">
|
||||||
<view class="m-b-12 size24 h_52" v-for="(item, i) in v.items" :key="i">
|
<view class="m-b-12 size24 h_52" v-for="(item, i) in v.items" :key="i">
|
||||||
<view class="flex1 flex-center ju-between h_52 bg18 radius8 p-l-8 p-r-16">
|
<view class="flex1 flex-center ju-between h_52 bg18 radius8 p-l-8 p-r-16">
|
||||||
<view class="lineOne c19">
|
<view class="lineOne c19">
|
||||||
{{ formatSkuProperties(item?.properties) }}
|
{{ formatSkuProperties(item?.properties) }}
|
||||||
</view>
|
</view>
|
||||||
<view class="flex-center">
|
<view class="flex-center">
|
||||||
<view class="c19">x{{ item.count }}</view>
|
<view class="c19">x{{ item.count }}</view>
|
||||||
<view class=" size28 m-l-12 weight900">¥<span class="">{{ fen2yuan(item.price) }}</span>
|
<view class="size28 m-l-12 weight900"
|
||||||
</view>
|
>¥<span class="">{{ fen2yuan(item.price) }}</span>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="c13 size28 weight900">
|
</view>
|
||||||
¥<span class="size40">{{ fen2yuan(item.payPrice) }}</span>
|
<view class="c13 size28 weight900">
|
||||||
</view>
|
¥<span class="size40">{{ fen2yuan(item.payPrice) }}</span>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="flex-row ju-between" :class="{ 'm-t-8': props.type == 3 }" v-else>
|
</view>
|
||||||
<view class="valueName size28" :class="{ c19: props.theme == 2 }">{{ formatSkuProperties(v.properties) }}</view>
|
<view class="flex-row ju-between" :class="{ 'm-t-8': props.type == 3 }" v-else>
|
||||||
<view class="shrink size28 c_333" :class="{ c0: props.theme == 2 }">{{
|
<view class="valueName size28" :class="{ c19: props.theme == 2 }">{{
|
||||||
|
formatSkuProperties(v.properties)
|
||||||
|
}}</view>
|
||||||
|
<view class="shrink size28 c_333" :class="{ c0: props.theme == 2 }">{{
|
||||||
`x${v.count}`
|
`x${v.count}`
|
||||||
}}</view>
|
}}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="btn flex-row ju-flex-end" v-if="props.type == 2">
|
<view class="btn flex-row ju-flex-end" v-if="props.type == 2">
|
||||||
<button class="ss-reset-button btnItem btnItem1"
|
<button
|
||||||
v-if="[10, 20].includes(props.data.status) && v.afterSaleStatus === 0" @tap.stop="
|
class="ss-reset-button btnItem btnItem1"
|
||||||
|
v-if="
|
||||||
|
[10, 20].includes(props.data.status) &&
|
||||||
|
v.afterSaleStatus === 0 &&
|
||||||
|
props.data.payChannelCode !== 'cash_payment'
|
||||||
|
"
|
||||||
|
@tap.stop="
|
||||||
sheep.$router.go('/pages/order/aftersale/apply', {
|
sheep.$router.go('/pages/order/aftersale/apply', {
|
||||||
orderId: props.data.id,
|
orderId: props.data.id,
|
||||||
itemId: v.id,
|
itemId: v.id,
|
||||||
})
|
})
|
||||||
">
|
"
|
||||||
申请售后
|
>
|
||||||
</button>
|
申请售后
|
||||||
<view class="btnItem btnItem1" v-if="v.afterSaleStatus === 10" @click="cancelAfterSale(v)">
|
</button>
|
||||||
取消售后
|
<view
|
||||||
</view>
|
class="btnItem btnItem1"
|
||||||
<view class="btnItem" v-if="v.afterSaleStatus === 20"> 售后成功 </view>
|
v-if="v.afterSaleStatus === 10"
|
||||||
</view>
|
@click="cancelAfterSale(v)"
|
||||||
</view>
|
>
|
||||||
</view>
|
取消售后
|
||||||
</view>
|
</view>
|
||||||
|
<view class="btnItem" v-if="v.afterSaleStatus === 20"> 售后成功 </view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, reactive, getCurrentInstance, defineProps } from 'vue';
|
import { ref, reactive, getCurrentInstance, defineProps } from 'vue';
|
||||||
import { fen2yuan } from '@/sheep/hooks/useGoods';
|
import { fen2yuan } from '@/sheep/hooks/useGoods';
|
||||||
import AfterSaleApi from '@/sheep/api/trade/afterSale';
|
import AfterSaleApi from '@/sheep/api/trade/afterSale';
|
||||||
import sheep from '@/sheep';
|
import sheep from '@/sheep';
|
||||||
const { proxy } = getCurrentInstance() as any;
|
const { proxy } = getCurrentInstance() as any;
|
||||||
let emit = defineEmits(['getOrderDetail']);
|
let emit = defineEmits(['getOrderDetail']);
|
||||||
const formatSkuProperties = (properties: any) => {
|
const formatSkuProperties = (properties: any) => {
|
||||||
const list = Array.isArray(properties) ? properties : [];
|
const list = Array.isArray(properties) ? properties : [];
|
||||||
return list
|
return list
|
||||||
.map((property) => property?.valueName)
|
.map((property) => property?.valueName)
|
||||||
.filter(Boolean)
|
.filter(Boolean)
|
||||||
.join(' ');
|
.join(' ');
|
||||||
};
|
};
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
data: {
|
data: {
|
||||||
type: Object,
|
type: Object,
|
||||||
default() {
|
default() {
|
||||||
return {};
|
return {};
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
type: {
|
type: {
|
||||||
type: String,
|
type: String,
|
||||||
default: '0', //0列表2订单详情 3订单列表 4ai订单详情
|
default: '0', //0列表2订单详情 3订单列表 4ai订单详情
|
||||||
},
|
},
|
||||||
theme: {
|
theme: {
|
||||||
type: String,
|
type: String,
|
||||||
default: '2', //1浅色 2深色
|
default: '2', //1浅色 2深色
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
const cancelAfterSale = (v) => {
|
const cancelAfterSale = (v) => {
|
||||||
uni.showModal({
|
uni.showModal({
|
||||||
title: '提示',
|
title: '提示',
|
||||||
content: '确定要取消此申请吗?',
|
content: '确定要取消此申请吗?',
|
||||||
confirmColor: '#FA7E31',
|
confirmColor: '#FA7E31',
|
||||||
success: async function (res) {
|
success: async function (res) {
|
||||||
if (!res.confirm) {
|
if (!res.confirm) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const { code } = await AfterSaleApi.cancelAfterSale(v.afterSaleId);
|
const { code } = await AfterSaleApi.cancelAfterSale(v.afterSaleId);
|
||||||
if (code === 0) {
|
if (code === 0) {
|
||||||
getOrderDetail();
|
getOrderDetail();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
const getOrderDetail = () => {
|
const getOrderDetail = () => {
|
||||||
emit('getOrderDetail');
|
emit('getOrderDetail');
|
||||||
};
|
};
|
||||||
const onCopy = (text) => {
|
const onCopy = (text) => {
|
||||||
sheep.$helper.copyText(text);
|
sheep.$helper.copyText(text);
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
.order_con {
|
.order_con {
|
||||||
.con_item {
|
.con_item {
|
||||||
margin-bottom: 24rpx;
|
margin-bottom: 24rpx;
|
||||||
|
|
||||||
.order_img {
|
.order_img {
|
||||||
width: 160rpx;
|
width: 160rpx;
|
||||||
height: 160rpx;
|
height: 160rpx;
|
||||||
border-radius: 8rpx;
|
border-radius: 8rpx;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
margin-right: 12rpx;
|
margin-right: 12rpx;
|
||||||
|
|
||||||
image {
|
image {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.spuName {
|
.spuName {
|
||||||
color: #333333;
|
color: #333333;
|
||||||
}
|
}
|
||||||
|
|
||||||
.valueName {
|
.valueName {
|
||||||
color: #777777;
|
color: #777777;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.price {
|
.price {
|
||||||
color: #ee0a24;
|
color: #ee0a24;
|
||||||
font-size: 24rpx;
|
font-size: 24rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.btnItem {
|
.btnItem {
|
||||||
line-height: 50rpx;
|
line-height: 50rpx;
|
||||||
padding: 0 20rpx;
|
padding: 0 20rpx;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
border-radius: 94px 94px 94px 94px;
|
border-radius: 94px 94px 94px 94px;
|
||||||
margin-top: 12rpx;
|
margin-top: 12rpx;
|
||||||
font-size: 24rpx;
|
font-size: 24rpx;
|
||||||
border: none;
|
border: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.btnItem1 {
|
.btnItem1 {
|
||||||
background: #F2F2F2;
|
background: #f2f2f2;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
+399
-359
@@ -1,393 +1,433 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="card_order bg24 size34" @click="
|
<view
|
||||||
utils.go('/pages/order/detail', { id: props.index != 5 ? props.data.id : props.data.orderId, type: props.data.type, source: props.data.__source })
|
class="card_order bg24 size34"
|
||||||
">
|
@click="
|
||||||
<view class="flex-center ju-between createTime">
|
utils.go('/pages/order/detail', {
|
||||||
<view class="flex-center shrink">
|
id: !props.isAfterSale ? props.data.id : props.data.orderId,
|
||||||
<view class="size28">订单编号: {{ props.data.no }}</view>
|
type: props.data.type,
|
||||||
<view class="copy flex-center" @tap.stop="onCopy(props.data.no)" style="margin-left: 10px">
|
source: props.data.__source,
|
||||||
<image :src="`${$url}goods/copy2.svg`" mode="scaleToFill" />
|
})
|
||||||
</view>
|
"
|
||||||
</view>
|
>
|
||||||
<view class="stateText size28" style="margin-left: 10px" :class="formatOrderColor(props.data)"
|
<view class="flex-center ju-between createTime">
|
||||||
v-if="props.index != 5">
|
<view class="flex-center shrink">
|
||||||
{{ formatOrderStatus(props.data) }}
|
<view class="size28">订单编号: {{ props.data.no }}</view>
|
||||||
</view>
|
<view class="copy flex-center" @tap.stop="onCopy(props.data.no)" style="margin-left: 10px">
|
||||||
<view class="stateText size28" v-else>
|
<image :src="`${$url}goods/copy2.svg`" mode="scaleToFill" />
|
||||||
{{ formatAfterSaleStatus(props.data) }}
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
<view
|
||||||
<card_order :data="props.data" v-if="props.index != 5" type="3"></card_order>
|
class="stateText size28"
|
||||||
<view v-else class="con_item flex-center ju-between al-flex-start">
|
style="margin-left: 10px"
|
||||||
<view class="order_img shrink">
|
:class="formatOrderColor(props.data)"
|
||||||
<image :src="`${props.data.picUrl}`" mode="aspectFill" />
|
v-if="!props.isAfterSale"
|
||||||
</view>
|
>
|
||||||
<view class="flex1 flex-column ju-between">
|
{{ formatOrderStatus(props.data) }}
|
||||||
<view class="flex-row ju-between">
|
</view>
|
||||||
<view class="size28 spuName lineTwo c0">{{ props.data.spuName }}</view>
|
<view class="stateText size28" v-else>
|
||||||
<view class="shrink price">
|
{{ formatAfterSaleStatus(props.data) }}
|
||||||
<span class="size24">¥</span><span class="size36"
|
</view>
|
||||||
style="font-weight: 600">{{ fen2yuan(props.data.refundPrice) }}</span>
|
</view>
|
||||||
</view>
|
<card_order :data="props.data" v-if="!props.isAfterSale" type="3"></card_order>
|
||||||
</view>
|
<view v-else class="con_item flex-center ju-between al-flex-start">
|
||||||
<view class="flex-row ju-between m-t-10">
|
<view class="order_img shrink">
|
||||||
<view class="valueName size24">{{
|
<image :src="`${props.data.picUrl}`" mode="aspectFill" />
|
||||||
|
</view>
|
||||||
|
<view class="flex1 flex-column ju-between">
|
||||||
|
<view class="flex-row ju-between">
|
||||||
|
<view class="size28 spuName lineTwo c0">{{ props.data.spuName }}</view>
|
||||||
|
<view class="shrink price">
|
||||||
|
<span class="size24">¥</span
|
||||||
|
><span class="size36" style="font-weight: 600">{{
|
||||||
|
fen2yuan(props.data.refundPrice)
|
||||||
|
}}</span>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="flex-row ju-between m-t-10">
|
||||||
|
<view class="valueName size24">{{
|
||||||
props.data.properties.map((property) => property.valueName).join(' ')
|
props.data.properties.map((property) => property.valueName).join(' ')
|
||||||
}}</view>
|
}}</view>
|
||||||
<view class="shrink size24 c0">{{ `x${props.data.count}` }}</view>
|
<view class="shrink size24 c0">{{ `x${props.data.count}` }}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="btn flex-row ju-flex-end">
|
<view class="btn flex-row ju-flex-end">
|
||||||
<button class="ss-reset-button btnItem btnItem1" @tap.stop="onApply"
|
<button
|
||||||
v-if="statusChange(['10', '20', '30', '62', '63'], String(props.data.status))">取消售后</button>
|
class="ss-reset-button btnItem btnItem1"
|
||||||
<button class="ss-reset-button btnItem btnItem1" style="margin-left: 20rpx"
|
@tap.stop="onApply"
|
||||||
v-if="statusChange(['20'], String(props.data.status))" @tap.stop="
|
v-if="statusChange(['10', '20', '30', '62', '63'], String(props.data.status))"
|
||||||
|
>取消售后</button
|
||||||
|
>
|
||||||
|
<button
|
||||||
|
class="ss-reset-button btnItem btnItem1"
|
||||||
|
style="margin-left: 20rpx"
|
||||||
|
v-if="statusChange(['20'], String(props.data.status))"
|
||||||
|
@tap.stop="
|
||||||
sheep.$router.go('/pages/order/aftersale/return-delivery', { id: props.data.id })
|
sheep.$router.go('/pages/order/aftersale/return-delivery', { id: props.data.id })
|
||||||
">
|
"
|
||||||
填写物流信息
|
>
|
||||||
</button>
|
填写物流信息
|
||||||
</view>
|
</button>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="discount-row flex-between" v-if="props.index != 5">
|
</view>
|
||||||
<view v-if="isDelayedShipmentOrder()" class="delay-notice flex-center">
|
<view class="discount-row flex-between" v-if="!props.isAfterSale">
|
||||||
<view class="delay-notice__icon">!</view>
|
<view v-if="isDelayedShipmentOrder()" class="delay-notice flex-center">
|
||||||
<view class="delay-notice__text">
|
<view class="delay-notice__icon">!</view>
|
||||||
延迟发货中,商品已为您锁定,配送需您手动恢复或点击立即发货。
|
<view class="delay-notice__text">
|
||||||
</view>
|
延迟发货中,商品已为您锁定,配送需您手动恢复或点击立即发货。
|
||||||
</view>
|
</view>
|
||||||
<view class="size24 c_999">{{ formatCreateTime(props.data.createTime) }}</view>
|
</view>
|
||||||
<view class="size24 c32">已优惠¥{{ fen2yuan(props.data.randomDiscountPrice) }}</view>
|
<view class="size24 c_999">{{ formatCreateTime(props.data.createTime) }}</view>
|
||||||
</view>
|
<view class="size24 c32">已优惠¥{{ fen2yuan(props.data.randomDiscountPrice) }}</view>
|
||||||
<view class="flex-row ju-flex-end" v-if="props.index != 5">
|
</view>
|
||||||
<view class="flex-center size24">{{ `共${props.data.productCount}件商品 合计: `
|
<view class="flex-row ju-flex-end" v-if="!props.isAfterSale">
|
||||||
}}
|
<view class="flex-center size24"
|
||||||
<!-- <view class="price">¥{{ fen2yuan(props.data.payPrice) }}</view> -->
|
>{{ `共${props.data.productCount}件商品 合计: ` }}
|
||||||
<view class="shrink price"><span class="size24">¥</span><span class="size36"
|
<!-- <view class="price">¥{{ fen2yuan(props.data.payPrice) }}</view> -->
|
||||||
style="font-weight: 600;">{{ fen2yuan(props.data.payPrice) }}</span></view>
|
<view class="shrink price"
|
||||||
</view>
|
><span class="size24">¥</span
|
||||||
</view>
|
><span class="size36" style="font-weight: 600">{{
|
||||||
<view class="flex-center ju-flex-end m-t-12" v-if="props.index != 5 && isAiActionOrder">
|
fen2yuan(props.data.payPrice)
|
||||||
<AiOrderActionBar
|
}}</span></view
|
||||||
:status="currentStatus"
|
>
|
||||||
:disableDelayShipment="isPickUpOrder"
|
</view>
|
||||||
:showView="true"
|
</view>
|
||||||
@delay="onDelayShipment"
|
<view class="flex-center ju-flex-end m-t-12" v-if="!props.isAfterSale && isAiActionOrder">
|
||||||
@now="onNowShipment"
|
<AiOrderActionBar
|
||||||
@view="goAiOrderInfo"
|
:status="currentStatus"
|
||||||
@confirm="confirmReceiveOrder"
|
:disableDelayShipment="isPickUpOrder"
|
||||||
@pay="goPay"
|
:showView="true"
|
||||||
/>
|
@delay="onDelayShipment"
|
||||||
</view>
|
@now="onNowShipment"
|
||||||
<view class="" style="margin-top: 32rpx" v-else-if="props.index != 5">
|
@view="goAiOrderInfo"
|
||||||
<card_orderBan :data="props.data" @downData="downData"></card_orderBan>
|
@confirm="confirmReceiveOrder"
|
||||||
</view>
|
@pay="goPay"
|
||||||
</view>
|
@cancel="cancelAiOrder"
|
||||||
|
/>
|
||||||
|
</view>
|
||||||
|
<view class="" style="margin-top: 32rpx" v-else-if="!props.isAfterSale">
|
||||||
|
<card_orderBan :data="props.data" @downData="downData"></card_orderBan>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<script setup>
|
<script setup>
|
||||||
import {
|
import { getCurrentInstance, defineProps, defineEmits, computed, ref, watch } from 'vue';
|
||||||
getCurrentInstance,
|
import {
|
||||||
defineProps,
|
fen2yuan,
|
||||||
defineEmits,
|
formatOrderColor,
|
||||||
computed,
|
formatOrderStatus,
|
||||||
ref,
|
formatAfterSaleStatus,
|
||||||
watch,
|
} from '@/sheep/hooks/useGoods';
|
||||||
} from 'vue';
|
import card_order from './card_order.vue';
|
||||||
import {
|
import card_orderBan from '@/components/card_orderBan/card_orderBan.vue';
|
||||||
fen2yuan,
|
import AiOrderActionBar from '@/components/orderItem/AiOrderActionBar.vue';
|
||||||
formatOrderColor,
|
import AfterSaleApi from '@/sheep/api/trade/afterSale';
|
||||||
formatOrderStatus,
|
import sheep from '@/sheep';
|
||||||
formatAfterSaleStatus,
|
import {
|
||||||
} from '@/sheep/hooks/useGoods';
|
aiDelayedShipment,
|
||||||
import card_order from './card_order.vue';
|
aiPendingShipment,
|
||||||
import card_orderBan from '@/components/card_orderBan/card_orderBan.vue';
|
confirmReceive as aiConfirmReceive,
|
||||||
import AiOrderActionBar from '@/components/orderItem/AiOrderActionBar.vue';
|
giftConfirmReceive,
|
||||||
import AfterSaleApi from '@/sheep/api/trade/afterSale';
|
cancelOrder as cancelAiOrderRequest,
|
||||||
import sheep from '@/sheep';
|
cancelOpenOrder,
|
||||||
import {
|
} from '@/sheep/api/ai';
|
||||||
aiDelayedShipment,
|
let emit = defineEmits(['downData']);
|
||||||
aiPendingShipment,
|
let { proxy } = getCurrentInstance();
|
||||||
confirmReceive as aiConfirmReceive,
|
let props = defineProps({
|
||||||
giftConfirmReceive,
|
data: {
|
||||||
} from '@/sheep/api/ai';
|
type: Object,
|
||||||
let emit = defineEmits(['downData']);
|
default() {
|
||||||
let { proxy } = getCurrentInstance();
|
return {};
|
||||||
let props = defineProps({
|
},
|
||||||
data: {
|
},
|
||||||
type: Object,
|
index: {
|
||||||
default() {
|
type: Number,
|
||||||
return {};
|
default: 0,
|
||||||
},
|
},
|
||||||
},
|
isAfterSale: {
|
||||||
index: {
|
type: Boolean,
|
||||||
type: Number,
|
default: false,
|
||||||
default: 0,
|
},
|
||||||
},
|
});
|
||||||
});
|
const downData = () => {
|
||||||
const downData = () => {
|
emit('downData');
|
||||||
emit('downData');
|
};
|
||||||
};
|
// 复制
|
||||||
// 复制
|
const onCopy = (no) => {
|
||||||
const onCopy = (no) => {
|
proxy.$sheep.$helper.copyText(no);
|
||||||
proxy.$sheep.$helper.copyText(no);
|
};
|
||||||
};
|
const formatCreateTime = (value) => {
|
||||||
const formatCreateTime = (value) => {
|
if (!value) return '';
|
||||||
if (!value) return '';
|
const s = sheep?.$helper?.timeFormat
|
||||||
const s = sheep?.$helper?.timeFormat
|
? sheep.$helper.timeFormat(value, 'yyyy-mm-dd hh:MM:ss')
|
||||||
? sheep.$helper.timeFormat(value, 'yyyy-mm-dd hh:MM:ss')
|
: String(value);
|
||||||
: String(value);
|
return s || '';
|
||||||
return s || '';
|
};
|
||||||
};
|
const onApply = () => {
|
||||||
const onApply = () => {
|
uni.showModal({
|
||||||
uni.showModal({
|
title: '提示',
|
||||||
title: '提示',
|
content: '确定要取消此申请吗?',
|
||||||
content: '确定要取消此申请吗?',
|
confirmColor: '#FA7E31',
|
||||||
confirmColor: '#FA7E31',
|
success: async function (res) {
|
||||||
success: async function (res) {
|
if (!res.confirm) {
|
||||||
if (!res.confirm) {
|
return;
|
||||||
return;
|
}
|
||||||
}
|
const { code } = await AfterSaleApi.cancelAfterSale(props.data.id);
|
||||||
const { code } = await AfterSaleApi.cancelAfterSale(props.data.id);
|
if (code === 0) {
|
||||||
if (code === 0) {
|
emit('downData');
|
||||||
emit('downData');
|
}
|
||||||
}
|
},
|
||||||
},
|
});
|
||||||
});
|
};
|
||||||
};
|
const statusChange = (arr, status) => {
|
||||||
const statusChange = (arr, status) => {
|
return arr.indexOf(status) != -1;
|
||||||
return arr.indexOf(status) != -1;
|
};
|
||||||
};
|
|
||||||
|
|
||||||
const isAiActionOrder =
|
const isAiActionOrder =
|
||||||
String(props.data?.__source) === 'aishop' || Number(props.data?.type) === 5;
|
String(props.data?.__source) === 'aishop' || Number(props.data?.type) === 5;
|
||||||
const isPickUpOrder = computed(() => {
|
const isPickUpOrder = computed(() => {
|
||||||
if (Number(props.data?.deliveryType) === 2) return true;
|
if (Number(props.data?.deliveryType) === 2) return true;
|
||||||
return Boolean(
|
return Boolean(
|
||||||
props.data?.pickUpStoreId ||
|
props.data?.pickUpStoreId ||
|
||||||
props.data?.pickUpStore ||
|
props.data?.pickUpStore ||
|
||||||
props.data?.pickUpStoreVO ||
|
props.data?.pickUpStoreVO ||
|
||||||
props.data?.pickUpVerifyCode,
|
props.data?.pickUpVerifyCode,
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
const currentStatus = ref(Number(props.data?.status));
|
const currentStatus = ref(Number(props.data?.status));
|
||||||
watch(
|
watch(
|
||||||
() => props.data?.status,
|
() => props.data?.status,
|
||||||
(value) => {
|
(value) => {
|
||||||
currentStatus.value = Number(value);
|
currentStatus.value = Number(value);
|
||||||
},
|
},
|
||||||
{ immediate: true },
|
{ immediate: true },
|
||||||
);
|
);
|
||||||
const isDelayedShipmentOrder = () =>
|
const isDelayedShipmentOrder = () => currentStatus.value === 50 && !isPickUpOrder.value;
|
||||||
currentStatus.value === 50 && !isPickUpOrder.value;
|
|
||||||
|
|
||||||
const resolveAiOrderId = (data) => {
|
const resolveAiOrderId = (data) => {
|
||||||
return data?.id || data?.orderId;
|
return data?.id || data?.orderId;
|
||||||
};
|
};
|
||||||
|
|
||||||
const onDelayShipment = () => {
|
const onDelayShipment = () => {
|
||||||
delayShipment(props.data);
|
delayShipment(props.data);
|
||||||
};
|
};
|
||||||
|
|
||||||
const onNowShipment = () => {
|
const onNowShipment = () => {
|
||||||
nowShipment(props.data);
|
nowShipment(props.data);
|
||||||
};
|
};
|
||||||
|
|
||||||
function delayShipment(data) {
|
function delayShipment(data) {
|
||||||
if (isPickUpOrder.value) return;
|
if (isPickUpOrder.value) return;
|
||||||
const id = resolveAiOrderId(data);
|
const id = resolveAiOrderId(data);
|
||||||
if (!id) {
|
if (!id) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '订单信息异常',
|
title: '订单信息异常',
|
||||||
icon: 'none',
|
icon: 'none',
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
uni.showModal({
|
uni.showModal({
|
||||||
title: '延迟发货',
|
title: '延迟发货',
|
||||||
content: '请您确认是否暂时不需要发货,确认后该产品将为您安排延迟发货',
|
content: '请您确认是否暂时不需要发货,确认后该产品将为您安排延迟发货',
|
||||||
confirmColor: '#FA7E31',
|
confirmColor: '#FA7E31',
|
||||||
success: async function (res) {
|
success: async function (res) {
|
||||||
if (!res.confirm) return;
|
if (!res.confirm) return;
|
||||||
const { code } = await aiDelayedShipment({
|
const { code } = await aiDelayedShipment({
|
||||||
id,
|
id,
|
||||||
status: 50,
|
status: 50,
|
||||||
});
|
});
|
||||||
if (code === 0) {
|
if (code === 0) {
|
||||||
currentStatus.value = 50;
|
currentStatus.value = 50;
|
||||||
emit('downData');
|
emit('downData');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function nowShipment(data) {
|
function nowShipment(data) {
|
||||||
if (isPickUpOrder.value) return;
|
if (isPickUpOrder.value) return;
|
||||||
const id = resolveAiOrderId(data);
|
const id = resolveAiOrderId(data);
|
||||||
if (!id) {
|
if (!id) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '订单信息异常',
|
title: '订单信息异常',
|
||||||
icon: 'none',
|
icon: 'none',
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
uni.showModal({
|
uni.showModal({
|
||||||
title: '立即发货',
|
title: '立即发货',
|
||||||
content: '请您确认是否需要立即发货,确认后将尽快为您安排发货',
|
content: '请您确认是否需要立即发货,确认后将尽快为您安排发货',
|
||||||
confirmColor: '#FA7E31',
|
confirmColor: '#FA7E31',
|
||||||
success: async function (res) {
|
success: async function (res) {
|
||||||
if (!res.confirm) return;
|
if (!res.confirm) return;
|
||||||
const { code } = await aiPendingShipment({
|
const { code } = await aiPendingShipment({
|
||||||
id,
|
id,
|
||||||
status: 10,
|
status: 10,
|
||||||
});
|
});
|
||||||
if (code === 0) {
|
if (code === 0) {
|
||||||
currentStatus.value = 10;
|
currentStatus.value = 10;
|
||||||
emit('downData');
|
emit('downData');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
const goAiOrderInfo = () => {
|
const goAiOrderInfo = () => {
|
||||||
if (Number(props.data?.type) === 5) {
|
if (Number(props.data?.type) === 5) {
|
||||||
const id = props.data?.id;
|
const id = props.data?.id;
|
||||||
if (!id) return;
|
if (!id) return;
|
||||||
proxy.utils.go('/pages/order/detail', { id, type: props.data?.type });
|
proxy.utils.go('/pages/order/detail', { id, type: props.data?.type });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const id = resolveAiOrderId(props.data);
|
const id = resolveAiOrderId(props.data);
|
||||||
if (!id) return;
|
if (!id) return;
|
||||||
proxy.utils.go('/pages/AI/orderInfo', { id });
|
proxy.utils.go('/pages/AI/orderInfo', { id });
|
||||||
};
|
};
|
||||||
|
|
||||||
const confirmReceiveOrder = async () => {
|
const confirmReceiveOrder = async () => {
|
||||||
const id = resolveAiOrderId(props.data);
|
const id = resolveAiOrderId(props.data);
|
||||||
if (!id) return;
|
if (!id) return;
|
||||||
const req = Number(props.data?.type) === 5 ? giftConfirmReceive : aiConfirmReceive;
|
const req = Number(props.data?.type) === 5 ? giftConfirmReceive : aiConfirmReceive;
|
||||||
const { code } = await req({ id });
|
const { code } = await req({ id });
|
||||||
if (code === 0) {
|
if (code === 0) {
|
||||||
emit('downData');
|
emit('downData');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const goPay = () => {
|
const goPay = () => {
|
||||||
const id = resolveAiOrderId(props.data);
|
const id = resolveAiOrderId(props.data);
|
||||||
const payOrderId = props.data?.payOrderId;
|
const payOrderId = props.data?.payOrderId;
|
||||||
if (!id || !payOrderId) {
|
if (!id || !payOrderId) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '支付信息异常',
|
title: '支付信息异常',
|
||||||
icon: 'none',
|
icon: 'none',
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
proxy.utils.go('/pages/AI/cashierDesk', {
|
proxy.utils.go('/pages/AI/cashierDesk', {
|
||||||
id,
|
id,
|
||||||
payOrderId,
|
payOrderId,
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const cancelAiOrder = () => {
|
||||||
|
const id = resolveAiOrderId(props.data);
|
||||||
|
if (!id) return;
|
||||||
|
uni.showModal({
|
||||||
|
title: '提示',
|
||||||
|
content: '确定要取消订单吗?',
|
||||||
|
confirmColor: '#FA7E31',
|
||||||
|
success: async (res) => {
|
||||||
|
if (!res.confirm) return;
|
||||||
|
const request = Number(props.data?.type) === 5 ? cancelOpenOrder : cancelAiOrderRequest;
|
||||||
|
const result = await request({ id });
|
||||||
|
if (result.code === 0) emit('downData');
|
||||||
|
},
|
||||||
|
});
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.card_order {
|
.card_order {
|
||||||
padding: 24rpx;
|
padding: 24rpx;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
border-radius: 8rpx;
|
border-radius: 8rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.createTime {
|
.createTime {
|
||||||
margin-bottom: 32rpx;
|
margin-bottom: 32rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.discount-row {
|
.discount-row {
|
||||||
margin-top: 8rpx;
|
margin-top: 8rpx;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
row-gap: 12rpx;
|
row-gap: 12rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.delay-notice {
|
.delay-notice {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
padding: 18rpx 20rpx;
|
padding: 18rpx 20rpx;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
border-radius: 12rpx;
|
border-radius: 12rpx;
|
||||||
background: #fff4ea;
|
background: #fff4ea;
|
||||||
align-items: flex-start;
|
align-items: flex-start;
|
||||||
}
|
}
|
||||||
|
|
||||||
.delay-notice__icon {
|
.delay-notice__icon {
|
||||||
width: 28rpx;
|
width: 28rpx;
|
||||||
height: 28rpx;
|
height: 28rpx;
|
||||||
line-height: 28rpx;
|
line-height: 28rpx;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
border: 2rpx solid #fa7e31;
|
border: 2rpx solid #fa7e31;
|
||||||
color: #fa7e31;
|
color: #fa7e31;
|
||||||
font-size: 20rpx;
|
font-size: 20rpx;
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
margin-right: 12rpx;
|
margin-right: 12rpx;
|
||||||
margin-top: 2rpx;
|
margin-top: 2rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.delay-notice__text {
|
.delay-notice__text {
|
||||||
color: #fa7e31;
|
color: #fa7e31;
|
||||||
font-size: 24rpx;
|
font-size: 24rpx;
|
||||||
line-height: 36rpx;
|
line-height: 36rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.price {
|
.price {
|
||||||
color: #ee0a24;
|
color: #ee0a24;
|
||||||
font-size: 24rpx;
|
font-size: 24rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.copy {
|
.copy {
|
||||||
width: 24rpx;
|
width: 24rpx;
|
||||||
height: 24rpx;
|
height: 24rpx;
|
||||||
margin-left: 14rpx;
|
margin-left: 14rpx;
|
||||||
|
|
||||||
image {
|
image {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.con_item {
|
.con_item {
|
||||||
margin-bottom: 24rpx;
|
margin-bottom: 24rpx;
|
||||||
|
|
||||||
.order_img {
|
.order_img {
|
||||||
width: 160rpx;
|
width: 160rpx;
|
||||||
height: 160rpx;
|
height: 160rpx;
|
||||||
border-radius: 8rpx;
|
border-radius: 8rpx;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
margin-right: 12rpx;
|
margin-right: 12rpx;
|
||||||
|
|
||||||
image {
|
image {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.spuName {
|
.spuName {
|
||||||
color: #323232;
|
color: #323232;
|
||||||
}
|
}
|
||||||
|
|
||||||
.valueName {
|
.valueName {
|
||||||
color: #777777;
|
color: #777777;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.price {
|
.price {
|
||||||
color: #ee0a24;
|
color: #ee0a24;
|
||||||
font-size: 24rpx;
|
font-size: 24rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.btnItem {
|
.btnItem {
|
||||||
line-height: 50rpx;
|
line-height: 50rpx;
|
||||||
padding: 0 20rpx;
|
padding: 0 20rpx;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
border-radius: 94px 94px 94px 94px;
|
border-radius: 94px 94px 94px 94px;
|
||||||
margin-top: 12rpx;
|
margin-top: 12rpx;
|
||||||
font-size: 24rpx;
|
font-size: 24rpx;
|
||||||
border: none;
|
border: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.btnItem1 {
|
.btnItem1 {
|
||||||
background: #F2F2F2;
|
background: #f2f2f2;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -103,6 +103,7 @@
|
|||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"prettier": "^2.8.7",
|
"prettier": "^2.8.7",
|
||||||
|
"sass": "^1.99.0",
|
||||||
"vconsole": "^3.15.0"
|
"vconsole": "^3.15.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+353
-307
@@ -1,213 +1,259 @@
|
|||||||
<template>
|
<template>
|
||||||
<s-pages title="收银台" :pink_bg="true" :goLeft="false" @onClickLeft="onClickLeft">
|
<s-pages title="收银台" :pink_bg="true" :goLeft="false" @onClickLeft="onClickLeft">
|
||||||
<view class="p-x-32">
|
<view class="p-x-32">
|
||||||
<view class="center p-t-96 weight500 size100"><span class="size48">¥</span>
|
<view class="center p-t-96 weight500 size100"
|
||||||
{{ fen2yuan(state.orderInfo.payPrice) }}
|
><span class="size48">¥</span>
|
||||||
</view>
|
{{ fen2yuan(state.orderInfo.payPrice) }}
|
||||||
<view class="center size22 c_money">
|
</view>
|
||||||
已优惠{{ fen2yuan(state.orderInfo.randomDiscountPrice) }}元
|
<view class="center size22 c_money">
|
||||||
</view>
|
已优惠{{ fen2yuan(state.orderInfo.randomDiscountPrice) }}元
|
||||||
<view class="center m-t-20 m-b-66">{{ payDescText }}</view>
|
</view>
|
||||||
<view>
|
<view class="center m-t-20 m-b-66">{{ payDescText }}</view>
|
||||||
<radio-group @change="onTapPay">
|
<view>
|
||||||
<label class="" v-for="item in state.payMethods" :key="item.title">
|
<radio-group @change="onTapPay">
|
||||||
<view class="flex-center ju-between m-b-40" :class="{ 'disabled-pay-item': item.disabled }">
|
<label class="" v-for="item in state.payMethods" :key="item.title">
|
||||||
<view class="flex-center">
|
<view
|
||||||
<image class="h_64 w_64" v-if="item.disabled"
|
class="flex-center ju-between m-b-40"
|
||||||
:src="sheep.$url.static('/static/img/shop/pay/cod_disabled.png')"
|
:class="{ 'disabled-pay-item': item.disabled }"
|
||||||
mode="aspectFit" />
|
>
|
||||||
<image class="h_64 w_64" v-else :src="sheep.$url.static(item.icon)" mode="aspectFit" />
|
<view class="flex-center">
|
||||||
<text class="pay-title m-l-12">{{ item.title }}</text>
|
<image
|
||||||
</view>
|
class="h_64 w_64"
|
||||||
<view class="check-box ss-flex ss-col-center ss-p-l-10">
|
v-if="item.disabled"
|
||||||
<view class="userInfo-money ss-m-r-10" v-if="item.value === 'wallet'">
|
:src="sheep.$url.static('/static/img/shop/pay/cod_disabled.png')"
|
||||||
余额: {{ fen2yuan(totalRecharge) }}元
|
mode="aspectFit"
|
||||||
</view>
|
/>
|
||||||
<view class="">
|
<image
|
||||||
<radio :value="item.value" color="var(--ui-BG-Main)"
|
class="h_64 w_64"
|
||||||
backgroundColor="rgba(255, 255, 255, 0)" :disabled="item.disabled"
|
v-else
|
||||||
:checked="state.payment === item.value" />
|
:src="sheep.$url.static(item.icon)"
|
||||||
</view>
|
mode="aspectFit"
|
||||||
</view>
|
/>
|
||||||
</view>
|
<text class="pay-title m-l-12">{{ item.title }}</text>
|
||||||
</label>
|
</view>
|
||||||
</radio-group>
|
<view class="check-box ss-flex ss-col-center ss-p-l-10">
|
||||||
</view>
|
<view class="userInfo-money ss-m-r-10" v-if="item.value === 'wallet'">
|
||||||
|
余额: {{ fen2yuan(totalRecharge) }}元
|
||||||
|
</view>
|
||||||
|
<view class="">
|
||||||
|
<radio
|
||||||
|
:value="item.value"
|
||||||
|
color="var(--ui-BG-Main)"
|
||||||
|
backgroundColor="rgba(255, 255, 255, 0)"
|
||||||
|
:disabled="item.disabled"
|
||||||
|
:checked="state.payment === item.value"
|
||||||
|
/>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</label>
|
||||||
|
</radio-group>
|
||||||
|
</view>
|
||||||
|
|
||||||
<!-- 工具 -->
|
<!-- 工具 -->
|
||||||
<view class="modal-footer ss-flex ss-row-center ss-col-center ss-m-t-80 ss-m-b-40">
|
<view class="modal-footer ss-flex ss-row-center ss-col-center ss-m-t-80 ss-m-b-40">
|
||||||
<button v-if="state.payStatus === 0" class="ss-reset-button past-due-btn">
|
<button v-if="state.payStatus === 0" class="ss-reset-button past-due-btn">
|
||||||
检测支付环境中
|
检测支付环境中
|
||||||
</button>
|
</button>
|
||||||
<button v-else-if="state.payStatus === -1" class="ss-reset-button past-due-btn" disabled>
|
<button v-else-if="state.payStatus === -1" class="ss-reset-button past-due-btn" disabled>
|
||||||
支付已过期
|
支付已过期
|
||||||
</button>
|
</button>
|
||||||
<button v-else class="ai-button2" @tap="onPay" :disabled="state.payStatus !== 1"
|
<button v-else-if="state.payStatus === 3" class="ai-button2" @tap="onPay">
|
||||||
:class="{ 'disabled-btn': state.payStatus !== 1 }">
|
切换支付方式
|
||||||
立即支付
|
</button>
|
||||||
</button>
|
<button
|
||||||
</view>
|
v-else
|
||||||
</view>
|
class="ai-button2"
|
||||||
</s-pages>
|
@tap="onPay"
|
||||||
|
:disabled="state.payStatus !== 1"
|
||||||
|
:class="{ 'disabled-btn': state.payStatus !== 1 }"
|
||||||
|
>
|
||||||
|
立即支付
|
||||||
|
</button>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</s-pages>
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import {
|
import {
|
||||||
ref,
|
ref,
|
||||||
reactive,
|
reactive,
|
||||||
onMounted,
|
onMounted,
|
||||||
onUnmounted,
|
onUnmounted,
|
||||||
getCurrentInstance,
|
getCurrentInstance,
|
||||||
watch,
|
watch,
|
||||||
nextTick,
|
nextTick,
|
||||||
computed,
|
computed,
|
||||||
} from 'vue';
|
} from 'vue';
|
||||||
let { proxy } = getCurrentInstance();
|
let { proxy } = getCurrentInstance();
|
||||||
import { onLoad, onShow } from '@dcloudio/uni-app';
|
import { onLoad, onShow } from '@dcloudio/uni-app';
|
||||||
import * as api from '@/sheep/api/ai/index';
|
import * as api from '@/sheep/api/ai/index';
|
||||||
import sheep from '@/sheep';
|
import sheep from '@/sheep';
|
||||||
import PayChannelApi from '@/sheep/api/pay/channel';
|
import PayChannelApi from '@/sheep/api/pay/channel';
|
||||||
import { fen2yuan, useDurationTime } from '@/sheep/hooks/useGoods';
|
import PayOrderApi from '@/sheep/api/pay/order';
|
||||||
import { getPayMethods, goPayResult } from '@/sheep/platform/pay';
|
import { fen2yuan, useDurationTime } from '@/sheep/hooks/useGoods';
|
||||||
import { SYSCONST } from '@/sheep/helper/const';
|
import { getPayMethods, goPayResult } from '@/sheep/platform/pay';
|
||||||
import { getWallet } from '@/sheep/api/home/pay';
|
import { SYSCONST } from '@/sheep/helper/const';
|
||||||
let id = ref('');
|
import { getWallet } from '@/sheep/api/home/pay';
|
||||||
let payOrderId = ref('');
|
let id = ref('');
|
||||||
let orderInfo = ref({});
|
let payOrderId = ref('');
|
||||||
const userWallet = ref();
|
let orderInfo = ref({});
|
||||||
|
const userWallet = ref();
|
||||||
const returnTo = ref('');
|
const returnTo = ref('');
|
||||||
|
|
||||||
let totalRecharge = ref();
|
let totalRecharge = ref();
|
||||||
// 检测支付环境
|
// 检测支付环境
|
||||||
const state = reactive({
|
const state = reactive({
|
||||||
orderType: 'aiGoods', // 订单类型; goods - 商品订单, recharge - 充值订单 aiRecharge
|
orderType: 'aiGoods', // 订单类型; goods - 商品订单, recharge - 充值订单 aiRecharge
|
||||||
orderInfo: {}, // 支付单信息
|
orderInfo: {}, // 支付单信息
|
||||||
payStatus: 0, // 0=检测支付环境, -2=未查询到支付单信息, -1=支付已过期, 1=待支付,2=订单已支付
|
payStatus: 0, // 0=检测支付环境, -2=未查询到支付单信息, -1=支付已过期, 1=待支付,2=订单已支付,3=现金待确认
|
||||||
payMethods: [], // 可选的支付方式
|
payMethods: [], // 可选的支付方式
|
||||||
payment: '', // 选中的支付方式
|
payment: '', // 选中的支付方式
|
||||||
});
|
});
|
||||||
const getOrderDetail = async () => {
|
const getOrderDetail = async () => {
|
||||||
let { code, data } = await api.getOrderDetail({ id: id.value });
|
let { code, data } = await api.getOrderDetail({ id: id.value });
|
||||||
console.log('订单详情', code, data);
|
console.log('订单详情', code, data);
|
||||||
if (code !== 0 || !data) {
|
if (code !== 0 || !data) {
|
||||||
state.payStatus = -2;
|
state.payStatus = -2;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
state.orderInfo = data || {};
|
state.orderInfo = data || {};
|
||||||
// 设置支付状态
|
// 设置支付状态
|
||||||
checkPayStatus();
|
checkPayStatus();
|
||||||
// 获得支付方式
|
// 获得支付方式
|
||||||
await setPayMethods();
|
await setPayMethods();
|
||||||
};
|
};
|
||||||
|
|
||||||
// 获得支付方式
|
// 获得支付方式
|
||||||
async function setPayMethods() {
|
async function setPayMethods() {
|
||||||
const { data, code } = await PayChannelApi.getEnableChannelCodeList(state.orderInfo.appId || 1);
|
// 业务订单详情不含支付应用编号,拆分后需从支付单获取真实 appId,避免误用商城应用渠道
|
||||||
// console.log('支付方式', code, data);
|
let appId = Number(state.orderInfo.appId);
|
||||||
if (code !== 0) {
|
if (!appId && payOrderId.value) {
|
||||||
return;
|
const payOrderRes = await PayOrderApi.getOrder(payOrderId.value, false);
|
||||||
}
|
appId = Number(payOrderRes?.data?.appId);
|
||||||
state.payMethods = getPayMethods(data);
|
}
|
||||||
console.log('支付方式', state.payMethods);
|
if (!appId) {
|
||||||
// 金额超出阈值,仅允许余额支付
|
sheep.$helper.toast('支付应用信息异常');
|
||||||
if (state.orderInfo?.totalPrice >= SYSCONST.MAX_PRICE) {
|
state.payMethods = [];
|
||||||
state.payMethods = state.payMethods.map((item) => ({
|
return;
|
||||||
...item,
|
}
|
||||||
disabled: item.value !== 'wallet' ? true : item.disabled,
|
const { data, code } = await PayChannelApi.getEnableChannelCodeList(appId);
|
||||||
}));
|
// console.log('支付方式', code, data);
|
||||||
state.payment = 'wallet';
|
if (code !== 0) {
|
||||||
}
|
return;
|
||||||
state.payMethods.find((item) => {
|
}
|
||||||
if (item.value && !item.disabled) {
|
// 现金待确认状态下去除现金渠道,仅展示可切换的线上渠道
|
||||||
state.payment = item.value;
|
state.payMethods = getPayMethods(data).filter(
|
||||||
return true;
|
(item) => item.value !== 'cash' || state.payStatus !== 3,
|
||||||
}
|
);
|
||||||
});
|
console.log('支付方式', state.payMethods);
|
||||||
}
|
// 金额超出阈值,仅允许余额支付
|
||||||
// 支付文案提示
|
if (state.orderInfo?.totalPrice >= SYSCONST.MAX_PRICE) {
|
||||||
const payDescText = computed(() => {
|
state.payMethods = state.payMethods.map((item) => ({
|
||||||
if (state.payStatus === 2) {
|
...item,
|
||||||
return '该订单已支付';
|
disabled: item.value !== 'wallet' ? true : item.disabled,
|
||||||
}
|
}));
|
||||||
if (state.payStatus === 1 && state.orderInfo?.payExpireTime) {
|
state.payment = 'wallet';
|
||||||
const time = useDurationTime(state.orderInfo.payExpireTime);
|
}
|
||||||
if (time?.ms <= 0) {
|
state.payMethods.find((item) => {
|
||||||
state.payStatus = -1;
|
if (item.value && !item.disabled) {
|
||||||
return '';
|
state.payment = item.value;
|
||||||
}
|
return true;
|
||||||
return `剩余支付时间 ${time?.h}:${time?.m}:${time?.s} `;
|
}
|
||||||
}
|
});
|
||||||
if (state.payStatus === -2) {
|
}
|
||||||
return '未查询到支付单信息';
|
// 支付文案提示
|
||||||
}
|
const payDescText = computed(() => {
|
||||||
return '';
|
if (state.payStatus === 2) {
|
||||||
});
|
return '该订单已支付';
|
||||||
|
}
|
||||||
|
if (state.payStatus === 3) {
|
||||||
|
return '现金待确认';
|
||||||
|
}
|
||||||
|
if (state.payStatus === 1 && state.orderInfo?.payExpireTime) {
|
||||||
|
const time = useDurationTime(state.orderInfo.payExpireTime);
|
||||||
|
if (time?.ms <= 0) {
|
||||||
|
state.payStatus = -1;
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
return `剩余支付时间 ${time?.h}:${time?.m}:${time?.s} `;
|
||||||
|
}
|
||||||
|
if (state.payStatus === -2) {
|
||||||
|
return '未查询到支付单信息';
|
||||||
|
}
|
||||||
|
return '';
|
||||||
|
});
|
||||||
|
|
||||||
// 状态转换:payOrder.status => payStatus
|
// 状态转换:payOrder.status => payStatus
|
||||||
function checkPayStatus() {
|
function checkPayStatus() {
|
||||||
if (state.orderInfo.status === 10 || state.orderInfo.status === 20) {
|
if (state.orderInfo.status === 10 || state.orderInfo.status === 20) {
|
||||||
// 支付成功
|
// 支付成功
|
||||||
state.payStatus = 2;
|
state.payStatus = 2;
|
||||||
// 跳转回支付成功页
|
// 跳转回支付成功页
|
||||||
uni.showModal({
|
uni.showModal({
|
||||||
title: '提示',
|
title: '提示',
|
||||||
content: '订单已支付',
|
content: '订单已支付',
|
||||||
confirmColor: '#FA7E31',
|
confirmColor: '#FA7E31',
|
||||||
showCancel: false,
|
showCancel: false,
|
||||||
success: function () {
|
success: function () {
|
||||||
goPayResult(state.orderInfo.id, state.orderType);
|
goPayResult(state.orderInfo.id, state.orderType);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (state.orderInfo.status === 30) {
|
if (state.orderInfo.status === 30) {
|
||||||
// 支付关闭
|
// 支付关闭
|
||||||
state.payStatus = -1;
|
state.payStatus = -1;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
state.payStatus = 1; // 待支付
|
if (Number(state.orderInfo.status) === 70) {
|
||||||
}
|
state.payStatus = 3;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
state.payStatus = 1; // 待支付
|
||||||
|
}
|
||||||
|
|
||||||
// 切换支付方式
|
// 切换支付方式
|
||||||
function onTapPay(e) {
|
function onTapPay(e) {
|
||||||
state.payment = e.detail.value;
|
state.payment = e.detail.value;
|
||||||
}
|
}
|
||||||
let type = ref(); //2充值
|
let type = ref(); //2充值
|
||||||
onLoad(async (options) => {
|
onLoad(async (options) => {
|
||||||
id.value = options.id || '';
|
id.value = options.id || '';
|
||||||
payOrderId.value = options.payOrderId || '';
|
payOrderId.value = options.payOrderId || '';
|
||||||
type.value = options.type || '';
|
type.value = options.type || '';
|
||||||
returnTo.value = options.returnTo || '';
|
returnTo.value = options.returnTo || '';
|
||||||
|
|
||||||
if (type.value == 2) {
|
if (type.value == 2) {
|
||||||
state.orderType = 'aiRecharge';
|
state.orderType = 'aiRecharge';
|
||||||
state.orderInfo.totalPrice = options.price * 100;
|
state.orderInfo.totalPrice = options.price * 100;
|
||||||
// state.orderInfo.price = options.price || '';
|
// state.orderInfo.price = options.price || '';
|
||||||
|
|
||||||
// 设置支付状态
|
// 设置支付状态
|
||||||
checkPayStatus();
|
checkPayStatus();
|
||||||
// 获得支付方式
|
// 获得支付方式
|
||||||
await setPayMethods();
|
await setPayMethods();
|
||||||
} else {
|
} else {
|
||||||
getOrderDetail();
|
getOrderDetail();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
onShow(() => {
|
onShow(() => {
|
||||||
getWallet().then((res) => {
|
getWallet().then((res) => {
|
||||||
if (res.code === 0) {
|
if (res.code === 0) {
|
||||||
totalRecharge.value = res.data.totalRecharge;
|
totalRecharge.value = res.data.totalRecharge;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
const onPay = () => {
|
const onPay = () => {
|
||||||
// console.log(userWallet.value.totalRecharge);
|
// console.log(userWallet.value.totalRecharge);
|
||||||
if (state.payment === '') {
|
if (state.payment === '') {
|
||||||
sheep.$helper.toast('请选择支付方式');
|
sheep.$helper.toast('请选择支付方式');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (state.orderInfo.totalPrice >= SYSCONST.MAX_PRICE && state.payment !== 'wallet') {
|
if (state.orderInfo.totalPrice >= SYSCONST.MAX_PRICE && state.payment !== 'wallet') {
|
||||||
sheep.$helper.toast('请选择余额支付');
|
sheep.$helper.toast('请选择余额支付');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (returnTo.value) {
|
if (returnTo.value) {
|
||||||
uni.setStorageSync('pay_return_to', returnTo.value);
|
uni.setStorageSync('pay_return_to', returnTo.value);
|
||||||
} else if (String(type.value) === '2') {
|
} else if (String(type.value) === '2') {
|
||||||
@@ -215,130 +261,130 @@
|
|||||||
} else if (state.orderType === 'aiGoods') {
|
} else if (state.orderType === 'aiGoods') {
|
||||||
uni.setStorageSync('pay_return_to', 'aiStore_myshop');
|
uni.setStorageSync('pay_return_to', 'aiStore_myshop');
|
||||||
}
|
}
|
||||||
if (state.payment === 'wallet') {
|
if (state.payment === 'wallet') {
|
||||||
uni.showModal({
|
uni.showModal({
|
||||||
title: '提示',
|
title: '提示',
|
||||||
content: '确定要支付吗?',
|
content: '确定要支付吗?',
|
||||||
confirmColor: '#FA7E31',
|
confirmColor: '#FA7E31',
|
||||||
success: function (res) {
|
success: function (res) {
|
||||||
if (res.confirm) {
|
if (res.confirm) {
|
||||||
// sheep.$platform.pay(state.payment, state.orderType, payOrderId.value);
|
// sheep.$platform.pay(state.payment, state.orderType, payOrderId.value);
|
||||||
if (totalRecharge.value < state.orderInfo.totalPrice) {
|
if (totalRecharge.value < state.orderInfo.totalPrice) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '余额不足请充值',
|
title: '余额不足请充值',
|
||||||
icon: 'none',
|
icon: 'none',
|
||||||
});
|
});
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pages/home/recharge',
|
url: '/pages/home/recharge',
|
||||||
});
|
});
|
||||||
}, 1000);
|
}, 1000);
|
||||||
} else {
|
} else {
|
||||||
sheep.$platform.pay(state.payment, state.orderType, payOrderId.value);
|
sheep.$platform.pay(state.payment, state.orderType, payOrderId.value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
sheep.$platform.pay(state.payment, state.orderType, payOrderId.value);
|
sheep.$platform.pay(state.payment, state.orderType, payOrderId.value);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
const onClickLeft = () => {
|
const onClickLeft = () => {
|
||||||
uni.navigateBack({
|
uni.navigateBack({
|
||||||
delta: 1,
|
delta: 1,
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.pay-icon {
|
.pay-icon {
|
||||||
width: 36rpx;
|
width: 36rpx;
|
||||||
height: 36rpx;
|
height: 36rpx;
|
||||||
margin-right: 26rpx;
|
margin-right: 26rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ss-modal-box {
|
.ss-modal-box {
|
||||||
// max-height: 1000rpx;
|
// max-height: 1000rpx;
|
||||||
|
|
||||||
.modal-header {
|
.modal-header {
|
||||||
position: relative;
|
position: relative;
|
||||||
padding: 60rpx 20rpx 40rpx;
|
padding: 60rpx 20rpx 40rpx;
|
||||||
|
|
||||||
.money-text {
|
.money-text {
|
||||||
color: $red;
|
color: $red;
|
||||||
font-size: 46rpx;
|
font-size: 46rpx;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
font-family: OPPOSANS;
|
font-family: OPPOSANS;
|
||||||
|
|
||||||
&::before {
|
&::before {
|
||||||
content: '¥';
|
content: '¥';
|
||||||
font-size: 30rpx;
|
font-size: 30rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.time-text {
|
.time-text {
|
||||||
font-size: 26rpx;
|
font-size: 26rpx;
|
||||||
color: $gray-b;
|
color: $gray-b;
|
||||||
}
|
}
|
||||||
|
|
||||||
.close-icon {
|
.close-icon {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 10rpx;
|
top: 10rpx;
|
||||||
right: 20rpx;
|
right: 20rpx;
|
||||||
font-size: 46rpx;
|
font-size: 46rpx;
|
||||||
opacity: 0.2;
|
opacity: 0.2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.modal-content {
|
.modal-content {
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
|
|
||||||
.pay-title {
|
.pay-title {
|
||||||
font-size: 26rpx;
|
font-size: 26rpx;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
color: #333333;
|
color: #333333;
|
||||||
}
|
}
|
||||||
|
|
||||||
.pay-tip {
|
.pay-tip {
|
||||||
font-size: 26rpx;
|
font-size: 26rpx;
|
||||||
color: #bbbbbb;
|
color: #bbbbbb;
|
||||||
}
|
}
|
||||||
|
|
||||||
.pay-item {
|
.pay-item {
|
||||||
height: 86rpx;
|
height: 86rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.disabled-pay-item {
|
.disabled-pay-item {
|
||||||
.pay-title {
|
.pay-title {
|
||||||
color: #999999;
|
color: #999999;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.userInfo-money {
|
.userInfo-money {
|
||||||
font-size: 26rpx;
|
font-size: 26rpx;
|
||||||
color: #bbbbbb;
|
color: #bbbbbb;
|
||||||
line-height: normal;
|
line-height: normal;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.save-btn {
|
.save-btn {
|
||||||
width: 710rpx;
|
width: 710rpx;
|
||||||
height: 80rpx;
|
height: 80rpx;
|
||||||
border-radius: 40rpx;
|
border-radius: 40rpx;
|
||||||
background: linear-gradient(90deg, var(--ui-BG-Main), var(--ui-BG-Main-gradient));
|
background: linear-gradient(90deg, var(--ui-BG-Main), var(--ui-BG-Main-gradient));
|
||||||
color: $white;
|
color: $white;
|
||||||
}
|
}
|
||||||
|
|
||||||
.disabled-btn {
|
.disabled-btn {
|
||||||
background: #e5e5e5;
|
background: #e5e5e5;
|
||||||
color: #999999;
|
color: #999999;
|
||||||
}
|
}
|
||||||
|
|
||||||
.past-due-btn {
|
.past-due-btn {
|
||||||
width: 710rpx;
|
width: 710rpx;
|
||||||
height: 80rpx;
|
height: 80rpx;
|
||||||
border-radius: 40rpx;
|
border-radius: 40rpx;
|
||||||
background-color: #999;
|
background-color: #999;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -60,6 +60,9 @@
|
|||||||
<button v-else-if="state.payStatus === -1" class="ss-reset-button past-due-btn" disabled>
|
<button v-else-if="state.payStatus === -1" class="ss-reset-button past-due-btn" disabled>
|
||||||
支付已过期
|
支付已过期
|
||||||
</button>
|
</button>
|
||||||
|
<button v-else-if="state.payStatus === 3" class="ai-button2" @tap="onPay">
|
||||||
|
切换支付方式
|
||||||
|
</button>
|
||||||
<button
|
<button
|
||||||
v-else
|
v-else
|
||||||
class="ai-button2"
|
class="ai-button2"
|
||||||
@@ -89,6 +92,7 @@
|
|||||||
import * as api from '@/sheep/api/ai/index';
|
import * as api from '@/sheep/api/ai/index';
|
||||||
import sheep from '@/sheep';
|
import sheep from '@/sheep';
|
||||||
import PayChannelApi from '@/sheep/api/pay/channel';
|
import PayChannelApi from '@/sheep/api/pay/channel';
|
||||||
|
import PayOrderApi from '@/sheep/api/pay/order';
|
||||||
import { fen2yuan, useDurationTime } from '@/sheep/hooks/useGoods';
|
import { fen2yuan, useDurationTime } from '@/sheep/hooks/useGoods';
|
||||||
import { getPayMethods, goPayResult } from '@/sheep/platform/pay';
|
import { getPayMethods, goPayResult } from '@/sheep/platform/pay';
|
||||||
import { SYSCONST } from '@/sheep/helper/const';
|
import { SYSCONST } from '@/sheep/helper/const';
|
||||||
@@ -104,7 +108,7 @@
|
|||||||
const state = reactive({
|
const state = reactive({
|
||||||
orderType: 'aiGoods', // 订单类型; goods - 商品订单, recharge - 充值订单 aiRecharge
|
orderType: 'aiGoods', // 订单类型; goods - 商品订单, recharge - 充值订单 aiRecharge
|
||||||
orderInfo: {}, // 支付单信息
|
orderInfo: {}, // 支付单信息
|
||||||
payStatus: 0, // 0=检测支付环境, -2=未查询到支付单信息, -1=支付已过期, 1=待支付,2=订单已支付
|
payStatus: 0, // 0=检测支付环境, -2=未查询到支付单信息, -1=支付已过期, 1=待支付,2=订单已支付,3=现金待确认
|
||||||
payMethods: [], // 可选的支付方式
|
payMethods: [], // 可选的支付方式
|
||||||
payment: '', // 选中的支付方式
|
payment: '', // 选中的支付方式
|
||||||
});
|
});
|
||||||
@@ -123,11 +127,25 @@
|
|||||||
|
|
||||||
// 获得支付方式
|
// 获得支付方式
|
||||||
async function setPayMethods() {
|
async function setPayMethods() {
|
||||||
const { data, code } = await PayChannelApi.getEnableChannelCodeList(state.orderInfo.appId || 1);
|
// 业务订单详情不含支付应用编号,拆分后需从支付单获取真实 appId,避免误用商城应用渠道
|
||||||
|
let appId = Number(state.orderInfo.appId);
|
||||||
|
if (!appId && payOrderId.value) {
|
||||||
|
const payOrderRes = await PayOrderApi.getOrder(payOrderId.value, false);
|
||||||
|
appId = Number(payOrderRes?.data?.appId);
|
||||||
|
}
|
||||||
|
if (!appId) {
|
||||||
|
sheep.$helper.toast('支付应用信息异常');
|
||||||
|
state.payMethods = [];
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const { data, code } = await PayChannelApi.getEnableChannelCodeList(appId);
|
||||||
if (code !== 0) {
|
if (code !== 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
state.payMethods = getPayMethods(data);
|
// 现金待确认状态下去除现金渠道,仅展示可切换的线上渠道
|
||||||
|
state.payMethods = getPayMethods(data).filter(
|
||||||
|
(item) => item.value !== 'cash' || state.payStatus !== 3,
|
||||||
|
);
|
||||||
// 金额超出阈值,仅允许余额支付
|
// 金额超出阈值,仅允许余额支付
|
||||||
if (state.orderInfo?.totalPrice >= SYSCONST.MAX_PRICE) {
|
if (state.orderInfo?.totalPrice >= SYSCONST.MAX_PRICE) {
|
||||||
state.payMethods = state.payMethods.map((item) => ({
|
state.payMethods = state.payMethods.map((item) => ({
|
||||||
@@ -148,6 +166,9 @@
|
|||||||
if (state.payStatus === 2) {
|
if (state.payStatus === 2) {
|
||||||
return '该订单已支付';
|
return '该订单已支付';
|
||||||
}
|
}
|
||||||
|
if (state.payStatus === 3) {
|
||||||
|
return '现金待确认';
|
||||||
|
}
|
||||||
if (state.payStatus === 1 && state.orderInfo?.payExpireTime) {
|
if (state.payStatus === 1 && state.orderInfo?.payExpireTime) {
|
||||||
const time = useDurationTime(state.orderInfo.payExpireTime);
|
const time = useDurationTime(state.orderInfo.payExpireTime);
|
||||||
if (time?.ms <= 0) {
|
if (time?.ms <= 0) {
|
||||||
@@ -184,6 +205,10 @@
|
|||||||
state.payStatus = -1;
|
state.payStatus = -1;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (Number(state.orderInfo.status) === 70) {
|
||||||
|
state.payStatus = 3;
|
||||||
|
return;
|
||||||
|
}
|
||||||
state.payStatus = 1; // 待支付
|
state.payStatus = 1; // 待支付
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -73,7 +73,11 @@
|
|||||||
<view class="copy" @click.stop="onCopy">
|
<view class="copy" @click.stop="onCopy">
|
||||||
<image :src="`${$url}goods/copy1.png`" mode="scaleToFill" />
|
<image :src="`${$url}goods/copy1.png`" mode="scaleToFill" />
|
||||||
</view>
|
</view>
|
||||||
<truckLine :data="state.orderInfo" :code="3" v-if="state.orderInfo.deliveryTime"></truckLine>
|
<truckLine
|
||||||
|
:data="state.orderInfo"
|
||||||
|
:code="3"
|
||||||
|
v-if="state.orderInfo.deliveryTime"
|
||||||
|
></truckLine>
|
||||||
</view>
|
</view>
|
||||||
<view class="notice-item flex-row ju-between">
|
<view class="notice-item flex-row ju-between">
|
||||||
<text class="title c25">下单时间</text>
|
<text class="title c25">下单时间</text>
|
||||||
@@ -169,6 +173,12 @@
|
|||||||
text: '已取消',
|
text: '已取消',
|
||||||
text1: '您的订单已取消!',
|
text1: '您的订单已取消!',
|
||||||
},
|
},
|
||||||
|
70: {
|
||||||
|
text: '现金待确认',
|
||||||
|
text1: '等待工作人员确认收款',
|
||||||
|
btn1: '切换支付',
|
||||||
|
btn2: '取消订单',
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
// ========== 门店自提(核销) ==========
|
// ========== 门店自提(核销) ==========
|
||||||
@@ -234,7 +244,14 @@
|
|||||||
}
|
}
|
||||||
if (state.orderInfo.status === 0 && type === 2) {
|
if (state.orderInfo.status === 0 && type === 2) {
|
||||||
// 取消订单
|
// 取消订单
|
||||||
cancelOrder();
|
cancelUnpaidOpenOrder();
|
||||||
|
}
|
||||||
|
if (Number(state.orderInfo.status) === 70 && type === 2) {
|
||||||
|
cancelOpenOrder();
|
||||||
|
}
|
||||||
|
if (Number(state.orderInfo.status) === 70 && type === 1) {
|
||||||
|
// 现金待确认切回线上支付
|
||||||
|
goPay();
|
||||||
}
|
}
|
||||||
if (state.orderInfo.status === 20 && type === 1) {
|
if (state.orderInfo.status === 20 && type === 1) {
|
||||||
// 确认收货confirmReceive
|
// 确认收货confirmReceive
|
||||||
@@ -253,8 +270,17 @@
|
|||||||
payOrderId: state.orderInfo.payOrderId,
|
payOrderId: state.orderInfo.payOrderId,
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
const cancelOrder = () => {
|
const cancelUnpaidOpenOrder = () => {
|
||||||
OrderApi.cancelOrder({
|
OrderApi.cancelUnpaidOpenOrder({
|
||||||
|
id: orderId.value,
|
||||||
|
}).then((res) => {
|
||||||
|
if (res.code === 0) {
|
||||||
|
getOrderDetail();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
const cancelOpenOrder = () => {
|
||||||
|
OrderApi.cancelOpenOrder({
|
||||||
id: orderId.value,
|
id: orderId.value,
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
if (res.code === 0) {
|
if (res.code === 0) {
|
||||||
|
|||||||
@@ -178,6 +178,12 @@
|
|||||||
text: '已取消',
|
text: '已取消',
|
||||||
text1: '您的订单已取消!',
|
text1: '您的订单已取消!',
|
||||||
},
|
},
|
||||||
|
70: {
|
||||||
|
text: '现金待确认',
|
||||||
|
text1: '等待工作人员确认收款',
|
||||||
|
btn1: '切换支付',
|
||||||
|
btn2: '取消订单',
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
// ========== 门店自提(核销) ==========
|
// ========== 门店自提(核销) ==========
|
||||||
@@ -264,6 +270,13 @@
|
|||||||
// 取消订单
|
// 取消订单
|
||||||
cancelOrder();
|
cancelOrder();
|
||||||
}
|
}
|
||||||
|
if (Number(state.orderInfo.status) === 70 && type === 2) {
|
||||||
|
cancelOrder();
|
||||||
|
}
|
||||||
|
if (Number(state.orderInfo.status) === 70 && type === 1) {
|
||||||
|
// 现金待确认切回线上支付
|
||||||
|
goPay();
|
||||||
|
}
|
||||||
if (state.orderInfo.status === 20 && type === 1) {
|
if (state.orderInfo.status === 20 && type === 1) {
|
||||||
// 确认收货confirmReceive
|
// 确认收货confirmReceive
|
||||||
OrderApi.confirmReceive({
|
OrderApi.confirmReceive({
|
||||||
|
|||||||
+41
-13
@@ -72,7 +72,11 @@
|
|||||||
<view class="copy" @click.stop="onCopy">
|
<view class="copy" @click.stop="onCopy">
|
||||||
<image :src="`${$url}goods/copy2.svg`" mode="scaleToFill" />
|
<image :src="`${$url}goods/copy2.svg`" mode="scaleToFill" />
|
||||||
</view>
|
</view>
|
||||||
<truckLine :data="state.orderInfo" :code="1" v-if="state.orderInfo.deliveryTime"></truckLine>
|
<truckLine
|
||||||
|
:data="state.orderInfo"
|
||||||
|
:code="1"
|
||||||
|
v-if="state.orderInfo.deliveryTime"
|
||||||
|
></truckLine>
|
||||||
</view>
|
</view>
|
||||||
<view class="notice-item flex-row ju-between">
|
<view class="notice-item flex-row ju-between">
|
||||||
<text class="title c0">下单时间</text>
|
<text class="title c0">下单时间</text>
|
||||||
@@ -103,8 +107,14 @@
|
|||||||
@now="nowShipment"
|
@now="nowShipment"
|
||||||
@confirm="confirmReceiveOrder"
|
@confirm="confirmReceiveOrder"
|
||||||
@pay="goPay"
|
@pay="goPay"
|
||||||
|
@cancel="cancelAiOrder"
|
||||||
/>
|
/>
|
||||||
<card_orderBan v-else :data="state.orderInfo" @downData="getOrderDetail" type="2"></card_orderBan>
|
<card_orderBan
|
||||||
|
v-else
|
||||||
|
:data="state.orderInfo"
|
||||||
|
@downData="getOrderDetail"
|
||||||
|
type="2"
|
||||||
|
></card_orderBan>
|
||||||
</view>
|
</view>
|
||||||
</su-fixed>
|
</su-fixed>
|
||||||
</s-pages>
|
</s-pages>
|
||||||
@@ -114,10 +124,7 @@
|
|||||||
import sheep from '@/sheep';
|
import sheep from '@/sheep';
|
||||||
import { onLoad, onShow } from '@dcloudio/uni-app';
|
import { onLoad, onShow } from '@dcloudio/uni-app';
|
||||||
import { computed, reactive, ref } from 'vue';
|
import { computed, reactive, ref } from 'vue';
|
||||||
import {
|
import { fen2yuan, handleOrderButtons } from '@/sheep/hooks/useGoods';
|
||||||
fen2yuan,
|
|
||||||
handleOrderButtons,
|
|
||||||
} from '@/sheep/hooks/useGoods';
|
|
||||||
import OrderApi from '@/sheep/api/trade/order';
|
import OrderApi from '@/sheep/api/trade/order';
|
||||||
import {
|
import {
|
||||||
aiDelayedShipment,
|
aiDelayedShipment,
|
||||||
@@ -126,11 +133,13 @@
|
|||||||
giftConfirmReceive,
|
giftConfirmReceive,
|
||||||
getOrderDetail as getAiOrderDetail,
|
getOrderDetail as getAiOrderDetail,
|
||||||
getOpenOrderDetail,
|
getOpenOrderDetail,
|
||||||
|
cancelOrder as cancelAiOrderRequest,
|
||||||
|
cancelOpenOrder,
|
||||||
} from '@/sheep/api/ai';
|
} from '@/sheep/api/ai';
|
||||||
import StoreApi from '@/sheep/api/trade/store';
|
import StoreApi from '@/sheep/api/trade/store';
|
||||||
import card_order from '@/components/orderItem/card_order.vue';
|
import card_order from '@/components/orderItem/card_order.vue';
|
||||||
import AiOrderActionBar from '@/components/orderItem/AiOrderActionBar.vue';
|
import AiOrderActionBar from '@/components/orderItem/AiOrderActionBar.vue';
|
||||||
import truckLine from '@/components/truckLine/truckLine.vue'
|
import truckLine from '@/components/truckLine/truckLine.vue';
|
||||||
import PickUpVerify from '@/pages/order/pickUpVerify.vue';
|
import PickUpVerify from '@/pages/order/pickUpVerify.vue';
|
||||||
|
|
||||||
const headerBg = sheep.$url.css('/static/img/shop/order/order_bg.png');
|
const headerBg = sheep.$url.css('/static/img/shop/order/order_bg.png');
|
||||||
@@ -143,7 +152,6 @@
|
|||||||
source: '',
|
source: '',
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
// ========== 门店自提(核销) ==========
|
// ========== 门店自提(核销) ==========
|
||||||
const systemStore = ref({}); // 门店信息
|
const systemStore = ref({}); // 门店信息
|
||||||
|
|
||||||
@@ -178,7 +186,7 @@
|
|||||||
const status = Number(state.orderInfo?.status);
|
const status = Number(state.orderInfo?.status);
|
||||||
if ([0, 20].includes(status)) return true;
|
if ([0, 20].includes(status)) return true;
|
||||||
if (isPickUpOrder.value) return false;
|
if (isPickUpOrder.value) return false;
|
||||||
return [10, 50].includes(status);
|
return [10, 50, 70].includes(status);
|
||||||
});
|
});
|
||||||
|
|
||||||
const resolvePickUpStoreId = (data = {}) => {
|
const resolvePickUpStoreId = (data = {}) => {
|
||||||
@@ -256,9 +264,10 @@
|
|||||||
const confirmReceiveOrder = async () => {
|
const confirmReceiveOrder = async () => {
|
||||||
const id = resolveAiOrderId(state.orderInfo);
|
const id = resolveAiOrderId(state.orderInfo);
|
||||||
if (!id) return;
|
if (!id) return;
|
||||||
const req = Number(state.orderInfo?.type) === 5 || String(state.orderType) === '5'
|
const req =
|
||||||
? giftConfirmReceive
|
Number(state.orderInfo?.type) === 5 || String(state.orderType) === '5'
|
||||||
: aiConfirmReceive;
|
? giftConfirmReceive
|
||||||
|
: aiConfirmReceive;
|
||||||
const { code } = await req({ id });
|
const { code } = await req({ id });
|
||||||
if (code === 0) {
|
if (code === 0) {
|
||||||
getOrderDetail();
|
getOrderDetail();
|
||||||
@@ -281,6 +290,25 @@
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const cancelAiOrder = () => {
|
||||||
|
const id = resolveAiOrderId(state.orderInfo);
|
||||||
|
if (!id) return;
|
||||||
|
uni.showModal({
|
||||||
|
title: '提示',
|
||||||
|
content: '确定要取消订单吗?',
|
||||||
|
confirmColor: '#FA7E31',
|
||||||
|
success: async (res) => {
|
||||||
|
if (!res.confirm) return;
|
||||||
|
const request =
|
||||||
|
Number(state.orderInfo?.type) === 5 || String(state.orderType) === '5'
|
||||||
|
? cancelOpenOrder
|
||||||
|
: cancelAiOrderRequest;
|
||||||
|
const result = await request({ id });
|
||||||
|
if (result.code === 0) await getOrderDetail();
|
||||||
|
},
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
async function getOrderDetail() {
|
async function getOrderDetail() {
|
||||||
let id = state.orderInfo.id;
|
let id = state.orderInfo.id;
|
||||||
// 对详情数据进行适配
|
// 对详情数据进行适配
|
||||||
@@ -350,7 +378,7 @@
|
|||||||
type: 1,
|
type: 1,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "随机优惠",
|
title: '随机优惠',
|
||||||
value: 'randomDiscountPrice',
|
value: 'randomDiscountPrice',
|
||||||
type: 1,
|
type: 1,
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -72,6 +72,7 @@
|
|||||||
:data="v"
|
:data="v"
|
||||||
@downData="downCallback(state.currentTab)"
|
@downData="downCallback(state.currentTab)"
|
||||||
:index="state.currentTab"
|
:index="state.currentTab"
|
||||||
|
:isAfterSale="tabMaps[state.currentTab].id === 4"
|
||||||
>
|
>
|
||||||
</orderItem>
|
</orderItem>
|
||||||
</view>
|
</view>
|
||||||
@@ -119,6 +120,11 @@
|
|||||||
name: '待支付',
|
name: '待支付',
|
||||||
value: 0,
|
value: 0,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
id: 70,
|
||||||
|
name: '现金待确认',
|
||||||
|
value: 70,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
id: 10,
|
id: 10,
|
||||||
name: '待发货',
|
name: '待发货',
|
||||||
|
|||||||
+22
-10
@@ -31,12 +31,7 @@
|
|||||||
src="/static/pay/cod_disabled.png"
|
src="/static/pay/cod_disabled.png"
|
||||||
mode="aspectFit"
|
mode="aspectFit"
|
||||||
/>
|
/>
|
||||||
<image
|
<image class="pay-icon" v-else :src="item.icon" mode="aspectFit" />
|
||||||
class="pay-icon"
|
|
||||||
v-else
|
|
||||||
:src="item.icon"
|
|
||||||
mode="aspectFit"
|
|
||||||
/>
|
|
||||||
<text class="pay-title c0">{{ item.title }}</text>
|
<text class="pay-title c0">{{ item.title }}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="check-box ss-flex ss-col-center ss-p-l-10">
|
<view class="check-box ss-flex ss-col-center ss-p-l-10">
|
||||||
@@ -64,6 +59,9 @@
|
|||||||
<button v-else-if="state.payStatus === -1" class="ss-reset-button past-due-btn" disabled>
|
<button v-else-if="state.payStatus === -1" class="ss-reset-button past-due-btn" disabled>
|
||||||
支付已过期
|
支付已过期
|
||||||
</button>
|
</button>
|
||||||
|
<button v-else-if="state.payStatus === 3" class="submit-btn" @tap="onPay">
|
||||||
|
切换支付方式
|
||||||
|
</button>
|
||||||
<button
|
<button
|
||||||
v-else
|
v-else
|
||||||
class="submit-btn"
|
class="submit-btn"
|
||||||
@@ -94,7 +92,7 @@
|
|||||||
const state = reactive({
|
const state = reactive({
|
||||||
orderType: 'goods', // 订单类型; goods - 商品订单, recharge - 充值订单
|
orderType: 'goods', // 订单类型; goods - 商品订单, recharge - 充值订单
|
||||||
orderInfo: {}, // 支付单信息
|
orderInfo: {}, // 支付单信息
|
||||||
payStatus: 0, // 0=检测支付环境, -2=未查询到支付单信息, -1=支付已过期, 1=待支付,2=订单已支付
|
payStatus: 0, // 0=检测支付环境, -2=未查询到支付单信息, -1=支付已过期, 1=待支付,2=订单已支付,3=现金待确认
|
||||||
payMethods: [], // 可选的支付方式
|
payMethods: [], // 可选的支付方式
|
||||||
payment: '', // 选中的支付方式
|
payment: '', // 选中的支付方式
|
||||||
});
|
});
|
||||||
@@ -139,7 +137,11 @@
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
console.log('支付方式:'+state.payment, '订单类型:'+state.orderType, '订单ID:'+state.orderInfo.id);
|
console.log(
|
||||||
|
'支付方式:' + state.payment,
|
||||||
|
'订单类型:' + state.orderType,
|
||||||
|
'订单ID:' + state.orderInfo.id,
|
||||||
|
);
|
||||||
sheep.$platform.pay(state.payment, state.orderType, state.orderInfo.id);
|
sheep.$platform.pay(state.payment, state.orderType, state.orderInfo.id);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -149,6 +151,9 @@
|
|||||||
if (state.payStatus === 2) {
|
if (state.payStatus === 2) {
|
||||||
return '该订单已支付';
|
return '该订单已支付';
|
||||||
}
|
}
|
||||||
|
if (state.payStatus === 3) {
|
||||||
|
return '现金待确认';
|
||||||
|
}
|
||||||
// if (state.payStatus === 1 && state.orderInfo?.expireTime) {
|
// if (state.payStatus === 1 && state.orderInfo?.expireTime) {
|
||||||
// const time = useDurationTime(state.orderInfo.expireTime);
|
// const time = useDurationTime(state.orderInfo.expireTime);
|
||||||
// if (time?.ms <= 0) {
|
// if (time?.ms <= 0) {
|
||||||
@@ -185,6 +190,10 @@
|
|||||||
state.payStatus = -1;
|
state.payStatus = -1;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (Number(state.orderInfo.status) === 40) {
|
||||||
|
state.payStatus = 3;
|
||||||
|
return;
|
||||||
|
}
|
||||||
state.payStatus = 1; // 待支付
|
state.payStatus = 1; // 待支付
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -213,7 +222,7 @@
|
|||||||
|
|
||||||
// 设置支付状态
|
// 设置支付状态
|
||||||
checkPayStatus();
|
checkPayStatus();
|
||||||
// 获得支付方式
|
// 现金待确认不再展示支付渠道
|
||||||
await setPayMethods();
|
await setPayMethods();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -224,7 +233,10 @@
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
console.log(data);
|
console.log(data);
|
||||||
state.payMethods = getPayMethods(data);
|
// 现金待确认状态下去除现金渠道,仅展示可切换的线上渠道
|
||||||
|
state.payMethods = getPayMethods(data).filter(
|
||||||
|
(item) => item.value !== 'cash' || state.payStatus !== 3,
|
||||||
|
);
|
||||||
console.log(state.payMethods);
|
console.log(state.payMethods);
|
||||||
state.payMethods.find((item) => {
|
state.payMethods.find((item) => {
|
||||||
console.log(item);
|
console.log(item);
|
||||||
|
|||||||
+149
-123
@@ -1,19 +1,19 @@
|
|||||||
import request from '@/sheep/request'
|
import request from '@/sheep/request';
|
||||||
// 消息列表 aishop/shop-messages/list
|
// 消息列表 aishop/shop-messages/list
|
||||||
export function getMessageList(params: any) {
|
export function getMessageList(params: any) {
|
||||||
return request({
|
return request({
|
||||||
url: '/aishop/shop-messages/list',
|
url: '/aishop/shop-messages/list',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params
|
params,
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
// 是否开通店铺 member/user/check-shop-status
|
// 是否开通店铺 member/user/check-shop-status
|
||||||
export function checkShopStatus(params: any) {
|
export function checkShopStatus(params: any) {
|
||||||
return request({
|
return request({
|
||||||
url: '/member/user/check-shop-status',
|
url: '/member/user/check-shop-status',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params
|
params,
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 判断剩余开通数量 member/user/ai-shop-remaining
|
// 判断剩余开通数量 member/user/ai-shop-remaining
|
||||||
@@ -21,8 +21,8 @@ export function getRemainingCount(params: any) {
|
|||||||
return request({
|
return request({
|
||||||
url: '/member/user/ai-shop-remaining',
|
url: '/member/user/ai-shop-remaining',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params
|
params,
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 选品广场 aishop/product/spu/page
|
// 选品广场 aishop/product/spu/page
|
||||||
@@ -30,16 +30,16 @@ export function getSpuPage(params: any) {
|
|||||||
return request({
|
return request({
|
||||||
url: '/aishop/product/spu/page',
|
url: '/aishop/product/spu/page',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params
|
params,
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
// 选品广场 轮次
|
// 选品广场 轮次
|
||||||
export function getSpuTimeList(params: any) {
|
export function getSpuTimeList(params: any) {
|
||||||
return request({
|
return request({
|
||||||
url: '/aishop/product/spu/time-list',
|
url: '/aishop/product/spu/time-list',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params
|
params,
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 代理收益订单排行 aishop/agent-earnings-order/earnings-page
|
// 代理收益订单排行 aishop/agent-earnings-order/earnings-page
|
||||||
@@ -51,18 +51,18 @@ export function earningsPage(params: any) {
|
|||||||
custom: {
|
custom: {
|
||||||
showLoading: false,
|
showLoading: false,
|
||||||
},
|
},
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
// 明细 aishop/product/spu/get-detail
|
// 明细 aishop/product/spu/get-detail
|
||||||
export function getSpuDetail(id: any, shoppingPlazaId: any) {
|
export function getSpuDetail(id: any, shoppingPlazaId: any) {
|
||||||
return request({
|
return request({
|
||||||
url: '/aishop/product/spu/get-detail',
|
url: '/aishop/product/spu/get-detail',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params:{
|
params: {
|
||||||
id,
|
id,
|
||||||
shoppingPlazaId
|
shoppingPlazaId,
|
||||||
}
|
},
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 添加购物车 app-api/aishop/shop-cart/add
|
// 添加购物车 app-api/aishop/shop-cart/add
|
||||||
@@ -73,17 +73,17 @@ export function addShopCart(params: any) {
|
|||||||
data: params,
|
data: params,
|
||||||
custom: {
|
custom: {
|
||||||
showSuccess: true,
|
showSuccess: true,
|
||||||
successMsg: '添加成功'
|
successMsg: '添加成功',
|
||||||
},
|
},
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
// 获取购物车列表app-api/aishop/shop-cart/list
|
// 获取购物车列表app-api/aishop/shop-cart/list
|
||||||
export function getShopCartList(params: any) {
|
export function getShopCartList(params: any) {
|
||||||
return request({
|
return request({
|
||||||
url: '/aishop/shop-cart/list',
|
url: '/aishop/shop-cart/list',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params
|
params,
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
// 删除购物车 app-api/aishop/shop-cart/delete
|
// 删除购物车 app-api/aishop/shop-cart/delete
|
||||||
export function deleteShopCart(params: any) {
|
export function deleteShopCart(params: any) {
|
||||||
@@ -93,9 +93,9 @@ export function deleteShopCart(params: any) {
|
|||||||
params,
|
params,
|
||||||
custom: {
|
custom: {
|
||||||
showSuccess: true,
|
showSuccess: true,
|
||||||
successMsg: '删除成功'
|
successMsg: '删除成功',
|
||||||
},
|
},
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
// 更新购物车 app-api/aishop/shop-cart/update
|
// 更新购物车 app-api/aishop/shop-cart/update
|
||||||
export function updateShopCart(params: any) {
|
export function updateShopCart(params: any) {
|
||||||
@@ -105,9 +105,9 @@ export function updateShopCart(params: any) {
|
|||||||
data: params,
|
data: params,
|
||||||
custom: {
|
custom: {
|
||||||
showSuccess: true,
|
showSuccess: true,
|
||||||
successMsg: '更新成功'
|
successMsg: '更新成功',
|
||||||
},
|
},
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取订单结算信息aishop/order/settlement
|
// 获取订单结算信息aishop/order/settlement
|
||||||
@@ -115,38 +115,38 @@ export function getSettlementInfo(params: any) {
|
|||||||
return request({
|
return request({
|
||||||
url: '/aishop/order/settlement',
|
url: '/aishop/order/settlement',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params
|
params,
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 生成订单 aishop/order/createOrder
|
// 生成订单 aishop/order/createOrder
|
||||||
export function createOrder(params: any) {
|
export function createOrder(params: any) {
|
||||||
const query = {
|
const query = {
|
||||||
...params,
|
...params,
|
||||||
}
|
};
|
||||||
if (!(Number(query?.id) > 0)) {
|
if (!(Number(query?.id) > 0)) {
|
||||||
delete query.id
|
delete query.id;
|
||||||
}
|
}
|
||||||
if (!(Number(query?.deliveryType) > 0)) {
|
if (!(Number(query?.deliveryType) > 0)) {
|
||||||
delete query.deliveryType
|
delete query.deliveryType;
|
||||||
}
|
}
|
||||||
if (!(Number(query?.pickUpStoreId) > 0)) {
|
if (!(Number(query?.pickUpStoreId) > 0)) {
|
||||||
delete query.pickUpStoreId
|
delete query.pickUpStoreId;
|
||||||
}
|
}
|
||||||
if (!String(query?.receiverName || '').trim()) {
|
if (!String(query?.receiverName || '').trim()) {
|
||||||
delete query.receiverName
|
delete query.receiverName;
|
||||||
}
|
}
|
||||||
if (!String(query?.receiverPhone || query?.receiverMobile || '').trim()) {
|
if (!String(query?.receiverPhone || query?.receiverMobile || '').trim()) {
|
||||||
delete query.receiverPhone
|
delete query.receiverPhone;
|
||||||
} else {
|
} else {
|
||||||
query.receiverPhone = String(query?.receiverPhone || query?.receiverMobile || '').trim()
|
query.receiverPhone = String(query?.receiverPhone || query?.receiverMobile || '').trim();
|
||||||
}
|
}
|
||||||
delete query.receiverMobile
|
delete query.receiverMobile;
|
||||||
return request({
|
return request({
|
||||||
url: '/aishop/order/createOrder',
|
url: '/aishop/order/createOrder',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
params: query,
|
params: query,
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
//查询订单 aishop/order/get-detail
|
//查询订单 aishop/order/get-detail
|
||||||
@@ -154,24 +154,24 @@ export function getOrderDetail(params: any) {
|
|||||||
return request({
|
return request({
|
||||||
url: '/aishop/order/get-detail',
|
url: '/aishop/order/get-detail',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params
|
params,
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
// 获取订单列表 aishop/order/page
|
// 获取订单列表 aishop/order/page
|
||||||
export function getOrderPage(params: any) {
|
export function getOrderPage(params: any) {
|
||||||
return request({
|
return request({
|
||||||
url: '/aishop/order/page',
|
url: '/aishop/order/page',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params
|
params,
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
// 店铺订单列表 aishop/order/aiShopPage
|
// 店铺订单列表 aishop/order/aiShopPage
|
||||||
export function getAiShopPage(params: any) {
|
export function getAiShopPage(params: any) {
|
||||||
return request({
|
return request({
|
||||||
url: '/aishop/order/aiShopPage',
|
url: '/aishop/order/aiShopPage',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params
|
params,
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 取消订单 aishop/order/cancel
|
// 取消订单 aishop/order/cancel
|
||||||
@@ -182,9 +182,35 @@ export function cancelOrder(params: any) {
|
|||||||
params,
|
params,
|
||||||
custom: {
|
custom: {
|
||||||
showSuccess: true,
|
showSuccess: true,
|
||||||
successMsg: '取消成功'
|
successMsg: '取消成功',
|
||||||
},
|
},
|
||||||
})
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 取消现金待确认的 AI 店铺开通订单
|
||||||
|
export function cancelOpenOrder(params: { id: number }) {
|
||||||
|
return request({
|
||||||
|
url: '/aishop/order/cancel-open',
|
||||||
|
method: 'DELETE',
|
||||||
|
params,
|
||||||
|
custom: {
|
||||||
|
showSuccess: true,
|
||||||
|
successMsg: '取消成功',
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 取消未支付的 AI 店铺开通订单
|
||||||
|
export function cancelUnpaidOpenOrder(params: { id: number }) {
|
||||||
|
return request({
|
||||||
|
url: '/aishop/order/cancel-open-unpaid',
|
||||||
|
method: 'DELETE',
|
||||||
|
params,
|
||||||
|
custom: {
|
||||||
|
showSuccess: true,
|
||||||
|
successMsg: '取消成功',
|
||||||
|
},
|
||||||
|
});
|
||||||
}
|
}
|
||||||
// 确认收货 aishop/order/receive
|
// 确认收货 aishop/order/receive
|
||||||
export function confirmReceive(params: any) {
|
export function confirmReceive(params: any) {
|
||||||
@@ -194,9 +220,9 @@ export function confirmReceive(params: any) {
|
|||||||
params,
|
params,
|
||||||
custom: {
|
custom: {
|
||||||
showSuccess: true,
|
showSuccess: true,
|
||||||
successMsg: '确认收货成功'
|
successMsg: '确认收货成功',
|
||||||
},
|
},
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 开通ai店铺aishop/order/createOpen
|
// 开通ai店铺aishop/order/createOpen
|
||||||
@@ -205,97 +231,97 @@ export function createOpen(params: any) {
|
|||||||
url: '/aishop/order/createOpen',
|
url: '/aishop/order/createOpen',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
params,
|
params,
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
// 用户等级 aishop/level-card/info
|
// 用户等级 aishop/level-card/info
|
||||||
export function getLevelInfo(params: any) {
|
export function getLevelInfo(params: any) {
|
||||||
return request({
|
return request({
|
||||||
url: '/aishop/level-card/info',
|
url: '/aishop/level-card/info',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params
|
params,
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getPrice(params: any) {
|
export function getPrice(params: any) {
|
||||||
return request({
|
return request({
|
||||||
url: '/app/markingConfig/getPrice',
|
url: '/app/markingConfig/getPrice',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params
|
params,
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
// 获取是否开通商品发货
|
// 获取是否开通商品发货
|
||||||
export function getAiOpenStatus(params : any) {
|
export function getAiOpenStatus(params: any) {
|
||||||
return request({
|
return request({
|
||||||
url: '/aishop/shop-cart/AiOpenStatus',
|
url: '/aishop/shop-cart/AiOpenStatus',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params
|
params,
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
//获取已购买赠品
|
//获取已购买赠品
|
||||||
export function getGiftOrder(params: any) {
|
export function getGiftOrder(params: any) {
|
||||||
return request({
|
return request({
|
||||||
url: '/aishop/order/get-pay-order',
|
url: '/aishop/order/get-pay-order',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params
|
params,
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
//查询赠品订单
|
//查询赠品订单
|
||||||
export function getGiftOrderDetail(params : any) {
|
export function getGiftOrderDetail(params: any) {
|
||||||
return request({
|
return request({
|
||||||
url: '/aishop/order/get-detail-open',
|
url: '/aishop/order/get-detail-open',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params
|
params,
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
export const getOpenOrderDetail = getGiftOrderDetail;
|
export const getOpenOrderDetail = getGiftOrderDetail;
|
||||||
// 获取开通ai店铺商品订单结算信息
|
// 获取开通ai店铺商品订单结算信息
|
||||||
export function getGiftSettlementInfo(params : any) {
|
export function getGiftSettlementInfo(params: any) {
|
||||||
return request({
|
return request({
|
||||||
url: '/aishop/order/settlement-open',
|
url: '/aishop/order/settlement-open',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params
|
params,
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
// 创建发货状态订单
|
// 创建发货状态订单
|
||||||
export function createOrderOpen(params : any) {
|
export function createOrderOpen(params: any) {
|
||||||
const query = {
|
const query = {
|
||||||
...params,
|
...params,
|
||||||
}
|
};
|
||||||
if (!(Number(query?.id) > 0)) {
|
if (!(Number(query?.id) > 0)) {
|
||||||
delete query.id
|
delete query.id;
|
||||||
}
|
}
|
||||||
if (!(Number(query?.spuId) > 0)) {
|
if (!(Number(query?.spuId) > 0)) {
|
||||||
delete query.spuId
|
delete query.spuId;
|
||||||
}
|
}
|
||||||
if (!(Number(query?.deliveryType) > 0)) {
|
if (!(Number(query?.deliveryType) > 0)) {
|
||||||
delete query.deliveryType
|
delete query.deliveryType;
|
||||||
}
|
}
|
||||||
if (!(Number(query?.pickUpStoreId) > 0)) {
|
if (!(Number(query?.pickUpStoreId) > 0)) {
|
||||||
delete query.pickUpStoreId
|
delete query.pickUpStoreId;
|
||||||
}
|
}
|
||||||
if (!String(query?.receiverName || '').trim()) {
|
if (!String(query?.receiverName || '').trim()) {
|
||||||
delete query.receiverName
|
delete query.receiverName;
|
||||||
}
|
}
|
||||||
if (!String(query?.receiverPhone || query?.receiverMobile || '').trim()) {
|
if (!String(query?.receiverPhone || query?.receiverMobile || '').trim()) {
|
||||||
delete query.receiverPhone
|
delete query.receiverPhone;
|
||||||
} else {
|
} else {
|
||||||
query.receiverPhone = String(query?.receiverPhone || query?.receiverMobile || '').trim()
|
query.receiverPhone = String(query?.receiverPhone || query?.receiverMobile || '').trim();
|
||||||
}
|
}
|
||||||
delete query.receiverMobile
|
delete query.receiverMobile;
|
||||||
return request({
|
return request({
|
||||||
url: '/aishop/order/createOrderOpen',
|
url: '/aishop/order/createOrderOpen',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
params: query,
|
params: query,
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
//查询赠品订单
|
//查询赠品订单
|
||||||
export function getGiftOrderInfo(params: any) {
|
export function getGiftOrderInfo(params: any) {
|
||||||
return request({
|
return request({
|
||||||
url: '/aishop/order/get-detail-open',
|
url: '/aishop/order/get-detail-open',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params
|
params,
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
// 赠品确认收货
|
// 赠品确认收货
|
||||||
export function giftConfirmReceive(params: any) {
|
export function giftConfirmReceive(params: any) {
|
||||||
@@ -305,25 +331,25 @@ export function giftConfirmReceive(params: any) {
|
|||||||
params,
|
params,
|
||||||
custom: {
|
custom: {
|
||||||
showSuccess: true,
|
showSuccess: true,
|
||||||
successMsg: '确认收货成功'
|
successMsg: '确认收货成功',
|
||||||
},
|
},
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
//开通ai店铺赠送商品套餐
|
//开通ai店铺赠送商品套餐
|
||||||
export function getAiProduct(params : any) {
|
export function getAiProduct(params: any) {
|
||||||
return request({
|
return request({
|
||||||
url: '/aishop/product/page',
|
url: '/aishop/product/page',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params
|
params,
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
// 延迟发货
|
// 延迟发货
|
||||||
export function aiDelayedShipment(params : any) {
|
export function aiDelayedShipment(params: any) {
|
||||||
return request({
|
return request({
|
||||||
url: '/aishop/order/update/delayedShipment',
|
url: '/aishop/order/update/delayedShipment',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
params,
|
params,
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getMyShop(params: any) {
|
export function getMyShop(params: any) {
|
||||||
@@ -331,14 +357,14 @@ export function getMyShop(params: any) {
|
|||||||
url: '/aishop/app/myshop/get',
|
url: '/aishop/app/myshop/get',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params,
|
params,
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 立即发货
|
// 立即发货
|
||||||
export function aiPendingShipment(params : any) {
|
export function aiPendingShipment(params: any) {
|
||||||
return request({
|
return request({
|
||||||
url: '/aishop/order/update/pendingShipment',
|
url: '/aishop/order/update/pendingShipment',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
params,
|
params,
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -141,8 +141,8 @@ export function formatOrderStatus(order) {
|
|||||||
if (order.status == 60) {
|
if (order.status == 60) {
|
||||||
return '待处理';
|
return '待处理';
|
||||||
}
|
}
|
||||||
if (order.status == 70) {
|
if (Number(order.status) === 70) {
|
||||||
return '已下架';
|
return '现金待确认';
|
||||||
}
|
}
|
||||||
return '已关闭';
|
return '已关闭';
|
||||||
}
|
}
|
||||||
@@ -156,6 +156,9 @@ export function formatOrderStatusDescription(order) {
|
|||||||
if (order.status === 0) {
|
if (order.status === 0) {
|
||||||
return `请在 ${formatDate(order.payExpireTime)} 前完成支付`;
|
return `请在 ${formatDate(order.payExpireTime)} 前完成支付`;
|
||||||
}
|
}
|
||||||
|
if (Number(order.status) === 70) {
|
||||||
|
return '等待工作人员确认收款';
|
||||||
|
}
|
||||||
if (order.status === 10) {
|
if (order.status === 10) {
|
||||||
return '商家未发货,请耐心等待';
|
return '商家未发货,请耐心等待';
|
||||||
}
|
}
|
||||||
@@ -195,6 +198,9 @@ export function handleOrderButtons(order) {
|
|||||||
order.buttons.push('cancel');
|
order.buttons.push('cancel');
|
||||||
order.buttons.push('pay');
|
order.buttons.push('pay');
|
||||||
}
|
}
|
||||||
|
if (Number(order.status) === 70) {
|
||||||
|
order.buttons.push('cancel');
|
||||||
|
}
|
||||||
if (order.status === 30 && !order.commentStatus) {
|
if (order.status === 30 && !order.commentStatus) {
|
||||||
// 发起评价
|
// 发起评价
|
||||||
order.buttons.push('comment');
|
order.buttons.push('comment');
|
||||||
|
|||||||
+92
-51
@@ -108,7 +108,12 @@ export default class SheepPay {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
return payAction[sheep.$platform.name][this.payment]();
|
const action = payAction[sheep.$platform.name]?.[this.payment];
|
||||||
|
if (!action) {
|
||||||
|
sheep.$helper.toast('当前支付方式不可用');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
return action();
|
||||||
}
|
}
|
||||||
|
|
||||||
// 预支付
|
// 预支付
|
||||||
@@ -134,14 +139,13 @@ export default class SheepPay {
|
|||||||
console.log('发起预支付 API 调用' + JSON.stringify(data));
|
console.log('发起预支付 API 调用' + JSON.stringify(data));
|
||||||
// 发起预支付 API 调用
|
// 发起预支付 API 调用
|
||||||
PayOrderApi.submitOrder(data).then((res) => {
|
PayOrderApi.submitOrder(data).then((res) => {
|
||||||
// 成功时
|
resolve(res);
|
||||||
res.code === 0 && resolve(res);
|
|
||||||
// 失败时
|
// 失败时
|
||||||
if (res.code !== 0 && res.msg.indexOf('无效的openid') >= 0) {
|
if (res.code !== 0 && res.msg?.indexOf('无效的openid') >= 0) {
|
||||||
// 特殊逻辑:微信公众号、小程序支付时,必须传入 openid 不正确的情况
|
// 特殊逻辑:微信公众号、小程序支付时,必须传入 openid 不正确的情况
|
||||||
if (
|
if (
|
||||||
res.msg.indexOf('无效的openid') >= 0 || // 获取的 openid 不正确时,或者随便输入了个 openid
|
res.msg?.indexOf('无效的openid') >= 0 || // 获取的 openid 不正确时,或者随便输入了个 openid
|
||||||
res.msg.indexOf('下单账号与支付账号不一致') >= 0
|
res.msg?.indexOf('下单账号与支付账号不一致') >= 0
|
||||||
) {
|
) {
|
||||||
// https://developers.weixin.qq.com/community/develop/doc/00008c53c347804beec82aed051c00
|
// https://developers.weixin.qq.com/community/develop/doc/00008c53c347804beec82aed051c00
|
||||||
this.bindWeixin();
|
this.bindWeixin();
|
||||||
@@ -181,8 +185,9 @@ export default class SheepPay {
|
|||||||
async wechatWapPay() {
|
async wechatWapPay() {
|
||||||
const { error, data } = await this.prepay();
|
const { error, data } = await this.prepay();
|
||||||
if (error === 0) {
|
if (error === 0) {
|
||||||
const redirect_url = `${getRootUrl()}pages/pay/result?id=${this.id}&payment=${this.payment
|
const redirect_url = `${getRootUrl()}pages/pay/result?id=${this.id}&payment=${
|
||||||
}&orderType=${this.orderType}`;
|
this.payment
|
||||||
|
}&orderType=${this.orderType}`;
|
||||||
location.href = `${data.pay_data.h5_url}&redirect_url=${encodeURIComponent(redirect_url)}`;
|
location.href = `${data.pay_data.h5_url}&redirect_url=${encodeURIComponent(redirect_url)}`;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -234,8 +239,44 @@ export default class SheepPay {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async cashPay() {
|
async cashPay() {
|
||||||
const { code } = await this.prepay('cash_payment');
|
const result = await this.prepay('cash_payment');
|
||||||
code === 0 && this.payResult('success');
|
const code = result?.code;
|
||||||
|
const data = result?.data;
|
||||||
|
if (code !== 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (Number(data?.status) !== 40 || data?.displayContent !== 'cash_pending') {
|
||||||
|
sheep.$helper.toast('现金支付状态异常');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const payOrderResult = await PayOrderApi.getOrder(this.id, false);
|
||||||
|
const payOrder = payOrderResult?.code === 0 ? payOrderResult.data : null;
|
||||||
|
uni.showModal({
|
||||||
|
title: '现金支付',
|
||||||
|
content: '现金支付申请已提交,等待工作人员确认',
|
||||||
|
showCancel: false,
|
||||||
|
success: () => this.redirectCashPendingOrder(payOrder),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
redirectCashPendingOrder(payOrder = {}) {
|
||||||
|
const businessOrderId = payOrder?.merchantOrderId;
|
||||||
|
const orderType = Number(payOrder?.orderType);
|
||||||
|
if (!businessOrderId) {
|
||||||
|
uni.reLaunch({ url: '/pages/order/list' });
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const routes = {
|
||||||
|
1: `/pages/order/detail?id=${businessOrderId}`,
|
||||||
|
2: `/pages/AI/orderInfo?id=${businessOrderId}`,
|
||||||
|
3: `/pages/AI/giftOrderInfo?id=${businessOrderId}`,
|
||||||
|
};
|
||||||
|
const url = routes[orderType];
|
||||||
|
if (!url) {
|
||||||
|
uni.reLaunch({ url: '/pages/order/list' });
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
uni.redirectTo({ url });
|
||||||
}
|
}
|
||||||
|
|
||||||
// 模拟支付
|
// 模拟支付
|
||||||
@@ -273,7 +314,7 @@ export default class SheepPay {
|
|||||||
if (code !== 0) {
|
if (code !== 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
console.log(data.displayContent)
|
console.log(data.displayContent);
|
||||||
uni.requestPayment({
|
uni.requestPayment({
|
||||||
provider: 'alipay',
|
provider: 'alipay',
|
||||||
orderInfo: data.displayContent, // 直接使用返回的支付参数
|
orderInfo: data.displayContent, // 直接使用返回的支付参数
|
||||||
@@ -349,29 +390,31 @@ export default class SheepPay {
|
|||||||
console.log('token:' + uni.getStorageSync('token'));
|
console.log('token:' + uni.getStorageSync('token'));
|
||||||
console.log('orderId:' + that.id);
|
console.log('orderId:' + that.id);
|
||||||
// #ifdef APP-PLUS
|
// #ifdef APP-PLUS
|
||||||
plus.share.getServices(services => {
|
plus.share.getServices(
|
||||||
const weixinService = services.find(service => service.id === 'weixin');
|
(services) => {
|
||||||
if (weixinService) {
|
const weixinService = services.find((service) => service.id === 'weixin');
|
||||||
weixinService.launchMiniProgram({
|
if (weixinService) {
|
||||||
// appid: 'wx23b0c321b5d74d63',
|
weixinService.launchMiniProgram({
|
||||||
id: 'gh_c69ddc78e1cd', // 替换为实际小程序原始ID
|
// appid: 'wx23b0c321b5d74d63',
|
||||||
type: 0, // 类型:// 版本:0-正式版 1-测试版 2-体验版
|
id: 'gh_c69ddc78e1cd', // 替换为实际小程序原始ID
|
||||||
path: 'pages/pkgD/pay?token=' + uni.getStorageSync('token') + '&orderId=' + that.id, // 可选跳转路径
|
type: 0, // 类型:// 版本:0-正式版 1-测试版 2-体验版
|
||||||
});
|
path: 'pages/pkgD/pay?token=' + uni.getStorageSync('token') + '&orderId=' + that.id, // 可选跳转路径
|
||||||
} else {
|
});
|
||||||
uni.showToast({ title: '未检测到微信客户端', icon: 'none' });
|
} else {
|
||||||
}
|
uni.showToast({ title: '未检测到微信客户端', icon: 'none' });
|
||||||
}, err => {
|
}
|
||||||
console.error('获取服务失败:', err);
|
},
|
||||||
});
|
(err) => {
|
||||||
|
console.error('获取服务失败:', err);
|
||||||
|
},
|
||||||
|
);
|
||||||
// #endif
|
// #endif
|
||||||
|
|
||||||
}
|
}
|
||||||
//检测code是否过期
|
//检测code是否过期
|
||||||
verify_wechat_code(code) {
|
verify_wechat_code(code) {
|
||||||
let appid = 'wx23b0c321b5d74d63'
|
let appid = 'wx23b0c321b5d74d63';
|
||||||
let secret = 'aff28ef70e00c12245e77a9804dfd8a2'
|
let secret = 'aff28ef70e00c12245e77a9804dfd8a2';
|
||||||
let url = `https://api.weixin.qq.com/sns/oauth2/access_token?appid=${appid}&secret=${secret}&code=${code}&grant_type=authorization_code`
|
let url = `https://api.weixin.qq.com/sns/oauth2/access_token?appid=${appid}&secret=${secret}&code=${code}&grant_type=authorization_code`;
|
||||||
return uni.request({
|
return uni.request({
|
||||||
url: url,
|
url: url,
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
@@ -382,11 +425,10 @@ export default class SheepPay {
|
|||||||
fail(err) {
|
fail(err) {
|
||||||
console.log('verify_wechat_code 失败:' + JSON.stringify(err));
|
console.log('verify_wechat_code 失败:' + JSON.stringify(err));
|
||||||
},
|
},
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
//检测是否开通支付
|
//检测是否开通支付
|
||||||
is_open_wxPay(pay_info) {
|
is_open_wxPay(pay_info) {
|
||||||
|
|
||||||
uni.requestPayment({
|
uni.requestPayment({
|
||||||
provider: 'wxpay',
|
provider: 'wxpay',
|
||||||
orderInfo: pay_info,
|
orderInfo: pay_info,
|
||||||
@@ -395,35 +437,36 @@ export default class SheepPay {
|
|||||||
},
|
},
|
||||||
fail(err) {
|
fail(err) {
|
||||||
console.error('开通支付失败:', err);
|
console.error('开通支付失败:', err);
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
// 汇付支付宝支付
|
// 汇付支付宝支付
|
||||||
async hfAlipayPay() {
|
async hfAlipayPay() {
|
||||||
let { code, data } = await this.prepay('hf_alipay_app');
|
let { code, data } = await this.prepay('hf_alipay_app');
|
||||||
console.log(data)
|
console.log(data);
|
||||||
if (code !== 0) return
|
if (code !== 0) return;
|
||||||
if (data.displayMode.toLowerCase() == sheep.$platform.name.toLowerCase()) {
|
if (data.displayMode.toLowerCase() == sheep.$platform.name.toLowerCase()) {
|
||||||
//拼接支付宝内部功能,直接打开支付页面
|
//拼接支付宝内部功能,直接打开支付页面
|
||||||
let url = `alipays://platformapi/startapp?saId=10000007&qrcode=${encodeURI(data.displayContent)}?_s=web-other`;
|
let url = `alipays://platformapi/startapp?saId=10000007&qrcode=${encodeURI(
|
||||||
console.log(url)
|
data.displayContent,
|
||||||
let platform = uni.getSystemInfoSync().platform;//获取平台判断
|
)}?_s=web-other`;
|
||||||
|
console.log(url);
|
||||||
|
let platform = uni.getSystemInfoSync().platform; //获取平台判断
|
||||||
if (platform == 'android') {
|
if (platform == 'android') {
|
||||||
plus.runtime.openURL(url)
|
plus.runtime.openURL(url);
|
||||||
} else if (platform == 'ios') {
|
} else if (platform == 'ios') {
|
||||||
plus.runtime.launchApplication({
|
plus.runtime.launchApplication({
|
||||||
action: url
|
action: url,
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
sheep.$helper.toast(`请使用${data.displayMode}进行支付`);
|
sheep.$helper.toast(`请使用${data.displayMode}进行支付`);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getPayMethods(channels) {
|
export function getPayMethods(channels) {
|
||||||
|
channels = Array.isArray(channels) ? channels : [];
|
||||||
const payMethods1 = [
|
const payMethods1 = [
|
||||||
{
|
{
|
||||||
icon: '/static/pay/wechat.svg',
|
icon: '/static/pay/wechat.svg',
|
||||||
@@ -470,10 +513,9 @@ export function getPayMethods(channels) {
|
|||||||
{
|
{
|
||||||
icon: '/static/pay/alipay.svg',
|
icon: '/static/pay/alipay.svg',
|
||||||
title: 'H支付宝支付',
|
title: 'H支付宝支付',
|
||||||
value: "hf_alipay_app",
|
value: 'hf_alipay_app',
|
||||||
disabled: false,
|
disabled: false,
|
||||||
},
|
},
|
||||||
|
|
||||||
];
|
];
|
||||||
let payMethods = [];
|
let payMethods = [];
|
||||||
// 1. 处理【微信支付】
|
// 1. 处理【微信支付】
|
||||||
@@ -492,8 +534,7 @@ export function getPayMethods(channels) {
|
|||||||
let hfAlipayMethod = null;
|
let hfAlipayMethod = null;
|
||||||
payMethods1.forEach((e) => {
|
payMethods1.forEach((e) => {
|
||||||
const exists =
|
const exists =
|
||||||
channels.indexOf(e.value) !== -1 ||
|
channels.indexOf(e.value) !== -1 || (e.value === 'cash' && channels.includes('cash_payment'));
|
||||||
(e.value === 'cash' && channels.includes('cash_payment'));
|
|
||||||
if (exists) {
|
if (exists) {
|
||||||
payMethods.push(e);
|
payMethods.push(e);
|
||||||
if (e.value == 'wechat') {
|
if (e.value == 'wechat') {
|
||||||
@@ -520,7 +561,7 @@ export function getPayMethods(channels) {
|
|||||||
(platform === 'WechatMiniProgram' && channels.includes('wx_lite')) ||
|
(platform === 'WechatMiniProgram' && channels.includes('wx_lite')) ||
|
||||||
(platform === 'App' && channels.includes('wx_app'))
|
(platform === 'App' && channels.includes('wx_app'))
|
||||||
) {
|
) {
|
||||||
wechatMethod.disabled = false;
|
if (wechatMethod) wechatMethod.disabled = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (
|
if (
|
||||||
@@ -529,10 +570,10 @@ export function getPayMethods(channels) {
|
|||||||
(platform === 'WechatMiniProgram' && channels.includes('alipay_wap')) ||
|
(platform === 'WechatMiniProgram' && channels.includes('alipay_wap')) ||
|
||||||
(platform === 'App' && channels.includes('alipay_app'))
|
(platform === 'App' && channels.includes('alipay_app'))
|
||||||
) {
|
) {
|
||||||
alipayMethod.disabled = false;
|
if (alipayMethod) alipayMethod.disabled = false;
|
||||||
}
|
}
|
||||||
if (channels.includes('wallet')) {
|
if (channels.includes('wallet')) {
|
||||||
walletMethod.disabled = false;
|
if (walletMethod) walletMethod.disabled = false;
|
||||||
}
|
}
|
||||||
if (channels.includes('cash_payment') && cashMethod) {
|
if (channels.includes('cash_payment') && cashMethod) {
|
||||||
cashMethod.disabled = false;
|
cashMethod.disabled = false;
|
||||||
@@ -558,7 +599,7 @@ export function goPayResult(id, orderType, resultType) {
|
|||||||
// });
|
// });
|
||||||
uni.redirectTo({
|
uni.redirectTo({
|
||||||
url: '/pages/pay/result?id=' + id + '&orderType=' + orderType + '&payState=' + resultType,
|
url: '/pages/pay/result?id=' + id + '&orderType=' + orderType + '&payState=' + resultType,
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
export function goBindWeixin() {
|
export function goBindWeixin() {
|
||||||
|
|||||||
Reference in New Issue
Block a user