From 551b0b49b5188f413927a9460e1b6281a2eab1ab Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Thu, 8 Aug 2024 17:16:48 +0800 Subject: [PATCH] 1 --- config/app.js | 4 +- pages.json | 7 + pages/my/my.vue | 2 + pagesOrder/delivery/index.vue | 596 ++++++++++++++++++++++++++++++++++ pagesOrder/settle/settle.vue | 44 +-- 5 files changed, 623 insertions(+), 30 deletions(-) create mode 100644 pagesOrder/delivery/index.vue diff --git a/config/app.js b/config/app.js index da7298e..971d6b2 100644 --- a/config/app.js +++ b/config/app.js @@ -3,9 +3,9 @@ let WSS_URL import store from "@/store/user.js" // 环境 // let env = "dev" -let env = "prod" +// let env = "prod" // let env = "release"; -// let env = "local"; +let env = "local"; switch (env) { case 'dev': diff --git a/pages.json b/pages.json index c50dca4..e30cb07 100644 --- a/pages.json +++ b/pages.json @@ -197,6 +197,13 @@ "navigationBarTitleText": "设置密码", "enablePullDownRefresh": false } + }, + { + "path" : "delivery/index", + "style" : + { + "navigationBarTitleText" : "配送员订单" + } } ] }, diff --git a/pages/my/my.vue b/pages/my/my.vue index f4045a6..6fbab3d 100644 --- a/pages/my/my.vue +++ b/pages/my/my.vue @@ -123,6 +123,8 @@ + + diff --git a/pagesOrder/delivery/index.vue b/pagesOrder/delivery/index.vue new file mode 100644 index 0000000..39dbecb --- /dev/null +++ b/pagesOrder/delivery/index.vue @@ -0,0 +1,596 @@ + + + + + \ No newline at end of file diff --git a/pagesOrder/settle/settle.vue b/pagesOrder/settle/settle.vue index 3840893..b1f8337 100644 --- a/pagesOrder/settle/settle.vue +++ b/pagesOrder/settle/settle.vue @@ -83,13 +83,17 @@ + 价格明细 商品总价 共计{{ cartList.length }}款商品 - + ¥{{ c_price(orderInfo.pay_price, 0) }}.{{ c_price(orderInfo.pay_price, 1) }} + + + 运费 @@ -255,10 +259,13 @@ import ZyPasswordboard from '@/uni_modules/zy-passwordboard/components/zy-passwordboard/zy-passwordboard.vue'; const userInfo = useUserStore().userInfo; + const shop_Info = ref({}) + // 用户选择的门店信息 let STORE_INFO = uni.getStorageSync('STORE_INFO'); - if (STORE_INFO) - STORE_INFO = JSON.parse(STORE_INFO) + if (STORE_INFO){ + shop_Info.value = JSON.parse(STORE_INFO) + } const cartStore = useCartStore(); const reservation_time = ref('') @@ -344,23 +351,6 @@ }) } - // getMerchantList(); - // 定位 - // const LoadAddress = () => { - // uni.getLocation({ - // success: (res) => {}, - // fail: (err) => { - // uni.$u.toast('定位失败, 请手动选择提货点!') - // }, - // complete: (res) => { - // myAddressInfo.value.long = res.longitude || ""; - // myAddressInfo.value.lat = res.latitude || ""; - // getMerchantList(); - // } - // }) - // } - // LoadAddress(); - const changeShop = (e) => { shopInfo.value = e; shopListShow.value = false; @@ -395,7 +385,7 @@ } // 提交订单 - const submitOrder = () => { + const submitOrder = () => { if (orderInfo.value.pay_price == 0) { pay_type.value = 3; return uni.$u.toast('当前支付金额为0,暂不能使用微信支付') @@ -412,13 +402,12 @@ long: "", }; let reservation = ref(0); - const shop_Info = ref({}) const cartList = ref([]); const orderInfo = ref({}); const checkOrder = (store_id) => { checkOrderApi({ cart_id: cartStore.cartList, - store_id: STORE_INFO.id || 0, + store_id: shop_Info.value.id || 0, ...location }).then(res => { cartList.value = res.data.cart_list; @@ -447,7 +436,7 @@ }).then(res => { reservation.value = res.data.reservation }) - + checkOrder(datas.id) // formData.store_id = datas.id // formData.store_name = datas.name }) @@ -483,7 +472,6 @@ cart_id: cartStore.cartList, address_id: addressInfo.value.address_id, pay_type: pay_type.value, - store_id: STORE_INFO.id || 0, store_id: shop_Info.value.id, shipping_type: orderInfo.value.shipping_type, mark: formData.value.remark, @@ -564,8 +552,8 @@ price = price + ''; return price.split('.')[index] || (index ? '00' : '0'); } - const toastAddressoff=()=>{ - toastAddressShow.value=false; + const toastAddressoff = () => { + toastAddressShow.value = false; uni.redirectTo({ url: '/pagesOrder/settle/settle' }); @@ -607,7 +595,7 @@ const userLocationfalse = () => { LocationShow.value = false; uni.$u.toast('获取位置当前失败,为你推荐当前门店') - checkOrder(STORE_INFO.id); + checkOrder(shop_Info.value.id); } const opensettings = (a = false) => { if (a == false) {