Browse Source

修复产品对应问题

xiaohaizhao 1 year ago
parent
commit
10371cc207
1 changed files with 4 additions and 2 deletions
  1. 4 2
      packageA/market/detail.js

+ 4 - 2
packageA/market/detail.js

@@ -11,6 +11,7 @@ Page({
     loading: true
   },
   onLoad(options) {
+    console.log(options)
     if (options.id) this.setData({
       sa_itemgroupid: options.id,
       itemno: options.itemno
@@ -51,14 +52,15 @@ Page({
         }, 500)
         return;
       }
-      this.handleFiles(res.data[0].attinfos)
+      let index = res.data.findIndex(v => v.itemno == this.data.itemno);
+      this.handleFiles(res.data[index].attinfos)
       const CNY = sum => currency(sum, {
         symbol: "¥",
         precision: 2
       }).format();
 
       this.setData({
-        detail: res.data[0],
+        detail: res.data[index],
         rows: res.data.map(v => {
           v.gradeprice = CNY(v.gradeprice);
           v.marketprice = CNY(v.marketprice);