优化
This commit is contained in:
@@ -120,6 +120,7 @@ onLoad((e) => {
|
||||
|
||||
onShow(async () => {
|
||||
if(isLogin()) {
|
||||
// userStore.getProfile();
|
||||
if(userInfo.value.maOpenId) {
|
||||
if(getCompanyId() === '') {
|
||||
switchCompany();
|
||||
|
@@ -161,8 +161,9 @@ const addShoppingCart = () => {
|
||||
|
||||
const placeOrder = () => {
|
||||
showSkuDialog((e: GoodsBean) => {
|
||||
console.log(e);
|
||||
const orderBean = {
|
||||
totalPrice: e.price * e.checkedStock.count,
|
||||
totalPrice: (e.consumePrice * e.checkedStock.count).toFixed(2),
|
||||
orderGoods: [e]
|
||||
};
|
||||
goPath(`/pages/mall/subs/order/order-confirm?orderBean=${encodeURIComponent(JSON.stringify(orderBean))}`);
|
||||
|
@@ -124,7 +124,7 @@
|
||||
import { assetsUrl, defaultImage } from '@/utils/assets';
|
||||
import PaymentDialog from '@/components/payment-dialog.vue';
|
||||
import CouponDialog from '@/pages/mall/subs/components/coupon-dialog.vue';
|
||||
import { goPath, parseParameter, sortASCII } from '@/utils';
|
||||
import { goPath, parseParameter, showToast, sortASCII } from '@/utils';
|
||||
import { hexMD5 } from '@/utils/common/md5';
|
||||
import { getPaymentList, orderCreate, overPayment } from '@/api/order';
|
||||
import { CouponBean } from '@/api/user/types';
|
||||
@@ -198,6 +198,12 @@ const navigateTo = (e: any) => {
|
||||
};
|
||||
|
||||
const createOrder = async () => {
|
||||
|
||||
//邮寄
|
||||
if(tabIndex.value == 1 && !deliveryAddress.value.addrid) {
|
||||
showToast('请选择收货地址');
|
||||
return;
|
||||
}
|
||||
const params = {
|
||||
// 'discount': 0,
|
||||
// 'freePrice': 0,
|
||||
@@ -217,7 +223,7 @@ const createOrder = async () => {
|
||||
'stockId': item.checkedStock.stockId,
|
||||
'originPrice': item.price,
|
||||
// 'consumePrice': item.price * ((userInfo.value?.levelEntity?.discount || 0) / 100),
|
||||
'consumePrice': item.price,
|
||||
'consumePrice': item.consumePrice,
|
||||
'discount': userInfo.value?.levelEntity?.discount || 0
|
||||
// 'discountOriginPrice': 0,
|
||||
// 'produceIntegral': 0,
|
||||
|
@@ -85,7 +85,7 @@ watch(checkedAll, (newValue) => {
|
||||
});
|
||||
|
||||
const totalPayPrice = computed(() => {
|
||||
return shoppingCartList.value.filter(res => res.checked).reduce((a, b) => a + b.price * b.checkedStock.count, 0);
|
||||
return shoppingCartList.value.filter(res => res.checked).reduce((a, b) => a + b.consumePrice * b.checkedStock.count, 0);
|
||||
});
|
||||
|
||||
const deleteShoppingCart = () => {
|
||||
|
@@ -10,7 +10,7 @@
|
||||
<view class='right-content accent-text-color' :class='{"right-content-disabled": item?.status==1}'>
|
||||
<text>{{ item?.name }}</text>
|
||||
<text>有效期至{{ dayjs(item?.startTime).format('YYYY-MM-DD') }}</text>
|
||||
<text class='btn-text' :class='{"btn-text-disabled": item?.status==1}'>
|
||||
<text class='btn-text' :class='{"btn-text-disabled": item?.status==1}' @click.stop='goPath("/pages/mall/index")'>
|
||||
立即使用
|
||||
</text>
|
||||
</view>
|
||||
@@ -24,6 +24,7 @@ import { assetsUrl } from '@/utils/assets';
|
||||
import dayjs from 'dayjs';
|
||||
import { PropType } from 'vue';
|
||||
import { CouponBean } from '@/api/user/types';
|
||||
import { goPath } from '@/utils';
|
||||
|
||||
defineProps({
|
||||
item: Object as PropType<CouponBean>
|
||||
|
@@ -4,7 +4,7 @@
|
||||
<image class='goods-image' :src='item?.orderGoods[0].images||defaultImage' />
|
||||
<view class='c-flex-column' style='flex: 1;'>
|
||||
<view class='c-flex-row'>
|
||||
<text class='goods-name'>{{ item?.orderGoods[0].goodsName }}</text>
|
||||
<text class='goods-name'>{{ item?.orderGoods[0].goodsName||'未知' }}</text>
|
||||
<text class='status'>
|
||||
<text v-if='item?.payStatus == 2'>已支付</text>
|
||||
<text v-else-if='isPending(item)'>待支付</text>
|
||||
|
@@ -38,7 +38,7 @@
|
||||
<image class='goods-image' :src='item.stockStock.images||defaultImage' />
|
||||
<view class='c-flex-column' style='flex: 1;'>
|
||||
<view class='c-flex-row'>
|
||||
<text class='goods-name'>{{ item.goodsName }}</text>
|
||||
<text class='goods-name'>{{ item.goodsName || '未知' }}</text>
|
||||
</view>
|
||||
<text style='color: #999999;margin-top: 30rpx'>
|
||||
{{ item.goodsCode }}
|
||||
@@ -92,6 +92,12 @@
|
||||
<text style='color: #5B96FB;margin-left: 10rpx'>复制</text>
|
||||
</text>
|
||||
<text>下单时间:{{ orderBean?.order?.createTime }}</text>
|
||||
<text>
|
||||
支付状态:
|
||||
<text v-if='orderBean?.order?.payStatus == 2' style='color: #F32B2B'>已支付</text>
|
||||
<text v-else-if='isPending(orderBean?.order)' style='color: #F32B2B'>待支付</text>
|
||||
<text v-else style='color: #999999'>已过期</text>
|
||||
</text>
|
||||
</view>
|
||||
|
||||
<view class='bottom-action-view c-flex-row' v-if='isPending(orderBean?.order)'>
|
||||
@@ -404,8 +410,8 @@ const payment = () => {
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
text:nth-of-type(1) {
|
||||
margin-bottom: 12rpx;
|
||||
text:nth-of-type(3) {
|
||||
margin-bottom: 0rpx;
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user