diff --git a/sub-operation-service/src/apis/agricultural.js b/sub-operation-service/src/apis/agricultural.js index 175e1e2..f40319b 100644 --- a/sub-operation-service/src/apis/agricultural.js +++ b/sub-operation-service/src/apis/agricultural.js @@ -43,7 +43,7 @@ export function addToCart(params) { // 立即购买商品按钮 export function quicklyBuy(data = {}) { - return request('goods/goodInfoManage/contentPage', { + return request('user-center/orderInfo/genQuickBuyOrder', { method: 'POST', data, }); diff --git a/sub-operation-service/src/layouts/component/Header/index.vue b/sub-operation-service/src/layouts/component/Header/index.vue index d8fa0c7..140106f 100644 --- a/sub-operation-service/src/layouts/component/Header/index.vue +++ b/sub-operation-service/src/layouts/component/Header/index.vue @@ -86,6 +86,10 @@ const meuns = ref([ label: '智慧种植', path: '/sub-operation-service/smartFarm', }, + { + label: '农事服务', + path: '/sub-operation-service/farmService', + }, { label: '电商交易', path: '/sub-operation-service/ecommerce', diff --git a/sub-operation-service/src/views/brand/components/Auth.vue b/sub-operation-service/src/views/brand/components/Auth.vue index ec965e8..6a781e5 100644 --- a/sub-operation-service/src/views/brand/components/Auth.vue +++ b/sub-operation-service/src/views/brand/components/Auth.vue @@ -71,17 +71,21 @@ 审批中 被驳回 已失效 - - 授权证书 - +
+ + 授权证书 + + 溯源报告 + 取消授权 +
@@ -98,6 +102,82 @@ /> + + +
+ +
+

基本信息

+ + 产品名称:{{ traceData.productName }} 产品数量:{{ traceData.quantity }} 生产经营主体:{{ traceData.producer }} 原产地:{{ traceData.origin }} 生产日期:{{ traceData.productionDate }} 追溯码:{{ traceData.traceCode }} 追溯次数:{{ traceData.traceCount }} 次 + +
+ + +
+

基地信息

+ + 基地地址:{{ traceData.base.address }} 地理位置:{{ traceData.base.location }} 面积:{{ traceData.base.area }} 亩 气候条件:{{ traceData.base.climate }} 土壤类型:{{ traceData.base.soil }} + +
+ + +
+

农事信息

+ + + + + +
+ + +
+

分拣包装

+ + 包装企业:{{ traceData.packaging.company }} 包装类型:{{ traceData.packaging.type }} 包装人:{{ traceData.packaging.person }} 包装时间:{{ traceData.packaging.time }} + +
+ + +
+

仓储物流信息

+ + 存储类型:{{ traceData.logistics.storageType }} + 存储温度:{{ traceData.logistics.temperature }} + 发货地址:{{ traceData.logistics.shipFrom }} 收货地址:{{ traceData.logistics.shipTo }} + +
+ + +
+

交易信息

+ + 交易时间:{{ traceData.trade.time }} 买家:{{ traceData.trade.buyer }} + +
+ + +
+ 产品图 +
+
+
@@ -107,6 +187,9 @@ import { getAssetsFile } from '@/utils/index.js'; import { authList, getProducts } from '@/apis/brand'; import { Edit } from '@element-plus/icons-vue'; +const dialogVisible = ref(false); +const traceData = ref(null); + const activeStatus = ref('1'); const products = ref([ @@ -172,6 +255,60 @@ const products = ref([ }, ]); +const onRevoke = (p) => { + console.log('取消授权', p); +}; + +function onInspect(item) { + // 这里用硬编码模拟请求,实际中可换成接口调用:getTraceById(id).then(res=> traceData.value = res) + const mocks = [ + { + productName: '耿马镇沙疆西红柿', + quantity: '300KG', + producer: '北大荒技术有限公司', + origin: '耿马县孟定镇下坝村', + productionDate: '2025-6-3', + traceCode: '10.5487542154785XSE254.1040201', + traceCount: 30, + base: { + address: '耿马县孟定镇下坝村', + location: '东经102° · 北纬24°', + area: 9000, + climate: '亚热带高原季风型,温和多雨', + soil: '红壤', + }, + farmingRecords: [ + { date: '2025/3/14', operation: '播种西红柿种', operator: '李强' }, + { date: '2025/4/2', operation: '施肥 氮肥', operator: '李强' }, + { date: '2025/5/17', operation: '浇水', operator: '李强' }, + { date: '2025/6/14', operation: '采摘', operator: '李强' }, + ], + packaging: { + company: '瑞禾农产品包装公司', + type: '纸箱', + person: '李明瑞', + time: '2025-1-20 16:27:41', + }, + logistics: { + storageType: '冷藏', + temperature: '2°C', + shipFrom: '北京市朝阳区解放路24号', + shipTo: '上海市黄浦区南京路36号', + }, + trade: { + time: '2025-4-2 08:13:52', + buyer: '李楠', + }, + img: 'images/brand/product4.png', + }, + ]; + traceData.value = mocks[0]; + traceData.value.img = item.goodsUrl; + traceData.value.productName = item.productName; + console.log(item); + dialogVisible.value = true; +} + // const filteredProducts = computed(() => products.value.filter((p) => p.status === activeStatus.value)); const certificateDialogVisible = ref(false); const currentCertificateImg = ref(''); @@ -316,7 +453,7 @@ onMounted(() => { :deep(.el-tabs__item) { font-size: 24px; font-weight: 700; - border: 1 solid #f000; + border: 0; } } .flex { diff --git a/sub-operation-service/src/views/brand/index.vue b/sub-operation-service/src/views/brand/index.vue index 899c12f..392999d 100644 --- a/sub-operation-service/src/views/brand/index.vue +++ b/sub-operation-service/src/views/brand/index.vue @@ -15,13 +15,13 @@ 授权管理 授权记录 - 品牌制度 + 品牌使用管理 - - - 使用监管 - + + + + diff --git a/sub-operation-service/src/views/ecommerce/agriculturalDetail.vue b/sub-operation-service/src/views/ecommerce/agriculturalDetail.vue index 4eace4e..d35ce9b 100644 --- a/sub-operation-service/src/views/ecommerce/agriculturalDetail.vue +++ b/sub-operation-service/src/views/ecommerce/agriculturalDetail.vue @@ -143,7 +143,7 @@ import { useRoute, useRouter } from 'vue-router'; import { getGoodDetail } from '@/apis/agricultural.js'; import { addToCart, quicklyBuy } from '../../apis/agricultural.js'; import { useMethodsStore } from '@/store/modules/methods'; -import { ElMessage } from 'element-plus'; +import { ElMessage, ElMessageBox } from 'element-plus'; const methodsStore = useMethodsStore(); @@ -406,12 +406,25 @@ const toBack = (level) => { }; const buyGood = () => { - const obj = { - goodsId: goodId, - weightId: currentGood.value.netWeight[currentWeight.value].id, // 规格ID - quantity: saveInfo.num, - }; - // quicklyBuy(obj).then((res) => {}); + ElMessageBox.confirm('是否确认直接购买该商品?', '请确认', { + distinguishCancelAndClose: true, + confirmButtonText: '确认', + cancelButtonText: '取消', + }).then(() => { + const obj = { + goodsId: goodId, + weightId: currentGood.value.netWeight[currentWeight.value].id, // 规格ID + quantity: saveInfo.num, + }; + quicklyBuy(obj).then((res) => { + if (res.code === 200) { + router.push({ + path: '/sub-operation-service/sureOrder', + query: { id: res.data.id }, + }); + } + }); + }); }; const addGoodToCart = () => { diff --git a/sub-operation-service/src/views/ecommerce/components/filtertop.vue b/sub-operation-service/src/views/ecommerce/components/filtertop.vue index 7c75261..b05a734 100644 --- a/sub-operation-service/src/views/ecommerce/components/filtertop.vue +++ b/sub-operation-service/src/views/ecommerce/components/filtertop.vue @@ -3,8 +3,8 @@