|
@@ -3,7 +3,8 @@
|
|
|
|
|
|
<head>
|
|
|
<meta charset="UTF-8">
|
|
|
- <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
|
|
|
+ <meta name="viewport"
|
|
|
+ content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no"/>
|
|
|
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
|
|
<title>关键词</title>
|
|
|
<script src="{{Msg "seo" "cdn"}}/vipsubscribe/js/rem.js?v={{Msg "seo" "version"}}"></script>
|
|
@@ -16,861 +17,899 @@
|
|
|
</head>
|
|
|
|
|
|
<body>
|
|
|
- <div class="keyWord">
|
|
|
- <section class="add-keyword-container" style="display: none;">
|
|
|
- <div>
|
|
|
- <div class="classify">
|
|
|
- <span class="classify-l">关键词分类</span>
|
|
|
- <span class="classify-r">
|
|
|
+<div class="keyWord">
|
|
|
+ <section class="add-keyword-container" style="display: none;">
|
|
|
+ <div>
|
|
|
+ <div class="classify">
|
|
|
+ <span class="classify-l">关键词分类</span>
|
|
|
+ <span class="classify-r">
|
|
|
<span class="classify-detail">未分类</span>
|
|
|
<span class="iconfont icon-arrow"></span>
|
|
|
</span>
|
|
|
- </div>
|
|
|
- <p class="classify-tips">
|
|
|
- 关键词分类便于对同类别关键词做整合管理
|
|
|
- </p>
|
|
|
- <p class="classify-fast" style="display:none;">
|
|
|
- 快速导入
|
|
|
- </p>
|
|
|
</div>
|
|
|
- <section class="content">
|
|
|
- <!-- 添加关键词 -->
|
|
|
- <div class="enter addkeyWord" style="display: none;">
|
|
|
- <input type="text" class="enterOne" placeholder="请输入关键词" maxlength="20" />
|
|
|
- <!-- <textarea style="resize:none;" rows="1" class="enterOne" name="" id="" placeholder="请输入关键词" maxlength="100"></textarea> -->
|
|
|
- <div class="btnChoose" style="display:none;">
|
|
|
- <button onclick="toappendkey(this)">添加 附加词</button>
|
|
|
- <button onclick="tonotkey(this)">添加 排除词</button>
|
|
|
- </div>
|
|
|
- <div class="btn">
|
|
|
- <button onclick="Cancel()" style="width:49%;background:#fff;color:#2cb7ca;opacity: 1;">取消</button>
|
|
|
- <button disabled>确认</button>
|
|
|
- </div>
|
|
|
+ <p class="classify-tips">
|
|
|
+ 关键词分类便于对同类别关键词做整合管理
|
|
|
+ </p>
|
|
|
+ <p class="classify-fast" style="display:none;">
|
|
|
+ 快速导入
|
|
|
+ </p>
|
|
|
+ </div>
|
|
|
+ <section class="content">
|
|
|
+ <!-- 添加关键词 -->
|
|
|
+ <div class="enter addkeyWord" style="display: none;">
|
|
|
+ <input type="text" class="enterOne" placeholder="请输入关键词" maxlength="20"/>
|
|
|
+ <!-- <textarea style="resize:none;" rows="1" class="enterOne" name="" id="" placeholder="请输入关键词" maxlength="100"></textarea> -->
|
|
|
+ <div class="btnChoose" style="display:none;">
|
|
|
+ <button onclick="toappendkey(this)">添加 附加词</button>
|
|
|
+ <button onclick="tonotkey(this)">添加 排除词</button>
|
|
|
</div>
|
|
|
-
|
|
|
- <!-- 添加关键词显示列表 -->
|
|
|
- <div class="showKeyWord">
|
|
|
- <ul>
|
|
|
- </ul>
|
|
|
+ <div class="btn">
|
|
|
+ <button onclick="Cancel()" style="width:49%;background:#fff;color:#2cb7ca;opacity: 1;">取消</button>
|
|
|
+ <button disabled>确认</button>
|
|
|
</div>
|
|
|
+ </div>
|
|
|
|
|
|
- <div class="problem">
|
|
|
- 疑问解答 <i class="iconfont icon-wenhao"></i>
|
|
|
- </div>
|
|
|
- </section>
|
|
|
+ <!-- 添加关键词显示列表 -->
|
|
|
+ <div class="showKeyWord">
|
|
|
+ <ul>
|
|
|
+ </ul>
|
|
|
+ </div>
|
|
|
|
|
|
- <div class="addKeyWord addNewKeyword">
|
|
|
- <i class="iconfont icon-tianjia" style="display:none;"></i>
|
|
|
- <p> 关键词添加数量:<em style="color: #2cb7ca;" class="kws_count">0 </em>/ 300</p>
|
|
|
+ <div class="problem">
|
|
|
+ 疑问解答 <i class="iconfont icon-wenhao"></i>
|
|
|
</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>
|
|
|
|
|
|
- <div class="addKeyWord addNewKeyword"><div class="addClassify">新增关键词分类</div></div>
|
|
|
- </section>
|
|
|
+ <div class="addKeyWord addNewKeyword">
|
|
|
+ <i class="iconfont icon-tianjia" style="display:none;"></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">
|
|
|
|
|
|
- <!-- 疑难问题弹窗 -->
|
|
|
- <div class="problemPop dialog-container">
|
|
|
- <div class="problemPopContent">
|
|
|
- <h3>疑问解答</h3>
|
|
|
- <ul>
|
|
|
- <li>
|
|
|
- <p>例:某公司主营业务为软件系统开发</p>
|
|
|
- </li>
|
|
|
- <li>
|
|
|
- <h4>关键词:</h4>
|
|
|
- <p>目标信息中的关键性词语,如“软件系统”</p>
|
|
|
- </li>
|
|
|
- <li>
|
|
|
- <h4>附加词:</h4>
|
|
|
- <p>与关键词形成一体/组合,便于查找准确信息,如“开发”</p>
|
|
|
- </li>
|
|
|
- <li>
|
|
|
- <h4>排除词:</h4>
|
|
|
- <p>与关键词互斥,可排除一部分非目标信息,如“运维”</p>
|
|
|
- </li>
|
|
|
- </ul>
|
|
|
- <button class="knowBtn">我知道了</button>
|
|
|
- </div>
|
|
|
+ </ul>
|
|
|
+
|
|
|
+ <div class="addKeyWord addNewKeyword">
|
|
|
+ <div class="addClassify">新增关键词分类</div>
|
|
|
</div>
|
|
|
- <!-- 关键词分类弹框 -->
|
|
|
- <div class="classify-edit-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">
|
|
|
- <input type="text" class="classify-keyword" maxlength="20" placeholder="输入分类名称">
|
|
|
- </div>
|
|
|
- <div class="weui-dialog__ft">
|
|
|
- <a href="javascript:;" class="dialog__btn dialog__btn_confirm opacity6">确定</a>
|
|
|
- <a href="javascript:;" class="dialog__btn dialog__btn_cancel">取消</a>
|
|
|
- </div>
|
|
|
+ </section>
|
|
|
+
|
|
|
+ <!-- 疑难问题弹窗 -->
|
|
|
+ <div class="problemPop dialog-container">
|
|
|
+ <div class="problemPopContent">
|
|
|
+ <h3>疑问解答</h3>
|
|
|
+ <ul>
|
|
|
+ <li>
|
|
|
+ <p>例:某公司主营业务为软件系统开发</p>
|
|
|
+ </li>
|
|
|
+ <li>
|
|
|
+ <h4>关键词:</h4>
|
|
|
+ <p>目标信息中的关键性词语,如“软件系统”</p>
|
|
|
+ </li>
|
|
|
+ <li>
|
|
|
+ <h4>附加词:</h4>
|
|
|
+ <p>与关键词形成一体/组合,便于查找准确信息,如“开发”</p>
|
|
|
+ </li>
|
|
|
+ <li>
|
|
|
+ <h4>排除词:</h4>
|
|
|
+ <p>与关键词互斥,可排除一部分非目标信息,如“运维”</p>
|
|
|
+ </li>
|
|
|
+ </ul>
|
|
|
+ <button class="knowBtn">我知道了</button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <!-- 关键词分类弹框 -->
|
|
|
+ <div class="classify-edit-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">
|
|
|
+ <input type="text" class="classify-keyword" maxlength="20" placeholder="输入分类名称">
|
|
|
+ </div>
|
|
|
+ <div class="weui-dialog__ft">
|
|
|
+ <a href="javascript:;" class="dialog__btn dialog__btn_confirm opacity6">确定</a>
|
|
|
+ <a href="javascript:;" class="dialog__btn dialog__btn_cancel">取消</a>
|
|
|
</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 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 class="classify-fast-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">
|
|
|
- 快速导入可将免费版招标订阅内所设置的关键词及其排除词一并导入至“<span class="fastICName">未分类</span>”关键词分类内,无需再次手动输入,简化您的订阅过程。
|
|
|
- <p style="color:#888;">注:地区与行业分类以VIP订阅设置内为准,不做导入。</p>
|
|
|
- </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 class="classify-fast-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">
|
|
|
+ 快速导入可将免费版招标订阅内所设置的关键词及其排除词一并导入至“<span class="fastICName">未分类</span>”关键词分类内,无需再次手动输入,简化您的订阅过程。
|
|
|
+ <p style="color:#888;">注:地区与行业分类以VIP订阅设置内为准,不做导入。</p>
|
|
|
+ </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>
|
|
|
-
|
|
|
- <script src="{{Msg "seo" "cdn"}}/js/jquery-3.2.1.min.js?v={{Msg "seo" "version"}}"></script>
|
|
|
- <script src="{{Msg "seo" "cdn"}}/js/jquery.cookie.js?v={{Msg "seo" "version"}}"></script>
|
|
|
- <script src="{{Msg "seo" "cdn"}}/vipsubscribe/js/weui.min.js?v={{Msg "seo" "version"}}"></script>
|
|
|
- {{include "/common/weixin.html"}}
|
|
|
- <script src="{{Msg "seo" "cdn"}}/wxswordfish/share.js?v={{Msg "seo" "version"}}"></script>
|
|
|
- <script>
|
|
|
- initShare({{.T.signature}},{{.T.openid}},2,"jy_extend",{{.T.nickname}},{{.T.avatar}});
|
|
|
-
|
|
|
- var a_items = [];//全部数据
|
|
|
- var a_items_m = [];//全部数据
|
|
|
- var a_items_str = "";//关键词字符串
|
|
|
- var classify_name = "";//分类名称
|
|
|
- var classify_index = 0;//分类索引
|
|
|
- var kws_name = "";//分类关键词内容
|
|
|
- var kws_index = 0;//分类关键词索引
|
|
|
- var kws_count = 0;//关键词个数
|
|
|
- var modifyFlag = false;//附加词 排除词变动
|
|
|
- var addition_kws = []; //附加词
|
|
|
- var not_kws = []; //排除词
|
|
|
- var classify_arr = [];//分类对象
|
|
|
- var kws_arr = {};//所有关键词对象
|
|
|
- var kws_tips = 0;
|
|
|
- var fastimport = 0;//快速导入功能
|
|
|
- // 页面状态
|
|
|
- var pageState = {
|
|
|
- //是否第一次设置关键词
|
|
|
- isFirstSetKeyword: true
|
|
|
+</div>
|
|
|
+
|
|
|
+<script src="{{Msg "seo" "cdn"}}/js/jquery-3.2.1.min.js?v={{Msg "seo" "version"}}"></script>
|
|
|
+<script src="{{Msg "seo" "cdn"}}/js/jquery.cookie.js?v={{Msg "seo" "version"}}"></script>
|
|
|
+<script src="{{Msg "seo" "cdn"}}/vipsubscribe/js/weui.min.js?v={{Msg "seo" "version"}}"></script>
|
|
|
+{{include "/common/weixin.html"}}
|
|
|
+<script src="{{Msg "seo" "cdn"}}/wxswordfish/share.js?v={{Msg "seo" "version"}}"></script>
|
|
|
+<script>
|
|
|
+ initShare({{.T.signature}},{{.T.openid}}, 2, "jy_extend",{{.T.nickname}},{{.T.avatar}});
|
|
|
+
|
|
|
+ var a_items = [];//全部数据
|
|
|
+ var a_items_m = [];//全部数据
|
|
|
+ var a_items_str = "";//关键词字符串
|
|
|
+ var classify_name = "";//分类名称
|
|
|
+ var classify_index = 0;//分类索引
|
|
|
+ var kws_name = "";//分类关键词内容
|
|
|
+ var kws_index = 0;//分类关键词索引
|
|
|
+ var kws_count = 0;//关键词个数
|
|
|
+ var modifyFlag = false;//附加词 排除词变动
|
|
|
+ var addition_kws = []; //附加词
|
|
|
+ var not_kws = []; //排除词
|
|
|
+ var classify_arr = [];//分类对象
|
|
|
+ var kws_arr = {};//所有关键词对象
|
|
|
+ var kws_tips = 0;
|
|
|
+ var fastimport = 0;//快速导入功能
|
|
|
+ // 页面状态
|
|
|
+ var pageState = {
|
|
|
+ //是否第一次设置关键词
|
|
|
+ isFirstSetKeyword: true
|
|
|
+ }
|
|
|
+
|
|
|
+ //
|
|
|
+ function Cancel() {
|
|
|
+ if ($(".showKeyWord li").length == 0) {
|
|
|
+ window.history.go(-1)
|
|
|
+ } else {
|
|
|
+ $(".content .addkeyWord").hide();
|
|
|
+ $(".add-keyword-container .addNewKeyword i").show();
|
|
|
}
|
|
|
- //
|
|
|
- function Cancel(){
|
|
|
- if($(".showKeyWord li").length==0){
|
|
|
- window.history.go(-1)
|
|
|
- }else{
|
|
|
- $(".content .addkeyWord").hide();
|
|
|
- $(".add-keyword-container .addNewKeyword i").show();
|
|
|
- }
|
|
|
- }
|
|
|
- //
|
|
|
- function initSess(){
|
|
|
- weui.loading();
|
|
|
- setTimeout(function(){
|
|
|
- weui.loading().hide();
|
|
|
- if(window.location.search.indexOf("page=2")>-1){
|
|
|
- history.replaceState("{id:1}","","/front/vipsubscribe/toSetKeyWordPage")
|
|
|
- }else if(history.state){
|
|
|
- window.history.go(-1)
|
|
|
- }
|
|
|
- },500)
|
|
|
- }
|
|
|
- //
|
|
|
- $(function(){
|
|
|
- var isinitpage = false;
|
|
|
- $(window).bind("pageshow", function(event){
|
|
|
- if(event.originalEvent.persisted){
|
|
|
- initpage();
|
|
|
- isinitpage = true;
|
|
|
- initSess();
|
|
|
- reloadFunc();
|
|
|
- }
|
|
|
- });
|
|
|
- if(!isinitpage) {
|
|
|
- initpage();
|
|
|
- initSess();
|
|
|
- reloadFunc();
|
|
|
- }
|
|
|
- window.addEventListener('popstate', function(event){
|
|
|
- if(!isinitpage){
|
|
|
- if(a_items.length==0){
|
|
|
- window.history.go(-1)
|
|
|
- }
|
|
|
- var loading = weui.loading('', {
|
|
|
- className: 'custom-classname'
|
|
|
- })
|
|
|
- $('.classify-show-pop').hide();
|
|
|
- $('.classify-edit-pop').hide();
|
|
|
- //重新加载数据
|
|
|
- initpage();
|
|
|
- // 用定时器模拟请求耗时
|
|
|
- setTimeout(function () {
|
|
|
- loading.hide(function() {
|
|
|
- console.log('loading has been hidden');
|
|
|
- })
|
|
|
- // 判断是否是第一次(没有关键词进入)
|
|
|
- // 隐藏关键词列表section,显示分类列表section
|
|
|
- var isClassifyColumnShow = $('.add-keyword-container').is(':hidden')
|
|
|
- if (!isClassifyColumnShow) {
|
|
|
- $('.add-keyword-container').hide()
|
|
|
- $('.all-classify-column').show()
|
|
|
- }
|
|
|
- }, 500)
|
|
|
- }
|
|
|
- isinitpage = false
|
|
|
- })
|
|
|
- // 关键词分类 - 去设置按钮点击事件
|
|
|
- $('.classify-show-pop .dialog__btn_confirm').on('click', function() {
|
|
|
- $('.classify-show-pop').hide();
|
|
|
- setTimeout(function(){
|
|
|
- modalOne();
|
|
|
- },200)
|
|
|
- })
|
|
|
- // 关键词分类 - 取消按钮点击事件
|
|
|
- $('.classify-show-pop .dialog__btn_cancel').on('click', function() {
|
|
|
- $('.enterOne').focus();
|
|
|
- $('.classify-show-pop').hide();
|
|
|
- })
|
|
|
- })
|
|
|
- //获取数据
|
|
|
- function initpage(){
|
|
|
- if(sessionStorage&&sessionStorage.kwspage){
|
|
|
- if(sessionStorage.addition_kws!=undefined){
|
|
|
- addition_kws = JSON.parse(sessionStorage.addition_kws);
|
|
|
- }
|
|
|
- if(sessionStorage.not_kws!=undefined){
|
|
|
- not_kws = JSON.parse(sessionStorage.not_kws);
|
|
|
+ }
|
|
|
+
|
|
|
+ //
|
|
|
+ function initSess() {
|
|
|
+ weui.loading();
|
|
|
+ setTimeout(function () {
|
|
|
+ weui.loading().hide();
|
|
|
+ if (window.location.search.indexOf("page=2") > -1) {
|
|
|
+ history.replaceState("{id:1}", "", "/front/vipsubscribe/toSetKeyWordPage")
|
|
|
+ } else if (history.state) {
|
|
|
+ window.history.go(-1)
|
|
|
+ }
|
|
|
+ }, 500)
|
|
|
+ }
|
|
|
+
|
|
|
+ //
|
|
|
+ $(function () {
|
|
|
+ var isinitpage = false;
|
|
|
+ $(window).bind("pageshow", function (event) {
|
|
|
+ if (event.originalEvent.persisted) {
|
|
|
+ initpage();
|
|
|
+ isinitpage = true;
|
|
|
+ initSess();
|
|
|
+ reloadFunc();
|
|
|
+ }
|
|
|
+ });
|
|
|
+ if (!isinitpage) {
|
|
|
+ initpage();
|
|
|
+ initSess();
|
|
|
+ reloadFunc();
|
|
|
+ }
|
|
|
+ window.addEventListener('popstate', function (event) {
|
|
|
+ if (!isinitpage) {
|
|
|
+ if (a_items.length == 0) {
|
|
|
+ window.history.go(-1)
|
|
|
}
|
|
|
- showKorshowC(sessionStorage.kwspage);
|
|
|
- a_items = JSON.parse(sessionStorage.a_items);
|
|
|
- a_items_m = JSON.parse(sessionStorage.a_items);
|
|
|
- a_items_str = sessionStorage.a_items_str;
|
|
|
- console.log("a_items_str:"+a_items_str)
|
|
|
- kws_arr = JSON.parse(sessionStorage.kws_arr);
|
|
|
- classify_name = sessionStorage.classify_name;
|
|
|
- classify_index = sessionStorage.classify_index;
|
|
|
- kws_name = sessionStorage.kws_name;
|
|
|
- kws_index = sessionStorage.kws_index;
|
|
|
- modifyFlag = true;
|
|
|
- kws_count = sessionStorage.kws_count;
|
|
|
- fastimport = parseInt(sessionStorage.fastimport);
|
|
|
- if(fastimport==0){
|
|
|
- $(".classify-fast").show();
|
|
|
- }else{
|
|
|
- $(".classify-fast").hide();
|
|
|
- }
|
|
|
- $(".kws_count").text(kws_count);
|
|
|
- $(".add-keyword-container .addNewKeyword i").hide();
|
|
|
- toSetKws();
|
|
|
- }else{
|
|
|
- //获取用户设置信息类型
|
|
|
- $.post("/subscribepay/afterPay/getUserInfo",{},function(r){
|
|
|
- if(r.userData){
|
|
|
- var _userData = r.userData;
|
|
|
- var _vipData = _userData["o_vipjy"];
|
|
|
- var ordinarykc = parseInt(_userData["ordinarykc"])
|
|
|
- fastimport = parseInt(_userData["i_vip_fastimport"]);
|
|
|
- if(fastimport==0&&ordinarykc>0){
|
|
|
- sessionStorage.fastimport = fastimport;
|
|
|
- $(".classify-fast").show();
|
|
|
- }else{
|
|
|
- sessionStorage.fastimport = 1;
|
|
|
- $(".classify-fast").hide();
|
|
|
- }
|
|
|
- modifyFlag = false;
|
|
|
- if (_vipData["a_items"]!=undefined&&_vipData["a_items"].length>0){
|
|
|
- a_items = _vipData["a_items"]
|
|
|
- a_items_m = _vipData["a_items"]
|
|
|
- pageState.isFirstSetKeyword = false;
|
|
|
- appendHtml(a_items);
|
|
|
- }else{
|
|
|
- pageState.isFirstSetKeyword = true;
|
|
|
- }
|
|
|
- if(sessionStorage.a_items_str==undefined){
|
|
|
- a_items_str = items_str(a_items_m);
|
|
|
- sessionStorage.a_items_str = a_items_str;//当前数据string
|
|
|
- }else{
|
|
|
- a_items_str = sessionStorage.a_items_str;
|
|
|
- }
|
|
|
- hasWords();
|
|
|
- }else{
|
|
|
- pageState.isFirstSetKeyword = true;
|
|
|
- }
|
|
|
- showKorshowC(pageState.isFirstSetKeyword);
|
|
|
+ var loading = weui.loading('', {
|
|
|
+ className: 'custom-classname'
|
|
|
})
|
|
|
+ $('.classify-show-pop').hide();
|
|
|
+ $('.classify-edit-pop').hide();
|
|
|
+ //重新加载数据
|
|
|
+ initpage();
|
|
|
+ // 用定时器模拟请求耗时
|
|
|
+ setTimeout(function () {
|
|
|
+ loading.hide(function () {
|
|
|
+ console.log('loading has been hidden');
|
|
|
+ })
|
|
|
+ // 判断是否是第一次(没有关键词进入)
|
|
|
+ // 隐藏关键词列表section,显示分类列表section
|
|
|
+ var isClassifyColumnShow = $('.add-keyword-container').is(':hidden')
|
|
|
+ if (!isClassifyColumnShow) {
|
|
|
+ $('.add-keyword-container').hide()
|
|
|
+ $('.all-classify-column').show()
|
|
|
+ }
|
|
|
+ }, 500)
|
|
|
}
|
|
|
- }
|
|
|
- //
|
|
|
- function items_str(_items){
|
|
|
- if(_items.length==0){
|
|
|
- return ""
|
|
|
- }
|
|
|
- var items_str = "";
|
|
|
- for (var a = 0; a < _items.length; a++) {
|
|
|
- items_str += _items[a]["s_item"]
|
|
|
- var a_key = _items[a]["a_key"]
|
|
|
- for(var b=0;b<a_key.length;b++){
|
|
|
- items_str += a_key[b]["key"].join('');
|
|
|
- if(a_key[b]["appendkey"]!=undefined&&a_key[b]["appendkey"]!=""){
|
|
|
- items_str += a_key[b]["appendkey"].join('');
|
|
|
- }
|
|
|
- if(a_key[b]["notkey"]!=undefined&&a_key[b]["notkey"]!=""){
|
|
|
- items_str += a_key[b]["notkey"].join('');
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- return items_str
|
|
|
- }
|
|
|
- //强制弹出 提示信息
|
|
|
- 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%' })
|
|
|
+ isinitpage = false
|
|
|
+ })
|
|
|
+ // 关键词分类 - 去设置按钮点击事件
|
|
|
+ $('.classify-show-pop .dialog__btn_confirm').on('click', function () {
|
|
|
+ $('.classify-show-pop').hide();
|
|
|
+ setTimeout(function () {
|
|
|
+ modalOne();
|
|
|
+ }, 200)
|
|
|
+ })
|
|
|
+ // 关键词分类 - 取消按钮点击事件
|
|
|
+ $('.classify-show-pop .dialog__btn_cancel').on('click', function () {
|
|
|
+ $('.enterOne').focus();
|
|
|
+ $('.classify-show-pop').hide();
|
|
|
+ })
|
|
|
+ })
|
|
|
+
|
|
|
+ //获取数据
|
|
|
+ function initpage() {
|
|
|
+ if (sessionStorage && sessionStorage.kwspage) {
|
|
|
+ if (sessionStorage.addition_kws != undefined) {
|
|
|
+ addition_kws = JSON.parse(sessionStorage.addition_kws);
|
|
|
+ }
|
|
|
+ if (sessionStorage.not_kws != undefined) {
|
|
|
+ not_kws = JSON.parse(sessionStorage.not_kws);
|
|
|
+ }
|
|
|
+ showKorshowC(sessionStorage.kwspage);
|
|
|
+ a_items = JSON.parse(sessionStorage.a_items);
|
|
|
+ a_items_m = JSON.parse(sessionStorage.a_items);
|
|
|
+ a_items_str = sessionStorage.a_items_str;
|
|
|
+ console.log("a_items_str:" + a_items_str)
|
|
|
+ kws_arr = JSON.parse(sessionStorage.kws_arr);
|
|
|
+ classify_name = sessionStorage.classify_name;
|
|
|
+ classify_index = sessionStorage.classify_index;
|
|
|
+ kws_name = sessionStorage.kws_name;
|
|
|
+ kws_index = sessionStorage.kws_index;
|
|
|
+ modifyFlag = true;
|
|
|
+ kws_count = sessionStorage.kws_count;
|
|
|
+ fastimport = parseInt(sessionStorage.fastimport);
|
|
|
+ if (fastimport == 0) {
|
|
|
+ $(".classify-fast").show();
|
|
|
} else {
|
|
|
- dialog.css({ 'top': '50%' })
|
|
|
+ $(".classify-fast").hide();
|
|
|
}
|
|
|
- $('.classify-show-pop').show()
|
|
|
+ $(".kws_count").text(kws_count);
|
|
|
+ $(".add-keyword-container .addNewKeyword i").hide();
|
|
|
+ toSetKws();
|
|
|
+ } else {
|
|
|
+ //获取用户设置信息类型
|
|
|
+ $.post("/subscribepay/afterPay/getUserInfo", {}, function (r) {
|
|
|
+ if (r.userData) {
|
|
|
+ var _userData = r.userData;
|
|
|
+ var _vipData = _userData["o_vipjy"];
|
|
|
+ var ordinarykc = parseInt(_userData["ordinarykc"])
|
|
|
+ fastimport = parseInt(_userData["i_vip_fastimport"]);
|
|
|
+ if (fastimport == 0 && ordinarykc > 0) {
|
|
|
+ sessionStorage.fastimport = fastimport;
|
|
|
+ $(".classify-fast").show();
|
|
|
+ } else {
|
|
|
+ sessionStorage.fastimport = 1;
|
|
|
+ $(".classify-fast").hide();
|
|
|
+ }
|
|
|
+ modifyFlag = false;
|
|
|
+ if (_vipData["a_items"] != undefined && _vipData["a_items"].length > 0) {
|
|
|
+ a_items = _vipData["a_items"]
|
|
|
+ a_items_m = _vipData["a_items"]
|
|
|
+ pageState.isFirstSetKeyword = false;
|
|
|
+ appendHtml(a_items);
|
|
|
+ } else {
|
|
|
+ pageState.isFirstSetKeyword = true;
|
|
|
+ }
|
|
|
+ if (sessionStorage.a_items_str == undefined) {
|
|
|
+ a_items_str = items_str(a_items_m);
|
|
|
+ sessionStorage.a_items_str = a_items_str;//当前数据string
|
|
|
+ } else {
|
|
|
+ a_items_str = sessionStorage.a_items_str;
|
|
|
+ }
|
|
|
+ hasWords();
|
|
|
+ } else {
|
|
|
+ pageState.isFirstSetKeyword = true;
|
|
|
+ }
|
|
|
+ showKorshowC(pageState.isFirstSetKeyword);
|
|
|
+ })
|
|
|
}
|
|
|
- //关键词和分类列表切换
|
|
|
- function showKorshowC(state){
|
|
|
- if (state) {
|
|
|
- $('.add-keyword-container').show()
|
|
|
- $('.all-classify-column').hide()
|
|
|
- $(".addClassify").hide();
|
|
|
- } else {
|
|
|
- $('.add-keyword-container').hide()
|
|
|
- $('.all-classify-column').show()
|
|
|
- $(".addClassify").show();
|
|
|
- $(".add-keyword-container .addNewKeyword i").hide();
|
|
|
+ }
|
|
|
+
|
|
|
+ //
|
|
|
+ function items_str(_items) {
|
|
|
+ if (_items.length == 0) {
|
|
|
+ return ""
|
|
|
+ }
|
|
|
+ var items_str = "";
|
|
|
+ for (var a = 0; a < _items.length; a++) {
|
|
|
+ items_str += _items[a]["s_item"]
|
|
|
+ var a_key = _items[a]["a_key"]
|
|
|
+ for (var b = 0; b < a_key.length; b++) {
|
|
|
+ items_str += a_key[b]["key"].join('');
|
|
|
+ if (a_key[b]["appendkey"] != undefined && a_key[b]["appendkey"] != "") {
|
|
|
+ items_str += a_key[b]["appendkey"].join('');
|
|
|
+ }
|
|
|
+ if (a_key[b]["notkey"] != undefined && a_key[b]["notkey"] != "") {
|
|
|
+ items_str += a_key[b]["notkey"].join('');
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
- //分类列表
|
|
|
- function appendHtml(kwsdata){
|
|
|
- kws_count = 0;
|
|
|
- var classifyHtml = '';
|
|
|
- classify_arr = [];//每次初始化分类对象
|
|
|
- kws_arr = {};//每次初始化关键词对象
|
|
|
- for (var i = 0; i < kwsdata.length; i++) {
|
|
|
- var s_item = kwsdata[i]["s_item"]
|
|
|
- if(s_item==""){
|
|
|
- s_item = "未分类"
|
|
|
+ return items_str
|
|
|
+ }
|
|
|
+
|
|
|
+ //强制弹出 提示信息
|
|
|
+ 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) {
|
|
|
+ $('.add-keyword-container').show()
|
|
|
+ $('.all-classify-column').hide()
|
|
|
+ $(".addClassify").hide();
|
|
|
+ } else {
|
|
|
+ $('.add-keyword-container').hide()
|
|
|
+ $('.all-classify-column').show()
|
|
|
+ $(".addClassify").show();
|
|
|
+ $(".add-keyword-container .addNewKeyword i").hide();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ //分类列表
|
|
|
+ function appendHtml(kwsdata) {
|
|
|
+ kws_count = 0;
|
|
|
+ var classifyHtml = '';
|
|
|
+ classify_arr = [];//每次初始化分类对象
|
|
|
+ kws_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 += "、"
|
|
|
}
|
|
|
- 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(' ');
|
|
|
- kws_arr[a_key[j]["key"].join(' ')]=j+"-"+i
|
|
|
- }
|
|
|
- classifyHtml +='<li class="classify-item">'
|
|
|
- +'<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></div>'
|
|
|
- +'<div class="classifyKeysShow">'+keystr+'</div>'
|
|
|
- +'</li>'
|
|
|
+ keystr += a_key[j]["key"].join(' ');
|
|
|
+ kws_arr[a_key[j]["key"].join(' ')] = j + "-" + i
|
|
|
+ }
|
|
|
+ classifyHtml += '<li class="classify-item">'
|
|
|
+ + '<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></div>'
|
|
|
+ + '<div class="classifyKeysShow">' + keystr + '</div>'
|
|
|
+ + '</li>'
|
|
|
+
|
|
|
+ }
|
|
|
+ if (classifyHtml != "") {
|
|
|
+ $(".classify-list").html(classifyHtml);
|
|
|
+ }
|
|
|
+ $(".kws_count").text(kws_count);
|
|
|
+ }
|
|
|
|
|
|
+ //是否有关键词
|
|
|
+ function hasWords() {
|
|
|
+ var showKeyWordLength = $(".showKeyWord ul").find('li').length;
|
|
|
+ var modifyShow = false
|
|
|
+ $(".showKeyWord li").each(function () {
|
|
|
+ if (!$(this).find(".modify").is(":hidden")) {
|
|
|
+ modifyShow = true
|
|
|
+ return false;
|
|
|
}
|
|
|
- if(classifyHtml!=""){
|
|
|
- $(".classify-list").html(classifyHtml);
|
|
|
+ })
|
|
|
+ if (showKeyWordLength === 0) {
|
|
|
+ $(".content .addkeyWord").show();
|
|
|
+ $(".add-keyword-container .addNewKeyword i").hide();
|
|
|
+ } else {
|
|
|
+ $(".content .addkeyWord").hide();
|
|
|
+ if (!modifyShow) {
|
|
|
+ $(".add-keyword-container .addNewKeyword i").show();
|
|
|
}
|
|
|
- $(".kws_count").text(kws_count);
|
|
|
}
|
|
|
- //是否有关键词
|
|
|
- function hasWords() {
|
|
|
- var showKeyWordLength = $(".showKeyWord ul").find('li').length;
|
|
|
- var modifyShow = false
|
|
|
- $(".showKeyWord li").each(function(){
|
|
|
- if(!$(this).find(".modify").is(":hidden")){
|
|
|
- modifyShow = true
|
|
|
- return false;
|
|
|
- }
|
|
|
- })
|
|
|
- if (showKeyWordLength === 0) {
|
|
|
- $(".content .addkeyWord").show();
|
|
|
- $(".add-keyword-container .addNewKeyword i").hide();
|
|
|
+ }
|
|
|
+
|
|
|
+ //修改关键词内容
|
|
|
+ function toSetKws() {
|
|
|
+ //分类列表进入
|
|
|
+ if (kws_index == -1) {
|
|
|
+ var edhtml = '<input type="text" class="enterOne" placeholder="请输入关键词" maxlength="20">'
|
|
|
+ + '<div class="btnChoose">'
|
|
|
+ if (addition_kws.length > 0) {
|
|
|
+ edhtml += '<button onclick="toappendkey(this)">编辑 附加词<i>(' + addition_kws.length + ')</i></button>'
|
|
|
} else {
|
|
|
- $(".content .addkeyWord").hide();
|
|
|
- if(!modifyShow){
|
|
|
- $(".add-keyword-container .addNewKeyword i").show();
|
|
|
- }
|
|
|
+ edhtml += '<button onclick="toappendkey(this)">添加 附加词</button>'
|
|
|
}
|
|
|
+ if (not_kws.length > 0) {
|
|
|
+ edhtml += '<button onclick="tonotkey(this)">编辑 排除词<i>(' + not_kws.length + ')</i></button>'
|
|
|
+ } else {
|
|
|
+ edhtml += '<button onclick="tonotkey(this)">添加 排除词</button>'
|
|
|
+ }
|
|
|
+ edhtml += '</div>'
|
|
|
+ + '<div class="btn">'
|
|
|
+ + '<button onclick="Cancel()" style="width:49%;background:#fff;color:#2cb7ca;opacity: 1;">取消</button>'
|
|
|
+ + '<button style="opacity: 1;">确认</button>'
|
|
|
+ + '</div>'
|
|
|
+ $(".enter.addkeyWord").html(edhtml);
|
|
|
+ setTimeout(function () {
|
|
|
+ $(".enter.addkeyWord").find("input").val(kws_name)
|
|
|
+ $(".enter.addkeyWord").show();
|
|
|
+ }, 200)
|
|
|
+ }
|
|
|
+ if (classify_name == "") {
|
|
|
+ $(".classify-detail").text("未分类");
|
|
|
+ } else {
|
|
|
+ $(".classify-detail").text(classify_name);
|
|
|
}
|
|
|
- //修改关键词内容
|
|
|
- function toSetKws(){
|
|
|
- //分类列表进入
|
|
|
- if(kws_index==-1){
|
|
|
- var edhtml = '<input type="text" class="enterOne" placeholder="请输入关键词" maxlength="20">'
|
|
|
- +'<div class="btnChoose">'
|
|
|
- if(addition_kws.length>0){
|
|
|
- edhtml +='<button onclick="toappendkey(this)">编辑 附加词<i>('+addition_kws.length+')</i></button>'
|
|
|
- }else{
|
|
|
- edhtml +='<button onclick="toappendkey(this)">添加 附加词</button>'
|
|
|
+ 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;
|
|
|
+ }
|
|
|
+ if (kws_tips == 0 && classify_name.indexOf("未分类") > -1 && window.location.search.indexOf("page=2") < 0) {
|
|
|
+ //第一次进来分类提示
|
|
|
+ showMeg();
|
|
|
+ var param = {};
|
|
|
+ param.classify_index = classify_index;
|
|
|
+ param.kws_tips = 1;
|
|
|
+ $.post("/subscribepay/afterPay/updateUserTips", param, function (r) {
|
|
|
+ if (r.flag) {
|
|
|
+ kws_tips = param.kws_tips;
|
|
|
+ $(".classify").attr("tips", kws_tips);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ for (var i = _keyArr.length - 1; i >= 0; i--) {
|
|
|
+ var ak_showClass = 'hide';//是否显示附加词个数
|
|
|
+ var nk_showClass = 'hide';//是否显示排除词个数
|
|
|
+ var ak_remark = '添加';
|
|
|
+ var nk_remark = '添加';
|
|
|
+ var appendkeylth = 0;
|
|
|
+ var notkeylth = 0;
|
|
|
+ kwsHtml += '<li>'
|
|
|
+ if (modifyFlag && i == kws_index) {
|
|
|
+ kwsHtml += '<div class="one" style="display:none;">'
|
|
|
+ _keyArr[i]["appendkey"] = addition_kws;
|
|
|
+ _keyArr[i]["notkey"] = not_kws;
|
|
|
+ } else {
|
|
|
+ kwsHtml += '<div class="one" style="">'
|
|
|
+ }
|
|
|
+ kwsHtml += '<div>'
|
|
|
+ + '<span><strong> 关键词:</strong>'
|
|
|
+ + '<p class="key">' + _keyArr[i]["key"].join(" ") + '</p></span>'
|
|
|
+ if (_keyArr[i]["appendkey"] != undefined && _keyArr[i]["appendkey"].length > 0) {
|
|
|
+ ak_showClass = "";
|
|
|
+ ak_remark = '编辑';
|
|
|
+ appendkeylth = _keyArr[i]["appendkey"].length;
|
|
|
+ kwsHtml += '<span>'
|
|
|
+ + '<strong> 附加词:</strong>'
|
|
|
+ + '<p class="addition">' + _keyArr[i]["appendkey"].join(" ") + '</p>'
|
|
|
+ + '</span>'
|
|
|
}
|
|
|
- if(not_kws.length>0){
|
|
|
- edhtml +='<button onclick="tonotkey(this)">编辑 排除词<i>('+not_kws.length+')</i></button>'
|
|
|
- }else{
|
|
|
- edhtml +='<button onclick="tonotkey(this)">添加 排除词</button>'
|
|
|
+ if (_keyArr[i]["notkey"] != undefined && _keyArr[i]["notkey"].length > 0) {
|
|
|
+ nk_showClass = "";
|
|
|
+ nk_remark = '编辑';
|
|
|
+ notkeylth = _keyArr[i]["notkey"].length;
|
|
|
+ kwsHtml += '<span>'
|
|
|
+ + '<strong> 排除词:</strong>'
|
|
|
+ + '<p class="notkey">' + _keyArr[i]["notkey"].join(" ") + '</p>'
|
|
|
+ + '</span>'
|
|
|
}
|
|
|
- edhtml +='</div>'
|
|
|
- +'<div class="btn">'
|
|
|
- +'<button onclick="Cancel()" style="width:49%;background:#fff;color:#2cb7ca;opacity: 1;">取消</button>'
|
|
|
- +'<button style="opacity: 1;">确认</button>'
|
|
|
- +'</div>'
|
|
|
- $(".enter.addkeyWord").html(edhtml);
|
|
|
- setTimeout(function(){
|
|
|
- $(".enter.addkeyWord").find("input").val(kws_name)
|
|
|
- $(".enter.addkeyWord").show();
|
|
|
- },200)
|
|
|
+ var p = kws_arr[_keyArr[i]["key"].join(" ")].split("-")[0]
|
|
|
+ kwsHtml += '</div>'
|
|
|
+ + '<button class="editKeyWord" dataIndex="' + p + '"><i class="iconfont icon-xiugai"></i> 修改</button>'
|
|
|
+ + '</div>'
|
|
|
+
|
|
|
+ if (modifyFlag && i == kws_index) {
|
|
|
+ kwsHtml += '<div class="modify" style="display:block;">'
|
|
|
+ if (addition_kws.length > 0) {
|
|
|
+ appendkeylth = addition_kws.length;
|
|
|
+ }
|
|
|
+ if (not_kws.length > 0) {
|
|
|
+ notkeylth = not_kws.length;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ kwsHtml += '<div class="modify" style="display: none;">'
|
|
|
+ }
|
|
|
+ kwsHtml += '<textarea name="" rows="1" placeholder="" maxlength="20">' + _keyArr[i]["key"].join(" ") + '</textarea>'
|
|
|
+ + '<button class="addAdjunctWord" onclick="toappendkey(this)">' + ak_remark + ' 附加词 <i class="appendkey ' + ak_showClass + '">(' + appendkeylth + ')</i></button>'
|
|
|
+ + '<button class="addExclusion" onclick="tonotkey(this)">' + nk_remark + ' 排除词 <i class="notkey ' + nk_showClass + '">(' + notkeylth + ')</i></button>'
|
|
|
+ + '<button class="deleteKey">删除</button>'
|
|
|
+ + '<button class="ascertainKey" dataIndex="' + p + '" onclick="saveK(this)">确定</button>'
|
|
|
+ + '</div>'
|
|
|
+ + '</li>'
|
|
|
}
|
|
|
- if(classify_name==""){
|
|
|
- $(".classify-detail").text("未分类");
|
|
|
- }else{
|
|
|
- $(".classify-detail").text(classify_name);
|
|
|
+ $(".showKeyWord ul").html(kwsHtml);
|
|
|
+ }
|
|
|
+ hasWords();
|
|
|
+ // 发送请求刷新数据,在ajax回调中执行
|
|
|
+ $('.add-keyword-container').show();
|
|
|
+ $('.all-classify-column').hide();
|
|
|
+ clearSesstion();
|
|
|
+ }
|
|
|
+
|
|
|
+ //跳转附加词
|
|
|
+ function toappendkey(th) {
|
|
|
+ if (!$('.enter.addkeyWord').is(':hidden')) {
|
|
|
+ if ($.trim($('.addkeyWord input.enterOne').val()) == "") {
|
|
|
+ return
|
|
|
}
|
|
|
- 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;
|
|
|
- }
|
|
|
- if (kws_tips==0&&classify_name.indexOf("未分类")>-1&&window.location.search.indexOf("page=2")<0){
|
|
|
- //第一次进来分类提示
|
|
|
- showMeg();
|
|
|
- var param = {};
|
|
|
- param.classify_index = classify_index;
|
|
|
- param.kws_tips = 1;
|
|
|
- $.post("/subscribepay/afterPay/updateUserTips",param,function(r){
|
|
|
- if(r.flag){
|
|
|
- kws_tips = param.kws_tips;
|
|
|
- $(".classify").attr("tips",kws_tips);
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
- for (var i = _keyArr.length - 1; i >= 0; i--) {
|
|
|
- var ak_showClass = 'hide';//是否显示附加词个数
|
|
|
- var nk_showClass = 'hide';//是否显示排除词个数
|
|
|
- var ak_remark = '添加';
|
|
|
- var nk_remark = '添加';
|
|
|
- var appendkeylth = 0;
|
|
|
- var notkeylth = 0;
|
|
|
- kwsHtml +='<li>'
|
|
|
- if(modifyFlag&&i==kws_index){
|
|
|
- kwsHtml +='<div class="one" style="display:none;">'
|
|
|
- _keyArr[i]["appendkey"] = addition_kws;
|
|
|
- _keyArr[i]["notkey"] = not_kws;
|
|
|
- }else{
|
|
|
- kwsHtml +='<div class="one" style="">'
|
|
|
+ kws_index = -1
|
|
|
+ kws_name = $.trim($('.addkeyWord input.enterOne').val());
|
|
|
+ } else {
|
|
|
+ if ($.trim($(th).parent(".modify").find("textarea").val()) == "") {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ kws_name = $.trim($(th).parent(".modify").find("textarea").val());
|
|
|
+ }
|
|
|
+ history.replaceState("", "", "/front/vipsubscribe/toSetKeyWordPage?page=243")
|
|
|
+ setSesstion();
|
|
|
+ window.location.href = "/front/vipsubscribe/toSetadditionPage";
|
|
|
+ }
|
|
|
+
|
|
|
+ //
|
|
|
+ function tonotkey(th) {
|
|
|
+ if (!$('.enter.addkeyWord').is(':hidden')) {
|
|
|
+ if ($.trim($('.addkeyWord input.enterOne').val()) == "") {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ kws_index = -1
|
|
|
+ kws_name = $.trim($('.addkeyWord input.enterOne').val());
|
|
|
+ } else {
|
|
|
+ if ($.trim($(th).parent(".modify").find("textarea").val()) == "") {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ kws_name = $.trim($(th).parent(".modify").find("textarea").val());
|
|
|
+ }
|
|
|
+ history.replaceState("", "", "/front/vipsubscribe/toSetKeyWordPage?page=243")
|
|
|
+ setSesstion();
|
|
|
+ window.location.href = '/front/vipsubscribe/toSetexclusivePage';
|
|
|
+ }
|
|
|
+
|
|
|
+ //保存缓存
|
|
|
+ function setSesstion() {
|
|
|
+ sessionStorage.kwspage = true;//关键词页面标识
|
|
|
+ sessionStorage.kws_name = kws_name;//当前关键词
|
|
|
+ sessionStorage.classify_name = classify_name;//当前分类
|
|
|
+ sessionStorage.kws_index = kws_index;//当前关键词索引
|
|
|
+ sessionStorage.classify_index = classify_index;//当前分类索引
|
|
|
+ sessionStorage.a_items = JSON.stringify(a_items);//当前数据
|
|
|
+ sessionStorage.addition_kws = JSON.stringify(addition_kws);//当前编辑关键词附加词
|
|
|
+ sessionStorage.not_kws = JSON.stringify(not_kws);//当前编辑关键词排除词
|
|
|
+ sessionStorage.kws_arr = JSON.stringify(kws_arr);//当前所有关键词排
|
|
|
+
|
|
|
+ sessionStorage.kws_count = kws_count;//关键词个数
|
|
|
+ }
|
|
|
+
|
|
|
+ //
|
|
|
+ function clearSesstion() {
|
|
|
+ if (!sessionStorage) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ sessionStorage.removeItem("kwspage");
|
|
|
+ sessionStorage.removeItem("kws_name");
|
|
|
+ sessionStorage.removeItem("classify_name");
|
|
|
+ sessionStorage.removeItem("kws_index");
|
|
|
+ sessionStorage.removeItem("classify_index");
|
|
|
+ sessionStorage.removeItem("a_items");
|
|
|
+ sessionStorage.removeItem("addition_kws");
|
|
|
+ sessionStorage.removeItem("not_kws");
|
|
|
+ sessionStorage.removeItem("kws_count");
|
|
|
+ sessionStorage.removeItem("kws_arr");
|
|
|
+ }
|
|
|
+
|
|
|
+ //保存关键词
|
|
|
+ function saveK(th) {
|
|
|
+ setTimeout(function () {
|
|
|
+ var $this = $(th);
|
|
|
+ kws_name = $.trim($(th).siblings('textarea').val());
|
|
|
+ if (kws_name == "") {
|
|
|
+ weui.toast('您设置的关键词不能为空,请调整后再添加。', {
|
|
|
+ duration: 2000,
|
|
|
+ className: 'custom-toast',
|
|
|
+ callback: function () {
|
|
|
+ console.log('close')
|
|
|
}
|
|
|
- kwsHtml +='<div>'
|
|
|
- +'<span><strong> 关键词:</strong>'
|
|
|
- +'<p class="key">'+_keyArr[i]["key"].join(" ")+'</p></span>'
|
|
|
- if (_keyArr[i]["appendkey"]!=undefined&&_keyArr[i]["appendkey"].length>0){
|
|
|
- ak_showClass = "";
|
|
|
- ak_remark = '编辑';
|
|
|
- appendkeylth = _keyArr[i]["appendkey"].length;
|
|
|
- kwsHtml +='<span>'
|
|
|
- +'<strong> 附加词:</strong>'
|
|
|
- +'<p class="addition">'+_keyArr[i]["appendkey"].join(" ")+'</p>'
|
|
|
- +'</span>'
|
|
|
+ });
|
|
|
+ return
|
|
|
+ }
|
|
|
+ var _index = Number($this.attr("dataindex"));
|
|
|
+ if (kws_arr[kws_name] != undefined && kws_arr[kws_name] != (_index + "-" + classify_index)) {
|
|
|
+ weui.toast('您设置的关键词已存在,请调整后再添加。', {
|
|
|
+ duration: 2000,
|
|
|
+ className: 'custom-toast',
|
|
|
+ callback: function () {
|
|
|
+ console.log('close')
|
|
|
}
|
|
|
- if (_keyArr[i]["notkey"]!=undefined&&_keyArr[i]["notkey"].length>0){
|
|
|
- nk_showClass = "";
|
|
|
- nk_remark = '编辑';
|
|
|
- notkeylth = _keyArr[i]["notkey"].length;
|
|
|
- kwsHtml +='<span>'
|
|
|
- +'<strong> 排除词:</strong>'
|
|
|
- +'<p class="notkey">'+_keyArr[i]["notkey"].join(" ")+'</p>'
|
|
|
- +'</span>'
|
|
|
+ });
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (kws_name.length > 20) {
|
|
|
+ weui.toast('关键词不能超过20字', {
|
|
|
+ duration: 2000,
|
|
|
+ className: 'custom-toast',
|
|
|
+ callback: function () {
|
|
|
+ console.log('close')
|
|
|
}
|
|
|
- var p = kws_arr[_keyArr[i]["key"].join(" ")].split("-")[0]
|
|
|
- kwsHtml +='</div>'
|
|
|
- +'<button class="editKeyWord" dataIndex="'+p+'"><i class="iconfont icon-xiugai"></i> 修改</button>'
|
|
|
- +'</div>'
|
|
|
-
|
|
|
- if(modifyFlag&&i==kws_index){
|
|
|
- kwsHtml +='<div class="modify" style="display:block;">'
|
|
|
- if(addition_kws.length>0){
|
|
|
- appendkeylth = addition_kws.length;
|
|
|
- }
|
|
|
- if(not_kws.length>0){
|
|
|
- notkeylth = not_kws.length;
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ if (saveData('SK')) {
|
|
|
+ //$this.attr("dataindex",kws_index);
|
|
|
+ $this.parent().siblings().find('.key').text(kws_name)
|
|
|
+ $this.parent().hide().siblings().show()
|
|
|
+ $(".add-keyword-container .addNewKeyword i").show();
|
|
|
+ //
|
|
|
+ doSessionData("", _index);
|
|
|
+ //把kws_name,kws_index,addition_kws,not_kws初始化
|
|
|
+ kws_index = 0;
|
|
|
+ kws_name = "";
|
|
|
+ addition_kws = [];
|
|
|
+ not_kws = [];
|
|
|
+ } else {
|
|
|
+ weui.toast('保存出错,稍后再试', {
|
|
|
+ duration: 2000,
|
|
|
+ className: 'custom-toast',
|
|
|
+ callback: function () {
|
|
|
+ console.log('close')
|
|
|
}
|
|
|
- }else{
|
|
|
- kwsHtml +='<div class="modify" style="display: none;">'
|
|
|
- }
|
|
|
- kwsHtml +='<textarea name="" rows="1" placeholder="" maxlength="20">'+_keyArr[i]["key"].join(" ")+'</textarea>'
|
|
|
- +'<button class="addAdjunctWord" onclick="toappendkey(this)">'+ak_remark+' 附加词 <i class="appendkey '+ak_showClass+'">('+appendkeylth+')</i></button>'
|
|
|
- +'<button class="addExclusion" onclick="tonotkey(this)">'+nk_remark+' 排除词 <i class="notkey '+nk_showClass+'">('+notkeylth+')</i></button>'
|
|
|
- +'<button class="deleteKey">删除</button>'
|
|
|
- +'<button class="ascertainKey" dataIndex="'+p+'" onclick="saveK(this)">确定</button>'
|
|
|
- +'</div>'
|
|
|
- +'</li>'
|
|
|
+ });
|
|
|
}
|
|
|
- $(".showKeyWord ul").html(kwsHtml);
|
|
|
}
|
|
|
- hasWords();
|
|
|
- // 发送请求刷新数据,在ajax回调中执行
|
|
|
- $('.add-keyword-container').show();
|
|
|
- $('.all-classify-column').hide();
|
|
|
- clearSesstion();
|
|
|
- }
|
|
|
- //跳转附加词
|
|
|
- function toappendkey(th){
|
|
|
- if(!$('.enter.addkeyWord').is(':hidden')){
|
|
|
- if($.trim($('.addkeyWord input.enterOne').val())==""){
|
|
|
- return
|
|
|
+ }, 150)
|
|
|
+ }
|
|
|
+
|
|
|
+ //保存数据
|
|
|
+ function saveData(actionType) {
|
|
|
+ var _flag = false;
|
|
|
+ var param = {};
|
|
|
+ param.pageType = "keyWords";
|
|
|
+ param.classify_index = classify_index;
|
|
|
+ param.classify_name = classify_name;
|
|
|
+ param.kws_index = kws_index;
|
|
|
+ param.kws_name = kws_name;
|
|
|
+ param.actionType = actionType;
|
|
|
+ param.addition_kws = addition_kws;
|
|
|
+ param.not_kws = not_kws;
|
|
|
+ param.kwscount = $(".content .showKeyWord li").length;
|
|
|
+ $.ajax({
|
|
|
+ type: "POST",
|
|
|
+ url: "/subscribepay/afterPay/setUserInfo",
|
|
|
+ data: param,
|
|
|
+ dataType: "json",
|
|
|
+ async: false,
|
|
|
+ traditional: true,
|
|
|
+ success: function (r) {
|
|
|
+ if (r.flag) {
|
|
|
+ console.log("保存成功")
|
|
|
+ _flag = r.flag;
|
|
|
}
|
|
|
- kws_index = -1
|
|
|
- kws_name = $.trim($('.addkeyWord input.enterOne').val());
|
|
|
- }else{
|
|
|
- if($.trim($(th).parent(".modify").find("textarea").val())==""){
|
|
|
- return
|
|
|
- }
|
|
|
- kws_name = $.trim($(th).parent(".modify").find("textarea").val());
|
|
|
}
|
|
|
- history.replaceState("","","/front/vipsubscribe/toSetKeyWordPage?page=243")
|
|
|
- setSesstion();
|
|
|
- window.location.href="/front/vipsubscribe/toSetadditionPage";
|
|
|
- }
|
|
|
- //
|
|
|
- function tonotkey(th){
|
|
|
- if(!$('.enter.addkeyWord').is(':hidden')){
|
|
|
- if($.trim($('.addkeyWord input.enterOne').val())==""){
|
|
|
- return
|
|
|
+ });
|
|
|
+ return _flag
|
|
|
+ }
|
|
|
+
|
|
|
+ //处理缓存数据 根据新索引和原索引操作----
|
|
|
+ function doSessionData(t, index) {
|
|
|
+ //删除关键词
|
|
|
+ if (t != "DK") {
|
|
|
+ if ($(".showKeyWord li:first").find(".editKeyWord").attr("dataIndex") != undefined && index <= Number($(".showKeyWord li:first").find(".editKeyWord").attr("dataIndex"))) {
|
|
|
+ var akws = a_items[classify_index]["a_key"];
|
|
|
+ for (var n in akws) {
|
|
|
+ var ky = akws[n]["key"].join(" ");
|
|
|
+ var sy = index + "-" + classify_index
|
|
|
+ if (kws_arr[ky] == sy) {
|
|
|
+ delete kws_arr[ky];
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ a_items[classify_index]["a_key"][kws_index]["key"] = kws_name.split(' ')
|
|
|
+ a_items[classify_index]["a_key"][kws_index]["appendkey"] = addition_kws
|
|
|
+ a_items[classify_index]["a_key"][kws_index]["notkey"] = not_kws
|
|
|
+ } else {
|
|
|
+ //新加
|
|
|
+ var karr = {"key": kws_name.split(" "), "appendkey": addition_kws, "notkey": not_kws}
|
|
|
+ if (index == 0) {
|
|
|
+ var keyM = [];
|
|
|
+ keyM.push(karr);
|
|
|
+ var classifyArr = {"s_item": classify_name, "a_key": keyM}
|
|
|
+ a_items.push(classifyArr);
|
|
|
+ } else {
|
|
|
+ a_items[classify_index]["a_key"].push(karr);
|
|
|
}
|
|
|
- kws_index = -1
|
|
|
- kws_name = $.trim($('.addkeyWord input.enterOne').val());
|
|
|
- }else{
|
|
|
- if($.trim($(th).parent(".modify").find("textarea").val())==""){
|
|
|
- return
|
|
|
- }
|
|
|
- kws_name = $.trim($(th).parent(".modify").find("textarea").val());
|
|
|
}
|
|
|
- history.replaceState("","","/front/vipsubscribe/toSetKeyWordPage?page=243")
|
|
|
- setSesstion();
|
|
|
- window.location.href='/front/vipsubscribe/toSetexclusivePage';
|
|
|
+ kws_arr[kws_name] = index + "-" + classify_index
|
|
|
+ } else {
|
|
|
+ var akws = a_items[classify_index]["a_key"];
|
|
|
+ for (var n in akws) {
|
|
|
+ var ky = akws[n]["key"].join(" ");
|
|
|
+ var sy = index + "-" + classify_index
|
|
|
+ if (kws_arr[ky] == sy) {
|
|
|
+ delete kws_arr[ky];
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (a_items[classify_index]["a_key"].length == 1) {
|
|
|
+ a_items.splice(classify_index, 1);
|
|
|
+ } else {
|
|
|
+ a_items[classify_index]["a_key"].splice(kws_index, 1);
|
|
|
+ }
|
|
|
}
|
|
|
- //保存缓存
|
|
|
- function setSesstion(){
|
|
|
- sessionStorage.kwspage = true;//关键词页面标识
|
|
|
- sessionStorage.kws_name = kws_name;//当前关键词
|
|
|
- sessionStorage.classify_name = classify_name;//当前分类
|
|
|
- sessionStorage.kws_index = kws_index;//当前关键词索引
|
|
|
- sessionStorage.classify_index = classify_index;//当前分类索引
|
|
|
- sessionStorage.a_items = JSON.stringify(a_items);//当前数据
|
|
|
- sessionStorage.addition_kws = JSON.stringify(addition_kws);//当前编辑关键词附加词
|
|
|
- sessionStorage.not_kws = JSON.stringify(not_kws);//当前编辑关键词排除词
|
|
|
- sessionStorage.kws_arr = JSON.stringify(kws_arr);//当前所有关键词排
|
|
|
-
|
|
|
- sessionStorage.kws_count=kws_count;//关键词个数
|
|
|
+ a_items_m = a_items
|
|
|
+ //更新vip首页数据
|
|
|
+ var subVipState = sessionStorage.getItem('sub_vip_state')
|
|
|
+ if (subVipState != "") {
|
|
|
+ var reqData = JSON.parse(subVipState);
|
|
|
+ reqData.items = a_items_m;
|
|
|
+ sessionStorage.setItem('sub_vip_state', JSON.stringify(reqData))
|
|
|
}
|
|
|
- //
|
|
|
- function clearSesstion(){
|
|
|
- if(!sessionStorage){
|
|
|
- return;
|
|
|
- }
|
|
|
- sessionStorage.removeItem("kwspage");
|
|
|
- sessionStorage.removeItem("kws_name");
|
|
|
- sessionStorage.removeItem("classify_name");
|
|
|
- sessionStorage.removeItem("kws_index");
|
|
|
- sessionStorage.removeItem("classify_index");
|
|
|
- sessionStorage.removeItem("a_items");
|
|
|
- sessionStorage.removeItem("addition_kws");
|
|
|
- sessionStorage.removeItem("not_kws");
|
|
|
- sessionStorage.removeItem("kws_count");
|
|
|
- sessionStorage.removeItem("kws_arr");
|
|
|
+ }
|
|
|
+
|
|
|
+ //
|
|
|
+ function modalOne() {
|
|
|
+ // 如果是苹果手机,打开时候要设置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%'})
|
|
|
}
|
|
|
- //保存关键词
|
|
|
- function saveK(th){
|
|
|
- setTimeout(function(){
|
|
|
- var $this = $(th);
|
|
|
- kws_name = $.trim($(th).siblings('textarea').val());
|
|
|
- if(kws_name==""){
|
|
|
- weui.toast('您设置的关键词不能为空,请调整后再添加。', {
|
|
|
- duration: 2000,
|
|
|
- className: 'custom-toast',
|
|
|
- callback: function () { console.log('close') }
|
|
|
- });
|
|
|
- return
|
|
|
- }
|
|
|
- var _index = Number($this.attr("dataindex"));
|
|
|
- if(kws_arr[kws_name]!=undefined&&kws_arr[kws_name]!=(_index+"-"+classify_index)){
|
|
|
- weui.toast('您设置的关键词已存在,请调整后再添加。', {
|
|
|
- duration: 2000,
|
|
|
- className: 'custom-toast',
|
|
|
- callback: function () { console.log('close') }
|
|
|
- });
|
|
|
- return
|
|
|
- }
|
|
|
- if(kws_name.length > 20){
|
|
|
- weui.toast('关键词不能超过20字', {
|
|
|
- duration: 2000,
|
|
|
- className: 'custom-toast',
|
|
|
- callback: function () { console.log('close') }
|
|
|
- });
|
|
|
- }else{
|
|
|
- if(saveData('SK')){
|
|
|
- //$this.attr("dataindex",kws_index);
|
|
|
- $this.parent().siblings().find('.key').text(kws_name)
|
|
|
- $this.parent().hide().siblings().show()
|
|
|
- $(".add-keyword-container .addNewKeyword i").show();
|
|
|
- //
|
|
|
- doSessionData("",_index);
|
|
|
- //把kws_name,kws_index,addition_kws,not_kws初始化
|
|
|
- kws_index = 0;
|
|
|
- kws_name = "";
|
|
|
- addition_kws = [];
|
|
|
- not_kws = [];
|
|
|
- }else{
|
|
|
- weui.toast('保存出错,稍后再试', {
|
|
|
- duration: 2000,
|
|
|
- className: 'custom-toast',
|
|
|
- callback: function () { console.log('close') }
|
|
|
- });
|
|
|
- }
|
|
|
- }
|
|
|
- },150)
|
|
|
+ $('.classify-edit-pop').show()
|
|
|
+ var currentClassifyName = $(".classify").find('.classify-detail').text()
|
|
|
+ if (currentClassifyName.indexOf("未分类") > -1) {
|
|
|
+ currentClassifyName = ""
|
|
|
}
|
|
|
- //保存数据
|
|
|
- function saveData(actionType){
|
|
|
- var _flag = false;
|
|
|
- var param = {};
|
|
|
- param.pageType = "keyWords";
|
|
|
- param.classify_index = classify_index;
|
|
|
- param.classify_name = classify_name;
|
|
|
- param.kws_index = kws_index;
|
|
|
- param.kws_name = kws_name;
|
|
|
- param.actionType = actionType;
|
|
|
- param.addition_kws = addition_kws;
|
|
|
- param.not_kws = not_kws;
|
|
|
- param.kwscount = $(".content .showKeyWord li").length;
|
|
|
- $.ajax({
|
|
|
- type: "POST",
|
|
|
- url: "/subscribepay/afterPay/setUserInfo",
|
|
|
- data: param,
|
|
|
- dataType: "json",
|
|
|
- async: false,
|
|
|
- traditional: true,
|
|
|
- success: function(r){
|
|
|
- if(r.flag){
|
|
|
- console.log("保存成功")
|
|
|
- _flag = r.flag;
|
|
|
- }
|
|
|
+ $('input.classify-keyword').val(currentClassifyName).focus()
|
|
|
+ }
|
|
|
+
|
|
|
+ //
|
|
|
+ function modalTwo() {
|
|
|
+ $(".fastICName").text($(".classify-detail").text());
|
|
|
+ // 如果是苹果手机,打开时候要设置top
|
|
|
+ var agent = navigator.userAgent.toLowerCase();
|
|
|
+ var dialog = $('.classify-fast-pop .weui-dialog')
|
|
|
+ if (/iphone|ipod|ipad|ios/.test(agent)) {
|
|
|
+ dialog.css({'top': '40%'})
|
|
|
+ } else {
|
|
|
+ dialog.css({'top': '50%'})
|
|
|
+ }
|
|
|
+ $('.classify-fast-pop').show();
|
|
|
+ }
|
|
|
+</script>
|
|
|
+<script src="{{Msg "seo" "cdn"}}/vipsubscribe/js/keyWord.js?v={{Msg "seo" "version"}}23"></script>
|
|
|
+<script>
|
|
|
+ window.onunload = function () {//离开页面保存关键词修改
|
|
|
+ if (items_str(a_items_m) != a_items_str) {
|
|
|
+ sessionStorage.removeItem("a_items_str");
|
|
|
+ $.post("/subscribepay/afterPay/modification ", {}, function (r) {
|
|
|
+ if (r && r.mflag) {
|
|
|
+ console.log("保存成功")
|
|
|
}
|
|
|
- });
|
|
|
- return _flag
|
|
|
+ })
|
|
|
}
|
|
|
- //处理缓存数据 根据新索引和原索引操作----
|
|
|
- function doSessionData(t,index){
|
|
|
- //删除关键词
|
|
|
- if(t!="DK"){
|
|
|
- if($(".showKeyWord li:first").find(".editKeyWord").attr("dataIndex")!=undefined&&index <= Number($(".showKeyWord li:first").find(".editKeyWord").attr("dataIndex"))){
|
|
|
- var akws = a_items[classify_index]["a_key"];
|
|
|
- for (var n in akws){
|
|
|
- var ky = akws[n]["key"].join(" ");
|
|
|
- var sy = index+"-"+classify_index
|
|
|
- if(kws_arr[ky]==sy){
|
|
|
- delete kws_arr[ky];
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
- a_items[classify_index]["a_key"][kws_index]["key"]= kws_name.split(' ')
|
|
|
- a_items[classify_index]["a_key"][kws_index]["appendkey"]= addition_kws
|
|
|
- a_items[classify_index]["a_key"][kws_index]["notkey"]= not_kws
|
|
|
- }else{
|
|
|
- //新加
|
|
|
- var karr = {"key":kws_name.split(" "),"appendkey":addition_kws,"notkey":not_kws}
|
|
|
- if (index==0){
|
|
|
- var keyM = [];
|
|
|
- keyM.push(karr);
|
|
|
- var classifyArr = {"s_item":classify_name,"a_key":keyM}
|
|
|
- a_items.push(classifyArr);
|
|
|
- }else{
|
|
|
- a_items[classify_index]["a_key"].push(karr);
|
|
|
+ }
|
|
|
+
|
|
|
+ // 设置一条空记录,用户第一次进入添加关键词点击确定时候调用
|
|
|
+ function setEmptyHistory() {
|
|
|
+ if (pageState.isFirstSetKeyword) {
|
|
|
+ history.pushState({id: 1}, "", "")
|
|
|
+ pageState.isFirstSetKeyword = false
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ //
|
|
|
+ $(function () {
|
|
|
+ $(".addNewKeyword div").on('click', function () {
|
|
|
+ history.pushState({id: 1}, "", "");
|
|
|
+ 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])
|
|
|
}
|
|
|
- }
|
|
|
- kws_arr[kws_name] = index+"-"+classify_index
|
|
|
- }else{
|
|
|
- var akws = a_items[classify_index]["a_key"];
|
|
|
- for (var n in akws){
|
|
|
- var ky = akws[n]["key"].join(" ");
|
|
|
- var sy = index+"-"+classify_index
|
|
|
- if(kws_arr[ky]==sy){
|
|
|
- delete kws_arr[ky];
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
- if (a_items[classify_index]["a_key"].length==1){
|
|
|
- a_items.splice(classify_index,1);
|
|
|
- }else{
|
|
|
- a_items[classify_index]["a_key"].splice(kws_index,1);
|
|
|
}
|
|
|
}
|
|
|
- a_items_m = a_items
|
|
|
- }
|
|
|
- //
|
|
|
- function modalOne(){
|
|
|
- // 如果是苹果手机,打开时候要设置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()
|
|
|
- var currentClassifyName = $(".classify").find('.classify-detail').text()
|
|
|
- if(currentClassifyName.indexOf("未分类")>-1){
|
|
|
- currentClassifyName = ""
|
|
|
- }
|
|
|
- $('input.classify-keyword').val(currentClassifyName).focus()
|
|
|
- }
|
|
|
- //
|
|
|
- function modalTwo(){
|
|
|
- $(".fastICName").text($(".classify-detail").text());
|
|
|
- // 如果是苹果手机,打开时候要设置top
|
|
|
- var agent = navigator.userAgent.toLowerCase();
|
|
|
- var dialog = $('.classify-fast-pop .weui-dialog')
|
|
|
- if( /iphone|ipod|ipad|ios/.test(agent) ){
|
|
|
- dialog.css({ 'top': '40%' })
|
|
|
- } else {
|
|
|
- dialog.css({ 'top': '50%' })
|
|
|
- }
|
|
|
- $('.classify-fast-pop').show();
|
|
|
- }
|
|
|
- </script>
|
|
|
- <script src="{{Msg "seo" "cdn"}}/vipsubscribe/js/keyWord.js?v={{Msg "seo" "version"}}23"></script>
|
|
|
- <script>
|
|
|
- window.onunload = function() {//离开页面保存关键词修改
|
|
|
- if(items_str(a_items_m)!=a_items_str){
|
|
|
- sessionStorage.removeItem("a_items_str");
|
|
|
- $.post("/subscribepay/afterPay/modification ",{},function(r){
|
|
|
- if(r&&r.mflag){
|
|
|
- console.log("保存成功")
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
- }
|
|
|
- // 设置一条空记录,用户第一次进入添加关键词点击确定时候调用
|
|
|
- function setEmptyHistory() {
|
|
|
- if (pageState.isFirstSetKeyword) {
|
|
|
- history.pushState({id:1}, "","")
|
|
|
- pageState.isFirstSetKeyword = false
|
|
|
+ if (noNameIndex != -1) {
|
|
|
+ noNameIndex = noNameIndex + parseInt(1)
|
|
|
+ noName = noName + noNameIndex
|
|
|
}
|
|
|
- }
|
|
|
- //
|
|
|
- $(function(){
|
|
|
- $(".addNewKeyword div").on('click', function () {
|
|
|
- history.pushState({id:1}, "","");
|
|
|
+ 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();
|
|
|
+ $(".add-keyword-container .addNewKeyword i").hide();
|
|
|
+ setTimeout(function () {
|
|
|
+ modalOne();
|
|
|
+ }, 200)
|
|
|
+ })
|
|
|
+ // 通过判断是那个隐藏来判断是添加关键词还是添加新分类
|
|
|
+ $(".addNewKeyword i").on('click', function () {
|
|
|
+ // 如果是在分类列表点击添加(此时关键词列表是隐藏的)
|
|
|
+ // isClassifyColumnShow = true说明是添加新分类
|
|
|
+ var isClassifyColumnShow = $('.add-keyword-container').is(':hidden');
|
|
|
+ if (isClassifyColumnShow) {
|
|
|
+ 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);
|
|
|
+ $('.classify .classify-detail').text('未分类');
|
|
|
$('.add-keyword-container .showKeyWord ul').html('');
|
|
|
+ }
|
|
|
+ $(".add-keyword-container .addNewKeyword i").hide();
|
|
|
+ $('.add-keyword-container').show();
|
|
|
+ $('.all-classify-column').hide();
|
|
|
+ //
|
|
|
+ kws_index = 0;
|
|
|
+ modifyFlag = false;
|
|
|
+ addition_kws = [];
|
|
|
+ not_kws = [];
|
|
|
+ // 显示添加关键词的输入框
|
|
|
+ $(".enter.addkeyWord").find(".btnChoose button").eq(0).html('添加 附加词');
|
|
|
+ $(".enter.addkeyWord").find(".btnChoose button").eq(1).html('添加 排除词');
|
|
|
+ $(".enter.addkeyWord").find(".btn button").eq(1).css({"opacity": ".5"});
|
|
|
+ $(".enter.addkeyWord").find(".btn button").eq(1).attr("disabled", true);
|
|
|
+ $(".enter.addkeyWord").find("input").val("");
|
|
|
+ $(".enter.addkeyWord").show();
|
|
|
+ $('.enterOne').focus();
|
|
|
+ })
|
|
|
|
|
|
- $('.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();
|
|
|
- $(".add-keyword-container .addNewKeyword i").hide();
|
|
|
- setTimeout(function(){
|
|
|
- modalOne();
|
|
|
- },200)
|
|
|
- })
|
|
|
- // 通过判断是那个隐藏来判断是添加关键词还是添加新分类
|
|
|
- $(".addNewKeyword i").on('click', function () {
|
|
|
- // 如果是在分类列表点击添加(此时关键词列表是隐藏的)
|
|
|
- // isClassifyColumnShow = true说明是添加新分类
|
|
|
- var isClassifyColumnShow = $('.add-keyword-container').is(':hidden');
|
|
|
- if (isClassifyColumnShow) {
|
|
|
- history.pushState({}, "","");
|
|
|
- classify_index = $(".classify-list li").length;
|
|
|
- // 还原有数据
|
|
|
- $('.classify .classify-detail').text('未分类');
|
|
|
- $('.add-keyword-container .showKeyWord ul').html('');
|
|
|
- }
|
|
|
- $(".add-keyword-container .addNewKeyword i").hide();
|
|
|
- $('.add-keyword-container').show();
|
|
|
- $('.all-classify-column').hide();
|
|
|
- //
|
|
|
- kws_index = 0;
|
|
|
- modifyFlag = false;
|
|
|
- addition_kws = [];
|
|
|
- not_kws = [];
|
|
|
- // 显示添加关键词的输入框
|
|
|
- $(".enter.addkeyWord").find(".btnChoose button").eq(0).html('添加 附加词');
|
|
|
- $(".enter.addkeyWord").find(".btnChoose button").eq(1).html('添加 排除词');
|
|
|
- $(".enter.addkeyWord").find(".btn button").eq(1).css({"opacity":".5"});
|
|
|
- $(".enter.addkeyWord").find(".btn button").eq(1).attr("disabled", true);
|
|
|
- $(".enter.addkeyWord").find("input").val("");
|
|
|
- $(".enter.addkeyWord").show();
|
|
|
- $('.enterOne').focus();
|
|
|
- })
|
|
|
-
|
|
|
- // 点击分类目录的每一项,进入对应列表
|
|
|
- $('.classify-list').on('click', '.classify-item', function() {
|
|
|
- // 添加一条空历史记录
|
|
|
- history.pushState({id:1}, "","");
|
|
|
- classify_name = $.trim($(this).find('.classify-item-l').text());
|
|
|
- classify_index = $(this).index();
|
|
|
- kws_index = 0;
|
|
|
- //展示此关键词信息
|
|
|
- $(".add-keyword-container .addNewKeyword i").show();
|
|
|
- toSetKws();
|
|
|
- })
|
|
|
+ // 点击分类目录的每一项,进入对应列表
|
|
|
+ $('.classify-list').on('click', '.classify-item', function () {
|
|
|
+ // 添加一条空历史记录
|
|
|
+ history.pushState({id: 1}, "", "");
|
|
|
+ classify_name = $.trim($(this).find('.classify-item-l').text());
|
|
|
+ classify_index = $(this).index();
|
|
|
+ kws_index = 0;
|
|
|
+ //展示此关键词信息
|
|
|
+ $(".add-keyword-container .addNewKeyword i").show();
|
|
|
+ toSetKws();
|
|
|
})
|
|
|
- </script>
|
|
|
- {{include "/common/baiducc.html"}}
|
|
|
+ })
|
|
|
+</script>
|
|
|
+{{include "/common/baiducc.html"}}
|
|
|
</body>
|
|
|
|
|
|
</html>
|