diff --git a/.env b/.env index db4e7e9..389397f 100644 --- a/.env +++ b/.env @@ -7,4 +7,4 @@ VITE_APP_TITLE = 借还柜 VITE_ROUTER_HISTORY = hash ## 是否开启 console 调试工具 -VITE_CONSOLE = true +VITE_CONSOLE = false diff --git a/src/pages/order/index.vue b/src/pages/order/index.vue index aace50f..d55a2b7 100644 --- a/src/pages/order/index.vue +++ b/src/pages/order/index.vue @@ -1,7 +1,10 @@ @@ -94,16 +118,26 @@ onMounted(() => { 数量: {{ item.orderGoods.quantity }} 小计: ¥{{ (item.orderGoods.price * item.orderGoods.quantity).toFixed(2) }} - - - 退还 - - + + + 打开柜子 + + + 退还商品 + + + { > {{ getOrderGoodsStatusText(item.orderGoods.status) }} - @@ -183,20 +216,17 @@ goods-info { color: #999; } -.refund-btn { - margin-left: auto; - color: #fff; - background: #ee0a24; - border-radius: 15px; - padding: 8px 20px; - font-size: 14px; - min-width: 80px; +.button-group { + display: flex; + justify-content: flex-end; + gap: 8px; + width: 100%; } .action-row { display: flex; flex-direction: column; - gap: 8px; align-items: flex-end; + gap: 4px; } \ No newline at end of file diff --git a/src/pages/product/components/checkout.vue b/src/pages/product/components/checkout.vue index c9556c4..f83b64f 100644 --- a/src/pages/product/components/checkout.vue +++ b/src/pages/product/components/checkout.vue @@ -72,7 +72,13 @@ async function handleSubmit() { }) } - // 移除原有的支付方式选择弹窗代码 + // 在handleSubmit函数开头添加验证 + if (!/^1[3-9]\d{9}$/.test(tel.value)) { + return showConfirmDialog({ + title: "格式错误", + message: "请输入有效的手机号码" + }); + } submitting.value = true try { @@ -165,23 +171,40 @@ async function handleSubmit() { + + + - - - - - - 微信支付 - - - - 余额支付(当前:¥{{ balance.toFixed(2) }}) - - - - + + + 微信支付 + + + + + + + + 余额支付 + (当前:¥{{ balance.toFixed(2) }}) + + + + @@ -197,7 +220,7 @@ async function handleSubmit() { - diff --git a/src/pinia/stores/order.ts b/src/pinia/stores/order.ts index 9c9a222..67506e5 100644 --- a/src/pinia/stores/order.ts +++ b/src/pinia/stores/order.ts @@ -3,10 +3,12 @@ import { getOrdersByOpenIdApi } from "@@/apis/shop" import type { ShopOrderEntity, ShopOrderGoodsEntity, Goods } from "@@/apis/shop/type" export interface Order extends ShopOrderEntity { - goodsList: Array<{ - goodsInfo: Goods - orderGoods: ShopOrderGoodsEntity - }> + goodsList: Array +} + +export interface OrderGoods { + goodsInfo: Goods + orderGoods: ShopOrderGoodsEntity } export const useOrderStore = defineStore("order", () => { diff --git a/types/auto/components.d.ts b/types/auto/components.d.ts index 436f172..39a8321 100644 --- a/types/auto/components.d.ts +++ b/types/auto/components.d.ts @@ -27,8 +27,6 @@ declare module 'vue' { VanNavBar: typeof import('vant/es')['NavBar'] VanPicker: typeof import('vant/es')['Picker'] VanPopup: typeof import('vant/es')['Popup'] - VanRadio: typeof import('vant/es')['Radio'] - VanRadioGroup: typeof import('vant/es')['RadioGroup'] VanSidebar: typeof import('vant/es')['Sidebar'] VanSidebarItem: typeof import('vant/es')['SidebarItem'] VanTabbar: typeof import('vant/es')['Tabbar']
数量: {{ item.orderGoods.quantity }}
小计: ¥{{ (item.orderGoods.price * item.orderGoods.quantity).toFixed(2) }}