Kaynağa Gözat

Merge branch 'dev2.8.5' of http://192.168.3.207:10080/qmx/jy into dev2.8.5

wangshan 5 yıl önce
ebeveyn
işleme
53a9ca695b
28 değiştirilmiş dosya ile 511 ekleme ve 251 silme
  1. 7 2
      src/jfw/front/vipsubscribe.go
  2. 1 1
      src/jfw/modules/pushsubscribe/src/match/config.json
  3. 6 2
      src/jfw/modules/pushsubscribe/src/match/job/matchjob.go
  4. 5 3
      src/jfw/modules/pushsubscribe/src/push/config.json
  5. 2 0
      src/jfw/modules/pushsubscribe/src/push/config/config.go
  6. 6 8
      src/jfw/modules/pushsubscribe/src/push/job/jobs.go
  7. 41 40
      src/jfw/modules/pushsubscribe/src/push/job/movejob.go
  8. 12 8
      src/jfw/modules/pushsubscribe/src/push/job/pushjob.go
  9. 0 13
      src/jfw/modules/pushsubscribe/src/push/job/refreshjob.go
  10. 2 2
      src/jfw/modules/pushsubscribe/src/push/job/repairjob.go
  11. 10 11
      src/jfw/modules/pushsubscribe/src/push/main.go
  12. 2 0
      src/jfw/modules/pushsubscribe/src/push/util/rpccall.go
  13. 29 12
      src/jfw/modules/subscribepay/src/entity/subscribeVip.go
  14. 107 75
      src/jfw/modules/subscribepay/src/service/vipRenewUpgrade.go
  15. 1 1
      src/jfw/modules/subscribepay/src/service/vipSubscribeEdit.go
  16. 25 7
      src/jfw/modules/subscribepay/src/service/vipSubscribePay.go
  17. 21 0
      src/web/staticres/js/common.js
  18. 3 3
      src/web/templates/weixin/vipsubscribe/choose_area.html
  19. 3 1
      src/web/templates/weixin/vipsubscribe/choose_area_upgrade.html
  20. 3 1
      src/web/templates/weixin/vipsubscribe/choose_industry_upgrade.html
  21. 5 5
      src/web/templates/weixin/vipsubscribe/edit_subscribe_allArea.html
  22. 4 6
      src/web/templates/weixin/vipsubscribe/edit_subscribe_city.html
  23. 0 2
      src/web/templates/weixin/vipsubscribe/edit_subscribe_success.html
  24. 15 2
      src/web/templates/weixin/vipsubscribe/renew_notice.html
  25. 51 3
      src/web/templates/weixin/vipsubscribe/renew_pay.html
  26. 24 2
      src/web/templates/weixin/vipsubscribe/vip_purchase.html
  27. 39 18
      src/web/templates/weixin/vipsubscribe/vip_upgrade.html
  28. 87 23
      src/web/templates/weixin/wxinfocontent.html

+ 7 - 2
src/jfw/front/vipsubscribe.go

@@ -122,9 +122,14 @@ func (s *Subscribepay) TrialInfo() {
 
 //订阅收费购买页面
 func (s *Subscribepay) ToPurchasePage(flag string) {
-	if flag == "trial" {
+	if flag == "trial" { //试用
 		s.T["isTrial"] = true
-	} else {
+	} else { //付费
+		if flag == "willExpire" {
+			s.T["orderType"] = 5
+		} else {
+			s.T["orderType"] = 1
+		}
 		s.T["signature"] = wx.SignJSSDK(s.Site() + s.Url()) //微信支付准备参数
 	}
 	s.Render("/weixin/vipsubscribe/vip_purchase.html")

+ 1 - 1
src/jfw/modules/pushsubscribe/src/match/config.json

@@ -7,7 +7,7 @@
 	"maxSearch": 5000,
 	"mgoAddr": "192.168.3.128:27080",
 	"mgoSize": 10,
-	"testids": ["5cee3e2a61fd002c800e2569"],
+	"testids": ["5d81c5a525ef8723ac0036f9"],
 	"filterWords":["项目","中标","公告"],
 	"matchPoolSize": 60,
 	"matchDuration": 1, 

+ 6 - 2
src/jfw/modules/pushsubscribe/src/match/job/matchjob.go

@@ -112,8 +112,12 @@ func (m *MatchJob) Execute() {
 		if user_batch_size == 0 {
 			break
 		}
-		m.ToMatch(user_batch_index, vipUser)
-		m.ToMatch(user_batch_index, freeUser)
+		if len(vipUser.Users > 0) {
+			m.ToMatch(user_batch_index, vipUser)
+		}
+		if len(freeUser.Users > 0) {
+			m.ToMatch(user_batch_index, freeUser)
+		}
 		if user_batch_size < Config.UserBatch {
 			break
 		}

+ 5 - 3
src/jfw/modules/pushsubscribe/src/push/config.json

@@ -33,21 +33,23 @@
 	"vipMaxPushSize": 2000,
 	"mgoAddr": "192.168.3.128:27080",
 	"mgoSize": 10,
-	"testids": ["5cee3e2a61fd002c800e2569"],
-	"weixinRpcServer": "192.168.20.111:8083",
+	"testids": ["5d81c5a525ef8723ac0036f9"],
+	"weixinRpcServer": "127.0.0.1:8083",
 	"wxColor": "#2cb7ca",
 	"wxGroup": "招标信息",
 	"wxTitle": "根据你订阅的关键词“%s”,剑鱼标讯为你推送以下信息。如果不想继续收到此类信息,可进入招标订阅的设置页面取消订阅。",
 	"vipWxTitle": "根据你当前订阅,剑鱼标讯为你推送以下信息。如果不想继续收到此类信息,可进入招标订阅的设置页面取消订阅。",
 	"wxDetailColor":"#686868",
 	"appPushServiceRpc":"127.0.0.1:5566",
-	"pcHelper":"192.168.20.129:8082",
+	"pcHelper":"127.0.0.1:8082",
 	"oncePushTime": "9:00",
 	"otherPushTimes":[
 		"07:30",
 		"14:00",
 		"18:00"
 	],
+	"vipPushDay": 7,
+	"vipPushWeek": "Friday",
 	"savePoolSize":10,
 	"pushPoolSize": 60,
 	"mergePoolSize": 40,

+ 2 - 0
src/jfw/modules/pushsubscribe/src/push/config/config.go

@@ -33,6 +33,8 @@ type config struct {
 	PushBatch               int         `json:"pushBatch"`
 	OncePushTime            string      `json:"oncePushTime"`
 	OtherPushTimes          []string    `json:"otherPushTimes"`
+	VipPushDay              int         `json:"vipPushDay"`
+	VipPushWeek             string      `json:"vipPushWeek"`
 	WxPoolSize              int         `json:"wxPoolSize"`
 	AppPoolSize             int         `json:"appPoolSize"`
 	MailSleep               int         `json:"mailSleep"`

+ 6 - 8
src/jfw/modules/pushsubscribe/src/push/job/jobs.go

@@ -6,12 +6,11 @@ import (
 )
 
 var Jobs = struct {
-	Move    *moveJob
-	Refresh *refreshJob
-	Push    *pushJob
-	Repair  *repairJob
+	Move   *MoveJob
+	Push   *PushJob
+	Repair *RepairJob
 }{
-	Move: &moveJob{
+	Move: &MoveJob{
 		moveLock:  &sync.Mutex{},
 		moveWait:  &sync.WaitGroup{},
 		movePool:  make(chan bool, Config.MovePoolSize),
@@ -19,14 +18,13 @@ var Jobs = struct {
 		mergeWait: &sync.WaitGroup{},
 		mergePool: make(chan bool, Config.MergePoolSize),
 	},
-	Refresh: &refreshJob{},
-	Push: &pushJob{
+	Push: &PushJob{
 		pool:     make(chan bool, Config.PushPoolSize),
 		savePool: make(chan bool, Config.SavePoolSize),
 		wait:     &sync.WaitGroup{},
 		lock:     &sync.Mutex{},
 	},
-	Repair: &repairJob{
+	Repair: &RepairJob{
 		pool: make(chan bool, Config.PushPoolSize),
 		wait: &sync.WaitGroup{},
 		lock: &sync.Mutex{},

+ 41 - 40
src/jfw/modules/pushsubscribe/src/push/job/movejob.go

@@ -14,10 +14,13 @@ import (
 	mgo "gopkg.in/mgo.v2"
 )
 
-type moveJob struct {
+type MoveUser struct {
 	info      map[string]interface{}
 	ids       []interface{}
 	isVipUser bool
+}
+
+type MoveJob struct {
 	moveLock  *sync.Mutex
 	moveWait  *sync.WaitGroup
 	movePool  chan bool
@@ -26,7 +29,7 @@ type moveJob struct {
 	mergePool chan bool
 }
 
-func (m *moveJob) Execute() {
+func (m *MoveJob) Execute() {
 	defer util.Catch()
 	Jobs.Push.lock.Lock()
 	defer Jobs.Push.lock.Unlock()
@@ -39,7 +42,7 @@ func (m *moveJob) Execute() {
 			"$lt": nowUnix,
 		},
 	}).Sort("userid").Iter()
-	moves := map[string]*moveJob{}
+	moveUsers := map[string]*MoveUser{}
 	logger.Info("开始遍历pushspace_temp")
 	index, number, length := 0, 0, 0
 	for data := make(map[string]interface{}); it.Next(&data); {
@@ -59,9 +62,9 @@ func (m *moveJob) Execute() {
 				maxPushSize = Config.VipMaxPushSize
 			}
 			m.moveLock.Lock()
-			move := moves[userId]
-			if move != nil {
-				list, _ := move.info["list"].(SortList)
+			moveUser := moveUsers[userId]
+			if moveUser != nil {
+				list, _ := moveUser.info["list"].(SortList)
 				idMap := map[string]bool{}
 				for _, v := range list {
 					idMap[util.ObjToString((*v.Info)["_id"])] = true
@@ -78,23 +81,23 @@ func (m *moveJob) Execute() {
 					list = list[:maxPushSize]
 				}
 				temp["list"] = list
-				move.info = temp
-				move.isVipUser = isVipUser
-				move.ids = append(move.ids, temp["_id"])
+				moveUser.info = temp
+				moveUser.isVipUser = isVipUser
+				moveUser.ids = append(moveUser.ids, temp["_id"])
 			} else {
 				temp["list"] = putil.ToSortList(temp["list"])
-				move = &moveJob{
+				moveUser = &MoveUser{
 					info:      temp,
 					ids:       []interface{}{temp["_id"]},
 					isVipUser: isVipUser,
 				}
 			}
-			moves[userId] = move
+			moveUsers[userId] = moveUser
 			length++
 			if length == Config.MoveBatch {
-				m.merge(&number, nowUnix, moves)
+				m.merge(&number, nowUnix, moveUsers)
 				length = 0
-				moves = map[string]*moveJob{}
+				moveUsers = map[string]*MoveUser{}
 			}
 		}(data)
 		data = make(map[string]interface{})
@@ -104,13 +107,13 @@ func (m *moveJob) Execute() {
 	}
 	m.moveWait.Wait()
 	if length > 0 {
-		m.merge(&number, nowUnix, moves)
+		m.merge(&number, nowUnix, moveUsers)
 		length = 0
-		moves = map[string]*moveJob{}
+		moveUsers = map[string]*MoveUser{}
 	}
 	logger.Info("迁移数据结束。。。", index)
 }
-func (m *moveJob) merge(number *int, nowUnix int64, moves map[string]*moveJob) {
+func (m *MoveJob) merge(number *int, nowUnix int64, moveUsers map[string]*MoveUser) {
 	*number++
 	logger.Info("第", *number, "次开始合并数据")
 	index := 0
@@ -119,10 +122,10 @@ func (m *moveJob) merge(number *int, nowUnix int64, moves map[string]*moveJob) {
 	updateArray_query := []map[string]interface{}{}
 	updateArray_set := []map[string]interface{}{}
 	updateArray_delete := []interface{}{}
-	for u, m := range moves {
+	for k, v := range moveUsers {
 		m.mergePool <- true
 		m.mergeWait.Add(1)
-		go func(userId string, move *moveJob) {
+		go func(userId string, moveUser *MoveUser) {
 			defer func() {
 				<-m.mergePool
 				m.mergeWait.Done()
@@ -130,29 +133,25 @@ func (m *moveJob) merge(number *int, nowUnix int64, moves map[string]*moveJob) {
 			sess := mongodb.GetMgoConn()
 			defer mongodb.DestoryMongoConn(sess)
 			var data map[string]interface{}
-			err := sess.DB(putil.DbName).C("pushspace").Find(map[string]interface{}{"userid": userId}).Select(map[string]interface{}{"list": 1}).One(&data)
-			if err != nil {
-				logger.Error(userId, "获取用户pushspace表中出数据出错", err)
-				return
-			}
+			sess.DB(putil.DbName).C("pushspace").Find(map[string]interface{}{"userid": userId}).Select(map[string]interface{}{"list": 1}).One(&data)
 			if data == nil { //批量新增
 				m.mergeLock.Lock()
-				saveArray = append(saveArray, move.info)
-				saveArray_delete = append(saveArray_delete, move.ids...)
+				saveArray = append(saveArray, moveUser.info)
+				saveArray_delete = append(saveArray_delete, moveUser.ids...)
 				if len(saveArray) == putil.BulkSize {
-					m.saveBulk(sess, &saveArray, &saveArray_delete)
+					m.saveBulk(&saveArray, &saveArray_delete)
 				}
 				m.mergeLock.Unlock()
 			} else { //批量更新
 				setMap := map[string]interface{}{}
 				for _, field := range MoveFields {
-					if move.info[field] == nil {
+					if moveUser.info[field] == nil {
 						continue
 					}
-					setMap[field] = move.info[field]
+					setMap[field] = moveUser.info[field]
 				}
 				//
-				newListOrig, _ := move.info["list"].(SortList)
+				newListOrig, _ := moveUser.info["list"].(SortList)
 				if newListOrig == nil || len(newListOrig) == 0 {
 					return
 				}
@@ -175,7 +174,7 @@ func (m *moveJob) merge(number *int, nowUnix int64, moves map[string]*moveJob) {
 				}
 				rLength := len(oldList)
 				maxPushSize := Config.MaxPushSize
-				if move.isVipUser {
+				if moveUser.isVipUser {
 					maxPushSize = Config.VipMaxPushSize
 				}
 				upSet := map[string]interface{}{}
@@ -192,32 +191,32 @@ func (m *moveJob) merge(number *int, nowUnix int64, moves map[string]*moveJob) {
 				}
 				upSet["$set"] = setMap
 				m.mergeLock.Lock()
-				updateArray_delete = append(updateArray_delete, move.ids...)
+				updateArray_delete = append(updateArray_delete, moveUser.ids...)
 				updateArray_query = append(updateArray_query, map[string]interface{}{"_id": data["_id"]})
 				updateArray_set = append(updateArray_set, upSet)
 				if len(updateArray_query) == putil.BulkSize {
-					m.updateBulk(sess, &updateArray_query, &updateArray_set, &updateArray_delete)
+					m.updateBulk(&updateArray_query, &updateArray_set, &updateArray_delete)
 				}
 				m.mergeLock.Unlock()
 			}
-		}(u, m)
+		}(k, v)
 		index++
 		if index%500 == 0 {
 			logger.Info("第", *number, "次合并数据:", index)
 		}
 	}
 	m.mergeWait.Wait()
-	sess := mongodb.GetMgoConn()
-	defer mongodb.DestoryMongoConn(sess)
 	if len(saveArray) > 0 {
-		m.saveBulk(sess, &saveArray, &saveArray_delete)
+		m.saveBulk(&saveArray, &saveArray_delete)
 	}
 	if len(updateArray_query) > 0 {
-		m.updateBulk(sess, &updateArray_query, &updateArray_set, &updateArray_delete)
+		m.updateBulk(&updateArray_query, &updateArray_set, &updateArray_delete)
 	}
 	logger.Info("第", *number, "次合并数据结束。。。", index)
 }
-func (m *moveJob) saveBulk(sess *mgo.Session, saves *[]map[string]interface{}, deletes *[]interface{}) {
+func (m *MoveJob) saveBulk(saves *[]map[string]interface{}, deletes *[]interface{}) {
+	sess := mongodb.GetMgoConn()
+	defer mongodb.DestoryMongoConn(sess)
 	coll := sess.DB(putil.DbName).C("pushspace")
 	bulk := coll.Bulk()
 	for _, v := range *saves {
@@ -231,7 +230,9 @@ func (m *moveJob) saveBulk(sess *mgo.Session, saves *[]map[string]interface{}, d
 	}
 	*saves = []map[string]interface{}{}
 }
-func (m *moveJob) updateBulk(sess *mgo.Session, array_q, array_s *[]map[string]interface{}, array_d *[]interface{}) {
+func (m *MoveJob) updateBulk(array_q, array_s *[]map[string]interface{}, array_d *[]interface{}) {
+	sess := mongodb.GetMgoConn()
+	defer mongodb.DestoryMongoConn(sess)
 	coll := sess.DB(putil.DbName).C("pushspace")
 	bulk := coll.Bulk()
 	for k, v := range *array_q {
@@ -246,7 +247,7 @@ func (m *moveJob) updateBulk(sess *mgo.Session, array_q, array_s *[]map[string]i
 	*array_q = []map[string]interface{}{}
 	*array_s = []map[string]interface{}{}
 }
-func (m *moveJob) delBulk(sess *mgo.Session, array *[]interface{}) {
+func (m *MoveJob) delBulk(sess *mgo.Session, array *[]interface{}) {
 	coll := sess.DB(putil.DbName).C("pushspace_temp")
 	count := 0
 	bulk := coll.Bulk()

+ 12 - 8
src/jfw/modules/pushsubscribe/src/push/job/pushjob.go

@@ -2,6 +2,7 @@ package job
 
 import (
 	"fmt"
+	"log"
 	"net/http"
 	"os"
 	. "public"
@@ -34,7 +35,7 @@ func init() {
 	}
 }
 
-type pushJob struct {
+type PushJob struct {
 	taskType                int
 	pool                    chan bool
 	wait                    *sync.WaitGroup
@@ -45,7 +46,7 @@ type pushJob struct {
 }
 
 //taskType 1--一天三次推送 2--九点推送
-func (p *pushJob) Execute(taskType int) {
+func (p *PushJob) Execute(taskType int) {
 	p.startPush(taskType)
 	if taskType == 2 {
 		p.startPush(3)
@@ -53,13 +54,15 @@ func (p *pushJob) Execute(taskType int) {
 }
 
 //开始推送
-func (p *pushJob) startPush(taskType int) {
+func (p *PushJob) startPush(taskType int) {
 	defer util.Catch()
 	var pusher Pusher
 	if taskType == 1 || taskType == 2 {
 		pusher = &NormalPush{}
 	} else if taskType == 3 {
 		pusher = &SpecialPush{}
+	} else {
+		return
 	}
 	p.lock.Lock()
 	defer p.lock.Unlock()
@@ -130,6 +133,7 @@ func (p *pushJob) startPush(taskType int) {
 					}
 				}
 				pushResult := p.selectPush(p.taskType, wxPush, appPush, mailPush, u, list)
+				log.Println(pushResult)
 				pusher.AfterPush(pushResult, u, v)
 			}(temp, isTake)
 		}
@@ -142,7 +146,7 @@ func (p *pushJob) startPush(taskType int) {
 }
 
 //满足条件进行推送
-func (p *pushJob) selectPush(taskType int, wxPush, appPush, mailPush int, u *UserInfo, list SortList) (pushResult *putil.PushResult) {
+func (p *PushJob) selectPush(taskType int, wxPush, appPush, mailPush int, u *UserInfo, list SortList) (pushResult *putil.PushResult) {
 	if wxPush == 1 || appPush == 1 || mailPush == 1 || u.PchelperPush == 1 {
 		pushResult = p.doPush(taskType, true, wxPush, appPush, mailPush, u, &list)
 	}
@@ -150,7 +154,7 @@ func (p *pushJob) selectPush(taskType int, wxPush, appPush, mailPush int, u *Use
 }
 
 //进入具体推送
-func (p *pushJob) doPush(taskType int, isSave bool, wxPush, appPush, mailPush int, k *UserInfo, sl *SortList) (pushResult *putil.PushResult) {
+func (p *PushJob) doPush(taskType int, isSave bool, wxPush, appPush, mailPush int, k *UserInfo, sl *SortList) (pushResult *putil.PushResult) {
 	defer util.Catch()
 	pushResult = &putil.PushResult{}
 	mailContent := ""
@@ -282,7 +286,7 @@ func (p *pushJob) doPush(taskType int, isSave bool, wxPush, appPush, mailPush in
 		pushResult.IsSaveSuccess = true
 	}
 	if isVipUser && (k.RateMode == 3 || k.RateMode == 4) {
-		if now.Day() != 28 && now.Weekday().String() != "Friday" {
+		if now.Day() != Config.VipPushDay && now.Weekday().String() != Config.VipPushWeek {
 			pushResult.IsVipTempSave = true
 			return
 		} else {
@@ -427,7 +431,7 @@ func (p *pushJob) doPush(taskType int, isSave bool, wxPush, appPush, mailPush in
 }
 
 //推送邮件(含附件)
-func (p *pushJob) sendMail(email, subject, html string, fmdatas []map[string]interface{}) bool {
+func (p *PushJob) sendMail(email, subject, html string, fmdatas []map[string]interface{}) bool {
 	if !Config.IsPushMail || len(Gmails) == 0 {
 		return true
 	}
@@ -461,7 +465,7 @@ func (p *pushJob) sendMail(email, subject, html string, fmdatas []map[string]int
 }
 
 //保存发送信息
-func (p *pushJob) save(k *UserInfo, matchInfos []*MatchInfo) string {
+func (p *PushJob) save(k *UserInfo, matchInfos []*MatchInfo) string {
 	p.savePool <- true
 	defer func() {
 		<-p.savePool

+ 0 - 13
src/jfw/modules/pushsubscribe/src/push/job/refreshjob.go

@@ -1,13 +0,0 @@
-package job
-
-import "qfw/util/mongodb"
-
-var pool = make(chan bool, 20)
-
-type refreshJob struct{}
-
-func (r *refreshJob) Execute() {
-	sess := mongodb.GetMgoConn()
-	defer mongodb.DestoryMongoConn(sess)
-	//sess.DB("qfw").C("user").Find()
-}

+ 2 - 2
src/jfw/modules/pushsubscribe/src/push/job/repairjob.go

@@ -10,13 +10,13 @@ import (
 )
 
 //补推接口
-type repairJob struct {
+type RepairJob struct {
 	pool chan bool
 	wait *sync.WaitGroup
 	lock *sync.Mutex
 }
 
-func (r *repairJob) Execute(param string) bool {
+func (r *RepairJob) Execute(param string) bool {
 	logger.Info("开始补推任务。。。")
 	var pusher Pusher = &RepairPush{}
 	taskType := 0

+ 10 - 11
src/jfw/modules/pushsubscribe/src/push/main.go

@@ -41,18 +41,17 @@ func main() {
 	}
 	//
 	log.Println("订阅推送-推送程序启动。。。")
+	if *move == 1 {
+		job.Jobs.Move.Execute()
+	}
 	if *modle == 1 {
 		job.Jobs.Push.Execute(*taskType)
-	} else {
-		go job.Task.Move.Execute()
-		go job.Task.OtherPush.Execute()
-		go job.Task.OncePush.Execute()
-		if *move == 1 {
-			job.Jobs.Move.Execute()
-		}
-		if *modle == 2 {
-			job.Jobs.Push.Execute(*taskType)
-		}
-		<-chan bool(nil)
+		return
+	} else if *modle == 2 {
+		job.Jobs.Push.Execute(*taskType)
 	}
+	go job.Task.Move.Execute()
+	go job.Task.OtherPush.Execute()
+	go job.Task.OncePush.Execute()
+	<-chan bool(nil)
 }

+ 2 - 0
src/jfw/modules/pushsubscribe/src/push/util/rpccall.go

@@ -2,6 +2,7 @@ package util
 
 import (
 	"encoding/json"
+	"log"
 	"net/rpc"
 	. "public"
 	. "push/config"
@@ -43,6 +44,7 @@ func SendWeixin(k *UserInfo, remark, title, pushDate string) bool {
 		Url:         Config.JianyuDomain + "/front/sess/" + Se.EncodeString(k.S_m_openid+",uid,"+strconv.Itoa(int(time.Now().Unix()))+",historypush") + "__" + pushDate,
 	}
 	ok, res := qrpc.WxPush(Config.WeixinRpcServer, "WeiXinRpc.SubscribePush", p)
+	log.Println(ok, res)
 	if !ok && (strings.Contains(res, "[46004]") || strings.Contains(res, "[65302]") || strings.Contains(res, "[43004]") || strings.Contains(res, "[40003]")) {
 		mongodb.Update("user", map[string]interface{}{"_id": bson.ObjectIdHex(k.Id)}, map[string]interface{}{
 			"$set": map[string]interface{}{

+ 29 - 12
src/jfw/modules/subscribepay/src/entity/subscribeVip.go

@@ -25,7 +25,7 @@ type VipSimpleMsg struct {
 	Industry   []string                `json:"industry"`   //行业
 	Cyclecount int                     `json:"cyclecount"` //日期数量
 	Cycleunit  int                     `json:"cycleunit"`  //日期单位
-	OrderType  int                     `json:"ordertype"`  //类型 1:订单 2:续费 3:立即升级 4:下月升级
+	OrderType  int                     `json:"ordertype"`  //类型 1:订单 2:续费 3:立即升级 4:下月升级 5:即将到期(升降级)
 }
 
 //购买内容
@@ -99,7 +99,7 @@ func (this *vipSubscribeStruct) PayCallBack(param *CallBackParam) bool {
 		flag = JyVipSubStruct.RenewSubVip(userid, qutil.ObjToString((*orderdata)["vip_endtime"]))
 	} else if vmsg.OrderType == 3 { //立即升级
 		flag = JyVipSubStruct.UpgradeSubVip(userid, vmsg, qutil.ObjToString((*orderdata)["vip_starttime"]), qutil.ObjToString((*orderdata)["vip_endtime"]), true)
-	} else if vmsg.OrderType == 4 { //下月升级
+	} else if vmsg.OrderType == 4 || vmsg.OrderType == 5 { //下月升级
 		flag = JyVipSubStruct.UpgradeSubVip(userid, vmsg, qutil.ObjToString((*orderdata)["vip_starttime"]), qutil.ObjToString((*orderdata)["vip_endtime"]), false)
 	}
 	//支付成功后 其他未支付vip订阅订单 变为已取消
@@ -118,14 +118,11 @@ func (this *vipSubscribeStruct) StartSubVip(userId string, vmsg VipSimpleMsg, st
 		buyset.AreaCount = -1       //城市数量
 		buyset.BuyerclassCount = -1 //行业数量
 	}
-	//计算服务时间
 	if !util.MQFW.UpdateById("user", userId,
 		bson.M{"$set": bson.M{
 			"o_vipjy.i_trial":      -1,                      //已激活试用
 			"o_vipjy.o_area":       vmsg.Area,               //设置地区
 			"o_vipjy.a_buyerclass": vmsg.Industry,           //设置行业
-			"o_vipjy.i_cycleunit":  vmsg.Cycleunit,          //购买单位
-			"o_vipjy.i_cyclecount": vmsg.Cyclecount,         //购买时长
 			"o_vipjy.o_buyset":     buyset,                  //购买内容 城市、省份、行业数量
 			"l_vip_starttime":      startTime.Unix(),        //开始时间
 			"l_vip_endtime":        endTime.Unix(),          //结束时间
@@ -164,21 +161,18 @@ func (this *vipSubscribeStruct) UpgradeSubVip(userId string, vmsg VipSimpleMsg,
 	if isNow {
 		return util.MQFW.UpdateById("user", userId,
 			bson.M{"$set": bson.M{
-				"o_vipjy.o_area":       vmsg.Area,       //设置地区
-				"o_vipjy.a_buyerclass": vmsg.Industry,   //设置行业
-				"o_vipjy.i_cycleunit":  vmsg.Cycleunit,  //购买单位
-				"o_vipjy.i_cyclecount": vmsg.Cyclecount, //购买时长
+				"o_vipjy.o_area":       vmsg.Area,     //设置地区
+				"o_vipjy.a_buyerclass": vmsg.Industry, //设置行业
 				"o_vipjy.o_buyset":     buyset,
 				"l_vip_endtime":        endTime.Unix(),
 				"i_vip_status":         2,
-				//	"l_vip_starttime":      startTime.Unix(),
 			}})
 	} else {
 		if !util.MQFW.UpdateById("user", userId,
 			bson.M{"$set": bson.M{
 				"l_vip_endtime": endTime.Unix(),
 			}}) {
-			log.Println("%s更新结束日期出错", userId)
+			log.Printf("%s更新结束%d日期出错\n", userId, endTime.Unix())
 			return false
 		}
 		return util.MQFW.Save("vip_upgrade",
@@ -236,6 +230,26 @@ func (this *vipSubscribeStruct) CanTrial(userId string) bool {
 	return true
 }
 
+//校验订单是否可以创建是否合法,返回user表查询信息
+func (this *vipSubscribeStruct) OrderCheck(userId string, orderType int) (bool, *map[string]interface{}) {
+	res, ok := util.MQFW.FindById("user", userId, `{"l_vip_endtime":1,"i_vip_status":1}`)
+	if !ok || len(*res) == 0 {
+		return false, nil
+	}
+	switch orderType { //1:订单 2:续费 3:立即升级 4:下月升级 5:即将到期(升降级)
+	case 1: //新订单 用户不能处于vip状态
+		vipStatus := qutil.IntAll((*res)["i_vip_status"])
+		return vipStatus != 2, res
+	case 5: //是否在到期结束三天内
+		timeStamp := qutil.Int64All((*res)["l_vip_endtime"])
+		if timeStamp == 0 {
+			return false, nil
+		}
+		return time.Now().AddDate(0, 0, 3).After(time.Unix(timeStamp, 0)), res
+	}
+	return false, nil
+}
+
 //获取省份,城市,行业购买内容
 //[省份,城市,行业]
 func (this *vipSubscribeStruct) GetBuySet(userId string) (*SubvipBuySet, error) {
@@ -253,9 +267,12 @@ func (this *vipSubscribeStruct) GetBuySet(userId string) (*SubvipBuySet, error)
 
 //订阅修改校验
 func (this *vipSubscribeStruct) SubEditCheckArea(area *map[string]interface{}, buySet *SubvipBuySet) bool {
-	if buySet.AreaCount == -1 {
+	if buySet.AreaCount == -1 { //购买全国
 		return true
 	}
+	if len(*area) == 0 { //选择全国
+		return false
+	}
 	pCount := 0
 	for k, v := range *area {
 		citys := qutil.ObjArrToStringArr(v.([]interface{}))

+ 107 - 75
src/jfw/modules/subscribepay/src/service/vipRenewUpgrade.go

@@ -5,6 +5,7 @@ import (
 	"entity"
 	"errors"
 	"log"
+	"math"
 	qutil "qfw/util"
 	//	"strings"
 	"fmt"
@@ -22,7 +23,6 @@ import (
 type RenewUpgrade struct {
 	*xweb.Action
 	getBuyMsg               xweb.Mapper `xweb:"/renewUpgrade/getBuyMsg"`               //获取购买相关信息
-	getRenewUpgradePrice    xweb.Mapper `xweb:"/renewUpgrade/getRenewUpgradePrice"`    //获取价格
 	renewUpgradeCreateOrder xweb.Mapper `xweb:"/renewUpgrade/renewUpgradeCreateOrder"` //续费升级支付
 }
 
@@ -65,80 +65,27 @@ func (this *RenewUpgrade) GetBuyMsg() {
 	}
 }
 
-func (this *RenewUpgrade) GetRenewUpgradePrice() {
-	years, _ := this.GetInteger("nowUpgradeYear")
-	months, _ := this.GetInteger("nowUpgrade")
-	log.Println("years", years)
-	log.Println("months", months)
-	var price int
-	userId := qutil.ObjToString(this.GetSession("userId"))
-	data, ok := util.MQFW.FindById("user", userId, nil)
-	if ok && len(*data) > 0 && *data != nil {
-		vipjy := (*data)["o_vipjy"].(map[string]interface{})
-		area := vipjy["o_area"]
-		buyerclass := vipjy["a_buyerclass"]
-		//
-		areaArr := qutil.ObjToMap(area)
-		buyerclassArr := qutil.ObjArrToStringArr(buyerclass.([]interface{}))
-		var completeMonth = 0
-		var completeYear = 0
-		if years >= 1 {
-			monthprice := entity.JyVipSubStruct.GetSubVipPrice(areaArr, buyerclassArr, months, 2)
-			yearprice := entity.JyVipSubStruct.GetSubVipPrice(areaArr, buyerclassArr, years, 1)
-			price = yearprice + monthprice
-			if monthprice == 0 {
-				completeMonth = ((yearprice / years) / 10)
-				completeYear = (yearprice / years)
-			} else {
-				completeMonth = (monthprice / months)
-				completeYear = ((monthprice / months) * 10)
-			}
-			log.Println("yearprice", yearprice)
-			log.Println("monthprice", monthprice)
-			log.Println("price", price)
-		} else {
-			price = entity.JyVipSubStruct.GetSubVipPrice(areaArr, buyerclassArr, months, 2)
-			completeMonth = (price / months)
-			completeYear = ((price / months) * 10)
-			log.Println("price111", price)
-		}
-		oldPrice := float32(price) / 100
-		log.Println("price", oldPrice)
-		log.Println("completeMonth", float32(completeMonth)/100)
-		log.Println("completeYear", float32(completeYear)/100)
-
-		dataArr := map[string]interface{}{
-			"oldprice":      oldPrice,
-			"oldyearprice":  float32(completeYear) / 100,
-			"oldmonthprice": float32(completeMonth) / 100,
-		}
-		this.ServeJson(dataArr)
-	}
-
-}
-
 //升级续费
 //创建订单返回支付串
 func (this *RenewUpgrade) RenewUpgradeCreateOrder() {
-	area := qutil.ObjToMap(this.GetString("area"))
-	industry := strings.Split(this.GetString("industry"), ",")
-	date := this.GetString("time") //
-	payWay := this.GetString("payWay")
-	effect := this.GetString("effect")         //升级 生效日期 Now  下月一号的时间戳
-	pay_source := this.GetString("pay_source") //类型  Renew or Upgrade
+	area := qutil.ObjToMap(this.GetString("area"))               //已购买区域+新增区域
+	industry := strings.Split(this.GetString("industry"), ",")   //已购买行业+新增行业
+	areas := qutil.ObjToMap(this.GetString("areas"))             //已购买区域
+	industrys := strings.Split(this.GetString("industrys"), ",") //已购买行业
+	date := this.GetString("time")                               //不延长时为空,正常为 年或月
+	payWay := this.GetString("payWay")                           //支付方式
+	effect := this.GetString("effect")                           //升级 生效日期 立即生效-now  下月一号生效-下月一号的时间戳
+	pay_source := this.GetString("pay_source")                   //类型  续费-Renew or 升级-Upgrade
 	userId := qutil.ObjToString(this.GetSession("userId"))
 	openId := qutil.ObjToString(this.GetSession("s_m_openid"))
-	endtime := this.GetString("endtime")
-	log.Println("endtime", endtime)
 	r := func() *entity.FuncResult {
 		now := time.Now()
 		//数据校验
-		if len(industry) == 1 { //去掉[""]
-			for _, i := range industry {
-				if i == "" {
-					industry = []string{}
-				}
-			}
+		if len(industry) == 1 && industry[0] == "" { //去掉[""]
+			industry = []string{}
+		}
+		if len(industrys) == 1 && industrys[0] == "" { //去掉[""]
+			industrys = []string{}
 		}
 		if !(pay_source == "Renew" || pay_source == "Upgrade") {
 			return &entity.FuncResult{false, errors.New("未知操作"), nil}
@@ -181,9 +128,17 @@ func (this *RenewUpgrade) RenewUpgradeCreateOrder() {
 			startTime = endTime
 		}
 		if date_unit == 1 { ///延长时间
-			endTime = startTime.AddDate(date_count, 0, 0)
+			endTime = endTime.AddDate(date_count, 0, 0)
 		} else if date_unit == 2 { //月
-			endTime = startTime.AddDate(0, date_count, 0)
+			endTime = endTime.AddDate(0, date_count, 0)
+		}
+		if pay_source == "Renew" && now.Unix() > end { //到期后的续费从当前时间往后延长
+			startTime = now
+			if date_unit == 1 { ///延长时间
+				endTime = startTime.AddDate(date_count, 0, 0)
+			} else if date_unit == 2 { //月
+				endTime = startTime.AddDate(0, date_count, 0)
+			}
 		}
 		filter := entity.VipSimpleMsg{
 			area,
@@ -197,14 +152,28 @@ func (this *RenewUpgrade) RenewUpgradeCreateOrder() {
 			return &entity.FuncResult{false, errors.New("创建订单出错"), nil}
 		}
 		//计算价格
-		/*var totalfee int
-		if effect != "" {
-			totalfee = qutil.IntAll(this.GetString("price")) * 100
-		} else {
+		var totalfee int
+		if pay_source == "Renew" {
 			totalfee = entity.JyVipSubStruct.GetSubVipPrice(area, industry, date_count, date_unit)
+		} else if pay_source == "Upgrade" {
+			upgradeYear, upgradeMonth := MaxUpgradeMonth(end, effect)                       //获取最大升级月数
+			addY := entity.JyVipSubStruct.GetSubVipPrice(area, industry, upgradeYear, 1)    //已购+新增,以年为单位的价格
+			addM := entity.JyVipSubStruct.GetSubVipPrice(area, industry, upgradeMonth, 2)   //已购+新增,以月为单位的价格
+			addPrice := addM + addY                                                         //已购+新增总价格
+			nowY := entity.JyVipSubStruct.GetSubVipPrice(areas, industrys, upgradeYear, 1)  //已购,以年为单位的价格
+			nowM := entity.JyVipSubStruct.GetSubVipPrice(areas, industrys, upgradeMonth, 2) //已购,以月为单位的价格
+			nowPrice := nowM + nowY                                                         //已购总价格
+			totalfee = addPrice - nowPrice                                                  //已购+新增的总价格 - 已购总价格 = 升级差价
+			if date_unit == 1 {                                                             //升级中的延长时间
+				lengPrice := entity.JyVipSubStruct.GetSubVipPrice(area, industry, date_count, 1) //单位为年的已购+新增延长时间价格
+				totalfee = totalfee + lengPrice                                                  //已购+新增延长时间价格 + 升级差价 = 最终价格
+			} else if date_unit == 2 {
+				lengPrice := entity.JyVipSubStruct.GetSubVipPrice(area, industry, date_count, 2) //单位为月的已购+新增延长时间价格
+				totalfee = totalfee + lengPrice                                                  //已购+新增延长时间价格 + 升级差价 = 最终价格
+			}
 		}
-		log.Println("price", totalfee)*/
-		totalfee := 1
+		log.Println("price", totalfee)
+		totalfee = 1 //设置测试价格为0.01
 
 		//创建订单
 		tradeno, prepayid, payStr := "", "", ""
@@ -295,3 +264,66 @@ func checkReqDates(dateStr string) (cyclecount, cycleunit int, err error) {
 	}
 	return -1, -1, errors.New(fmt.Sprintf("日期%s格式化出错", dateStr))
 }
+
+//获取最大升级月数
+func MaxUpgradeMonth(endTime int64, effect string) (int, int) {
+	endYear := time.Unix(endTime, 0).Year()
+	endMonth := int(time.Unix(endTime, 0).Month())
+	endDay := time.Unix(endTime, 0).Day()
+	nowYear := time.Now().Year()
+	nowMonth := int(time.Now().Month())
+	nowDay := time.Now().Day()
+	nowUpgrade := 0
+	if endYear == nowYear {
+		if endMonth == nowMonth {
+			nowUpgrade = 1
+		} else {
+			if endDay > nowDay {
+				nowUpgrade = endMonth - nowMonth + 1
+			} else {
+				nowUpgrade = endMonth - nowMonth
+			}
+		}
+	} else {
+		if endMonth == nowMonth {
+			if endDay <= nowDay {
+				nowUpgrade = (endYear - nowYear) * 12
+			} else {
+				nowUpgrade = (endYear-nowYear)*12 + 1
+			}
+		} else if endMonth > nowMonth {
+			if endDay <= nowDay {
+				nowUpgrade = (endYear-nowYear)*12 + (endMonth - nowMonth)
+			} else {
+				nowUpgrade = (endYear-nowYear)*12 + (endMonth - nowMonth) + 1
+			}
+		} else {
+			if endDay <= nowDay {
+				nowUpgrade = (endYear-nowYear-1)*12 + (12 - nowMonth + endMonth)
+			} else {
+				nowUpgrade = (endYear-nowYear-1)*12 + (12 - nowMonth + endMonth) + 1
+			}
+		}
+	}
+
+	if effect != "now" {
+		nowUpgrade = nowUpgrade - 1
+	}
+	if nowUpgrade == 0 {
+		nowUpgrade = 1
+	}
+	//
+	var nowUpgradeYear = 0
+	if nowUpgrade >= 12 {
+		nowUpgradeYear = int(math.Floor(float64(nowUpgrade) / float64(12)))
+		nowUpgrade = nowUpgrade - 12
+	} else if nowUpgrade >= 24 {
+		nowUpgradeYear = int(math.Floor(float64(nowUpgrade) / float64(12)))
+		nowUpgrade = nowUpgrade - 24
+	}
+	if nowUpgrade >= 10 {
+		nowUpgradeYear = nowUpgradeYear + 1
+		nowUpgrade = 0
+	}
+	return nowUpgradeYear, nowUpgrade
+}

+ 1 - 1
src/jfw/modules/subscribepay/src/service/vipSubscribeEdit.go

@@ -93,7 +93,7 @@ func (this *EditSub) SaveSubEdit() {
 			if err != nil {
 				return &editSubResult{false, errors.New("数据格式错误"), nil}
 			}
-			if len(industryNew) > buyset.BuyerclassCount && buyset.BuyerclassCount != -1 {
+			if buyset.BuyerclassCount != -1 && (len(industryNew) == 0 || len(industryNew) > buyset.BuyerclassCount) {
 				return &editSubResult{false, errors.New("非法操作"), nil}
 			}
 			if ok := util.MQFW.UpdateById("user", userId, bson.M{"$set": bson.M{"o_vipjy.a_buyerclass": industryNew}}); !ok {

+ 25 - 7
src/jfw/modules/subscribepay/src/service/vipSubscribePay.go

@@ -28,12 +28,13 @@ func init() {
 	xweb.AddAction(&SubVipPayOrder{})
 }
 
-//创建订单返回支付串
+//新订单 或 即将到期续费
 func (this *SubVipPayOrder) CreateOrder() {
 	area := qutil.ObjToMap(this.GetString("area"))
 	industry := strings.Split(this.GetString("industry"), ",")
 	date := this.GetString("time")
 	payWay := this.GetString("payWay")
+	orderType, _ := this.GetInteger("orderType") //1 简单付费,5 剩余三天 升降级付费
 	userId := qutil.ObjToString(this.GetSession("userId"))
 	openId := qutil.ObjToString(this.GetSession("s_m_openid"))
 	r := func() *entity.FuncResult {
@@ -42,8 +43,12 @@ func (this *SubVipPayOrder) CreateOrder() {
 		if len(industry) == 1 && industry[0] == "" { //去掉[""]
 			industry = []string{}
 		}
-		if !(payWay == "wx_js" || payWay == "wx_app" || payWay == "ali_app") {
-			return &entity.FuncResult{false, errors.New("未知支付"), nil}
+		if !(payWay == "wx_js" || payWay == "wx_app" || payWay == "ali_app") || !(orderType == 1 || orderType == 5) {
+			return &entity.FuncResult{false, errors.New("参数异常"), nil}
+		}
+		createOk, userData := entity.JyVipSubStruct.OrderCheck(userId, orderType)
+		if !createOk { //校验订单
+			return &entity.FuncResult{false, errors.New("非法请求"), nil}
 		}
 		date_count, date_unit, err := checkReqDate(date)
 		if err != nil {
@@ -54,9 +59,9 @@ func (this *SubVipPayOrder) CreateOrder() {
 			industry,
 			date_count,
 			date_unit,
-			1,
+			orderType,
 		}
-		log.Println(area, industry, date, payWay)
+
 		//插入订单表
 		mog_id := entity.JyVipSubStruct.SaveSelectLog(userId, openId, &filter)
 		if mog_id == "" {
@@ -98,7 +103,7 @@ func (this *SubVipPayOrder) CreateOrder() {
 		}
 		filterStr, _ := json.Marshal(filter)
 		ordercode := pay.GetOrderCode(userId)
-		orderid := util.Mysql.Insert("dataexport_order", map[string]interface{}{
+		insertMap := map[string]interface{}{
 			"order_money":    totalfee,
 			"order_status":   0,
 			"user_nickname":  qutil.ObjToString(this.GetSession("s_nickname")),
@@ -115,7 +120,20 @@ func (this *SubVipPayOrder) CreateOrder() {
 			"pay_way":        payWay,
 			"user_id":        userId,
 			"filter":         string(filterStr), //筛选
-		})
+		}
+		if orderType == 5 { //插入生效时间和结束时间
+			timeStamp := qutil.Int64All((*userData)["l_vip_endtime"])
+			startTime := time.Unix(timeStamp, 0)
+			var endTime time.Time
+			if filter.Cycleunit == 1 { //年
+				endTime = startTime.AddDate(filter.Cyclecount, 0, 0)
+			} else if filter.Cycleunit == 2 { //月
+				endTime = startTime.AddDate(0, filter.Cyclecount, 0)
+			}
+			insertMap["vip_starttime"] = qutil.FormatDate(&startTime, qutil.Date_Full_Layout)
+			insertMap["vip_endtime"] = qutil.FormatDate(&endTime, qutil.Date_Full_Layout)
+		}
+		orderid := util.Mysql.Insert("dataexport_order", insertMap)
 		if orderid == -1 {
 			return &entity.FuncResult{false, errors.New("数据库操作异常"), nil}
 		}

+ 21 - 0
src/web/staticres/js/common.js

@@ -262,6 +262,27 @@ function getUrlParam(name){
 		return unescape(r[2]); 
 	return null;
 }
+
+/******* 获取url参数(正则)********/
+function getParam(name) {
+    var search = document.location.search;
+    // alert(search);
+    var pattern = new RegExp("[?&]" + name + "\=([^&]+)", "g");
+    var matcher = pattern.exec(search);
+    var items = null;
+    if (null != matcher) {
+        try {
+            items = decodeURIComponent(decodeURIComponent(matcher[1]));
+        } catch (e) {
+            try {
+                items = decodeURIComponent(matcher[1]);
+            } catch (e) {
+                items = matcher[1];
+            }
+        }
+    }
+    return items;
+};
 //获取滚动条宽度
 function getScrollWidth() {
 	var noScroll, scroll, oDiv = document.createElement("DIV");

+ 3 - 3
src/web/templates/weixin/vipsubscribe/choose_area.html

@@ -592,7 +592,7 @@
           let pHeight = $('.result_text').height()
           let minHeight = $('.result_text').css('min-height')
           let rows = Math.round(Math.round(pHeight)/ parseFloat(minHeight));
-          $(".select-area-box .area-list").css("margin-top",$('.result_text').height()+20);
+          $(".select-area-box .area-list").css("margin-top",$('.result_text').height()+25);
           console.log("高度:"+ pHeight,"最小高度"+ minHeight,"行数:" + rows)
           if(rows == 1){
               $('.packup').hide()
@@ -619,14 +619,14 @@
                 $(".result").css("padding-bottom","0.3rem")
                 $(this).hide();
                 $('.packup').show()
-                $(".select-area-box .area-list").css("margin-top",$('.result_text').height()+20);
+                $(".select-area-box .area-list").css("margin-top",$('.result_text').height()+25);
             })
             $('.packup').click(function () { 
                 $(".result").css("padding-bottom","0.2rem")
                 $('.result_text').addClass('line_two')
                 $(this).hide();
                 $('.detail').show()
-                $(".select-area-box .area-list").css("margin-top",$('.result_text').height()+20);
+                $(".select-area-box .area-list").css("margin-top",$('.result_text').height()+25);
             })
             $("body").on('click','.slide a',function(){
                 var s = $(this).html()

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

@@ -389,8 +389,10 @@
     <script src="/vipsubscribe/js/fastclick.js?v={{Msg "seo" "version"}}"></script>
     <script src="/vipsubscribe/js/mapJSON.js?v={{Msg "seo" "version"}}"></script>
     <script src="/vipsubscribe/js/common.js?v={{Msg "seo" "version"}}"></script>
+    {{include "/common/weixin.html"}}
     <script>
-  
+  		initShare({{.T.signature}},{{.T.openid}},2,"jy_extend",{{.T.nickname}},{{.T.avatar}});
+  		//
     	//已购买
     	var buystr = "";
         $DoPost("/subscribepay/renewUpgrade/getBuyMsg", {}, function (data) {

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

@@ -249,8 +249,10 @@
         <script src="/vipsubscribe/js/fastclick.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>
+        {{include "/common/weixin.html"}}
         <script>
-              
+           initShare({{.T.signature}},{{.T.openid}},2,"jy_extend",{{.T.nickname}},{{.T.avatar}});
+           //
            // 点击导航跳转
             $("body").on('click','.slide a',function(){
                 var s = $(this).html()

+ 5 - 5
src/web/templates/weixin/vipsubscribe/edit_subscribe_allArea.html

@@ -458,14 +458,14 @@
                 $(".result").css("padding-bottom","0.3rem")
                 $(this).hide();
                 $('.packup').show()
-                $(".select-area-box .area-list").css("margin-top",$('.result_text').height()+20);
+                $(".select-area-box .area-list").css("margin-top",$('.result_text').height()+25);
             })
             $('.packup').click(function () { 
                 $(".result").css("padding-bottom","0.2rem")
                 $('.result_text').addClass('line_two')
                 $(this).hide();
                 $('.detail').show()
-                $(".select-area-box .area-list").css("margin-top",$('.result_text').height()+20);
+                $(".select-area-box .area-list").css("margin-top",$('.result_text').height()+25);
             })
             // 锚点跳转
             $("body").on('click', '.slide a', function () {
@@ -543,7 +543,7 @@
             $('#enter').click(function(){
               $("#enter").attr("disabled","disabled");
               //提交修改
-              if(EditArea.reqData.buyset.areacount==-1&&EditArea.reqData.area["全国"]){
+              if(EditArea.reqData.area["全国"]){
                 EditArea.reqData.area={}
               }
               console.log("final select ",EditArea.reqData.area)
@@ -663,7 +663,7 @@
                 }
             }
             $('.result_name').append(html);
-            $(".select-area-box .area-list").css("margin-top",$('.result').height()+20);
+            $(".select-area-box .area-list").css("margin-top",$('.result').height()+25);
             this.isOpen();
             if(this.noChange(this.lastSelectObj,this.reqData.area)){
               $("#enter").attr("disabled","disabled");  
@@ -681,7 +681,7 @@
             let pHeight = $('.result_text').height()
             let minHeight = $('.result_text').css('min-height')
             let rows = Math.round(Math.round(pHeight)/ parseFloat(minHeight));
-            $(".select-area-box .area-list").css("margin-top",$('.result_text').height()+20);
+            $(".select-area-box .area-list").css("margin-top",$('.result_text').height()+25);
             console.log("高度:"+ pHeight,"最小高度"+ minHeight,"行数:" + rows)
             if(rows == 1){
                 $('.packup').hide()

+ 4 - 6
src/web/templates/weixin/vipsubscribe/edit_subscribe_city.html

@@ -418,7 +418,6 @@
             $('.count').html(num[1].length);
             // 初次渲染城市选择结果
             $('.result_name').html(num[1].join('、'));
-           
             // 渲染城市
             $(".select-area-box ul li:not('.index')").each(function () {
                 var text = $(this).find(".province").text().trim();
@@ -479,14 +478,14 @@
                 $(".result").css("padding-bottom","0.3rem")
                 $(this).hide();
                 $('.packup').show()
-                $(".select-area-box .area-list").css("margin-top",$('.result_text').height()+20);
+                $('.select-area-box').css("margin-top",$(".optional_count").height()+$('.result_text').height()+25);
             })
             $('.packup').click(function () { 
                 $(".result").css("padding-bottom","0.2rem")
                 $('.result_text').addClass('line_two')
                 $(this).hide();
                 $('.detail').show()
-                $(".select-area-box .area-list").css("margin-top",$('.result_text').height()+20);
+                $('.select-area-box').css("margin-top",$(".optional_count").height()+$('.result_text').height()+25);
             })
             // 锚点跳转
             $("body").on('click', '.slide a', function () {
@@ -613,7 +612,7 @@
             this.selectObj=selectObj;
             $('.count').text(cityCount)
             $('.result_name').append(html);
-            $('.select-area-box').css("margin-top",$(".optional_count").height()+$(".result").height()+20);
+            $('.select-area-box').css("margin-top",$(".optional_count").height()+$(".result").height()+25);
             this.isOpen();
             if(this.noChange(this.selectObj,EditCity.reqData.area)||!this.compareArr(Object.keys(this.selectObj),Object.keys(this.reqData.buyset.citys))){
               $("#enter").attr("disabled","disabled")
@@ -639,8 +638,7 @@
             let pHeight = $('.result_text').height()
             let minHeight = $('.result_text').css('min-height')
             let rows = Math.round(Math.round(pHeight)/ parseFloat(minHeight));
-            $(".select-area-box .area-list").css("margin-top",$('.result_text').height()+20);
-            console.log("高度:"+ pHeight,"最小高度"+ minHeight,"行数:" + rows)
+            $('.select-area-box').css("margin-top",$(".optional_count").height()+$('.result_text').height()+25);
             if(rows == 1){
                 $('.packup').hide()
                 $('.detail').hide()

+ 0 - 2
src/web/templates/weixin/vipsubscribe/edit_subscribe_success.html

@@ -33,11 +33,9 @@
             }
             $(function(){
                 timer($('.time'),()=>{
-                    // window.location.href="vip_subscribe_edit.html"
                     window.location.replace('/front/vipsubscribe/toEditSubPage');
                 })
                 $('#back').click(function () {  
-                    // window.location.href="vip_subscribe_edit.html"
                     window.location.replace('/front/vipsubscribe/toEditSubPage');
                 })
             })

+ 15 - 2
src/web/templates/weixin/vipsubscribe/renew_notice.html

@@ -54,8 +54,9 @@
     	<script src="/vipsubscribe/js/fastclick.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>
+		{{include "/common/weixin.html"}}
 		<script type="text/javascript">
-			
+			initShare({{.T.signature}},{{.T.openid}},2,"jy_extend",{{.T.nickname}},{{.T.avatar}});
 			//
 			$DoPost("/subscribepay/renewUpgrade/getBuyMsg", {}, function (data) {
 				var area = data.area;
@@ -120,7 +121,19 @@
 			    	$(".free_service").show();
 			    }
 			});
-	        
+			
+	        //
+		    function checkObj(obj) {
+			    //检验数组
+			    if (Array.prototype.isPrototypeOf(obj) && obj.length === 0) {
+			        return true;
+			    }
+			    //检验对象
+			    if (Object.prototype.isPrototypeOf(obj) && Object.keys(obj).length === 0) {
+			        return true;
+			    }
+			    return false;
+			}
 			
 		</script>
 	</body>

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

@@ -49,7 +49,7 @@
                             <p>
                                 <!-- 正常点击vip首页续费进入显示去升级,即将到期点击vip首页续费显示订阅修改 -->
                                 <a href="/weixin/pay/toUpgradePage" class="go_update renew_upgrade">去升级</a>
-                                <a href="/front/vipsubscribe/toEditSubPage" class="go_update renew_update">订阅修改</a>
+                                <a href="/weixin/pay/vipsubscribe_willExpire" class="go_update renew_update">订阅修改</a>
                             </p>
                         </div>
                 </li>
@@ -201,6 +201,8 @@
     <script src="https://res.wx.qq.com/open/libs/weuijs/1.1.4/weui.min.js?v={{Msg "seo" "version"}}"></script>
     {{include "/common/weixin.html"}}
     <script type="text/javascript">
+    	initShare({{.T.signature}},{{.T.openid}},2,"jy_extend",{{.T.nickname}},{{.T.avatar}});
+    	//
     	try{
 			var signature = {{.T.signature}};
 			var isConfigSuccess = true;
@@ -526,8 +528,54 @@
 			    	$(".item_validity .label_for").text(dateHtml);
 			    }
 			    if(starts !== "" && ends !== ""){
-			    	let end = new Date(ends).toLocaleDateString();
-			    	console.log(end)
+			    	let end = new Date(ends*1000).toLocaleDateString();
+			    	let endtime = end.split("/");
+			    	let endYear = Number(endtime[0]);
+			    	let endMonth = Number(endtime[1]);
+			    	let endDay = Number(endtime[2]);
+			    	let start = new Date(starts*1000).toLocaleDateString();
+			    	let starttime = start.split("/");
+			    	let startYear = Number(starttime[0]);
+			    	let startMonth = Number(starttime[1]);
+			    	let startDay = Number(starttime[2]);
+			    	let year = "";
+			    	let month = "";
+			    	if(endYear > startYear){
+			    		if(endMonth > startMonth){
+			    			if(endDay < startDay){
+			    				year = endYear - startYear;
+			    				month = endMonth - startMonth -1;
+			    			}else{
+			    				year = endYear - startYear;
+			    				month = endMonth - startMonth;
+			    			}
+			    		}else{
+			    			if(endDay < startDay){
+			    				year = endYear - startYear-1;
+			    				month = 12+Number(endMonth)-startMonth -1;
+			    			}else{
+			    				year = endYear - startYear-1;
+			    				month = 12+Number(endMonth)-startMonth;
+			    			}
+			    			if(year === 0){
+			    				year = "";
+			    			}
+			    		}
+			    	}else if(endYear === startYear){
+			    		if(endDay < startDay){
+		    				month = endMonth - startMonth -1;
+		    			}else{
+		    				month = endMonth - startMonth;
+		    			}
+			    	}
+			    	//
+			    	if(year !== "" && month !==""){
+			    		$(".item_cycle .label_for").text(year+"年"+month+"个月");
+			    	}else if(year !== ""&& month ===""){
+			    		$(".item_cycle .label_for").text(year+"年");
+			    	}else if(year === ""&& month !==""){
+			    		$(".item_cycle .label_for").text(month+"个月");
+			    	}
 			    }
 			    var val = monthPrice * 6
 			    $(".computed_price").html("¥"+val.toFixed(1))

+ 24 - 2
src/web/templates/weixin/vipsubscribe/vip_purchase.html

@@ -142,7 +142,7 @@
                     <div class="weui-cell__bd read">
                         <p>
                             我已阅读,理解并接受
-                            <a href="abc.html">
+                            <a href="/front/staticPage/wx-serviceterms.html">
                                 《剑鱼标讯线上购买与服务条款》
                             </a>
                         </p>
@@ -342,6 +342,27 @@
             if(sessionStorage.getItem("vipSubSelectIndustry")){
               this.industrySelect=JSON.parse(sessionStorage.getItem("vipSubSelectIndustry"));
             }
+            {{if eq .T.orderType 5 }}
+              //即将到期 回显已购买
+              if(!sessionStorage.getItem("vipSubSelectArea")||!sessionStorage.getItem("vipSubSelectIndustry")){
+                $DoPost("/subscribepay/editSub/getSubBuyMsg",{},function(r){
+                  if(r.success){
+                    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=["全部行业"]
+                    }
+                    sessionStorage.setItem("vipSubSelectArea",JSON.stringify(purchase.areaSelect));
+                    sessionStorage.setItem("vipSubSelectIndustry",JSON.stringify(purchase.industrySelect));
+                  }
+                },false)
+              }
+            {{end}}
             if(sessionStorage.getItem("vipSubSelectTime")){
               this.timeSelect=JSON.parse(sessionStorage.getItem("vipSubSelectTime"));
             }
@@ -622,7 +643,8 @@
                     "area":JSON.stringify(area),
                     "industry":industry.join(","),
                     "time":$(".info:eq(2)").val().trim(),
-                    "payWay":"wx_js"
+                    "payWay":"wx_js",
+                    "orderType":{{.T.orderType}},
                   }
                   $DoPost("/subscribepay/vipsubscribe/createOrder",param,function(r){
                     if(r.success){

+ 39 - 18
src/web/templates/weixin/vipsubscribe/vip_upgrade.html

@@ -131,7 +131,7 @@
                     <div class="weui-cell__bd read">
                         <p>
                             我已阅读,理解并接受
-                            <a href="abc.html">
+                            <a href="/front/staticPage/wx-serviceterms.html">
                                 《剑鱼标讯线上购买与服务条款》
                             </a>
                         </p>
@@ -296,6 +296,8 @@
     <script src="/vipsubscribe/js/common.js?v={{Msg "seo" "version"}}"></script>
     {{include "/common/weixin.html"}}
     <script type="text/javascript">
+    	initShare({{.T.signature}},{{.T.openid}},2,"jy_extend",{{.T.nickname}},{{.T.avatar}});
+    	//
     	try{
 			var signature = {{.T.signature}};
 			var isConfigSuccess = true;
@@ -991,33 +993,44 @@
 			}
 			console.log("year",nowUpgradeYear)
 			console.log("month",nowUpgrade)
+			//
+			if (nowUpgradeYear >= 1) {
+				let monthprice = getsubVipOrderPrice(area, buyerclass, [nowUpgrade, 2])
+				let yearprice = getsubVipOrderPrice(area, buyerclass, [nowUpgradeYear, 1])
+				oldPrice = yearprice + monthprice
+				if (monthprice == 0) {
+					oldMonthPrice = ((yearprice / nowUpgradeYear) / 10).toFixed(1);
+					oldYearPrice = (yearprice / nowUpgradeYear).toFixed(1);
+				} else {
+					oldMonthPrice = (monthprice / nowUpgrade).toFixed(1);
+					oldYearPrice = ((monthprice / nowUpgrade) * 10).toFixed(1);
+				}
+			} else {
+				oldPrice = getsubVipOrderPrice(area, buyerclass, [nowUpgrade, 2])
+				oldMonthPrice = (oldPrice / nowUpgrade)
+				oldYearPrice = ((oldPrice / nowUpgrade) * 10).toFixed(1);
+			}
 			console.log("oldYearPrice",oldYearPrice)
 			console.log("oldMonthPrice",oldMonthPrice)
-			$DoPost("/subscribepay/renewUpgrade/getRenewUpgradePrice", {"nowUpgradeYear":nowUpgradeYear,"nowUpgrade":nowUpgrade}, function (r) {
-				if(r){
-					oldPrice = r.oldprice;
-					oldYearPrice = r.oldyearprice;
-					oldMonthPrice = r.oldmonthprice;
-				}
-			},false);
+			//
 			if(nowUpgradeYear >= 1){
 				let yearprice = getsubVipOrderPrice(areasArr,industrysArr,[nowUpgradeYear,1]);
 				let monthprice = getsubVipOrderPrice(areasArr,industrysArr,[nowUpgrade,2]);
 				price = yearprice + monthprice;
 				if(monthprice === 0){
-					completeMonth = ((yearprice / nowUpgradeYear) / 10-oldMonthPrice).toFixed(1);
-					completeYear = (yearprice / nowUpgradeYear-oldYearPrice).toFixed(1);
+					completeMonth = ((yearprice / nowUpgradeYear) / 10).toFixed(1);
+					completeYear = (yearprice / nowUpgradeYear).toFixed(1);
 				}else{
-					completeMonth = (monthprice / nowUpgrade-oldMonthPrice).toFixed(1);
-					completeYear = ((monthprice / nowUpgrade)*10-oldYearPrice).toFixed(1);
+					completeMonth = (monthprice / nowUpgrade).toFixed(1);
+					completeYear = ((monthprice / nowUpgrade)*10).toFixed(1);
 				}
 				console.log("yearprice",yearprice);
 				console.log("monthprice",monthprice);
 				console.log(">=1",price);
 			}else{
 				price = getsubVipOrderPrice(areasArr,industrysArr,[nowUpgrade,2]);
-				completeMonth = (price / nowUpgrade-oldMonthPrice).toFixed(1);
-				completeYear = ((price / nowUpgrade)*10-oldYearPrice).toFixed(1);
+				completeMonth = (price / nowUpgrade).toFixed(1);
+				completeYear = ((price / nowUpgrade)*10).toFixed(1);
 				console.log("<1",price)
 			}
 			
@@ -1039,7 +1052,9 @@
 				cPrice = (Number(cPrice) + Number(proPrice)).toFixed(1);
 			}
 			$(".finally_price").html("¥"+cPrice);
-			$(".save_upgrade").removeAttr('disabled');
+			if (cPrice>0){
+				$(".save_upgrade").removeAttr('disabled');
+			}
         }
         FinallyPrice();
         
@@ -1061,6 +1076,7 @@
         		let b = nowYear+"/"+a+"/1";
         		effect = new Date(b).getTime() /1000;
         	}
+        	//
         	let areas = areasArr;
         	let industrys = industrysArr;
         	if(areas["全国"]){
@@ -1069,21 +1085,26 @@
             if(industrys.length==1&&industrys[0]=="全部行业"){
                 industrys=[];
             }
+            //
+            let areaarr = area;
+        	let industryarr = buyerclass;
+            //
             let renew_time = $('.choose_item.lengthen .info').text();
             let times = "";
             if(renew_time !== "不延长"){
             	times = $('.choose_item.lengthen .info').text();
             }
-            let price = $(".finally_price").html().replace("¥","");
+            //
 	    	var param = {
 	    		"area": JSON.stringify(areas),
 	    		"industry": industrys.join(","),
+	    		"areas": JSON.stringify(areaarr),
+	    		"industryarr": industryarr.join(","),
 	    		"payWay": "wx_js",
 	    		"effect": effect,
 	    		"pay_source" : "Upgrade",
 	    		"time": times,
-	    		"price": Number(price),
-	    		"endtime": ends,
+	    		"nowUp": Number(nowRenew),
 	    	}
 	    	console.log(param)
 	    	$DoPost("/subscribepay/renewUpgrade/renewUpgradeCreateOrder",param,function(r){

+ 87 - 23
src/web/templates/weixin/wxinfocontent.html

@@ -11,7 +11,7 @@
 <script src="{{Msg "seo" "cdn"}}/js/fastclick.js?v={{Msg "seo" "version"}}"></script>
 <script src="{{Msg "seo" "cdn"}}/js/jquery.cookie.js"></script>
 <script src="{{Msg "seo" "cdn"}}/js/bootstrap.min.js"></script>
-<script src="{{Msg "seo" "cdn"}}/js/common.js?v={{Msg "seo" "version"}}"></script>
+<script src="{{Msg "seo" "cdn"}}/js/common.js?v={{Msg "seo" "version"}}1"></script>
 <script src="{{Msg "seo" "cdn"}}/wxswordfish/share.js?v={{Msg "seo" "version"}}"></script>
 <style type="text/css">
 /* forceShare start */
@@ -142,15 +142,11 @@ pre {
 .toolbar .follow_vip{
 	float: right;
 	color: #ffba00;
-	position: relative;
-	top: 10px;
 }
-.toolbar .follow i{
+.toolbar .follow i,.toolbar .follow_vip i{
 	top: 2px;
 }
-.toolbar .follow_vip i{
-	top: 3px;
-}
+
 .timebefore{
 	color: #888888;
 	position: relative;
@@ -158,10 +154,8 @@ pre {
 }
 .timebefore_vip{
 	color: #888888;
-	position: relative;
-    top: 10px;
-    right: 3.3rem;
     font-size: 14px;
+	
 }
 .timebefore i{
 	color: #7a7a7a;
@@ -491,6 +485,23 @@ pre {
     margin-right: 3px;
     float: left;
 }
+
+.projectMatch{
+	 padding: 1px 3px;
+    background: #B4B4B8;
+    color: #fff;
+    border-radius: 3px;
+    margin-right: 3px;
+    float: left;
+}
+
+.time_label{
+	margin-top:5px;
+	display: flex;
+	align-items: center;
+	justify-content: space-between;
+}
+  
 </style>
 </head>
 <body>
@@ -513,6 +524,66 @@ pre {
 <div class="info">
 	<div class="title myfollow" id="title">{{.T.obj.title}}</div>
 	<div class="toolbar">
+		{{if .T.obj.isVip}}
+		<!--VIP-->
+		<div class="type_label clearfix">
+			<script>var area="{{.T.obj.area}}"; if(area!="A" && area.replace(/\s+/g,"")!=""){document.write('<span class="area">'+area+'</span>');}</script>
+			<script>
+				var type = "";
+				if ({{.T.obj.subtype}} !=""){
+					type = {{.T.obj.subtype}};
+				}else if({{.T.obj.toptype}} !=""){
+					type = {{.T.obj.toptype}};
+				}else{
+					type = {{.T.obj.type}};
+					if(type == "bid"){
+						type = "中标";
+					}else if(type == "tender"){
+						type = "招标";
+					}else{
+						type = "";
+					}
+				}
+				if(type != ""){
+					document.write("<span class='type'>"+type+"</span>");
+				}
+	
+				var industry = {{.T.obj.industry}};
+				var subscopeclass = {{.T.obj.s_subscopeclass}};
+				//vip用户显示与普通用户不同
+				var buyerclass={{.T.obj.buyerclass}};
+				if(industry){
+	                document.write("<span class='industry'>"+industry+"</span>");
+				}else if(subscopeclass){
+					var suclass = subscopeclass.split(",")[0];
+					document.write("<span class='industry'>"+ suclass.split("_")[0]+"</span>");
+				}
+				if(buyerclass){
+					document.write("<span class='buyerclass'>"+ buyerclass+"</span>");
+				}
+				//项目匹配
+				projectMatch=getParam("projectMatch");
+				if (projectMatch){
+					document.write("<span class='projectMatch'>"+projectMatch+"</span>")
+				}
+				
+			</script>
+		</div>
+		<div class="time_label">
+			<script>
+				var l_publishtime = {{.T.obj.l_publishtime}};
+					if(l_publishtime != ""){
+						var tdf = timeDiff(new Date(Number(l_publishtime+"000")))
+						if(tdf != null){
+							document.write("<div class='timebefore_vip'><i class='glyphicon bofangjilu'></i>"+tdf+"</div>");
+						}
+					}
+			</script>
+		
+		{{if .T.obj.hasSession}}{{if or .T.obj.projectname .T.obj.projectcode}}<div class="follow_vip" >{{if .T.obj.followFlag}}<i class="glyphicon yiguanzhu"></i>已关注{{else}}<i class="glyphicon weiguanzhu"></i>关注项目{{end}}</div>{{end}}{{else}}<!--<a href="/swordfish/share/-1" style="text-decoration: none;color:#24C0D7;"><span class="follow"><i class="glyphicon weiguanzhu"></i></span>关注项目</a>-->{{end}}
+		</div>
+		{{else}}
+		<!--非VIP-->
 		<script>var area="{{.T.obj.area}}"; if(area!="A" && area.replace(/\s+/g,"")!=""){document.write('<span class="area">'+area+'</span>');}</script>
 		<script>
 			var type = "";
@@ -537,7 +608,6 @@ pre {
 			var industry = {{.T.obj.industry}};
 			var subscopeclass = {{.T.obj.s_subscopeclass}};
 			//vip用户显示与普通用户不同
-			var isvip={{.T.obj.isVip}};
 			var buyerclass={{.T.obj.buyerclass}};
 			if(industry){
                 document.write("<span class='industry'>"+industry+"</span>");
@@ -545,25 +615,19 @@ pre {
 				var suclass = subscopeclass.split(",")[0];
 				document.write("<span class='industry'>"+ suclass.split("_")[0]+"</span>");
 			}
-			if(isvip){
-				document.write("<span class='buyerclass'>"+ buyerclass+"</span></br>");
-			}
+			//projectMatch=getParam("projectMatch");
+			//if (projectMatch){
+			//	document.write("<span class='projectMatch'>"+projectMatch+"</span>")
+			//}
 			var l_publishtime = {{.T.obj.l_publishtime}};
 			if(l_publishtime != ""){
 				var tdf = timeDiff(new Date(Number(l_publishtime+"000")))
 				if(tdf != null){
-					if(isvip){
-						document.write("<span class='timebefore_vip'><i class='glyphicon bofangjilu'></i>"+tdf+"</span>");
-					}else{
-						document.write("<span class='timebefore'><i class='glyphicon bofangjilu'></i>"+tdf+"</span>");
-					}
+					document.write("<span class='timebefore'><i class='glyphicon bofangjilu'></i>"+tdf+"</span>");
 				}
 			}
 		</script>
-		{{if .T.obj.isVip}}
-			{{if .T.obj.hasSession}}{{if or .T.obj.projectname .T.obj.projectcode}}<span class="follow_vip" >{{if .T.obj.followFlag}}<i class="glyphicon yiguanzhu"></i>已关注{{else}}<i class="glyphicon weiguanzhu"></i>关注项目{{end}}</span>{{end}}{{else}}<!--<a href="/swordfish/share/-1" style="text-decoration: none;color:#24C0D7;"><span class="follow"><i class="glyphicon weiguanzhu"></i></span>关注项目</a>-->{{end}}
-		{{else}}
-			{{if .T.obj.hasSession}}{{if or .T.obj.projectname .T.obj.projectcode}}<span class="follow" >{{if .T.obj.followFlag}}<i class="glyphicon yiguanzhu"></i>已关注{{else}}<i class="glyphicon weiguanzhu"></i>关注项目{{end}}</span>{{end}}{{else}}<!--<a href="/swordfish/share/-1" style="text-decoration: none;color:#24C0D7;"><span class="follow"><i class="glyphicon weiguanzhu"></i></span>关注项目</a>-->{{end}}
+		{{if .T.obj.hasSession}}{{if or .T.obj.projectname .T.obj.projectcode}}<span class="follow" >{{if .T.obj.followFlag}}<i class="glyphicon yiguanzhu"></i>已关注{{else}}<i class="glyphicon weiguanzhu"></i>关注项目{{end}}</span>{{end}}{{else}}<!--<a href="/swordfish/share/-1" style="text-decoration: none;color:#24C0D7;"><span class="follow"><i class="glyphicon weiguanzhu"></i></span>关注项目</a>-->{{end}}
 		{{end}}
 	</div>
 	<!--{{if .T.obj.hasSession}}