feat(custom): 新增聚合积分支付
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2024-03-20 15:53:52 +08:00
parent 2646d025f4
commit 63733d0109
14 changed files with 437 additions and 409 deletions

View File

@@ -4,7 +4,7 @@ import Taro from "@tarojs/taro";
import { addCart, getCart, clearCart } from "@/api/cart";
import { Del2 } from "@nutui/icons-vue-taro";
import { createActiveOrder } from "@/api/goods";
import { createAfterOrder } from "@/api/admin";
import { createAfterOrder, getUserPoint } from "@/api/admin";
import Pay from "@/components/Pay.vue";
interface CardList {
@@ -142,11 +142,21 @@ const create_order = async () => {
url: `/pages/admin/add_order/pending_order/pending_order_detail/index?oid=${res.data.oid}&bid=${props.merInfo.bid}`,
});
} else {
const mer_info = Taro.getStorageSync("mer_info");
const user_info = Taro.getStorageSync("userInfo");
const data = await getUserPoint({
phone: user_info.data.phone,
bid: mer_info.bid,
});
res = await createActiveOrder({
Bid: [props.merInfo.bid],
custID: data.data.store_user_id,
});
if (res.data.oid) {
orderData.value = res.oid;
orderData.value = {
jh_info: data.data,
oid: res.data.oid,
};
isShowPay.value = true;
}
}
@@ -174,9 +184,10 @@ defineExpose({
<view class="container">
<view>购物车数量: {{ cartInfo.count }}</view>
<view v-if="cartInfo.count > 0">
<text>总金额: {{ cartInfo.price.toFixed(2) }}</text
<text>总金额: {{ cartInfo.price.toFixed(2) }}</text>
<text v-if="!IsPendingOrder"
>总积分: {{ cartInfo.exchange.toFixed(2) }}</text
>
<text v-if="!IsPendingOrder">总积分: {{ cartInfo.exchange.toFixed(2) }}</text>
</view>
</view>
<view v-if="cartInfo.count > 0" class="payBtn" @click.stop="create_order"