ソースを参照

fix: 购物车结算页传递SKU信息到下单

- goCheckout 时传递 skuId 和 specDesc

Ultraworked with Sisyphus

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Xiaogang Liao 1 ヶ月 前
コミット
f0c8d11b0e
1 ファイル変更9 行追加2 行削除
  1. 9 2
      cfc-frontend/pages/shop/cart/cart.vue

+ 9 - 2
cfc-frontend/pages/shop/cart/cart.vue

@@ -249,13 +249,20 @@ export default {
       var selected = []
       for (var i = 0; i < this.items.length; i++) {
         if (this.items[i].checked) {
-          selected.push({
+          var item = {
             productId: this.items[i].productId,
             productName: this.items[i].productName,
             coverImage: this.items[i].coverImage,
             unitPrice: this.items[i].unitPrice,
             quantity: this.items[i].quantity
-          })
+          }
+          if (this.items[i].skuId) {
+            item.skuId = this.items[i].skuId
+          }
+          if (this.items[i].specDesc) {
+            item.specDesc = this.items[i].specDesc
+          }
+          selected.push(item)
         }
       }
       uni.setStorageSync('checkoutItems', selected)