This commit is contained in:
zmj 2024-06-08 17:04:53 +08:00
parent af1677554c
commit 8dfc454ba9
2 changed files with 19 additions and 11 deletions

View File

@ -52,11 +52,12 @@
</view> </view>
<view class="address-btn item-center"> <view class="address-btn item-center">
<view class='ship-type' style=""> <view class='ship-type' style="">
<view class="ship-type-item" :class='{actShipItem:shipping_type==2 }' @click='shipping_type=2'> <view class="ship-type-item" :class='{actShipItem:orderInfo.shipping_type==2 }'
@click='orderInfo.shipping_type=2' v-if='orderInfo.default_delivery==1'>
自提 自提
</view> </view>
<view class="ship-type-item" v-if='true' @click='shipping_type=1' <view class="ship-type-item" v-if='true' @click='orderInfo.shipping_type=1'
:class='{actShipItem:shipping_type==1 }'> :class='{actShipItem:orderInfo.shipping_type==1 }'>
配送 配送
</view> </view>
</view> </view>
@ -86,7 +87,8 @@
<view class="head-title">价格明细</view> <view class="head-title">价格明细</view>
<view class="row"> <view class="row">
<view>商品总价 <text>共计{{cartList.length}}款商品</text></view> <view>商品总价 <text>共计{{cartList.length}}款商品</text></view>
<view><text>¥</text>{{c_price(orderInfo.pay_price, 0)}}<text>.{{c_price(orderInfo.pay_price, 1)}}</text> <view>
<text>¥</text>{{c_price(orderInfo.total_price, 0)}}<text>.{{c_price(orderInfo.total_price, 1)}}</text>
</view> </view>
</view> </view>
<view class="row"> <view class="row">
@ -152,8 +154,8 @@
<text style="color: #000;">合计: </text> <text style="color: #000;">合计: </text>
<text></text> <text></text>
<block v-if="orderInfo.total_price"> <block v-if="orderInfo.total_price">
<text style="font-size: 32rpx;font-weight: bold;">{{c_price(orderInfo.total_price, 0)}}</text> <text style="font-size: 32rpx;font-weight: bold;">{{c_price(orderInfo.pay_price, 0)}}</text>
<text>.{{c_price(orderInfo.total_price, 1)}}</text> <text>.{{c_price(orderInfo.pay_price, 1)}}</text>
</block> </block>
</view> </view>
</view> </view>
@ -197,9 +199,13 @@
createOrderApi createOrderApi
} from "@/api/order.js"; } from "@/api/order.js";
//
let STORE_INFO = uni.getStorageSync('STORE_INFO');
if (STORE_INFO)
STORE_INFO = JSON.parse(STORE_INFO)
const cartStore = useCartStore(); const cartStore = useCartStore();
const reservation_time = ref('') const reservation_time = ref('')
const shipping_type = ref(2)
const formData = ref({ const formData = ref({
remark: "" remark: ""
@ -349,7 +355,8 @@
const orderInfo = ref({}); const orderInfo = ref({});
const checkOrder = () => { const checkOrder = () => {
checkOrderApi({ checkOrderApi({
cart_id: cartStore.cartList cart_id: cartStore.cartList,
store_id: STORE_INFO.id || 0
}).then(res => { }).then(res => {
cartList.value = res.data.cart_list; cartList.value = res.data.cart_list;
orderInfo.value = res.data.order; orderInfo.value = res.data.order;
@ -364,10 +371,11 @@
createOrderApi({ createOrderApi({
cart_id: cartStore.cartList, cart_id: cartStore.cartList,
address_id: addressInfo.value.address_id, address_id: addressInfo.value.address_id,
mer_id: shopInfo.value.mer_id,
pay_type: pay_type.value, pay_type: pay_type.value,
store_id: 2, store_id: 2,
reservation_time: "", reservation_time: reservation_time.value,
shipping_type: orderInfo.value.shipping_type,
mark: formData.value.remark
}).then(res => { }).then(res => {
console.log(res); console.log(res);

View File

@ -35,7 +35,7 @@ const useUserStore = defineStore("user", () => {
mobile: "19330904744", mobile: "19330904744",
nickname: "用户1714964250", nickname: "用户1714964250",
supplier: null, supplier: null,
token: "04d41270bc4dae8053cd180148514747" token: "e5561a79d439a061a3cca3f780d996e2"
} }
// #endif // #endif