瀏覽代碼

关键词

wangshan 5 年之前
父節點
當前提交
19ccdcb363

+ 24 - 0
src/jfw/front/vipsubscribe.go

@@ -17,6 +17,10 @@ type Subscribepay struct {
 	toPaySuccessPage  xweb.Mapper `xweb:"/front/vipsubscribe/toPaySuccessPage"`      //订阅支付完成页面
 	toOrderDetailPage xweb.Mapper `xweb:"/front/vipsubscribe/toOrderDetailPage"`     //订阅收费支付订单详情页面
 	toSetKeyWordPage  xweb.Mapper `xweb:"/front/vipsubscribe/toSetKeyWordPage"`      //订阅收费设置关键词
+	toSetPage         xweb.Mapper `xweb:"/front/vipsubscribe/toSetPage"`             //订阅收费设置
+	toSetInfoTypePage xweb.Mapper `xweb:"/front/vipsubscribe/toSetInfoTypePage"`     //订阅收费设置信息类型
+	toSetPushSetPage  xweb.Mapper `xweb:"/front/vipsubscribe/toSetPushSetPage"`      //订阅收费推送设置
+	toSetOtherKwsPage xweb.Mapper `xweb:"/front/vipsubscribe/toSet(.*)Page"`         //订阅收费附加词和排除词设置
 
 	//修改
 	toEditSubPage     xweb.Mapper `xweb:"/front/vipsubscribe/toEditSubPage"`     //订阅收费修改页面
@@ -38,6 +42,26 @@ func init() {
 	xweb.AddAction(&Subscribepay{})
 }
 
+//附加词|排除词
+func (s *Subscribepay) ToSetOtherKwsPage(page string) {
+	s.Render("/weixin/vipsubscribe/" + page + "Word.html")
+}
+
+//推送设置
+func (s *Subscribepay) ToSetPushSetPage() {
+	s.Render("/weixin/vipsubscribe/vip_seniorset.html")
+}
+
+//信息类型
+func (s *Subscribepay) ToSetInfoTypePage() {
+	s.Render("/weixin/vipsubscribe/messageType.html")
+}
+
+//订阅设置
+func (s *Subscribepay) ToSetPage() {
+	s.Render("/weixin/vipsubscribe/vip_index.html")
+}
+
 //订阅收费介绍页
 func (s *Subscribepay) Introduce() {
 	s.Render("/weixin/vipsubscribe/vip_introduce.html")

+ 1 - 1
src/jfw/modules/subscribepay/src/a/init.go

@@ -22,6 +22,6 @@ func init() {
 	xweb.RootApp().Logger.SetOutputLevel(1) //输出日志,改为4则不输出任何日志
 	//
 	xweb.AddAction(&service.Test{})
-	//xweb.AddAction(&service.Public{})
+	xweb.AddAction(&service.AfterPay{})
 	xweb.AddAction(&service.Trial{})
 }

+ 137 - 0
src/jfw/modules/subscribepay/src/service/afterPay.go

@@ -0,0 +1,137 @@
+package service
+
+import (
+	"log"
+	qutil "qfw/util"
+	"qfw/util/redis"
+	"strconv"
+	"strings"
+	"time"
+	"util"
+
+	"github.com/go-xweb/xweb"
+	"gopkg.in/mgo.v2/bson"
+)
+
+//完成支付数据交互接口
+type AfterPay struct {
+	*xweb.Action
+	getUserInfo xweb.Mapper `xweb:"/afterPay/getUserInfo"` //获取用户当前支付后的信息
+	setUserInfo xweb.Mapper `xweb:"/afterPay/setUserInfo"` //保存用户当前支付后的信息
+}
+
+//
+func (a *AfterPay) SetUserInfo() error {
+	defer qutil.Catch()
+	userId, _ := a.GetSession("userId").(string)
+	if userId != "" {
+		updateQuery := map[string]interface{}{
+			"_id": bson.ObjectIdHex(userId),
+		}
+		saveData := make(map[string]interface{})
+		if a.GetString("pageType") == "infoType" {
+			log.Println(a.GetString("infoTypeArr"))
+			infoTypeArr := a.GetString("infoTypeArr")
+			saveData["o_vipjy.a_infotype"] = strings.Split(infoTypeArr, ",")
+		} else if a.GetString("pageType") == "saveSeniorset" {
+			i_ratemode, _ := a.GetInteger("ratemode")
+			i_wxpush, _ := a.GetInteger("wxpush")
+			i_mailpush, _ := a.GetInteger("mailpush")
+			s_email := a.GetString("email")
+			i_matchway, _ := a.GetInteger("matchtype")
+			saveData["o_vipjy.i_ratemode"] = i_ratemode
+			saveData["o_vipjy.i_wxpush"] = i_wxpush
+			saveData["o_vipjy.i_mailpush"] = i_mailpush
+			saveData["o_vipjy.s_email"] = s_email
+			saveData["o_vipjy.i_matchway"] = i_matchway
+		}
+		flag := util.MQFW.Update("user", updateQuery, map[string]interface{}{
+			"$set": saveData,
+		}, false, false)
+		log.Println("flag:", flag)
+		a.ServeJson(map[string]interface{}{
+			"flag": flag,
+		})
+	}
+	return nil
+}
+
+//
+var threeRemind = int64(3 * 24 * 60 * 60)
+var twoRemind = int64(2 * 24 * 60 * 60)
+var oneRemind = int64(1 * 24 * 60 * 60)
+
+//
+func (a *AfterPay) GetUserInfo() error {
+	defer qutil.Catch()
+	userId, _ := a.GetSession("userId").(string)
+	var userData *map[string]interface{}
+	if userId != "" {
+		userData, _ = util.MQFW.FindById("user", userId, `{"o_vipjy":1,"i_vip_status":1,"l_vip_starttime":1,"l_vip_endtime":1}`)
+		if *userData != nil {
+			data := qutil.ObjToMap((*userData)["o_vipjy"])
+			//区域
+			_area := qutil.ObjToMap((*data)["o_area"].(interface{}))
+			var area = ""
+			for k, v := range *_area {
+				if len(v.([]interface{})) == 0 {
+					area += k + "、"
+				} else {
+					for _, _v := range v.([]interface{}) {
+						area += _v.(string) + "、"
+					}
+				}
+			}
+			(*data)["o_area"] = strings.TrimRight(area, "、")
+			//采购行业
+			_buyClass := (*data)["a_buyerclass"].([]interface{})
+			var buyClass = ""
+			for _, v := range _buyClass {
+				buyClass += v.(string) + "、"
+			}
+			(*data)["a_buyerclass"] = strings.TrimRight(buyClass, "、")
+			//有效日期
+			var _starttime = (*userData)["l_vip_starttime"]
+			(*userData)["l_vip_starttime"] = strings.Replace(qutil.FormatDateWithObj(&_starttime, qutil.Date_Short_Layout), "-", ".", -1)
+			var _endtime = (*userData)["l_vip_endtime"]
+			(*userData)["l_vip_endtime"] = strings.Replace(qutil.FormatDateWithObj(&_endtime, qutil.Date_Short_Layout), "-", ".", -1)
+			//订阅周期
+			var _cycleunit = qutil.IntAll((*data)["i_cycleunit"])
+			var _cyclecount = qutil.IntAll((*data)["i_cyclecount"])
+			if _cycleunit == 1 {
+				(*data)["cycle"] = strconv.Itoa(_cyclecount) + "年"
+			} else {
+				(*data)["cycle"] = strconv.Itoa(_cyclecount) + "月"
+			}
+			//是否到期
+			if qutil.Int64All(_endtime)-time.Now().Unix() < threeRemind && qutil.Int64All(_endtime)-time.Now().Unix() >= twoRemind {
+				(*data)["expRemind"] = "3" //即将到期
+			} else if qutil.Int64All(_endtime)-time.Now().Unix() < twoRemind && qutil.Int64All(_endtime)-time.Now().Unix() >= oneRemind {
+				(*data)["expRemind"] = "2" //即将到期
+			} else if qutil.Int64All(_endtime)-time.Now().Unix() < oneRemind && qutil.Int64All(_endtime)-time.Now().Unix() >= 0 {
+				(*data)["expRemind"] = "1" //即将到期
+			} else if qutil.Int64All(_endtime)-time.Now().Unix() < 0 {
+				(*data)["expRemind"] = "0" //已经到期
+			}
+			//每月修改次数
+			(*data)["modTimes"] = redis.GetInt("other", "vipSubscribe_"+userId+"_"+time.Now().Month().String()) //每个月修改次数
+			//信息类型
+			if (*data)["a_infotype"] != nil {
+				_infotype := (*data)["a_infotype"].([]interface{})
+				var infotype = ""
+				for _, v := range _infotype {
+					infotype += v.(string) + "、"
+				}
+				(*data)["a_infotype"] = strings.TrimRight(infotype, "、")
+			} else {
+				(*data)["a_infotype"] = ""
+			}
+
+		}
+		log.Println("userId:", userId)
+	}
+	a.ServeJson(map[string]interface{}{
+		"userData": userData,
+	})
+	return nil
+}

+ 341 - 0
src/web/staticres/vipsubscribe/css/addition_exclusive_word.css

@@ -0,0 +1,341 @@
+.exclusive-word,
+.addition-word {
+  display: flex;
+  flex-direction: column;
+  justify-content: space-between;
+  width: 100;
+  height: 100%;
+  overflow: hidden;
+}
+
+.exclusive-word .content,
+.addition-word .content {
+  flex: 1;
+  overflow-y: scroll;
+}
+
+.exclusive-word .title,
+.addition-word .title {
+  font-size: 0.26rem;
+  color: #888;
+  padding: 0.3rem;
+  line-height: 0.38rem;
+}
+
+.exclusive-word .enter .enterOne,
+.addition-word .enter .enterOne {
+  min-height: 47px;
+  width: 100%;
+  padding: 0.3rem;
+  font-size: 0.3rem;
+  background: #fff;
+}
+
+.exclusive-word .enter .btnChoose,
+.addition-word .enter .btnChoose {
+  border-top: 1px solid #e0e0e0;
+  overflow: hidden;
+  background: #fff;
+}
+
+.exclusive-word .enter .btnChoose button,
+.addition-word .enter .btnChoose button {
+  float: left;
+  height: 0.6rem;
+  font-size: 0.3rem;
+  width: 50%;
+  background: #fff;
+  margin: 0.15rem 0;
+  color: #1d1d1d;
+}
+
+.exclusive-word .enter .btnChoose button:first-child,
+.addition-word .enter .btnChoose button:first-child {
+  border-right: 1px solid #e0e0e0;
+}
+
+.exclusive-word .enter .btn,
+.addition-word .enter .btn {
+  margin-top: 0.16rem;
+}
+
+.exclusive-word .enter .btn button,
+.addition-word .enter .btn button {
+  width: 100%;
+  height: 0.94rem;
+  background: #2cb7ca;
+  color: #fff;
+  font-size: 0.36rem;
+  opacity: 0.5;
+}
+
+.exclusive-word .showKeyWord ul li,
+.addition-word .showKeyWord ul li {
+  margin-bottom: 0.16rem;
+  overflow: hidden;
+}
+
+.exclusive-word .showKeyWord ul li .one,
+.addition-word .showKeyWord ul li .one {
+  display: flex;
+  background: #fff;
+  line-height: 0.54rem;
+  padding: 0.2rem 0;
+}
+
+.exclusive-word .showKeyWord ul li .one div,
+.addition-word .showKeyWord ul li .one div {
+  flex: 1;
+}
+
+.exclusive-word .showKeyWord ul li .one div span,
+.addition-word .showKeyWord ul li .one div span {
+  display: flex;
+  padding: 0 0.3rem;
+}
+
+.exclusive-word .showKeyWord ul li .one div span strong,
+.addition-word .showKeyWord ul li .one div span strong {
+  font-size: 0.3rem;
+  color: #1d1d1d;
+  font-weight: normal;
+  display: block;
+  width: 1.3rem;
+}
+
+.exclusive-word .showKeyWord ul li .one div span p,
+.addition-word .showKeyWord ul li .one div span p {
+  flex: 1;
+  font-size: 0.3rem;
+  color: #686868;
+}
+
+.exclusive-word .showKeyWord ul li .one button,
+.addition-word .showKeyWord ul li .one button {
+  width: 1.96rem;
+  background: #fff;
+  color: #2cb7ca;
+  border-left: 1px solid #e0e0e0;
+  font-size: 0.3rem;
+  position: relative;
+  left: 0;
+}
+
+.exclusive-word .showKeyWord ul li .one button i,
+.addition-word .showKeyWord ul li .one button i {
+  font-size: 0.4rem;
+  padding-right: 0.1rem;
+}
+
+.exclusive-word .showKeyWord ul li .modify,
+.addition-word .showKeyWord ul li .modify {
+  display: none;
+  margin-top: 0.16rem;
+}
+
+.exclusive-word .showKeyWord ul li .modify textarea,
+.addition-word .showKeyWord ul li .modify textarea {
+  box-sizing: border-box;
+  min-height: 0.94rem;
+  resize: none;
+  width: 100%;
+  display: flex;
+  align-items: center;
+  padding: 0.3rem;
+  background: #fff;
+  outline: none;
+  font-size: 0.3rem;
+  color: #1d1d1d;
+}
+
+.exclusive-word .showKeyWord ul li .modify span,
+.addition-word .showKeyWord ul li .modify span {
+  width: 100%;
+  display: block;
+  line-height: 0.5rem;
+  padding: 0.2rem 0.3rem;
+  background: #fff;
+  outline: none;
+  font-size: 0.3rem;
+  color: #1d1d1d;
+  user-modify: read-write-plaintext-only;
+  -webkit-user-modify: read-write-plaintext-only;
+}
+
+.exclusive-word .showKeyWord ul li .modify button,
+.addition-word .showKeyWord ul li .modify button {
+  width: 50%;
+  height: 0.88rem;
+  float: left;
+  margin-top: 0.16rem;
+  font-size: 0.28rem;
+}
+
+.exclusive-word .showKeyWord ul li .modify button.addAdjunctWord, .exclusive-word .showKeyWord ul li .modify button.addExclusion,
+.addition-word .showKeyWord ul li .modify button.addAdjunctWord,
+.addition-word .showKeyWord ul li .modify button.addExclusion {
+  position: relative;
+  background: #fff;
+}
+
+.exclusive-word .showKeyWord ul li .modify button.addExclusion:before,
+.addition-word .showKeyWord ul li .modify button.addExclusion:before {
+  position: absolute;
+  content: "";
+  width: 1px;
+  height: 0.64rem;
+  background-color: #e0e0e0;
+  left: 0;
+  top: 0.13rem;
+}
+
+.exclusive-word .showKeyWord ul li .modify button.deleteKey,
+.addition-word .showKeyWord ul li .modify button.deleteKey {
+  color: #fff;
+  background: #fe737a;
+  font-size: 0.3rem;
+}
+
+.exclusive-word .showKeyWord ul li .modify button.ascertainKey,
+.addition-word .showKeyWord ul li .modify button.ascertainKey {
+  color: #fff;
+  background: #2cb7ca;
+  font-size: 0.3rem;
+}
+
+.exclusive-word .addKeyWord,
+.addition-word .addKeyWord {
+  padding-bottom: .2rem;
+  width: 100%;
+  text-align: center;
+}
+
+.exclusive-word .addKeyWord i,
+.addition-word .addKeyWord i {
+  margin-bottom: 0.4rem;
+  font-size: 1rem;
+  color: #2cb7ca;
+}
+
+.exclusive-word .addKeyWord p,
+.addition-word .addKeyWord p {
+  height: 0.56rem;
+  line-height: 0.56rem;
+  background-color: #fff;
+  font-size: 0.28rem;
+  color: #888;
+}
+
+.exclusive-word .problem,
+.addition-word .problem {
+  margin-top: 0.4rem;
+  font-size: 0.3rem;
+  color: #2cb7ca;
+  float: right;
+  margin-right: 0.3rem;
+}
+
+.exclusive-word .problem i,
+.addition-word .problem i {
+  margin-left: 0.06rem;
+}
+
+.exclusive-word .problemPop,
+.addition-word .problemPop {
+  background: rgba(0, 0, 0, 0.5);
+  position: fixed;
+  width: 100%;
+  height: 100%;
+  height: 100vh;
+  top: 0;
+  left: 0;
+  right: 0;
+  bottom: 0;
+  display: none;
+  align-items: center;
+  justify-content: center;
+}
+
+.exclusive-word .problemPop .problemPopContent,
+.addition-word .problemPop .problemPopContent {
+  width: 5.6rem;
+  min-height: 7.23rem;
+  display: inline-block;
+  background: #fff;
+  border-radius: 4px;
+  position: relative;
+  padding: 0.58rem 0;
+}
+
+.exclusive-word .problemPop .problemPopContent h3,
+.addition-word .problemPop .problemPopContent h3 {
+  font-size: 0.34rem;
+  text-align: center;
+  padding-bottom: 0.2rem;
+}
+
+.exclusive-word .problemPop .problemPopContent ul,
+.addition-word .problemPop .problemPopContent ul {
+  padding: 0 0.4rem;
+}
+
+.exclusive-word .problemPop .problemPopContent ul li,
+.addition-word .problemPop .problemPopContent ul li {
+  margin-top: 0.16rem;
+}
+
+.exclusive-word .problemPop .problemPopContent ul li h4,
+.addition-word .problemPop .problemPopContent ul li h4 {
+  font-size: 0.3rem;
+  line-height: 1.5;
+  color: #1d1d1d;
+}
+
+.exclusive-word .problemPop .problemPopContent ul li p,
+.addition-word .problemPop .problemPopContent ul li p {
+  font-size: 0.28rem;
+  color: #868686;
+  line-height: 1.4;
+}
+
+.exclusive-word .problemPop .problemPopContent button,
+.addition-word .problemPop .problemPopContent button {
+  width: 100%;
+  background: #fff;
+  border-top: 1px solid #e0e0e0;
+  position: absolute;
+  bottom: 0;
+  height: 1rem;
+  font-size: 0.36rem;
+  color: #2cb7ca;
+}
+
+.custom-toast .weui-toast {
+  font-size: 0.3rem;
+  padding: 0.2rem;
+  width: auto;
+  max-width: 6rem;
+  min-height: 0;
+  height: auto;
+  top: 50%;
+  left: 50%;
+  margin-left: 0;
+  margin-top: -0.47rem;
+  transform: translateX(-50%) translateY(-50%);
+}
+
+.custom-toast .weui-icon_toast {
+  display: none;
+}
+
+.custom-toast .weui-toast__content {
+  margin: 0;
+}
+
+.weui-dialog .weui-dialog__ft .weui-dialog__btn_primary {
+  color: #2cb7ca;
+}
+
+.weui-dialog input {
+  caret-color: #2cb7ca;
+}

+ 165 - 18
src/web/staticres/vipsubscribe/css/keyWord.css

@@ -7,19 +7,56 @@
   overflow: hidden;
 }
 
-.keyWord .content {
+.keyWord .add-keyword-container,
+.keyWord .all-classify-column {
+  display: flex;
   flex: 1;
+  flex-direction: column;
+  justify-content: space-between;
   overflow-y: scroll;
 }
 
-.keyWord .title {
+.keyWord .add-keyword-container .classify {
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+  padding: 0 .3rem;
+  height: 0.94rem;
+  background-color: #fff;
+}
+
+.keyWord .add-keyword-container .classify .classify-l {
+  font-size: .32rem;
+  color: #1d1d1d;
+}
+
+.keyWord .add-keyword-container .classify .classify-r {
+  display: flex;
+  align-items: center;
+  justify-content: end;
+  height: 100%;
+  color: #888888;
+  font-size: .28rem;
+}
+
+.keyWord .add-keyword-container .classify .classify-r .icon-arrow {
+  margin-left: .1rem;
+  font-size: .26rem;
+}
+
+.keyWord .add-keyword-container .classify-tips {
+  padding: .1rem .3rem .3rem;
   font-size: .26rem;
   color: #888;
-  padding: .3rem;
   line-height: .38rem;
 }
 
-.keyWord .enter .enterOne {
+.keyWord .add-keyword-container .content {
+  flex: 1;
+  overflow-y: scroll;
+}
+
+.keyWord .add-keyword-container .content .enter .enterOne {
   min-height: 47px;
   width: 100%;
   padding: 0.3rem;
@@ -27,13 +64,13 @@
   background: #fff;
 }
 
-.keyWord .enter .btnChoose {
+.keyWord .add-keyword-container .content .enter .btnChoose {
   border-top: 1px solid #e0e0e0;
   overflow: hidden;
   background: #fff;
 }
 
-.keyWord .enter .btnChoose button {
+.keyWord .add-keyword-container .content .enter .btnChoose button {
   float: left;
   height: 0.6rem;
   font-size: .3rem;
@@ -43,15 +80,15 @@
   color: #1D1D1D;
 }
 
-.keyWord .enter .btnChoose button:first-child {
+.keyWord .add-keyword-container .content .enter .btnChoose button:first-child {
   border-right: 1px solid #e0e0e0;
 }
 
-.keyWord .enter .btn {
+.keyWord .add-keyword-container .content .enter .btn {
   margin-top: .16rem;
 }
 
-.keyWord .enter .btn button {
+.keyWord .add-keyword-container .content .enter .btn button {
   width: 100%;
   height: 0.94rem;
   background: #2cb7ca;
@@ -60,6 +97,54 @@
   opacity: .5;
 }
 
+.keyWord .add-keyword-container .title {
+  font-size: .26rem;
+  color: #888;
+  padding: .3rem;
+  line-height: .38rem;
+}
+
+.keyWord .all-classify-column {
+  border-top: 1px solid transparent;
+}
+
+.keyWord .all-classify-column .classify-list {
+  margin-top: .24rem;
+}
+
+.keyWord .all-classify-column .classify-list .classify-item {
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+  padding: 0 .3rem;
+  height: 1.1rem;
+  background-color: #fff;
+  border-bottom: 1px solid #CECECE;
+}
+
+.keyWord .all-classify-column .classify-list .classify-item:first-of-type {
+  border-top: 1px solid #CECECE;
+}
+
+.keyWord .all-classify-column .classify-list .classify-item .classify-item-l {
+  font-size: .32rem;
+  color: #1d1d1d;
+}
+
+.keyWord .all-classify-column .classify-list .classify-item .classify-item-r {
+  display: flex;
+  align-items: center;
+  justify-content: end;
+  height: 100%;
+  color: #888888;
+  font-size: .28rem;
+}
+
+.keyWord .all-classify-column .classify-list .classify-item .classify-item-r .icon-arrow {
+  margin-left: .2rem;
+  font-size: .26rem;
+}
+
 .keyWord .showKeyWord ul li {
   margin-bottom: .16rem;
   overflow: hidden;
@@ -178,17 +263,23 @@
 }
 
 .keyWord .addKeyWord {
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+  justify-content: center;
   width: 100%;
   text-align: center;
+  line-height: 1;
 }
 
 .keyWord .addKeyWord i {
-  margin-bottom: .4rem;
+  margin-bottom: .3rem;
   font-size: 1rem;
   color: #2cb7ca;
 }
 
 .keyWord .addKeyWord p {
+  width: 100%;
   height: .56rem;
   line-height: .56rem;
   background-color: #fff;
@@ -208,7 +299,7 @@
   margin-left: .06rem;
 }
 
-.keyWord .problemPop {
+.dialog-container {
   background: rgba(0, 0, 0, 0.5);
   position: fixed;
   width: 100%;
@@ -223,7 +314,7 @@
   justify-content: center;
 }
 
-.keyWord .problemPop .problemPopContent {
+.dialog-container .problemPopContent {
   width: 5.6rem;
   min-height: 7.23rem;
   display: inline-block;
@@ -233,33 +324,33 @@
   padding: 0.58rem 0;
 }
 
-.keyWord .problemPop .problemPopContent h3 {
+.dialog-container .problemPopContent h3 {
   font-size: .34rem;
   text-align: center;
   padding-bottom: 0.2rem;
 }
 
-.keyWord .problemPop .problemPopContent ul {
+.dialog-container .problemPopContent ul {
   padding: 0 .4rem;
 }
 
-.keyWord .problemPop .problemPopContent ul li {
+.dialog-container .problemPopContent ul li {
   margin-top: 0.16rem;
 }
 
-.keyWord .problemPop .problemPopContent ul li h4 {
+.dialog-container .problemPopContent ul li h4 {
   font-size: .3rem;
   line-height: 1.5;
   color: #1d1d1d;
 }
 
-.keyWord .problemPop .problemPopContent ul li p {
+.dialog-container .problemPopContent ul li p {
   font-size: .28rem;
   color: #868686;
   line-height: 1.4;
 }
 
-.keyWord .problemPop .problemPopContent button {
+.dialog-container .problemPopContent button {
   width: 100%;
   background: #fff;
   border-top: 1px solid #E0E0E0;
@@ -295,3 +386,59 @@
 .weui-dialog .weui-dialog__ft .weui-dialog__btn_primary {
   color: #2cb7ca;
 }
+
+.weui-dialog input {
+  caret-color: #2cb7ca;
+}
+
+.classify-edit-pop .weui-dialog .weui-dialog__hd,
+.classify-edit-pop .weui-dialog .weui-dialog__bd {
+  padding: 0;
+  text-align: left;
+  font-size: .34rem;
+}
+
+.classify-edit-pop .weui-dialog .weui-dialog__hd {
+  padding-left: .3rem;
+  height: .88rem;
+  line-height: .88rem;
+  background-color: #F4F4F9;
+}
+
+.classify-edit-pop .weui-dialog .weui-dialog__bd {
+  padding: .38rem .3rem;
+}
+
+.classify-edit-pop .weui-dialog .weui-dialog__bd .classify-keyword {
+  padding: 0 .17rem;
+  height: 0.8rem;
+  width: 100%;
+  font-size: .32rem;
+  border: 1px solid #CECECE;
+}
+
+.classify-edit-pop .weui-dialog .weui-dialog__ft {
+  margin-top: .1rem;
+  margin-bottom: .3rem;
+  justify-content: space-around;
+}
+
+.classify-edit-pop .weui-dialog .weui-dialog__ft .dialog__btn {
+  display: inline-block;
+  width: 1.72rem;
+  height: .72rem;
+  line-height: .72rem;
+  color: #fff;
+}
+
+.classify-edit-pop .weui-dialog .weui-dialog__ft .dialog__btn_confirm {
+  background-color: #2CB7CA;
+}
+
+.classify-edit-pop .weui-dialog .weui-dialog__ft .dialog__btn_cancel {
+  background-color: #BFBFC3;
+}
+
+.classify-edit-pop .weui-dialog .weui-dialog__ft:after {
+  border: none;
+}

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

@@ -394,8 +394,8 @@
   position: relative;
   top: -0.03rem;
   left: .05rem;
-  display: inline-block;
-  width: .8rem;
+  display: none;
+  /*width: .8rem;*/
   line-height: normal;
   font-size: 0.18rem;
   color: #fff;

二進制
src/web/staticres/vipsubscribe/image/matchType.png


+ 26 - 13
src/web/staticres/vipsubscribe/js/additionWord.js

@@ -11,18 +11,18 @@ $(function(){
         var showKeyWordLength = $(".showKeyWord ul").find('li').length;
         if(showKeyWordLength === 0){
             $(".addkeyWord").show();
-            $(".showKeyWord").hide();
         } else {
             $(".addkeyWord").hide();
-            $(".showKeyWord").show();
         }
     }
     hasWords()
     
     // 添加按钮
     $(".addKeyWord i").on('click',function(){
-        $(".addkeyWord").show();
-        $(".showKeyWord").hide();
+        $(".addkeyWord").show()
+        $(".addkeyWord input").focus()
+        $('.showKeyWord').find('.one').show()
+        $('.showKeyWord').find('.modify').hide()
     })
     // 输入框自适应高度
     $('textarea').each(function(i,dom){
@@ -79,10 +79,13 @@ $(function(){
 
     // 编辑
     $(".showKeyWord").on('click', '.editKeyWord',function(e){
+        $('.enter.addkeyWord').hide()
+        $('.addKeyWord').hide()
+
         let oSpan = $(this).parent().siblings().children('textarea');
         console.log($(oSpan).val())
         let val = $(oSpan).val()
-        $(this).parent().siblings().show().parent().siblings().children('.modify').hide().siblings('.one').show()
+        $(this).parent().siblings().show().parents('li').siblings().children('.modify').hide().siblings('.one').show()
         $(oSpan).val('').focus().val(val) 
         $(this).parent().hide()
         $(this).parent().siblings().css('display','block')
@@ -90,23 +93,33 @@ $(function(){
 
     // 编辑 删除
     $('.showKeyWord').on('click', '.deleteKey', function(e) {
-        $(this).parents('li').remove()
-        hasWords()
-        console.log('删除附加词:',$(this).parent().find('span').text())
+        var jQueryDOM = $(this).parents('li')
+        weui.confirm('确定要删除附加词?', {
+            buttons: [{
+                label: '取消',
+                type: 'default',
+                onClick: function () { console.log('不删了') }
+            }, {
+                label: '确定',
+                type: 'primary',
+                onClick: function () {
+                    jQueryDOM.remove()
+                    hasWords()
+                    $('.addKeyWord').show()
+                }
+            }]
+        });
     })
     // 编辑 确定
     $('.showKeyWord').on('click', '.ascertainKey', function(e) {
+        $('.addKeyWord').show()
         var keyWord = $(this).siblings('textarea').val()
         $(this).parent().siblings().find('.key').text(keyWord)
         $(this).parent().hide().siblings().show()
         console.log(keyWord)
     })
 
-    //去空格方法
-    String.prototype.trim = function(){
-        return this.replace(/(^\s*)|(\s*$)/g, ' ');
-     }
-     //防止键盘把当前输入框给挡住
+    //防止键盘把当前输入框给挡住
     $('input[type="text"],textarea').focus(function () {
         var target = this;
         setTimeout(function(){

+ 10 - 12
src/web/staticres/vipsubscribe/js/exclusiveWord.js

@@ -11,18 +11,18 @@ $(function(){
         var showKeyWordLength = $(".showKeyWord ul").find('li').length;
         if(showKeyWordLength === 0){
             $(".addkeyWord").show();
-            $(".showKeyWord").hide();
         } else {
             $(".addkeyWord").hide();
-            $(".showKeyWord").show();
         }
     }
     hasWords()
     
     // 添加按钮
     $(".addKeyWord i").on('click',function(){
-        $(".addkeyWord").show();
-        $(".showKeyWord").hide();
+        $(".addkeyWord").show()
+        $(".addkeyWord input").focus()
+        $('.showKeyWord').find('.one').show()
+        $('.showKeyWord').find('.modify').hide()
     })
 
     // 添加keyWords检查输入框内是否有文字,如果有才能点击添加按钮
@@ -89,13 +89,15 @@ $(function(){
     })
 
     // 编辑
-    $(".showKeyWord").on('click', '.editKeyWord',function(e){
+    $(".showKeyWord").on('click', '.editKeyWord', function(e){
+        $('.enter.addkeyWord').hide()
+        $('.addKeyWord').hide()
+
         let oSpan = $(this).parent().siblings().children('textarea');
         let val = $(oSpan).val()
         $(this).parent().hide()
-        $(this).parent().siblings().css('display','block')
+        $(this).parent().siblings().show().parents('li').siblings().children('.modify').hide().siblings('.one').show()
         $(oSpan).val('').focus().val(val) 
-        $('.addKeyWord').hide()
     })
 
     // 编辑 删除
@@ -135,11 +137,7 @@ $(function(){
         }
     })
 
-    //去空格方法
-    String.prototype.trim = function(){
-        return this.replace(/(^\s*)|(\s*$)/g, ' ');
-    }
-    //防止键盘把当前输入框给挡住
+    // 防止键盘把当前输入框给挡住
     $('input[type="text"],textarea').focus(function () {
         var target = this;
         setTimeout(function(){

+ 60 - 29
src/web/staticres/vipsubscribe/js/keyWord.js

@@ -1,8 +1,11 @@
 $(function () {
+    
+    //去空格方法
+    // String.prototype.trim = function () {
+    //     return this.replace(/(^\s*)|(\s*$)/g, ' ');
+    // }
 
-    $(".enterOne").focus(function () {
-        $(".btnChoose").show();
-    })
+    // 疑问解答相关操作
     $('.knowBtn').on('click', function () {
         $(".problemPop").hide()
     })
@@ -10,27 +13,22 @@ $(function () {
         $(".problemPop").css("display", 'flex');
     })
 
+    $(".enterOne").focus(function () {
+        $(".btnChoose").show();
+    })
+
+    hasWords()
     function hasWords() {
         var showKeyWordLength = $(".showKeyWord ul").find('li').length;
         if (showKeyWordLength === 0) {
             $(".addkeyWord").show();
-            $(".showKeyWord").hide();
         } else {
             $(".addkeyWord").hide();
-            $(".showKeyWord").show();
         }
     }
-    hasWords()
-
-    //添加按钮
-    $(".addKeyWord i").on('click', function () {
-        $(".addkeyWord").show();
-        $(".showKeyWord").hide();
-    })
 
     // 输入框自适应高度
     $('textarea').each(function(i,dom){
-        // console.log(i,dom)
         dom.style.height = dom.scrollHeight +'px';
     })
     $("textarea").on("input", function() {
@@ -38,10 +36,8 @@ $(function () {
         this.style.height = this.scrollHeight + "px";
     })
 
-
     // 添加keyWords检查输入框内是否有文字,如果有才能点击添加按钮
     $('.addkeyWord input.enterOne').on('input', function () {
-
         var buttonDOM = $(this).siblings()[1].children[0]
         if ($(this).val().length >= 1) {
             buttonDOM.style.opacity = 1
@@ -51,7 +47,8 @@ $(function () {
             buttonDOM.setAttribute("disabled", true)
         }
     })
-    // 添加 按钮的点击事件
+
+    // 添加 确认按钮的点击事件
     $('.addkeyWord .btn button').on('click', function () {
         var keyWord = $('.addkeyWord input.enterOne').val()
         var html = `<li>
@@ -59,13 +56,13 @@ $(function () {
                             <div>
                                 <span>
                                     <strong> 关键词:</strong>
-                                    <p class="key">${ keyWord}</p>
+                                    <p class="key">${keyWord}</p>
                                 </span>
                             </div>
                             <button class="editKeyWord"><i class="iconfont icon-xiugai"></i> 修改</button>
                         </div>
                         <div class="modify">
-                            <textarea  name=""  rows="1"  placeholder="" maxlength="20">${ keyWord}</textarea>
+                            <textarea  name=""  rows="1"  placeholder="" maxlength="20">${keyWord}</textarea>
                             <button class="addAdjunctWord">编辑 附加词</button>
                             <button class="addExclusion">添加 排除词</button>
                             <button class="deleteKey">删除</button>
@@ -73,18 +70,19 @@ $(function () {
                         </div>
                     </li>`
         $('.showKeyWord > ul').prepend(html)
-
-        // 隐藏
-        $(".addkeyWord").hide();
-        $('.showKeyWord').show();
+        // 添加完成隐藏输入框
+        $(".addkeyWord").hide()
+        // 还原状态
         $('.enter.addkeyWord > input').val('')
         var buttonDOM = $('.enter.addkeyWord .btn button')[0]
         buttonDOM.style.opacity = .5
         buttonDOM.setAttribute("disabled", true)
-
+        // 设置状态
+        setEmptyHistory()
     })
     // 编辑
     $(".showKeyWord").on('click', '.editKeyWord', function (e) {
+        $('.enter.addkeyWord').hide()
         let oSpan = $(this).parent().siblings().children('textarea');
         console.log($(oSpan).val())
         let val = $(oSpan).val()
@@ -131,11 +129,7 @@ $(function () {
             $('.addKeyWord').show()
         }
     })
-
-    //去空格方法
-    String.prototype.trim = function () {
-        return this.replace(/(^\s*)|(\s*$)/g, ' ');
-    }
+    
     //防止键盘把当前输入框给挡住
     $('input[type="text"],textarea').focus(function () {
         var target = this;
@@ -143,5 +137,42 @@ $(function () {
             target.scrollIntoViewIfNeeded();
         },400);
     });
-})
 
+
+    // 显示关键词分类弹框
+    $('.classify-r').on('click', 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()
+        var currentClassifyName = $(this).find('.classify-detail').text()
+        $('input.classify-keyword').val(currentClassifyName).focus()
+    })
+
+    // 关键词分类 - 确定按钮点击事件
+    $('.classify-edit-pop .dialog__btn_confirm').on('click', function() {
+        var s = $('input.classify-keyword').val()
+        // 去空格
+        s = s.trim()
+        if (s.length === 0) {
+            return
+        }
+        
+        $('.classify-r .classify-detail').text(s)
+        // 关闭弹框后要重置input内容
+        $('.classify-edit-pop').hide()
+        $('input.classify-keyword').val('')
+    })
+
+    // 关键词分类 - 取消按钮点击事件
+    $('.classify-edit-pop .dialog__btn_cancel').on('click', function() {
+        $('.classify-edit-pop').hide()
+        $('input.classify-keyword').val('')
+    })
+
+})

+ 103 - 0
src/web/templates/weixin/vipsubscribe/additionWord.html

@@ -0,0 +1,103 @@
+<!DOCTYPE html>
+<html lang="en">
+
+<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 http-equiv="X-UA-Compatible" content="ie=edge">
+    <title>附加词</title>
+    <script src="../js/rem.js"></script>
+    <link rel="stylesheet" href="../css/base.css">
+    <link rel="stylesheet" href="../iconfont/iconfont.css">
+    <link rel="stylesheet" href="../css/weui.min.css">
+    <link rel="stylesheet" href="../css/addition_exclusive_word.css">
+</head>
+
+<body>
+
+    <div class="addition-word">
+        <section class="content">
+            <p class="title">示例:开发(附加词)</p>
+            <!-- 添加附加词 -->
+            <div class="enter addkeyWord">
+                <input type="text" class="enterOne" placeholder="请输入附加词" />
+                <div class="btn">
+                    <button disabled>确认</button>
+                </div>
+            </div>
+
+            <!-- 添加附加词显示列表 -->
+            <div class="showKeyWord">
+                <ul>
+                    <li>
+                        <div class="one">
+                            <div>
+                                <span>
+                                    <p class="key">abcde</p>
+                                </span>
+                            </div>
+                            <button class="editKeyWord"><i class="iconfont icon-xiugai"></i> 修改</button>
+                        </div>
+                        <div class="modify">
+                            <textarea  name=""  rows="1"  placeholder="" >abcde</textarea>
+                            <!-- <span contentEditable="true" id="option1">abcde</span> -->
+                            <button class="deleteKey">删除</button>
+                            <button class="ascertainKey">确定</button>
+                        </div>
+                    </li>
+                    <li>
+                        <div class="one">
+                            <div>
+                                <span>
+                                    <p class="key">abcde</p>
+                                </span>
+                            </div>
+                            <button class="editKeyWord"><i class="iconfont icon-xiugai"></i> 修改</button>
+                        </div>
+                        <div class="modify">
+                            <textarea  name=""  rows="1"  placeholder="" maxlength="20" >abcde</textarea>
+                            <button class="deleteKey">删除</button>
+                            <button class="ascertainKey">确定</button>
+                        </div>
+                    </li>
+                </ul>
+            </div>
+            <div class="problem">
+                疑问解答 <i class="iconfont icon-wenhao"></i>
+            </div> 
+        </section>
+        <div class="addKeyWord">
+            <i class="iconfont icon-tianjia"></i>
+        </div>
+        <!-- 疑难问题弹窗 -->
+        <div class="problemPop">
+            <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>
+    <script src="../js/jquery-2.1.4.js"></script>
+    <script src="../js/weui.min.js"></script>
+    <script src="../js/additionWord.js"></script>
+</body>
+
+</html>

+ 101 - 0
src/web/templates/weixin/vipsubscribe/exclusiveWord.html

@@ -0,0 +1,101 @@
+<!DOCTYPE html>
+<html lang="en">
+
+<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 http-equiv="X-UA-Compatible" content="ie=edge">
+    <title>排除词</title>
+    <script src="../js/rem.js"></script>
+    <link rel="stylesheet" href="../css/base.css">
+    <link rel="stylesheet" href="../iconfont/iconfont.css">
+    <link rel="stylesheet" href="../css/weui.min.css">
+    <link rel="stylesheet" href="../css/addition_exclusive_word.css">
+</head>
+
+<body>
+
+    <div class="exclusive-word">
+        <section class="content">
+            <p class="title">示例:运维(排除词)</p>
+            <!-- 添加排除词 -->
+            <div class="enter addkeyWord">
+                <input type="text" class="enterOne" placeholder="请输入排除词" />
+                <div class="btn">
+                    <button disabled>确认</button>
+                </div>
+            </div>
+            <!-- 添加排除词显示列表 -->
+            <div class="showKeyWord">
+                <ul>
+                    <li>
+                        <div class="one">
+                            <div>
+                                <span>
+                                    <p class="key">abcde</p>
+                                </span>
+                            </div>
+                            <button class="editKeyWord"><i class="iconfont icon-xiugai"></i> 修改</button>
+                        </div>
+                        <div class="modify">
+                            <textarea  name=""  rows="1"  placeholder="" >abcde</textarea>
+                            <button class="deleteKey">删除</button>
+                            <button class="ascertainKey">确定</button>
+                        </div>
+                    </li>
+                    <li>
+                        <div class="one">
+                            <div>
+                                <span>
+                                    <p class="key">abcde</p>
+                                </span>
+                            </div>
+                            <button class="editKeyWord"><i class="iconfont icon-xiugai"></i> 修改</button>
+                        </div>
+                        <div class="modify">
+                            <textarea  name=""  rows="1"  placeholder="" >abcde</textarea>
+                            <button class="deleteKey">删除</button>
+                            <button class="ascertainKey">确定</button>
+                        </div>
+                    </li>
+                </ul>
+            </div>
+            <div class="problem">
+                疑问解答 <i class="iconfont icon-wenhao"></i>
+            </div>
+        </section>
+        <div class="addKeyWord">
+            <i class="iconfont icon-tianjia"></i>
+        </div>
+        <!-- 疑难问题弹窗 -->
+        <div class="problemPop">
+            <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>
+    <script src="../js/jquery-2.1.4.js"></script>
+    <script src="../js/weui.min.js"></script>
+    <script src="../js/exclusiveWord.js"></script>
+</body>
+
+</html>

+ 231 - 94
src/web/templates/weixin/vipsubscribe/keyWord.html

@@ -1,16 +1,17 @@
 <!DOCTYPE html>
-<html lang="en">
+<html lang="zh-CN">
 
 <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="/vipsubscribe/js/rem.js?v={{Msg "seo" "version"}}"></script>
-    <link rel="stylesheet" href="/vipsubscribe/css/base.css?v={{Msg "seo" "version"}}">
-    <link rel="stylesheet" href="/vipsubscribe/iconfont/iconfont.css?v={{Msg "seo" "version"}}">
-    <link rel="stylesheet" href="/vipsubscribe/css/weui.min.css?v={{Msg "seo" "version"}}">
-    <link rel="stylesheet" href="/vipsubscribe/css/keyWord.css?v={{Msg "seo" "version"}}">
+    <script src="/vipsubscribe/js/rem.js"></script>
+    <link rel="stylesheet" href="/vipsubscribe/css/base.css">
+    <link rel="stylesheet" href="/vipsubscribe/iconfont/iconfont.css">
+    <link rel="stylesheet" href="/vipsubscribe/css/weui.min.css">
+    <link rel="stylesheet" href="/vipsubscribe/css/keyWord.css">
     <style>
         .ios-user-select {
             -webkit-user-select: text;
@@ -19,98 +20,58 @@
 </head>
 
 <body>
-
     <div class="keyWord">
-        <section class="content">
-            <p class="title">示例:软件系统(关键词); 开发(附加词); 运维(排除词)</p>
-            <!-- 添加关键词 -->
-            <div class="enter addkeyWord">
-                <input type="text" class="enterOne" placeholder="请输入关键词" maxlength="100"/>
-                <!-- <textarea style="resize:none;" rows="1"  class="enterOne" name="" id=""  placeholder="请输入关键词" maxlength="100"></textarea> -->
-                <div class="btnChoose" style="display:none;">
-                    <button onclick="window.location.href='additionWord.html'">添加 附加词</button>
-                    <button onclick="window.location.href='exclusiveWord.html'">添加 排除词</button>
-                </div>
-                <div class="btn">
-                    <button disabled>确认</button>
+        <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>
             </div>
+            <section class="content">
+                <!-- 添加关键词 -->
+                <div class="enter addkeyWord" style="display: none;">
+                    <input type="text" class="enterOne" placeholder="请输入关键词" maxlength="100" />
+                    <!-- <textarea style="resize:none;" rows="1"  class="enterOne" name="" id=""  placeholder="请输入关键词" maxlength="100"></textarea> -->
+                    <div class="btnChoose" style="display:none;">
+                        <button onclick="window.location.href='/front/vipsubscribe/toSetadditionPage'">添加 附加词</button>
+                        <button onclick="window.location.href='/front/vipsubscribe/toSetexclusivePage'">添加 排除词</button>
+                    </div>
+                    <div class="btn">
+                        <button disabled>确认</button>
+                    </div>
+                </div>
 
-            <!-- 添加排除词 -->
-            <!-- <div class="enter exclusion" style="display:none;">
-            <input type="text" placeholder="请输入排除词" class="enterOne">
-            <div class="btn">
-                <button disabled>确认</button>
-            </div>
-        </div> -->
-
-
-            <!-- 添加关键词显示列表 -->
-            <div class="showKeyWord">
-                <ul>
-                    <li>
-                        <div class="one">
-                            <div>
-                                <span>
-                                    <strong> 关键词:</strong>
-                                    <p class="key">信息化</p>
-                                </span>
-                            </div>
-                            <button class="editKeyWord"><i class="iconfont icon-xiugai"></i> 修改</button>
-                        </div>
-                        <div class="modify">
-                            <textarea  name=""  rows="1"  placeholder="" maxlength="20" >信息化</textarea>
-                            <button class="addAdjunctWord">编辑 附加词</button>
-                            <button class="addExclusion">添加 排除词</button>
-                            <button class="deleteKey">删除</button>
-                            <button class="ascertainKey">确定</button>
-                        </div>
-                    </li>
-
-                    <li>
-                        <div class="one">
-                            <div>
-                                <span>
-                                    <strong> 关键词:</strong>
-                                    <p class="key">信息化二</p>
-                                </span>
-                                <span>
-                                    <strong> 附加词:</strong>
-                                    <p class="addition">工程 招标项目 科技产品 农业 电子产品</p>
-                                </span>
-                                <span>
-                                    <strong> 排除词:</strong>
-                                    <p class="exclusion">办公 教育</p>
-                                </span>
-                            </div>
-                            <button class="editKeyWord"><i class="iconfont icon-xiugai"></i> 修改</button>
-                        </div>
-                        <div class="modify">
-                            <textarea  name=""  rows="1"  placeholder="" maxlength="20" >信息化二</textarea>
-                            <button class="addAdjunctWord">编辑 附加词</button>
-                            <button class="addExclusion ">添加 排除词</button>
-                            <button class="deleteKey">删除</button>
-                            <button class="ascertainKey">确定</button>
-                        </div>
-                    </li>
-                </ul>
-
-            </div>
-
-
-
-            <div class="problem">
-                疑问解答 <i class="iconfont icon-wenhao"></i>
-            </div>
+                <!-- 添加关键词显示列表 -->
+                <div class="showKeyWord">
+                    <ul>
+                    </ul>
+                </div>
 
-            
+                <div class="problem">
+                    疑问解答 <i class="iconfont icon-wenhao"></i>
+                </div>
+            </section>
+        </section>
+        <section class="all-classify-column" style="display: none;">
+            <ul class="classify-list">
+                
+            </ul>
         </section>
-        <div class="addKeyWord">
-            <div style=""><i class="iconfont icon-tianjia"></i></div>
-            <p> 关键词添加数量:<em style="color: #2cb7ca;">2 </em>/ 300</p>
+
+        <div class="addKeyWord addNewKeyword" style="display: none;">
+            <i class="iconfont icon-tianjia"></i>
+            <p> 关键词添加数量:<em style="color: #2cb7ca;" class="kwscount">0 </em>/ 300</p>
         </div>
+
         <!-- 疑难问题弹窗 -->
-        <div class="problemPop">
+        <div class="problemPop dialog-container">
             <div class="problemPopContent">
                 <h3>疑问解答</h3>
                 <ul>
@@ -133,10 +94,186 @@
                 <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" placeholder="输入分类名称">
+                </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="/vipsubscribe/js/zepto.js?v={{Msg "seo" "version"}}"></script>
-    <script src="/vipsubscribe/js/weui.min.js?v={{Msg "seo" "version"}}"></script>
-    <script src="/vipsubscribe/js/keyWord.js?v={{Msg "seo" "version"}}"></script>
+    
+    
+    <script src="/js/jquery-3.2.1.min.js?v=1412"></script>
+    <script src="/vipsubscribe/js/weui.min.js"></script>
+    <script>
+        var a_items = [];
+        var o_selected = {};
+        // 页面状态
+        var pageState = {
+            //是否第一次设置关键词
+            isFirstSetKeyword: true
+        }
+        $(function(){
+            init();
+        })
+        //获取数据
+        function init(){
+            //获取用户设置信息类型
+            $.post("/subscribepay/afterPay/getUserInfo",{},function(r){
+                if(r.userData){
+                    var _userData = r.userData;
+                    var _vipData = _userData["o_vipjy"];
+                    a_items = _vipData["a_items"]
+                        console.log(a_items)
+                        console.log(a_items.length)
+                    if (a_items!=undefined&&a_items.length>0){
+                        pageState.isFirstSetKeyword = false;
+                        appendHtml(a_items);
+                    }else{
+                        pageState.isFirstSetKeyword = true;
+                    }
+                }else{
+                    pageState.isFirstSetKeyword = true;
+                }
+                showKorshowC(pageState.isFirstSetKeyword);
+            })
+        }
+
+        //关键词和分类列表切换
+        function showKorshowC(state){
+            if (state) {
+                $('.add-keyword-container').show()
+                $('.all-classify-column').hide()
+            } else {
+                $('.add-keyword-container').hide()
+                $('.all-classify-column').show()
+            }
+            $(".addNewKeyword").show();
+        }
+        //分类列表
+        function appendHtml(kwsdata){
+            var classifyHtml = '';
+            var kwscount = 0;
+            for (var i = 0;  i < kwsdata.length; i++) {
+                console.log( kwsdata[i])
+                var s_item = kwsdata[i]["s_item"]
+                var a_key = kwsdata[i]["a_key"]
+                o_selected[s_item]=a_key
+                kwscount += a_key.length;
+                console.log("a_key:"+a_key.length)
+                classifyHtml +='<li class="classify-item">'
+                            +'<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>'
+                            +'</li>'
+
+            }
+            if(classifyHtml!=""){
+                $(".classify-list").html(classifyHtml);
+            }
+            $(".kwscount").text(kwscount);
+        }
+        //修改关键词内容
+        function toSetKws(_key){
+            // $(".content .addkeyWord").hide();
+            console.log(o_selected[_key])
+            $(".classify-detail").text(_key);
+            var kwsHtml = '';
+            var _keyArr = o_selected[_key];
+            for(var i=0;i<_keyArr.length;i++){
+                console.log(_keyArr[i])
+                kwsHtml +='<li>'
+                            +'<div class="one" style="">'
+                            +'<div><span><strong> 关键词:</strong>'
+                            +'<p class="key">'+_keyArr[i]["key"]+'</p></span></div>'
+                            +'<button class="editKeyWord"><i class="iconfont icon-xiugai"></i> 修改</button>'
+                            +'</div>'
+                            +'<div class="modify" style="display: none;">'
+                            +'<textarea name="" rows="1" placeholder="" maxlength="20">eee</textarea>'
+                            +'<button class="addAdjunctWord">编辑 附加词</button>'
+                            +'<button class="addExclusion">添加 排除词</button>'
+                            +'<button class="deleteKey">删除</button>'
+                            +'<button class="ascertainKey">确定</button>'
+                            +'</div>'
+                            +'</li>'
+            }
+            // 发送请求刷新数据,在ajax回调中执行
+            $('.add-keyword-container').show()
+            $('.all-classify-column').hide()
+        }
+    </script>
+    <script src="/vipsubscribe/js/keyWord.js"></script>
+    <script>
+        // 设置一条空记录,用户第一次进入添加关键词点击确定时候调用
+        function setEmptyHistory() {
+            if (pageState.isFirstSetKeyword) {
+                history.pushState({}, "","")
+                pageState.isFirstSetKeyword = false
+            }
+        }
+        //
+        $(function(){
+            // 通过判断是那个隐藏来判断是添加关键词还是添加新分类
+            $(".addNewKeyword i").on('click', function () {
+                // 如果是在分类列表点击添加(此时关键词列表是隐藏的)
+                // isClassifyColumnShow = true说明是添加新分类
+                var isClassifyColumnShow = $('.add-keyword-container').is(':hidden')
+                if (isClassifyColumnShow) {
+                    history.pushState({}, "","")
+                    // 还原有数据
+                    $('.classify .classify-detail').text('未分类')
+                    $('.add-keyword-container .showKeyWord ul').html('')
+                    
+                }
+                $('.add-keyword-container').show()
+                $('.all-classify-column').hide()
+                
+                // 显示添加关键词的输入框
+                $(".enter.addkeyWord").show()
+                $('.enterOne').focus()
+            })
+
+            // 点击分类目录的每一项,进入对应列表
+            $('.classify-list').on('click', '.classify-item-r', function() {
+                // 添加一条空历史记录
+                history.pushState({}, "","");
+                var classifyName = $(this).parent().find('.classify-item-l').text()
+                //展示此关键词信息
+                toSetKws(classifyName);
+            })
+        })
+        window.addEventListener('popstate', function(event){
+
+            var loading = weui.loading('loading...', {
+                className: 'custom-classname'
+            })
+            // 用定时器模拟请求耗时
+            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)
+        })
+    </script>
 </body>
 
 </html>

+ 272 - 0
src/web/templates/weixin/vipsubscribe/messageType.html

@@ -0,0 +1,272 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="UTF-8">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
+    <meta http-equiv="X-UA-Compatible" content="ie=edge">
+    <title>信息类型</title>
+    <link rel="stylesheet" href="/vipsubscribe/css/base.css">
+    <link rel="stylesheet" href="/vipsubscribe/iconfont/iconfont.css">
+    <link rel="stylesheet" href="/vipsubscribe/css/messageType.css">
+    <link rel="stylesheet" href="/css/common.css">
+    <script src="/vipsubscribe/js/rem.js"></script>
+    <style type="text/css">
+        body .industry .resetOne{
+            position: fixed;
+            bottom: 0px;
+        }
+        body .industry{
+            margin-bottom: 1rem;
+            height: auto;
+        }
+        body #nijianTip{
+            display: none;
+        }
+    </style>
+</head>
+<body>
+
+    <div class="easypopup" id="nijianTip">
+        <div class="easypopup-alert">
+            <div class="easypopup-content">
+                “拟建项目”是指那些处于前期立项、审批阶段的项目。供应商应在立项阶段掌握项目信息,做到早介入,稳拿单。
+            </div>
+            <div class="easypopup-footer">
+                <span onclick="njTipEasyPopup.hide();">我知道了</span>
+            </div>
+        </div>
+    </div>
+    <div class="industry">
+        <div class="all"><span>全部</span> </div>
+        <div class="list">
+            <ul>
+                <li>
+                    <dl>
+                        <dt class="question" dataValue="拟建">拟建项目</dt><i class="iconfont icon-wenhao "></i>
+                    </dl>
+                </li>
+                <li>
+                    <dl>
+                        <dt dataValue="预告">招标预告</dt>
+                    </dl>
+                </li>
+                <li>
+                    <dl>
+                        <dt  dataValue="招标">招标公告</dt>
+                        <dd>招标</dd>
+                        <dd>邀标</dd>
+                        <dd>询价</dd>
+                        <dd>竞谈</dd>
+                        <dd>单一</dd>
+                        <dd>竞价</dd>
+                        <dd>变更</dd>
+                    </dl>
+                </li>
+                <li>
+                    <dl>
+                        <dt dataValue="结果">招标结果</dt>
+                        <dd>中标</dd>
+                        <dd>成交</dd>
+                        <dd>废标</dd>
+                        <dd>流标</dd>
+                    </dl>
+                </li>
+                <li>
+                    <dl>
+                        <dt style="width:2rem;" dataValue="其它">招标信用信息</dt>
+                        <dd>合同</dd>
+                        <dd>验收</dd>
+                        <dd>违规</dd>
+                        <dd>其它</dd>
+                    </dl>
+                </li>
+            </ul>
+        </div>
+        
+        <div class="resetOne">
+            <button class="reset">重置</button>
+            <button class="sure">确认</button>
+        </div>
+
+    </div>
+    <script src="/js/jquery-3.2.1.min.js?v=1412"></script>
+    <script src="/js/common.js"></script>
+    <script>           
+        function hasActive(){
+            var arr = "";
+            $(".list ul li dl dd").each(function(index){
+                if($(this).hasClass('active')){
+                    arr = arr + "," + $(this).text()
+                }
+            })
+            $(".list ul li dl dt").each(function(index){
+                if($(this).hasClass('active')&&($(this).text()=="招标预告"||$(this).text()=="拟建项目")){
+                    arr = arr + "," + $(this).attr("dataValue")
+                }
+            })
+            return arr.substr(1)
+        }
+        //
+        function inputHtml(infoTypeData){
+            for (var i = infoTypeData.length - 1; i >= 0; i--) {
+                $(".list ul li dl dd").each(function(index){
+                    if($(this).text()==infoTypeData[i]){
+                        $(this).addClass("active");
+                        isDtSelected (this);
+                        isAllSelected ();
+                        $('.all span').removeClass('active');
+                    }
+                })
+                $(".list ul li dl dt").each(function(index){
+                    if($(this).attr("dataValue")==infoTypeData[i]){
+                        $(this).addClass("active");
+                        $(this).parent().find('dd').addClass('active');
+                        isAllSelected ();
+                        $('.all span').removeClass('active');
+                    }
+                })
+            }
+        }
+        //
+        isLockButton (false);
+        // 传入false为锁定确认按钮
+        function isLockButton (flag) {
+            var button = $('.reset').siblings()[0]
+            if (flag) {
+                // true,解锁button
+                $(button).css({ opacity: 1}).removeAttr('disabled')
+            } else {
+                // false, 锁定button
+                $(button).css({ opacity: 0.5 }).attr('disabled', true)
+            }
+        }
+        //
+        var njTipEasyPopup = null;
+        //是否 修改
+        $(function(){
+            //获取用户设置信息类型
+             $.post("/subscribepay/afterPay/getUserInfo",{},function(r){
+                 if(r.userData){
+                    var _userData = r.userData;
+                    var _vipData = _userData["o_vipjy"];
+                    var a_infotype = _vipData["a_infotype"]
+                    if (a_infotype!=undefined&&a_infotype.split("、").length>0){
+                        inputHtml(a_infotype.split("、"));
+                        isLockButton (true);
+                    }else{
+                        $('.all span').addClass('active');
+                    }
+                }else{
+                    $('.all span').addClass('active');
+                }
+            })
+            //
+            $(".sure").on("click",function(){
+                //获取用户设置信息类型
+                var _infoType =   hasActive();
+                $.post("/subscribepay/afterPay/setUserInfo",{pageType:"infoType",infoTypeArr:_infoType},function(r){
+                     if(r.flag){
+                        console.log("保存成功")
+                        window.history.go(-1);
+                    }
+                 })
+            })
+            //
+            njTipEasyPopup = new EasyPopup("nijianTip");
+            $(".icon-wenhao").on("click",function(){
+                njTipEasyPopup.show();
+            })
+            $('.all span').on('click',function(e){
+                if (!$(this).hasClass('active')) {
+                    isLockButton (true);
+                    $(this).addClass('active')
+                    $('.list ul li dl dt').removeClass('active')
+                    $('.list ul li dl dd').removeClass('active')
+                }
+            })
+            $(".list ul li dl dt").on("click", function(){
+                isLockButton (true);
+                if($(this).hasClass('active')){
+                    $(this).parent().find('dd').removeClass('active');
+                    $(this).removeClass('active');
+                }else{
+                    $(this).parent().find('dd').addClass('active');
+                    $(this).addClass('active');
+                    $('.all span').removeClass('active')
+                }
+                isAllSelected ()
+            })
+            $(".list ul li dl dd").on('click',function(){
+                isLockButton (true);
+                // 点击切换是否被选中
+                if($(this).hasClass('active')){
+                    $(this).removeClass('active');
+                }else{
+                    $(this).addClass('active');
+                    $('.all span').removeClass('active')
+                }
+
+                // 决定dt是否被选中
+                isDtSelected (this)
+                isAllSelected ()
+            })
+
+            $('.reset').on('click',function(){
+                isLockButton (true);
+                $('.all span').addClass('active')
+                $('.list ul li dl dt').removeClass('active')
+                $('.list ul li dl dd').removeClass('active')
+            })
+        })
+
+        // 判断dd是否被全部选中  -----> 操作二级标题
+        function isDtSelected (_this) {
+            // 如果全部dd选中 dt就选中,dd有一个没选中 dt就不选中
+            var _f = false
+            $(_this).parent().find('dd').each(function(index,dom){
+                // 如果有一个dd被选中,就设置标记为true
+                if (!$(dom).hasClass('active')) {
+                    _f = true
+                    return false
+                } else {
+                    _f = false
+                }
+            })
+            // 如果循环结束仍为false说明 dd全部被选中
+            if (_f) {
+                $(_this).parent().find('dt').removeClass('active')
+            } else {
+                $(_this).parent().find('dt').addClass('active')
+            }
+        }
+
+
+
+        // 判断dd是否被全部选中  ----> 操作.all全部按钮
+        function isAllSelected () {
+            // 所有dd不选中.all就选中
+            var _f = true
+            $('.list ul li dd').each(function(index,dom){
+                // 如果有所有dd被选中,就设置标记为true
+                // 也就是说,有一个dd没被选中,就设置标记为false
+                if (!$(dom).hasClass('active')) {
+                    _f = false
+                } 
+            })
+            $('.list ul li dt').each(function(index,dom){
+                // 如果有所有dd被选中,就设置标记为true
+                // 也就是说,有一个dd没被选中,就设置标记为false
+                if (!$(dom).hasClass('active')) {
+                    _f = false
+                } 
+            })
+            // 如果循环结束仍为true说明 dd没有全部都被选中
+            if (_f) {
+                $('.all span').addClass('active')
+                $('.list ul li dl dt').removeClass('active')
+                $('.list ul li dl dd').removeClass('active')
+            }
+        }
+    </script>
+</body>
+</html>

+ 53 - 14
src/web/templates/weixin/vipsubscribe/tmp/vip_index.html → src/web/templates/weixin/vipsubscribe/vip_index.html

@@ -3,8 +3,7 @@
 
 <head>
     <meta charset="UTF-8">
-    <meta name="viewport"
-        content="width=device-width,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover">
+    <meta name="viewport" content="width=device-width,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover">
     <meta name="apple-mobile-web-app-status-bar-style" content="#34355A" />
     <meta name="theme-color" content="#34355A">
     <meta http-equiv="X-UA-Compatible" content="ie=edge">
@@ -21,7 +20,7 @@
 
 <body>
     <div class="vip_index">
-        <div class="header">
+        <div class="header" style="display: none;">
             <img class="header_left" src="/vipsubscribe/image/left.png?v={{Msg "seo" "version"}}" alt="" onclick="javascript:history.back(-1);">
             <h3 class="header_title">VIP订阅</h3>
             <span class="header_right"></span>
@@ -42,21 +41,21 @@
                 <div class="s_info_top">
                     <p class="s_i_item">
                         <label>已购买区域:</label>
-                        <span>河南省、郑州市、洛阳市、淮南市、河南省、郑州市、洛阳市、淮南市、洛阳市</span>
+                        <span class="_area"></span>
                     </p>
                     <p class="s_i_item">
                         <label>已购买行业:</label>
-                        <span>保监、城管</span>
+                        <span class="_buyerClass"></span>
                     </p>
                     <p class="s_i_item">
                         <label>订阅周期:</label>
-                        <span>3个月</span>
+                        <span class="_cycleCount"></span>
                     </p>
                     <p class="s_i_item">
                         <label>有效日期:</label>
-                        <span>2019.07.31 - 2019.10.31</span>
+                        <span class="_activeDate"></span>
                     </p>
-                    <div class="to_expired">
+                    <div class="to_expired" style="display: none;">
                         <div class="e_circle">即将到期</div>
                     </div>
                 </div>
@@ -73,8 +72,8 @@
                             <img src="/vipsubscribe/image/keyword.png?v={{Msg "seo" "version"}}" alt="">
                             <span>关键词</span>
                         </div>
-                        <a href="keyWord.html" class="media_right">
-                            安保、监察、监管、安保、监察、安保、监察、监管、安保、监察
+                        <a href="/front/vipsubscribe/toSetKeyWordPage" class="media_right">
+                            
                         </a>
                     </div>
                     <div class="media_list">
@@ -82,14 +81,14 @@
                             <img src="/vipsubscribe/image/type.png?v={{Msg "seo" "version"}}" alt="">
                             <span>信息类型</span>
                         </div>
-                        <a href="messageType.html" class="media_right">全部类型</a>
+                        <a href="/front/vipsubscribe/toSetInfoTypePage" class="media_right" id="infoType"></a>
                     </div>
                     <div class="media_list">
                         <div class="media_left">
                             <img src="/vipsubscribe/image/set.png?v={{Msg "seo" "version"}}" alt="">
                             <span>推送设置</span>
                         </div>
-                        <a href="#" class="media_right">实时推送</a>
+                        <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_left">
@@ -116,10 +115,10 @@
         </div>
         <div class="footer">
             <!-- 续费提醒 -->
-            <div class="renew_toast">
+            <div class="renew_toast" style="display: none;">
                 <div>
                     <i class="icon iconfont" id="close_renew">&#xe61a;</i>
-                    <span>VIP订阅服务还有 3 天到期,请及时续费!</span>
+                    <span>VIP订阅服务还有 <span class="renew_day"></span> 天到期,请及时续费!</span>
                     <a href="vip_renew.html">去续费</a>
                 </div>
             </div>
@@ -147,6 +146,46 @@
     <script src="/vipsubscribe/js/weui.min.js?v={{Msg "seo" "version"}}"></script>
     <script>
         $(function () {
+            //获取用户信息
+           $.post("/subscribepay/afterPay/getUserInfo",{},function(r){
+                if(r.userData){
+                   var _userData = r.userData;
+                   var _vipData = _userData["o_vipjy"];
+                   var _vipstatus = _userData["i_vip_status"];
+                   console.log(_userData)
+                   if(_vipstatus&&_vipstatus=="1"){
+                        $('.free7days_pic').append("<style>.free7days_pic::after{display:inline-block}</style>");
+                   }else{
+                        $('.free7days_pic').append("<style>.free7days_pic::after{display:none}</style>");
+                   }
+                   if(_vipData){
+                        $("._area").text(_vipData["o_area"]);
+                        $("._buyerClass").text(_vipData["a_buyerclass"]);
+                        $("._cycleCount").text(_vipData["cycle"]);
+                        $("._activeDate").text(_userData["l_vip_starttime"]+" - "+_userData["l_vip_endtime"]);
+                        if(parseInt(_vipData["expRemind"])>0){
+                            $(".to_expired").show();
+                            $(".renew_day").text(parseInt(_vipData["expRemind"]))
+                            $(".renew_toast").show();
+                        }else{
+                            $(".to_expired").hide();
+                        }
+                        if(_vipData["a_infotype"]==""){
+                            _vipData["a_infotype"]="全部类型"
+                        }
+                        $("#infoType").text(_vipData["a_infotype"]);
+                        var pushText = "实时推送"
+                        if(_vipData["i_ratemode"]=="4"){
+                            pushText = "每月推送"
+                        }else if(_vipData["i_ratemode"]=="3"){
+                            pushText = "每周推送"
+                        }else if(_vipData["i_ratemode"]=="2"){
+                            pushText = "每日推送"
+                        }
+                        $("#pushSet").text(pushText);
+                   }
+                }
+           })
             let isChecked = true; //默认是否开通自动续费
             if (isChecked === true) {
                 $('.switch').addClass('checked')

+ 333 - 0
src/web/templates/weixin/vipsubscribe/vip_seniorset.html

@@ -0,0 +1,333 @@
+<html>
+<head>
+	<title>招标订阅</title>
+	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
+	<link href="{{Msg "seo" "cdn"}}/mobiscroll/mobiscroll.min.css" rel="stylesheet">
+	<link href="{{Msg "seo" "cdn"}}/css/common.css?v={{Msg "seo" "version"}}" rel="stylesheet">
+	<link href="{{Msg "seo" "cdn"}}/css/wxkeyset.css?v={{Msg "seo" "version"}}" rel="stylesheet">
+	{{include "/common/weixin.html"}}
+	<script src="{{Msg "seo" "cdn"}}/js/jquery.js"></script>
+	<script src="{{Msg "seo" "cdn"}}/wxswordfish/share.js?v={{Msg "seo" "version"}}"></script>
+	<script src="{{Msg "seo" "cdn"}}/js/fastclick.js?v={{Msg "seo" "version"}}"></script>
+	<script src="{{Msg "seo" "cdn"}}/js/common.js?v={{Msg "seo" "version"}}"></script>
+	<script src="{{Msg "seo" "cdn"}}/mobiscroll/mobiscroll.min.js"></script>
+	<script src="{{Msg "seo" "cdn"}}/js/rem.js"></script>
+
+	<style>
+		#pushway ul>li:nth-child(n+2) {
+			/*padding: 8px 0px;*/
+		}
+		#matchType ul>li:nth-child(n+2) {
+			line-height: normal;
+			padding: 14px 0px;
+			color: #1d1d1d;
+		}
+		#matchType ul>li:nth-child(2) {
+			padding-top: 16px;
+			line-height: 55px;
+		}
+		#matchType ul>li>span {
+			display: block;
+			margin-top: 6px;
+			font-size: 14px;
+			color: #686868;
+		}
+	</style>
+	<script>
+		// initShare({{.T.signature}},{{.T.openid}},2,"jy_extend",{{.T.nickname}},{{.T.avatar}});
+		var s_email = "";
+		// var haskeyword = {{.T.haskeyword}};
+		var keepOneTipWayMsg = "请保留一种推送方式,<br>剑鱼标讯还要推送信息给您";
+		var emailSetModal = null;
+		var clickDelayed = false;
+		setTimeout(function(){
+			clickDelayed = true;
+		},500);
+		$(function(){
+			new FastClick(document.body);
+			emailSetModal = new EasyPopup("emailSetModal");
+			$(window).bind("pageshow", function(event){
+				if(event.originalEvent.persisted){
+					window.location.reload(true);
+				}
+			});
+			//获取用户设置信息类型
+             $.post("/subscribepay/afterPay/getUserInfo",{},function(r){
+                 if(r.userData){
+                    var _userData = r.userData;
+                    var _vipData = _userData["o_vipjy"];
+                    var i_ratemode = _vipData["i_ratemode"]
+                    if (i_ratemode!=undefined){
+                        $("#pushfrequency li").eq(parseInt(i_ratemode)).addClass("checked");
+                    }else{
+                         $("#pushfrequency li").eq(1).addClass("checked");
+                    }
+                    var i_wxpush = _vipData["i_wxpush"]
+                    if (i_wxpush!=undefined&&i_wxpush=="1"){
+						$("#wxtip").addClass("on");
+                     	$("#wxtip .turn-on").show();
+                     	$("#wxtip .turn-off").hide();
+                    }else{
+                     	$("#wxtip .turn-off").show();
+                     	$("#wxtip .turn-on").hide();
+                    }
+                    var i_mailpush = _vipData["i_mailpush"]
+                    s_email = _vipData["s_email"]
+                    $("#email").val(s_email);
+					$(".emailset>span").css("max-width",$("#emailtip").width()-80).text(s_email);
+                    if (i_mailpush!=undefined&&i_mailpush=="1"){
+                     	$("#emailtip .turn-on").show();
+                     	$("#emailtip .turn-off").hide();
+						$("#emailtip").addClass("on");
+						$(".emailset").show();
+                    }else{
+                     	$("#emailtip .turn-off").show();
+                     	$("#emailtip .turn-on").hide();
+                    }
+                    var i_matchway = _vipData["i_matchway"]
+                    if (i_matchway!=undefined){
+                        $("#matchType li").eq(i_matchway).addClass("checked");
+                    }else{
+                        $("#matchType li").eq(1).addClass("checked");
+                    }
+                }else{
+                     $("#pushfrequency li").eq(1).addClass("checked");
+                     $("#wxtip .turn-on").show();
+                     $("#emailtip .turn-off").show();
+                }
+            })
+			////////////////////////////////
+			$(".modal-dialog").css("margin-top",$(window).height()*0.25);
+			//推送结果预览
+			$("#resultpreview").click(function(){
+				if(!clickDelayed){
+					return;
+				}
+				window.location.href = "/wxpush/wxpushview";
+			});
+			
+			//微信提醒
+			$("#wxtip>img").click(function(){
+				var parentLi = $(this).parent();
+				if($(this).hasClass("turn-on")){
+					if(!$("#emailtip").hasClass("on")){
+						EasyAlert.show(keepOneTipWayMsg);
+						return;
+					}
+					parentLi.removeClass("on");
+					parentLi.children(".turn-off").show();
+					parentLi.children(".turn-on").hide();
+				}else{
+					parentLi.addClass("on");
+					parentLi.children(".turn-on").show();
+					parentLi.children(".turn-off").hide();
+				}
+				saveData();
+			});
+			//邮件提醒
+			$("#emailtip>img").click(function(){
+				var parentLi = $(this).parent();
+				if($(this).hasClass("turn-on")){
+					if(!$("#wxtip").hasClass("on")){
+						EasyAlert.show(keepOneTipWayMsg);
+						return;
+					}
+					$(".emailset").hide();
+					parentLi.removeClass("on");
+					parentLi.children(".turn-off").show();
+					parentLi.children(".turn-on").hide();
+				}else{
+					if(s_email == ""){
+						emailSetModalShow();
+						return;
+					}else{
+						emailtipOn();
+						$(".emailset").show();
+					}
+				}
+				saveData();
+			});
+			$(".emailset>img").click(function(){
+				emailSetModalShow();
+			});
+			$("#sure").click(function(){
+				var thisValue = $("#email").val();
+				var szReg=/^([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\_|\.|-|\-]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/; 
+				if(!szReg.test(thisValue)){
+					$(".error").removeClass("hide");
+					return;
+				}else{
+					$(".error").addClass("hide");
+				}
+				emailtipOn();
+				$(".emailset").show();
+				$(".emailset>span").text(thisValue);
+				emailSetModal.hide();
+				$("#setSuccess").hide().show();
+				setTimeout(function(){
+					$("#setSuccess").hide();
+				},EasyAlert.waitTime);
+				s_email = thisValue;
+				saveData();
+			});
+			$(".complate").click(function(){
+				if(!clickDelayed){
+					return;
+				}
+				window.history.go(-1);
+			});
+			//
+		});
+		//
+		function emailtipOn(){
+			$("#emailtip").addClass("on");
+			$("#emailtip").children(".turn-on").show();
+			$("#emailtip").children(".turn-off").hide();
+		}
+		//
+		function emailSetModalShow(){
+			$("#email").val(s_email);
+			$(".error").addClass("hide");
+			emailSetModal.show();
+		}
+		function saveData(){
+			var param = {
+				"pageType": "saveSeniorset",
+				"ratemode": 1,
+				"wxpush":0,
+				"mailpush":0,
+				"matchtype":1,
+				"email": $("#email").val(),
+			};
+			if($("#matchType li:eq(2)").hasClass("checked")){
+				param["matchtype"] = 2;
+			}
+			$("#pushfrequency li").each(function(){
+				if ($(this).hasClass("checked")){
+					param["ratemode"] = $(this).attr("dataid");
+				}
+			})
+			//
+			if($("#wxtip").hasClass("on")){
+				param["wxpush"] = 1;
+			}
+			if($("#emailtip").hasClass("on")){
+				param["mailpush"] = 1;
+			}
+			$.post("/subscribepay/afterPay/setUserInfo",param,function(r){
+				console.log(r)
+			});
+		}
+		//
+		function docheck(n,th){
+			if(parseInt(n)<5){
+				console.log("++++++++++++")
+				$("#pushfrequency li").each(function(){
+					var linum = $(this).attr("dataid");
+					$(this).removeClass("checked");
+					if(linum==n){
+						$(this).addClass("checked");
+					}
+				})
+			}else {
+				$("#matchType li").each(function(){
+					var linum = $(this).attr("dataid");
+					$(this).removeClass("checked");
+					if(linum==n){
+						$(this).addClass("checked");
+					}
+				})
+			}
+			saveData();
+		}
+	</script>
+</head>
+<body class="seniorsetpage">
+	<div class="header">
+		推送设置<span class="complate">完成</span>
+	</div>
+
+	<div class="content">
+		<div id="pushfrequency">
+			<ul class="navchoose">
+				<li><img src="{{Msg "seo" "cdn"}}/images/wxkeyset/pushfrequency.png">推送时间</li>
+				<li onclick="docheck('1',this)" dataid="1">
+					实时推送
+					<img src="{{Msg "seo" "cdn"}}/images/wxkeyset/checked.png" class="checked-img">
+					<span>8点-20点实时推送</span>
+				</li>
+				<li onclick="docheck('2',this)" dataid="2">
+					每日推送
+					<img src="{{Msg "seo" "cdn"}}/images/wxkeyset/checked.png" class="checked-img">
+					<span>上午9点推送一次</span>
+				</li>
+				<li onclick="docheck('3',this)" dataid="3">
+					每周推送
+					<img src="{{Msg "seo" "cdn"}}/images/wxkeyset/checked.png" class="checked-img">
+					<span>每周五上午9点推送一次</span>
+				</li>
+				<li onclick="docheck('4',this)" dataid="4">
+					每月推送
+					<img src="{{Msg "seo" "cdn"}}/images/wxkeyset/checked.png" class="checked-img">
+					<span>每月28日上午9点推送一次</span>
+				</li>
+			</ul>
+		</div>
+		<div id="pushway">
+			<ul class="navchoose">
+				<li><img src="{{Msg "seo" "cdn"}}/images/wxkeyset/pushway.png">推送方式</li>
+				<li id="wxtip">
+					微信提醒
+					<img src="{{Msg "seo" "cdn"}}/images/wxkeyset/turn-on.png" class="turn-on">
+					<img src="{{Msg "seo" "cdn"}}/images/wxkeyset/turn-off.png" class="turn-off">
+				</li>
+				<li id="emailtip">
+					邮件提醒
+					<img src="{{Msg "seo" "cdn"}}/images/wxkeyset/turn-on.png" class="turn-on">
+					<img src="{{Msg "seo" "cdn"}}/images/wxkeyset/turn-off.png" class="turn-off">
+					<div class="emailset">
+						<span></span>
+						<img src="{{Msg "seo" "cdn"}}/images/wx/editemail.png">
+					</div>
+				</li>
+			</ul>
+		</div>
+		<div id="matchType">
+			<ul class="navchoose">
+				<li><img src="{{Msg "seo" "cdn"}}/vipsubscribe/image/matchType.png">关键词匹配方式</li>
+				<li onclick="docheck('5',this)" dataid="5">
+					按标题匹配
+					<img src="{{Msg "seo" "cdn"}}/images/wxkeyset/checked.png" class="checked-img">
+				</li>
+				<li onclick="docheck('6',this)" dataid="6">
+					按全文匹配
+					<img src="{{Msg "seo" "cdn"}}/images/wxkeyset/checked.png" class="checked-img">
+					<span>会产生无效信息,请根据需要选择</span>
+				</li>
+			</ul>
+		</div>
+		<div class="onenavbar" id="resultpreview">
+			<img src="{{Msg "seo" "cdn"}}/images/wxkeyset/resultpreview.png" class="img-left">
+			推送结果预览
+			<img src="{{Msg "seo" "cdn"}}/wxswordfish/images/right.png" class="img-right">
+		</div>
+	</div>
+	<div class="easypopup" id="emailSetModal">
+		<div class="easypopup-edit">
+			<div class="easypopup-header">设置邮件地址</div>
+			<div class="easypopup-content">
+				<input type="text" id="email" placeholder="邮件地址" class="form-control"/>
+				<div class="error hide">您输入的邮箱不正确,请重新输入</div>
+			</div>
+			<div class="easypopup-footer">
+				<span onclick="emailSetModal.hide();">取消</span>
+				<span id="sure">确定</span>
+			</div>
+		</div>
+	</div>
+	<div class="easyalert easyalert-icon" id="setSuccess">
+		<img src='{{Msg "seo" "cdn"}}/images/set-right.png' style='width: 49px;margin-bottom: 15px;margin-top: 25px;'><br>设置成功
+	</div>
+	{{include "/common/baiducc.html"}}
+</body>
+</html>