wangshan 5 lat temu
rodzic
commit
5d7d4ee089

+ 3 - 3
src/config.json

@@ -1,6 +1,6 @@
 {
     "nodeName":"node1",
-	"mongodbServers": "192.168.3.11:27080",
+	"mongodbServers": "192.168.3.128:27080",
     "mongodbPoolSize": "25",
     "mongodbName": "qfw",
     "influxaddr": "http://192.168.3.11:8086",
@@ -8,9 +8,9 @@
     "qrModelID": "2",
     "numTimeNumber": 15,
     "strTimeNumber": 30,
-    "elasticsearch": "http://192.168.3.11:9800",
+    "elasticsearch": "http://192.168.3.128:9800",
     "elasticPoolSize": 30,
-    "redisaddrs": "other=192.168.3.128:1712,push=192.168.3.128:1712,pushcache_1=192.168.3.128:1712,pushcache_2_a=192.168.3.128:1712,pushcache_2_b=192.168.3.128:1712,sso=192.168.3.128:1712,session=192.168.3.128:1712,recovery=192.168.3.128:1712",
+    "redisaddrs": "other=192.168.3.128:1712,push=192.168.3.128:1712,pushcache_1=192.168.3.128:5000,pushcache_2_a=192.168.3.128:5001,pushcache_2_b=192.168.3.128:5002,sso=192.168.3.128:1712,session=192.168.3.128:1712,recovery=192.168.3.128:1712",
     "redislogin": "login=192.168.3.128:1712",
     "webport": "83",
     "webrpcport": "8084",

+ 33 - 5
src/jfw/modules/subscribepay/src/service/afterPay.go

@@ -17,9 +17,33 @@ import (
 //完成支付数据交互接口
 type AfterPay struct {
 	*xweb.Action
-	getUserInfo xweb.Mapper `xweb:"/afterPay/getUserInfo"` //获取用户当前支付后的信息
-	setUserInfo xweb.Mapper `xweb:"/afterPay/setUserInfo"` //保存用户当前支付后的信息
-	getPushView xweb.Mapper `xweb:"/afterPay/getPushView"` //VIP推送预览
+	getUserInfo    xweb.Mapper `xweb:"/afterPay/getUserInfo"`    //获取用户当前支付后的信息
+	setUserInfo    xweb.Mapper `xweb:"/afterPay/setUserInfo"`    //保存用户当前支付后的信息
+	getPushView    xweb.Mapper `xweb:"/afterPay/getPushView"`    //VIP推送预览
+	updateUserTips xweb.Mapper `xweb:"/afterPay/updateUserTips"` //修改用户未分类关键词提醒
+}
+
+//
+func (a *AfterPay) UpdateUserTips() error {
+	defer qutil.Catch()
+	userId, _ := a.GetSession("userId").(string)
+	flag := false
+	if userId != "" {
+		classify_index := a.GetString("classify_index")
+		kws_tips, _ := a.GetInteger("kws_tips")
+		log.Println(kws_tips, "---", classify_index)
+		saveData := make(map[string]interface{})
+		saveData["o_vipjy.a_items."+classify_index+".i_tips"] = kws_tips
+		log.Println("------", userId)
+		flag = util.MQFW.UpdateById("user", userId, map[string]interface{}{
+			"$set": saveData,
+		})
+		log.Println(flag)
+	}
+	a.ServeJson(map[string]interface{}{
+		"flag": flag,
+	})
+	return nil
 }
 
 //
@@ -85,7 +109,7 @@ func (a *AfterPay) SetUserInfo() error {
 					flag = util.MQFW.UpdateById("user", userId,
 						bson.M{
 							"$push": bson.M{"o_vipjy.a_items." + classify_index + ".a_key": bson.M{"key": _kws, "appendkey": addtion_kws, "notkey": not_kws}},
-							"$set":  bson.M{"o_vipjy.a_items." + classify_index + ".s_item": classify_name, "o_vipjy.l_modifydate": time.Now().Unix()},
+							"$set":  bson.M{"o_vipjy.a_items." + classify_index + ".s_item": classify_name, "o_vipjy.a_items." + classify_index + ".i_tips": 0, "o_vipjy.l_modifydate": time.Now().Unix()},
 						})
 				}
 			} else if actionType == "DK" { //删除关键词
@@ -147,7 +171,11 @@ func (a *AfterPay) GetUserInfo() error {
 					}
 				}
 			}
-			(*data)["o_area"] = strings.TrimRight(area, "、")
+			if area == "" {
+				(*data)["o_area"] = "全国"
+			} else {
+				(*data)["o_area"] = strings.TrimRight(area, "、")
+			}
 			//采购行业
 			_buyClass := (*data)["a_buyerclass"].([]interface{})
 			var buyClass = ""

+ 10 - 8
src/web/staticres/vipsubscribe/css/keyWord.css

@@ -2,8 +2,8 @@
   display: flex;
   flex-direction: column;
   justify-content: space-between;
-  width: 100;
-  height: 100%;
+  width: 100%;
+  height: 100vh;
   overflow: hidden;
 }
 
@@ -109,15 +109,15 @@
 }
 
 .keyWord .all-classify-column .classify-list {
-  margin-top: .24rem;
+  margin-top: .8rem;
 }
 
 .keyWord .all-classify-column .classify-list .classify-item {
-  display: flex;
+  /*display: flex;*/
   align-items: center;
   justify-content: space-between;
-  padding: 0 .3rem;
-  height: 1.1rem;
+  padding: 0.3rem;
+  height: 1.6rem;
   background-color: #fff;
   border-bottom: 1px solid #CECECE;
 }
@@ -132,12 +132,14 @@
 }
 
 .keyWord .all-classify-column .classify-list .classify-item .classify-item-r {
-  display: flex;
+  /*display: flex;*/
   align-items: center;
   justify-content: end;
-  height: 100%;
+  /*height: 100%;*/
   color: #888888;
   font-size: .28rem;
+  /*new*/
+  float: right;
 }
 
 .keyWord .all-classify-column .classify-list .classify-item .classify-item-r .icon-arrow {

+ 1 - 1
src/web/staticres/vipsubscribe/css/vip_index.css

@@ -409,7 +409,7 @@
   flex-direction: column;
   flex-wrap: nowrap;
   width: 100%;
-  height: 100%;
+  height: 100vh;
   padding-top: constant(safe-area-inset-top);
   padding-top: env(safe-area-inset-top);
   padding-bottom: constant(safe-area-inset-bottom);

+ 26 - 0
src/web/staticres/vipsubscribe/js/keyWord.js

@@ -53,6 +53,7 @@ $(function () {
         if(kws_count>300){
             alert("您设置的关键词已超出最高上限,请调整后再添加。")
         }else if (saveData("SK")){
+            
             //点击保存关键词,查看缓存中存的附加词 和排除词。
             $(".kws_count").text(kws_count);
             var html = `<li><div class="one"><div>
@@ -104,6 +105,26 @@ $(function () {
             if(a_items.length==0){
                 setEmptyHistory();
             }
+            //保存关键词 查看关键词数量 未分类 超过20 100提示
+            if(classify_name.indexOf("未分类")>-1){
+                if((kws_tips==0&&$(".showKeyWord li").length==2)||(kws_tips==20&&$(".showKeyWord li").length==5)){
+                    //未分类 20个关键词提示,100个关键词提示
+                    showMeg();
+                    var param = {};
+                    param.classify_index = classify_index;
+                    if(kws_tips==0){
+                        param.kws_tips = 20;
+                    }else if(kws_tips==20){
+                        param.kws_tips = 100;
+                    }
+                    $.post("/subscribepay/afterPay/updateUserTips",param,function(r){
+                        if(r.flag){
+                            kws_tips = param.kws_tips;
+                            $(".classify").attr("tips",kws_tips);
+                        }
+                    })
+                }
+            }
             //
             doSessionData();
         }
@@ -223,6 +244,11 @@ $(function () {
         if (classify_name.length === 0) {
             return
         }
+        //分类名称是否已存在
+        if($.inArray(classify_name, classify_arr)>-1){
+            alert("此分类名称已存在!")
+            return
+        }
         $(this).removeClass("opacity6");
         $('.classify-r .classify-detail').text(classify_name);
         // 关闭弹框后要重置input内容

+ 208 - 9
src/web/templates/weixin/vipsubscribe/keyWord.html

@@ -19,6 +19,96 @@
         .opacity6{
             opacity: 0.6;
         }
+        .keysexplain{
+            position: absolute;
+            font-size: .3rem;
+            top: .18rem;
+            margin-left: .3rem;
+            color: #888;
+        }
+        .classifyKeysShow{
+            font-size: .25rem;
+            color: #686868;
+            margin-top: 0.1rem;
+            text-overflow: ellipsis;
+            overflow: hidden;
+            display: -webkit-box;
+            -webkit-line-clamp: 1;
+            -webkit-box-orient: vertical;
+        }
+        .addClassify{
+            height: 1rem;
+            text-align: center;
+            background: #2CB7CA;
+            width: 100%;
+            line-height: 1rem;
+            color:#FFFFFF;
+            font-size: .32rem;
+        }
+
+        .classify-show-pop .weui-dialog .weui-dialog__hd {
+          padding: 0;
+          text-align: center;
+          font-size: .34rem;
+      }
+
+      .classify-show-pop .weui-dialog .weui-dialog__hd {
+          padding-left: .3rem;
+          height: .88rem;
+          line-height: .88rem;
+          background-color: #F4F4F9;
+      }
+
+      .classify-show-pop .weui-dialog .weui-dialog__bd {
+          padding: .38rem .1rem;
+          text-align: center;
+          font-size: .32rem;
+          color: #1d1d1d;
+          line-height: .6rem;
+      }
+
+      .classify-show-pop .weui-dialog .weui-dialog__bd .classify-keyword {
+          padding: 0 .17rem;
+          height: 0.8rem;
+          width: 100%;
+          font-size: .32rem;
+          border: 1px solid #CECECE;
+      }
+
+      .classify-show-pop .weui-dialog .weui-dialog__ft {
+          margin-top: .1rem;
+          margin-bottom: .3rem;
+          justify-content: space-around;
+      }
+
+      .classify-show-pop .weui-dialog .weui-dialog__ft .dialog__btn {
+          display: inline-block;
+          width: 1.72rem;
+          height: .72rem;
+          line-height: .72rem;
+          color: #fff;
+          font-size: .32rem;
+      }
+
+      .classify-show-pop .weui-dialog .weui-dialog__ft .dialog__btn_confirm {
+            background-color: #2CB7CA;
+      }
+
+      .classify-show-pop .weui-dialog .weui-dialog__ft .dialog__btn_cancel {
+            background-color: #BFBFC3;
+      }
+
+      .classify-show-pop .weui-dialog .weui-dialog__ft:after {
+            border: none;
+      }
+      .keyWord .addKeyWord{
+            position: fixed;
+            bottom: 0;
+      }
+      .all-classify-column{
+            position: relative;
+            padding-bottom: 1rem;
+      }
     </style>
 </head>
 
@@ -61,17 +151,20 @@
                     疑问解答 <i class="iconfont icon-wenhao"></i>
                 </div>
             </section>
+
+            <div class="addKeyWord addNewKeyword" style="display: none;">
+                <i class="iconfont icon-tianjia"></i>
+                <p> 关键词添加数量:<em style="color: #2cb7ca;" class="kws_count">0 </em>/ 300</p>
+            </div>
         </section>
         <section class="all-classify-column" style="display: none;">
+            <div class="keysexplain"><p> 关键词添加数量:<em style="color: #2cb7ca;" class="kws_count">0 </em> / 300</p></div>
             <ul class="classify-list">
                 
             </ul>
-        </section>
 
-        <div class="addKeyWord addNewKeyword" style="display: none;">
-            <i class="iconfont icon-tianjia"></i>
-            <p> 关键词添加数量:<em style="color: #2cb7ca;" class="kws_count">0 </em>/ 300</p>
-        </div>
+            <div class="addKeyWord addNewKeyword" style="display: none;"><div class="addClassify">新增关键词分类</div></div>
+        </section>
 
         <!-- 疑难问题弹窗 -->
         <div class="problemPop dialog-container">
@@ -113,6 +206,23 @@
                 </div>
             </div>
         </div>
+
+        <!-- 关键词分类说明 -->
+        <div class="classify-show-pop dialog-container">
+            <!-- <div class="weui-mask weui-animate-fade-in"></div> -->
+            <div class="weui-dialog weui-animate-fade-in">
+                <div class="weui-dialog__hd">
+                    <strong class="weui-dialog__title">提示信息</strong>
+                </div>
+                <div class="weui-dialog__bd">
+                    关键词分类有利于关键词做整合管理<br>工作更高效!
+                </div>
+                <div class="weui-dialog__ft">
+                    <a href="javascript:;" class="dialog__btn dialog__btn_confirm">去设置</a> 
+                    <a href="javascript:;" class="dialog__btn dialog__btn_cancel">取消</a>
+                </div>
+            </div>
+        </div>
     </div>
     
     <script src="/js/jquery-3.2.1.min.js?v=1412"></script>
@@ -128,6 +238,8 @@
         var modifyFlag = false;//附加词 排除词变动
         var addition_kws = []; //附加词
         var not_kws = []; //排除词
+        var classify_arr = [];//分类对象
+        var kws_tips = 0;
         // 页面状态
         var pageState = {
             //是否第一次设置关键词
@@ -135,6 +247,27 @@
         }
         $(function(){
             init();
+
+            // 关键词分类 - 去设置按钮点击事件
+            $('.classify-show-pop .dialog__btn_confirm').on('click', function() {
+                $('.classify-show-pop').hide();
+                setTimeout(function(){
+                    // 如果是苹果手机,打开时候要设置top
+                    var agent = navigator.userAgent.toLowerCase();
+                    var dialog = $('.classify-edit-pop .weui-dialog')
+                    if( /iphone|ipod|ipad|ios/.test(agent) ){
+                        dialog.css({ 'top': '30%' })
+                    } else {
+                        dialog.css({ 'top': '50%' })
+                    }
+                    $('.classify-edit-pop').show();
+                },200)
+            })
+
+            // 关键词分类 - 取消按钮点击事件
+            $('.classify-show-pop .dialog__btn_cancel').on('click', function() {
+                $('.classify-show-pop').hide();
+            })
         })
         //获取数据
         function init(){
@@ -178,6 +311,18 @@
                 })
             }
         }
+        //强制弹出 提示信息
+        function showMeg(){
+            // 如果是苹果手机,打开时候要设置top
+            var agent = navigator.userAgent.toLowerCase();
+            var dialog = $('.classify-show-pop .weui-dialog')
+            if( /iphone|ipod|ipad|ios/.test(agent) ){
+                dialog.css({ 'top': '30%' })
+            } else {
+                dialog.css({ 'top': '50%' })
+            }
+            $('.classify-show-pop').show()
+        }
         //关键词和分类列表切换
         function showKorshowC(state){
             if (state) {
@@ -193,19 +338,29 @@
         function appendHtml(kwsdata){
             kws_count = 0;
             var classifyHtml = '';
+            classify_arr = [];//每次初始化分类对象
             for (var i = 0;  i < kwsdata.length; i++) {
                 var s_item = kwsdata[i]["s_item"]
                 if(s_item==""){
                     s_item = "未分类"
                 }
+                classify_arr.push(s_item);
                 var a_key = kwsdata[i]["a_key"]
                 kws_count += a_key.length;
+                var keystr = '';
+                for(var j=0;j<a_key.length;j++){
+                    if(keystr!=""){
+                        keystr += "、"
+                    }
+                    keystr += a_key[j]["key"].join('、');
+                } 
                 classifyHtml +='<li class="classify-item">'
-                            +'<span class="classify-item-l">'+s_item+'</span>'
+                            +'<div><span class="classify-item-l">'+s_item+'</span>'
                             +'<span class="classify-item-r">'
                             +'<span class="classify-item-detail">关键词'+a_key.length+'个</span>'
                             +'<span class="iconfont icon-arrow"></span>'
-                            +'</span>'
+                            +'</span></div>'
+                            +'<div class="classifyKeysShow">'+keystr+'</div>'
                             +'</li>'
 
             }
@@ -225,6 +380,7 @@
         }
         //修改关键词内容
         function toSetKws(){
+            //分类列表进入
             if(kws_index==-1){
                 var edhtml = '<input type="text" class="enterOne" placeholder="请输入关键词" maxlength="100">'
                             +'<div class="btnChoose">'
@@ -256,6 +412,12 @@
             var kwsHtml = '';
             if( a_items[classify_index]!=undefined){
                 var _keyArr = a_items[classify_index]["a_key"];
+                //未分类 关键词强制提醒标识
+                kws_tips = a_items[classify_index]["i_tips"];
+                if(kws_tips==undefined){
+                    kws_tips = 0;
+                }
+                $(".classify").attr("tips",Number(kws_tips));
                 for (var i = _keyArr.length - 1; i >= 0; i--) {
                     var ak_showClass = 'hide';//是否显示附加词个数
                     var nk_showClass = 'hide';//是否显示排除词个数
@@ -439,6 +601,7 @@
         }
         //处理缓存数据
         function doSessionData(t){
+            //删除关键词
             if(t!="DK"){
                 if(kws_index == ($(".showKeyWord li").length-1)){
                     //新加
@@ -481,6 +644,40 @@
         }
         //
         $(function(){
+
+            $(".addNewKeyword div").on('click', function () {
+                history.pushState({}, "","");
+                classify_index = $(".classify-list li").length;
+                var noNameIndex = -1;
+                var noName = "未分类"
+                for (var i = classify_arr.length - 1; i >= 0; i--) {
+                    if(classify_arr[i].indexOf("未分类")>-1){
+                       if (noNameIndex < Number(classify_arr[i].split("未分类")[1])){
+                            noNameIndex = Number(classify_arr[i].split("未分类")[1])
+                       }
+                    }
+                }
+                if(noNameIndex!=-1){
+                    noNameIndex = noNameIndex + parseInt(1)
+                    noName = noName + noNameIndex
+                }
+                classify_name = noName;
+                // 还原有数据
+                $('.classify .classify-detail').text(noName);
+                $('.add-keyword-container .showKeyWord ul').html('');
+
+                $('.add-keyword-container').show();
+                $('.all-classify-column').hide();
+
+                // 显示添加关键词的输入框
+                $(".enter.addkeyWord").find(".btnChoose button").eq(0).html('添加 附加词');
+                $(".enter.addkeyWord").find(".btnChoose button").eq(1).html('添加 附加词');
+                $(".enter.addkeyWord").find("input").val("");
+                $(".enter.addkeyWord").show();
+                $('.enterOne').focus();
+                //第一次进来分类提示
+                showMeg();
+            })
             // 通过判断是那个隐藏来判断是添加关键词还是添加新分类
             $(".addNewKeyword i").on('click', function () {
                 // 如果是在分类列表点击添加(此时关键词列表是隐藏的)
@@ -509,8 +706,8 @@
             $('.classify-list').on('click', '.classify-item-r', function() {
                 // 添加一条空历史记录
                 history.pushState({}, "","");
-                classify_name = $(this).parent().find('.classify-item-l').text();
-                classify_index = $(this).parent("li").index()
+                classify_name = $(this).parent('div').find('.classify-item-l').text();
+                classify_index = $(this).parent().parent("li.classify-item").index()
                 //展示此关键词信息
                 toSetKws();
             })
@@ -522,6 +719,8 @@
             var loading = weui.loading('loading...', {
                 className: 'custom-classname'
             })
+            $('.classify-show-pop').hide();
+            $('.classify-edit-pop').hide();
             //重新加载数据
             init();
             // 用定时器模拟请求耗时

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

@@ -90,7 +90,7 @@
                         </div>
                         <a href="/front/vipsubscribe/toSetPushSetPage" class="media_right" id="pushSet"></a>
                     </div>
-                    <div class="media_list" style="margin-top:.2rem;" id="auto_renew">
+                    <div class="media_list" style="margin-top:.2rem;display: none;" id="auto_renew">
                         <div class="media_left">
                             <img src="/vipsubscribe/image/renew.png?v={{Msg "seo" "version"}}" alt="">
                             <span>自动续费</span>