skyline 1 hónapja
szülő
commit
4792389068

+ 14 - 3
haha-mp/src/pages/orders/orders.vue

@@ -266,9 +266,18 @@ const viewOrderDetail = (order: OrderInfo) => {
 }
 
 .product-image {
-  width: 100rpx;
-  height: 100rpx;
+  width: 160rpx;
+  height: 160rpx;
   margin-right: 20rpx;
+  flex-shrink: 0; /* 防止被压缩 */
+  background-color: #f5f5f5;
+  border-radius: 8rpx;
+  overflow: hidden;
+}
+
+.product-image image {
+  width: 100%;
+  height: 100%;
 }
 
 .image-placeholder {
@@ -282,7 +291,7 @@ const viewOrderDetail = (order: OrderInfo) => {
   display: flex;
   flex-direction: column;
   justify-content: space-between;
-  align-items: flex-end;
+  min-width: 0; /* 允许内容换行 */
 }
 
 .product-name {
@@ -292,6 +301,8 @@ const viewOrderDetail = (order: OrderInfo) => {
   width: 100%;
   text-align: left;
   margin-bottom: 10rpx;
+  line-height: 1.4;
+  word-break: break-all; /* 允许换行 */
 }
 
 .price-info {

+ 29 - 1
haha-service/src/main/java/com/haha/service/impl/HahaCallbackServiceImpl.java

@@ -11,6 +11,7 @@ import com.haha.mapper.DeviceMapper;
 import com.haha.mapper.OrderGoodsMapper;
 import com.haha.sdk.HahaClient;
 import com.haha.service.HahaCallbackService;
+import com.haha.service.NewProductApplyService;
 import com.haha.service.OrderService;
 import com.haha.service.payment.payscore.PayScoreResult;
 import com.haha.service.payment.payscore.PayScoreService;
@@ -47,6 +48,9 @@ public class HahaCallbackServiceImpl implements HahaCallbackService {
     @Autowired
     private HahaClient hahaClient;
 
+    @Autowired
+    private NewProductApplyService newProductApplyService;
+
     @Autowired(required = false)
     private PayScoreService payScoreService;
 
@@ -184,14 +188,22 @@ public class HahaCallbackServiceImpl implements HahaCallbackService {
             Integer status = parseInteger(statusObj);
             String name = (String) params.get("name");
             String code = (String) params.get("code");
+            String barCode = (String) params.get("bar_code");
             String rejectReason = (String) params.get("reject_reason");
 
-            log.info("新品审核结果 - ID: {}, 商品名: {}, 状态: {}, code: {}", id, name, status, code);
+            log.info("新品审核结果 - ID: {}, 商品名: {}, 状态: {}, code: {}, barCode: {}", 
+                    id, name, status, code, barCode);
 
             if (status != null && status == 2) {
                 log.warn("新品 {} 被拒绝,原因: {}", name, rejectReason);
             }
 
+            newProductApplyService.updateByCallback(id, status, code, rejectReason);
+
+            if (status != null && status == 3 && code != null && !code.isEmpty()) {
+                syncProductToMerchant(code, name);
+            }
+
             String auditKey = "product:audit:" + id;
             stringRedisTemplate.opsForValue().set(auditKey, JSON.toJSONString(params), 7, TimeUnit.DAYS);
 
@@ -200,6 +212,22 @@ public class HahaCallbackServiceImpl implements HahaCallbackService {
         }
     }
 
+    private void syncProductToMerchant(String code, String name) {
+        try {
+            log.info("开始同步商品到商家商品库 - code: {}, name: {}", code, name);
+            
+            boolean success = hahaClient.getGoodsApi().addToMerchant(code);
+            
+            if (success) {
+                log.info("商品同步成功 - code: {}, name: {}", code, name);
+            } else {
+                log.warn("商品同步失败 - code: {}, name: {}", code, name);
+            }
+        } catch (Exception e) {
+            log.error("同步商品到商家商品库异常 - code: {}, name: {}", code, name, e);
+        }
+    }
+
     @Override
     public void handleMergeProduct(Map<String, Object> params) {
         try {