From aca52db249c7ddcd84e1d4125573a6bb3524670f Mon Sep 17 00:00:00 2001
From: lisy <linlangsur163@163.com>
Date: 星期一, 07 八月 2023 21:29:50 +0800
Subject: [PATCH] app端:商品详情列表数据的处理bug

---
 cloud-server-management/src/main/webapp/static/modular/system/tCoupon/TCouponInfo.js |   34 +++++++++++++++++++++++++++++-----
 1 files changed, 29 insertions(+), 5 deletions(-)

diff --git a/cloud-server-management/src/main/webapp/static/modular/system/tCoupon/TCouponInfo.js b/cloud-server-management/src/main/webapp/static/modular/system/tCoupon/TCouponInfo.js
index 66943ad..02d3589 100644
--- a/cloud-server-management/src/main/webapp/static/modular/system/tCoupon/TCouponInfo.js
+++ b/cloud-server-management/src/main/webapp/static/modular/system/tCoupon/TCouponInfo.js
@@ -4,7 +4,8 @@
 var couponInfoDlg = {
     couponInfoData: {},
     goodsPicArray: [], //商品图片数组
-    goodsCover: '' //商品封面图
+    goodsCover: '', //商品封面图
+    storeIds: [],
 };
 
 /**
@@ -214,6 +215,7 @@
 
 var num = 0;
 couponInfoDlg.addBranch = function () {
+    num=num+1;
     var a= "";
     a = "<div style=\'margin-left: 25%\' class=\"col-sm-9 control-label\">\n" +
         "                            <select class=\"col-sm-1\"  id=\'provinceData"+num+"\' style=\"margin-top: 1%;width: 25%\" onchange=\'changeCity("+num+")\'>\n" +
@@ -228,7 +230,6 @@
         "                        </div>";
     $("#cityDemo").append($(a));
     getProvince(num);
-    num=num+1
 }
 
 
@@ -242,7 +243,7 @@
  */
 couponInfoDlg.addSubmit = function () {
 
-    var resultData = {};
+    var cityIds = [];
     // 优惠券名称
     var couponName = $('#name').val();
     // 优惠券类型
@@ -266,6 +267,29 @@
     let exchangeMethod = $(':radio[name="exchangeMethod"]:checked').val();
 
     var requiredCash = $('#requiredCash').val();
+
+    var company = $('#company').val();
+    if (company === '2'){
+        var myselect=document.getElementById('cityData');
+        var seCity = myselect.options[myselect.selectedIndex].value;
+        if (seCity === null || seCity === undefined || seCity === ''){
+            return Feng.error('请选中一个省市');
+        }
+        cityIds.push(seCity);
+        if (this.num > 0){
+            for (let i = 1; i <= num; i++) {
+                var insSelect=document.getElementById('cityData'+i);
+                var inData = insSelect.options[insSelect.selectedIndex].value;
+                if (inData !== undefined || inData !== null ||  inData !== ''){
+                    cityIds.push(inData);
+                }
+            }
+        }
+    }
+
+    if (company === '3'){
+
+    }
 
     console.log('11111111')
 
@@ -297,8 +321,8 @@
     ajax.set("goodImg",this.goodsCover);
     ajax.set("goodImgs",this.goodsPicArray);
     ajax.set("company",$('#company').val());
-    ajax.set("cityIds",[]);
-    ajax.set("storeIds",[]);
+    ajax.set("cityIds",cityIds);
+    ajax.set("storeIds",this.storeIds);
     ajax.start();
 
 }

--
Gitblit v1.7.1