From 3effbc342c5ee35e0f439eb019d239b7c5123dc5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8D=92?= Date: Mon, 25 Aug 2025 01:46:41 +0800 Subject: [PATCH] 1 --- src/api/system/jdorder.js | 17 +++ src/router/index.js | 15 +++ src/views/system/favoriteProduct/index.vue | 12 +- src/views/system/jdorder/index.vue | 2 +- src/views/system/jdorder/orderList.vue | 144 +++++++++++++++++++++ 5 files changed, 183 insertions(+), 7 deletions(-) create mode 100644 src/views/system/jdorder/orderList.vue diff --git a/src/api/system/jdorder.js b/src/api/system/jdorder.js index af42288..d108ecf 100644 --- a/src/api/system/jdorder.js +++ b/src/api/system/jdorder.js @@ -1,5 +1,22 @@ import request from '@/utils/request' +// JD订单列表 +export function listJDOrders(query) { + return request({ + url: '/jarvis/jdorder/list', + method: 'get', + params: query + }) +} + +// JD订单详情 +export function getJDOrder(id) { + return request({ + url: `/jarvis/jdorder/${id}`, + method: 'get' + }) +} + // 一键转链 export function generatePromotionContent(data) { return request({ diff --git a/src/router/index.js b/src/router/index.js index d2a930f..d2fd14f 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -131,6 +131,21 @@ export const constantRoutes = [ } ] }, + { + path: '/sloworder', + component: Layout, + redirect: 'noredirect', + name: 'SlowOrder', + meta: { title: '下好的慢单', icon: 'list' }, + children: [ + { + path: 'index', + component: () => import('@/views/system/jdorder/orderList'), + name: 'SlowOrderIndex', + meta: { title: '下好的慢单', icon: 'list' } + } + ] + }, { path: '/favorite', component: Layout, diff --git a/src/views/system/favoriteProduct/index.vue b/src/views/system/favoriteProduct/index.vue index c0f1a00..f4f05c5 100644 --- a/src/views/system/favoriteProduct/index.vue +++ b/src/views/system/favoriteProduct/index.vue @@ -571,15 +571,17 @@ export default { }, /** 快速发品 */ handleQuickPublish(row) { - // 先用商品链接生成完整商品信息,再打开通用发品弹窗 const id = row.id || this.ids; getFavoriteProduct(id).then(async res => { const p = res && res.data ? res.data : (row || {}); try { + // 与转链保持一致:优先使用保存的商品链接,避免用名称/ID 产生歧义 + if (!p.productUrl) { + this.$modal.msgWarning('该常用商品缺少商品链接,无法生成完整发品信息'); + } let detail = null; - const inputContent = p.productUrl || p.productName || p.skuid || ''; - if (inputContent) { - const r = await generatePromotionContent({ promotionContent: inputContent }); + if (p.productUrl) { + const r = await generatePromotionContent({ promotionContent: p.productUrl }); const resultStr = (r && (r.msg || r.data)) || ''; try { const arr = typeof resultStr === 'string' ? JSON.parse(resultStr) : resultStr; if (Array.isArray(arr) && arr.length) detail = arr[0]; } catch(e) {} } @@ -592,7 +594,6 @@ export default { images: images, originalPrice: detail && detail.price ? Number(detail.price) : (p.price ? Number(p.price) : undefined), wenanOptions: wenanOptions, - // 预设:同一用户经常固定账号与地区,优先从常用商品扩展字段取值(如有) userName: p.userName || '', province: p.province || null, city: p.city || null, @@ -605,7 +606,6 @@ export default { this.publishDialogVisible = true; } }).catch(() => { - // 失败也尽量用行数据打开 const images = row && row.productImage ? [row.productImage] : []; this.publishInitialData = { title: row.productName || '', images, content: '' }; this.publishDialogVisible = true; diff --git a/src/views/system/jdorder/index.vue b/src/views/system/jdorder/index.vue index 1e1947c..7a9d02d 100644 --- a/src/views/system/jdorder/index.vue +++ b/src/views/system/jdorder/index.vue @@ -281,7 +281,7 @@ export default { skuid: product.skuid || product.skuId || product.spuid || '', productName: product.skuName || product.title || '', shopName: product.shopName || '', - productUrl: product.url || '', + productUrl: product.materialUrl || product.url || '', productImage: Array.isArray(product.images) && product.images.length ? product.images[0] : '', price: product.price != null ? String(product.price) : (product.lowestCouponPrice != null ? String(product.lowestCouponPrice) : ''), commissionInfo: product.commission != null ? String(product.commission) : '', diff --git a/src/views/system/jdorder/orderList.vue b/src/views/system/jdorder/orderList.vue new file mode 100644 index 0000000..0f357dd --- /dev/null +++ b/src/views/system/jdorder/orderList.vue @@ -0,0 +1,144 @@ + + + + + + +