ソースを参照

fix:输入相同的手机号,赠送时长相加

Signed-off-by: tangshizhe <48740614+tangshizhe@users.noreply.github.com>
tangshizhe 4 ヶ月 前
コミット
e37a25cf9c
1 ファイル変更5 行追加2 行削除
  1. 5 2
      plugins/gift-friends/src/components/GiftSubmitDialog.vue

+ 5 - 2
plugins/gift-friends/src/components/GiftSubmitDialog.vue

@@ -386,8 +386,11 @@ export default {
     async confirmGiftData() {
     async confirmGiftData() {
       // 参数格式:{phones:{18439509554: 1,18439509555: 2}}
       // 参数格式:{phones:{18439509554: 1,18439509555: 2}}
       const data = this.personList.reduce((acc, cur) => {
       const data = this.personList.reduce((acc, cur) => {
-        if (cur.phone && cur.monthnum) {
-          acc[cur.phone] = cur.monthnum
+        if (acc[cur.phone]) {
+          acc[cur.phone] += Number(cur.monthnum)
+        }
+        else {
+          acc[cur.phone] = Number(cur.monthnum)
         }
         }
         return acc
         return acc
       }, {})
       }, {})