zhangxinlei1996 5 gadi atpakaļ
vecāks
revīzija
465fd3a3fc
49 mainītis faili ar 2879 papildinājumiem un 1509 dzēšanām
  1. 73 0
      src/jfw/front/jylog.go
  2. 2 2
      src/jfw/front/swordfish.go
  3. 8 2
      src/jfw/modules/app/src/web/staticres/jyapp/vipsubscribe/css/choose_area.css
  4. 359 349
      src/jfw/modules/app/src/web/staticres/jyapp/vipsubscribe/css/choose_area_new.css
  5. 142 96
      src/jfw/modules/app/src/web/staticres/jyapp/vipsubscribe/js/editArea.js
  6. 32 5
      src/jfw/modules/app/src/web/templates/vipsubscribe/choose_area.html
  7. 0 2
      src/jfw/modules/app/src/web/templates/vipsubscribe/choose_industry.html
  8. 3 5
      src/jfw/modules/app/src/web/templates/vipsubscribe/edit_city_new.html
  9. 1 1
      src/jfw/modules/app/src/web/templates/vipsubscribe/edit_subscribe.html
  10. 6 5
      src/jfw/modules/app/src/web/templates/vipsubscribe/edit_subscribe_industry.html
  11. 42 7
      src/jfw/modules/app/src/web/templates/vipsubscribe/vip_purchase.html
  12. 5 0
      src/jfw/modules/app/src/web/templates/weixin/search/mainSearch.html
  13. 58 0
      src/jfw/modules/subscribepay/README.md
  14. 27 12
      src/jfw/modules/subscribepay/src/config/config.go
  15. 62 3
      src/jfw/modules/subscribepay/src/message.json
  16. 13 26
      src/jfw/modules/subscribepay/src/service/afterPay.go
  17. 10 4
      src/jfw/modules/subscribepay/src/service/vipRenewUpgrade.go
  18. 1 0
      src/jfw/modules/subscribepay/src/service/vipSubscribePay.go
  19. 6 1
      src/jfw/modules/subscribepay/src/timetask.json
  20. 56 27
      src/jfw/modules/subscribepay/src/timetask/timetask.go
  21. 228 0
      src/jfw/modules/subscribepay/src/util/msgremind.go
  22. 3 1
      src/jfw/modules/subscribepay/src/util/public.go
  23. 2 2
      src/jfw/modules/weixin/src/jrpc/jrpc.go
  24. 10 5
      src/jfw/public/historypush.go
  25. 407 0
      src/web/staticres/css/subscribe.css
  26. BIN
      src/web/staticres/images/subscribe/QR_code.png
  27. BIN
      src/web/staticres/images/subscribe/banner.png
  28. BIN
      src/web/staticres/images/subscribe/free.png
  29. BIN
      src/web/staticres/images/subscribe/line.png
  30. BIN
      src/web/staticres/images/subscribe/mengban.png
  31. BIN
      src/web/staticres/images/subscribe/vip-logo.png
  32. BIN
      src/web/staticres/images/subscribe/vip.png
  33. BIN
      src/web/staticres/images/subscribe/vip_tanchuang.png
  34. 360 349
      src/web/staticres/vipsubscribe/css/choose_area_new.css
  35. 140 94
      src/web/staticres/vipsubscribe/js/editArea.js
  36. 73 0
      src/web/staticres/vipsubscribe/js/mapArea.js
  37. 136 0
      src/web/templates/pc/subscribe_new.html
  38. 89 54
      src/web/templates/weixin/historypush.html
  39. 16 2
      src/web/templates/weixin/vipsubscribe/choose_area.html
  40. 11 5
      src/web/templates/weixin/vipsubscribe/choose_area_upgrade.html
  41. 35 17
      src/web/templates/weixin/vipsubscribe/choose_industry_upgrade.html
  42. 3 5
      src/web/templates/weixin/vipsubscribe/edit_city_new.html
  43. 392 389
      src/web/templates/weixin/vipsubscribe/edit_subscribe_industry.html
  44. 3 1
      src/web/templates/weixin/vipsubscribe/edit_subscribe_success.html
  45. 10 3
      src/web/templates/weixin/vipsubscribe/renew_notice.html
  46. 3 4
      src/web/templates/weixin/vipsubscribe/renew_pay.html
  47. 2 2
      src/web/templates/weixin/vipsubscribe/vip_index.html
  48. 16 8
      src/web/templates/weixin/vipsubscribe/vip_purchase.html
  49. 34 21
      src/web/templates/weixin/vipsubscribe/vip_upgrade.html

+ 73 - 0
src/jfw/front/jylog.go

@@ -0,0 +1,73 @@
+package front
+
+/**
+日志文件自动切换,默认保留15天内日志
+**/
+
+import (
+	"log"
+	"os"
+	"path/filepath"
+	"regexp"
+	"time"
+
+	"github.com/go-xweb/xweb"
+	"github.com/robfig/cron"
+)
+
+//日志格式
+var fileReg = regexp.MustCompile("^(\\d{4}_[0-9_]{14})\\.log$")
+
+//当前日志文件句柄
+var LogFile *os.File
+
+//时间格式
+var FMT = "2006_01_02_15_04_05"
+
+//日志目录
+var LogPath = "./jylog"
+
+func init() {
+	os.Mkdir(LogPath, os.ModePerm)
+	//默认保留15天内的日志,-1为永久保留
+	initLog(15)
+}
+
+func initLog(saveDay int) {
+	go logfile()
+	task := cron.New()
+	task.Start()
+	task.AddFunc("0 0 0 * * ?", func() {
+		go logfile()
+		time.Sleep(50 * time.Second)
+		if saveDay > 0 {
+			filepath.Walk(LogPath, func(path string, info os.FileInfo, err error) error {
+				str := fileReg.FindStringSubmatch(info.Name())
+				if len(str) == 2 {
+					t, er := time.ParseInLocation(FMT, str[1], time.Local)
+					if er == nil {
+						if (time.Now().Unix()-t.Unix())/86400 > int64(saveDay) {
+							log.Println("delete log file:", path, os.Remove(path))
+						}
+					}
+				}
+				return nil
+			})
+		}
+	})
+}
+
+//创建并切换输出文件
+func logfile() {
+	now := time.Now().Format(FMT)
+	file, _ := os.Create(LogPath + "/" + now + ".log")
+	log.SetOutput(file)
+	xweb.RootApp().Logger.SetOutput(file)
+	go func(file *os.File) {
+		time.Sleep(5 * time.Second)
+		if LogFile != nil {
+			LogFile.Close()
+		}
+		LogFile = file
+	}(file)
+}

+ 2 - 2
src/jfw/front/swordfish.go

@@ -2350,7 +2350,7 @@ func (f *Front) HasPushHistory() {
 	//获取时间
 	var formatTime string
 	selectTime := f.GetString("selectTime")
-	log.Println(selectTime, "---", f.GetString("area"))
+	//	log.Println(selectTime, "---", f.GetString("area"))
 	lenStr := len([]rune(selectTime))
 	if selectTime != "" {
 		if selectTime != "undefined" && lenStr >= 10 {
@@ -2370,7 +2370,7 @@ func (f *Front) HasPushHistory() {
 	hasKeyFlag := false
 	isVipFlag := false
 	isPassCount := false
-	isExpire := 0
+	isExpire := -1
 	tedayNum := time.Unix(time.Now().Unix(), 1).Format("20060102")
 	isOnTail := 0
 	if util.IntAll((*user)["i_vip_status"]) == 1 || util.IntAll((*user)["i_vip_status"]) == 2 {

+ 8 - 2
src/jfw/modules/app/src/web/staticres/jyapp/vipsubscribe/css/choose_area.css

@@ -494,16 +494,22 @@
 
 #choose_area .select-area-box .tab .province .checkbox:checked {
   border: 0;
-  background: url(../image/xuanzhong.png) no-repeat center center;
+  background: url(/jyapp/vipsubscribe/image/xuanzhong.png) no-repeat center center;
   background-size: 100% 100%;
 }
 
 #choose_area .select-area-box .tab .province .checkbox[disabled] {
   border: 0;
-  background: url(../image/active_disabled.png) no-repeat center center;
+  background: url(/jyapp/vipsubscribe/image/active_disabled.png) no-repeat center center;
   background-size: 100% 100%;
 }
 
+#choose_area .select-area-box .tab .province .checkbox.half:checked {
+  border: 0 !important;
+  background: url(/jyapp/vipsubscribe/image/banxuan.png) no-repeat center center !important;
+  background-size: cover !important;
+}
+
 #choose_area .select-area-box label::after {
   font-size: 14px;
   float: right;

+ 359 - 349
src/jfw/modules/app/src/web/staticres/jyapp/vipsubscribe/css/choose_area_new.css

@@ -1,609 +1,619 @@
 @charset "UTF-8";
 .main {
-  width: 100%;
-  overflow: scroll;
+    width: 100%;
+    overflow: scroll;
 }
 
 .main::-webkit-scrollbar {
-  display: none;
+    display: none;
 }
 
 .layout_top-bottom {
-  display: flex;
-  flex-direction: column;
-  justify-content: space-between;
-  height: 100%;
+    display: flex;
+    flex-direction: column;
+    justify-content: space-between;
+    height: 100%;
 }
 
 .layout_top-bottom .layou_top {
-  flex: 1;
-  overflow: scroll;
+    flex: 1;
+    overflow: scroll;
 }
 
 .bottom_button {
-  display: flex;
-  justify-content: space-between;
-  align-items: center;
-  width: 100%;
-  height: .94rem;
+    display: flex;
+    justify-content: space-between;
+    align-items: center;
+    width: 100%;
+    height: .94rem;
 }
 
 .bottom_button .left_btn,
 .bottom_button .right_btn {
-  flex: 1;
-  height: 100%;
-  font-size: .34rem;
+    flex: 1;
+    height: 100%;
+    font-size: .34rem;
 }
 
 .bottom_button .left_btn {
-  color: #2cb7ca;
-  background-color: #fff;
-  border-top: 1px solid #e0e0e0;
+    color: #2cb7ca;
+    background-color: #fff;
+    border-top: 1px solid #e0e0e0;
 }
 
 .bottom_button .right_btn {
-  color: #fff;
-  background-color: #2cb7ca;
-  border-top: 1px solid #2cb7ca;
+    color: #fff;
+    background-color: #2cb7ca;
+    border-top: 1px solid #2cb7ca;
 }
 
 .bottom_button button[disabled] {
-  opacity: .5;
+    opacity: .5;
 }
 
 .public_btn {
-  width: 100%;
-  height: .94rem;
-  line-height: .94rem;
-  text-align: center;
-  background: #2CB7CA;
-  color: #fff;
-  border-radius: 0.06rem;
-  font-size: .34rem;
+    width: 100%;
+    height: .94rem;
+    line-height: .94rem;
+    text-align: center;
+    background: #2CB7CA;
+    color: #fff;
+    border-radius: 0.06rem;
+    font-size: .34rem;
 }
 
 .tips_btn {
-  display: flex;
-  position: relative;
-  flex-direction: column;
-  align-items: center;
-  justify-content: space-between;
+    display: flex;
+    position: relative;
+    flex-direction: column;
+    align-items: center;
+    justify-content: space-between;
 }
 
 .tips_btn .tips_discount {
-  width: 100%;
+    width: 100%;
 }
 
 .tips_btn .tips_discount .tips_d_money {
-  display: none;
-  position: absolute;
-  left: 50%;
-  top: -.2rem;
-  padding: 0 .4rem;
-  height: .64rem;
-  line-height: .64rem;
-  color: #2CB7CA;
-  font-size: .32rem;
-  background-color: #fff;
-  border-radius: .32rem;
-  transform: translate(-50%, -100%);
-  box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.16);
+    display: none;
+    position: absolute;
+    left: 50%;
+    top: -.2rem;
+    padding: 0 .4rem;
+    height: .64rem;
+    line-height: .64rem;
+    color: #2CB7CA;
+    font-size: .32rem;
+    background-color: #fff;
+    border-radius: .32rem;
+    transform: translate(-50%, -100%);
+    box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.16);
 }
 
 .tips_btn .tips_discount .tips_d_text {
-  display: none;
-  height: .72rem;
-  line-height: .72rem;
-  color: #fff;
-  font-size: .28rem;
-  text-align: center;
-  background-color: #FFB901;
+    display: none;
+    height: .72rem;
+    line-height: .72rem;
+    color: #fff;
+    font-size: .28rem;
+    text-align: center;
+    background-color: #FFB901;
 }
 
 .tips_btn .btns {
-  display: flex;
-  align-items: center;
-  justify-content: space-between;
-  width: 100%;
-  height: .94rem;
-  line-height: .94rem;
-  color: #fff;
-  font-size: .34rem;
+    display: flex;
+    align-items: center;
+    justify-content: space-between;
+    width: 100%;
+    height: .94rem;
+    line-height: .94rem;
+    color: #fff;
+    font-size: .34rem;
 }
 
 .tips_btn .btns .save-btn,
 .tips_btn .btns .reset-btn {
-  flex: 1;
-  width: 50%;
-  text-align: center;
-  height: 100%;
-  font-size: .34rem;
+    flex: 1;
+    width: 50%;
+    text-align: center;
+    height: 100%;
+    font-size: .34rem;
 }
 
 .tips_btn .btns .reset-btn {
-  background: #fff;
-  color: #2cb7ca;
-  border-top: 1px solid #e0e0e0;
+    background: #fff;
+    color: #2cb7ca;
+    border-top: 1px solid #e0e0e0;
 }
 
 .tips_btn .btns .save-btn {
-  background: #2cb7ca;
-  color: #fff;
-  border-top: 1px solid #2cb7ca;
+    background: #2cb7ca;
+    color: #fff;
+    border-top: 1px solid #2cb7ca;
 }
 
 .tips_btn .btns button[disabled] {
-  opacity: .5;
+    opacity: .5;
 }
 
 .jy_icon {
-  position: relative;
-  width: 100%;
-  height: 100%;
+    position: relative;
+    width: 100%;
+    height: 100%;
 }
 
 .jy_icon.decrease:before,
 .jy_icon.increase:before,
 .jy_icon.increase:after {
-  position: absolute;
-  left: 50%;
-  top: 50%;
-  content: '';
-  width: 0.4rem;
-  height: 0.04rem;
-  background-color: #686868;
-  transform: translate(-50%, -50%);
+    position: absolute;
+    left: 50%;
+    top: 50%;
+    content: '';
+    width: 0.4rem;
+    height: 0.04rem;
+    background-color: #686868;
+    transform: translate(-50%, -50%);
 }
 
 .jy_icon.increase:after {
-  transform: translate(-50%, -50%) rotate(90deg);
+    transform: translate(-50%, -50%) rotate(90deg);
 }
 
 /*禁止长按复制 加给body*/
 .no-touch {
-  -webkit-touch-callout: none;
-  -webkit-user-select: none;
-  -khtml-user-select: none;
-  -moz-user-select: none;
-  -ms-user-select: none;
-  user-select: none;
+    -webkit-touch-callout: none;
+    -webkit-user-select: none;
+    -khtml-user-select: none;
+    -moz-user-select: none;
+    -ms-user-select: none;
+    user-select: none;
 }
 
 /* 弹性盒子布局 */
 .flex_alginC {
-  display: flex;
-  align-items: center;
+    display: flex;
+    align-items: center;
 }
 
 .flex_alginC_justB {
-  display: flex;
-  align-items: center;
-  justify-content: space-between;
+    display: flex;
+    align-items: center;
+    justify-content: space-between;
 }
 
 .flex_alginC_justC {
-  display: flex;
-  align-items: center;
-  justify-content: center;
+    display: flex;
+    align-items: center;
+    justify-content: center;
 }
 
 .flex_column {
-  display: flex;
-  flex-direction: column;
+    display: flex;
+    flex-direction: column;
 }
 
 .flex_column_alignC {
-  display: flex;
-  flex-direction: column;
-  align-items: center;
+    display: flex;
+    flex-direction: column;
+    align-items: center;
 }
 
 /* 自定义弹窗*/
 @-webkit-keyframes c {
-  0% {
-    opacity: 0;
-  }
-  to {
-    opacity: 1;
-  }
+    0% {
+        opacity: 0;
+    }
+    to {
+        opacity: 1;
+    }
 }
 
 @keyframes c {
-  0% {
-    opacity: 0;
-  }
-  to {
-    opacity: 1;
-  }
+    0% {
+        opacity: 0;
+    }
+    to {
+        opacity: 1;
+    }
 }
 
 .custom-dialog .weui-animate-fade-in {
-  -webkit-animation: c ease 0s forwards;
-  animation: c ease 0s forwards;
+    -webkit-animation: c ease 0s forwards;
+    animation: c ease 0s forwards;
 }
 
 @-webkit-keyframes d {
-  0% {
-    opacity: 1;
-  }
-  to {
-    opacity: 0;
-  }
+    0% {
+        opacity: 1;
+    }
+    to {
+        opacity: 0;
+    }
 }
 
 @keyframes d {
-  0% {
-    opacity: 1;
-  }
-  to {
-    opacity: 0;
-  }
+    0% {
+        opacity: 1;
+    }
+    to {
+        opacity: 0;
+    }
 }
 
 .custom-dialog .weui-animate-fade-out {
-  -webkit-animation: d ease 0s forwards;
-  animation: d ease 0s forwards;
+    -webkit-animation: d ease 0s forwards;
+    animation: d ease 0s forwards;
 }
 
 .custom-dialog .weui-dialog__hd {
-  background: #F5F4F9;
-  padding: .17rem 0;
-  color: #000;
-  font-size: .34rem;
-  text-align: center;
+    background: #F5F4F9;
+    padding: .17rem 0;
+    color: #000;
+    font-size: .34rem;
+    text-align: center;
 }
 
 .custom-dialog .weui-dialog__bd {
-  padding: .37rem 0;
-  color: #1D1D1D;
-  font-size: .32rem;
-  text-align: center;
+    padding: .37rem 0;
+    color: #1D1D1D;
+    font-size: .32rem;
+    text-align: center;
 }
 
 .custom-dialog .weui-dialog__ft:after {
-  border: 0;
+    border: 0;
 }
 
 .custom-dialog .weui-dialog__btn:after {
-  border: 0;
+    border: 0;
 }
 
 .custom-dialog .weui-dialog__ft {
-  display: flex;
-  align-items: center;
-  justify-content: center;
-  padding-bottom: .38rem;
-  box-sizing: border-box;
-  text-align: center;
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    padding-bottom: .38rem;
+    box-sizing: border-box;
+    text-align: center;
 }
 
 .custom-dialog .weui-dialog__btn {
-  display: block;
-  width: 1.72rem;
-  height: .72rem;
-  line-height: .72rem;
-  color: #fff;
-  padding: 0;
-  flex: none;
-  text-align: center;
-  border-radius: 3px;
+    display: block;
+    width: 1.72rem;
+    height: .72rem;
+    line-height: .72rem;
+    color: #fff;
+    padding: 0;
+    flex: none;
+    text-align: center;
+    border-radius: 3px;
 }
 
 .custom-dialog .weui-dialog__btn_primary {
-  background-color: #2CB7CA;
-  margin-right: 1rem;
+    background-color: #2CB7CA;
+    margin-right: 1rem;
 }
 
 .custom-dialog .weui-dialog__btn_default {
-  background-color: #BFBFC3;
+    background-color: #BFBFC3;
 }
 
 /* 自定义switch按钮 */
 .custom-switch {
-  position: relative;
-  width: 52px;
-  height: 32px;
-  border: 1px solid #dfdfdf;
-  outline: 0;
-  border-radius: 16px;
-  box-sizing: border-box;
-  background-color: #dfdfdf;
-  -webkit-transition: background-color .1s,border .1s;
-  transition: background-color .1s,border .1s;
-  -webkit-appearance: none;
+    position: relative;
+    width: 52px;
+    height: 32px;
+    border: 1px solid #dfdfdf;
+    outline: 0;
+    border-radius: 16px;
+    box-sizing: border-box;
+    background-color: #dfdfdf;
+    -webkit-transition: background-color .1s, border .1s;
+    transition: background-color .1s, border .1s;
+    -webkit-appearance: none;
 }
 
 .custom-switch:before {
-  content: " ";
-  position: absolute;
-  top: 0;
-  left: 0;
-  width: 50px;
-  height: 30px;
-  border-radius: 15px;
-  background-color: #fdfdfd;
-  -webkit-transition: -webkit-transform 0.35s cubic-bezier(0.45, 1, 0.4, 1);
-  transition: -webkit-transform 0.35s cubic-bezier(0.45, 1, 0.4, 1);
-  transition: transform 0.35s cubic-bezier(0.45, 1, 0.4, 1);
-  transition: transform 0.35s cubic-bezier(0.45, 1, 0.4, 1), -webkit-transform 0.35s cubic-bezier(0.45, 1, 0.4, 1);
+    content: " ";
+    position: absolute;
+    top: 0;
+    left: 0;
+    width: 50px;
+    height: 30px;
+    border-radius: 15px;
+    background-color: #fdfdfd;
+    -webkit-transition: -webkit-transform 0.35s cubic-bezier(0.45, 1, 0.4, 1);
+    transition: -webkit-transform 0.35s cubic-bezier(0.45, 1, 0.4, 1);
+    transition: transform 0.35s cubic-bezier(0.45, 1, 0.4, 1);
+    transition: transform 0.35s cubic-bezier(0.45, 1, 0.4, 1), -webkit-transform 0.35s cubic-bezier(0.45, 1, 0.4, 1);
 }
 
 .custom-switch:after {
-  content: " ";
-  position: absolute;
-  top: 0;
-  left: 0;
-  width: 30px;
-  height: 30px;
-  border-radius: 15px;
-  background-color: #fff;
-  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
-  -webkit-transition: -webkit-transform 0.35s cubic-bezier(0.4, 0.4, 0.25, 1.35);
-  transition: -webkit-transform 0.35s cubic-bezier(0.4, 0.4, 0.25, 1.35);
-  transition: transform 0.35s cubic-bezier(0.4, 0.4, 0.25, 1.35);
-  transition: transform 0.35s cubic-bezier(0.4, 0.4, 0.25, 1.35), -webkit-transform 0.35s cubic-bezier(0.4, 0.4, 0.25, 1.35);
+    content: " ";
+    position: absolute;
+    top: 0;
+    left: 0;
+    width: 30px;
+    height: 30px;
+    border-radius: 15px;
+    background-color: #fff;
+    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
+    -webkit-transition: -webkit-transform 0.35s cubic-bezier(0.4, 0.4, 0.25, 1.35);
+    transition: -webkit-transform 0.35s cubic-bezier(0.4, 0.4, 0.25, 1.35);
+    transition: transform 0.35s cubic-bezier(0.4, 0.4, 0.25, 1.35);
+    transition: transform 0.35s cubic-bezier(0.4, 0.4, 0.25, 1.35), -webkit-transform 0.35s cubic-bezier(0.4, 0.4, 0.25, 1.35);
 }
 
 .custom-switch.checked {
-  border-color: #04be02;
-  background-color: #04be02;
+    border-color: #04be02;
+    background-color: #04be02;
 }
 
 .custom-switch.checked:before {
-  transform: scale(0);
+    transform: scale(0);
 }
 
 .custom-switch.checked:after {
-  transform: translateX(20px);
+    transform: translateX(20px);
 }
 
 .custom-toast .weui-toast {
-  font-size: .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%);
+    font-size: .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;
+    display: none;
 }
 
 .custom-toast .weui-toast__content {
-  margin: 0;
+    margin: 0;
 }
 
 .jymobile-tab-triangle {
-  position: relative;
+    position: relative;
 }
 
 .jymobile-tab-triangle:after {
-  content: '';
-  position: absolute;
-  top: 50%;
-  right: 0;
-  width: 0;
-  height: 0;
-  font-size: 0;
-  line-height: 0;
-  border-style: solid;
-  border-width: .1rem;
-  border-color: #aaa transparent transparent transparent;
-  transform: translate(140%, -30%);
+    content: '';
+    position: absolute;
+    top: 50%;
+    right: 0;
+    width: 0;
+    height: 0;
+    font-size: 0;
+    line-height: 0;
+    border-style: solid;
+    border-width: .1rem;
+    border-color: #aaa transparent transparent transparent;
+    transform: translate(140%, -30%);
 }
 
 .jymobile-tab-triangle.active:after {
-  border-color: transparent transparent #2cb7ca transparent;
-  transform: translate(140%, -70%);
+    border-color: transparent transparent #2cb7ca transparent;
+    transform: translate(140%, -70%);
 }
 
 .jymobile-tab-triangle.current {
-  color: #2cb7ca;
+    color: #2cb7ca;
 }
 
 .jymobile-tab-triangle.current:after {
-  border-color: #2cb7ca transparent transparent transparent;
+    border-color: #2cb7ca transparent transparent transparent;
 }
 
 #choose_area {
-  display: flex;
-  justify-content: space-between;
-  flex-direction: column;
-  overflow: hidden;
-  height: 100%;
+    display: flex;
+    justify-content: space-between;
+    flex-direction: column;
+    overflow: hidden;
+    height: 100%;
 }
 
 #choose_area .form {
-  flex: 1;
-  overflow-y: scroll;
+    flex: 1;
+    overflow-y: scroll;
 }
 
 #choose_area .optional_count, #choose_area .all_area {
-  background: #fff;
-  height: .88rem;
-  line-height: .88rem;
-  padding: 0 .3rem;
-  font-size: .3rem;
-  color: #1d1d1d;
+    height: .88rem;
+    line-height: .88rem;
+    padding: 0 .3rem;
+    font-size: .3rem;
+    color: #1d1d1d;
 }
 
 #choose_area .optional_count em, #choose_area .all_area em {
-  color: #2cb7ca;
+    color: #2cb7ca;
 }
 
 #choose_area .result {
-  position: relative;
-  padding: .2rem .3rem;
-  font-size: .26rem;
-  text-align: justify;
+    position: relative;
+    padding: .2rem .3rem;
+    font-size: .26rem;
+    text-align: justify;
 }
 
 #choose_area .result .result_text {
-  position: relative;
-  min-height: 19px;
+    position: relative;
+    min-height: 19px;
 }
 
 #choose_area .result .line_two {
-  text-overflow: ellipsis;
-  overflow: hidden;
-  text-overflow: ellipsis;
-  display: -webkit-box;
-  -webkit-line-clamp: 2;
-  line-clamp: 2;
-  -webkit-box-orient: vertical;
+    text-overflow: ellipsis;
+    overflow: hidden;
+    text-overflow: ellipsis;
+    display: -webkit-box;
+    -webkit-line-clamp: 2;
+    line-clamp: 2;
+    -webkit-box-orient: vertical;
 }
 
 #choose_area .result .detail, #choose_area .result .packup {
-  display: inline-block;
-  width: 1.5rem;
-  padding-right: 0.1rem;
-  text-align: right;
-  color: #2cb7ca;
-  font-size: .26rem;
-  z-index: 999;
+    display: inline-block;
+    width: 1.5rem;
+    padding-right: 0.1rem;
+    text-align: right;
+    color: #2cb7ca;
+    font-size: .26rem;
+    z-index: 999;
 }
 
 #choose_area .result .detail {
-  position: absolute;
-  right: 0;
-  bottom: 0;
-  background: linear-gradient(90deg, rgba(245, 244, 249, 0) 0%, rgba(245, 244, 249, 0.96) 36%, #f5f4f9 100%);
+    position: absolute;
+    right: 0;
+    bottom: 0;
+    background: linear-gradient(90deg, rgba(245, 244, 249, 0) 0%, rgba(245, 244, 249, 0.96) 36%, #f5f4f9 100%);
 }
 
 #choose_area .result .packup {
-  position: absolute;
-  right: 0.3rem;
-  bottom: 0;
-  margin-top: .1rem;
+    position: absolute;
+    right: 0.3rem;
+    bottom: 0;
+    margin-top: .1rem;
 }
 
 #choose_area .select-area-box {
-  padding-bottom: .94rem;
+    padding-bottom: .94rem;
 }
 
 #choose_area .select-area-box .tab {
-  display: flex;
-  align-items: center;
-  justify-content: space-between;
-  color: #1d1d1d;
-  background: #fff;
-  font-size: .3rem;
-  padding: .2rem .5rem;
-  border-bottom: 1px solid #e0e0e0;
-  box-sizing: border-box;
+    display: flex;
+    align-items: center;
+    justify-content: space-between;
+    color: #1d1d1d;
+    background: #fff;
+    font-size: .3rem;
+    padding: .2rem .5rem;
+    border-bottom: 1px solid #e0e0e0;
+    box-sizing: border-box;
 }
 
 #choose_area .select-area-box .tab .province {
-  display: flex;
-  align-items: center;
+    display: flex;
+    align-items: center;
 }
 
 #choose_area .select-area-box .tab .province .checkbox {
-  width: .4rem;
-  height: .4rem;
-  border: 1px solid #ddd;
-  border-radius: 50%;
-  margin-right: .2rem;
-  -webkit-appearance: none;
-  background: #fff;
+    width: .4rem;
+    height: .4rem;
+    border: 1px solid #ddd;
+    border-radius: 50%;
+    margin-right: .2rem;
+    -webkit-appearance: none;
+    background: #fff;
 }
 
 #choose_area .select-area-box .tab .province .checkbox:checked {
-  border: 0;
-  background: url(/jyapp/vipsubscribe/image/xuanzhong.png) no-repeat center center;
-  background-size: 100% 100%;
+    border: 0;
+    background: url(/jyapp/vipsubscribe/image/xuanzhong.png) no-repeat center center;
+    background-size: 100% 100%;
 }
 
 #choose_area .select-area-box .tab .province .checkbox[disabled] {
-  border: 0;
-  background: url(/jyapp/vipsubscribe/image/active_disabled.png) no-repeat center center;
-  background-size: 100% 100%;
+    border: 0;
+    background: url(/jyapp/vipsubscribe/image/active_disabled.png) no-repeat center center;
+    background-size: 100% 100%;
+    opacity: 1;
 }
 
 #choose_area .select-area-box .tab .province .checkbox.half {
-  border: 0 !important;
-  background: url(/jyapp/vipsubscribe/image/banxuan.png) no-repeat center center !important;
-  background-size: cover !important;
+    border: 0 !important;
+    background: url(/jyapp/vipsubscribe/image/banxuan.png) no-repeat center center !important;
+    background-size: cover !important;
 }
 
 #choose_area .select-area-box .tab .province .checkbox.half[disabled] {
-  border: 0 !important;
-  background: url(/jyapp/vipsubscribe/image/banxuan.png) no-repeat center center !important;
-  background-size: cover !important;
+    border: 0 !important;
+    background: url(/jyapp/vipsubscribe/image/banxuan.png) no-repeat center center !important;
+    background-size: cover !important;
+    opacity: 1 !important;
 }
 
 #choose_area .select-area-box .tab .optional {
-  color: #2CB7CA;
-  font-size: 0.28rem;
-  margin-left: -2.8rem;
+    color: #2CB7CA;
+    font-size: 0.28rem;
+    margin-left: -2.8rem;
 }
 
 #choose_area .select-area-box label::after {
-  font-size: 14px;
-  float: right;
-  margin-right: 15px;
+    font-size: 14px;
+    float: right;
+    margin-right: 15px;
 }
 
 #choose_area .select-area-box .tab_content {
-  display: none;
-  font-size: .28rem;
-  padding: .1rem .3rem;
-  text-align: center;
+    display: none;
+    font-size: .28rem;
+    padding: .1rem .3rem;
+    text-align: center;
 }
 
 #choose_area .select-area-box .tab_content .city {
-  float: left;
-  padding: .1rem .2rem;
-  background: #fff;
-  margin: .1rem 0 .1rem .1rem;
-  border-radius: 0.04rem;
-  font-size: .28rem;
+    float: left;
+    padding: .1rem .2rem;
+    background: #fff;
+    margin: .1rem 0 .1rem .1rem;
+    border-radius: 0.04rem;
+    font-size: .28rem;
 }
 
 #choose_area .select-area-box .tab_content .active {
-  background: #2cb7ca;
-  color: #fff;
+    background: #2cb7ca;
+    color: #fff;
 }
 
 #choose_area .select-area-box .tab_content .active[disabled] {
-  background: #BFBFC3;
-  color: #fff;
+    background: #BFBFC3;
+    color: #fff;
 }
 
 #choose_area .select-area-box .tab_content .city[disabled] {
-  background: #BFBFC3;
-  color: #fff;
+    background: #BFBFC3;
+    color: #fff;
 }
 
 #choose_area .select-area-box .index {
-  padding: .3rem .3rem .1rem .3rem;
-  font-size: .32rem;
+    padding: .3rem .3rem .1rem .3rem;
+    font-size: .32rem;
 }
 
 #choose_area .slide {
-  background: transparent;
-  position: fixed;
-  right: 0;
-  top: 50%;
-  height: 8.5rem;
-  width: .4rem;
-  font-size: .26rem;
-  text-align: center;
-  display: flex;
-  flex-direction: column;
-  justify-content: center;
-  padding: .1rem 0;
-  align-items: center;
-  margin-top: -4.25rem;
-  z-index: 9999;
+    background: transparent;
+    position: fixed;
+    right: 0;
+    top: 50%;
+    height: 8.5rem;
+    width: .4rem;
+    font-size: .26rem;
+    text-align: center;
+    display: flex;
+    flex-direction: column;
+    justify-content: center;
+    padding: .1rem 0;
+    align-items: center;
+    margin-top: -4.25rem;
+    z-index: 9999;
 }
 
 #choose_area .slide a {
-  margin-bottom: .1rem;
+    margin-bottom: .1rem;
+}
+
+.icon.iconfont {
+    display: inline-block;
 }
+
+.icon.iconfont.up {
+    display: inline-block;
+    transform: rotate(-180deg);
+}

+ 142 - 96
src/jfw/modules/app/src/web/staticres/jyapp/vipsubscribe/js/editArea.js

@@ -2,21 +2,21 @@
 var areaData = {
     "data": {
         "area": {
-            "北京": [],
-            "河南": [
-                "商丘市",
-                "安阳市",
-                "新乡市",
-                "郑州市"
-            ],
-            "澳门": [],
-            "甘肃": []
+            // "北京": [],
+            // "河南": [
+            //     "洛阳市",
+            //     "驻马店市",
+            //     "周口市",
+            //     // "郑州市"
+            // ],
+            // "澳门": [],
+            // "甘肃": []
         },
         "buyset": {
-            "areacount": 4,
+            "areacount": -1,
             "buyerclasscount": 11,
             "citys": {
-                "河南": 4
+                //   "河南": 4
             }
         },
         "industry": [
@@ -37,7 +37,6 @@ var areaData = {
     "success": true
 }
 
-
 //加载数据
 function getData() {
     $DoPost("/subscribepay/editSub/getSubBuyMsg", {}, function (r) {
@@ -55,18 +54,28 @@ function createMoreCity(arr) {
     return tempHtml
 }
 
+var animatedRuning = false;
+
+function checkAnimatedRuning() {
+    if (animatedRuning) {
+        return true
+    }
+    animatedRuning = true;
+    setTimeout(function () {
+        animatedRuning = false;
+    }, 500);
+    return false
+}
+
 // 省下拉市事件
 function slideFun(obj) {
+    if (checkAnimatedRuning()) {
+        return
+    }
     if (obj.next('.tab_content:not(:animated)').css("display") == "block") {
-        obj.children().children('i').css({
-            "display": "inline-block",
-            "transform": "rotate(0)"
-        })
+        obj.children().children('i').removeClass("up");
     } else {
-        obj.children().children('i').css({
-            "display": "inline-block",
-            "transform": "rotate(-180deg)"
-        })
+        obj.children().children('i').addClass("up");
     }
     obj.toggleClass('selected').next('.tab_content:not(:animated)').slideToggle(500)
     obj.parent().siblings().children('.tab').removeClass('selected');
@@ -76,16 +85,14 @@ var obj
 
 // 改变选择结果方法
 function getResult() {
-    var data = '';
     obj = {};
-    $('.result_name').empty();
+    //$('.result_name').empty();
     $('.province').each(function () {
         let provinceText = $(this).text().trim();//省份名称
         let isChecked = $(this).children('.checkbox').is(':checked');
         let isHalf = $(this).children('.checkbox').hasClass('half');
         let arr = [];
         if (isChecked) {
-            data += provinceText + '、';
             obj[provinceText] = [];
         } else if (isHalf && !isChecked) {
             let $that = $(this);
@@ -97,13 +104,12 @@ function getResult() {
                 }
             })
             obj[$that.text().trim()] = arr
-            data += `${$that.text().trim()}(${arr.join('、')})、`
         }
     })
     $('count').html($('.checkbox:not(.other):checked').length);
-    $('.result_name').append(data.substring(0, data.length - 1));
-    //校验是否修改
-    if (theSameAs(obj)) {
+    //$('.result_name').append(getAreaClassArr_index(obj).join("、"));
+//校验是否修改
+    if (theSameAs(obj) || $.isEmptyObject(obj)) {
         $('#enter').attr("disabled", "disabled");
     } else {
         $('#enter').removeAttr("disabled");
@@ -114,7 +120,6 @@ function getResult() {
 function init() {
     let p = areaData.data.area;
     let count = areaData.data.buyset.citys;
-    var ht = '';
     // 1.渲染城市列表
     $(".select-area-box ul li:not('.index')").each(function () {
         var text = $(this).find(".province").text().trim()
@@ -128,88 +133,127 @@ function init() {
         box.html(html)
     })
     // 2.当areacount == -1时,全国为选中状态,为正数时为选中的省份数目,全国选项不显示
-    if (areaData.data.buyset.areacount == -1) {
-        // 选中全国
+    let pLength = Object.keys(areaData.data.area).length;
+    let cLength = Object.keys(areaData.data.buyset.citys).length
+    console.log(pLength, cLength)
+    if (areaData.data.buyset.areacount == -1 && pLength == 0 && cLength == 0) {
+        // 当购买的全国切选中的是全国时
         // $('.optional_count').html("可选择全部区域")
-        $('.all_area').show()
+        //$('.all_area').show()
         $('.optional_count').hide()
         $('.total').html('34')
         $('.count').html('34')
         $('.tab.whole').parent('li').show();
         $('.checkbox.other').prop('checked', true);
-        $('.checkbox:not(.other)').attr('disabled', true)
-        ht += `<span>全国</span>`
+        // $('.checkbox:not(.other)').attr('disabled',true)
+        //$('.result_name').append(`<span>全国</span>`);
+    } else if (areaData.data.buyset.areacount == -1 && pLength != 0) {
+        // 当购买的全国而没有选择全国,选择部分省市时
+        //$('.all_area').show();
+        $('.province').removeAttr('data-count');
+        $('.optional_count').hide();
+        $('.total').html('34');
+        initResult()
     } else {
-        $('.all_area').hide()
+        //$('.all_area').hide()
         $('.optional_count').show()
         $('.total').html(areaData.data.buyset.areacount)
         $('.tab.whole').parent('li').hide();
-        $('.checkbox.other').attr('disabled', true);
-        // 渲染已选择结果
-        for (const k in p) {
-            console.log(p[k], k)
-            if (p[k].length == 0) {
-                ht += k + '、';
-                $('.province').each(function () {
-                    let t = $(this).text().trim();
-                    if (k == t && p[k].length == 0) {
-                        // 如果购买的是全省,则不可点击下拉事件(不可修改城市)
-                        // $(this).parent('.tab').unbind("click").parent('li').siblings().find('.tab').unbind("click");
+        // $('.checkbox.other').attr('disabled',true);
+        initResult()
+    }
+
+}
+
+function initResult() {
+    let isAll = areaData.data.buyset.areacount;
+    let p = areaData.data.area;
+    let count = areaData.data.buyset.citys;
+    // 渲染已选择结果
+    for (const k in p) {
+        console.log(p[k], k)
+        if (p[k].length == 0) {
+            $('.province').each(function () {
+                let t = $(this).text().trim();
+                if (k == t && p[k].length == 0) {
+                    // 如果购买的是全省,则不可点击下拉事件(不可修改城市)
+                    if (isAll != -1) {
                         $(this).parent().siblings().children('.city').addClass('active').attr('disabled', true);
-                        $(this).children('.checkbox').prop('checked', true)
+                        $(this).parent('.tab').unbind('click').parent('li').siblings().find('.checkbox:not(.half)').parents('.tab').unbind('click')
+                    } else {
+                        $(this).parent().siblings().children('.city').addClass('active').removeAttr('disabled')
+                    }
+                    $(this).children('.checkbox').prop('checked', true)
+                }
+            })
+        } else {
+            console.log(k, p[k].length)
+            $('.city').each(function () {
+                let t = $(this).text().trim();
+                p[k].forEach(v => {
+                    // console.log(v,t)
+                    if (v == t) {
+                        let that = $(this).parents('li').find('.tab:not(.municipality)');
+                        console.log("v==t")
+                        // 如果是可修改城市的省份,则可以进行下拉展示
+                        that.bind('click', function () {
+                            slideFun($(this));
+                        })
+                        $(this).addClass('active').removeAttr('disabled').parent().siblings('.tab').find('input').addClass('half');
+                        return;
                     }
                 })
-            } else {
-                console.log(k, p[k])
-                ht += `${k}( ${p[k].join('、')} )、`;
-                $('.city').each(function () {
-                    let t = $(this).text().trim();
-                    p[k].forEach(v => {
-                        // console.log(v,t)
-                        if (v == t) {
-                            let that = $(this).parents('li').find('.tab:not(.municipality)');
-                            console.log("v==t")
-                            // 如果是可修改城市的省份,则可以进行下拉展示
-                            that.bind('click', function () {
-                                slideFun($(this));
-                            });
-                            $(this).addClass('active').parent().siblings('.tab').find('input').addClass('half');
-                            return;
-                        }
-                    })
-                })
-                for (const c in count) {
-                    if (p[k].length >= count[c]) {
+            })
+            for (const c in count) {
+                if (p[k].length >= count[c]) {
+                    if (isAll != -1) {
                         $('.city:not(.active)').attr('disabled', true)
+                    } else {
+                        $('.city:not(.active)').removeAttr('disabled')
                     }
                 }
             }
         }
-        // 添加可选择城市文字 和自定义属性值
+    }
+    // 添加可选择城市文字 和自定义属性值
+    if (areaData.data.buyset.areacount != -1) {
         for (const c in count) {
             $('.province').each(function () {
                 let t = $(this).text().trim();
                 if (c == t) {
                     $(this).attr("data-count", count[c]);
                     $(this).after(`<em class="optional">可选择 ${count[c]} 个市</em>`)
-                    $(this).parent().bind('click', function () {
+                    let that = $(this).parent('.tab:not(.municipality)');
+                    that.bind('click', function () {
                         slideFun($(this));
                     })
                 }
             })
         }
-        $('.result_name').append(ht.substring(0, ht.length - 1));
-        $('.count').html($('.checkbox:not(.other):checked').length)
-        //$('.city:not(.active)').attr('disabled', true)
-        // 如果选中的省份数量等于购买的省份数量,则将其他未选中的省份禁用
-        if ($('.checkbox:not(.other):checked').length == $('.total').html()) {
-            $('.checkbox:not(:checked)').attr('disabled', true)
-        }
+    }
+    //$('.result_name').append(getAreaClassArr_index(areaData.data.area).join("、"));
+    $('.count').html($('.checkbox:not(.other):checked').length)
+    // 如果选中的省份数量等于购买的省份数量,则将其他未选中的省份禁用
+    if ($('.checkbox:not(.other):checked').length == $('.total').html()) {
+        $('.checkbox:not(:checked)').attr('disabled', true);
     }
     $('#enter').attr("disabled", "disabled");
 }
 
 $(function () {
+    // 省下拉事件
+    $('.tab:not(.municipality)').on('click', function () {
+        if (checkAnimatedRuning()) {
+            return
+        }
+        if ($(this).next('.tab_content:not(:animated)').css("display") == "block") {
+            $(this).children().children('i').removeClass("up");
+        } else {
+            $(this).children().children('i').addClass("up");
+        }
+        $(this).toggleClass('selected').next('.tab_content:not(:animated)').slideToggle(500);
+        $(this).parent().siblings().children('.tab').removeClass('selected');
+    });
     getData();
     // 初始化
     init();
@@ -219,25 +263,21 @@ $(function () {
         let isChecked = $(this).is(':checked');
         if (isChecked) {
             $('.count').html('34')
-            $('.checkbox:not(.other)').prop('checked', false).attr('disabled', true).removeClass('half')
-            $('.city').removeClass('active').attr('disabled', true)
-            $('.tab').unbind("click").siblings().slideUp()
+            $('.checkbox:not(.other)').prop('checked', false).removeClass('half')
+            $('.city').removeClass('active');
+            $('.tab_content').slideUp()
             getResult()
         } else {
-            // $('.count').html($('.checkbox:not(.other):checked').length)
             $('.checkbox:not(.other)').removeAttr('disabled')
             $('.city').removeAttr('disabled')
-            $('.tab:not(.municipality)').on('click', function () {
-                slideFun($(this));
-            });
             getResult()
         }
     })
     // 2.点击非全国按钮onchange事件;
     $('.checkbox:not(.other)').on('change', function () {
+        $('.checkbox.other').prop('checked', false);
         let checkedLength = $('.checkbox:checked').length;
         let totalLength = $('.total').text();
-        // console.log(checkedLength,totalLength)
         $('.count').html(checkedLength)
         if (checkedLength < totalLength) {
             $('.checkbox:not(.other)').removeAttr('disabled')
@@ -247,10 +287,14 @@ $(function () {
             getResult()
         }
         if ($(this).is(':checked')) {
-            $(this).prop('checked', true).removeClass('half').parent().parent().siblings().find('.city').addClass('active').attr('disabled', true)
+            if (areaData.data.buyset.areacount != -1) {
+                $(this).prop('checked', true).removeClass('half').parents('li').find('.city').addClass('active').attr('disabled', true);
+            } else {
+                $(this).prop('checked', true).removeClass('half').parents('li').find('.city').addClass('active');
+            }
             getResult()
         } else {
-            $(this).prop('checked', false).removeClass('half').parent().parent().siblings().find('.city').removeClass('active').removeAttr('disabled')
+            $(this).prop('checked', false).removeClass('half').parent().parent().siblings().find('.city').removeClass('active').removeAttr('disabled');
             getResult()
         }
 
@@ -259,10 +303,11 @@ $(function () {
     $('.checkbox.half').on('change', function () {
         console.log($(this).is(':checked'))
         if ($(this).is(':checked')) {
-            $(this).prop('checked', true).removeClass('half');
-            $(this).removeClass('half').parent().parent().siblings().find('.city').addClass('active').attr('disabled', true);
-            $(this).parent().parent().siblings().children('.city').addClass('active');
-            //$(this).parent().siblings('.optional').hide();
+            if (areaData.data.buyset.areacount != -1) {
+                $(this).prop('checked', true).removeClass('half').parents('li').find('.city').addClass('active').attr('disabled', true);
+            } else {
+                $(this).prop('checked', true).removeClass('half').parents('li').find('.city').addClass('active');
+            }
             getResult()
         } else {
             $(this).prop('checked', false);
@@ -274,10 +319,10 @@ $(function () {
     // 4.点击城市按钮触发的事件
     $('.tab_content').on('click', '.city', function () {
         let count = $(this).parent().siblings().find('.province').attr('data-count');
-        $(this).toggleClass('active')
+        $(this).toggleClass('active');
+        $('.checkbox.other').prop('checked', false);
         var isActive = $(this).parent().find('.city.active').length
         let cityLength = $(this).parent().find('.city').length
-
         if (isActive === cityLength) {//当选中的城市数量等于该省下所有城市总数时,即为全选
             var oInput = $(this).parents('li').find('input.checkbox')
             oInput.removeClass('half').prop('checked', true)
@@ -316,11 +361,12 @@ $(function () {
     // 取消按钮事件 返回上一页
     $('#cancel').click(function () {
         // window.history.go(-1)
-        $('.result_name').empty()
+        //$('.result_name').empty()
         $('.checkbox').prop('checked', false).removeAttr('disabled');
         $('.city').removeClass('active');
         $('.tab_content').slideUp();
-        $('.optional').remove()
+        $('.optional').remove();
+        $('.tab').find('i').removeClass("up");
         init();
     })
     // 确定修改事件
@@ -331,7 +377,7 @@ $(function () {
             "value": JSON.stringify(obj)
         }, function (r) {
             if (r.success) {
-                window.location.replace('/jyapp/vipsubscribe/submitEditSubFinish');
+                window.location.replace('/front/vipsubscribe/submitEditSubFinish');
             }
             $('#enter').removeAttr("disabled");
         }, false);
@@ -342,4 +388,4 @@ function theSameAs(select) {
     let tmp1 = getAreaClassArr(select);
     let tmp2 = getAreaClassArr(areaData.data.area);
     return (JSON.stringify(tmp1[0].sort()) === JSON.stringify(tmp2[0].sort())) && (JSON.stringify(tmp1[1].sort()) === JSON.stringify(tmp2[1].sort()));
-}
+}

+ 32 - 5
src/jfw/modules/app/src/web/templates/vipsubscribe/choose_area.html

@@ -466,7 +466,7 @@
                         $(dom).addClass('active').attr('disabled', !canClick).parents().siblings('.tab')
                             .addClass('selected').children('.province').children('.checkbox').attr({
                             "checked": true
-                        })
+                        }).addClass('half');
                     }
                 })
             })
@@ -475,6 +475,7 @@
             //如果选中所有,则转为全国
             if ($(".city").length == $(".city.active").length) {
                 $(".checkbox.other").trigger("click");
+                $(".checkbox").removeClass("half");
                 return
             }
             var tmpSelect = {};
@@ -657,6 +658,9 @@
                 document.querySelector('#' + s).scrollIntoView({block: 'center'});
             })
             $(".select-area-box .tab:not(.municipality)").on('click', function (event) {
+                if (AreaChoose.checkAnimatedRuning()) {
+                    return
+                }
                 if ($(this).next('.tab_content:not(:animated)').css("display") == "block") {
                     $(this).children().children('i').css({
                         "display": "inline-block",
@@ -680,12 +684,19 @@
                     $(".province input").prop('checked', false);
                     $(".city").removeClass('active');
                     $(this).prop('checked', true);
+                    $(".checkbox").removeClass("half");
                 } else {
                     $(".checkbox.other").prop('checked', false);
-                    if ($(this).is(':checked') == false) {
-                        $(this).parent().parent().siblings('.tab_content').children('.city').removeClass('active');
-                        if ($(".province .checkbox:checked").length == 0) {//若没有省份被选中 则选中全国
-                            $(".checkbox.other").prop('checked', true);
+                    if (!$(this).is(':checked')) {
+                        if ($(this).hasClass("half")) {//判断当前是否是半选
+                            $(this).prop("checked", true).removeClass("half");
+                            $(this).parent().parent().siblings('.tab_content').children('.city').addClass('active');
+                        } else {
+                            $(this).parent().parent().siblings('.tab_content').children('.city').removeClass('active');
+                            if ($(".province .checkbox:checked").length == 0) {//若没有省份被选中 则选中全国
+                                $(".checkbox.other").prop('checked', true);
+                                $(".checkbox").removeClass("half");
+                            }
                         }
                     } else {
                         $(this).parent().parent().siblings('.tab_content').children('.city').addClass('active');
@@ -703,6 +714,11 @@
                     var input = $(this).parents('li').find('input.checkbox')
                     window.input = input
                     input.prop('checked', true)
+                    if (isActive != $(this).parent().find('.city').length) {//是否全选
+                        $(this).parent('div').siblings('.tab').find('.province .checkbox').addClass('half');
+                    } else {
+                        $(this).parent('div').siblings('.tab').find('.province .checkbox').removeClass('half');
+                    }
                 } else {
                     $(this).parent('div').siblings('.tab').children().children('.checkbox').prop(
                         'checked', false)
@@ -753,6 +769,17 @@
                 $('.tips_d_money').text('¥' + price);
             }
 
+        },
+        animatedRuning: false,
+        checkAnimatedRuning: function () {
+            if (AreaChoose.animatedRuning) {
+                return true
+            }
+            AreaChoose.animatedRuning = true;
+            setTimeout(function () {
+                AreaChoose.animatedRuning = false;
+            }, 500);
+            return false
         }
     };
 

+ 0 - 2
src/jfw/modules/app/src/web/templates/vipsubscribe/choose_industry.html

@@ -318,8 +318,6 @@
             // 除全部行业外所有按钮都被选中了
             $('#all button').trigger('click');
         }
-        //调整高度
-        $(".select-area-box .list").css("margin-top", $(".result").height() + 20);
     }
 
     function showSelect(arr, canclick) {

+ 3 - 5
src/jfw/modules/app/src/web/templates/vipsubscribe/edit_city_new.html

@@ -35,13 +35,11 @@
 </div>
 <div class="app-layout-content-b">
     <div id="choose_area">
-        <p class="all_area" style="display: none;"> 可选择全部区域</p>
+        <!--<p class="all_area" style="display: none;"> 可选择全部区域</p>-->
         <p class="optional_count"> 可选择省数量:<em class="count"></em> / <span class="total"></span></p>
-        <div class="result">
-            <!-- 首次购买 显示"已选择" -----  升级订阅显示"已新增" -->
-
+        <!--<div class="result">
             <p>已选择:<span class="result_name"></span></p>
-        </div>
+        </div>-->
         <div class="form">
             <div class="select-area-box" style="padding-bottom: 0;">
                 <ul class="area-list">

+ 1 - 1
src/jfw/modules/app/src/web/templates/vipsubscribe/edit_subscribe.html

@@ -103,7 +103,7 @@
 
             //行业展示                 
             if (this.reqData.buyset.buyerclasscount === -1) {
-                $(".edit_item.industry .item_bottom").text("已购买全");
+                $(".edit_item.industry .item_bottom").text("已购买全行业");
             } else {
                 $(".edit_item.industry .item_bottom").text("已购买" + this.reqData.buyset.buyerclasscount + "个行业");
             }

+ 6 - 5
src/jfw/modules/app/src/web/templates/vipsubscribe/edit_subscribe_industry.html

@@ -22,11 +22,12 @@
 </div>
 <div class="app-layout-content-b">
     <main class="choose_industry main">
-        <p class="optional_count"> 可选择行业数量: <em class="count"></em> / <span class="total"></span></p>
-        <div class="result" style="display: block;">
+        <p class="optional_count" style="background: rgba(245,244,249,1);"> 可选择行业数量: <em class="count"></em> / <span
+                    class="total"></span></p>
+        <!--<div class="result" style="display: block;">
             <span class="label">已选择:</span>
             <span class="result_name">全部行业</span>
-        </div>
+        </div>-->
         <div class="form">
             <div class="select-area-box">
                 <ul class="list">
@@ -278,7 +279,7 @@
         showData: function () {
             this.selectlast = this.reqData.industry;
 
-            $('.result .result_name').html(this.reqData.industry.join('、'));
+            //$('.result .result_name').html(this.reqData.industry.join('、'));
 
             $('.industry_item').each(function () {
                 let text = $(this).text();
@@ -394,7 +395,7 @@
             }
             this.reqData.industry = selectedArr;
             var selectedStr = selectedArr.join('、')
-            $('.result .result_name').text(selectedStr)
+            //$('.result .result_name').text(selectedStr)
             if (this.noChange(this.reqData.industry, EditIndustry.selectlast) || this.reqData.industry.length == 0) {
                 $('#enter').attr('disabled', 'disabled');
             } else {

+ 42 - 7
src/jfw/modules/app/src/web/templates/vipsubscribe/vip_purchase.html

@@ -295,6 +295,7 @@
                     this.industrySelect = JSON.parse(sessionStorage.getItem("vipSubSelectIndustry"));
                 }
                 {{if eq .T.orderType 5 }}
+                $('#payHandle').text("立即续费");
                 //即将到期 回显已购买
                 if (!sessionStorage.getItem("vipSubSelectArea") || !sessionStorage.getItem("vipSubSelectIndustry")) {
                     $DoPost("/subscribepay/editSub/getSubBuyMsg", {}, function (r) {
@@ -315,7 +316,33 @@
                     }, false)
                 }
                 {{end}}
+                {{if .T.again}}    //再次购买回显
+                {{if eq .T.again 1 }}
+                var orderCode = getParam("orderCode")
+                if (!sessionStorage.getItem("vipSubSelectArea") || !sessionStorage.getItem("vipSubSelectIndustry")) {
+                    $DoPost("/subscribepay/orderListDetails/getVipOrderInfo", {"orderCode": orderCode}, function (r) {
+                        if (!$.isEmptyObject(r.data.area)) {
+                            purchase.areaSelect = r.data.area
+                        } else {
+                            purchase.areaSelect = {"全国": []}
+                        }
+                        if (r.data.industry.length != 0) {
+                            purchase.industrySelect = r.data.industry
+                        } else {
+                            purchase.industrySelect = ["全部行业"]
+                        }
+//                          if (r.timeSelect!=undefined&&r.company!=undefined){
+//                         		purchase.timeSelect=[r.timeSelect,r.company];
+//                          }
+                        $(".weui-icon-checked").click();
+                        sessionStorage.setItem("vipSubSelectArea", JSON.stringify(purchase.areaSelect));
+                        sessionStorage.setItem("vipSubSelectIndustry", JSON.stringify(purchase.industrySelect));
+                        //sessionStorage.setItem("vipSubSelectTime", JSON.stringify(purchase.timeSelect));
 
+                    }, false)
+                }
+                {{end}}
+                {{end}}
                 if (sessionStorage.getItem("vipSubSelectTime")) {
                     this.timeSelect = JSON.parse(sessionStorage.getItem("vipSubSelectTime"));
                 }
@@ -350,9 +377,9 @@
                 }
             }
 
-            if (!$.isEmptyObject(data) && !this.areaSelect["一个省"]) {
+            /*if (!$.isEmptyObject(data) && !this.areaSelect["一个省"]) {
                 $(".choose_area").val(provinceArr.join(" ") + " " + cityArr.join(" "));
-            }
+            }*/
 
             if (!$.isEmptyObject(this.areaSelect) && !this.areaSelect["全国"] && !this.areaSelect["一个省"]) { //选择有行业信息 且不是全国
                 var tipTxt = "已选择 ";
@@ -361,7 +388,12 @@
                     if (provinceArr.length > 0) tipTxt += "、";
                     tipTxt += cityArr.length + " 个地市";
                 }
-                $(".add_tips.area").text(tipTxt).css("display", "");
+                $(".choose_area").val(tipTxt);
+                //$(".add_tips.area").text(tipTxt).css("display", "");
+            } else if (!$.isEmptyObject(this.areaSelect) && this.areaSelect["全国"]) {
+                $(".choose_area").val("全国");
+            } else {
+                $(".choose_area").val("");
             }
         },
         showPrice: function () {
@@ -386,12 +418,15 @@
         },
         showIndustry: function () {
             let data = this.industrySelect;
-            if (data.length > 0 && data[0] != "一个行业") {
+            /*if (data.length > 0 && data[0] != "一个行业") {
                 $(".choose_industry").val(data.join(" "));
-            }
+            }*/
             if (this.industrySelect.length > 0 && this.industrySelect[0] != "全部行业" && this.industrySelect[0] != "一个行业") { //选择有行业信息
-                var tipTxt = "已选择 ";
-                $(".add_tips.industry").text(tipTxt + this.industrySelect.length + " 个行业").css("display", "");
+                $(".choose_industry").val("已选择 " + this.industrySelect.length + " 个行业");
+            } else if (this.industrySelect.length > 0 && this.industrySelect[0] == "全部行业") {
+                $(".choose_industry").val("全部行业");
+            } else {
+                $(".choose_industry").val("");
             }
         },
         showTime: function () {

+ 5 - 0
src/jfw/modules/app/src/web/templates/weixin/search/mainSearch.html

@@ -780,7 +780,12 @@
 </script>
 </div>
 {{end}}
+<script src="/jyapp/js/fastclick.js?v={{Msg "seo" "version"}}"></script>
 <script type="text/javascript">
+	$(function() {
+	    // 解决ios系统click 事件300毫秒的延迟
+	    FastClick.attach(document.body);
+	});
  	sessionStorage.removeItem("readClause");
 	if(sessionStorage.onceTipUpdate != "1"){
 		localStorage.removeItem("onceTipUpdate");

+ 58 - 0
src/jfw/modules/subscribepay/README.md

@@ -0,0 +1,58 @@
+/**************************微信模板消息**************************/
+模版ID
+owspgSN6Tn3z0Olx4odQTLqg9JfiMi30SlZBPDrxlOc
+开发者调用模版消息接口时需提供模版ID
+标题
+续费提醒
+行业
+IT科技 - 互联网|电子商务
+详细内容
+{{first.DATA}}
+账号名:{{keyword1.DATA}}
+用户ID:{{keyword2.DATA}}
+服务项目:{{keyword3.DATA}}
+过期时间:{{keyword4.DATA}}
+{{remark.DATA}}
+
+模版ID
+tI13Li1FN0K6YY3fSn527-HcYIKfgrQ-k0qYxsESM3k
+开发者调用模版消息接口时需提供模版ID
+标题
+订单未支付提醒
+行业
+IT科技 - 互联网|电子商务
+详细内容
+{{first.DATA}}
+下单时间:{{keyword1.DATA}}
+订单号:{{keyword2.DATA}}
+待付金额:{{keyword3.DATA}}
+订单信息:{{keyword4.DATA}}
+{{remark.DATA}}
+
+模版ID
+xDdO4kzp5_zv-QXqr4L38RWjzp1RJLzJCTxwmutXqQA
+开发者调用模版消息接口时需提供模版ID
+标题
+购买成功通知
+行业
+IT科技 - 互联网|电子商务
+详细内容
+{{first.DATA}}
+商品名称:{{keyword1.DATA}}
+订单编号:{{keyword2.DATA}}
+购买时间:{{keyword3.DATA}}
+到期时间:{{keyword4.DATA}}
+{{remark.DATA}}
+
+模版ID
+6SMSSwz5c26YjMac71CD4PbDA_GB-MTtRxmC7BdeWRk
+开发者调用模版消息接口时需提供模版ID
+标题
+试用版到期提醒
+行业
+IT科技 - 互联网|电子商务
+详细内容
+{{first.DATA}}
+账号:{{keyword1.DATA}}
+到期时间:{{keyword2.DATA}}
+{{remark.DATA}}

+ 27 - 12
src/jfw/modules/subscribepay/src/config/config.go

@@ -39,22 +39,37 @@ type config struct {
 	WxTplExpire    string
 	OrderCountdown interface{}
 }
-type timetaskConfig struct {
-	ExpireRemind   string
-	SyncVipUpgrade string
-	CheckIsExpire  string
+type timeTaskConfig struct {
+	ExpireRemind   string   //到期提醒
+	SyncVipUpgrade string   //同步未及时生效的数据
+	CheckIsExpire  string   //定时更新用户vip状态
+	UnpaidRemind   struct { //未支付订单提醒
+		AfterOrder   int64 //下单后n小时提醒
+		BeforeExpire int64 //n小时自动关闭提醒
+		Duration     int   //定时任务时间间隔
+	}
 }
 type messageConfig struct {
-	WxTplExpire struct {
-		Id       string
-		First    *qrpc.TmplItem
-		Keyword2 *qrpc.TmplItem
-		Keyword3 *qrpc.TmplItem
-	}
+	WxTpl_OnTrial_SoonExpire *WxTplMsg //试用即将到期
+	WxTpl_OnTrial_Expired    *WxTplMsg //试用已到期
+	WxTpl_SoonExpire         *WxTplMsg //即将到期
+	WxTpl_Expired            *WxTplMsg //已到期
+	WxTpl_Unpaid             *WxTplMsg //未支付订单
+	WxTpl_PaySuccess         *WxTplMsg //支付成功
+}
+
+type WxTplMsg struct {
+	Id       string
+	First    *qrpc.TmplItem
+	Keyword1 *qrpc.TmplItem
+	Keyword2 *qrpc.TmplItem
+	Keyword3 *qrpc.TmplItem
+	Keyword4 *qrpc.TmplItem
+	Remark   *qrpc.TmplItem
 }
 
 var Config *config
-var TimetaskConfig *timetaskConfig
+var TimeTaskConfig *timeTaskConfig
 var MessageConfig *messageConfig
 
 //发送邮件邮箱
@@ -70,7 +85,7 @@ var Wxoauth, Wxoauthinfo string
 func init() {
 	//程序配置文件
 	qutil.ReadConfig(&Config)
-	qutil.ReadConfig("./timetask.json", &TimetaskConfig)
+	qutil.ReadConfig("./timetask.json", &TimeTaskConfig)
 	qutil.ReadConfig("./message.json", &MessageConfig)
 	for _, v := range Config.Mail {
 		mail := &mail.GmailAuth{

+ 62 - 3
src/jfw/modules/subscribepay/src/message.json

@@ -1,15 +1,74 @@
 {
-	"wxTplExpire": {
+	"WxTpl_OnTrial_SoonExpire": {
+		"id": "_2qGuk_KkOQtiO8oV_7ZOCWfjX2FQjs6pUDYBHkpygI",
+		"first":{
+			"value":"您试用的VIP订阅服务即将到期,如需获取更多精准招标信息,请及时购买。"
+		},
+		"remark": {
+			"value":"感谢您的试用,如已购买,请忽略此信息。"
+		}
+	},
+	"WxTpl_OnTrial_Expired": {
+		"id": "_2qGuk_KkOQtiO8oV_7ZOCWfjX2FQjs6pUDYBHkpygI",
+		"first":{
+			"value":"您试用的VIP订阅服务已到期,如需获取更多精准招标信息,请及时购买。"
+		},
+		"remark": {
+			"value":"感谢您的试用,如已购买,请忽略此信息。"
+		}
+	},
+	"WxTpl_SoonExpire": {
+		"id": "3_VPNbD7fmfd8BsdjLW-a7FOP4wIhEGV7Jx-11-9c7g",
+		"first":{
+			"value":"您的VIP订阅服务即将到期,为了不影响您所获取更全面的招标信息,请您及时续费。"
+		},
+		"keyword2": {
+			"value":"-"
+		},
+		"keyword3": {
+			"value":"VIP订阅"
+		},
+		"remark": {
+			"value":"如已续费,请忽略此信息。"
+		}
+	},
+	"WxTpl_Expired": {
 		"id": "3_VPNbD7fmfd8BsdjLW-a7FOP4wIhEGV7Jx-11-9c7g",
 		"first":{
-			"value":"您的VIP订阅服务%s到期,为不影响您的使用。请立即续费",
-			"color":"#FF0000"
+			"value":"您的VIP订阅服务已到期,如需获取更多精准招标信息,请再次购买。"
 		},
 		"keyword2": {
 			"value":"-"
 		},
 		"keyword3": {
 			"value":"VIP订阅"
+		},
+		"remark": {
+			"value":"如已续费,请忽略此信息。"
+		}
+	},
+	"WxTpl_Unpaid": {
+		"id": "9oRmG95lUQZMH-ZVTryoKpAuZTDQWVEsJBhZmJp_41c",
+		"first":{
+			"value":"您的订单 %s 处于未支付状态,为了使您获取更多招标信息,请您及时付款。"
+		},
+		"keyword3": {
+			"value":"%s元"
+		},
+		"keyword4": {
+			"value":"VIP订阅%s"
+		},
+		"remark": {
+			"value":"订单将在%.0f小时后自动关闭,请及时支付。"
+		}
+	},
+	"WxTpl_PaySuccess": {
+		"id": "Pr6QjYUit1Tc7GMHhziU5pnfYAiKsa11l2NMGdHO-NU",
+		"first":{
+			"value":"您的订单 %s 已支付成功,剑鱼标讯将为您提供更多精准招标信息,感谢您的购买!"
+		},
+		"keyword1": {
+			"value":"VIP订阅%s"
 		}
 	}
 }

+ 13 - 26
src/jfw/modules/subscribepay/src/service/afterPay.go

@@ -306,37 +306,24 @@ func (a *AfterPay) GetUserInfo() error {
 			data := qutil.ObjToMap((*userData)["o_vipjy"])
 			i_vip_status := qutil.IntAll((*userData)["i_vip_status"])
 			//区域
-			_area := qutil.ObjToMap((*data)["o_area"].(interface{}))
-			var area_i = 0
-			var area_j = 0
-			for _, v := range *_area {
-				if len(v.([]interface{})) == 0 {
-					area_i += 1
-				} else {
-
-					area_j += len(v.([]interface{}))
-				}
+			_buyset := qutil.ObjToMap((*data)["o_buyset"].(interface{}))
+			var area_i = qutil.IntAll((*_buyset)["areacount"])
+			var citys = qutil.ObjToMap((*_buyset)["citys"].(interface{}))
+			var city_i = 0
+			for _, cv := range *citys {
+				city_i += qutil.IntAll(cv.(int))
 			}
-			if area_i != 0 && area_j != 0 {
-				(*data)["o_area"] = strconv.Itoa(area_i) + "个省级区域、" + strconv.Itoa(area_j) + "个地市"
-			} else if area_i == 0 && area_j != 0 {
-				(*data)["o_area"] = strconv.Itoa(area_j) + "个地市"
-			} else if area_i != 0 && area_j == 0 {
+			if area_i != -1 && city_i != 0 {
+				(*data)["o_area"] = strconv.Itoa(area_i) + "个省级区域、" + strconv.Itoa(city_i) + "个地市"
+			} else if area_i == -1 && city_i != 0 {
+				(*data)["o_area"] = strconv.Itoa(city_i) + "个地市"
+			} else if area_i != -1 && city_i == 0 {
 				(*data)["o_area"] = strconv.Itoa(area_i) + "个省级区域"
 			} else {
 				(*data)["o_area"] = "全国"
 			}
 			//采购行业
-			//_buyClass := (*data)["a_buyerclass"].([]interface{})
-			//			var buyClass = ""
-			//			for _, v := range _buyClass {
-			//				buyClass += v.(string) + "、"
-			//			}
-			//			if buyClass == "" {
-			//				(*data)["a_buyerclass"] = "全行业"
-			//			} else {
-			//				(*data)["a_buyerclass"] = strings.TrimRight(buyClass, "、")
-			//			}
+			(*data)["a_buyerclass"] = qutil.IntAll((*_buyset)["buyerclasscount"])
 			//有效日期
 			var _starttime = (*userData)["l_vip_starttime"]
 			(*userData)["l_vip_starttime"] = strings.Replace(qutil.FormatDateWithObj(&_starttime, qutil.Date_Short_Layout), "-", ".", -1)
@@ -371,7 +358,7 @@ func (a *AfterPay) GetUserInfo() error {
 			} 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)["expRemind"] = "-1" //已经到期
 			}
 			//信息类型
 			if (*data)["a_infotype"] != nil {

+ 10 - 4
src/jfw/modules/subscribepay/src/service/vipRenewUpgrade.go

@@ -49,7 +49,7 @@ func (this *RenewUpgrade) GetBuyMsg() {
 		orderdata := util.Mysql.FindOne("dataexport_order", map[string]interface{}{
 			"user_id":      userId,
 			"order_status": 1,
-		}, "filter", "create_time desc")
+		}, "filter,order_code", "create_time desc")
 		vmsg := entity.VipSimpleMsg{}
 		if len(*orderdata) > 0 && *orderdata != nil {
 			filterStr := qutil.ObjToString((*orderdata)["filter"])
@@ -73,6 +73,7 @@ func (this *RenewUpgrade) GetBuyMsg() {
 				"buyset":      buyset,
 				"allarea":     allArea,
 				"allindustry": allIndustry,
+				"orderCode":   (*orderdata)["order_code"],
 			}
 			this.ServeJson(dataArr)
 		}
@@ -187,9 +188,10 @@ func (this *RenewUpgrade) RenewUpgradeCreateOrder() {
 		//		}
 		filter := entity.VipSimpleMsg{}
 		if pay_source == "Renew" {
+			vipjy := (*res)["o_vipjy"].(map[string]interface{})
 			filter = entity.VipSimpleMsg{
-				area,
-				industry,
+				qutil.ObjToMap(vipjy["o_area"]),
+				qutil.ObjArrToStringArr(vipjy["a_buyerclass"].([]interface{})),
 				nil,
 				nil,
 				date_count,
@@ -233,7 +235,9 @@ func (this *RenewUpgrade) RenewUpgradeCreateOrder() {
 					Leng := len(industry) - reduce
 					if len(industry) > 0 {
 						if industry[0] != "no" {
+							log.Println("industry", industry)
 							industry = industry[0:Leng]
+							log.Println("industry", industry)
 						}
 					}
 				}
@@ -378,7 +382,7 @@ func (this *RenewUpgrade) GetExprie() {
 	orderdata := util.Mysql.FindOne("dataexport_order", map[string]interface{}{
 		"id":      orderId,
 		"user_id": userId,
-	}, "filter", "")
+	}, "filter,order_code", "")
 	vmsg := entity.VipSimpleMsg{}
 	if orderdata != nil && len(*orderdata) > 0 {
 		filterStr := qutil.ObjToString((*orderdata)["filter"])
@@ -389,8 +393,10 @@ func (this *RenewUpgrade) GetExprie() {
 		dataArr := map[string]interface{}{
 			"area":       vmsg.Area,
 			"buyerclass": vmsg.Industry,
+			"orderCode":  (*orderdata)["order_code"],
 			"vipStatus":  vipStatus,
 		}
+		log.Println(dataArr)
 		this.ServeJson(dataArr)
 	}
 }

+ 1 - 0
src/jfw/modules/subscribepay/src/service/vipSubscribePay.go

@@ -138,6 +138,7 @@ func (this *SubVipPayOrder) CreateOrder() {
 			timeStamp := qutil.Int64All((*userData)["l_vip_endtime"])
 			startTime := time.Unix(timeStamp, 0)
 			endTime := util.GetDATE(filter.Cycleunit, filter.Cyclecount, timeStamp)
+			insertMap["vip_type"] = 1
 			insertMap["vip_starttime"] = qutil.FormatDate(&startTime, qutil.Date_Full_Layout)
 			insertMap["vip_endtime"] = qutil.FormatDate(&endTime, qutil.Date_Full_Layout)
 		}

+ 6 - 1
src/jfw/modules/subscribepay/src/timetask.json

@@ -1,5 +1,10 @@
 {
 	"expireRemind": "10:00",
 	"syncVipUpgrade": "00:00",
-	"checkIsExpire": "00:00"
+	"checkIsExpire": "00:00",
+	"unpaidRemind": {
+		"afterOrder": 7200,
+		"beforeExpire": 7200,
+		"duration": 10
+	}
 }

+ 56 - 27
src/jfw/modules/subscribepay/src/timetask/timetask.go

@@ -16,8 +16,6 @@ const (
 	threeday = 259200
 )
 
-var Se = qutil.SimpleEncrypt{Key: "topnet"}
-
 func Run() {
 	go syncVipUpgrade()
 	go checkIsExpire()
@@ -26,7 +24,7 @@ func Run() {
 
 //vip升级 下个月生效 同步
 func syncVipUpgrade() {
-	crontab(true, TimetaskConfig.SyncVipUpgrade, func() {
+	crontab(true, TimeTaskConfig.SyncVipUpgrade, func() {
 		log.Println("定时任务,开始同步vip升级数据")
 		sess := util.MQFW.GetMgoConn()
 		defer util.MQFW.DestoryMongoConn(sess)
@@ -73,7 +71,7 @@ func syncVipUpgrade() {
 
 //每天0点 检查试用、vip服务是否到期
 func checkIsExpire() {
-	crontab(true, TimetaskConfig.CheckIsExpire, func() {
+	crontab(true, TimeTaskConfig.CheckIsExpire, func() {
 		log.Println("定时任务,开始更新vip状态")
 		now_unix := time.Now().Unix()
 		sess := util.MQFW.GetMgoConn()
@@ -103,16 +101,15 @@ func checkIsExpire() {
 				delSess := util.MQFW.GetMgoConn()
 				defer util.MQFW.DestoryMongoConn(delSess)
 				for _, pushColl := range []string{"pushspace", "pushspace_temp", "pushspace_vip", "pushspace_fail", "pushspace_project"} {
-					log.Println("用户", _id, "已到期开始删除", pushColl, "表数据。。。")
 					_, err := delSess.DB("qfw").C(pushColl).RemoveAll(map[string]interface{}{"userid": _id})
 					if err != nil {
 						log.Println("用户", _id, "已到期删除", pushColl, "表数据出错", err)
 					} else {
-						log.Println("用户", _id, "已到期删除", pushColl, "表数据结束。。。")
+						log.Println("用户", _id, "已到期删除", pushColl, "表数据")
 					}
 				}
 				log.Println("用户", _id, i_vip_status, l_vip_endtime, "修改已到期状态")
-			} else if l_vip_endtime-now_unix <= threeday && i_vip_expire_tip != 1 && i_vip_expire_tip != -1 {
+			} else if l_vip_endtime-now_unix <= threeday && i_vip_expire_tip != 1 {
 				updateOk := util.MQFW.UpdateById("user", _id, map[string]interface{}{
 					"$set": map[string]interface{}{
 						"i_vip_expire_tip": 1,
@@ -128,8 +125,8 @@ func checkIsExpire() {
 
 //即将到期或者已到期发推送消息
 func expireRemind() {
-	crontab(false, TimetaskConfig.ExpireRemind, func() {
-		log.Println("定时任务,开始推送消息")
+	crontab(true, TimeTaskConfig.ExpireRemind, func() {
+		log.Println("定时任务,到期提醒,开始推送消息")
 		sess := util.MQFW.GetMgoConn()
 		defer util.MQFW.DestoryMongoConn(sess)
 		it := sess.DB("qfw").C("user").Find(map[string]interface{}{
@@ -142,7 +139,6 @@ func expireRemind() {
 			"s_jpushid":        1,
 			"s_opushid":        1,
 			"s_appponetype":    1,
-			"i_applystatus":    1,
 			"s_nickname":       1,
 			"i_ispush":         1,
 			"i_vip_status":     1,
@@ -152,19 +148,17 @@ func expireRemind() {
 		}).Iter()
 		for m := make(map[string]interface{}); it.Next(&m); {
 			_id := qutil.BsonIdToSId(m["_id"])
-			i_vip_expire_tip := qutil.Int64All(m["i_vip_expire_tip"])
+			i_vip_status := qutil.IntAll(m["i_vip_status"])
+			i_vip_expire_tip := qutil.IntAll(m["i_vip_expire_tip"])
 			wxPushOk, appPushOk := false, false
 			if i_vip_expire_tip == 1 || i_vip_expire_tip == 2 {
 				tp := "will"
-				tpMsg := "即将"
 				if i_vip_expire_tip == 2 {
 					tp = "exprie"
-					tpMsg = "已"
 				}
 				l_vip_starttime := qutil.Int64All(m["l_vip_starttime"])
 				l_vip_endtime := qutil.Int64All(m["l_vip_endtime"])
 				s_m_openid := qutil.ObjToString(m["s_m_openid"])
-				i_applystatus := qutil.IntAll(m["i_applystatus"])
 				isPushWx := qutil.IntAllDef(m["i_ispush"], 1)
 				s_jpushid := qutil.ObjToString(m["s_jpushid"])
 				s_opushid := qutil.ObjToString(m["s_opushid"])
@@ -178,45 +172,80 @@ func expireRemind() {
 				if order != nil && len(*order) > 0 {
 					orderId = fmt.Sprint((*order)["id"])
 				}
-				log.Println("推送消息", _id, "i_vip_status", m["i_vip_status"], "orderId", orderId, "l_vip_starttime", l_vip_starttime, "l_vip_endtime", l_vip_endtime, "i_vip_expire_tip", i_vip_expire_tip, "s_m_openid", s_m_openid, "isPushWx", isPushWx, "i_applystatus", i_applystatus, "s_appponetype", s_appponetype, "s_jpushid", s_jpushid, "s_opushid", s_opushid)
-				if isPushWx == 1 && i_applystatus == 1 && s_m_openid != "" {
+				log.Println("到期提醒,推送消息", _id, "i_vip_status", i_vip_status, "orderId", orderId, "l_vip_starttime", l_vip_starttime, "l_vip_endtime", l_vip_endtime, "i_vip_expire_tip", i_vip_expire_tip, "s_m_openid", s_m_openid, "isPushWx", isPushWx, "s_appponetype", s_appponetype, "s_jpushid", s_jpushid, "s_opushid", s_opushid)
+				if isPushWx == 1 && s_m_openid != "" {
+					tplId, first_value, keyword1_value, keyword2_value, keyword3_value, keyword4_value, remark := "", "", "", "", "", "", ""
+					switch i_vip_status {
+					case 1, -1:
+						if i_vip_expire_tip == 1 {
+							tplId = MessageConfig.WxTpl_OnTrial_SoonExpire.Id
+							first_value = MessageConfig.WxTpl_OnTrial_SoonExpire.First.Value
+							remark = MessageConfig.WxTpl_OnTrial_SoonExpire.Remark.Value
+						} else if i_vip_expire_tip == 2 {
+							tplId = MessageConfig.WxTpl_OnTrial_Expired.Id
+							first_value = MessageConfig.WxTpl_OnTrial_Expired.First.Value
+							remark = MessageConfig.WxTpl_OnTrial_Expired.Remark.Value
+						}
+						keyword1_value = qutil.ObjToString(m["s_nickname"])
+						keyword2_value = qutil.FormatDateByInt64(&l_vip_endtime, qutil.Date_Short_Layout)
+						break
+					case 2, -2:
+						if i_vip_expire_tip == 1 {
+							tplId = MessageConfig.WxTpl_SoonExpire.Id
+							first_value = MessageConfig.WxTpl_SoonExpire.First.Value
+							keyword2_value = MessageConfig.WxTpl_SoonExpire.Keyword2.Value
+							keyword3_value = MessageConfig.WxTpl_SoonExpire.Keyword3.Value
+							remark = MessageConfig.WxTpl_SoonExpire.Remark.Value
+						} else if i_vip_expire_tip == 2 {
+							tplId = MessageConfig.WxTpl_Expired.Id
+							first_value = MessageConfig.WxTpl_Expired.First.Value
+							keyword2_value = MessageConfig.WxTpl_Expired.Keyword2.Value
+							keyword3_value = MessageConfig.WxTpl_Expired.Keyword3.Value
+							remark = MessageConfig.WxTpl_Expired.Remark.Value
+						}
+						keyword1_value = qutil.ObjToString(m["s_nickname"])
+						keyword4_value = qutil.FormatDateByInt64(&l_vip_endtime, qutil.Date_Short_Layout)
+						break
+					}
 					tmplData := map[string]*qrpc.TmplItem{
 						"first": &qrpc.TmplItem{
-							Value: fmt.Sprintf(MessageConfig.WxTplExpire.First.Value, tpMsg),
-							Color: MessageConfig.WxTplExpire.First.Color,
+							Value: first_value,
 						},
 						"keyword1": &qrpc.TmplItem{
-							Value: qutil.ObjToString(m["s_nickname"]),
+							Value: keyword1_value,
 						},
 						"keyword2": &qrpc.TmplItem{
-							Value: MessageConfig.WxTplExpire.Keyword2.Value,
+							Value: keyword2_value,
 						},
 						"keyword3": &qrpc.TmplItem{
-							Value: MessageConfig.WxTplExpire.Keyword3.Value,
+							Value: keyword3_value,
 						},
 						"keyword4": &qrpc.TmplItem{
-							Value: qutil.FormatDateByInt64(&l_vip_endtime, qutil.Date_Short_Layout),
+							Value: keyword4_value,
+						},
+						"remark": &qrpc.TmplItem{
+							Value: remark,
 						},
 					}
 					wxPushOk, _ = qrpc.WxSendTmplMsg(Config.Weixinrpc, &qrpc.WxTmplMsg{
 						OpenId:   s_m_openid,
-						TplId:    MessageConfig.WxTplExpire.Id,
+						TplId:    tplId,
 						TmplData: tmplData,
-						Url:      Config.WebDomain + "/front/sess/" + Se.EncodeString(s_m_openid+",uid,"+strconv.Itoa(int(time.Now().Unix()))+",expireTip") + "__" + tp + "__" + fmt.Sprint(orderId) + "__" + fmt.Sprint(l_vip_starttime) + "__" + fmt.Sprint(l_vip_endtime),
+						Url:      Config.WebDomain + "/front/sess/" + util.Se_Topnet.EncodeString(s_m_openid+",uid,"+strconv.Itoa(int(time.Now().Unix()))+",msgremind") + "__" + fmt.Sprint("type=%s&orderid=%d", tp, orderId),
 					})
-					log.Println("微信推送", _id, wxPushOk)
+					log.Println("到期提醒,微信推送", _id, wxPushOk)
 				}
 			}
 			if wxPushOk || appPushOk {
 				util.MQFW.UpdateById("user", _id, map[string]interface{}{
 					"$set": map[string]interface{}{
-						"i_vip_expire_tip": -i_vip_expire_tip,
+						"i_vip_expire_tip": 0,
 					},
 				})
 			}
 			m = make(map[string]interface{})
 		}
-		log.Println("定时任务,推送消息结束")
+		log.Println("定时任务,到期提醒,推送消息结束")
 	})
 }
 

+ 228 - 0
src/jfw/modules/subscribepay/src/util/msgremind.go

@@ -0,0 +1,228 @@
+//未支付订单提醒
+package util
+
+import (
+	. "config"
+	"fmt"
+	"log"
+	"math"
+	"qfw/util"
+	qrpc "qfw/util/rpc"
+	"strconv"
+	"strings"
+	"sync"
+	"time"
+)
+
+var MsgRemind = &msgRemind{
+	unpaidOrders: &sync.Map{},
+}
+
+type msgRemind struct {
+	unpaidOrders *sync.Map
+}
+
+type unpaidOrder struct {
+	orderId      int    //订单id
+	orderCode    string //订单编号
+	userId       string //用户id
+	createTime   int64  //下单时间
+	remindStatus int    //1-下单时间2小时提醒 2-剩余2小时自动关闭时再次提醒
+	vipType      int    //-1:直接购买 0:试用 1:续费 2:升级
+	orderMoney   int    //订单金额
+}
+
+/*新的订单存库以后,再存入内存中
+ *@param orderId 订单id
+ *@param orderMoney 订单金额
+ *@param vipType -1:直接购买 0:试用 1:续费 2:升级
+ *@param remindStatus 1-下单时间2小时提醒 2-剩余2小时自动关闭时再次提醒
+ *@param orderCode 订单编号
+ *@param userId 用户id
+ *@param createTime 购买时间
+ */
+func (m *msgRemind) Add(orderId, orderMoney, vipType, remindStatus int, orderCode, userId string, createTime int64) {
+	log.Println("未支付待提醒订单加入", orderId, orderCode, userId, createTime)
+	m.unpaidOrders.Store(orderId, &unpaidOrder{
+		orderCode:    orderCode,
+		userId:       userId,
+		createTime:   createTime,
+		orderId:      orderId,
+		orderMoney:   orderMoney,
+		vipType:      vipType,
+		remindStatus: remindStatus,
+	})
+}
+
+/*
+ *订单支付成功以后,消息通知处理
+ *@param orderId 订单id
+ *@param orderCode 订单编号
+ *@param userId 用户id
+ *@param createTime 购买时间
+ *@param vipType -1:直接购买 0:试用 1:续费 2:升级
+ */
+func (m *msgRemind) PaySuccess(orderId int, orderCode, userId, createTime string, vipType int) {
+	go func() {
+		defer util.Catch()
+		log.Println("支付成功以后,消息提醒处理", orderId, orderCode, userId, createTime)
+		m.unpaidOrders.Delete(orderId)
+		user, ok := MQFW.FindById("user", userId, `{"s_m_openid":1,"s_jpushid":1,"s_opushid":1,"s_appponetype":1,"i_ispush":1,"l_vip_endtime":1}`)
+		if !ok || user == nil || len(*user) == 0 {
+			return
+		}
+		isPushWx := util.IntAllDef((*user)["i_ispush"], 1)
+		s_m_openid, _ := (*user)["s_m_openid"].(string)
+		s_jpushid, _ := (*user)["s_jpushid"].(string)
+		s_opushid, _ := (*user)["s_opushid"].(string)
+		s_appponetype, _ := (*user)["s_appponetype"].(string)
+		log.Println("支付成功,推送消息", userId, "s_m_openid", s_m_openid, "s_jpushid", s_jpushid, "s_opushid", s_opushid, "s_appponetype", s_appponetype)
+		if isPushWx == 1 {
+			l_vip_endtime := (*user)["l_vip_endtime"]
+			expireTime := util.FormatDateWithObj(&l_vip_endtime, util.Date_Short_Layout)
+			wxPushOk, _ := qrpc.WxSendTmplMsg(Config.Weixinrpc, &qrpc.WxTmplMsg{
+				OpenId: s_m_openid,
+				TplId:  MessageConfig.WxTpl_PaySuccess.Id,
+				TmplData: map[string]*qrpc.TmplItem{
+					"first": &qrpc.TmplItem{
+						Value: fmt.Sprintf(MessageConfig.WxTpl_PaySuccess.First.Value, orderCode),
+					},
+					"keyword1": &qrpc.TmplItem{
+						Value: fmt.Sprintf(MessageConfig.WxTpl_PaySuccess.Keyword1.Value, m.getVipType(vipType)),
+					},
+					"keyword2": &qrpc.TmplItem{
+						Value: orderCode,
+					},
+					"keyword3": &qrpc.TmplItem{
+						Value: strings.Split(createTime, " ")[0],
+					},
+					"keyword4": &qrpc.TmplItem{
+						Value: expireTime,
+					},
+				},
+				Url: Config.WebDomain + "/front/sess/" + Se_Topnet.EncodeString(s_m_openid+",uid,"+strconv.Itoa(int(time.Now().Unix()))+",msgremind") + "__" + fmt.Sprintf("type=paid&orderid=%d", orderId),
+			})
+			log.Println("支付成功,微信推送", userId, wxPushOk)
+		}
+	}()
+}
+
+func (m *msgRemind) getVipType(vipType int) string {
+	switch vipType {
+	case 0:
+		return "(试用)"
+	case 1:
+		return "(续费)"
+	case 2:
+		return "(升级)"
+	}
+	return ""
+}
+
+func (m *msgRemind) run() {
+	duration := time.Duration(TimeTaskConfig.UnpaidRemind.Duration) * time.Minute
+	log.Println("未支付订单定时任务run after", duration)
+	time.AfterFunc(duration, func() {
+		defer util.Catch()
+		m.unpaidOrders.Range(func(k interface{}, v interface{}) bool {
+			orderId, _ := k.(int)
+			unpaidOrder, _ := v.(*unpaidOrder)
+			now_unix := time.Now().Unix()
+			remind_status := 0
+			//剩余2小时
+			if unpaidOrder.remindStatus != 2 && now_unix >= unpaidOrder.createTime+259200-TimeTaskConfig.UnpaidRemind.BeforeExpire {
+				remind_status = 2
+			} else if unpaidOrder.remindStatus == 0 && now_unix > unpaidOrder.createTime+TimeTaskConfig.UnpaidRemind.AfterOrder { //下单时间后2小时未支付
+				remind_status = 1
+			}
+			if remind_status == 0 {
+				return true
+			}
+			user, ok := MQFW.FindById("user", unpaidOrder.userId, `{"s_m_openid":1,"s_jpushid":1,"s_opushid":1,"s_appponetype":1,"i_ispush":1}`)
+			if !ok || user == nil || len(*user) == 0 {
+				return true
+			}
+			isPushWx := util.IntAllDef((*user)["i_ispush"], 1)
+			s_m_openid, _ := (*user)["s_m_openid"].(string)
+			s_jpushid, _ := (*user)["s_jpushid"].(string)
+			s_opushid, _ := (*user)["s_opushid"].(string)
+			s_appponetype, _ := (*user)["s_appponetype"].(string)
+			log.Println("未支付订单,推送消息", unpaidOrder.userId, "remind_status", remind_status, "i_ispush", isPushWx, "s_m_openid", s_m_openid, "s_jpushid", s_jpushid, "s_opushid", s_opushid, "s_appponetype", s_appponetype)
+			wxPushOk, appPushOk := false, false
+			if isPushWx == 1 {
+				tmplData := map[string]*qrpc.TmplItem{
+					"first": &qrpc.TmplItem{
+						Value: fmt.Sprintf(MessageConfig.WxTpl_Unpaid.First.Value, unpaidOrder.orderCode),
+					},
+					"keyword1": &qrpc.TmplItem{
+						Value: util.FormatDateByInt64(&unpaidOrder.createTime, util.Date_Short_Layout),
+					},
+					"keyword2": &qrpc.TmplItem{
+						Value: unpaidOrder.orderCode,
+					},
+					"keyword3": &qrpc.TmplItem{
+						Value: fmt.Sprintf(MessageConfig.WxTpl_Unpaid.Keyword3.Value, fmt.Sprintf("%.2f", float64(unpaidOrder.orderMoney)/100)),
+					},
+					"keyword4": &qrpc.TmplItem{
+						Value: fmt.Sprintf(MessageConfig.WxTpl_Unpaid.Keyword4.Value, m.getVipType(unpaidOrder.vipType)),
+					},
+				}
+				if remind_status == 2 {
+					tmplData["remark"] = &qrpc.TmplItem{
+						Value: fmt.Sprintf(MessageConfig.WxTpl_Unpaid.Remark.Value, math.Ceil(float64(TimeTaskConfig.UnpaidRemind.BeforeExpire)/3600)),
+					}
+				}
+				wxPushOk, _ = qrpc.WxSendTmplMsg(Config.Weixinrpc, &qrpc.WxTmplMsg{
+					OpenId:   s_m_openid,
+					TplId:    MessageConfig.WxTpl_Unpaid.Id,
+					TmplData: tmplData,
+					Url:      Config.WebDomain + "/front/sess/" + Se_Topnet.EncodeString(s_m_openid+",uid,"+strconv.Itoa(int(time.Now().Unix()))+",msgremind") + "__" + fmt.Sprintf("type=unpaid&orderid=%d", orderId),
+				})
+				log.Println("未支付订单,微信推送", unpaidOrder.userId, wxPushOk)
+			}
+			if wxPushOk || appPushOk {
+				if remind_status == 2 {
+					m.unpaidOrders.Delete(orderId)
+				} else {
+					unpaidOrder.remindStatus = 1
+					m.unpaidOrders.Store(orderId, unpaidOrder)
+				}
+				Mysql.Update("dataexport_order", map[string]interface{}{
+					"id": orderId,
+				}, map[string]interface{}{
+					"remind_status": remind_status,
+				})
+			}
+			return true
+		})
+		m.run()
+	})
+}
+
+func init() {
+	go func() {
+		log.Println("开始加载72小时内的订单到内存中。。。")
+		startTime := time.Now().Local().AddDate(0, 0, -3).Format(util.Date_Full_Layout)
+		list := Mysql.SelectBySql("select id,order_code,order_money,user_id,create_time,remind_status,vip_type from dataexport_order where create_time>=? and product_type='VIP订阅' and order_status=0 and (remind_status<>2 or remind_status is null)", startTime)
+		if list == nil {
+			log.Println("加载72小时内的订单到内存中失败")
+			return
+		}
+		for _, v := range *list {
+			order_code, _ := v["order_code"].(string)
+			user_id, _ := v["user_id"].(string)
+			create_time, _ := v["create_time"].(string)
+			if order_code == "" || user_id == "" || create_time == "" {
+				continue
+			}
+			createTime, err := time.ParseInLocation(util.Date_Full_Layout, create_time, time.Local)
+			if err != nil {
+				continue
+			}
+			orderId := util.IntAll(v["id"])
+			MsgRemind.Add(orderId, util.IntAll(v["order_money"]), util.IntAllDef(v["vip_type"], -1), util.IntAll(v["remind_status"]), order_code, user_id, createTime.Unix())
+		}
+		log.Println("加载72小时内的订单到内存中结束。。。", len(*list))
+	}()
+	MsgRemind.run()
+}

+ 3 - 1
src/jfw/modules/subscribepay/src/util/public.go

@@ -1,10 +1,13 @@
 package util
 
 import (
+	qutil "qfw/util"
 	"qfw/util/sms"
 	"strings"
 )
 
+var Se_Topnet = qutil.SimpleEncrypt{Key: "topnet"}
+
 //根据模板发送短信,模板是运营商设定的。
 //第三个参数是可变参数,可以传入多个,但要和模板相匹配
 func SendSMS(tplcode /*模板代码*/, mobile /*手机号码*/ string, param map[string]string) {
@@ -15,4 +18,3 @@ func SendSMS(tplcode /*模板代码*/, mobile /*手机号码*/ string, param map
 	text := strings.Join(tmp, "&")
 	sms.SendSms(mobile, tplcode, text)
 }
-

+ 2 - 2
src/jfw/modules/weixin/src/jrpc/jrpc.go

@@ -40,7 +40,7 @@ func (w *WeiXinRpc) SubscribePush(param *qrpc.NotifyMsg, ret *qrpc.RpcResult) er
 			"first":    weixin.TmplItem{param.Title, util.If(param.Color != "", param.Color, "#0987FF").(string)},
 			"keyword1": weixin.TmplItem{param.Detail, ""},
 			"keyword2": weixin.TmplItem{param.Service, ""},
-			"remark":   weixin.TmplItem{param.Remark, util.If(param.Color != "", param.DetailColor, "#0987FF").(string)},
+			"remark":   weixin.TmplItem{param.Remark, util.If(param.DetailColor != "", param.DetailColor, "#0987FF").(string)},
 		})
 	if err != nil {
 		*ret = qrpc.RpcResult(err.Error())
@@ -58,7 +58,7 @@ func (w *WeiXinRpc) SendPushMsg(param *qrpc.NotifyMsg, ret *qrpc.RpcResult) erro
 			"first":    weixin.TmplItem{param.Title, util.If(param.Color != "", param.Color, "#0987FF").(string)},
 			"keyword1": weixin.TmplItem{param.Detail, ""},
 			"keyword2": weixin.TmplItem{param.Service, ""},
-			"remark":   weixin.TmplItem{param.Remark, util.If(param.Color != "", param.DetailColor, "#0987FF").(string)},
+			"remark":   weixin.TmplItem{param.Remark, util.If(param.DetailColor != "", param.DetailColor, "#0987FF").(string)},
 		})
 	if err != nil {
 		*ret = qrpc.RpcResult(err.Error())

+ 10 - 5
src/jfw/public/historypush.go

@@ -46,19 +46,24 @@ func (h *historyPush) Datas_Mysql(userId string, pageNum int, selectTime, area s
 	}
 	if area != "" {
 		findStr += " and city in ("
-		for k, v := range strings.Split(area, ",") {
-			if k > 0 {
-				findStr += ","
+		var _area = ""
+		for _, v := range strings.Split(area, ",") {
+			if v == "全部" {
+				continue
 			}
-			findStr += "'" + v + "'"
+			if _area != "" {
+				_area += ","
+			}
+			_area += "'" + v + "'"
 		}
-		findStr += ")"
+		findStr += _area + ")"
 	}
 	countSQL = countSQL + findStr
 	count := Mysql.CountBySql(countSQL)
 	start := (pageNum - 1) * pageSize
 	findStr += " order by id desc limit " + fmt.Sprint(start) + "," + fmt.Sprint(pageSize)
 	findSQL = findSQL + findStr
+	//	log.Println("findsql:", findSQL)
 	list := Mysql.SelectBySql(findSQL)
 	if len(*list) > 0 {
 		pushCas := h.getJyPushs(*list)

+ 407 - 0
src/web/staticres/css/subscribe.css

@@ -0,0 +1,407 @@
+/* banner图板块 */
+.tender-1{
+    width: 100%;
+    height: 475px;
+}
+.tender-1 .imgauto{
+    width: 100%;
+    height: 100%;
+    /* margin: 0 auto; */
+}
+.tender-1 .imgauto img{
+    width: 100%;
+    z-index: 1;
+}
+
+/* 订阅模式选择板块 */
+
+.subscription{
+    width: 100%;
+    height: 268px;
+    margin-top: 30px;
+}
+.subscription .sub-center{
+    width: 840px;
+    height: 268px;
+    margin: 0 auto;
+    display: flex;
+}
+.subscription .sub-center .sub-free{
+    width: 354px;
+    height: 214px;
+    padding: 27px;
+    background: url('/images/subscribe/free.png') no-repeat;
+}
+.subscription .sub-center .sub-free .free-title{
+    width: 100%;
+    height: 26px;
+    margin-top: 28px;
+    text-align: center;
+    font-size:20px;
+    font-family:Microsoft YaHei;
+    font-weight:400;
+    line-height:26px;
+    color:rgba(255,255,255,1);
+    opacity:1;
+}
+.subscription .sub-center .sub-free .free-btn{
+    width:180px;
+    height:46px;
+    background:rgba(44,183,202,1);
+    opacity:1;
+    border-radius:6px;
+    margin: 76px auto;
+    display: block;
+    text-align: center;
+    font-size:18px;
+    font-family:Microsoft YaHei;
+    font-weight:400;
+    line-height:46px;
+    color:rgba(255,255,255,1);
+    opacity:1;
+}
+.subscription .sub-center .sub-vip{
+    width: 354px;
+    height: 214px;
+    padding: 27px;
+    background: url('/images/subscribe/vip.png') no-repeat;
+}
+
+.subscription .sub-center .sub-vip .vip-logo{
+    width: 100%;
+    height: 38px;
+    margin-top: 22px;
+    display: flex;
+    justify-content: center;
+    align-items: center;
+}
+.subscription .sub-center .sub-vip .vip-logo img{
+    width: 38px;
+    height: 38px;
+    margin-right: 10px;
+}
+.subscription .sub-center .sub-vip .vip-logo .vip-title{
+    font-size:20px;
+    font-family:Microsoft YaHei;
+    font-weight:400;
+    line-height:26px;
+    color:rgba(255,218,177,1);
+    opacity:1;
+}
+.subscription .sub-center .sub-vip .vip-btn{
+    width:180px;
+    height:46px;
+    background:rgba(52,53,90,1);
+    margin: 69px auto;
+    opacity:1;
+    border-radius:6px;
+    display: block;
+    text-align: center;
+    font-size:18px;
+    font-family:Microsoft YaHei;
+    font-weight:400;
+    line-height:46px;
+    color:rgba(255,218,177,1);
+}
+/* 订阅模式对比板块 */
+.sub-contrast{
+    width: 100%;
+    height: 666px;
+    margin-top: 79px;
+}
+.sub-contrast .contrast-header{
+    width: 100%;
+    height: 31px;
+}
+.sub-contrast .contrast-header .header-title{
+    width: 331px;
+    height: 31px;
+    line-height: 31px;
+    margin: 0 auto;
+    background: url('/images/subscribe/line.png') no-repeat;
+    font-size:24px;
+    font-family:Microsoft YaHei;
+    font-weight:400;
+    color:rgba(29,29,29,1);
+    opacity:1;
+    text-align: center;
+    background-position: center;
+}
+.sub-contrast .contrast-main{
+    width: 100%;
+    height: 422px;
+    margin-top: 85px;
+}
+.sub-contrast .contrast-main .contrast-main-center{
+    width: 960px;
+    height: 422px;
+    margin: 0 auto;
+    display: flex;
+    border: 1px solid rgba(224,224,224,1);
+}
+/* 功能/价格 */
+/* li+li表示选中除第一个li其他所有的li */
+.sub-contrast .contrast-main .contrast-main-center .center-left{
+    width: 201px;
+    height: 422px;
+}
+.sub-contrast .contrast-main .contrast-main-center .center-left>ul{
+    width: 201px;
+    height: 422px;
+    margin: 0;
+}
+.sub-contrast .contrast-main .contrast-main-center .center-left>ul li+li{
+    width: 200px;
+    height: 58px;
+    text-align: center;
+    line-height: 60px;
+    font-size:16px;
+    font-family:Microsoft YaHei;
+    font-weight:400;
+    color:rgba(29,29,29,1);
+    opacity:1;
+    border-bottom: 1px solid rgba(224,224,224,1);
+    border-right: 1px solid rgba(224,224,224,1);
+}
+/* 免费版 */
+.sub-contrast .contrast-main .contrast-main-center .center-center{
+    width: 259px;
+    height: 422px;
+    transition:all 0.5s;
+}
+.sub-contrast .contrast-main .contrast-main-center .center-center>ul{
+    width: 259px;
+    transition:all 0.5s;
+    height: 422px;
+    margin: 0;
+}
+
+.sub-contrast .contrast-main .contrast-main-center .center-center>ul li+li{
+    transition:all 0.5s;
+    width: 258px;
+    height: 58px;
+    text-align: center;
+    line-height: 60px;
+    font-size:16px;
+    font-family:Microsoft YaHei;
+    font-weight:400;
+    color:rgba(29,29,29,1);
+    opacity:1;
+    border-bottom: 1px solid rgba(224,224,224,1);
+    border-right: 1px solid rgba(224,224,224,1);
+}
+.sub-contrast .contrast-main .contrast-main-center .center-center>ul li:nth-child(7){
+    background-color: rgba(246, 246, 246, 1);
+    border-right: 1px solid rgba(224,224,224,1) ;
+    display: flex;
+    transition:all 0.5s;
+    justify-content: center;
+    align-items: center;
+}
+.sub-contrast .contrast-main .contrast-main-center .center-center ul li:nth-child(7) .btn-free{
+    display: block;
+    cursor: pointer;
+    transition:all 0.5s;
+    width:90px;
+    height:30px;
+    background:rgba(246,246,246,1);
+    opacity:1;
+    border-radius:4px;
+    font-size:16px;
+    font-family:Microsoft YaHei;
+    font-weight:400;
+    line-height:26px;
+    color:rgba(104,104,104,1);
+}
+/* 免费版滑过特效 */
+.sub-contrast .contrast-main .contrast-main-center .center-center:hover ul{
+    height: 463px;
+    /* transform: scaleY(1.1); */
+    transition: 0.5s;
+    box-shadow: 0px 0px 20px rgba(0,0,0,0.2);
+    margin-top: -22px;
+}
+.sub-contrast .contrast-main .contrast-main-center .center-center:hover ul .modify-center{
+    height: 90px;
+    line-height: 90px;
+    transition: 0.5s;
+}
+.sub-contrast .contrast-main .contrast-main-center .center-center:hover ul li:nth-child(7){
+    height: 80px;
+    width: 258px;
+    transition: 0.5s;
+    line-height: 80px;
+    display: flex;
+    justify-content: center;
+    align-items: center;
+}
+.sub-contrast .contrast-main .contrast-main-center .center-center:hover ul li:nth-child(7) .btn-free{
+    transition: 0.5s;
+    background:rgba(44,183,202,1);
+    color: white;
+}
+/* VIP订阅专属服务 */
+.sub-contrast .contrast-main .contrast-main-center .center-right{
+    width: 500px;
+    height: 422px;
+    transition:all 0.5s;
+}
+.sub-contrast .contrast-main .contrast-main-center .center-right>ul{
+    width: 500px;
+    height: 422px;
+    margin: 0;
+    transition:all 0.5s;
+}
+.sub-contrast .contrast-main .contrast-main-center .center-right>ul li+li{
+    width: 500px;
+    height: 58px;
+    text-align: center;
+    transition:all 0.5s;
+    line-height: 60px;
+    font-size:16px;
+    font-family:Microsoft YaHei;
+    font-weight:400;
+    color:rgba(29,29,29,1);
+    opacity:1;
+    border-bottom: 1px solid rgba(224,224,224,1);
+}
+.sub-contrast .contrast-main .contrast-main-center .center-right>ul li:nth-child(7){
+    background-color: #FBF2EA;
+    display: flex;
+    justify-content: center;
+    align-items: center;
+    transition:all 0.5s;
+}
+.sub-contrast .contrast-main .contrast-main-center .center-right>ul li:nth-child(7) .On-trial{
+    width:90px;
+    height:30px;
+    border:1px solid rgba(207,173,137,1);
+    transition:all 0.5s;
+    opacity:1;
+    border-radius:4px;
+    display: block;
+    text-align: center;
+    line-height: 30px;
+    font-size:14px;
+    font-family:MicrosoftYaHei;
+    color:rgba(207,173,137,1);
+    margin-left: 16px;
+}
+/* VIP订阅滑过特效 */
+.sub-contrast .contrast-main .contrast-main-center .center-right:hover ul{
+    height: 463px;
+    margin-top: -22px;
+    box-shadow: 0px 0px 20px rgba(0,0,0,0.2);
+    transition:all 0.5s;
+}
+.sub-contrast .contrast-main .contrast-main-center .center-right:hover ul .modify-right{
+    height: 90px;
+    line-height: 90px;
+    transition:all 0.5s;
+}
+.sub-contrast .contrast-main .contrast-main-center .center-right:hover ul li:nth-child(7){
+    height:80px;
+    line-height: 80px;
+    transition:all 0.5s;
+}
+.sub-contrast .contrast-main .contrast-main-center .center-right:hover ul li:nth-child(7) .On-trial{
+    background:#34355A;
+    font-size:14px;
+    font-family:MicrosoftYaHei;
+    line-height:30px;
+    color:rgba(255,218,177,1);
+    transition:all 0.5s;
+    opacity:1;
+    text-decoration: none;
+}
+.sub-contrast .contrast-main .contrast-main-center ul .top-title{
+    height: 68px;
+    text-align: center;
+    transition:all 0.5s;
+    line-height: 68px;
+    font-size:20px;
+    font-family:Microsoft YaHei;
+    font-weight:400;
+    color:rgba(29,29,29,1);
+    opacity:1;
+    border-bottom: 1px solid rgba(224,224,224,1);
+    border-right: 1px solid rgba(224,224,224,1);
+}
+/* 选中免费版 */
+.sub-contrast .contrast-main .contrast-main-center ul .modify-center{
+    background: rgba(238, 238, 238, 1);
+}
+/* 选中VIP订阅专属服务 */
+.sub-contrast .contrast-main .contrast-main-center ul .modify-right{
+    background:rgba(52,53,90,1);
+    color:rgba(255,218,177,1);
+    position: relative;
+    border-right: 0;
+}
+.sub-contrast .contrast-main .contrast-main-center ul .modify-right img{
+    background:rgba(52,53,90,1);
+    color:rgba(255,218,177,1);
+    position: absolute;
+    right: 0;
+    bottom: 0;
+    width: 174px;
+}
+/* 选中关键词设置颜色 */
+.sub-contrast .contrast-main .contrast-main-center ul li>span{
+    color: #CFAD89;
+}
+
+/* VIP弹窗 */
+
+.hide{
+    display:none;
+}
+.modal{
+    position:fixed;
+    left:50%;
+    top:50%;
+    width:335px;
+    height:395px;
+    margin-left:-200px;
+    margin-top:-250px;
+    z-index:10;
+    background-color:white;
+}
+.modal .modal-dialog{
+    width: 335px;
+    height: 395px;
+    position: relative;
+}
+.modal .modal-dialog img{
+    margin-top: -48px;
+}
+.modal .modal-dialog .vip-code{
+    position: absolute;
+    width: 170px;
+    height: 197px;
+    left: 30%;
+    bottom: 0%;
+}
+.modal .modal-dialog .vip-code .vip-text{
+    width:170px;
+    height:21px;
+    font-size:16px;
+    font-family:MicrosoftYaHei;
+    line-height:24px;
+    color:rgba(59,33,5,1);
+    opacity:1;
+    margin: 20px 0 0 -15px;
+}
+.shade{
+    position:fixed;
+    left:0;
+    right:0;
+    top:0;
+    bottom:0;
+    opacity:0.6;
+    background-color:black;
+    z-index:9;
+}
+.vip-text{
+    text-align:center;
+}

BIN
src/web/staticres/images/subscribe/QR_code.png


BIN
src/web/staticres/images/subscribe/banner.png


BIN
src/web/staticres/images/subscribe/free.png


BIN
src/web/staticres/images/subscribe/line.png


BIN
src/web/staticres/images/subscribe/mengban.png


BIN
src/web/staticres/images/subscribe/vip-logo.png


BIN
src/web/staticres/images/subscribe/vip.png


BIN
src/web/staticres/images/subscribe/vip_tanchuang.png


+ 360 - 349
src/web/staticres/vipsubscribe/css/choose_area_new.css

@@ -1,609 +1,620 @@
 @charset "UTF-8";
 .main {
-  width: 100%;
-  overflow: scroll;
+    width: 100%;
+    overflow: scroll;
 }
 
 .main::-webkit-scrollbar {
-  display: none;
+    display: none;
 }
 
 .layout_top-bottom {
-  display: flex;
-  flex-direction: column;
-  justify-content: space-between;
-  height: 100%;
+    display: flex;
+    flex-direction: column;
+    justify-content: space-between;
+    height: 100%;
 }
 
 .layout_top-bottom .layou_top {
-  flex: 1;
-  overflow: scroll;
+    flex: 1;
+    overflow: scroll;
 }
 
 .bottom_button {
-  display: flex;
-  justify-content: space-between;
-  align-items: center;
-  width: 100%;
-  height: .94rem;
+    display: flex;
+    justify-content: space-between;
+    align-items: center;
+    width: 100%;
+    height: .94rem;
 }
 
 .bottom_button .left_btn,
 .bottom_button .right_btn {
-  flex: 1;
-  height: 100%;
-  font-size: .34rem;
+    flex: 1;
+    height: 100%;
+    font-size: .34rem;
 }
 
 .bottom_button .left_btn {
-  color: #2cb7ca;
-  background-color: #fff;
-  border-top: 1px solid #e0e0e0;
+    color: #2cb7ca;
+    background-color: #fff;
+    border-top: 1px solid #e0e0e0;
 }
 
 .bottom_button .right_btn {
-  color: #fff;
-  background-color: #2cb7ca;
-  border-top: 1px solid #2cb7ca;
+    color: #fff;
+    background-color: #2cb7ca;
+    border-top: 1px solid #2cb7ca;
 }
 
 .bottom_button button[disabled] {
-  opacity: .5;
+    opacity: .5;
 }
 
 .public_btn {
-  width: 100%;
-  height: .94rem;
-  line-height: .94rem;
-  text-align: center;
-  background: #2CB7CA;
-  color: #fff;
-  border-radius: 0.06rem;
-  font-size: .34rem;
+    width: 100%;
+    height: .94rem;
+    line-height: .94rem;
+    text-align: center;
+    background: #2CB7CA;
+    color: #fff;
+    border-radius: 0.06rem;
+    font-size: .34rem;
 }
 
 .tips_btn {
-  display: flex;
-  position: relative;
-  flex-direction: column;
-  align-items: center;
-  justify-content: space-between;
+    display: flex;
+    position: relative;
+    flex-direction: column;
+    align-items: center;
+    justify-content: space-between;
 }
 
 .tips_btn .tips_discount {
-  width: 100%;
+    width: 100%;
 }
 
 .tips_btn .tips_discount .tips_d_money {
-  display: none;
-  position: absolute;
-  left: 50%;
-  top: -.2rem;
-  padding: 0 .4rem;
-  height: .64rem;
-  line-height: .64rem;
-  color: #2CB7CA;
-  font-size: .32rem;
-  background-color: #fff;
-  border-radius: .32rem;
-  transform: translate(-50%, -100%);
-  box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.16);
+    display: none;
+    position: absolute;
+    left: 50%;
+    top: -.2rem;
+    padding: 0 .4rem;
+    height: .64rem;
+    line-height: .64rem;
+    color: #2CB7CA;
+    font-size: .32rem;
+    background-color: #fff;
+    border-radius: .32rem;
+    transform: translate(-50%, -100%);
+    box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.16);
 }
 
 .tips_btn .tips_discount .tips_d_text {
-  display: none;
-  height: .72rem;
-  line-height: .72rem;
-  color: #fff;
-  font-size: .28rem;
-  text-align: center;
-  background-color: #FFB901;
+    display: none;
+    height: .72rem;
+    line-height: .72rem;
+    color: #fff;
+    font-size: .28rem;
+    text-align: center;
+    background-color: #FFB901;
 }
 
 .tips_btn .btns {
-  display: flex;
-  align-items: center;
-  justify-content: space-between;
-  width: 100%;
-  height: .94rem;
-  line-height: .94rem;
-  color: #fff;
-  font-size: .34rem;
+    display: flex;
+    align-items: center;
+    justify-content: space-between;
+    width: 100%;
+    height: .94rem;
+    line-height: .94rem;
+    color: #fff;
+    font-size: .34rem;
 }
 
 .tips_btn .btns .save-btn,
 .tips_btn .btns .reset-btn {
-  flex: 1;
-  width: 50%;
-  text-align: center;
-  height: 100%;
-  font-size: .34rem;
+    flex: 1;
+    width: 50%;
+    text-align: center;
+    height: 100%;
+    font-size: .34rem;
 }
 
 .tips_btn .btns .reset-btn {
-  background: #fff;
-  color: #2cb7ca;
-  border-top: 1px solid #e0e0e0;
+    background: #fff;
+    color: #2cb7ca;
+    border-top: 1px solid #e0e0e0;
 }
 
 .tips_btn .btns .save-btn {
-  background: #2cb7ca;
-  color: #fff;
-  border-top: 1px solid #2cb7ca;
+    background: #2cb7ca;
+    color: #fff;
+    border-top: 1px solid #2cb7ca;
 }
 
 .tips_btn .btns button[disabled] {
-  opacity: .5;
+    opacity: .5;
 }
 
 .jy_icon {
-  position: relative;
-  width: 100%;
-  height: 100%;
+    position: relative;
+    width: 100%;
+    height: 100%;
 }
 
 .jy_icon.decrease:before,
 .jy_icon.increase:before,
 .jy_icon.increase:after {
-  position: absolute;
-  left: 50%;
-  top: 50%;
-  content: '';
-  width: 0.4rem;
-  height: 0.04rem;
-  background-color: #686868;
-  transform: translate(-50%, -50%);
+    position: absolute;
+    left: 50%;
+    top: 50%;
+    content: '';
+    width: 0.4rem;
+    height: 0.04rem;
+    background-color: #686868;
+    transform: translate(-50%, -50%);
 }
 
 .jy_icon.increase:after {
-  transform: translate(-50%, -50%) rotate(90deg);
+    transform: translate(-50%, -50%) rotate(90deg);
 }
 
 /*禁止长按复制 加给body*/
 .no-touch {
-  -webkit-touch-callout: none;
-  -webkit-user-select: none;
-  -khtml-user-select: none;
-  -moz-user-select: none;
-  -ms-user-select: none;
-  user-select: none;
+    -webkit-touch-callout: none;
+    -webkit-user-select: none;
+    -khtml-user-select: none;
+    -moz-user-select: none;
+    -ms-user-select: none;
+    user-select: none;
 }
 
 /* 弹性盒子布局 */
 .flex_alginC {
-  display: flex;
-  align-items: center;
+    display: flex;
+    align-items: center;
 }
 
 .flex_alginC_justB {
-  display: flex;
-  align-items: center;
-  justify-content: space-between;
+    display: flex;
+    align-items: center;
+    justify-content: space-between;
 }
 
 .flex_alginC_justC {
-  display: flex;
-  align-items: center;
-  justify-content: center;
+    display: flex;
+    align-items: center;
+    justify-content: center;
 }
 
 .flex_column {
-  display: flex;
-  flex-direction: column;
+    display: flex;
+    flex-direction: column;
 }
 
 .flex_column_alignC {
-  display: flex;
-  flex-direction: column;
-  align-items: center;
+    display: flex;
+    flex-direction: column;
+    align-items: center;
 }
 
 /* 自定义弹窗*/
 @-webkit-keyframes c {
-  0% {
-    opacity: 0;
-  }
-  to {
-    opacity: 1;
-  }
+    0% {
+        opacity: 0;
+    }
+    to {
+        opacity: 1;
+    }
 }
 
 @keyframes c {
-  0% {
-    opacity: 0;
-  }
-  to {
-    opacity: 1;
-  }
+    0% {
+        opacity: 0;
+    }
+    to {
+        opacity: 1;
+    }
 }
 
 .custom-dialog .weui-animate-fade-in {
-  -webkit-animation: c ease 0s forwards;
-  animation: c ease 0s forwards;
+    -webkit-animation: c ease 0s forwards;
+    animation: c ease 0s forwards;
 }
 
 @-webkit-keyframes d {
-  0% {
-    opacity: 1;
-  }
-  to {
-    opacity: 0;
-  }
+    0% {
+        opacity: 1;
+    }
+    to {
+        opacity: 0;
+    }
 }
 
 @keyframes d {
-  0% {
-    opacity: 1;
-  }
-  to {
-    opacity: 0;
-  }
+    0% {
+        opacity: 1;
+    }
+    to {
+        opacity: 0;
+    }
 }
 
 .custom-dialog .weui-animate-fade-out {
-  -webkit-animation: d ease 0s forwards;
-  animation: d ease 0s forwards;
+    -webkit-animation: d ease 0s forwards;
+    animation: d ease 0s forwards;
 }
 
 .custom-dialog .weui-dialog__hd {
-  background: #F5F4F9;
-  padding: .17rem 0;
-  color: #000;
-  font-size: .34rem;
-  text-align: center;
+    background: #F5F4F9;
+    padding: .17rem 0;
+    color: #000;
+    font-size: .34rem;
+    text-align: center;
 }
 
 .custom-dialog .weui-dialog__bd {
-  padding: .37rem 0;
-  color: #1D1D1D;
-  font-size: .32rem;
-  text-align: center;
+    padding: .37rem 0;
+    color: #1D1D1D;
+    font-size: .32rem;
+    text-align: center;
 }
 
 .custom-dialog .weui-dialog__ft:after {
-  border: 0;
+    border: 0;
 }
 
 .custom-dialog .weui-dialog__btn:after {
-  border: 0;
+    border: 0;
 }
 
 .custom-dialog .weui-dialog__ft {
-  display: flex;
-  align-items: center;
-  justify-content: center;
-  padding-bottom: .38rem;
-  box-sizing: border-box;
-  text-align: center;
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    padding-bottom: .38rem;
+    box-sizing: border-box;
+    text-align: center;
 }
 
 .custom-dialog .weui-dialog__btn {
-  display: block;
-  width: 1.72rem;
-  height: .72rem;
-  line-height: .72rem;
-  color: #fff;
-  padding: 0;
-  flex: none;
-  text-align: center;
-  border-radius: 3px;
+    display: block;
+    width: 1.72rem;
+    height: .72rem;
+    line-height: .72rem;
+    color: #fff;
+    padding: 0;
+    flex: none;
+    text-align: center;
+    border-radius: 3px;
 }
 
 .custom-dialog .weui-dialog__btn_primary {
-  background-color: #2CB7CA;
-  margin-right: 1rem;
+    background-color: #2CB7CA;
+    margin-right: 1rem;
 }
 
 .custom-dialog .weui-dialog__btn_default {
-  background-color: #BFBFC3;
+    background-color: #BFBFC3;
 }
 
 /* 自定义switch按钮 */
 .custom-switch {
-  position: relative;
-  width: 52px;
-  height: 32px;
-  border: 1px solid #dfdfdf;
-  outline: 0;
-  border-radius: 16px;
-  box-sizing: border-box;
-  background-color: #dfdfdf;
-  -webkit-transition: background-color .1s,border .1s;
-  transition: background-color .1s,border .1s;
-  -webkit-appearance: none;
+    position: relative;
+    width: 52px;
+    height: 32px;
+    border: 1px solid #dfdfdf;
+    outline: 0;
+    border-radius: 16px;
+    box-sizing: border-box;
+    background-color: #dfdfdf;
+    -webkit-transition: background-color .1s, border .1s;
+    transition: background-color .1s, border .1s;
+    -webkit-appearance: none;
 }
 
 .custom-switch:before {
-  content: " ";
-  position: absolute;
-  top: 0;
-  left: 0;
-  width: 50px;
-  height: 30px;
-  border-radius: 15px;
-  background-color: #fdfdfd;
-  -webkit-transition: -webkit-transform 0.35s cubic-bezier(0.45, 1, 0.4, 1);
-  transition: -webkit-transform 0.35s cubic-bezier(0.45, 1, 0.4, 1);
-  transition: transform 0.35s cubic-bezier(0.45, 1, 0.4, 1);
-  transition: transform 0.35s cubic-bezier(0.45, 1, 0.4, 1), -webkit-transform 0.35s cubic-bezier(0.45, 1, 0.4, 1);
+    content: " ";
+    position: absolute;
+    top: 0;
+    left: 0;
+    width: 50px;
+    height: 30px;
+    border-radius: 15px;
+    background-color: #fdfdfd;
+    -webkit-transition: -webkit-transform 0.35s cubic-bezier(0.45, 1, 0.4, 1);
+    transition: -webkit-transform 0.35s cubic-bezier(0.45, 1, 0.4, 1);
+    transition: transform 0.35s cubic-bezier(0.45, 1, 0.4, 1);
+    transition: transform 0.35s cubic-bezier(0.45, 1, 0.4, 1), -webkit-transform 0.35s cubic-bezier(0.45, 1, 0.4, 1);
 }
 
 .custom-switch:after {
-  content: " ";
-  position: absolute;
-  top: 0;
-  left: 0;
-  width: 30px;
-  height: 30px;
-  border-radius: 15px;
-  background-color: #fff;
-  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
-  -webkit-transition: -webkit-transform 0.35s cubic-bezier(0.4, 0.4, 0.25, 1.35);
-  transition: -webkit-transform 0.35s cubic-bezier(0.4, 0.4, 0.25, 1.35);
-  transition: transform 0.35s cubic-bezier(0.4, 0.4, 0.25, 1.35);
-  transition: transform 0.35s cubic-bezier(0.4, 0.4, 0.25, 1.35), -webkit-transform 0.35s cubic-bezier(0.4, 0.4, 0.25, 1.35);
+    content: " ";
+    position: absolute;
+    top: 0;
+    left: 0;
+    width: 30px;
+    height: 30px;
+    border-radius: 15px;
+    background-color: #fff;
+    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
+    -webkit-transition: -webkit-transform 0.35s cubic-bezier(0.4, 0.4, 0.25, 1.35);
+    transition: -webkit-transform 0.35s cubic-bezier(0.4, 0.4, 0.25, 1.35);
+    transition: transform 0.35s cubic-bezier(0.4, 0.4, 0.25, 1.35);
+    transition: transform 0.35s cubic-bezier(0.4, 0.4, 0.25, 1.35), -webkit-transform 0.35s cubic-bezier(0.4, 0.4, 0.25, 1.35);
 }
 
 .custom-switch.checked {
-  border-color: #04be02;
-  background-color: #04be02;
+    border-color: #04be02;
+    background-color: #04be02;
 }
 
 .custom-switch.checked:before {
-  transform: scale(0);
+    transform: scale(0);
 }
 
 .custom-switch.checked:after {
-  transform: translateX(20px);
+    transform: translateX(20px);
 }
 
 .custom-toast .weui-toast {
-  font-size: .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%);
+    font-size: .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;
+    display: none;
 }
 
 .custom-toast .weui-toast__content {
-  margin: 0;
+    margin: 0;
 }
 
 .jymobile-tab-triangle {
-  position: relative;
+    position: relative;
 }
 
 .jymobile-tab-triangle:after {
-  content: '';
-  position: absolute;
-  top: 50%;
-  right: 0;
-  width: 0;
-  height: 0;
-  font-size: 0;
-  line-height: 0;
-  border-style: solid;
-  border-width: .1rem;
-  border-color: #aaa transparent transparent transparent;
-  transform: translate(140%, -30%);
+    content: '';
+    position: absolute;
+    top: 50%;
+    right: 0;
+    width: 0;
+    height: 0;
+    font-size: 0;
+    line-height: 0;
+    border-style: solid;
+    border-width: .1rem;
+    border-color: #aaa transparent transparent transparent;
+    transform: translate(140%, -30%);
 }
 
 .jymobile-tab-triangle.active:after {
-  border-color: transparent transparent #2cb7ca transparent;
-  transform: translate(140%, -70%);
+    border-color: transparent transparent #2cb7ca transparent;
+    transform: translate(140%, -70%);
 }
 
 .jymobile-tab-triangle.current {
-  color: #2cb7ca;
+    color: #2cb7ca;
 }
 
 .jymobile-tab-triangle.current:after {
-  border-color: #2cb7ca transparent transparent transparent;
+    border-color: #2cb7ca transparent transparent transparent;
 }
 
 #choose_area {
-  display: flex;
-  justify-content: space-between;
-  flex-direction: column;
-  overflow: hidden;
-  height: 100%;
+    display: flex;
+    justify-content: space-between;
+    flex-direction: column;
+    overflow: hidden;
+    height: 100%;
 }
 
 #choose_area .form {
-  flex: 1;
-  overflow-y: scroll;
+    flex: 1;
+    overflow-y: scroll;
 }
 
 #choose_area .optional_count, #choose_area .all_area {
-  background: #fff;
-  height: .88rem;
-  line-height: .88rem;
-  padding: 0 .3rem;
-  font-size: .3rem;
-  color: #1d1d1d;
+    height: .88rem;
+    line-height: .88rem;
+    padding: 0 .3rem;
+    font-size: .3rem;
+    color: #1d1d1d;
 }
 
 #choose_area .optional_count em, #choose_area .all_area em {
-  color: #2cb7ca;
+    color: #2cb7ca;
 }
 
 #choose_area .result {
-  position: relative;
-  padding: .2rem .3rem;
-  font-size: .26rem;
-  text-align: justify;
+    position: relative;
+    padding: .2rem .3rem;
+    font-size: .26rem;
+    text-align: justify;
 }
 
 #choose_area .result .result_text {
-  position: relative;
-  min-height: 19px;
+    position: relative;
+    min-height: 19px;
 }
 
 #choose_area .result .line_two {
-  text-overflow: ellipsis;
-  overflow: hidden;
-  text-overflow: ellipsis;
-  display: -webkit-box;
-  -webkit-line-clamp: 2;
-  line-clamp: 2;
-  -webkit-box-orient: vertical;
+    text-overflow: ellipsis;
+    overflow: hidden;
+    text-overflow: ellipsis;
+    display: -webkit-box;
+    -webkit-line-clamp: 2;
+    line-clamp: 2;
+    -webkit-box-orient: vertical;
 }
 
 #choose_area .result .detail, #choose_area .result .packup {
-  display: inline-block;
-  width: 1.5rem;
-  padding-right: 0.1rem;
-  text-align: right;
-  color: #2cb7ca;
-  font-size: .26rem;
-  z-index: 999;
+    display: inline-block;
+    width: 1.5rem;
+    padding-right: 0.1rem;
+    text-align: right;
+    color: #2cb7ca;
+    font-size: .26rem;
+    z-index: 999;
 }
 
 #choose_area .result .detail {
-  position: absolute;
-  right: 0;
-  bottom: 0;
-  background: linear-gradient(90deg, rgba(245, 244, 249, 0) 0%, rgba(245, 244, 249, 0.96) 36%, #f5f4f9 100%);
+    position: absolute;
+    right: 0;
+    bottom: 0;
+    background: linear-gradient(90deg, rgba(245, 244, 249, 0) 0%, rgba(245, 244, 249, 0.96) 36%, #f5f4f9 100%);
 }
 
 #choose_area .result .packup {
-  position: absolute;
-  right: 0.3rem;
-  bottom: 0;
-  margin-top: .1rem;
+    position: absolute;
+    right: 0.3rem;
+    bottom: 0;
+    margin-top: .1rem;
 }
 
 #choose_area .select-area-box {
-  padding-bottom: .94rem;
+    padding-bottom: .94rem;
 }
 
 #choose_area .select-area-box .tab {
-  display: flex;
-  align-items: center;
-  justify-content: space-between;
-  color: #1d1d1d;
-  background: #fff;
-  font-size: .3rem;
-  padding: .2rem .5rem;
-  border-bottom: 1px solid #e0e0e0;
-  box-sizing: border-box;
+    display: flex;
+    align-items: center;
+    justify-content: space-between;
+    color: #1d1d1d;
+    background: #fff;
+    font-size: .3rem;
+    padding: .2rem .5rem;
+    border-bottom: 1px solid #e0e0e0;
+    box-sizing: border-box;
 }
 
 #choose_area .select-area-box .tab .province {
-  display: flex;
-  align-items: center;
+    display: flex;
+    align-items: center;
 }
 
 #choose_area .select-area-box .tab .province .checkbox {
-  width: .4rem;
-  height: .4rem;
-  border: 1px solid #ddd;
-  border-radius: 50%;
-  margin-right: .2rem;
-  -webkit-appearance: none;
-  background: #fff;
+    width: .4rem;
+    height: .4rem;
+    border: 1px solid #ddd;
+    border-radius: 50%;
+    margin-right: .2rem;
+    -webkit-appearance: none;
+    background: #fff;
 }
 
 #choose_area .select-area-box .tab .province .checkbox:checked {
-  border: 0;
-  background: url(/vipsubscribe/image/xuanzhong.png) no-repeat center center;
-  background-size: 100% 100%;
+    border: 0;
+    background: url(/vipsubscribe/image/xuanzhong.png) no-repeat center center;
+    background-size: 100% 100%;
 }
 
 #choose_area .select-area-box .tab .province .checkbox[disabled] {
-  border: 0;
-  background: url(/vipsubscribe/image/active_disabled.png) no-repeat center center;
-  background-size: 100% 100%;
+    border: 0;
+    background: url(/vipsubscribe/image/active_disabled.png) no-repeat center center;
+    background-size: 100% 100%;
+    opacity: 1;
 }
 
 #choose_area .select-area-box .tab .province .checkbox.half {
-  border: 0 !important;
-  background: url(/vipsubscribe/image/banxuan.png) no-repeat center center !important;
-  background-size: cover !important;
+    border: 0 !important;
+    background: url(/vipsubscribe/image/banxuan.png) no-repeat center center !important;
+    background-size: cover !important;
 }
 
 #choose_area .select-area-box .tab .province .checkbox.half[disabled] {
-  border: 0 !important;
-  background: url(/vipsubscribe/image/banxuan.png) no-repeat center center !important;
-  background-size: cover !important;
+    border: 0 !important;
+    background: url(/vipsubscribe/image/banxuan.png) no-repeat center center !important;
+    background-size: cover !important;
+    opacity: 1 !important;
 }
 
 #choose_area .select-area-box .tab .optional {
-  color: #2CB7CA;
-  font-size: 0.28rem;
-  margin-left: -2.8rem;
+    color: #2CB7CA;
+    font-size: 0.28rem;
+    margin-left: -2.8rem;
 }
 
 #choose_area .select-area-box label::after {
-  font-size: 14px;
-  float: right;
-  margin-right: 15px;
+    font-size: 14px;
+    float: right;
+    margin-right: 15px;
 }
 
 #choose_area .select-area-box .tab_content {
-  display: none;
-  font-size: .28rem;
-  padding: .1rem .3rem;
-  text-align: center;
+    display: none;
+    font-size: .28rem;
+    padding: .1rem .3rem;
+    text-align: center;
 }
 
 #choose_area .select-area-box .tab_content .city {
-  float: left;
-  padding: .1rem .2rem;
-  background: #fff;
-  margin: .1rem 0 .1rem .1rem;
-  border-radius: 0.04rem;
-  font-size: .28rem;
+    float: left;
+    padding: .1rem .2rem;
+    background: #fff;
+    margin: .1rem 0 .1rem .1rem;
+    border-radius: 0.04rem;
+    font-size: .28rem;
 }
 
 #choose_area .select-area-box .tab_content .active {
-  background: #2cb7ca;
-  color: #fff;
+    background: #2cb7ca;
+    color: #fff;
 }
 
 #choose_area .select-area-box .tab_content .active[disabled] {
-  background: #BFBFC3;
-  color: #fff;
+    background: #BFBFC3;
+    color: #fff;
 }
 
 #choose_area .select-area-box .tab_content .city[disabled] {
-  background: #BFBFC3;
-  color: #fff;
+    background: #BFBFC3;
+    color: #fff;
 }
 
 #choose_area .select-area-box .index {
-  padding: .3rem .3rem .1rem .3rem;
-  font-size: .32rem;
+    padding: .3rem .3rem .1rem .3rem;
+    font-size: .32rem;
 }
 
 #choose_area .slide {
-  background: transparent;
-  position: fixed;
-  right: 0;
-  top: 50%;
-  height: 8.5rem;
-  width: .4rem;
-  font-size: .26rem;
-  text-align: center;
-  display: flex;
-  flex-direction: column;
-  justify-content: center;
-  padding: .1rem 0;
-  align-items: center;
-  margin-top: -4.25rem;
-  z-index: 9999;
+    background: transparent;
+    position: fixed;
+    right: 0;
+    top: 50%;
+    height: 8.5rem;
+    width: .4rem;
+    font-size: .26rem;
+    text-align: center;
+    display: flex;
+    flex-direction: column;
+    justify-content: center;
+    padding: .1rem 0;
+    align-items: center;
+    margin-top: -4.25rem;
+    z-index: 9999;
 }
 
 #choose_area .slide a {
-  margin-bottom: .1rem;
+    margin-bottom: .1rem;
 }
+
+.icon.iconfont {
+    display: inline-block;
+}
+
+.icon.iconfont.up {
+    display: inline-block;
+    transform: rotate(-180deg);
+}
+

+ 140 - 94
src/web/staticres/vipsubscribe/js/editArea.js

@@ -2,21 +2,21 @@
 var areaData = {
     "data": {
         "area": {
-            "北京": [],
-            "河南": [
-                "商丘市",
-                "安阳市",
-                "新乡市",
-                "郑州市"
-            ],
-            "澳门": [],
-            "甘肃": []
+            // "北京": [],
+            // "河南": [
+            //     "洛阳市",
+            //     "驻马店市",
+            //     "周口市",
+            //     // "郑州市"
+            // ],
+            // "澳门": [],
+            // "甘肃": []
         },
         "buyset": {
-            "areacount": 4,
+            "areacount": -1,
             "buyerclasscount": 11,
             "citys": {
-                "河南": 4
+                //   "河南": 4
             }
         },
         "industry": [
@@ -37,7 +37,6 @@ var areaData = {
     "success": true
 }
 
-
 //加载数据
 function getData() {
     $DoPost("/subscribepay/editSub/getSubBuyMsg", {}, function (r) {
@@ -55,18 +54,28 @@ function createMoreCity(arr) {
     return tempHtml
 }
 
+var animatedRuning = false;
+
+function checkAnimatedRuning() {
+    if (animatedRuning) {
+        return true
+    }
+    animatedRuning = true;
+    setTimeout(function () {
+        animatedRuning = false;
+    }, 500);
+    return false
+}
+
 // 省下拉市事件
 function slideFun(obj) {
+    if (checkAnimatedRuning()) {
+        return
+    }
     if (obj.next('.tab_content:not(:animated)').css("display") == "block") {
-        obj.children().children('i').css({
-            "display": "inline-block",
-            "transform": "rotate(0)"
-        })
+        obj.children().children('i').removeClass("up");
     } else {
-        obj.children().children('i').css({
-            "display": "inline-block",
-            "transform": "rotate(-180deg)"
-        })
+        obj.children().children('i').addClass("up");
     }
     obj.toggleClass('selected').next('.tab_content:not(:animated)').slideToggle(500)
     obj.parent().siblings().children('.tab').removeClass('selected');
@@ -76,16 +85,14 @@ var obj
 
 // 改变选择结果方法
 function getResult() {
-    var data = '';
     obj = {};
-    $('.result_name').empty();
+    //$('.result_name').empty();
     $('.province').each(function () {
         let provinceText = $(this).text().trim();//省份名称
         let isChecked = $(this).children('.checkbox').is(':checked');
         let isHalf = $(this).children('.checkbox').hasClass('half');
         let arr = [];
         if (isChecked) {
-            data += provinceText + '、';
             obj[provinceText] = [];
         } else if (isHalf && !isChecked) {
             let $that = $(this);
@@ -97,12 +104,11 @@ function getResult() {
                 }
             })
             obj[$that.text().trim()] = arr
-            data += `${$that.text().trim()}(${arr.join('、')})、`
         }
     })
     $('count').html($('.checkbox:not(.other):checked').length);
-    $('.result_name').append(data.substring(0, data.length - 1));
-    //校验是否修改
+    //$('.result_name').append(getAreaClassArr_index(obj).join("、"));
+//校验是否修改
     if (theSameAs(obj) || $.isEmptyObject(obj)) {
         $('#enter').attr("disabled", "disabled");
     } else {
@@ -114,7 +120,6 @@ function getResult() {
 function init() {
     let p = areaData.data.area;
     let count = areaData.data.buyset.citys;
-    var ht = '';
     // 1.渲染城市列表
     $(".select-area-box ul li:not('.index')").each(function () {
         var text = $(this).find(".province").text().trim()
@@ -128,88 +133,127 @@ function init() {
         box.html(html)
     })
     // 2.当areacount == -1时,全国为选中状态,为正数时为选中的省份数目,全国选项不显示
-    if (areaData.data.buyset.areacount == -1) {
-        // 选中全国
+    let pLength = Object.keys(areaData.data.area).length;
+    let cLength = Object.keys(areaData.data.buyset.citys).length
+    console.log(pLength, cLength)
+    if (areaData.data.buyset.areacount == -1 && pLength == 0 && cLength == 0) {
+        // 当购买的全国切选中的是全国时
         // $('.optional_count').html("可选择全部区域")
-        $('.all_area').show()
+        //$('.all_area').show()
         $('.optional_count').hide()
         $('.total').html('34')
         $('.count').html('34')
         $('.tab.whole').parent('li').show();
         $('.checkbox.other').prop('checked', true);
-        $('.checkbox:not(.other)').attr('disabled', true)
-        ht += `<span>全国</span>`
+        // $('.checkbox:not(.other)').attr('disabled',true)
+        //$('.result_name').append(`<span>全国</span>`);
+    } else if (areaData.data.buyset.areacount == -1 && pLength != 0) {
+        // 当购买的全国而没有选择全国,选择部分省市时
+        //$('.all_area').show();
+        $('.province').removeAttr('data-count');
+        $('.optional_count').hide();
+        $('.total').html('34');
+        initResult()
     } else {
-        $('.all_area').hide()
+        //$('.all_area').hide()
         $('.optional_count').show()
         $('.total').html(areaData.data.buyset.areacount)
         $('.tab.whole').parent('li').hide();
-        $('.checkbox.other').attr('disabled', true);
-        // 渲染已选择结果
-        for (const k in p) {
-            console.log(p[k], k)
-            if (p[k].length == 0) {
-                ht += k + '、';
-                $('.province').each(function () {
-                    let t = $(this).text().trim();
-                    if (k == t && p[k].length == 0) {
-                        // 如果购买的是全省,则不可点击下拉事件(不可修改城市)
-                        // $(this).parent('.tab').unbind("click").parent('li').siblings().find('.tab').unbind("click");
+        // $('.checkbox.other').attr('disabled',true);
+        initResult()
+    }
+
+}
+
+function initResult() {
+    let isAll = areaData.data.buyset.areacount;
+    let p = areaData.data.area;
+    let count = areaData.data.buyset.citys;
+    // 渲染已选择结果
+    for (const k in p) {
+        console.log(p[k], k)
+        if (p[k].length == 0) {
+            $('.province').each(function () {
+                let t = $(this).text().trim();
+                if (k == t && p[k].length == 0) {
+                    // 如果购买的是全省,则不可点击下拉事件(不可修改城市)
+                    if (isAll != -1) {
                         $(this).parent().siblings().children('.city').addClass('active').attr('disabled', true);
-                        $(this).children('.checkbox').prop('checked', true)
+                        $(this).parent('.tab').unbind('click').parent('li').siblings().find('.checkbox:not(.half)').parents('.tab').unbind('click')
+                    } else {
+                        $(this).parent().siblings().children('.city').addClass('active').removeAttr('disabled')
+                    }
+                    $(this).children('.checkbox').prop('checked', true)
+                }
+            })
+        } else {
+            console.log(k, p[k].length)
+            $('.city').each(function () {
+                let t = $(this).text().trim();
+                p[k].forEach(v => {
+                    // console.log(v,t)
+                    if (v == t) {
+                        let that = $(this).parents('li').find('.tab:not(.municipality)');
+                        console.log("v==t")
+                        // 如果是可修改城市的省份,则可以进行下拉展示
+                        that.bind('click', function () {
+                            slideFun($(this));
+                        })
+                        $(this).addClass('active').removeAttr('disabled').parent().siblings('.tab').find('input').addClass('half');
+                        return;
                     }
                 })
-            } else {
-                console.log(k, p[k])
-                ht += `${k}( ${p[k].join('、')} )、`;
-                $('.city').each(function () {
-                    let t = $(this).text().trim();
-                    p[k].forEach(v => {
-                        // console.log(v,t)
-                        if (v == t) {
-                            let that = $(this).parents('li').find('.tab:not(.municipality)');
-                            console.log("v==t")
-                            // 如果是可修改城市的省份,则可以进行下拉展示
-                            that.bind('click', function () {
-                                slideFun($(this));
-                            });
-                            $(this).addClass('active').parent().siblings('.tab').find('input').addClass('half');
-                            return;
-                        }
-                    })
-                })
-                for (const c in count) {
-                    if (p[k].length >= count[c]) {
+            })
+            for (const c in count) {
+                if (p[k].length >= count[c]) {
+                    if (isAll != -1) {
                         $('.city:not(.active)').attr('disabled', true)
+                    } else {
+                        $('.city:not(.active)').removeAttr('disabled')
                     }
                 }
             }
         }
-        // 添加可选择城市文字 和自定义属性值
+    }
+    // 添加可选择城市文字 和自定义属性值
+    if (areaData.data.buyset.areacount != -1) {
         for (const c in count) {
             $('.province').each(function () {
                 let t = $(this).text().trim();
                 if (c == t) {
                     $(this).attr("data-count", count[c]);
                     $(this).after(`<em class="optional">可选择 ${count[c]} 个市</em>`)
-                    $(this).parent().bind('click', function () {
+                    let that = $(this).parent('.tab:not(.municipality)');
+                    that.bind('click', function () {
                         slideFun($(this));
                     })
                 }
             })
         }
-        $('.result_name').append(ht.substring(0, ht.length - 1));
-        $('.count').html($('.checkbox:not(.other):checked').length)
-        //$('.city:not(.active)').attr('disabled', true)
-        // 如果选中的省份数量等于购买的省份数量,则将其他未选中的省份禁用
-        if ($('.checkbox:not(.other):checked').length == $('.total').html()) {
-            $('.checkbox:not(:checked)').attr('disabled', true)
-        }
+    }
+    //$('.result_name').append(getAreaClassArr_index(areaData.data.area).join("、"));
+    $('.count').html($('.checkbox:not(.other):checked').length)
+    // 如果选中的省份数量等于购买的省份数量,则将其他未选中的省份禁用
+    if ($('.checkbox:not(.other):checked').length == $('.total').html()) {
+        $('.checkbox:not(:checked)').attr('disabled', true);
     }
     $('#enter').attr("disabled", "disabled");
 }
 
 $(function () {
+    // 省下拉事件
+    $('.tab:not(.municipality)').on('click', function () {
+        if (checkAnimatedRuning()) {
+            return
+        }
+        if ($(this).next('.tab_content:not(:animated)').css("display") == "block") {
+            $(this).children().children('i').removeClass("up");
+        } else {
+            $(this).children().children('i').addClass("up");
+        }
+        $(this).toggleClass('selected').next('.tab_content:not(:animated)').slideToggle(500);
+        $(this).parent().siblings().children('.tab').removeClass('selected');
+    });
     getData();
     // 初始化
     init();
@@ -219,25 +263,21 @@ $(function () {
         let isChecked = $(this).is(':checked');
         if (isChecked) {
             $('.count').html('34')
-            $('.checkbox:not(.other)').prop('checked', false).attr('disabled', true).removeClass('half')
-            $('.city').removeClass('active').attr('disabled', true)
-            $('.tab').unbind("click").siblings().slideUp()
+            $('.checkbox:not(.other)').prop('checked', false).removeClass('half')
+            $('.city').removeClass('active');
+            $('.tab_content').slideUp()
             getResult()
         } else {
-            // $('.count').html($('.checkbox:not(.other):checked').length)
             $('.checkbox:not(.other)').removeAttr('disabled')
             $('.city').removeAttr('disabled')
-            $('.tab:not(.municipality)').on('click', function () {
-                slideFun($(this));
-            });
             getResult()
         }
     })
     // 2.点击非全国按钮onchange事件;
     $('.checkbox:not(.other)').on('change', function () {
+        $('.checkbox.other').prop('checked', false);
         let checkedLength = $('.checkbox:checked').length;
         let totalLength = $('.total').text();
-        // console.log(checkedLength,totalLength)
         $('.count').html(checkedLength)
         if (checkedLength < totalLength) {
             $('.checkbox:not(.other)').removeAttr('disabled')
@@ -247,10 +287,14 @@ $(function () {
             getResult()
         }
         if ($(this).is(':checked')) {
-            $(this).prop('checked', true).removeClass('half').parent().parent().siblings().find('.city').addClass('active').attr('disabled', true)
+            if (areaData.data.buyset.areacount != -1) {
+                $(this).prop('checked', true).removeClass('half').parents('li').find('.city').addClass('active').attr('disabled', true);
+            } else {
+                $(this).prop('checked', true).removeClass('half').parents('li').find('.city').addClass('active');
+            }
             getResult()
         } else {
-            $(this).prop('checked', false).removeClass('half').parent().parent().siblings().find('.city').removeClass('active').removeAttr('disabled')
+            $(this).prop('checked', false).removeClass('half').parent().parent().siblings().find('.city').removeClass('active').removeAttr('disabled');
             getResult()
         }
 
@@ -259,10 +303,11 @@ $(function () {
     $('.checkbox.half').on('change', function () {
         console.log($(this).is(':checked'))
         if ($(this).is(':checked')) {
-            $(this).prop('checked', true).removeClass('half');
-            $(this).removeClass('half').parent().parent().siblings().find('.city').addClass('active').attr('disabled', true);
-            $(this).parent().parent().siblings().children('.city').addClass('active');
-            //$(this).parent().siblings('.optional').hide();
+            if (areaData.data.buyset.areacount != -1) {
+                $(this).prop('checked', true).removeClass('half').parents('li').find('.city').addClass('active').attr('disabled', true);
+            } else {
+                $(this).prop('checked', true).removeClass('half').parents('li').find('.city').addClass('active');
+            }
             getResult()
         } else {
             $(this).prop('checked', false);
@@ -274,10 +319,10 @@ $(function () {
     // 4.点击城市按钮触发的事件
     $('.tab_content').on('click', '.city', function () {
         let count = $(this).parent().siblings().find('.province').attr('data-count');
-        $(this).toggleClass('active')
+        $(this).toggleClass('active');
+        $('.checkbox.other').prop('checked', false);
         var isActive = $(this).parent().find('.city.active').length
         let cityLength = $(this).parent().find('.city').length
-
         if (isActive === cityLength) {//当选中的城市数量等于该省下所有城市总数时,即为全选
             var oInput = $(this).parents('li').find('input.checkbox')
             oInput.removeClass('half').prop('checked', true)
@@ -316,11 +361,12 @@ $(function () {
     // 取消按钮事件 返回上一页
     $('#cancel').click(function () {
         // window.history.go(-1)
-        $('.result_name').empty()
+        //$('.result_name').empty()
         $('.checkbox').prop('checked', false).removeAttr('disabled');
         $('.city').removeClass('active');
         $('.tab_content').slideUp();
-        $('.optional').remove()
+        $('.optional').remove();
+        $('.tab').find('i').removeClass("up");
         init();
     })
     // 确定修改事件
@@ -342,4 +388,4 @@ function theSameAs(select) {
     let tmp1 = getAreaClassArr(select);
     let tmp2 = getAreaClassArr(areaData.data.area);
     return (JSON.stringify(tmp1[0].sort()) === JSON.stringify(tmp2[0].sort())) && (JSON.stringify(tmp1[1].sort()) === JSON.stringify(tmp2[1].sort()));
-}
+}

+ 73 - 0
src/web/staticres/vipsubscribe/js/mapArea.js

@@ -0,0 +1,73 @@
+/**
+ * @file china-map.json
+ * @author wangshan 简易版2019-11-21
+ */
+var chinaMapJSON = [{
+	"安徽": ["合肥市", "芜湖市", "蚌埠市", "淮南市", "马鞍山市", "淮北市", "铜陵市", "安庆市", "黄山市", "滁州市", "阜阳市", "宿州市", "巢湖市", "六安市", "亳州市", "池州市", "宣城市"]
+}, {
+	"澳门": ["澳门"]
+}, {
+	"北京": ["北京市"]
+}, {
+	"重庆": ["重庆市"]
+}, {
+	"福建": ["福州市", "厦门市", "宁德市", "莆田市", "泉州市", "漳州市", "龙岩市", "三明市", "南平市"]
+}, {
+	"广东": ["广州市", "汕尾市", "阳江市", "揭阳市", "茂名市", "惠州市", "江门市", "韶关市", "梅州市", "汕头市", "深圳市", "珠海市", "佛山市", "肇庆市", "湛江市", "中山市", "河源市", "清远市", "云浮市", "潮州市", "东莞市"]
+}, {
+	"广西": ["防城港市", "南宁市", "崇左市", "来宾市", "柳州市", "桂林市", "梧州市", "贺州市", "贵港市", "玉林市", "百色市", "钦州市", "河池市", "北海市"]
+}, {
+	"贵州": ["贵阳市", "遵义市", "安顺市", "黔南布依族苗族自治州", "黔东南苗族侗族自治州", "铜仁市", "毕节市", "六盘水市", "黔西南布依族苗族自治州"]
+}, {
+	"甘肃": ["兰州市", "金昌市", "白银市", "天水市", "嘉峪关市", "武威市", "张掖市", "平凉市", "酒泉市", "庆阳市", "定西市", "陇南市", "临夏回族自治州", "甘南藏族自治州"]
+}, {
+	"河北": ["邯郸市", "石家庄市", "秦皇岛市", "保定市", "张家口市", "承德市", "唐山市", "廊坊市", "沧州市", "衡水市", "邢台市"]
+}, {
+	"湖北": ["武汉市", "襄阳市", "鄂州市", "孝感市", "黄冈市", "黄石市", "咸宁市", "荆州市", "宜昌市", "恩施土家族苗族自治州", "神农架林区", "十堰市", "随州市", "荆门市", "仙桃市", "天门市", "潜江市"]
+}, {
+	"黑龙江": ["哈尔滨市", "齐齐哈尔市", "鸡西市", "牡丹江市", "七台河市", "佳木斯市", "鹤岗市", "双鸭山市", "绥化市", "黑河市", "大兴安岭地区", "伊春市", "大庆市"]
+}, {
+	"海南": ["海口市", "三亚市", "五指山市", "琼海市", "儋州市", "文昌市", "万宁市", "东方市", "澄迈县", "定安县", "屯昌县", "临高县", "白沙黎族自治县", "昌江黎族自治县", "乐东黎族自治县", "陵水黎族自治县", "保亭黎族苗族自治县", "琼中黎族苗族自治县", "三沙市"]
+}, {
+	"河南": ["商丘市", "郑州市", "安阳市", "新乡市", "许昌市", "平顶山市", "信阳市", "南阳市", "开封市", "洛阳市", "济源市", "焦作市", "鹤壁市", "濮阳市", "周口市", "漯河市", "驻马店市", "三门峡市"]
+}, {
+	"湖南": ["岳阳市", "长沙市", "湘潭市", "株洲市", "衡阳市", "郴州市", "常德市", "益阳市", "娄底市", "邵阳市", "湘西土家族苗族自治州", "张家界市", "怀化市", "永州市"]
+}, {
+	"吉林": ["长春市", "吉林市", "延边朝鲜族自治州", "四平市", "通化市", "白城市", "辽源市", "松原市", "白山市"]
+}, {
+	"江苏": ["南京市", "无锡市", "镇江市", "苏州市", "南通市", "扬州市", "盐城市", "徐州市", "淮安市", "连云港市", "常州市", "泰州市", "宿迁市"]
+}, {
+	"江西": ["鹰潭市", "新余市", "南昌市", "九江市", "上饶市", "抚州市", "宜春市", "吉安市", "赣州市", "景德镇市", "萍乡市"]
+}, {
+	"辽宁": ["沈阳市", "铁岭市", "大连市", "鞍山市", "抚顺市", "本溪市", "丹东市", "锦州市", "营口市", "阜新市", "辽阳市", "朝阳市", "盘锦市", "葫芦岛市"]
+}, {
+	"内蒙古": ["呼伦贝尔市", "呼和浩特市", "包头市", "乌海市", "乌兰察布市", "通辽市", "赤峰市", "鄂尔多斯市", "巴彦淖尔市", "锡林郭勒盟", "兴安盟", "阿拉善盟"]
+}, {
+	"宁夏": ["银川市", "石嘴山市", "吴忠市", "固原市", "中卫市"]
+}, {
+	"青海": ["海北藏族自治州", "西宁市", "海东市", "黄南藏族自治州", "海南藏族自治州", "果洛藏族自治州", "玉树藏族自治州", "海西蒙古族藏族自治州"]
+}, {
+	"山西": ["朔州市", "忻州市", "太原市", "大同市", "阳泉市", "晋中市", "长治市", "晋城市", "临汾市", "吕梁市", "运城市"]
+}, {
+	"陕西": ["西安市", "咸阳市", "延安市", "榆林市", "渭南市", "商洛市", "安康市", "汉中市", "宝鸡市", "铜川市"]
+}, {
+	"上海": ["上海市"]
+}, {
+	"山东": ["菏泽市", "济南市", "青岛市", "淄博市", "德州市", "烟台市", "潍坊市", "济宁市", "泰安市", "临沂市", "滨州市", "东营市", "威海市", "枣庄市", "日照市", "莱芜市", "聊城市"]
+}, {
+	"四川": ["成都市", "攀枝花市", "自贡市", "绵阳市", "南充市", "达州市", "遂宁市", "广安市", "巴中市", "泸州市", "宜宾市", "资阳市", "内江市", "乐山市", "眉山市", "凉山彝族自治州", "雅安市", "甘孜藏族自治州", "阿坝藏族羌族自治州", "德阳市", "广元市"]
+}, {
+	"天津": ["天津市"]
+}, {
+	"台湾": ["台湾省"]
+}, {
+	"西藏": ["拉萨市", "日喀则市", "山南市", "林芝市", "昌都市", "那曲地区", "阿里地区"]
+}, {
+	"新疆": ["塔城地区", "哈密地区", "和田地区", "阿勒泰地区", "克孜勒苏柯尔克孜自治州", "博尔塔拉蒙古自治州", "克拉玛依市", "乌鲁木齐市", "石河子市", "昌吉回族自治州", "五家渠市", "吐鲁番市", "巴音郭楞蒙古自治州", "阿克苏地区", "阿拉尔市", "喀什地区", "图木舒克市", "伊犁哈萨克自治州"]
+}, {
+	"香港": ["香港"]
+}, {
+	"云南": ["西双版纳傣族自治州", "德宏傣族景颇族自治州", "昭通市", "昆明市", "大理白族自治州", "红河哈尼族彝族自治州", "曲靖市", "保山市", "文山壮族苗族自治州", "玉溪市", "楚雄彝族自治州", "普洱市", "临沧市", "怒江傈僳族自治州", "迪庆藏族自治州", "丽江市"]
+}, {
+	"浙江": ["舟山市", "衢州市", "杭州市", "湖州市", "嘉兴市", "宁波市", "绍兴市", "温州市", "丽水市", "金华市", "台州市"]
+}]

+ 136 - 0
src/web/templates/pc/subscribe_new.html

@@ -0,0 +1,136 @@
+<html>
+<head>
+    <title>招标订阅_剑鱼标讯,全行业招标信息智能推送领导者</title>
+    <meta http-equiv="X-UA-Compatible" content="IE=edge,Chrome=1"/>
+    <meta name="Keywords" content="招标订阅,招标项目,中标项目,招标信息,剑鱼标讯"/>
+    <meta name="Description" content="使用剑鱼标讯,可以精准匹配招标信息,只需要微信关注剑鱼标讯公众号,然后自行设定所关注的招标关键词和地区,满足订阅需求的招标信息就会在两个小时内自动推送。"/>
+    <meta name="renderer" content="webkit">
+    <meta content="telephone=no" name="format-detection"/>
+    {{include "/common/pnc.html"}}
+    <link rel="stylesheet" type="text/css" href="{{Msg "seo" "cdn"}}/css/reset.css?v={{Msg "seo" "version"}}"/>
+    <link rel="stylesheet" type="text/css" href="{{Msg "seo" "cdn"}}/css/subscribe.css?v={{Msg "seo" "version"}}"/>
+    <link rel="stylesheet" type="text/css" href="{{Msg "seo" "cdn"}}/pccss/reset_pc.css"/>
+    {{/*<link rel="stylesheet" type="text/css" href="{{Msg "seo" "cdn"}}/pccss/zhaobiao.css"/>*/}}
+    <link href="{{Msg "seo" "cdn"}}/css/pc.css?v={{Msg "seo" "version"}}" rel="stylesheet">
+    <link rel="stylesheet" type="text/css"
+          href="{{Msg "seo" "cdn"}}/pccss/public-nav-1200.css?v={{Msg "seo" "version"}}"/>
+    <script type="text/javascript" src="{{Msg "seo" "cdn"}}/js/public-nav.js?v={{Msg "seo" "version"}}"></script>
+    <script src="{{Msg "seo" "cdn"}}/js/jquery.cookie.js"></script>
+    <script>
+        $(function () {
+            $(window).scroll(function () {
+                if ($(this).scrollTop() > 0) {
+                    $("#backTop").show();
+                } else {
+                    $("#backTop").hide();
+                }
+            });
+        });
+    </script>
+<body>
+{{include "/common/pchead.html"}}
+<!--内容-->
+<!-- banner图板块 -->
+<div class="tender-1">
+    <div class="imgauto">
+        <img src="/images/subscribe/banner.png" alt="">
+    </div>
+</div>
+<!-- 订阅模式选择板块 -->
+<div class="subscription">
+    <div class="sub-center">
+        <div class="sub-free">
+            <h3 class="free-title">免费版订阅</h3>
+            <button class="free-btn">立即免费订阅</button>
+        </div>
+        <div class="sub-vip">
+            <div class="vip-logo">
+                <img src="/images/subscribe/vip-logo.png" alt="">
+                <h3 class="vip-title">VIP订阅</h3>
+            </div>
+            <button class="vip-btn btn btn-primary">免费试用</button>
+        </div>
+    </div>
+</div>
+<!-- VIP弹窗 -->
+<div class="modal hide">
+    <div class="modal-dialog">
+        <img src="/images/subscribe/vip_tanchuang.png" alt="">
+        <div class="vip-code">
+            <img src="/images/subscribe/QR_code.png" alt="">
+            <p class="vip-text">扫描二维码体验VIP订阅</p>
+        </div>
+    </div>
+</div>
+<div class="shade hide"></div>
+<!-- 订阅模式对比板块 -->
+<div class="sub-contrast">
+    <div class="contrast-header">
+        <div class="header-title">
+            对比
+        </div>
+    </div>
+    <div class="contrast-main">
+        <div class="contrast-main-center">
+            <div class="center-left">
+                <ul>
+                    <li class="top-title modify-left">功能/价格</li>
+                    <li>项目匹配</li>
+                    <li>行业订阅</li>
+                    <li>关键词</li>
+                    <li>匹配方式</li>
+                    <li>订阅区域</li>
+                    <li>价格</li>
+                </ul>
+            </div>
+            <div class="center-center">
+                <ul>
+                    <li class="top-title modify-center">免费版</li>
+                    <li>匹配单次公告信息</li>
+                    <li>—</li>
+                    <li>10组关键词</li>
+                    <li>仅支持标题匹配</li>
+                    <li>订阅区域精确到省</li>
+                    <li><i class="btn-free">免费</i></li>
+                </ul>
+            </div>
+            <div class="center-right">
+                <ul>
+                    <li class="top-title modify-right">
+                        VIP订阅专属服务
+                        <img src="/images/subscribe/mengban.png" alt="">
+                    </li>
+                    <li><span>匹配项目信息</span>,为你推送所匹配项目后续的全部动态</li>
+                    <li>按采购单位类型订阅,无需繁琐关键词设置</li>
+                    <li><span>300组</span>关键词,获取招标信息更全面</li>
+                    <li>支持<span>标题匹配+全文匹配</span>,信息筛选更灵活</li>
+                    <li>订阅区域<span>精确到地级市</span>,只看你最关注的</li>
+                    <li>低至5.8元/月
+                        <a href="javascript:;" class="On-trial vip-btn">免费试用</a>
+                    </li>
+                </ul>
+            </div>
+        </div>
+    </div>
+</div>
+<!--内容-->
+
+
+<!--百度统计start-->
+{{include "/common/pcbottom.html"}}
+{{include "/common/baiducc.html"}}
+<!--百度统计end-->
+
+<script>
+    $('.vip-btn').click(function () {
+        $('.hide').fadeIn(300);
+        $('.modal,.shade').slideDown(300);
+        // $('.hide').removeClass('hide');
+    })
+    $('.shade').click(function () {
+        $('.hide').fadeOut(300);
+        $('.modal,.shade').slideUp(300);
+    })
+</script>
+</body>
+</html>

+ 89 - 54
src/web/templates/weixin/historypush.html

@@ -276,8 +276,11 @@
 						$(".renew_toast").show();
 					}
 				}else{
-					if(parseInt(isExpire)!=0){
+					if(parseInt(isExpire)<0){
 						$(".nv_renew_toast").show();
+					}else{
+						$(".isExpire").text(parseInt(isExpire));
+						$(".renew_toast").show();
 					}
 				}
 				$(".vip_set").show();
@@ -789,7 +792,7 @@
 		}
 		._header{
 			position: fixed;
-			top: 0.02rem;
+			top: 0rem;
 			width: 100%;
 			z-index: 999;
 		}
@@ -913,66 +916,77 @@
       </div>
   	</div>
   	<script src="{{Msg "seo" "cdn"}}/vipsubscribe/js/weui.min.js?v={{Msg "seo" "version"}}"></script>
-  	<script src="{{Msg "seo" "cdn"}}/dataExport/js/mapJSON.js?v={{Msg "seo" "version"}}"></script>
+  	<script src="{{Msg "seo" "cdn"}}/vipsubscribe/js/mapArea.js?v={{Msg "seo" "version"}}"></script>
   	<script type="text/javascript" charset="UTF-8">
   		function mapData(){
   			var _citySessionData = null
-  			var _provinceArr = {}
-  			var _cityMap = []
+  			var _provinceArr = {}//选择的省份对应的城市
+			var allCityNum = 0;//选择全部省份的个数
+			var cityNumArr = {};//单个省份下的城市个数
   			if (sessionStorage&&sessionStorage.getItem(userId+"_selectCityName")!=null){
   				_citySessionData  = JSON.parse(sessionStorage.getItem(userId+"_selectCityName"));
   				for(var k=0;k<_citySessionData.length;k++){
-  					_provinceArr[_citySessionData[k]["province"]] = _citySessionData[k]["selectCity"].length
-  					_cityMap = _cityMap.concat(_citySessionData[k]["selectCity"])
+					if (_citySessionData[k]["selectCity"]["0"]=="全部"){
+						cityNumArr[_citySessionData[k]["province"]] = _citySessionData[k]["selectCity"].length - 1;
+					}else{
+  						cityNumArr[_citySessionData[k]["province"]] = _citySessionData[k]["selectCity"].length;
+					}
+					allCityNum += cityNumArr[_citySessionData[k]["province"]]
+  					_provinceArr[_citySessionData[k]["province"]] = _citySessionData[k]["selectCity"]
   				}
-  				if(_cityMap.length>0){
-  					 $('#showArea .jymobile-tab-triangle').addClass('current').text(`地区 ${_cityMap.length}`);
+				//所选地级市的数量
+  				if(allCityNum>0){
+  					 $('#showArea .jymobile-tab-triangle').addClass('current').text(`地区 ${allCityNum}`);
   				}
 				//sessionStorage.removeItem("selectCityName");
   			}
-	  		var provinceArr = ["安徽","澳门","北京","重庆","福建","广东","广西","贵州","甘肃","河北","湖北","黑龙江","海南","河南","湖南","吉林","江苏","江西","辽宁","内蒙古","宁夏","青海","山西","陕西","上海","山东","四川","天津","台湾","西藏","新疆","香港","云南","浙江"]
 	  		var provinceHtml = '<div class="province">';
 	  		var cityHtml = '<div class="city" >';
-	  		for (var j = 0;  j <  provinceArr.length;j++) {
+	  		for (var j = 0;  j <  chinaMapJSON.length;j++) {
 	  			var shwohide = 'none'
 	  			var _active = "";
-	  			for (var i = chinaMapJSON.length - 1; i >= 0; i--) {
-	  				_chinaMap = chinaMapJSON[i]
-	  				if(_chinaMap["name"].indexOf(provinceArr[j])>-1){
-	  					if (j==0){
-	  						shwohide = "";
-	  						_active = "active";
-	  					}
-	  					var provinceFlag = true;
-	  					if(_provinceArr[provinceArr[j]]!=undefined&&_provinceArr[provinceArr[j]]>0){
-								provinceHtml +='<p class="p_item '+_active+'"><span class="province-name">'+provinceArr[j]+'</span><span class="city-count" style="display: inline;">('+_provinceArr[provinceArr[j]]+')</span></p>'
-								//
-								cityHtml +='<div class="province_city" data-id="'+provinceArr[j]+'" style="display:'+shwohide+'">';
-								provinceFlag = false;
-	  					}
-	  					if(provinceFlag){
-	  						provinceHtml +='<p class="p_item '+_active+'"><span class="province-name">'+provinceArr[j]+'</span><span class="city-count"></span></p>'
-	  					
-	  						cityHtml +='<div class="province_city" data-id="'+provinceArr[j]+'" style="display:'+shwohide+'">'
-	  					}
-	  					var cityArr = _chinaMap["city"]
-	  					for(var m = 0;m < cityArr.length;m++){
-	  						var cityFlag = true;
-		  					if(_cityMap.length>0){
-			  					for(var k=0;k<_cityMap.length;k++){
-			  						if(_cityMap[k]==cityArr[m]["name"]){
-			  							cityHtml +='<p class="c_item"><input type="checkbox" class="checkbox"  checked><span class="city-name">'+cityArr[m]["name"]+'</span></p>';
-			  							cityFlag = false;
-			  							break;
-			  						}
-			  					}
-			  				}
-			  				if(cityFlag){
-	  							cityHtml +='<p class="c_item"><input type="checkbox" class="checkbox"><span class="city-name">'+cityArr[m]["name"]+'</span></p>'
-	  						}
-	  					}
-	  					cityHtml +='</div>'
-	  				}
+				var thisArea = chinaMapJSON[j]
+	  			for (var i in thisArea) {
+					//首先显示安徽省和其地级市 其他隐藏
+  					if (i=="安徽"){
+  						shwohide = "";
+  						_active = "active";
+  					}
+  					var provinceFlag = true;
+  					if(_provinceArr[i]!=undefined&&_provinceArr[i].length>0){
+							provinceHtml +='<p class="p_item '+_active+'"><span class="province-name">'+i+'</span><span class="city-count" style="display: inline;">('+cityNumArr[i]+')</span></p>'
+							//
+							cityHtml +='<div class="province_city" data-id="'+i+'" style="display:'+shwohide+'">';
+							provinceFlag = false;
+  					}
+  					if(provinceFlag){
+  						provinceHtml +='<p class="p_item '+_active+'"><span class="province-name">'+i+'</span><span class="city-count"></span></p>'
+  					
+  						cityHtml +='<div class="province_city" data-id="'+i+'" style="display:'+shwohide+'">'
+  					}
+  					var cityArr = thisArea[i]//每个省份下的地市
+					var _cityMap = _provinceArr[i]
+					if(_cityMap!=undefined&&_cityMap[0]=="全部"){
+						cityHtml +='<p class="c_item cityAll"><input type="checkbox" class="checkbox" checked><span class="city-name">全部</span></p>';
+					}else{
+						cityHtml +='<p class="c_item cityAll"><input type="checkbox" class="checkbox"><span class="city-name">全部</span></p>';
+					}
+  					for(var m = 0;m < cityArr.length;m++){
+  						var cityFlag = true;
+	  					if(_cityMap!=undefined&&_cityMap.length>0){
+		  					for(var k=0;k<_cityMap.length;k++){
+		  						if(_cityMap[k]==cityArr[m]){
+		  							cityHtml +='<p class="c_item"><input type="checkbox" class="checkbox"  checked><span class="city-name">'+cityArr[m]+'</span></p>';
+		  							cityFlag = false;
+		  							break;
+		  						}
+		  					}
+		  				}
+		  				if(cityFlag){
+  							cityHtml +='<p class="c_item"><input type="checkbox" class="checkbox"><span class="city-name">'+cityArr[m]+'</span></p>'
+  						}
+  					}
+  					cityHtml +='</div>'
 	  			}
 	  		}
 	  		provinceHtml += '</div>'
@@ -1115,13 +1129,32 @@
             	$(this).parent().children('input').trigger('click')
             })
             // 每次选择框变化,更新城市计数
-            $('.area_wrap .c_item input[type="checkbox"]').on('change',function () { 
+            $('.area_wrap .c_item input[type="checkbox"]').on('change',function () {
+				if($(this).parent("p").hasClass("cityAll")){
+					if ($(this).is(':checked')){
+						$(this).parent("p").nextAll("p").find('input[type="checkbox"]').prop('checked', true);
+					}else{
+						$(this).parent("p").nextAll("p").find('input[type="checkbox"]').prop('checked', false);
+					}
+				}else{
+					if ($(this).is(':checked')){
+						if($(this).parent().parent().find('input:checked').length == ($(this).parent().parent().find('p').length-1)){
+							$(this).parent().parent().find('.cityAll  input[type="checkbox"]').prop('checked', true);
+						}
+					}else{
+						$(this).parent().parent().find('.cityAll  input[type="checkbox"]').prop('checked', false);
+					}
+				}
             	var i = $(this).parent().parent().index()
                 // 找到该省份下所有被选中的input,统计有几个
                 var checkedCityNum = $(this).parent().parent().find('input:checked').length;
+				if(checkedCityNum>0&&$(this).parent().parent().find('.cityAll  input[type="checkbox"]').is(':checked')){
+					//判断全选是否
+					checkedCityNum = checkedCityNum -1;
+				}
                 var cityCountDOM = $('.province .p_item').eq(i).children('.city-count')
                 if (checkedCityNum) {
-                	cityCountDOM.show().text(`(${checkedCityNum})`)
+                	cityCountDOM.show().text(`(${checkedCityNum})`)
                 } else {
                 	cityCountDOM.show().text('')
                 	cityCountDOM.hide()
@@ -1131,14 +1164,16 @@
             $('.screen').click(function(){
             	$(".subscribe").toggleClass('overClass');
 				scrollHtml();
-				$('#showArea').find("span").toggleClass("current");
+				if(sessionStorage.getItem(userId+"_selectCityName")==""||sessionStorage.getItem(userId+"_selectCityName")==undefined){
+					$('#showArea').find("span").toggleClass("current");
+				}
             	$('.area_container').slideUp();
             	$('.screen').hide();
             })
             // 地区选择确认按钮
             $('.enter_btn').click(function (){
             	$(".subscribe").toggleClass('overClass');
-            	let cityCount = $('.area_wrap .city input:checked').length;
+            	let cityCount = $('.area_wrap .city input:checked').length-$('.area_wrap .city .cityAll input:checked').length;
             	$('.area_container').slideUp();
             	$('.screen').hide()
                 selectCity = "" //重新选择 初始化地区 参数
@@ -1180,9 +1215,9 @@
                     	province: provinceName,
                     	selectCity: cityArr
                     });
-                    sessionStorage.setItem(userId+"_selectCityName", JSON.stringify(selectCityName));
-                    ajaxFun(firstTime,selectCity);
                 })
+                sessionStorage.setItem(userId+"_selectCityName", JSON.stringify(selectCityName));
+                ajaxFun(firstTime,selectCity);
                 // 重写地区text
                 $('#showArea .jymobile-tab-triangle').addClass('current').text(`地区 ${cityCount}`);
                 

+ 16 - 2
src/web/templates/weixin/vipsubscribe/choose_area.html

@@ -653,6 +653,9 @@
                 document.querySelector('#' + s).scrollIntoView({block: 'center'});
             })
             $(".select-area-box .tab:not(.municipality)").on('click', function (event) {
+                if (AreaChoose.checkAnimatedRuning()) {
+                    return
+                }
                 if ($(this).next('.tab_content:not(:animated)').css("display") == "block") {
                     $(this).children().children('i').css({
                         "display": "inline-block",
@@ -761,11 +764,22 @@
                 $('.tips_d_money').text('¥' + price);
             }
 
+        },
+        animatedRuning: false,
+        checkAnimatedRuning: function () {
+            if (AreaChoose.animatedRuning) {
+                return true
+            }
+            AreaChoose.animatedRuning = true;
+            setTimeout(function () {
+                AreaChoose.animatedRuning = false;
+            }, 500);
+            return false
         }
-    }
+    };
 
     $(function () {
-        AreaChoose.isOpen()
+        AreaChoose.isOpen();
         AreaChoose.inintData(); //初始化 已选择和已购买数据
         AreaChoose.inintPage(); //初始化城市数据
 

+ 11 - 5
src/web/templates/weixin/vipsubscribe/choose_area_upgrade.html

@@ -399,9 +399,15 @@
     <script>
     	//已购买
     	var buystr = "";
+    	var areaData = {};
         $DoPost("/subscribepay/renewUpgrade/getBuyMsg", {}, function (data) {
         	if(data){
             	buystr = data.area;
+            	areaData["data"] = {
+            		"area" : data.area,
+            		"buyset" : data.buyset, 
+            	}
+            	console.log(areaData)
         	}
         }, false);
 //      console.log(buystr)
@@ -539,7 +545,7 @@
               let arr =[];
               // 判断省份下的城市是否等于选中的城市长度,相等就是全部选中
               if (length == activeLeng) {
-                  $('.tips_btn .tips_d_text.citys').slideUp()
+                  $('.tips_btn .tips_d_text.citys').hide();
                   // data.push($(this).parent('.tab_content').siblings('.tab:not(.whole)').children('.province').text().trim())
                   let province = $(this).parent('.tab_content').siblings('.tab:not(.whole)').children('.province').text().trim();
                   data.push({
@@ -591,10 +597,10 @@
                   // 判断每个省份下选中的城市长度,当大于等于4的时候 弹出"选择全省更划算的弹窗"
                   let childrenArr=[];
                   if (children.length >= 3 && !this.vipSubisTrial) {
-                      $('.tips_btn .tips_d_text.citys').text("已选择"+children.length+"个市,建议购买“全省”");
-                      $('.tips_btn .tips_d_text.citys').slideDown();
+                      $('.tips_btn .tips_d_text.citys').text("已选择"+children.length+"个市,建议购买“全省”");
+                      $('.tips_btn .tips_d_text.citys').show();
                   }else{
-                  		$('.tips_btn .tips_d_text.citys').slideUp();
+                  		$('.tips_btn .tips_d_text.citys').hide();
                   }
                   html += `${result[i].name}(`
                   for(var j = 0;j < children.length;j++){
@@ -629,7 +635,7 @@
 	            }
 	        }
           	if(provincesArr.length > 9){
-          		$('.tips_d_text.all').text("已选择"+provincesArr.length+"个省,建议购买“全国”");
+          		$('.tips_d_text.all').text("已选择"+provincesArr.length+"个省,建议购买“全国”");
           		$('.tips_d_text.all').show();
           		$('.tips_d_text.citys').hide();
           	}else{

+ 35 - 17
src/web/templates/weixin/vipsubscribe/choose_industry_upgrade.html

@@ -286,7 +286,10 @@
                 buttons.each(function(){
                     if ($(this).hasClass('active')) {
                         if($(this).attr("disabled")!="disabled"){
-                          selectedArr.push($(this).text())
+                        	if($(this).text() === "全部行业"){
+                        		
+                        	}
+                          	selectedArr.push($(this).text())
                         }
                     }
                 })
@@ -307,23 +310,29 @@
 							$(".tips_btn .btns .reset-btn").removeAttr("disabled");
 		            	}
                 	}else{
-                		let adds = buyIndustry.length + selectedArr.length
-                		$(".buyset").text("已购买:"+adds+"/"+buyset);
+                		if(selectedArr[0] === "全部行业"){
+                			$(".buyset").text("已购买:全部行业");
+                		}else{
+                			let adds = buyIndustry.length + selectedArr.length
+                			$(".buyset").text("已购买:"+buyset);
+                		}
                 	}
                 }else{
                 	if(buyset !== "全部行业"){
                 		$(".buyset").text("已购买:"+buyIndustryLen+"/"+buyset+"个行业")
                 	}else{
-                		$(".buyset").text("已购买:"+buyIndustryLen+"/"+buyset)
+                		$(".buyset").text("已购买:"+buyset)
                 	}
                 }
                 for(var i in selectedArr){
                 	if(selectedArr[i] === "全部行业"){
-                		$(".buyset").text("已购买:"+buyIndustry.length+"/"+buyset+"个行业");
-                		$(".addUpgrade").text("已新增:全部行业");
-                		$(".addUpgrade").show();
-                		$(".tips_btn .btns .save-btn").removeAttr("disabled");
-						$(".tips_btn .btns .reset-btn").removeAttr("disabled");
+                		if(buyset !== "全部行业"){
+                			$(".buyset").text("已购买:"+buyIndustry.length+"/"+buyset+"个行业");
+	                		$(".addUpgrade").text("已新增:全部行业");
+	                		$(".addUpgrade").show();
+	                		$(".tips_btn .btns .save-btn").removeAttr("disabled");
+							$(".tips_btn .btns .reset-btn").removeAttr("disabled");
+                		}
                 	}
                 }
                 // 显示隐藏优惠tips
@@ -406,13 +415,13 @@
                 findSelectedIndustry()
                 flushPrice()
             })
-
             // 重置按钮事件
             $('.reset-btn').on('click', function () {
 //            $("#all .industry_item").trigger("click");
 				$('.select-area-box .list button').removeClass('active');
                 showSelect(buyIndustry,false);
                 findSelectedIndustry();
+                sessionStorage.removeItem("vipSubSelectIndustryAdd");
                 sessionStorage.removeItem("vipSubSelectIndustryUpgrade");
                 $('.tips_btn .btns button').removeAttr('disabled');
             })
@@ -431,6 +440,8 @@
         				selectedIndustrysArr = selectedIndustryArr;
         			}
         		}
+        		sessionStorage.buyIndustry = $(".buyset").html();
+        		sessionStorage.addIndustry = $(".addUpgrade").html();
         		sessionStorage.setItem("vipSubSelectIndustryAdd",JSON.stringify(selectedIndustrysArr));
                 sessionStorage.setItem("vipSubSelectIndustryUpgrade",JSON.stringify(selectedIndustryArr));
                 history.go(-1);
@@ -464,13 +475,19 @@
 		            	buyLen = buyIndustry.length
 		            	buyIndustryLen = buyIndustry.length;
 		            	buyset = Number(data.buyset.buyerclasscount);
-		            	console.log(buyset)
-		            	if(buyset === -1){
-		            		buyset = "全部行业";
-		            		$(".buyset").text("已购买:"+buyLen+"/"+buyset);
-		            	}else{
-		            		$(".buyset").text("已购买:"+buyLen+"/"+buyset+"个行业");
-		            	}
+		            	if(sessionStorage.buyIndustry !== undefined){
+							$(".buyset").text(sessionStorage.buyIndustry);
+						}else{
+							if(buyset === -1){
+			            		buyset = "全部行业";
+			            		$(".buyset").text("已购买:/"+buyset);
+			            	}else{
+			            		$(".buyset").text("已购买:"+buyLen+"/"+buyset+"个行业");
+			            	}
+						}
+						if(sessionStorage.addIndustry !== undefined){
+							$(".addUpgrade").text(sessionStorage.addIndustry);
+						}
                 	}
                 },false);
                 if(checkObj(buyIndustry)){
@@ -500,6 +517,7 @@
 			    }
 			    return false;
 			}
+		
         </script>
     </body>
 </html>

+ 3 - 5
src/web/templates/weixin/vipsubscribe/edit_city_new.html

@@ -27,13 +27,11 @@
 
 <body>
 <div id="choose_area">
-    <p class="all_area" style="display: none;"> 可选择全部区域</p>
+    <!--<p class="all_area" style="display: none;"> 可选择全部区域</p>-->
     <p class="optional_count"> 可选择省数量:<em class="count"></em> / <span class="total"></span></p>
-    <div class="result">
-        <!-- 首次购买 显示"已选择" -----  升级订阅显示"已新增" -->
-
+    <!--<div class="result">
         <p>已选择:<span class="result_name"></span></p>
-    </div>
+    </div>-->
     <div class="form">
         <div class="select-area-box" style="padding-bottom: 0;">
             <ul class="area-list">

+ 392 - 389
src/web/templates/weixin/vipsubscribe/edit_subscribe_industry.html

@@ -1,405 +1,408 @@
 <!DOCTYPE html>
 <html>
-    <head>
-        <meta charset="utf-8">
-        <title>行业选择</title>
-        <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
-        <meta name="apple-mobile-web-app-capable" content="yes">
-        <meta name="apple-mobile-web-app-status-bar-style" content="black">
-        <script src="/vipsubscribe/js/rem.js?v={{Msg "seo" "version"}}"></script>
-        <link rel="stylesheet" href="/vipsubscribe/css/weui.min.css?v={{Msg "seo" "version"}}">
-        <link rel="stylesheet" type="text/css" href="/vipsubscribe/css/base.css?v={{Msg "seo" "version"}}" />
-        <link rel="stylesheet" type="text/css" href="/vipsubscribe/iconfont/iconfont.css?v={{Msg "seo" "version"}}" />
-        <link rel="stylesheet" href="/vipsubscribe/css/choose_industry.css?v={{Msg "seo" "version"}}">
-    </head>
-    <body>
-        <main class="choose_industry main">
-            <p class="optional_count"> 可选择行业数量: <em class="count"></em> / <span class="total"></span></p>
-            <div class="result"  style="display: block;">
-                <span class="label">已选择:</span>
-                <span class="result_name">全部行业</span>
-            </div>
-            <div class="form">
-                <div class="select-area-box">
-                    <ul class="list">
-                        <li class="list_item" id="all" style="display:none">
-                            <div class="item_label"></div>
-                            <div class="item_industry_list">
-                                <button class="industry_item">全部行业</button>
-                            </div>
-                        </li>
-                        <li class="list_item" id="A">
-                            <div class="item_label">A</div>
-                            <div class="item_industry_list">
-                                <button class="industry_item">安监</button>
-                            </div>
-                        </li>
-                        <li class="list_item" id="B">
-                            <div class="item_label">B</div>
-                            <div class="item_industry_list">
-                                <button class="industry_item">保监</button>
-                            </div>
-                        </li>
-                        <li class="list_item" id="C">
-                            <div class="item_label">C</div>
-                            <div class="item_industry_list">
-                                <button class="industry_item">财政</button>
-                                <button class="industry_item">传媒</button>
-                                <button class="industry_item">城管</button>
-                                <button class="industry_item">采矿业</button>
-                                <button class="industry_item">出版广电</button>
-                            </div>
-                        </li>
-                        <li class="list_item" id="D">
-                            <div class="item_label">D</div>
-                            <div class="item_industry_list">
-                                <button class="industry_item">档案</button>
-                                <button class="industry_item">地震</button>
-                                <button class="industry_item">党委办</button>
-                                <button class="industry_item">电信行业</button>
-                            </div>
-                        </li>
-                        <li class="list_item" id="F">
-                            <div class="item_label">F</div>
-                            <div class="item_industry_list">
-                                <button class="industry_item">法院</button>
-                                <button class="industry_item">发改</button>
-                            </div>
-                        </li>
-                        <li class="list_item" id="G">
-                            <div class="item_label">G</div>
-                            <div class="item_industry_list">
-                                <button class="industry_item">工商</button>
-                                <button class="industry_item">工信</button>
-                                <button class="industry_item">国土</button>
-                                <button class="industry_item">公安</button>
-                                <button class="industry_item">国资委</button>
-                                <button class="industry_item">公共资源交易</button>
-                            </div>
-                        </li>
-                        <li class="list_item" id="H">
-                            <div class="item_label">H</div>
-                            <div class="item_industry_list">
-                                <button class="industry_item">环保</button>
-                                <button class="industry_item">海关</button>
-                            </div>
-                        </li>
-                        <li class="list_item" id="J">
-                            <div class="item_label">J</div>
-                            <div class="item_industry_list">
-                                <button class="industry_item">教育</button>
-                                <button class="industry_item">军队</button>
-                                <button class="industry_item">交通</button>
-                                <button class="industry_item">纪委</button>
-                                <button class="industry_item">金融业</button>
-                                <button class="industry_item">建筑业</button>
-                                <button class="industry_item">检察院</button>
-                                <button class="industry_item">机关事务</button>
-                            </div>
-                        </li>
-                        <li class="list_item"  id="K">
-                            <div class="item_label">K</div>
-                            <div class="item_industry_list">
-                                <button class="industry_item">科技</button>
-                            </div>
-                        </li>
-                        <li class="list_item" id="L">
-                            <div class="item_label">L</div>
-                            <div class="item_industry_list">
-                                <button class="industry_item">林业</button>
-                                <button class="industry_item">旅游</button>
-                            </div>
-                        </li>
-                        <li class="list_item" id="M">
-                            <div class="item_label">M</div>
-                            <div class="item_industry_list">
-                                <button class="industry_item">民政</button>
-                                <button class="industry_item">民宗</button>
-                            </div>
-                        </li>
-                        <li class="list_item" id="N">
-                            <div class="item_label">N</div>
-                            <div class="item_industry_list">
-                                <button class="industry_item">农业</button>
-                                <button class="industry_item">能源化工</button>
-                                <button class="industry_item">农林牧渔</button>
-                            </div>
-                        </li>
-                        <li class="list_item" id="P">
-                            <div class="item_label">P</div>
-                            <div class="item_industry_list">
-                                <button class="industry_item">批发零售</button>
-                            </div>
-                        </li>
-                        <li class="list_item" id="Q">
-                            <div class="item_label">Q</div>
-                            <div class="item_industry_list">
-                                <button class="industry_item">气象</button>
-                            </div>
-                        </li>
-                        <li class="list_item" id="R">
-                            <div class="item_label">R</div>
-                            <div class="item_industry_list">
-                                <button class="industry_item">人行</button>
-                                <button class="industry_item">人社</button>
-                                <button class="industry_item">人大</button>
-                            </div>
-                        </li>
-                        <li class="list_item" id="S">
-                            <div class="item_label">S</div>
-                            <div class="item_industry_list">
-                                <button class="industry_item">食药</button>
-                                <button class="industry_item">税务</button>
-                                <button class="industry_item">水利</button>
-                                <button class="industry_item">市政</button>
-                                <button class="industry_item">审计</button>
-                                <button class="industry_item">商务</button>
-                                <button class="industry_item">司法</button>
-                                <button class="industry_item">社会团体</button>
-                            </div>
-                        </li>
-                        <li class="list_item" id="T">
-                            <div class="item_label">T</div>
-                            <div class="item_industry_list">
-                                <button class="industry_item">统计</button>
-                                <button class="industry_item">统战</button>
-                                <button class="industry_item">体育</button>
-                            </div>
-                        </li>                    
-                        <li class="list_item" id="W">
-                            <div class="item_label">W</div>
-                            <div class="item_industry_list">
-                                <button class="industry_item">文化</button>
-                                <button class="industry_item">卫生</button>
-                            </div>
-                        </li>
-                        <li class="list_item" id="X">
-                            <div class="item_label">X</div>
-                            <div class="item_industry_list">
-                                <button class="industry_item">学校</button>
-                                <button class="industry_item">宣传</button>
-                                <button class="industry_item">信息技术</button>
-                            </div>
-                        </li>
-                        <li class="list_item" id="Y">
-                            <div class="item_label">Y</div>
-                            <div class="item_industry_list">
-                                <button class="industry_item">医疗</button>
-                                <button class="industry_item">银监</button>
-                                <button class="industry_item">运输物流</button>
-                            </div>
-                        </li>
-                        <li class="list_item" id="Z">
-                            <div class="item_label">Z</div>
-                            <div class="item_industry_list">
-                                <button class="industry_item">质监</button>
-                                <button class="industry_item">组织</button>
-                                <button class="industry_item">政协</button>
-                                <button class="industry_item">住建</button>
-                                <button class="industry_item">证监</button>
-                                <button class="industry_item">政府办</button>
-                                <button class="industry_item">制造业</button>
-                                <button class="industry_item">政务中心</button>
-                                <button class="industry_item">住宿餐饮</button>
-                            </div>
-                        </li>
-                    </ul>
-                </div>
-            </div>
-            <div class="slide">
-                <a href="javascript:;">#</a>
-                <a href="javascript:;">A</a>
-                <a href="javascript:;">B</a>
-                <a href="javascript:;">C</a>
-                <a href="javascript:;">D</a>
-                <a href="javascript:;">F</a>
-                <a href="javascript:;">G</a>
-                <a href="javascript:;">H</a>
-                <a href="javascript:;">J</a>
-                <a href="javascript:;">K</a>
-                <a href="javascript:;">L</a>
-                <a href="javascript:;">M</a>
-                <a href="javascript:;">N</a>
-                <a href="javascript:;">P</a>
-                <a href="javascript:;">Q</a>
-                <a href="javascript:;">R</a>
-                <a href="javascript:;">S</a>
-                <a href="javascript:;">T</a>
-                <a href="javascript:;">W</a>
-                <a href="javascript:;">X</a>
-                <a href="javascript:;">Y</a>
-                <a href="javascript:;">Z</a>
-            </div>
-            <!-- <div class="bottom_button">
-                <button class="reset-btn left_btn" disabled>重置</button>
-                <button class="save-btn right_btn" disabled>确认</button>
-            </div> -->
-            <div class="tips_btn">
-                <div class="btns">
-                    <button class="reset-btn" id="cancel">取消</button>
-                    <button disabled class="save-btn" id="enter">确认修改</button>
-                </div>
-            </div>
-        </main>
-        <script src="/vipsubscribe/js/jquery-2.1.4.js?v={{Msg "seo" "version"}}"></script>
-        <script src="/vipsubscribe/js/weui.min.js?v={{Msg "seo" "version"}}"></script>
-        <script src="/vipsubscribe/js/common.js?v={{Msg "seo" "version"}}"></script>
-        <script>
+<head>
+    <meta charset="utf-8">
+    <title>行业选择</title>
+    <meta name="viewport"
+          content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no"/>
+    <meta name="apple-mobile-web-app-capable" content="yes">
+    <meta name="apple-mobile-web-app-status-bar-style" content="black">
+    <script src="/vipsubscribe/js/rem.js?v={{Msg "seo" "version"}}"></script>
+    <link rel="stylesheet" href="/vipsubscribe/css/weui.min.css?v={{Msg "seo" "version"}}">
+    <link rel="stylesheet" type="text/css" href="/vipsubscribe/css/base.css?v={{Msg "seo" "version"}}"/>
+    <link rel="stylesheet" type="text/css" href="/vipsubscribe/iconfont/iconfont.css?v={{Msg "seo" "version"}}"/>
+    <link rel="stylesheet" href="/vipsubscribe/css/choose_industry.css?v={{Msg "seo" "version"}}">
+</head>
+<body>
+<main class="choose_industry main">
+    <p class="optional_count" style="background: rgba(245,244,249,1);"> 可选择行业数量: <em class="count"></em> / <span class="total"></span></p>
+    <!--<div class="result" style="display: block;">
+        <span class="label">已选择:</span>
+        <span class="result_name">全部行业</span>
+    </div>-->
+    <div class="form">
+        <div class="select-area-box">
+            <ul class="list">
+                <li class="list_item" id="all" style="display:none">
+                    <div class="item_label"></div>
+                    <div class="item_industry_list">
+                        <button class="industry_item">全部行业</button>
+                    </div>
+                </li>
+                <li class="list_item" id="A">
+                    <div class="item_label">A</div>
+                    <div class="item_industry_list">
+                        <button class="industry_item">安监</button>
+                    </div>
+                </li>
+                <li class="list_item" id="B">
+                    <div class="item_label">B</div>
+                    <div class="item_industry_list">
+                        <button class="industry_item">保监</button>
+                    </div>
+                </li>
+                <li class="list_item" id="C">
+                    <div class="item_label">C</div>
+                    <div class="item_industry_list">
+                        <button class="industry_item">财政</button>
+                        <button class="industry_item">传媒</button>
+                        <button class="industry_item">城管</button>
+                        <button class="industry_item">采矿业</button>
+                        <button class="industry_item">出版广电</button>
+                    </div>
+                </li>
+                <li class="list_item" id="D">
+                    <div class="item_label">D</div>
+                    <div class="item_industry_list">
+                        <button class="industry_item">档案</button>
+                        <button class="industry_item">地震</button>
+                        <button class="industry_item">党委办</button>
+                        <button class="industry_item">电信行业</button>
+                    </div>
+                </li>
+                <li class="list_item" id="F">
+                    <div class="item_label">F</div>
+                    <div class="item_industry_list">
+                        <button class="industry_item">法院</button>
+                        <button class="industry_item">发改</button>
+                    </div>
+                </li>
+                <li class="list_item" id="G">
+                    <div class="item_label">G</div>
+                    <div class="item_industry_list">
+                        <button class="industry_item">工商</button>
+                        <button class="industry_item">工信</button>
+                        <button class="industry_item">国土</button>
+                        <button class="industry_item">公安</button>
+                        <button class="industry_item">国资委</button>
+                        <button class="industry_item">公共资源交易</button>
+                    </div>
+                </li>
+                <li class="list_item" id="H">
+                    <div class="item_label">H</div>
+                    <div class="item_industry_list">
+                        <button class="industry_item">环保</button>
+                        <button class="industry_item">海关</button>
+                    </div>
+                </li>
+                <li class="list_item" id="J">
+                    <div class="item_label">J</div>
+                    <div class="item_industry_list">
+                        <button class="industry_item">教育</button>
+                        <button class="industry_item">军队</button>
+                        <button class="industry_item">交通</button>
+                        <button class="industry_item">纪委</button>
+                        <button class="industry_item">金融业</button>
+                        <button class="industry_item">建筑业</button>
+                        <button class="industry_item">检察院</button>
+                        <button class="industry_item">机关事务</button>
+                    </div>
+                </li>
+                <li class="list_item" id="K">
+                    <div class="item_label">K</div>
+                    <div class="item_industry_list">
+                        <button class="industry_item">科技</button>
+                    </div>
+                </li>
+                <li class="list_item" id="L">
+                    <div class="item_label">L</div>
+                    <div class="item_industry_list">
+                        <button class="industry_item">林业</button>
+                        <button class="industry_item">旅游</button>
+                    </div>
+                </li>
+                <li class="list_item" id="M">
+                    <div class="item_label">M</div>
+                    <div class="item_industry_list">
+                        <button class="industry_item">民政</button>
+                        <button class="industry_item">民宗</button>
+                    </div>
+                </li>
+                <li class="list_item" id="N">
+                    <div class="item_label">N</div>
+                    <div class="item_industry_list">
+                        <button class="industry_item">农业</button>
+                        <button class="industry_item">能源化工</button>
+                        <button class="industry_item">农林牧渔</button>
+                    </div>
+                </li>
+                <li class="list_item" id="P">
+                    <div class="item_label">P</div>
+                    <div class="item_industry_list">
+                        <button class="industry_item">批发零售</button>
+                    </div>
+                </li>
+                <li class="list_item" id="Q">
+                    <div class="item_label">Q</div>
+                    <div class="item_industry_list">
+                        <button class="industry_item">气象</button>
+                    </div>
+                </li>
+                <li class="list_item" id="R">
+                    <div class="item_label">R</div>
+                    <div class="item_industry_list">
+                        <button class="industry_item">人行</button>
+                        <button class="industry_item">人社</button>
+                        <button class="industry_item">人大</button>
+                    </div>
+                </li>
+                <li class="list_item" id="S">
+                    <div class="item_label">S</div>
+                    <div class="item_industry_list">
+                        <button class="industry_item">食药</button>
+                        <button class="industry_item">税务</button>
+                        <button class="industry_item">水利</button>
+                        <button class="industry_item">市政</button>
+                        <button class="industry_item">审计</button>
+                        <button class="industry_item">商务</button>
+                        <button class="industry_item">司法</button>
+                        <button class="industry_item">社会团体</button>
+                    </div>
+                </li>
+                <li class="list_item" id="T">
+                    <div class="item_label">T</div>
+                    <div class="item_industry_list">
+                        <button class="industry_item">统计</button>
+                        <button class="industry_item">统战</button>
+                        <button class="industry_item">体育</button>
+                    </div>
+                </li>
+                <li class="list_item" id="W">
+                    <div class="item_label">W</div>
+                    <div class="item_industry_list">
+                        <button class="industry_item">文化</button>
+                        <button class="industry_item">卫生</button>
+                    </div>
+                </li>
+                <li class="list_item" id="X">
+                    <div class="item_label">X</div>
+                    <div class="item_industry_list">
+                        <button class="industry_item">学校</button>
+                        <button class="industry_item">宣传</button>
+                        <button class="industry_item">信息技术</button>
+                    </div>
+                </li>
+                <li class="list_item" id="Y">
+                    <div class="item_label">Y</div>
+                    <div class="item_industry_list">
+                        <button class="industry_item">医疗</button>
+                        <button class="industry_item">银监</button>
+                        <button class="industry_item">运输物流</button>
+                    </div>
+                </li>
+                <li class="list_item" id="Z">
+                    <div class="item_label">Z</div>
+                    <div class="item_industry_list">
+                        <button class="industry_item">质监</button>
+                        <button class="industry_item">组织</button>
+                        <button class="industry_item">政协</button>
+                        <button class="industry_item">住建</button>
+                        <button class="industry_item">证监</button>
+                        <button class="industry_item">政府办</button>
+                        <button class="industry_item">制造业</button>
+                        <button class="industry_item">政务中心</button>
+                        <button class="industry_item">住宿餐饮</button>
+                    </div>
+                </li>
+            </ul>
+        </div>
+    </div>
+    <div class="slide">
+        <a href="javascript:;">#</a>
+        <a href="javascript:;">A</a>
+        <a href="javascript:;">B</a>
+        <a href="javascript:;">C</a>
+        <a href="javascript:;">D</a>
+        <a href="javascript:;">F</a>
+        <a href="javascript:;">G</a>
+        <a href="javascript:;">H</a>
+        <a href="javascript:;">J</a>
+        <a href="javascript:;">K</a>
+        <a href="javascript:;">L</a>
+        <a href="javascript:;">M</a>
+        <a href="javascript:;">N</a>
+        <a href="javascript:;">P</a>
+        <a href="javascript:;">Q</a>
+        <a href="javascript:;">R</a>
+        <a href="javascript:;">S</a>
+        <a href="javascript:;">T</a>
+        <a href="javascript:;">W</a>
+        <a href="javascript:;">X</a>
+        <a href="javascript:;">Y</a>
+        <a href="javascript:;">Z</a>
+    </div>
+    <!-- <div class="bottom_button">
+        <button class="reset-btn left_btn" disabled>重置</button>
+        <button class="save-btn right_btn" disabled>确认</button>
+    </div> -->
+    <div class="tips_btn">
+        <div class="btns">
+            <button class="reset-btn" id="cancel">取消</button>
+            <button disabled class="save-btn" id="enter">确认修改</button>
+        </div>
+    </div>
+</main>
+<script src="/vipsubscribe/js/jquery-2.1.4.js?v={{Msg "seo" "version"}}"></script>
+<script src="/vipsubscribe/js/weui.min.js?v={{Msg "seo" "version"}}"></script>
+<script src="/vipsubscribe/js/common.js?v={{Msg "seo" "version"}}"></script>
+<script>
+    //加载数据
+    var EditIndustry = {
+        reqData: {},
+        selectlast: [],
+        init: function () {
+            this.getData();
+            this.showData();//初始化页面展示
+            this.initClick();//初始化点击事件
+        },
+        getData: function () {
             //加载数据
-            var EditIndustry={
-              reqData:{},
-              selectlast:[],
-              init:function(){
-                this.getData();
-                this.showData();//初始化页面展示
-                this.initClick();//初始化点击事件
-              },
-              getData:function(){
-                //加载数据
-                  $DoPost("/subscribepay/editSub/getSubBuyMsg",{},function(r){
-                    if(r.success){
-                      EditIndustry.reqData=r.data;
-                    }
-                  },false)
-                  if(this.reqData.industry.length==0&&this.reqData.buyset.buyerclasscount==-1){
-                    this.reqData.industry=["全部行业"]
-                  }
-              },
-              showData:function(){
-                this.selectlast=this.reqData.industry;
-                
-                $('.result .result_name').html(this.reqData.industry.join('、'));
-                
-                $('.industry_item').each(function () {  
-                  let text = $(this).text();
-                  EditIndustry.reqData.industry.forEach(v =>{
-                      if(v.trim() == text.trim()){
-                        $(this).addClass('active')
-                      }
-                    })
-                });
-                
-                if(this.reqData.buyset.buyerclasscount!=-1){ //非全部行业 展示数量
-                  $('.total').html(this.reqData.buyset.buyerclasscount);
-                  $('.count').html(this.reqData.industry.length);
-                  $('.optional_count').css({"width":"100%","position":"fixed","top":0,"z-index":9999});
-                  $('.result').css({"top":$('.optional_count').height()});
-                  $('.select-area-box').css({"padding-top":$('.optional_count').height()});
-                  if(this.reqData.industry.length>=this.reqData.buyset[2]){
-                    $('.industry_item:not(.active)').attr('disabled',true);
-                  }
-                }else{
-                  $("#all").css("display","");
-                  $(".optional_count").css("display","none");
+            $DoPost("/subscribepay/editSub/getSubBuyMsg", {}, function (r) {
+                if (r.success) {
+                    EditIndustry.reqData = r.data;
                 }
-                EditIndustry.findSelectedIndustry(true);
-              },
-              initClick:function(){
-                // 点击导航跳转
-                $("body").on('click','.slide a',function(){
-                    var s = $(this).html()
-                    if(s == '#'){
-                        return;
+            }, false)
+            if (this.reqData.industry.length == 0 && this.reqData.buyset.buyerclasscount == -1) {
+                this.reqData.industry = ["全部行业"]
+            }
+        },
+        showData: function () {
+            this.selectlast = this.reqData.industry;
+
+            //$('.result .result_name').html(this.reqData.industry.join('、'));
+
+            $('.industry_item').each(function () {
+                let text = $(this).text();
+                EditIndustry.reqData.industry.forEach(v => {
+                    if (v.trim() == text.trim()) {
+                        $(this).addClass('active')
                     }
-                    document.querySelector('#' + s).scrollIntoView({block:'center'});
                 })
-                // 每个button的点击事件
-                $('.select-area-box .list').on('click', 'button', function (e) {
-                    if($(this).text()=="全部行业"){
-                      if($(this).hasClass('active')){
+            });
+
+            if (this.reqData.buyset.buyerclasscount != -1) { //非全部行业 展示数量
+                $('.total').html(this.reqData.buyset.buyerclasscount);
+                $('.count').html(this.reqData.industry.length);
+                $('.optional_count').css({"width": "100%", "position": "fixed", "top": 0, "z-index": 9999});
+                $('.result').css({"top": $('.optional_count').height()});
+                $('.select-area-box').css({"padding-top": $('.optional_count').height()});
+                if (this.reqData.industry.length >= this.reqData.buyset[2]) {
+                    $('.industry_item:not(.active)').attr('disabled', true);
+                }
+            } else {
+                $("#all").css("display", "");
+                $(".optional_count").css("display", "none");
+            }
+            EditIndustry.findSelectedIndustry(true);
+        },
+        initClick: function () {
+            // 点击导航跳转
+            $("body").on('click', '.slide a', function () {
+                var s = $(this).html()
+                if (s == '#') {
+                    return;
+                }
+                document.querySelector('#' + s).scrollIntoView({block: 'center'});
+            })
+            // 每个button的点击事件
+            $('.select-area-box .list').on('click', 'button', function (e) {
+                if ($(this).text() == "全部行业") {
+                    if ($(this).hasClass('active')) {
                         return
-                      }
-                      if(EditIndustry.reqData.buyset.buyerclasscount!=-1){ //购买不是全部行业 不能点击
+                    }
+                    if (EditIndustry.reqData.buyset.buyerclasscount != -1) { //购买不是全部行业 不能点击
                         EditIndustry.showTip(`<span style="white-space: nowrap;">您只购买了${EditIndustry.reqData.buyset.buyerclasscount}个行业,如需更多请升级<span></p>`);
                         return
-                      }
-                      $('.select-area-box .list button').removeClass('active');
-                      $('#all button').addClass('active');
-                      $('#enter').removeAttr('disabled');
-                    }else{
-                      $(this).toggleClass('active')
-                      if($(".industry_item.active").length==0){//如果没有行业被选中 则选中全部行业
-                        if(EditIndustry.reqData.buyset.buyerclasscount==-1){
-                          $('#all button').addClass('active');
-                        }else{
-                          $('#enter').attr('disabled','disabled');//选择空不能提交
+                    }
+                    $('.select-area-box .list button').removeClass('active');
+                    $('#all button').addClass('active');
+                    $('#enter').removeAttr('disabled');
+                } else {
+                    $(this).toggleClass('active')
+                    if ($(".industry_item.active").length == 0) {//如果没有行业被选中 则选中全部行业
+                        if (EditIndustry.reqData.buyset.buyerclasscount == -1) {
+                            $('#all button').addClass('active');
+                        } else {
+                            $('#enter').attr('disabled', 'disabled');//选择空不能提交
                         }
-                      }else{
+                    } else {
                         $('#all button').removeClass('active');
                         $('#enter').removeAttr('disabled');
-                      }
-                    }
-                    
-                    EditIndustry.findSelectedIndustry(false);
-                })
-                // 取消按钮事件 返回上一页
-                $('#cancel').click(function(){
-                    window.history.go(-1);
-                })
-                // 确定修改事件
-                $('#enter').click(function(){
-                  $("#enter").attr("disabled","disabled");  
-                  //更新对象
-                  if(EditIndustry.reqData.buyset.buyerclasscount==-1&&EditIndustry.reqData.industry[0]=="全部行业"){
-                    EditIndustry.reqData.industry=[];
-                  }
-                  console.log("final select ",EditIndustry.reqData)
-                  $DoPost("/subscribepay/editSub/submit",{"type":"industry","value":JSON.stringify(EditIndustry.reqData.industry)},function(r){
-                    if(r.success){
-                      window.location.replace('/front/vipsubscribe/submitEditSubFinish');
                     }
-                  },false)
-                  $("#enter").removeAttr("disabled");  
-                })
-              },
-              showTip:function(msg){
-                weui.toast(msg,{
-                  duration: 2000,
-                  className: 'custom-toast',
-                });
-              },
-              findSelectedIndustry:function(isInit) {
-                  var buttons = $('.select-area-box .list button')
-                  // 找到已选择的数组(有active类的数组)
-                  var selectedArr = []
-                  buttons.each(function(){
-                      if ($(this).hasClass('active')) {
-                        selectedArr.push($(this).text())
-                      }
-                  })
-                  if(selectedArr.length==$('.select-area-box .list button').length-1){//选中了全部行业
-                    $('#all button').trigger('click');
-                    return
-                  }
-                  var selectCount= selectedArr.length
-                  $('.count').html(selectCount);
-                  // 显示隐藏优惠tips
-                  if (selectedArr.length >= EditIndustry.reqData.buyset.buyerclasscount&& EditIndustry.reqData.buyset.buyerclasscount!=-1) {
-                    if(!isInit){
-                      EditIndustry.showTip(`<span style="white-space: nowrap;">您只购买了${EditIndustry.reqData.buyset.buyerclasscount}个行业,如需更多请升级<span></p>`);
+                }
+
+                EditIndustry.findSelectedIndustry(false);
+            })
+            // 取消按钮事件 返回上一页
+            $('#cancel').click(function () {
+                window.history.go(-1);
+            })
+            // 确定修改事件
+            $('#enter').click(function () {
+                $("#enter").attr("disabled", "disabled");
+                //更新对象
+                if (EditIndustry.reqData.buyset.buyerclasscount == -1 && EditIndustry.reqData.industry[0] == "全部行业") {
+                    EditIndustry.reqData.industry = [];
+                }
+                console.log("final select ", EditIndustry.reqData)
+                $DoPost("/subscribepay/editSub/submit", {
+                    "type": "industry",
+                    "value": JSON.stringify(EditIndustry.reqData.industry)
+                }, function (r) {
+                    if (r.success) {
+                        window.location.replace('/front/vipsubscribe/submitEditSubFinish');
                     }
-                    $('.industry_item:not(.active)').attr('disabled','disabled');
-                  } else {
-                      $('.industry_item:not(.active)').removeAttr('disabled')
-                  }
-                  this.reqData.industry = selectedArr;
-                  var selectedStr = selectedArr.join('、')
-                  $('.result .result_name').text(selectedStr)
-                  if(this.noChange(this.reqData.industry,EditIndustry.selectlast)||this.reqData.industry.length==0){
-                    $('#enter').attr('disabled', 'disabled');
-                  }else{
-                    $('#enter').removeAttr('disabled');
-                  }
-                  $(".select-area-box .list").css("margin-top",$(".result").height()+20);
-              },
-              noChange:function(arr1,arr2){
-                return JSON.stringify(arr1.sort()) === JSON.stringify(arr2.sort());
-              }
-            }
-            $(function(){
-              EditIndustry.init();
+                }, false)
+                $("#enter").removeAttr("disabled");
             })
-            
-        </script>
-    </body>
+        },
+        showTip: function (msg) {
+            weui.toast(msg, {
+                duration: 2000,
+                className: 'custom-toast',
+            });
+        },
+        findSelectedIndustry: function (isInit) {
+            var buttons = $('.select-area-box .list button')
+            // 找到已选择的数组(有active类的数组)
+            var selectedArr = []
+            buttons.each(function () {
+                if ($(this).hasClass('active')) {
+                    selectedArr.push($(this).text())
+                }
+            })
+            if (selectedArr.length == $('.select-area-box .list button').length - 1) {//选中了全部行业
+                $('#all button').trigger('click');
+                return
+            }
+            var selectCount = selectedArr.length
+            $('.count').html(selectCount);
+            // 显示隐藏优惠tips
+            if (selectedArr.length >= EditIndustry.reqData.buyset.buyerclasscount && EditIndustry.reqData.buyset.buyerclasscount != -1) {
+                if (!isInit) {
+                    EditIndustry.showTip(`<span style="white-space: nowrap;">您只购买了${EditIndustry.reqData.buyset.buyerclasscount}个行业,如需更多请升级<span></p>`);
+                }
+                $('.industry_item:not(.active)').attr('disabled', 'disabled');
+            } else {
+                $('.industry_item:not(.active)').removeAttr('disabled')
+            }
+            this.reqData.industry = selectedArr;
+            var selectedStr = selectedArr.join('、')
+            //$('.result .result_name').text(selectedStr)
+            if (this.noChange(this.reqData.industry, EditIndustry.selectlast) || this.reqData.industry.length == 0) {
+                $('#enter').attr('disabled', 'disabled');
+            } else {
+                $('#enter').removeAttr('disabled');
+            }
+        },
+        noChange: function (arr1, arr2) {
+            return JSON.stringify(arr1.sort()) === JSON.stringify(arr2.sort());
+        }
+    }
+    $(function () {
+        EditIndustry.init();
+    })
+
+</script>
+</body>
 </html>

+ 3 - 1
src/web/templates/weixin/vipsubscribe/edit_subscribe_success.html

@@ -20,8 +20,10 @@
         </div>
         <script src="/vipsubscribe/js/jquery-2.1.4.js?v={{Msg "seo" "version"}}"></script>
         <script>
-
+			
             $(function(){
+            	sessionStorage.removeItem("vipSubSelectArea");
+            	sessionStorage.removeItem("vipSubSelectIndustry");
 //              timer($('.time'),()=>{
 //                  window.history.go(-1); 
 //              })

+ 10 - 3
src/web/templates/weixin/vipsubscribe/renew_notice.html

@@ -60,7 +60,7 @@
             </div>
 			<div class="renew_box">
                 <button style="display: none;" class="renew_service">续费</button>
-                <button style="display: none;" class="aginBuy" onclick="window.location.href='/weixin/pay/vipsubscribe_willExpire'">再次购买</button>
+                <button style="display: none;" class="aginBuy">再次购买</button>
                 <button style="display: none;" class="free_service" onclick="window.location.href='/swordfish/historypush'">使用免费订阅</button>
             </div>
 		</div>
@@ -73,6 +73,7 @@
 			var orderId = {{.T.orderId}};
 			var starts = {{.T.startTime}};
 			var ends = {{.T.endTime}};
+			var orderCode = "";
 //			console.log("orderId",orderId)
 //			console.log("starts",starts)
 //			console.log("ends",ends)
@@ -84,6 +85,8 @@
 						var buyerclass = r.buyerclass
 						var exprie = {{.T.exprie}};
 						var vipStatus = Number(r.vipStatus);
+						orderCode = r.orderCode;
+						//
 						var areaHtml = "";
 					    var provinceArr = [];
 					    var cityArr = [];
@@ -147,7 +150,7 @@
 					  	  	$(".free_service").show();
 					    }
 					}
-				});
+				},false);
 			}else{
 				$DoPost("/subscribepay/renewUpgrade/getBuyMsg", {}, function (data) {
 					if(data){
@@ -157,6 +160,7 @@
 					    var endTime = data.end;
 					    var exprie = {{.T.exprie}};
 					    var vipStatus = Number(data.vipStatus);
+					    orderCode = data.orderCode;
 					    //
 					    var areaHtml = "";
 					    var provinceArr = [];
@@ -222,7 +226,7 @@
 					    	$(".free_service").show();
 					    }
 					}
-				});	
+				},false);	
 			}
 			
 			$(".renew_service").on("click",function(){
@@ -232,6 +236,9 @@
 				};
 				window.location.href = "/weixin/pay/renewPayPage";
 			});
+			$(".aginBuy").on("click",function(){
+				window.location.href = "/weixin/pay/vipsubscribe_new?orderCode="+orderCode;
+			});
 	        //
 		    function checkObj(obj) {
 			    //检验数组

+ 3 - 4
src/web/templates/weixin/vipsubscribe/renew_pay.html

@@ -127,7 +127,7 @@
                     <span class="cancel">取消</span>
                 </div>
                 <div class="box_bd">
-                    <div class="tips profit_tips" style="display: none">已选择10个月,建议“按年订阅”更划算哦~</div>
+                    <div class="tips profit_tips" style="display: none">已选择10个月,建议“按年订阅”</div>
                     <div class="computed_price">¥58.0</div>
                     <div class="bd_select">
                         <div class="weui-cells weui-cells_checkbox choose-form">
@@ -391,7 +391,7 @@
 		        return
             }
             if (currentNum >= 10) {
-            	$('.profit_tips').text("已选择"+currentNum+"个月,建议“按年订阅”更划算哦~");
+            	$('.profit_tips').text("已选择"+currentNum+"个月,建议“按年订阅”");
                 $('.profit_tips').show();
                 if(currentNum==12){ //12个月自动跳转1年
                     $("#number_box_year .year_number:eq(0)").trigger("click");
@@ -457,7 +457,7 @@
             let isChecked = $(this).is(':checked')
             let val = $('.month_number').text();
             if (val >= 10) {
-            	$('.profit_tips').text("已选择"+val+"个月,建议“按年订阅”更划算哦~");
+            	$('.profit_tips').text("已选择"+val+"个月,建议“按年订阅”");
                 $('.profit_tips').show();
                 val = 10;
             }
@@ -799,7 +799,6 @@
 	    		"time": $('.choose_item.select_cycle .info').val(),
 	    		"payWay":"wx_js",
 	    		"pay_source": "Renew",
-	    		"endtime": ends,
 	    	}
 	    	console.log(param)
 	    	$DoPost("/subscribepay/renewUpgrade/renewUpgradeCreateOrder",param,function(r){

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

@@ -294,8 +294,8 @@
 	                        $("._area").text(area);
 							//行业
 							var buyerclass =  _vipData["a_buyerclass"];
-							if (buyerclass.length>0){
-	                        	$("._buyerClass").text(buyerclass.length+"个行业");
+							if (buyerclass >0){
+	                        	$("._buyerClass").text(buyerclass+"个行业");
 							}else{
 	                        	$("._buyerClass").text("全部行业");
 							}

+ 16 - 8
src/web/templates/weixin/vipsubscribe/vip_purchase.html

@@ -347,6 +347,7 @@
                         this.industrySelect = JSON.parse(sessionStorage.getItem("vipSubSelectIndustry"));
                     }
                     {{if eq .T.orderType 5 }}
+                    $('#payHandle').text("立即续费");
                     //即将到期 回显已购买
                     if (!sessionStorage.getItem("vipSubSelectArea") || !sessionStorage.getItem("vipSubSelectIndustry")) {
                         $DoPost("/subscribepay/editSub/getSubBuyMsg", {}, function (r) {
@@ -426,9 +427,9 @@
                     }
                 }
 
-                if (!$.isEmptyObject(data) && !this.areaSelect["一个省"]) {
+                /*if (!$.isEmptyObject(data) && !this.areaSelect["一个省"]) {
                     $(".choose_area").val(provinceArr.join(" ") + " " + cityArr.join(" "));
-                }
+                }*/
 
                 if (!$.isEmptyObject(this.areaSelect) && !this.areaSelect["全国"] && !this.areaSelect["一个省"]) { //选择有行业信息 且不是全国
                     var tipTxt = "已选择 ";
@@ -437,7 +438,12 @@
                         if (provinceArr.length > 0) tipTxt += "、";
                         tipTxt += cityArr.length + " 个地市";
                     }
-                    $(".add_tips.area").text(tipTxt).css("display", "");
+                    $(".choose_area").val(tipTxt);
+                    //$(".add_tips.area").text(tipTxt).css("display", "");
+                } else if (!$.isEmptyObject(this.areaSelect) && this.areaSelect["全国"]) {
+                    $(".choose_area").val("全国");
+                } else {
+                    $(".choose_area").val("");
                 }
             },
             showPrice: function () {
@@ -457,13 +463,15 @@
             },
             showIndustry: function () {
                 let data = this.industrySelect;
-                if (data.length > 0 && data[0] != "一个行业") {
+                /*if (data.length > 0 && data[0] != "一个行业") {
                     $(".choose_industry").val(data.join(" "));
-                }
-
+                }*/
                 if (this.industrySelect.length > 0 && this.industrySelect[0] != "全部行业" && this.industrySelect[0] != "一个行业") { //选择有行业信息
-                    var tipTxt = "已选择 ";
-                    $(".add_tips.industry").text(tipTxt + this.industrySelect.length + " 个行业").css("display", "");
+                    $(".choose_industry").val("已选择 " + this.industrySelect.length + " 个行业");
+                } else if (this.industrySelect.length > 0 && this.industrySelect[0] == "全部行业") {
+                    $(".choose_industry").val("全部行业");
+                } else {
+                    $(".choose_industry").val("");
                 }
             },
             showTime: function () {

+ 34 - 21
src/web/templates/weixin/vipsubscribe/vip_upgrade.html

@@ -437,6 +437,11 @@
 	        	sessionStorage.removeItem("vipSubSelectIndustryUpgrade");
 	        }
         }
+        if(sessionStorage.vipSubSelectIndustryAdd!==undefined&&sessionStorage.vipSubSelectIndustryAdd!==""){
+        	if(checkObj(JSON.parse(sessionStorage.vipSubSelectIndustryAdd))){
+	        	sessionStorage.removeItem("vipSubSelectIndustryAdd");
+	        }
+        }
         //
 		var monthPrice = "";
         var yearPrice = "";
@@ -607,7 +612,7 @@
             }
             $(".computed_price").show();
             if (currentNum >= 10) {
-            	$('.profit_tips').text("已选择"+currentNum+"个月,建议“按年订阅”更划算哦~");
+            	$('.profit_tips').text("已选择"+currentNum+"个月,建议“按年订阅”");
                 $('.profit_tips').show();
                 if(currentNum==12){ //12个月自动跳转1年
                     $("#number_box_year .year_number:eq(0)").trigger("click");
@@ -674,7 +679,7 @@
             let isChecked = $(this).is(':checked')
             let val = $('.month_number').text();
             if (val >= 10) {
-                $('.profit_tips').text("已选择"+val+"个月,建议“按年订阅”更划算哦~");
+                $('.profit_tips').text("已选择"+val+"个月,建议“按年订阅”");
                 $('.profit_tips').show();
             }
             
@@ -914,6 +919,8 @@
 	 	//
 	 	var area = "";
 	    var buyerclass = "";
+	    var buyArea = "";
+	    var buyIndustry = "";
 	    var cycleunit = "";
 	    var cyclecount = "";
 	 	var startTime = "";
@@ -923,8 +930,10 @@
 //	    var isvalidOk = "";
 	 	$DoPost("/subscribepay/renewUpgrade/getBuyMsg", {}, function (data) {
             if (data) {
-                area = data.allarea;
-			    buyerclass = data.allindustry;
+                area = data.area;
+			    buyerclass = data.buyerclass;
+			    buyArea = data.allarea;
+			    buyIndustry = data.allindustry;
 			    cycleunit = data.cycleunit;
 			    cyclecount = data.cyclecount;
 			    startTime = data.start;
@@ -1080,9 +1089,9 @@
 				}
 			}else{
 				areasArr = null;
-				if(area !== ""&&area !== undefined){
-					for(let province in area){
-			    		let citys = area[province];
+				if(buyArea !== ""&&buyArea !== undefined){
+					for(let province in buyArea){
+			    		let citys = buyArea[province];
 			    		if(citys.length===0){
 							allArea[province] = [];
 			    		}else{
@@ -1160,6 +1169,10 @@
 						industrysArr = ["全部行业"];
 					}
 				}
+			}
+			
+			if(sessionStorage.vipSubSelectIndustryUpgrade!==""&&sessionStorage.vipSubSelectIndustryUpgrade!==undefined){
+				var vipIndustry = JSON.parse(sessionStorage.vipSubSelectIndustryUpgrade);
 				if(buyerclass!==""&&buyerclass!==undefined){
 					for(let i in buyerclass){
 			    		let industry = buyerclass[i];
@@ -1178,9 +1191,9 @@
 				}
 			}else{
 				industrysArr = null;
-				if(buyerclass!==""&&buyerclass!==undefined){
-					for(let i in buyerclass){
-			    		let industry = buyerclass[i];
+				if(buyIndustry!==""&&buyIndustry!==undefined){
+					for(let i in buyIndustry){
+			    		let industry = buyIndustry[i];
 			    		allIndustry.push(industry);
 			    	}
 			    }
@@ -1301,8 +1314,8 @@
 			console.log("month",nowUpgrade)
 			//
 			if (nowUpgradeYear >= 1) {
-				let monthprice = getsubVipOrderPrice(area, buyerclass, [nowUpgrade, 2])
-				let yearprice = getsubVipOrderPrice(area, buyerclass, [nowUpgradeYear, 1])
+				let monthprice = getsubVipOrderPrice(buyArea, buyIndustry, [nowUpgrade, 2])
+				let yearprice = getsubVipOrderPrice(buyArea, buyIndustry, [nowUpgradeYear, 1])
 				oldPrice = yearprice + monthprice
 				if (monthprice == 0) {
 					oldMonthPrice = ((yearprice / nowUpgradeYear) / 10).toFixed(1);
@@ -1312,7 +1325,7 @@
 					oldYearPrice = ((monthprice / nowUpgrade) * 10).toFixed(1);
 				}
 			} else {
-				oldPrice = getsubVipOrderPrice(area, buyerclass, [nowUpgrade, 2])
+				oldPrice = getsubVipOrderPrice(buyArea, buyIndustry, [nowUpgrade, 2])
 				oldMonthPrice = (oldPrice / nowUpgrade)
 				oldYearPrice = ((oldPrice / nowUpgrade) * 10).toFixed(1);
 			}
@@ -1332,12 +1345,12 @@
 					addAreaPriceM = getsubVipOrderPrice(areasArr,industrysArr,[nowUpgrade,2]);
 				}
 				if(areasArr !== null){
-					oldAreaPriceY = getsubVipOrderPrice(areasArr,buyerclass,[nowUpgradeYear,1]);
-					oldAreaPriceM = getsubVipOrderPrice(areasArr,buyerclass,[nowUpgrade,2]);
+					oldAreaPriceY = getsubVipOrderPrice(areasArr,buyIndustry,[nowUpgradeYear,1]);
+					oldAreaPriceM = getsubVipOrderPrice(areasArr,buyIndustry,[nowUpgrade,2]);
 				}
 				if(industrysArr !== null){
-					addIndustryPriceY = getsubVipOrderPrice(area,industrysArr,[nowUpgradeYear,1]);
-					addIndustryPriceM = getsubVipOrderPrice(area,industrysArr,[nowUpgrade,2]);
+					addIndustryPriceY = getsubVipOrderPrice(buyArea,industrysArr,[nowUpgradeYear,1]);
+					addIndustryPriceM = getsubVipOrderPrice(buyArea,industrysArr,[nowUpgrade,2]);
 				}
 				let yearprice = getsubVipOrderPrice(allArea,allIndustry,[nowUpgradeYear,1]);
 				let monthprice = getsubVipOrderPrice(allArea,allIndustry,[nowUpgrade,2]);
@@ -1363,10 +1376,10 @@
 					addAreaPriceM = getsubVipOrderPrice(areasArr,industrysArr,[nowUpgrade,2]);
 				}
 				if(areasArr !== null){
-					oldAreaPriceM = getsubVipOrderPrice(areasArr,buyerclass,[nowUpgrade,2]);
+					oldAreaPriceM = getsubVipOrderPrice(areasArr,buyIndustry,[nowUpgrade,2]);
 				}
 				if(industrysArr !== null){
-					addIndustryPriceM = getsubVipOrderPrice(area,industrysArr,[nowUpgrade,2]);
+					addIndustryPriceM = getsubVipOrderPrice(buyArea,industrysArr,[nowUpgrade,2]);
 				}
 				let monthprice = getsubVipOrderPrice(allArea,allIndustry,[nowUpgrade,2]);
 //				price = getsubVipOrderPrice(areasArr,industrysArr,[nowUpgrade,2]);
@@ -1468,8 +1481,8 @@
         		industryArr = "no";
         	}
             //
-            let areaarr = area;
-        	let industryarr = buyerclass;
+            let areaarr = buyArea;
+        	let industryarr = buyIndustry;
         	let allAreaArr = allArea;
         	let allIndustryArr = allIndustry;
         	if(allAreaArr["全国"]){