功能完善

This commit is contained in:
2024-04-13 00:57:24 +08:00
parent 93e9c5227b
commit be328f9243
14 changed files with 244 additions and 107 deletions

View File

@@ -14,17 +14,24 @@
<view v-show='tabIndex==1' class='address-view c-flex-column'
@click.stop='goPath("/pages/mine/subs/address/index")'>
<view class='user-info c-flex-row'>
<text>默认</text>
<text>黄先生</text>
<text>155****6532</text>
<view style='flex: 1' />
<image :src='assetsUrl("ic_arrow_right_gray.png")' />
</view>
<view class='addr c-flex-row'>
<image :src='assetsUrl("ic_location.png")' />
<text>湖南省 长沙市 详细地址详细地址详细地址</text>
<view v-if='deliveryAddress?.addrid'>
<view class='user-info c-flex-row'>
<text class='status' v-if='deliveryAddress?.defaultstatus==1'>默认</text>
<text>{{ deliveryAddress?.name }}</text>
<text>{{ deliveryAddress?.mobile }}</text>
<view style='flex: 1' />
<image :src='assetsUrl("ic_arrow_right_gray.png")' />
</view>
<view class='addr c-flex-row'>
<image :src='assetsUrl("ic_location.png")' />
<text>{{ deliveryAddress?.addr }}</text>
</view>
</view>
<view v-else class='user-info c-flex-row'>
<text style='flex: 1'>请选择收货地址</text>
<image :src='assetsUrl("ic_arrow_right_gray.png")' />
</view>
<image class='dashed-line' :src='assetsUrl("ic_address_dashed_line.png")' />
</view>
@@ -119,13 +126,13 @@ import PaymentDialog from '@/components/payment-dialog.vue';
import CouponDialog from '@/pages/mall/subs/components/coupon-dialog.vue';
import { goPath, parseParameter, sortASCII } from '@/utils';
import { hexMD5 } from '@/utils/common/md5';
import { orderCreate } from '@/api/order';
import { getPaymentList, orderCreate, overPayment } from '@/api/order';
import { CouponBean } from '@/api/user/types';
import { OrderBean } from '@/api/order/types';
import { useUserStore } from '@/store';
const userStore = useUserStore();
const { terminalInfo } = storeToRefs(userStore);
const { terminalInfo, deliveryAddress } = storeToRefs(userStore);
const couponDialogRef = ref();
const paymentDialogRef = ref();
@@ -159,7 +166,7 @@ const buildSqbParams = computed(() => {
});
const changePayment = () => {
paymentDialogRef.value.show();
// paymentDialogRef.value.show();
};
const showCouponDialog = () => {
@@ -185,14 +192,15 @@ const navigateTo = (e: any) => {
const payment = async () => {
await uni.showLoading();
const params = {
'discount': 0,
'freePrice': 0,
'reducePrice': 0,
// 'discount': 0,
// 'freePrice': 0,
// 'reducePrice': 0,
'totalPrice': orderBean?.value?.totalPrice,
'integral': 0,
'allowIntegral': 0,
'produceIntegralNumber': 0,
// 'integral': 0,
// 'allowIntegral': 0,
// 'produceIntegralNumber': 0,
'remark': orderBean.value?.remark,
// 'address': JSON.stringify(deliveryAddress.value),
'orderGoods': orderBean?.value?.orderGoods?.map(item => (
{
'goodsId': item.id,
@@ -200,12 +208,12 @@ const payment = async () => {
'goodsNum': item.checkedStock.count,
'stockId': item.checkedStock.stockId,
'originPrice': item.price,
'consumePrice': item.price,
'discount': 0,
'discountOriginPrice': 0,
'produceIntegral': 0,
'priceModify': [0],
'offset': 0
'consumePrice': item.price
// 'discount': 0,
// 'discountOriginPrice': 0,
// 'produceIntegral': 0,
// 'priceModify': [0],
// 'offset': 0
}
))
};
@@ -213,16 +221,25 @@ const payment = async () => {
const result = await orderCreate(params);
orderBean.value!.id = result.id;
// let signParams = buildSignParams.value;
// const signStr = parseParameter(signParams) + '&key=' + terminalInfo.value.terminalKey;
// const sign = hexMD5(signStr).toUpperCase();
// payParams.value = {
// ...signParams,
// sign: sign
// };
const paymentList = await getPaymentList(orderBean.value?.id || '');
console.log('----------->>>>>orderBean.value ', orderBean.value);
const paymentParams = {
orderId: orderBean?.value?.id,
produceIntegralNumber: Math.round((orderBean?.value?.totalPrice || 0) + (orderBean?.value?.useGold || 0)),
transactionPrice: orderBean?.value?.totalPrice,
useGold: orderBean.value?.useGold || 0,
detailBos: [{
integralNumber: orderBean?.value?.totalPrice || 0,
onlinePayResult: '',
payName: '收钱吧',
payTypeId: paymentList.find((res: any) => res.type === 'ShouQianBa')?.id,
transactionPrice: Number(orderBean?.value?.totalPrice)
}]
};
await overPayment(paymentParams);
uni.navigateBack();
uni.hideLoading();
};
</script>
@@ -278,7 +295,7 @@ const payment = async () => {
margin-left: 20rpx;
margin-right: 20rpx;
text:nth-of-type(1) {
.status {
padding: 2rpx 10rpx;
font-size: 24rpx;
color: #F32B2B;