ソースを参照

feat: 标讯详情页摘要扩展winners

cuiyalong 1 年間 前
コミット
2d4598dca4
1 ファイル変更9 行追加4 行削除
  1. 9 4
      data/data-models/modules/article/transform/summary2.js

+ 9 - 4
data/data-models/modules/article/transform/summary2.js

@@ -38,13 +38,14 @@ class Buyer extends Unit {
   }
 }
 class Winner extends Unit {
-  constructor(name, id, { seoId, winnerPerson, winnerTel, isCandidate }) {
+  constructor(name, id, { seoId, winnerPerson, winnerTel, isCandidate, personTel }) {
     super(name, id)
 
     this.seoId = seoId || ''
     this.winnerPerson = winnerPerson || ''
     this.winnerTel = winnerTel || ''
     this.isCandidate = isCandidate
+    this.personTel = personTel
   }
 }
 
@@ -153,13 +154,17 @@ class SummaryModel extends BaseModel {
         list.push(summaryWinner)
         list.push(winnerContactInfo)
 
-        const seoId = summary?.winnerSeoId[w.winner]
+        let seoId = ''
+        if (summary?.winnerSeoId) {
+          seoId = summary?.winnerSeoId[w.winner]
+        }
         winnerList.push(
-          new Winner('winner', '中标单位', {
+          new Winner(w.winner, w.winnerId, {
             seoId: seoId || '',
             winnerPerson: w.winnerPerson || '',
             winnerTel: w.winnerTel || '',
-            isCandidate: w.isCandidate || false
+            isCandidate: w.isCandidate || false,
+            personTel: winnerContactInfo
           })
         )
       })