IkC;IqPzNVB&tH+KCy@zcT3#OgbtSu@vu}7z zESZ-s$>g7wS5_4(>K?uzkgBZ{%)!IEo|z&)E41I*SZsedsjQtXx1fX_FyHFhaTRRF z+MzXw%E~H%7nI4*`*@BfWEcFZ^`E!&S!x-E z1zp#%nsYd@Prum_+8nu4cgtA>-O>B#%FvZQPNBgm0$&4P9PiH3Dq`4PN&GYKWJBeF z2K4Gs_GX5!Uf+|*pe)V5EPW~y>z%-yu~3qohU0Fq(Wf7i;7{#V{U$y_K2yWxM8ewR zf;DV3uPx-=u(UuP9qGE6Bb!|`zjP`lBFZ?tj?oir+2lVo1Su(vy|c6?DZ3q?%<~=S z4W9AZgT_{D?||0~c)#g4-hR~TlKDgUfNxRjerNlKeq;UCYa2r_b2kjAYVcp`x-Jqv zJc#8~vDJ^mtcGGXu{GMy5MS&A9AtN|n{bAJf+DMvTHJZqRDuRobr8pS1b0Q|8Vu zLKHU^G1w`PkwVo4R*V>};<4`Admp^JJ;>iZKnLe^jO
w`(4I6eAXS0@GKcfC*44sR6A7%C6@|4C8 T8XW?F|?~+_u{bqp!Mc6ovL*zE`c$NwVs}W=%RS2YGGe z_bmMe0(Tw3=Te>omd>65cjcsdcG5{l5CiTRid+~P|9FpA_|;c>vd~}%%F?yXFB}!| jtWtX~w^F-LZuJGkcRrrdU4B9g{6mlv+yzE=^ndy<6lNYI literal 0 HcmV?d00001 diff --git a/static/image/shopping/jingdong/waimai/waimai.png b/static/image/shopping/jingdong/waimai/waimai.png new file mode 100644 index 0000000000000000000000000000000000000000..8f27230b260c7ea411c4e153cfc746b9c876728b GIT binary patch literal 1601 zcmXZbc|6p47zglSUaMkeeslch`YF4XP7~eQlGcWjBScLJA#`A e0lC=!|M=fBf{BSdg<+q@upKZ_4w&dO05;kY z8v{6DV*zJu9B>vJ?}AMLT(OCO8#W0z2jDpFSdKgHCg6cf20U@Mfb+Q97jP*TaH$t@ zsh4o6UO287j^_ v)U@i{^GoM3!z2tGFyAmoMO^TP1?VTAl}e115g0Jx4XxK1dFAc!If#ZiP3 zHlZYnAdVu6qlu-_gwhydSqz~JWGwN19I-r}Se`(vNFY`w604Gk)f`gIO=8VWQtd5b z-7Qjm3h4omN@@VOq(*>8YU05XK1srdB?6K}05=17U}+jjng%}v?!qlX_)$9iI0J6K zM{du8+q1|W*>FcTxig0>%OyX_BX{MKy9>xq3jxa0B61HPqR2&Lc`>CID4{$rr6_ 4EJQJ|4F+C+QZM0+El zy=kV6HPgnWwDE_uw-0F(Kns215q%P9rN3*XPd%njx6$9X)8BW{XMj%n?03klj6N$v zJ^)XUIiL&qvm5yfc#3=kdXP_m9QoXf{QV42|MFaYUZK9w_x;j#c?%J6d1_Z}t&XGM zZT2T?TU%%6mIq#Vji69ymYK1U-I0z`{-lG#8g6GN<*+Uqi~8biqjQS RIJ9`GG2 zLhI+$ll>syxdV9EF7M(xlS__S{ifXu$xUVo<@F-N XpMnX@@sMMrG(Ol-C{RAB5JhM5(1oyO7r)0^AGDwpjI zMO8l!l&Gq?d#ePLRE0W8FD|;a?{D+LbRAXJD6X1WUamx3rYH3kda-Wys0paDSyfZK zw%WF^avLLj{aIv#jsWYj?##r10m+u~^=UuPg=x wQ+VR&R#U1*u*efzQE@mc7;4xcr(4P!koQK(?T9Q4xU92%pO(JLEJRzoUX zEY=3`N$)qNY%=dUFFx*Ri6&YZSnm612G^oO-i90uV4$x|vEEvx%Ph{_Ah2M5xkk5} z{|ghfE1eliV^I#;=^n8MW1A;BTAIvM4H^r_*ErM+o9fMPW(4jt4eC3!v@&K8_+Wpp zRuyT7Iydz5+teG~8*;C#nGHE6?RX&Hi}v&i4XEa-35E`Sv`p!OR=2zwc}93?cw3s* z&yMi>aB0UFeU17&wEOV6 q5+!@}^jZ$s7Euv$PVCd(1{+otSxr#M+P+bh&SI;mvgmHSG>s3>ZV4W5I5{L zveYzW($ GaaWry=Zl_!lJg~4I-YM^@_>r zo?Xpbk~)efG_$IQ_8zvfvN^tFH7EAwvF8G>`;7G3s0;_E(zYDcKap1!mYuo0Ws0fg jwo;d!xZC)) Date: Wed, 15 Apr 2026 18:38:50 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E5=AE=8C=E6=88=90=E4=BA=AC=E4=B8=9C?= =?UTF-8?q?=E7=A7=92=E9=80=81=E5=A4=96=E5=8D=96=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../shopping/jingdong/shopping-card.vue | 27 +- pages/balance/index.vue | 3 +- .../video-group-chat/video-group-chat.vue | 42 +- .../jingdong/add-waimai/add-waimai.vue | 476 +++++++- pages/shopping/jingdong/json/order.json | 60 +- pages/shopping/jingdong/list-index.vue | 38 +- .../jingdong/order-detail/order-detail.vue | 7 +- .../waimai-order-detail.vue | 1011 ++++++++++++++++- .../image/shopping/jingdong/waimai/back.png | Bin 0 -> 1047 bytes .../shopping/jingdong/waimai/baozhang.png | Bin 0 -> 1664 bytes static/image/shopping/jingdong/waimai/bg.png | Bin 0 -> 24491 bytes .../waimai/shop-recoomend/style-1.png | Bin 0 -> 147119 bytes .../waimai/shop-recoomend/style-2.png | Bin 0 -> 123922 bytes 13 files changed, 1560 insertions(+), 104 deletions(-) create mode 100644 static/image/shopping/jingdong/waimai/back.png create mode 100644 static/image/shopping/jingdong/waimai/baozhang.png create mode 100644 static/image/shopping/jingdong/waimai/bg.png create mode 100644 static/image/shopping/jingdong/waimai/shop-recoomend/style-1.png create mode 100644 static/image/shopping/jingdong/waimai/shop-recoomend/style-2.png diff --git a/components/shopping/jingdong/shopping-card.vue b/components/shopping/jingdong/shopping-card.vue index 6d294f8..099691b 100644 --- a/components/shopping/jingdong/shopping-card.vue +++ b/components/shopping/jingdong/shopping-card.vue @@ -14,7 +14,9 @@ - {{ formatStatusDesc(item.statusDesc) }} +{{ + item.shopType != 'waimai' ? formatStatusDesc(item.statusDesc) : + formatWaimaiStatusDesc(item.statusDesc) }} {{ @@ -87,7 +89,11 @@ ¥ -{{ safeFormatPrice(item) }} +{{ item.shopType === 'waimai' ? + (item.totalPrice ? Number(item.totalPrice).toFixed(2) : '0.00') + : + safeFormatPrice(item) + }} 共{{ @@ -119,7 +125,7 @@ ,快去支付吧~本单可享 + }}{{ item.promoHighlight - }} ,快去支付吧~当笔订单返现成功到账, @@ -161,6 +167,21 @@ const onLongPress = (e) => { emit('longpress', { event: e, item: props.item }); }; +const formatWaimaiStatusDesc = (desc) => { + if (!desc || !desc.includes(':')) return desc; + const parts = desc.split(':'); + if (parts.length === 2) { + const m = parseInt(parts[0]) || 0; + const s = parseInt(parts[1]) || 0; + if (m > 0) { + return `${m}分钟`; + } else { + return `${s}秒`; + } + } + return desc; +}; + const formatStatusDesc = (desc) => { if (!desc || !desc.includes(' : ')) return desc; const parts = desc.split(' : '); diff --git a/pages/balance/index.vue b/pages/balance/index.vue index 626331d..cb65a85 100644 --- a/pages/balance/index.vue +++ b/pages/balance/index.vue @@ -515,11 +515,12 @@ const onMenuScroll = (e) => { } .nav-text { - font-size: 18px; + font-size: 36rpx; margin-right: 4px; color: #FFFFFF; height: 24px; line-height: 24px; + font-weight: 500; } ::v-deep .uni-navbar__header-btns-left { diff --git a/pages/other/video-group-chat/video-group-chat.vue b/pages/other/video-group-chat/video-group-chat.vue index af8013d..81c51c2 100644 --- a/pages/other/video-group-chat/video-group-chat.vue +++ b/pages/other/video-group-chat/video-group-chat.vue @@ -1,4 +1,4 @@ - +点击领取 diff --git a/pages/shopping/jingdong/add-waimai/add-waimai.vue b/pages/shopping/jingdong/add-waimai/add-waimai.vue index d4babe9..1ce1efc 100644 --- a/pages/shopping/jingdong/add-waimai/add-waimai.vue +++ b/pages/shopping/jingdong/add-waimai/add-waimai.vue @@ -11,8 +11,13 @@ @@ -64,39 +64,43 @@ - - - +- -+ +{{ videoData.micOn ? '麦克风已开' : '麦克风已关' }} - - +- -+ +{{ videoData.speakerOn ? '扬声器已开' : '扬声器已关' }} - - +- -+ +{{ videoData.cameraOn ? '摄像头已开' : '摄像头已关' }} - +- + - + +请在{{ order.statusDesc }} +内支付 + + +请在{{ order.statusDesc || '29:59' }} +内支付 现在支付,预计 {{ order.deliveryTime || '11:17-11:32' }} @@ -43,8 +48,18 @@ + {{ activeTab == 'beicanzhong' ? '备餐时间' : '取餐时间' }} + +{{ + order.trackingTime }} ++ + @@ -218,9 +300,8 @@+ - {{ order.trackingTitle || @@ -52,7 +67,10 @@ }} 预计送达 {{ activeTab == 'qvcanzhong' ? '骑手已到店,取餐中' : '商家备餐中' }} ++ + + + - - ++ + + +查看发票 @@ -124,7 +145,19 @@您的订单已取消,请查看取消进度详情。 *轻点可替换商品图片,长按可从相册中选择图片* + ++ + + ++ + @@ -167,7 +200,7 @@ @@ -209,6 +242,55 @@¥ -+ + +商品总价 ++ ¥ ++ + ++ + + +运费 ++ ++ +已减¥ ++ + + +打包费 ++ ¥ ++ + +合计 ++ +共减¥ +¥ +商品总价 ¥ - -+ @@ -234,7 +315,7 @@ + + +@@ -242,12 +323,11 @@ 已减¥ + placeholder="优惠运费" color="#F10F1A" fontWeight="500" type="digit" show-edit /> @@ -298,6 +378,27 @@ 合计 - 共减 ¥2.7 + 共减¥ 需付款- ¥{{ (Number(order.products[0].price) + Number(order.carriage)) ? - (Number(order.products[0].price) - + Number(order.carriage)) : - 0 }} + ¥{{ order.amountTo || '0.00' }}+ + + ++ +你可能还喜欢 ++ ++ ++ + ++ @@ -364,14 +465,17 @@ import NavBar from "@/components/nav-bar/nav-bar.vue"; import { waimaiType, waimaiClassfiy } from "../json/order.json"; import AutoWidthInput from "@/components/common/auto-width-input.vue"; import DateTimePicker from '@/components/dengrq-datetime-picker/dateTimePicker/index.vue'; +import { stringUtil } from "@/utils/common.js"; const data = reactive({ - navTitle: "新增外卖订单", activeTab: 'weizhifu', - order: {} - + order: {}, + isEditMode: false, + currentId: '' }) -let { navTitle, activeTab, order } = toRefs(data); +let { activeTab, order, isEditMode, currentId } = toRefs(data); + +const navTitle = computed(() => isEditMode.value ? "修改外卖订单" : "新增外卖订单"); /** * 切换tab @@ -423,17 +527,78 @@ const switchTab = (item) => { const chooseImage = (index = 0) => { uni.chooseImage({ count: 1, - sizeType: ['compressed'], - sourceType: ['album', 'camera'], + sizeType: ['original'], + sourceType: ['album'], success: (res) => { const tempFile = res.tempFilePaths[0]; - // 将临时路径持久化 + + // #ifdef APP-PLUS || MP-WEIXIN + // App端/小程序端:将临时路径持久化 uni.saveFile({ tempFilePath: tempFile, success: (saveRes) => { order.value.products[index].image = saveRes.savedFilePath; + }, + fail: () => { + // 如果持久化失败,回退到临时路径 + order.value.products[index].image = tempFile; } }); + // #endif + + // #ifdef H5 + // H5端:直接使用临时路径 (Blob URL) + order.value.products[index].image = tempFile; + // #endif + } + }); +}; + +const chooseDeliveryImage = () => { + // 记录旧图路径用于清理 + const oldImagePath = order.value.deliveryImages; + + uni.chooseImage({ + count: 1, + sizeType: ['original'], + sourceType: ['album'], + success: (res) => { + const tempFilePath = res.tempFilePaths[0]; + + // #ifdef H5 + // H5端直接使用,不进行持久化保存 + order.value.deliveryImages = tempFilePath; + uni.showToast({ title: '上传预览成功', icon: 'success' }); + // #endif + + // #ifdef APP-PLUS || MP-WEIXIN + uni.showLoading({ title: '处理图片中...' }); + // 将新图保存为持久化文件 + uni.saveFile({ + tempFilePath: tempFilePath, + success: (saveRes) => { + // 1. 设置新图片路径 + order.value.deliveryImages = saveRes.savedFilePath; + + // 2. 如果旧图是本地持久化文件,则物理删除它 + if (oldImagePath && (oldImagePath.includes('_doc') || oldImagePath.includes('store_') || oldImagePath.includes('at_'))) { + uni.removeSavedFile({ + filePath: oldImagePath, + success: () => console.log('旧配送图已清理:', oldImagePath), + fail: (err) => console.error('旧图清理失败:', err) + }); + } + uni.showToast({ title: '上传成功', icon: 'success' }); + }, + fail: (err) => { + console.error('保存图片失败:', err); + order.value.deliveryImages = tempFilePath; + }, + complete: () => { + uni.hideLoading(); + } + }); + // #endif } }); }; @@ -464,24 +629,109 @@ const deleteProduct = (index) => { order.value.products.splice(index, 1); }; +/** + * 通用:检测并清理本地持久化文件 + */ +const detectAndRemoveLocalFile = (path) => { + if (!path) return; + // 仅对沙盒路径执行物理删除 + if (path.includes('_doc') || path.includes('store_') || path.includes('at_')) { + uni.removeSavedFile({ + filePath: path, + success: () => console.log('本地冗余文件已物理清理:', path), + fail: (err) => console.log('物理清理跳过或失败:', err) + }); + } +}; + +/** + * 切换推荐商品图片 (点击切换内置样式) + */ +const toggleRecommendImg = () => { + const style1 = '/static/image/shopping/jingdong/waimai/shop-recoomend/style-1.png'; + const style2 = '/static/image/shopping/jingdong/waimai/shop-recoomend/style-2.png'; + + // 如果当前是自定义路径,在切回内置样式前,先清理物理文件 + detectAndRemoveLocalFile(order.value.recommendImg); + + if (order.value.recommendImg === style1) { + order.value.recommendImg = style2; + } else { + order.value.recommendImg = style1; + } +}; + +// 推荐商品图选择逻辑 (直接持久化) +const chooseRecommendImg = () => { + const oldImagePath = order.value.recommendImg; + + uni.chooseImage({ + count: 1, + sizeType: ['original'], + sourceType: ['album'], + success: (res) => { + const tempFilePath = res.tempFilePaths[0]; + + // #ifdef H5 + order.value.recommendImg = tempFilePath; + uni.showToast({ title: '更换预览成功', icon: 'success' }); + // #endif + + // #ifdef APP-PLUS || MP-WEIXIN + uni.showLoading({ title: '处理图片中...' }); + uni.saveFile({ + tempFilePath: tempFilePath, + success: (saveRes) => { + // 1. 先清理旧的本地文件 + detectAndRemoveLocalFile(oldImagePath); + + // 2. 设置新路径 + order.value.recommendImg = saveRes.savedFilePath; + + uni.showToast({ title: '自定义图片成功', icon: 'success' }); + }, + fail: () => { + order.value.recommendImg = tempFilePath; + }, + complete: () => { + uni.hideLoading(); + } + }); + // #endif + } + }); +}; + const orderRef = ref(data.order); -// 初始化默认时间值 +// 初始化默认时间值与订单号 const initDefaultTimes = () => { if (!order.value) return; const now = new Date(); const timeStr = formatTime(now); - // 1. 初始化下单时间与支付时间 (交易时间) + // 1. 初始化订单基本信息 (时间、订单编号) if (order.value.orderInfo) { order.value.orderInfo.forEach(item => { const label = item.label; + // 填充时间 if ((label === '下单时间' || label === '支付时间' || label === '交易时间') && (!item.value || item.value.trim() === '' || item.value === '请输入')) { item.value = timeStr; } + // 填充随机订单号 + if (label === '订单编号' && (!item.value || item.value.trim() === '' || item.value === '请输入')) { + item.value = generateRandomOrder().toString(); + } }); } + // 3. 为未支付状态初始化默认倒计时 + if (activeTab.value === 'weizhifu' && (!order.value.statusDesc || order.value.statusDesc.trim() === '')) { + const m = (Math.floor(Math.random() * 30) + 1).toString().padStart(2, '0'); + const s = Math.floor(Math.random() * 60).toString().padStart(2, '0'); + order.value.statusDesc = `${m}:${s}`; + } + // 2. 初始化期望时间 (当前+40min 至 当前+65min) if (order.value.productsInfo) { if (!order.value.productsInfo.deliveryTime || order.value.productsInfo.deliveryTime.trim() === '' || order.value.productsInfo.deliveryTime === '请输入') { @@ -492,19 +742,34 @@ const initDefaultTimes = () => { order.value.productsInfo.deliveryTime = `今天${startText}-${endText}`; } } - + // 强制通知 Vue 更新 order.value = { ...order.value }; }; onLoad((options) => { - console.log('接收参数:', options); - initDefaultTimes(); - if (options.id) { - // 编辑模式 (假设从缓存或全局存储获取,此处仅作结构演示) - // data.isEditMode = true; + console.log('外卖页面接收参数:', options); + const editFlag = String(options.isEdit) === 'true' || options.isEdit === true; + + if (editFlag && options.id) { + // 1. 设置编辑标志 + isEditMode.value = true; + currentId.value = String(options.id); + + // 2. 从缓存加载数据回填 + const list = uni.getStorageSync('jingdongShopping') || []; + const editData = list.find(item => String(item.id) === String(options.id)); + + if (editData) { + order.value = JSON.parse(JSON.stringify(editData)); + if (editData.activeTab) { + activeTab.value = editData.activeTab; + } + console.log('编辑模式激活,数据回显:', activeTab.value); + } } else { - // 新增模式:初始化第一个 Tab 的默认数据 + // 新增模式 + initDefaultTimes(); switchTab({ key: activeTab.value }); } }); @@ -514,6 +779,34 @@ const timepopup = ref(null); // 单点时间选择器引用 const deliveryHours = Array.from({ length: 24 }, (_, i) => i.toString().padStart(2, '0')); const deliveryMinutes = Array.from({ length: 60 }, (_, i) => i.toString().padStart(2, '0')); const deliveryPickerValue = ref([11, 17, 0, 11, 32]); + +// 倒计时选择器范围 (0-59分, 0-59秒) +const countdownRange = ref([ + Array.from({ length: 60 }, (_, i) => i.toString().padStart(2, '0')), + Array.from({ length: 60 }, (_, i) => i.toString().padStart(2, '0')) +]); + +// 倒计时数值解析索引 +const countdownValue = computed(() => { + if (!order.value || !order.value.statusDesc) return [29, 59]; + const parts = order.value.statusDesc.split(':'); + if (parts.length !== 2) return [29, 59]; + return [ + parseInt(parts[0]) || 0, + parseInt(parts[1]) || 0 + ]; +}); + +/** + * 处理倒计时修改 + */ +const handleCountdownChange = (e) => { + const val = e.detail.value; + const m = countdownRange.value[0][val[0]]; + const s = countdownRange.value[1][val[1]]; + order.value.statusDesc = `${m}:${s}`; +}; + const editingField = ref('deliveryTime'); // 单点时间选择状态 @@ -579,6 +872,24 @@ const onClickItemInfo = (item) => { } } +/** + * 点击“备餐时间”或“取餐时间” + */ +const onClickTrackingTime = () => { + const label = activeTab.value === 'beicanzhong' ? '备餐时间' : '取餐时间'; + // 设置选择器上下文 + selectItemInfo.value = { + label: label, + value: order.value.trackingTime || formatTime(new Date()), + type: 'time', + key: 'trackingTime' + }; + datePickerData.value.selectDate = selectItemInfo.value.value; + datePickerData.value.endDate = "2099-12-31 23:59:59"; + + if (timepopup.value) timepopup.value.open(); +} + /** * 时间段选择器变化回调 */ @@ -592,6 +903,10 @@ const onTimeRangeChange = (e) => { const settmes = () => { if (selectItemInfo.value.type == 'time') { selectItemInfo.value.value = datePickerData.value.selectDate; + // 额外同步到 order.trackingTime + if (selectItemInfo.value.key === 'trackingTime') { + order.value.trackingTime = datePickerData.value.selectDate; + } } else if (selectItemInfo.value.type == 'timeRange') { const cols = timeRangePickerData.value.rangeCols; const sel = timeRangePickerData.value.rangeSelect; @@ -733,12 +1048,83 @@ const generateDefaultExpectedTime = () => { return `${h}:${min}-${h2}:${min2}`; }; +/** + * 计算商品总价 + */ +const totalProductPrice = computed(() => { + if (!order.value || !order.value.products) return '0.00'; + const total = order.value.products.reduce((sum, item) => { + const price = parseFloat(item.price) || 0; + const countStr = String(item.count || '1'); + // 处理可能包含 "数量x" 字符的情况 + const count = parseInt(countStr.replace(/[^\d]/g, '')) || 0; + return sum + (price * count); + }, 0); + return total.toFixed(2); +}); + +// 监听商品列表变化,实现自动计算总价逻辑 +watch(() => order.value.products, (newProducts) => { + if (newProducts && newProducts.length > 0) { + order.value.totalPrice = totalProductPrice.value; + } +}, { deep: true, immediate: true }); + +/** + * 安全转换数值 + */ +const parseMoney = (val) => { + if (!val) return 0; + if (typeof val === 'number') return val; + // 移除非数字符号(保留小数点) + const num = parseFloat(String(val).replace(/[^\d.]/g, '')); + return isNaN(num) ? 0 : num; +} + +// 监听相关分项变化,实现自动计算合计金额逻辑 +// 逻辑:总金额 = 商品总价 + 运费 + 打包费 - 优惠 +watch([ + () => order.value.totalPrice, + () => order.value.carriage, + () => order.value.packagingFee, + () => order.value.discount +], ([tp, c, pf, d]) => { + const total = parseMoney(tp) + parseMoney(c) + parseMoney(pf) - parseMoney(d); + order.value.amountTo = total > 0 ? total.toFixed(2) : '0.00'; +}, { immediate: true }); /** * 确认订单 */ const onConfirm = () => { + let list = uni.getStorageSync('jingdongShopping') || []; + if (!Array.isArray(list)) { + list = []; + } + order.value.activeTab = activeTab.value; + if (isEditMode.value) { + // 修改模式:查找原有 ID 并替换 (强制转字符串匹配) + const index = list.findIndex(item => String(item.id) === String(currentId.value)); + if (index > -1) { + list[index] = JSON.parse(JSON.stringify(order.value)); + } else { + // 如果缓存中没找到(可能是第一次修改系统默认数据),则追加 + list.push(JSON.parse(JSON.stringify(order.value))); + } + } else { + // 新增模式:仅在真正新增时生成 UUID 并追加 + order.value.id = stringUtil.uuid(); + list.push(JSON.parse(JSON.stringify(order.value))); + } + uni.setStorageSync('jingdongShopping', list); console.log("确认订单", order.value); + uni.showToast({ + title: isEditMode.value ? '修改成功' : '保存成功', + icon: 'success' + }); + setTimeout(() => { + uni.navigateBack(); + }, 1500); } @@ -1085,6 +1471,15 @@ const onConfirm = () => { } } +.shop-recommend { + height: 208rpx; + background-color: #FFFFFF; + margin: 16rpx; + border-radius: 24rpx; + overflow: hidden; + margin-top: 4rpx; +} + .product-card { padding: 28rpx 22rpx; margin: 16rpx; @@ -1372,7 +1767,7 @@ const onConfirm = () => { display: flex; justify-content: space-between; margin-top: 24rpx; - height: 38rpx; + min-height: 38rpx; .label { font-size: 26rpx; @@ -1448,4 +1843,21 @@ const onConfirm = () => { margin-left: 0; flex-shrink: 0; } + +.tips { + display: inline-block; + margin: 0 24rpx; + font-size: 18rpx; + color: #87868E; + line-height: 24rpx; + margin-top: 16rpx; +} + +.time-box { + text-align: left; + margin: 8rpx 20rpx; + padding: 16rpx; + background-color: #ffffff; + border-radius: 24rpx; +} \ No newline at end of file diff --git a/pages/shopping/jingdong/json/order.json b/pages/shopping/jingdong/json/order.json index b14a29d..75887e4 100644 --- a/pages/shopping/jingdong/json/order.json +++ b/pages/shopping/jingdong/json/order.json @@ -403,20 +403,24 @@ "shopType": "waimai", "shopName": "", "status": "等待付款", - "statusDesc": "29分钟", + "statusDesc": "", "deliveryTime": "11:17-11:32", "address": "", "phone": "", "consignee": "", "discountCarriage": "", "carriage": "", + "packagingFee": "", + "recommendImg": "/static/image/shopping/jingdong/waimai/shop-recoomend/style-1.png", + "discount": "0.00", + "amountTo": "", "products": [ { "image": "", "title": "", "desc": "一人份", "price": "", - "count": "数量x1" + "count": "1" } ], "productsInfo": { @@ -456,20 +460,26 @@ "id": 9632554, "shopType": "waimai", "type": "beicanzhong", - "shopName": "安野屋 (AARYE) 京...", - "status": "骑手到店取餐中", + "statusColor": "red", + "shopName": "", + "status": "商家备餐中", "trackingTitle": "10: 22-10: 55", - "trackingDesc": "骑手已到店,大王", + "trackingDesc": "骑手到店取餐中", "trackingTime": "2026-03-10 15: 14: 30", + "deliveryImages": "", + "discountCarriage": "", + "discount": "0.00", + "carriage": "", + "packagingFee": "", + "recommendImg": "/static/image/shopping/jingdong/waimai/shop-recoomend/style-1.png", + "amountTo": "", "products": [ { - "image": "/static/image/shopping/jingdong/product1.png", - "title": "超值哈哈哈哈哈哈哈哈哈哈哈哈哈哈好热 少糖", - "desc": "不支持7天无理由退货", - "service": "", - "tags": [], - "price": "69.00", - "count": "1", + "image": "", + "title": "", + "desc": "一人份", + "price": "", + "count": "1" } ], "productsInfo": { @@ -520,10 +530,18 @@ "shopType": "waimai", "type": "qvcanzhong", "shopName": "安野屋 (AARYE) 京...", - "status": "商家备餐中", + "status": "骑手到店取餐中", + "statusColor": "red", "trackingTitle": "10: 22-10: 55", - "trackingDesc": "商家已接单,商品备餐中", + "trackingDesc": "骑手已到店,大王", "trackingTime": "2026-03-10 15: 14: 30", + "recommendImg": "/static/image/shopping/jingdong/waimai/shop-recoomend/style-1.png", + "deliveryImages": "", + "discountCarriage": "", + "carriage": "", + "packagingFee": "", + "discount": "0.00", + "amountTo": "", "products": [ { "image": "/static/image/shopping/jingdong/product1.png", @@ -576,7 +594,7 @@ "value": "缺货时与我电话沟通", "type": "text" } - ], + ] }, "yiwancheng": { "id": 78456211, @@ -585,6 +603,12 @@ "shopName": "瑞幸咖啡", "status": "完成", "statusColor": "gray", + "recommendImg": "/static/image/shopping/jingdong/waimai/shop-recoomend/style-1.png", + "packagingFee": "", + "discountCarriage": "", + "carriage": "", + "discount": "0.00", + "amountTo": "", "products": [ { "image": "/static/image/shopping/jingdong/product1.png", @@ -649,6 +673,12 @@ "shopName": "瑞幸咖啡", "status": "已取消", "statusColor": "gray", + "recommendImg": "/static/image/shopping/jingdong/waimai/shop-recoomend/style-1.png", + "packagingFee": "", + "discountCarriage": "", + "discount": "0.00", + "carriage": "", + "amountTo": "", "products": [ { "image": "/static/image/shopping/jingdong/product1.png", diff --git a/pages/shopping/jingdong/list-index.vue b/pages/shopping/jingdong/list-index.vue index 7865469..267edb1 100644 --- a/pages/shopping/jingdong/list-index.vue +++ b/pages/shopping/jingdong/list-index.vue @@ -187,9 +187,15 @@ const editOrder = () => { const item = actionMenuState.value.item; if (!item) return; showActionMenu.value = false; - uni.navigateTo({ - url: '/pages/shopping/jingdong/add-order/add-order?id=' + item.id + '&type=' + item.shopType + '&isEdit=true' - }); + if (item.shopType == 'waimai') { + uni.navigateTo({ + url: '/pages/shopping/jingdong/add-waimai/add-waimai?id=' + item.id + '&type=' + item.shopType + '&isEdit=true' + }); + } else { + uni.navigateTo({ + url: '/pages/shopping/jingdong/add-order/add-order?id=' + item.id + '&type=' + item.shopType + '&isEdit=true' + }); + } }; /** @@ -215,23 +221,35 @@ const handleCardClick = (item) => { */ const handleDeleteOrder = () => { const itemToDel = actionMenuState.value.item; + if (!itemToDel) return; - // 1. 尝试删除本地持久化图片文件 (商品图 + 快递员头像) - const productImage = itemToDel?.products?.[0]?.image; - const courierImage = itemToDel?.courierImg; + // 1. 全量扫描并清理本地持久化图片文件 + const pathsToCleanup = []; + + // 收集单字段路径 + if (itemToDel.courierImg) pathsToCleanup.push(itemToDel.courierImg); + if (itemToDel.deliveryImages) pathsToCleanup.push(itemToDel.deliveryImages); + if (itemToDel.recommendImg) pathsToCleanup.push(itemToDel.recommendImg); + + // 收集商品列表路径 + if (itemToDel.products && Array.isArray(itemToDel.products)) { + itemToDel.products.forEach(p => { + if (p.image) pathsToCleanup.push(p.image); + }); + } const cleanupFile = (path) => { + // 仅清理持久化沙盒路径,不处理静态资源 if (path && (path.includes('_doc/') || path.includes('_downloads/') || path.includes('store_') || path.includes('at_'))) { uni.removeSavedFile({ filePath: path, - success: () => console.log('文件删除成功:', path), - fail: (err) => console.error('文件删除失败:', err) + success: () => console.log('物理文件清理成功:', path), + fail: (err) => console.log('物理文件清理跳过或失败:', err) }); } }; - cleanupFile(productImage); - cleanupFile(courierImage); + pathsToCleanup.forEach(path => cleanupFile(path)); // 2. 从列表中移除数据 const realIndex = mockOrderList.value.findIndex(item => item === itemToDel); diff --git a/pages/shopping/jingdong/order-detail/order-detail.vue b/pages/shopping/jingdong/order-detail/order-detail.vue index 8ee89db..134bf0a 100644 --- a/pages/shopping/jingdong/order-detail/order-detail.vue +++ b/pages/shopping/jingdong/order-detail/order-detail.vue @@ -1,7 +1,8 @@ - + @@ -437,7 +438,7 @@ 立即支付 -¥69 + {{ btn }} diff --git a/pages/shopping/jingdong/waimai-order-detail/waimai-order-detail.vue b/pages/shopping/jingdong/waimai-order-detail/waimai-order-detail.vue index 724e098..d5dbcf5 100644 --- a/pages/shopping/jingdong/waimai-order-detail/waimai-order-detail.vue +++ b/pages/shopping/jingdong/waimai-order-detail/waimai-order-detail.vue @@ -1,6 +1,7 @@- + - + + @@ -8,16 +9,26 @@ style="margin-left: 40rpx;" src="/static/image/shopping/jingdong/waimai/shuaxin.png"> + ++ {{ titleText }} +- 请在29:39 内支付 -现在支付,预计 +11:17-11:32 送达+ @@ -25,10 +36,11 @@请在 {{ order.statusDesc || '29:39' }} 内支付 +现在支付,预计 {{ order.deliveryTime }} 送达- 更多 +更多 取消订单 -立即支付 ¥14.5 +立即支付 ¥{{ (Number(order.totalPrice) + Number(order.carriage)) ? + (Number(order.totalPrice) + + Number(order.carriage)).toFixed(2) : + 0 }} - -10:43-10:58 +{{ order.trackingTitle || '-' }} 预计送达 {{ order.type == 'qvcanzhong' ? '骑手已到店,取餐中' : '商家备餐中' }} +{{ order.trackingDesc || (order.type == 'qvcanzhong' ? '骑手已到店,取餐中' : '商家备餐中') }} + @@ -45,7 +57,8 @@ - + + - 查看发票 @@ -99,38 +112,497 @@+ + + - 婷婷 -13812345678 +{{ order.consignee || '收货人' }} +{{ maskPhone(order.phone) }} 号码保护中 - 重庆哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈 + {{ order.address || '暂无收货地址' }} 修改 + + ++ + + + + ++ +订单信息 ++ + ++ +期望时间 +{{ + order.productsInfo.deliveryTime }} ++ + +配送地址 +{{ + order.address + }} ++ +餐具数量 +商家按餐量提供 ++ + +发票信息 +请查看发票信息 ++ ++ +号码保护 +保护隐私,服务护航 ++ + ++ +{{ info.label }} +{{ + info.value + }} ++ +{{ isOrderExpanded ? '点击收起' : '配送骑士/支付方式等' }} ++ + + + ++ ++ ++ +{{ order.shopName }} ++ + ++ ++ ++ +{{ order.products && order.products[0]?.title }} +{{ order.products && order.products[0]?.desc }} +数量x{{ order.products && order.products[0]?.count }} ++ ++ ++ +到手价 +¥{{ + order.status == '等待付款' || order.status == '已取消' ? + Number(order.products && order.products[0]?.price || 0).toFixed(2) : + Number((order.products && order.products[0]?.price || 0) - (order.discount || 0)).toFixed(2) + }} ++ +¥{{ Number(order.products && order.products[0]?.price || + 0).toFixed(2) + }} ++ ++ +餐具数量 ++ +{{ order.productsInfo.cutleryCount }} ++ +配送偏好 ++ +{{ order.productsInfo.deliveryPreference }} ++ +如遇缺货 ++ +{{ order.productsInfo.outOfStock }} ++ + ++ +商品总价 ++ +¥{{ order.totalPrice }} ++ ++ + +运费 ++ ++ +已减¥{{ order.discountCarriage }} +¥{{ + order.discountCarriage }} +{{ !Number(order.carriage) || Number(order.carriage) + <= 0 ? '免运费' : '运费¥' + order.carriage }} ++ + +打包费 ++ +¥{{ order.packagingFee || '0.00' }} ++ +合计 ++ +共减¥{{ + Number(order.discount) + Number(order.discountCarriage) + }} +¥ +{{ order.amountTo + }} + + 点击收起 + + + + ++ +商品总价 ++ ¥ + +{{ + order.totalPrice }} + ++ + +运费 ++ ++ +已减¥{{ order.discountCarriage }} +¥{{ + order.discountCarriage }} +{{ !Number(order.carriage) || Number(order.carriage) <= 0 ? '免运费' : '运费¥' + + order.carriage }} ++ + + +合计 ++ 共减 +¥{{ order.discount }} + 需付款+ ¥{{ (Number(order.totalPrice) + Number(order.carriage)) ? + (Number(order.totalPrice) + + Number(order.carriage)).toFixed(2) : + 0 }} ++ + + ++ +订单信息 +收起 + ++ + + ++ +{{ info.label }} +{{ + info.value + }} ++ + + ++ +快速解决问题 ++ +什么时候送达 +可以取消订单吗? +更多 ++ + ++ +安心保障 ++ ++ ++ ++ +售后保障 ++ + +食安险 +食品安全问题高效理赔 +去看看 ++ + ++ +你可能还喜欢 ++ ++ + ++ ++ + ++ +立即支付¥{{ (Number(order.totalPrice) + + Number(order.carriage)) ? + (Number(order.totalPrice) + + Number(order.carriage)).toFixed(2) : + 0 }} +