xuzhiheng 5 жил өмнө
parent
commit
b70c707052

+ 13 - 4
src/web/staticres/vipsubscribe/js/updateArea.js

@@ -195,18 +195,27 @@ $(function () {
 
 
     function setDataInResult() {
     function setDataInResult() {
         let buySetInfo = {
         let buySetInfo = {
-            p: `省级区域${alreadyBuy.province.selectedCount}/${alreadyBuy.province.totalCount}`,
+            p: `省级区域${alreadyBuy.province.selectedCount}/${alreadyBuy.province.totalCount}`,
             c: `地市${alreadyBuy.city.selectedCount}/${alreadyBuy.city.totalCount}`
             c: `地市${alreadyBuy.city.selectedCount}/${alreadyBuy.city.totalCount}`
         }
         }
         let addedInfo = {
         let addedInfo = {
-            p: `省级区域 ${newlyAdded.province}`,
+            p: `省级区域 ${newlyAdded.province}`,
             c: `地市 ${newlyAdded.city}`
             c: `地市 ${newlyAdded.city}`
         }
         }
 
 
         // 修改数量并进行重新赋值
         // 修改数量并进行重新赋值
-        $('.result_text.already .buy-set-info').text(buySetInfo.p + buySetInfo.c)
+		if (alreadyBuy.city.totalCount === 0) {
+			// 只买了省级区域
+			$('.result_text.already .buy-set-info').text(buySetInfo.p)
+		} else if (alreadyBuy.province.totalCount === 0){
+			// 只买了市
+			$('.result_text.already .buy-set-info').text(buySetInfo.c)
+		} else {
+			$('.result_text.already .buy-set-info').text(`${buySetInfo.p}、${buySetInfo.c}`)
+		}
+        
         // 升级新增赋值
         // 升级新增赋值
-        $('.result_text.add_new .added-info').text(addedInfo.p + addedInfo.c)
+        $('.result_text.add_new .added-info').text(`${addedInfo.p}、${addedInfo.c}`)
 
 
         if (newlyAdded.province !== 0 || newlyAdded.city !== 0) {
         if (newlyAdded.province !== 0 || newlyAdded.city !== 0) {
             $('.result_text.add_new').show()
             $('.result_text.add_new').show()