wangshan пре 5 година
родитељ
комит
2aed8090b3

+ 8 - 2
src/jfw/modules/subscribepay/src/service/afterPay.go

@@ -186,17 +186,23 @@ func (a *AfterPay) SetUserInfo() error {
 				_kws := strings.Split(kws_name, " ")
 				if actionType == "SK" { //保存关键词
 					if len(addtion_kws) > 0 {
-						for _, addval := range addtion_kws {
+						for i, addval := range addtion_kws {
 							if len([]rune(addval)) > 20 {
 								addval = qutil.SubString(addval, 0, 20)
 							}
+							if addval == "" {
+								addtion_kws = append(addtion_kws[:i], addtion_kws[i+1:]...)
+							}
 						}
 					}
 					if len(not_kws) > 0 {
-						for _, notval := range not_kws {
+						for i, notval := range not_kws {
 							if len([]rune(notval)) > 20 {
 								notval = qutil.SubString(notval, 0, 20)
 							}
+							if notval == "" {
+								not_kws = append(not_kws[:i], not_kws[i+1:]...)
+							}
 						}
 					}
 					if kwscount != "0" {

+ 17 - 6
src/web/staticres/vipsubscribe/js/additionWord.js

@@ -39,7 +39,7 @@ $(function(){
     // 添加keyWords检查输入框内是否有文字,如果有才能点击添加按钮
     $('.addkeyWord input.enterOne').on('input', function() {
         var buttonDOM = $(this).siblings().find('button')[1]
-        if ($(this).val().length >= 1) {
+        if ($.trim($(this).val()).length >= 1) {
             buttonDOM.style.opacity = 1
             buttonDOM.removeAttribute("disabled")
         } else {
@@ -51,8 +51,13 @@ $(function(){
     // 添加 按钮的点击事件
     $('.addkeyWord .btn button:nth-child(2)').on('click', function(){
         var timestamp = new Date().getTime();//动态生成不同的id,因为id唯一不能重复,所以 用时间戳 代替  防止重复
-        var keyWord = $('.addkeyWord input.enterOne').val();
-		if(keyWord==""){
+        var keyWord = $.trim($('.addkeyWord input.enterOne').val());
+		if(keyWord==""&&keyWord.length==0){
+            weui.toast('附加词不能为空', {
+                duration: 2000,
+                className: 'custom-toast',
+                callback: function () { console.log('close') }
+            });
 			return
 		}
 		_addindex = 0;
@@ -114,7 +119,7 @@ $(function(){
     // 编辑 删除
     $('.showKeyWord').on('click', '.deleteKey', function(e) {
         var jQueryDOM = $(this).parents('li');
-        _addkws = $(this).siblings('textarea').val();
+        _addkws = $.trim($(this).siblings('textarea').val());
 		var _index =  $('.showKeyWord li').length - $(this).parent().parent("li").index() -1;
         weui.confirm('确定要删除附加词?', {
             buttons: [{
@@ -134,9 +139,15 @@ $(function(){
     })
     // 编辑 确定
     $('.showKeyWord').on('click', '.ascertainKey', function(e) {
-        var keyWord = $(this).siblings('textarea').val();
+        var keyWord = $.trim($(this).siblings('textarea').val());
 		var _index =  $('.showKeyWord li').length - $(this).parent().parent("li").index() -1;
-        if(keyWord.length > 20){
+		if(keyWord.length==0){
+            weui.toast('附加词不能为空', {
+                duration: 2000,
+                className: 'custom-toast',
+                callback: function () { console.log('close') }
+            });
+		}else if(keyWord.length > 20){
             weui.toast('每组附加词不能超过20字', {
                 duration: 2000,
                 className: 'custom-toast',

+ 19 - 5
src/web/staticres/vipsubscribe/js/exclusiveWord.js

@@ -43,7 +43,7 @@ $(function(){
         }
 
         var buttonDOM = $(this).siblings().find('button')[1]
-        if ($(this).val().length >= 1) {
+        if ($.trim($(this).val()).length >= 1) {
             buttonDOM.style.opacity = 1
             buttonDOM.removeAttribute("disabled")
         } else {
@@ -63,7 +63,15 @@ $(function(){
     // 添加 按钮的点击事件
    
     $('.addkeyWord .btn button:nth-child(2)').on('click', function(){
-        var keyWord = $('.addkeyWord input.enterOne').val()
+        var keyWord = $.trim($('.addkeyWord input.enterOne').val());
+		if (keyWord==""){
+            weui.toast('排除词不能为空', {
+                duration: 2000,
+                className: 'custom-toast',
+                callback: function () { console.log('close') }
+            });
+			return
+		}
 		_notindex = 0;
 		if($(".showKeyWord li").length>0){
         	_notindex = Number($(".showKeyWord li:first").find(".editKeyWord").attr("dataIndex")) + Number(1);
@@ -123,7 +131,7 @@ $(function(){
     // 编辑 删除
     $('.showKeyWord').on('click', '.deleteKey', function(e) {
         var jQueryDOM = $(this).parents('li');
-        _notkws = $(this).siblings('textarea').val();
+        _notkws = $.trim($(this).siblings('textarea').val());
 		var _index =  $('.showKeyWord li').length - $(this).parent().parent("li").index() -1;
         weui.confirm('确定要删除排除词?', {
             buttons: [{
@@ -145,9 +153,15 @@ $(function(){
     // 编辑 确定
     $('.showKeyWord').on('click', '.ascertainKey', function(e) {
         var $this = $(this);
-        var keyWord = $(this).siblings('textarea').val();
+        var keyWord = $.trim($(this).siblings('textarea').val());
 		var _index =  $('.showKeyWord li').length - $(this).parent().parent("li").index() -1;
-        if(keyWord.length > 20){
+		if(keyWord.length ==0){
+            weui.toast('排除词不能为空', {
+                duration: 2000,
+                className: 'custom-toast',
+                callback: function () { console.log('close') }
+            });
+        }else if(keyWord.length > 20){
             weui.toast('每组排除词不能超过20字', {
                 duration: 2000,
                 className: 'custom-toast',

+ 1 - 1
src/web/templates/weixin/vipsubscribe/keyWord.html

@@ -417,7 +417,7 @@
                     if(keystr!=""){
                         keystr += "、"
                     }
-                    keystr += a_key[j]["key"].join('');
+                    keystr += a_key[j]["key"].join(' ');
 					kws_arr[a_key[j]["key"].join(' ')]=j+"-"+i
                 } 
                 classifyHtml +='<li class="classify-item">'

+ 10 - 2
src/web/templates/weixin/vipsubscribe/vip_index.html

@@ -292,10 +292,18 @@
 							//地区
 							var area = _vipData["o_area"];
 							var _area = getAreaClassArr_index(area)
-	                        $("._area").text(_area.join("、"));
+							if (_area.length>0){
+	                        	$("._area").text(_area.join("、"));
+							}else{
+	                        	$("._area").text("全国");
+							}
 							//行业
 							var buyerclass =  SortArr(_vipData["a_buyerclass"]);
-	                        $("._buyerClass").text(buyerclass.join("、"));
+							if (buyerclass.length>0){
+	                        	$("._buyerClass").text(buyerclass.join("、"));
+							}else{
+	                        	$("._buyerClass").text("全部行业");
+							}
 	                        $("._cycleCount").text(_vipData["cycle"]);
 	                        $("._activeDate").text(_userData["l_vip_starttime"]+" - "+_userData["l_vip_endtime"]);
 	                        if(_vipData["a_infotype"]==""){