Quellcode durchsuchen

Merge branch 'master' into hotfix/v4.9.82.2

yuelujie vor 7 Monaten
Ursprung
Commit
4b2cd993c4
100 geänderte Dateien mit 2124 neuen und 717 gelöschten Zeilen
  1. 2 1
      src/config.json
  2. 1 0
      src/config.yaml
  3. 3 0
      src/jfw/config/config.go
  4. 15 15
      src/jfw/front/front.go
  5. 1 1
      src/jfw/front/login.go
  6. 1 1
      src/jfw/front/org_structure.go
  7. 1 1
      src/jfw/front/otherAct.go
  8. 1 1
      src/jfw/front/pchelper.go
  9. 208 0
      src/jfw/front/returnMoneyPage.go
  10. 1 4
      src/jfw/front/swordfish.go
  11. 34 2
      src/jfw/front/vipsubscribe.go
  12. 2 2
      src/jfw/front/wxkeyset.go
  13. 4 3
      src/jfw/modules/app/src/app/front/errLogsReceive.go
  14. 11 7
      src/jfw/modules/app/src/app/front/front.go
  15. 2 2
      src/jfw/modules/app/src/app/front/login.go
  16. 18 19
      src/jfw/modules/app/src/app/front/me.go
  17. 0 2
      src/jfw/modules/app/src/app/front/swordfish.go
  18. 2 3
      src/jfw/modules/app/src/app/front/vipsubscribe.go
  19. 305 305
      src/jfw/modules/app/src/app/front/wxkeyset.go
  20. 1 0
      src/jfw/modules/app/src/config.yaml
  21. 2 0
      src/jfw/modules/app/src/jfw/config/config.go
  22. 7 0
      src/jfw/modules/app/src/web/staticres/jyapp/vipsubscribe/css/base.css
  23. 19 2
      src/jfw/modules/app/src/web/staticres/jyapp/vipsubscribe/css/vip_index_new.css
  24. 6 0
      src/jfw/modules/app/src/web/staticres/jyapp/vipsubscribe/css/vip_pay_success.css
  25. 26 1
      src/jfw/modules/app/src/web/staticres/jyapp/vipsubscribe/js/vip_index_new.js
  26. 13 4
      src/jfw/modules/app/src/web/staticres/jyapp/vipsubscribe/js/vip_order_detail.js
  27. 3 1
      src/jfw/modules/app/src/web/templates/big-member/page_orderdetail_aiForecastPack.html
  28. 11 5
      src/jfw/modules/app/src/web/templates/big-member/page_orderdetail_member.html
  29. 9 2
      src/jfw/modules/app/src/web/templates/big-member/page_orderdetail_subAccount.html
  30. 3 2
      src/jfw/modules/app/src/web/templates/commonPay/areaPack/orderDetail.html
  31. 16 2
      src/jfw/modules/app/src/web/templates/commonPay/bidfile/bidfileDetail.html
  32. 3 2
      src/jfw/modules/app/src/web/templates/commonPay/buyerPortraitPack/orderDetail.html
  33. 3 2
      src/jfw/modules/app/src/web/templates/commonPay/dataFile/orderDetail.html
  34. 3 2
      src/jfw/modules/app/src/web/templates/commonPay/dataPack/orderDetail.html
  35. 3 2
      src/jfw/modules/app/src/web/templates/commonPay/docMember/orderDetail.html
  36. 3 2
      src/jfw/modules/app/src/web/templates/commonPay/enterpriseAnalysis/orderDetail.html
  37. 3 2
      src/jfw/modules/app/src/web/templates/commonPay/filePack/orderDetail.html
  38. 14 4
      src/jfw/modules/app/src/web/templates/commonPay/integral/integralDetail.html
  39. 3 2
      src/jfw/modules/app/src/web/templates/commonPay/marketAnalysis/orderDetail.html
  40. 12 2
      src/jfw/modules/app/src/web/templates/commonPay/medical/orderDetail.html
  41. 2 1
      src/jfw/modules/app/src/web/templates/commonPay/myOrder.html
  42. 3 2
      src/jfw/modules/app/src/web/templates/commonPay/ownerAnalysis/orderDetail.html
  43. 6 3
      src/jfw/modules/app/src/web/templates/vipsubscribe/vip_index_new.html
  44. 1 0
      src/jfw/modules/app/src/web/templates/vipsubscribe/vip_order_detail.html
  45. 5 2
      src/jfw/modules/app/src/web/templates/vipsubscribe/vip_pay_success.html
  46. 8 7
      src/jfw/modules/publicapply/src/applocation/entity/entity.go
  47. 6 5
      src/jfw/modules/publicapply/src/detail/dao/bidding.go
  48. 8 10
      src/jfw/modules/publicapply/src/drainage/entity/entity.go
  49. 2 1
      src/jfw/modules/publicapply/src/drainage/entity/wxdreply.go
  50. 2 2
      src/jfw/modules/publicapply/src/drainage/initjson/initjson.go
  51. 3 4
      src/jfw/modules/publicapply/src/drainage/service/buyerunit.go
  52. 1 1
      src/jfw/modules/publicapply/src/oneclick/entity/entity.go
  53. 50 48
      src/jfw/modules/publicapply/src/subscribePush/entity/keyWords.go
  54. 17 4
      src/jfw/modules/subscribepay/src/config.json
  55. 21 2
      src/jfw/modules/subscribepay/src/config/config.go
  56. 1 1
      src/jfw/modules/subscribepay/src/entity/dataReportStruct.go
  57. 1 2
      src/jfw/modules/subscribepay/src/entity/equityCode.go
  58. 2 2
      src/jfw/modules/subscribepay/src/entity/jyCourseOnlineStruct.go
  59. 1 0
      src/jfw/modules/subscribepay/src/entity/order.go
  60. 21 14
      src/jfw/modules/subscribepay/src/entity/payCommonEntity.go
  61. 1 0
      src/jfw/modules/subscribepay/src/entity/reWardStruct.go
  62. 68 0
      src/jfw/modules/subscribepay/src/entity/returnMoney.go
  63. 21 17
      src/jfw/modules/subscribepay/src/entity/shareFission.go
  64. 41 2
      src/jfw/modules/subscribepay/src/entity/subscribeVip.go
  65. 2 0
      src/jfw/modules/subscribepay/src/go.mod
  66. 4 0
      src/jfw/modules/subscribepay/src/go.sum
  67. 33 17
      src/jfw/modules/subscribepay/src/pay/aliPay.go
  68. 3 3
      src/jfw/modules/subscribepay/src/pay/util.go
  69. 44 35
      src/jfw/modules/subscribepay/src/pay/wxPay.go
  70. 69 0
      src/jfw/modules/subscribepay/src/rpcfollow/returnMoney.go
  71. 155 28
      src/jfw/modules/subscribepay/src/service/commonAction.go
  72. 10 10
      src/jfw/modules/subscribepay/src/service/courseAction.go
  73. 3 3
      src/jfw/modules/subscribepay/src/service/dataReport.go
  74. 1 1
      src/jfw/modules/subscribepay/src/service/debrisProduct.go
  75. 2 2
      src/jfw/modules/subscribepay/src/service/entniche.go
  76. 10 5
      src/jfw/modules/subscribepay/src/service/orderListDetails.go
  77. 74 29
      src/jfw/modules/subscribepay/src/service/payCallback.go
  78. 1 1
      src/jfw/modules/subscribepay/src/service/reward.go
  79. 14 13
      src/jfw/modules/subscribepay/src/service/salesCreateOrder.go
  80. 1 1
      src/jfw/modules/subscribepay/src/service/userAccountInfo.go
  81. 8 0
      src/web/staticres/common-module/order-list/css/order-detail.css
  82. 7 0
      src/web/staticres/common-module/order-list/css/order-list.css
  83. 1 1
      src/web/staticres/common-module/order-list/js/order-detail.js
  84. 1 1
      src/web/staticres/common-module/order-list/js/order-list.js
  85. 5 2
      src/web/staticres/common-module/vipsubscribe/css/vip-subscribe-set-template.css
  86. 8 0
      src/web/staticres/vipsubscribe/css/public.css
  87. 22 5
      src/web/staticres/vipsubscribe/css/vip_index_new.css
  88. 8 0
      src/web/staticres/vipsubscribe/css/vip_pay_success.css
  89. 24 0
      src/web/staticres/vipsubscribe/js/vip_index_new.js
  90. 85 0
      src/web/templates/common/returnMoney/aliReturnMoney.html
  91. 390 0
      src/web/templates/common/returnMoney/wxReturnMoney.html
  92. 8 2
      src/web/templates/order/pc/buyerPortraitPack/detail.html
  93. 8 2
      src/web/templates/order/pc/docMember/detail.html
  94. 8 2
      src/web/templates/order/pc/filePack/detail.html
  95. 6 1
      src/web/templates/order/pc/integral/integralDetail.html
  96. 9 2
      src/web/templates/order/pc/reportDownloadPack/detail.html
  97. 5 2
      src/web/templates/pc/entniche_orderDetail.html
  98. 8 2
      src/web/templates/pc/medaratus_orderDetail.html
  99. 8 3
      src/web/templates/pc/member_orderDetail.html
  100. 12 6
      src/web/templates/pc/myOrder.html

+ 2 - 1
src/config.json

@@ -63,7 +63,8 @@
     "weChatUrlEnt": "/jy_mobile/project/joined/list?identity=ent",
     "weChatUrl": "/jy_mobile/project/joined/list",
     "agencyInfo": "/jy_mobile/message/todoList?msgType=11",
-    "report_analysis": "/jyapp/big/page/report_analysis?id=%s"
+    "report_analysis": "/jyapp/big/page/report_analysis?id=%s",
+    "subVipSetPage": "/front/vipsubscribe/toSubVipSetPage?vSwitch=v"
   },
   "jy_activeset": {
     "activitystartcode": "3201000000",

+ 1 - 0
src/config.yaml

@@ -15,3 +15,4 @@ database:
   default:
     link: "clickhouse:jytop:pwdTopJy123@tcp(192.168.3.207:19000)/jyseo_test?dial_timeout=2000ms&max_execution_time=60"
     debug: true
+GuideRegistedate: 1735034400  #该时间之前注册的付费用户不用进订阅向导

+ 3 - 0
src/jfw/config/config.go

@@ -34,6 +34,8 @@ var (
 	JyAnonymousLimit     *anonymousLimit
 	AreaCity             areaInfo
 	SampleReport         SampleReportConfig
+	GuideRegistedate     int64 //该时间之前注册的付费用户不用进订阅向导
+
 )
 
 // 样例报告
@@ -119,6 +121,7 @@ func init() {
 		RegEntManageApplication(g.Cfg().MustGet(ctx, "entManageApplication").String()).
 		RegPublicservice(g.Cfg().MustGet(ctx, "publicserviceKey").String())
 	//SubjectMatter = GetLetterMap(util.InterfaceToStr(Sysconfig["hotSubjectMatter"]))
+	GuideRegistedate = g.Cfg().MustGet(ctx, "GuideRegistedate").Int64()
 }
 
 func IpInit() {

+ 15 - 15
src/jfw/front/front.go

@@ -1098,7 +1098,7 @@ func (m *Front) Isrecord(name string) {
 	}
 }
 
-// 招标订阅向导
+// 招标订阅向导  p618已弃用
 func (f *Front) TSGuide() error {
 	defer util.Catch()
 	sessVal := f.Session().GetMultiple()
@@ -1107,7 +1107,7 @@ func (f *Front) TSGuide() error {
 		return f.Redirect("/swordfish/share/-1")
 	}
 	if f.Method() == "GET" {
-		if !isInTSguide(userid) {
+		if !isInTSguide(userid, f.Session()) {
 			return f.Redirect("/wxkeyset/keyset/index")
 		}
 		f.T["signature"] = wx.SignJSSDK(f.Site() + f.Url())
@@ -1192,23 +1192,23 @@ func (f *Front) TSGuide() error {
 	return nil
 }
 
-func isInTSguide(userid string) bool {
+const tsGuideFinished = 1 // 完成订阅向导设置
+
+func isInTSguide(userid string, session *httpsession.Session) bool {
 	if userid == "" {
 		return false
 	}
-	data := jyutil.Compatible.Select(userid, `{"o_jy":1,"i_ts_guide":1,"":1,"i_member_status":1,"i_vip_status":1}`)
-	if data != nil {
-		//付费用户无免费订阅,不进入订阅向导页面
-		if util.IntAll((*data)["i_member_status"]) > 0 || util.IntAll((*data)["i_vip_status"]) > 0 {
-			return false
-		}
-		o_jy, _ := (*data)["o_jy"].(map[string]interface{})
-		i_ts_guide := util.IntAll((*data)["i_ts_guide"])
-		if i_ts_guide == 2 || (i_ts_guide == 0 && len(o_jy) == 0) {
-			return true
-		}
+	data := jy.GetBigVipUserBaseMsg(session, *config.Middleground)
+	//p618发版之前注册的付费用户不进入订阅向导页面
+	userdata := jyutil.Compatible.Select(userid, `{"i_ts_guide":1,"l_registedate":1}`)
+	if userdata == nil || len(*userdata) == 0 {
+		return false
 	}
-	return false
+	registedate := util.Int64All((*userdata)["l_registedate"])
+	if (!data.Data.Free.IsFree && registedate < config.GuideRegistedate) || util.Int64All((*userdata)["i_ts_guide"]) == tsGuideFinished {
+		return false
+	}
+	return true
 }
 
 // 查看原文中转

+ 1 - 1
src/jfw/front/login.go

@@ -214,7 +214,7 @@ func (l *Login) Login() error {
 					if _id != "" {
 						redis.Del("limitation", fmt.Sprintf("firstVisitTagByWX_%s", l.Session().Id()))
 						//用户日志保存
-						jy.SaveUserLog(public.Mgo_Log, _id, phone, "phone", "pc", source, "", gconv.String(l.GetSession("RSource")), gconv.String(sessVal["RSource"]), qutil.GetIp(l.Request), l.UserAgent(), "jybx", "")
+						go jy.SaveUserLog(public.Mgo_Log, _id, phone, "phone", "pc", source, "", gconv.String(l.GetSession("RSource")), gconv.String(sessVal["RSource"]), qutil.GetIp(l.Request), l.UserAgent(), "jybx", "")
 						jy.ClearPhoneIdentSession(l.Session())
 						ok, _, userInfo := afterLogin(l.Request, phone, l.Session(), false)
 						userInfo["isNewUser"] = true

+ 1 - 1
src/jfw/front/org_structure.go

@@ -197,7 +197,7 @@ func (this *OrgStructure) AutoLogon() error {
 			}); resp != nil && resp.Data.Id > 0 {
 				data["base_user_id"] = resp.Data.Id
 				if id := mongodb.Save("user", data); id != "" {
-					jy.SaveUserLog(public.Mgo_Log, id, openId, "wx", "pc", source, openId, gconv.String(this.GetSession("RSource")), gconv.String(this.GetSession("RSource")), util.GetIp(this.Request), this.UserAgent(), "jybx", "")
+					go jy.SaveUserLog(public.Mgo_Log, id, openId, "wx", "pc", source, openId, gconv.String(this.GetSession("RSource")), gconv.String(this.GetSession("RSource")), util.GetIp(this.Request), this.UserAgent(), "jybx", "")
 					nsqPath, _ := config.Sysconfig["nsq"].(string)
 					nsq_topic, _ := config.Sysconfig["nsq_topic"].(string)
 					jy.Publish(public.Mgo_Log, nsqPath, nsq_topic, "task", id, jy.Jyweb_node2, map[string]interface{}{

+ 1 - 1
src/jfw/front/otherAct.go

@@ -151,7 +151,7 @@ func (f *Front) Lpsubmit() error {
 			_id := mongodb.Save("user", data)
 			if _id != "" {
 				//用户日志保存
-				jy.SaveUserLog(public.Mgo_Log, _id, phone, "phone", "pc", "landPage", "", gconv.String(f.GetSession("RSource")), util.ObjToString(f.GetSession("RSource")), util.GetIp(f.Request), f.UserAgent(), "jybx", "")
+				go jy.SaveUserLog(public.Mgo_Log, _id, phone, "phone", "pc", "landPage", "", gconv.String(f.GetSession("RSource")), util.ObjToString(f.GetSession("RSource")), util.GetIp(f.Request), f.UserAgent(), "jybx", "")
 				deleteIdentSession(f.Session())
 				return "y"
 			}

+ 1 - 1
src/jfw/front/pchelper.go

@@ -154,7 +154,7 @@ func (l *PcHelper) Login() error {
 						}
 						_id := mongodb.Save("user", data)
 						if _id != "" {
-							jy.SaveUserLog(public.Mgo_Log, _id, phone, "phone", "pc", "pc", "", gconv.String(l.GetSession("RSource")), gconv.String(l.GetSession("RSource")), util.GetIp(l.Request), l.UserAgent(), "jybx", "")
+							go jy.SaveUserLog(public.Mgo_Log, _id, phone, "phone", "pc", "pc", "", gconv.String(l.GetSession("RSource")), gconv.String(l.GetSession("RSource")), util.GetIp(l.Request), l.UserAgent(), "jybx", "")
 							jy.ClearPhoneIdentSession(l.Session())
 							reToken = getUToken(mac, phone)
 							reOpenId = phone

+ 208 - 0
src/jfw/front/returnMoneyPage.go

@@ -0,0 +1,208 @@
+package front
+
+import (
+	"app.yhyue.com/moapp/jybase/go-xweb/xweb"
+	"app.yhyue.com/moapp/jybase/redis"
+	"app.yhyue.com/moapp/jypkg/public"
+	"errors"
+	"fmt"
+	"github.com/gogf/gf/v2/util/gconv"
+	"jy/src/jfw/config"
+	"jy/src/jfw/jyutil"
+	"jy/src/jfw/wx"
+	"net/url"
+	"regexp"
+	"strings"
+	"time"
+)
+
+type (
+	ReturnMoneyPage struct {
+		*xweb.Action
+		toRedirect     xweb.Mapper `xweb:"/returnMoney/toRedirect"` //跳转重定向(弃用,扫码并没有refer)
+		wxReturnMoney  xweb.Mapper `xweb:"/weixin/pay/returnMoney"` //微信数据导出-支付页面
+		aliReturnMoney xweb.Mapper `xweb:"/returnMoney/aliPage"`    //剑鱼管理后台微信支付回款
+	}
+
+	returnMoney struct {
+		PayWay string
+		Price  string
+	}
+)
+
+func init() {
+	xweb.AddAction(&ReturnMoneyPage{})
+}
+
+func (this *ReturnMoneyPage) ToRedirect() error {
+	var (
+		token = this.GetString("token")
+		refer = strings.ToLower(this.Refer())
+	)
+	if token == "" {
+		return fmt.Errorf("未知回款订单,token异常")
+	}
+	if refer != "" {
+		if strings.Contains(refer, "alipay") {
+			return this.Redirect(fmt.Sprintf("/returnMoney/aliPage?token=%s", token))
+		} else if strings.Contains(refer, "micromessenger") || strings.Contains(refer, "weixin") {
+			return this.Redirect(fmt.Sprintf("/weixin/pay/returnMoney?token=%s", token))
+		}
+	}
+	rMap := public.Mysql.FindOne("return_money_online", map[string]interface{}{"token": token, "status": 0}, "pay_way", "")
+	if rMap == nil || len(*rMap) == 0 {
+		return fmt.Errorf("未知回款订单")
+	}
+	var payWay = gconv.String((*rMap)["pay_way"])
+	if strings.Contains(payWay, "wx") {
+		return this.Redirect(fmt.Sprintf("/weixin/pay/returnMoney?token=%s", token))
+	} else {
+		return this.Redirect(fmt.Sprintf("/returnMoney/aliPage?token=%s", token))
+	}
+}
+
+func (this *ReturnMoneyPage) WxReturnMoney() {
+	err := func() error {
+		var (
+			getSession = this.Session().GetMultiple()
+			openid     = gconv.String(getSession["s_m_openid"])
+			data       = map[string]interface{}{
+				"token": this.GetString("token"),
+			}
+		)
+		//没有用户session 或  有session但是没有关注(刚刚取关 session信息存留)
+		if openid == "" || (openid != "" && !CheckUserIsSubscribe(openid)) {
+			stateKey := this.GetString("state")
+			if stateKey == "" { //公众号回调
+				stateKey = getTmpKey()
+				//暂存参数
+				for k, v := range this.Request.Form {
+					if len(v) > 0 {
+						data[k] = v[0]
+					}
+				}
+				redis.Put("other", stateKey, data, 60*5) //存储信息
+				return this.Redirect(fmt.Sprintf(config.Wxoauth, url.QueryEscape(this.Site()+this.Url()), stateKey), 302)
+			}
+			//获取wx跳转前参数
+			if redisValue := redis.Get("other", stateKey); redisValue != nil {
+				if param, ok := redisValue.(map[string]interface{}); ok {
+					data = param
+				}
+			}
+			//获取用户openid
+			openid = jyutil.Getopenid(this.GetString("code"))
+		}
+
+		if openid == "" {
+			return fmt.Errorf("<p>请在微信端打开</p>")
+		}
+		this.Session().Set("openid_returnMoney", openid)
+
+		token := gconv.String(data["token"])
+		rData, err := getReturnPayDetail(token)
+		if err != nil {
+			return err
+		}
+
+		var pay_param map[string]interface{}
+		if payWay, payParam := gconv.String(rData["pay_way"]), gconv.String(rData["pay_param"]); payWay == "wx_js" && payParam != "" {
+			pay_param = gconv.Map(payParam)
+		}
+		this.T["pay_param"] = pay_param
+		this.T["token"] = token
+		this.T["data"] = rData
+		this.T["signature"] = wx.SignJSSDK(this.Site() + this.Url())
+		return this.Render("/common/returnMoney/wxReturnMoney.html", &this.T)
+	}()
+	if err != nil {
+		this.T["note"] = err.Error()
+		this.Render("/weixin/commonPay/orderStatus.html", &this.T)
+	}
+}
+
+func (this *ReturnMoneyPage) AliReturnMoney() {
+	err := func() error {
+		token := this.GetString("token")
+		rData, err := getReturnPayDetail(token)
+		if err != nil {
+			return err
+		}
+		var pay_param string
+		if gconv.String(rData["pay_way"]) == "ali_pc" {
+			pay_param = gconv.String(rData["pay_param"])
+		}
+		this.T["pay_param"] = pay_param
+		this.T["token"] = token
+		this.T["data"] = formatShow(rData)
+		return this.Render("/common/returnMoney/aliReturnMoney.html", &this.T)
+	}()
+	if err != nil {
+		this.T["note"] = err.Error()
+		this.Render("/weixin/commonPay/orderStatus.html", &this.T)
+	}
+}
+
+func getReturnPayDetail(token string) (map[string]interface{}, error) {
+	if token == "" {
+		return nil, errors.New("<p>参数异常</p>")
+	}
+	rList := public.Mysql.SelectBySql("SELECT d.order_status,d.product_type,d.user_phone,d.company_name,r.return_money,r.pay_param,r.pay_way,r.expire_time,r.status FROM dataexport_order d inner join return_money_online r on (d.order_code=r.order_code) WHERE r.token=? ", token)
+	if rList == nil || len(*rList) == 0 {
+		return nil, fmt.Errorf("<p>未知回款单</p>")
+	}
+
+	var (
+		rMap        = (*rList)[0]
+		expire_time = gconv.String(rMap["expire_time"])
+		status      = gconv.Int64(rMap["status"])
+		orderStatus = gconv.Int64(rMap["order_status"])
+	)
+	if orderStatus == -2 {
+		return nil, fmt.Errorf("<p>该订单已取消,如有问题<br>请联系您的客户经理</p>")
+	}
+	if status > 0 {
+		return nil, fmt.Errorf("<p>您已完成支付!</p>")
+	} else if status == -1 {
+		return nil, fmt.Errorf("<p>支付二维码已过期,请联<br>系您的客户经理重新提供</p>")
+	}
+
+	if expire, err := time.ParseInLocation(time.DateTime, expire_time, time.Local); err == nil {
+		if time.Now().After(expire) {
+			go public.Mysql.Update("return_money_online", map[string]interface{}{"token": token, "status": 0}, map[string]interface{}{"status": -1})
+			return nil, fmt.Errorf("<p>支付二维码已过期,请联<br>系您的客户经理重新提供</p>")
+		}
+	}
+	return rMap, nil
+}
+
+func formatShow(orderMap map[string]interface{}) map[string]interface{} {
+	var (
+		account string
+		rMap    = map[string]interface{}{}
+	)
+	if company_name := gconv.String(orderMap["company_name"]); company_name != "" {
+		account = company_name
+	} else if phone := gconv.String(orderMap["user_phone"]); len(phone) == 11 && !strings.HasPrefix(phone, "9") {
+		account = maskPhoneNumber(phone)
+	}
+	rMap["account"] = account
+
+	product := gconv.String(orderMap["product_type"])
+	if product == "VIP订阅" {
+		product = "超级订阅"
+	}
+	rMap["product"] = product
+
+	t, _ := time.Parse(time.DateTime, gconv.String(orderMap["expire_time"]))
+	rMap["expire_time"] = t.Format("2006年01月02日")
+
+	rMap["price"] = gconv.Float64(orderMap["return_money"]) / 100.0
+	return rMap
+}
+
+func maskPhoneNumber(phoneNumber string) string {
+	re := regexp.MustCompile(`(\d{3})\d{4}(\d{4})`)
+	maskedNumber := re.ReplaceAllString(phoneNumber, "$1****$2")
+	return maskedNumber
+}

+ 1 - 4
src/jfw/front/swordfish.go

@@ -1236,9 +1236,7 @@ func (m *Front) AjaxReq() error {
 					break
 				}
 				if _, ok := existKeyMap[keysArray[i]]; !ok {
-
 					saveKey = append(saveKey, bson.M{"key": []string{keysArray[i]}, "notkey": []string{}, "from": 1})
-
 				}
 			}
 			//如果不存在
@@ -1254,7 +1252,6 @@ func (m *Front) AjaxReq() error {
 						flag = "y"
 					}
 				}
-
 			}
 		}
 		break
@@ -1955,7 +1952,7 @@ func (f *Front) HasPushHistory() {
 		"haskey":      hasKeyFlag,
 		"data":        list,
 		"hasNextPage": hasNextPage,
-		"isInTSguide": isInTSguide(userId),
+		"isInTSguide": isInTSguide(userId, f.Session()),
 		"isVipSub":    isVipFlag,
 		"isPassCount": isPassCount,
 		"isExpire":    isExpire,

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

@@ -63,12 +63,44 @@ type Subscribepay struct {
 	wxViewPage xweb.Mapper `xweb:"/vipsubscribe/wx/page/(.*)"` //超级订阅wx
 	//订阅付费消息提醒中转
 	msgremind xweb.Mapper `xweb:"/front/vipsubscribe/msgremind"`
+	//邮件推送-登录剑鱼标讯,查看更多招标信息 访问路由
+	mailToPage xweb.Mapper `xweb:"/front/subscribe/mailToPage"`
 }
 
 func init() {
 	xweb.AddAction(&Subscribepay{})
 }
 
+// (1)PC:未登录跳转至官网首页并弹窗提示登录,登录成功后进入【我的订阅】列表页;已登录直接进入【我的订阅】列表页(如有多套订阅,依据推送邮件是哪套订阅进行页面跳转);
+// (2)移动端:未登录跳转至登录页,登录成功后进入【我的订阅】列表页;已登录直接进入【我的订阅】列表页(如有多套订阅,依据推送邮件是哪套订阅进行页面跳转)。
+func (s *Subscribepay) MailToPage() error {
+	sess := s.Session().GetMultiple()
+	userid := util.ObjToString(sess["userId"])
+	//是否是移动端
+	bm := mobileReg.MatchString(s.Header("User-Agent"))
+	vSwitch := s.GetString("vSwitch")
+	if vSwitch == jy.SwitchService.Member || vSwitch == jy.SwitchService.Vip || vSwitch == jy.SwitchService.Entniche {
+		s.SetSession(jy.SwitchService.SessionKey, vSwitch)
+	}
+	page := "/"
+	if bm {
+		if userid == "" {
+			page = fmt.Sprintf("%s%s", config.Sysconfig["h5"].(string), "/jyapp/free/login?url=%2Fjy_mobile%2Ftabbar%2Fsubscribe")
+		} else {
+			page = fmt.Sprintf("%s%s", config.Sysconfig["h5"].(string), "/jy_mobile/tabbar/subscribe")
+		}
+	} else {
+		if userid == "" {
+			page = "/?nol=1"
+		} else {
+			if vSwitch == "" {
+				vSwitch = "f"
+			}
+			page = fmt.Sprintf("/page_workDesktop/work-bench/app/big/big_subscribe?vt=%s", vSwitch)
+		}
+	}
+	return s.Redirect(page, 302)
+}
 func (s *Subscribepay) EntSearch() {
 	s.Render("/weixin/vipsubscribe/vip_entSearch.html")
 }
@@ -154,8 +186,8 @@ func (s *Subscribepay) ToSetPage() error {
 	}
 
 	vipMsg := jy.GetBigVipUserBaseMsg(s.Session(), *config.Middleground)
-	if vipMsg.VipStatus <= 0 && vipMsg.Status <= 0 && isInTSguide(userid) { //仅免费用户跳转向导页面
-		return s.Redirect("/front/tenderSubscribe/guide?url=" + url.QueryEscape(s.Request.RequestURI))
+	if isInTSguide(userid, s.Session()) {
+		return s.Redirect("/jy_mobile/subscribe/guide?url=" + url.QueryEscape(s.Request.RequestURI))
 	} else if (vSwitch == "" || vSwitch == "v") && vipMsg.VipStatus <= 0 && !vipMsg.IsUpgrade {
 		if s.GetString("advertcode") != "" {
 			return s.Redirect("/wxkeyset/keyset/index?advertcode=" + s.GetString("advertcode"))

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

@@ -35,8 +35,8 @@ func (m *Front) WxKeyset(tpl string) error {
 		})
 	}
 	vipMsg := jy.GetBigVipUserBaseMsg(m.Session(), *config.Middleground)
-	if (tpl == "index" || tpl == "filterset") && vipMsg.VipStatus <= 0 && vipMsg.Status <= 0 && isInTSguide(userid) { //仅免费用户跳转向导页面
-		return m.Redirect("/front/tenderSubscribe/guide?url=" + url.QueryEscape(m.Request.RequestURI))
+	if (tpl == "index" || tpl == "filterset") && isInTSguide(userid, m.Session()) {
+		return m.Redirect("/jy_mobile/subscribe/guide?url=" + url.QueryEscape(m.Request.RequestURI))
 	}
 	//到新订阅设置
 	if vipMsg.VipStatus > 0 || vipMsg.IsUpgrade {

+ 4 - 3
src/jfw/modules/app/src/app/front/errLogsReceive.go

@@ -52,9 +52,10 @@ func (this *ErrLogServer) Receive() {
 				"i_reqTime":    data.ReqTime,
 			})
 		}
-		if !public.Mgo_Log.SaveBulk("jyapp_errlogs", saveArr...) {
-			return false, "数据保存异常"
-		}
+		go public.Mgo_Log.SaveBulk("jyapp_errlogs", saveArr...)
+		//if !public.Mgo_Log.SaveBulk("jyapp_errlogs", saveArr...) {
+		//	return false, "数据保存异常"
+		//}
 		return true, ""
 	}()
 	this.ServeJson(map[string]interface{}{

+ 11 - 7
src/jfw/modules/app/src/app/front/front.go

@@ -243,20 +243,24 @@ func mesCaLog(mid, url, userId, recType string) {
 func (m *Front) Wxerr() error {
 	return m.Render("/_err.html")
 }
+
+const tsGuideFinished = 1 // 完成订阅向导设置
+
 func isInTSguide(userid string, session *httpsession.Session) bool {
 	if userid == "" {
 		return false
 	}
 	data := jy.GetBigVipUserBaseMsg(session, *config.Middleground)
-	//付费用户无免费订阅,不进入订阅向导页面
-	if data.Data.Vip.Status > 0 {
+	//p618发版之前注册的付费用户不进入订阅向导页面
+	userdata := Compatible.Select(userid, `{"i_ts_guide":1,"l_registedate":1}`)
+	if userdata == nil || len(*userdata) == 0 {
 		return false
 	}
-	i_ts_guide := data.Data.Free.TsGuide
-	if i_ts_guide == 2 || (i_ts_guide == 0 && !data.Data.Free.FreeHasKey) {
-		return true
+	registedate := util.Int64All((*userdata)["l_registedate"])
+	if (!data.Data.Free.IsFree && registedate < config.GuideRegistedate) || util.Int64All((*userdata)["i_ts_guide"]) == tsGuideFinished {
+		return false
 	}
-	return false
+	return true
 }
 func (m *Front) Feedback() error {
 	defer util.Catch()
@@ -290,7 +294,7 @@ func (m *Front) Feedback() error {
 	return m.Render("/weixin/feedback.html", &m.T)
 }
 
-// 招标订阅向导
+// 招标订阅向导   p618走新的订阅向导 该路由已弃用
 func (f *Front) TSGuide() error {
 	defer util.Catch()
 	sessVal := f.Session().GetMultiple()

+ 2 - 2
src/jfw/modules/app/src/app/front/login.go

@@ -334,7 +334,7 @@ func (l *Login) Login() error {
 					_id := mongodb.Save("user", data)
 					if _id != "" {
 						log.Println(111, _id, phone, "phone", "app", isAndroidOrIOS(l.Header("User-Agent")), "", gconv.String(l.GetSession("RSource")), gconv.String(data["s_rsource"]), "", l.Header("User-Agent"), gconv.String(qutil.If(gconv.String(data["s_regsource"]) == "jyzbw", "jyzbw", "jybx")), "")
-						jy.SaveUserLog(public.Mgo_Log, _id, phone, "phone", "app", isAndroidOrIOS(l.Header("User-Agent")), "", gconv.String(l.GetSession("RSource")), gconv.String(data["s_rsource"]), "", l.Header("User-Agent"), gconv.String(qutil.If(gconv.String(data["s_regsource"]) == "jyzbw", "jyzbw", "jybx")), "")
+						go jy.SaveUserLog(public.Mgo_Log, _id, phone, "phone", "app", isAndroidOrIOS(l.Header("User-Agent")), "", gconv.String(l.GetSession("RSource")), gconv.String(data["s_rsource"]), "", l.Header("User-Agent"), gconv.String(qutil.If(gconv.String(data["s_regsource"]) == "jyzbw", "jyzbw", "jybx")), "")
 						if sourceLabel != "" {
 							go func() {
 								redis.Del("limitation", fmt.Sprintf("firstVisitTagByWX_%s", l.Session().Id()))
@@ -904,7 +904,7 @@ func (l *Login) WxLogin() {
 
 			if _id := mongodb.Save("user", newUser); _id != "" {
 				log.Println(222, _id, "", "wx", "app", isAndroidOrIOS(l.Header("User-Agent")), "", isAndroidOrIOS(l.Header("User-Agent")), sourceLabel, "", l.Header("User-Agent"), gconv.String(qutil.If(isAndroidOrIOS(l.Header("User-Agent")) == "jyzbw", "jyzbw", "jybx")), "")
-				jy.SaveUserLog(public.Mgo_Log, _id, "", "wx", "app", isAndroidOrIOS(l.Header("User-Agent")), "", isAndroidOrIOS(l.Header("User-Agent")), sourceLabel, "", l.Header("User-Agent"), gconv.String(qutil.If(isAndroidOrIOS(l.Header("User-Agent")) == "jyzbw", "jyzbw", "jybx")), "")
+				go jy.SaveUserLog(public.Mgo_Log, _id, "", "wx", "app", isAndroidOrIOS(l.Header("User-Agent")), "", isAndroidOrIOS(l.Header("User-Agent")), sourceLabel, "", l.Header("User-Agent"), gconv.String(qutil.If(isAndroidOrIOS(l.Header("User-Agent")) == "jyzbw", "jyzbw", "jybx")), "")
 				if sourceLabel != "" {
 					go func() {
 						redis.Del("limitation", fmt.Sprintf("firstVisitTagByWX_%s", l.Session().Id()))

+ 18 - 19
src/jfw/modules/app/src/app/front/me.go

@@ -209,7 +209,6 @@ func (l *Me) Updatepwd() error {
 	return nil
 }
 
-//
 func (l *Me) CheckUpdate() error {
 	defer qutil.Catch()
 	channel := l.GetString("channel")
@@ -278,22 +277,25 @@ func (l *Me) CheckUpdate() error {
 
 /*
 触发下面这4种事件后,需要请求下服务端接口,保存日志:
-    1、弹出更新提示对话框(event:client_tip)
-    2、点击取消(event:client_cancel)
-    3、点击去更新(event:client_update)
-    4、内部更新失败后,浏览器更新(event:client_outside)
-    5、下载成功(event:client_download_success)
-    6、下载失败(event:client_download_fail)
+
+	1、弹出更新提示对话框(event:client_tip)
+	2、点击取消(event:client_cancel)
+	3、点击去更新(event:client_update)
+	4、内部更新失败后,浏览器更新(event:client_outside)
+	5、下载成功(event:client_download_success)
+	6、下载失败(event:client_download_fail)
+
 接口地址:/jyapp/free/newVersionUpdateLog
 参数:
-    token           //用户token
-    event            //事件类型
-    current_version //当前版本号
-    new_version     //新版本号
-    channel         //渠道
-    phonetype       //手机型号
-    system          //系统版本
-    error           //下载失败的异常信息
+
+	token           //用户token
+	event            //事件类型
+	current_version //当前版本号
+	new_version     //新版本号
+	channel         //渠道
+	phonetype       //手机型号
+	system          //系统版本
+	error           //下载失败的异常信息
 */
 func (l *Me) NewVersionUpdateLog() {
 	u, s := analySign("", l.GetString("token"))
@@ -304,7 +306,7 @@ func (l *Me) NewVersionUpdateLog() {
 	if l.GetString("event") == "server_tip" && userId != "" {
 		redis.Del(ClientUpdate.RedisCode, "app_clientupdate_"+userId)
 	}
-	public.Mgo_Log.Save("jyapp_newversion_updatelog", map[string]interface{}{
+	go public.Mgo_Log.Save("jyapp_newversion_updatelog", map[string]interface{}{
 		"createtime":      time.Now().Unix(),
 		"userid":          userId,
 		"event":           l.GetString("event"),
@@ -321,7 +323,6 @@ func (l *Me) NewVersionUpdateLog() {
 	l.ServeJson(map[string]interface{}{})
 }
 
-//
 func (l *Me) MyInfo() {
 	r := map[string]interface{}{
 		"userType": "free",
@@ -395,7 +396,6 @@ func (l *Me) MyInfo() {
 	l.ServeJson(r)
 }
 
-//
 func (l *Me) AccountSafe() error {
 	return l.Render("/me/account.html")
 }
@@ -422,7 +422,6 @@ func (l *Me) GetAccountInfo() {
 	return
 }
 
-//
 func (l *Me) ControlGrayUpdate(t string) {
 	if l.GetString("pwd") != "lHJ5agM3eiKczOPk3IVj" {
 		l.Write("密码错误!")

+ 0 - 2
src/jfw/modules/app/src/app/front/swordfish.go

@@ -159,7 +159,6 @@ func (m *Front) AjaxReq() error {
 				}
 				if _, ok := existKeyMap[keysArray[i]]; !ok {
 					saveKey = append(saveKey, bson.M{"key": []string{keysArray[i]}, "notkey": []string{}, "from": 1})
-
 				}
 			}
 			positionType := util.Int64All(m.GetSession("positionType"))
@@ -169,7 +168,6 @@ func (m *Front) AjaxReq() error {
 				if len(a_key) >= 10 {
 					flag = "o"
 				} else {
-
 					if positionType == 0 {
 						ok = mongodb.UpdateById("user", userid,
 							bson.M{

+ 2 - 3
src/jfw/modules/app/src/app/front/vipsubscribe.go

@@ -127,9 +127,8 @@ func (s *Subscribepay) ToSetPage() {
 	//	s.Redirect("/jyapp/big/page/init") //跳转至首次初始化页面
 	//	return
 	//}
-	//仅免费用户跳转向导页面
-	if bigBaseMsg.Status <= 0 && bigBaseMsg.VipStatus <= 0 && isInTSguide(userid, s.Session()) {
-		s.Redirect("/jyapp/tenderSubscribe/guide?url=" + url.QueryEscape(s.Request.RequestURI))
+	if isInTSguide(userid, s.Session()) {
+		s.Redirect("/jy_mobile/subscribe/guide?url=" + url.QueryEscape(s.Request.RequestURI))
 	}
 	s.Render("/vipsubscribe/vip_index_new.html")
 }

+ 305 - 305
src/jfw/modules/app/src/app/front/wxkeyset.go

@@ -2,333 +2,333 @@
 package front
 
 import (
-    "fmt"
-    . "jy/src/jfw/modules/app/src/app/jyutil"
-    utils "jy/src/jfw/modules/app/src/app/jyutil"
-    "jy/src/jfw/modules/app/src/jfw/config"
-    "net/url"
-    "regexp"
-    "strconv"
-    "strings"
+	"fmt"
+	. "jy/src/jfw/modules/app/src/app/jyutil"
+	utils "jy/src/jfw/modules/app/src/app/jyutil"
+	"jy/src/jfw/modules/app/src/jfw/config"
+	"net/url"
+	"regexp"
+	"strconv"
+	"strings"
 
-    util "app.yhyue.com/moapp/jybase/common"
-    . "app.yhyue.com/moapp/jybase/date"
-    "app.yhyue.com/moapp/jypkg/common/src/qfw/util/jy"
-    //	"sync"
-    "time"
+	util "app.yhyue.com/moapp/jybase/common"
+	. "app.yhyue.com/moapp/jybase/date"
+	"app.yhyue.com/moapp/jypkg/common/src/qfw/util/jy"
+	//	"sync"
+	"time"
 )
 
 // WxKeyset 进入订阅词设置
 func (m *Front) WxKeyset(tpl string) error {
-    defer util.Catch()
-    userid := util.ObjToString(m.GetSession("userId"))
-    surprise := m.GetSession("surprise")
-    if tpl == "index" && isInTSguide(userid, m.Session()) { //仅免费用户跳转向导页面
-        return m.Redirect("/jyapp/tenderSubscribe/guide?url=" + url.QueryEscape(m.Request.RequestURI))
-    }
-    //到新订阅设置
-    vipMsg := jy.GetBigVipUserBaseMsg(m.Session(), *config.Middleground)
-    if vipMsg.IsUpgrade {
-        return m.Redirect("/jyapp/vipsubscribe/toSubVipSetPage")
-    }
-    if tpl == "seniorset" {
-        data := utils.Compatible.Select(userid, `{"o_jy":1}`)
-        if data != nil && len(*data) > 0 {
-            o_jy, _ := (*data)["o_jy"].(map[string]interface{})
-            a_key, _ := o_jy["a_key"].([]interface{})
-            if len(a_key) > 0 {
-                m.T["haskeyword"] = true
-            }
-        }
+	defer util.Catch()
+	userid := util.ObjToString(m.GetSession("userId"))
+	surprise := m.GetSession("surprise")
+	if tpl == "index" && isInTSguide(userid, m.Session()) {
+		return m.Redirect("/jy_mobile/subscribe/guide?url=" + url.QueryEscape(m.Request.RequestURI))
+	}
+	//到新订阅设置
+	vipMsg := jy.GetBigVipUserBaseMsg(m.Session(), *config.Middleground)
+	if vipMsg.IsUpgrade {
+		return m.Redirect("/jyapp/vipsubscribe/toSubVipSetPage")
+	}
+	if tpl == "seniorset" {
+		data := utils.Compatible.Select(userid, `{"o_jy":1}`)
+		if data != nil && len(*data) > 0 {
+			o_jy, _ := (*data)["o_jy"].(map[string]interface{})
+			a_key, _ := o_jy["a_key"].([]interface{})
+			if len(a_key) > 0 {
+				m.T["haskeyword"] = true
+			}
+		}
 
-    }
-    userId, _ := m.GetSession("userId").(string)
-    s_surprise := ""
-    if tpl == "index" || tpl == "filterset" {
-        data := utils.Compatible.Select(userId, `{"o_jy":1}`)
-        var o_jy map[string]interface{}
-        if data != nil && len(*data) > 0 {
-            o_jy, _ = (*data)["o_jy"].(map[string]interface{})
-            s_surprise = util.ObjToString(o_jy["s_surprise"])
-        }
-    }
-    m.T["s_surprise"] = s_surprise
-    m.T["surprise"] = surprise
-    if tpl == "index" {
-        m.T["isIosExam"], m.T["isIosExamPhone"], _, _ = IosExamInfo(m.Action, false, false)
-    }
-    return m.Render("/weixin/wxkeyset/"+tpl+".html", &m.T)
+	}
+	userId, _ := m.GetSession("userId").(string)
+	s_surprise := ""
+	if tpl == "index" || tpl == "filterset" {
+		data := utils.Compatible.Select(userId, `{"o_jy":1}`)
+		var o_jy map[string]interface{}
+		if data != nil && len(*data) > 0 {
+			o_jy, _ = (*data)["o_jy"].(map[string]interface{})
+			s_surprise = util.ObjToString(o_jy["s_surprise"])
+		}
+	}
+	m.T["s_surprise"] = s_surprise
+	m.T["surprise"] = surprise
+	if tpl == "index" {
+		m.T["isIosExam"], m.T["isIosExamPhone"], _, _ = IosExamInfo(m.Action, false, false)
+	}
+	return m.Render("/weixin/wxkeyset/"+tpl+".html", &m.T)
 }
 
-//ajax各种请求
+// ajax各种请求
 func (m *Front) WxKeysetAjaxReq() {
-    defer util.Catch()
-    userId, _ := m.GetSession("userId").(string)
-    if userId == "" {
-        m.ServeJson(map[string]interface{}{
-            "flag": false,
-        })
-        return
-    }
-    //增加锁,防止map读写
-    //	lock, _ := m.Session().Get("Lock").(*sync.Mutex)
-    //	lock.Lock()
-    //	defer lock.Unlock()
-    reqType := m.GetString("reqType")
-    if reqType == "getKeyset" { //获取高级设置
-        data := utils.Compatible.Select(userId, `{"o_jy":1,"l_registedate":1}`)
-        var o_jy map[string]interface{}
-        if data != nil && len(*data) > 0 {
-            o_jy, _ = (*data)["o_jy"].(map[string]interface{})
-            o_jy["i_new"] = NewUserByVIP(data)
-            a_key, _ := o_jy["a_key"].([]interface{})
-            m.SetSession("o_jy_a_key", a_key)
-        }
-        m.ServeJson(o_jy)
-        return
-    }
-    /*******************以下是修改操作******************/
-    index := ""
-    saveData := make(map[string]interface{})
-    if reqType == "saveKeyWords" { //保存关键词
-        a_key, _ := m.GetSession("o_jy_a_key").([]interface{})
-        keyWords := m.GetSlice("keyWords")
-        indexs := m.GetSlice("indexs")
-        var keyMaps []map[string]interface{}
-        //给删除的关键词加上标识
-        a_keycopy := make([]map[string]interface{}, len(a_key))
-        //复制
-        for k, v := range a_key {
-            key := v.(map[string]interface{})
-            keycopy := map[string]interface{}{}
-            for k1, v1 := range key {
-                keycopy[k1] = v1
-            }
-            isExists := false
-            for _, i := range indexs {
-                if k == util.IntAll(i) {
-                    isExists = true
-                    break
-                }
-            }
-            //isExists =false已经被删除
-            keycopy["flag"] = !isExists
-            a_keycopy[k] = keycopy
-        }
-        for k, v := range keyWords {
-            if strings.Trim(v, " ") == "" {
-                continue
-            }
-            if k >= 10 {
-                break
-            }
-            index := util.IntAll(indexs[k])
-            key := map[string]interface{}{}
-            if index < len(a_keycopy) {
-                key = a_keycopy[index]
-                flag, _ := key["flag"].(bool)
-                if flag {
-                    key = map[string]interface{}{}
-                } else {
-                    delete(key, "flag")
-                }
-            }
-            keys := processKeyword(v)
-            if keys != nil {
-                key["key"] = keys
-                if len(key) > 0 {
-                    keyMaps = append(keyMaps, key)
-                }
-            }
-        }
-        saveData["o_jy.a_key"] = keyMaps
-    } else if reqType == "saveArea" { //保存信息范围
-        index = m.GetString("index")
-        saveData["o_jy.a_key."+index+".area"] = m.GetSlice("area")
-    } else if reqType == "saveInfotype" { //保存信息类型
-        index = m.GetString("index")
-        saveData["o_jy.a_key."+index+".infotype"] = m.GetSlice("infotype")
-    } else if reqType == "saveNotkey" { //保存排除关键词
-        index = m.GetString("index")
-        notkey := m.GetSlice("notkey")
-        if len(notkey) > 10 {
-            notkey = notkey[0:10]
-        }
-        for k, v := range notkey {
-            notkey[k] = strings.Replace(v, " ", "", -1)
-        }
-        saveData["o_jy.a_key."+index+".notkey"] = notkey
-    } else if reqType == "saveSeniorset" { //保存高级设置
-        //推送频率:1实时 2每日一推 3自定义时间
-        ratemode, _ := m.GetInteger("ratemode")
-        if ratemode != 2 && ratemode != 3 {
-            ratemode = 1
-        }
-        saveData["o_jy.i_ratemode"] = ratemode
-        apppush, _ := m.GetInteger("apppush")
-        mailpush, _ := m.GetInteger("mailpush")
-        if apppush == 0 && mailpush == 0 {
-            apppush = 1
-        }
-        if ratemode == 3 {
-            saveData["o_jy.i_rmstart"], _ = m.GetInteger("rmstart")
-            saveData["o_jy.i_rmend"], _ = m.GetInteger("rmend")
-        }
-        saveData["o_jy.s_email"] = strings.Trim(m.GetString("email"), " ")
-        saveData["o_jy.i_apppush"] = apppush
-        saveData["o_jy.i_mailpush"] = mailpush
-    } else if reqType == "delKeysWord" { //
-        index = m.GetString("index")
-        var keyMaps = []map[string]interface{}{}
-        a_key, _ := m.GetSession("o_jy_a_key").([]interface{})
-        for k, v := range a_key {
-            if k != util.IntAll(index) {
-                keyMaps = append(keyMaps, v.(map[string]interface{}))
-            }
-        }
-        saveData["o_jy.a_key"] = keyMaps
-    } else if reqType == "setSurp" {
-        saveData["o_jy.s_surprise"] = "A"
-        m.SetSession("surprise", "A")
-    } else if reqType == "saveKeyWordsNew" { //保存 or 修改 整个订阅词接口
-        index = m.GetString("index")
-        indexInt := util.IntAll(index)
-        area := m.GetSlice("area")
-        infotype := m.GetSlice("infotype")
-        notkey := m.GetSlice("notkey")
-        keyWords := m.GetString("keyWords")
-        a_key, a_key_ok := m.GetSession("o_jy_a_key").([]interface{})
-        if len(notkey) > 10 {
-            notkey = notkey[0:10]
-        }
-        for k, v := range notkey {
-            notkey[k] = strings.Replace(v, " ", "", -1)
-        }
-        keys := processKeyword(keyWords)
-        if keys == nil || indexInt >= 10 {
-            m.ServeJson(map[string]interface{}{
-                "flag": false,
-            })
-            return
-        }
-        saveKey := map[string]interface{}{
-            "key":      []string{keys[0]},
-            "area":     fliterEmptyArr(area),
-            "notkey":   fliterEmptyArr(notkey),
-            "infotype": fliterEmptyArr(infotype),
-        }
-        var optime time.Time
-        var regtime int64
-        if rd := utils.Compatible.Select(userId, `{"o_jy":1,"l_registedate":1}`); rd != nil && len(*rd) > 0 {
-            //获取活动上线时间
-            optimalTime, _ := config.Sysconfig["optimalTime"].(string)
-            optime, _ = time.ParseInLocation(Date_Full_Layout, optimalTime, time.Local)
-            regtime, _ = (*rd)["l_registedate"].(int64)
-            if ojy, _ := (*rd)["o_jy"].(map[string]interface{}); len(ojy) > 0 {
-                if ojy["i_new"] == nil {
-                    if time.Unix(regtime, 0).After(optime) {
-                        saveData["o_jy.i_new"] = 1
-                    } else {
-                        saveData["o_jy.i_new"] = 0
-                    }
-                }
-                if ojy["a_key"] != nil {
-                    ak, _ := ojy["a_key"].([]interface{})
-                    if len(ak) > indexInt {
-                        if akmap, _ := ak[indexInt].(map[string]interface{}); akmap["from"] != nil {
-                            saveKey["from"] = akmap["from"]
-                        }
-                    }
-                }
-            }
-        }
-        if !a_key_ok && indexInt == 0 { //第一次新增
-            index = ""
-            saveData["o_jy.a_key"] = []map[string]interface{}{saveKey}
-            if time.Unix(regtime, 0).Before(optime) {
-                saveData["o_jy.i_new"] = 1
-            }
-        } else { //修改新增
-            if indexInt > len(a_key) {
-                indexInt = len(a_key)
-            }
-            saveData[fmt.Sprintf("o_jy.a_key.%d", indexInt)] = saveKey
-        }
-    }
-    //修改操作
-    var flag bool
-    if len(saveData) > 0 {
-        saveData["o_jy.l_modifydate"] = time.Now().Unix()
-        if index == "" {
-            flag = utils.Compatible.Update(userId, map[string]interface{}{
-                "$set": saveData,
-            })
-        } else {
-            if intIndex, e := strconv.Atoi(index); e == nil && intIndex >= 0 && intIndex < 10 {
-                flag = utils.Compatible.Update(userId, map[string]interface{}{
-                    "$set": saveData,
-                })
-            }
-        }
-    }
-    m.ServeJson(map[string]interface{}{
-        "flag": flag,
-    })
-    return
+	defer util.Catch()
+	userId, _ := m.GetSession("userId").(string)
+	if userId == "" {
+		m.ServeJson(map[string]interface{}{
+			"flag": false,
+		})
+		return
+	}
+	//增加锁,防止map读写
+	//	lock, _ := m.Session().Get("Lock").(*sync.Mutex)
+	//	lock.Lock()
+	//	defer lock.Unlock()
+	reqType := m.GetString("reqType")
+	if reqType == "getKeyset" { //获取高级设置
+		data := utils.Compatible.Select(userId, `{"o_jy":1,"l_registedate":1}`)
+		var o_jy map[string]interface{}
+		if data != nil && len(*data) > 0 {
+			o_jy, _ = (*data)["o_jy"].(map[string]interface{})
+			o_jy["i_new"] = NewUserByVIP(data)
+			a_key, _ := o_jy["a_key"].([]interface{})
+			m.SetSession("o_jy_a_key", a_key)
+		}
+		m.ServeJson(o_jy)
+		return
+	}
+	/*******************以下是修改操作******************/
+	index := ""
+	saveData := make(map[string]interface{})
+	if reqType == "saveKeyWords" { //保存关键词
+		a_key, _ := m.GetSession("o_jy_a_key").([]interface{})
+		keyWords := m.GetSlice("keyWords")
+		indexs := m.GetSlice("indexs")
+		var keyMaps []map[string]interface{}
+		//给删除的关键词加上标识
+		a_keycopy := make([]map[string]interface{}, len(a_key))
+		//复制
+		for k, v := range a_key {
+			key := v.(map[string]interface{})
+			keycopy := map[string]interface{}{}
+			for k1, v1 := range key {
+				keycopy[k1] = v1
+			}
+			isExists := false
+			for _, i := range indexs {
+				if k == util.IntAll(i) {
+					isExists = true
+					break
+				}
+			}
+			//isExists =false已经被删除
+			keycopy["flag"] = !isExists
+			a_keycopy[k] = keycopy
+		}
+		for k, v := range keyWords {
+			if strings.Trim(v, " ") == "" {
+				continue
+			}
+			if k >= 10 {
+				break
+			}
+			index := util.IntAll(indexs[k])
+			key := map[string]interface{}{}
+			if index < len(a_keycopy) {
+				key = a_keycopy[index]
+				flag, _ := key["flag"].(bool)
+				if flag {
+					key = map[string]interface{}{}
+				} else {
+					delete(key, "flag")
+				}
+			}
+			keys := processKeyword(v)
+			if keys != nil {
+				key["key"] = keys
+				if len(key) > 0 {
+					keyMaps = append(keyMaps, key)
+				}
+			}
+		}
+		saveData["o_jy.a_key"] = keyMaps
+	} else if reqType == "saveArea" { //保存信息范围
+		index = m.GetString("index")
+		saveData["o_jy.a_key."+index+".area"] = m.GetSlice("area")
+	} else if reqType == "saveInfotype" { //保存信息类型
+		index = m.GetString("index")
+		saveData["o_jy.a_key."+index+".infotype"] = m.GetSlice("infotype")
+	} else if reqType == "saveNotkey" { //保存排除关键词
+		index = m.GetString("index")
+		notkey := m.GetSlice("notkey")
+		if len(notkey) > 10 {
+			notkey = notkey[0:10]
+		}
+		for k, v := range notkey {
+			notkey[k] = strings.Replace(v, " ", "", -1)
+		}
+		saveData["o_jy.a_key."+index+".notkey"] = notkey
+	} else if reqType == "saveSeniorset" { //保存高级设置
+		//推送频率:1实时 2每日一推 3自定义时间
+		ratemode, _ := m.GetInteger("ratemode")
+		if ratemode != 2 && ratemode != 3 {
+			ratemode = 1
+		}
+		saveData["o_jy.i_ratemode"] = ratemode
+		apppush, _ := m.GetInteger("apppush")
+		mailpush, _ := m.GetInteger("mailpush")
+		if apppush == 0 && mailpush == 0 {
+			apppush = 1
+		}
+		if ratemode == 3 {
+			saveData["o_jy.i_rmstart"], _ = m.GetInteger("rmstart")
+			saveData["o_jy.i_rmend"], _ = m.GetInteger("rmend")
+		}
+		saveData["o_jy.s_email"] = strings.Trim(m.GetString("email"), " ")
+		saveData["o_jy.i_apppush"] = apppush
+		saveData["o_jy.i_mailpush"] = mailpush
+	} else if reqType == "delKeysWord" { //
+		index = m.GetString("index")
+		var keyMaps = []map[string]interface{}{}
+		a_key, _ := m.GetSession("o_jy_a_key").([]interface{})
+		for k, v := range a_key {
+			if k != util.IntAll(index) {
+				keyMaps = append(keyMaps, v.(map[string]interface{}))
+			}
+		}
+		saveData["o_jy.a_key"] = keyMaps
+	} else if reqType == "setSurp" {
+		saveData["o_jy.s_surprise"] = "A"
+		m.SetSession("surprise", "A")
+	} else if reqType == "saveKeyWordsNew" { //保存 or 修改 整个订阅词接口
+		index = m.GetString("index")
+		indexInt := util.IntAll(index)
+		area := m.GetSlice("area")
+		infotype := m.GetSlice("infotype")
+		notkey := m.GetSlice("notkey")
+		keyWords := m.GetString("keyWords")
+		a_key, a_key_ok := m.GetSession("o_jy_a_key").([]interface{})
+		if len(notkey) > 10 {
+			notkey = notkey[0:10]
+		}
+		for k, v := range notkey {
+			notkey[k] = strings.Replace(v, " ", "", -1)
+		}
+		keys := processKeyword(keyWords)
+		if keys == nil || indexInt >= 10 {
+			m.ServeJson(map[string]interface{}{
+				"flag": false,
+			})
+			return
+		}
+		saveKey := map[string]interface{}{
+			"key":      []string{keys[0]},
+			"area":     fliterEmptyArr(area),
+			"notkey":   fliterEmptyArr(notkey),
+			"infotype": fliterEmptyArr(infotype),
+		}
+		var optime time.Time
+		var regtime int64
+		if rd := utils.Compatible.Select(userId, `{"o_jy":1,"l_registedate":1}`); rd != nil && len(*rd) > 0 {
+			//获取活动上线时间
+			optimalTime, _ := config.Sysconfig["optimalTime"].(string)
+			optime, _ = time.ParseInLocation(Date_Full_Layout, optimalTime, time.Local)
+			regtime, _ = (*rd)["l_registedate"].(int64)
+			if ojy, _ := (*rd)["o_jy"].(map[string]interface{}); len(ojy) > 0 {
+				if ojy["i_new"] == nil {
+					if time.Unix(regtime, 0).After(optime) {
+						saveData["o_jy.i_new"] = 1
+					} else {
+						saveData["o_jy.i_new"] = 0
+					}
+				}
+				if ojy["a_key"] != nil {
+					ak, _ := ojy["a_key"].([]interface{})
+					if len(ak) > indexInt {
+						if akmap, _ := ak[indexInt].(map[string]interface{}); akmap["from"] != nil {
+							saveKey["from"] = akmap["from"]
+						}
+					}
+				}
+			}
+		}
+		if !a_key_ok && indexInt == 0 { //第一次新增
+			index = ""
+			saveData["o_jy.a_key"] = []map[string]interface{}{saveKey}
+			if time.Unix(regtime, 0).Before(optime) {
+				saveData["o_jy.i_new"] = 1
+			}
+		} else { //修改新增
+			if indexInt > len(a_key) {
+				indexInt = len(a_key)
+			}
+			saveData[fmt.Sprintf("o_jy.a_key.%d", indexInt)] = saveKey
+		}
+	}
+	//修改操作
+	var flag bool
+	if len(saveData) > 0 {
+		saveData["o_jy.l_modifydate"] = time.Now().Unix()
+		if index == "" {
+			flag = utils.Compatible.Update(userId, map[string]interface{}{
+				"$set": saveData,
+			})
+		} else {
+			if intIndex, e := strconv.Atoi(index); e == nil && intIndex >= 0 && intIndex < 10 {
+				flag = utils.Compatible.Update(userId, map[string]interface{}{
+					"$set": saveData,
+				})
+			}
+		}
+	}
+	m.ServeJson(map[string]interface{}{
+		"flag": flag,
+	})
+	return
 }
 
-//过滤[""]数组
+// 过滤[""]数组
 func fliterEmptyArr(beforeArr []string) []string {
-    afterArr := []string{}
-    for _, v := range beforeArr {
-        if v == "" {
-            continue
-        }
-        afterArr = append(afterArr, v)
-    }
-    return afterArr
+	afterArr := []string{}
+	for _, v := range beforeArr {
+		if v == "" {
+			continue
+		}
+		afterArr = append(afterArr, v)
+	}
+	return afterArr
 }
 
-//高级设置
+// 高级设置
 func (m *Front) WxKeysetSeniorset() error {
-    return m.Render("/weixin/wxkeyset/seniorset.html")
+	return m.Render("/weixin/wxkeyset/seniorset.html")
 }
 
-//高级设置
+// 高级设置
 func (m *Front) WxKeysetFilterset() error {
-    return m.Render("/weixin/wxkeyset/filterset.html")
+	return m.Render("/weixin/wxkeyset/filterset.html")
 }
 
-//保存入库之前,处理订阅的关键词
+// 保存入库之前,处理订阅的关键词
 func processKeyword(keyword string) []string {
-    keywordReg := regexp.MustCompile("([\\s\u3000\u2003\u00a0+,,])+")
-    spaceReg := regexp.MustCompile("\\s+")
-    keyword = keywordReg.ReplaceAllString(keyword, " ")
-    keyword = spaceReg.ReplaceAllString(keyword, " ")
-    keyword = strings.Trim(keyword, " ")
-    if keyword == "" {
-        return nil
-    }
-    return strings.Split(keyword, " ")
+	keywordReg := regexp.MustCompile("([\\s\u3000\u2003\u00a0+,,])+")
+	spaceReg := regexp.MustCompile("\\s+")
+	keyword = keywordReg.ReplaceAllString(keyword, " ")
+	keyword = spaceReg.ReplaceAllString(keyword, " ")
+	keyword = strings.Trim(keyword, " ")
+	if keyword == "" {
+		return nil
+	}
+	return strings.Split(keyword, " ")
 }
 
-//超级订阅优化,免费订阅判断新老用户  1:新用户 0:老用户
+// 超级订阅优化,免费订阅判断新老用户  1:新用户 0:老用户
 func NewUserByVIP(mData *map[string]interface{}) int {
-    if len(*mData) == 0 || mData == nil {
-        return 1
-    }
-    ojy, _ := (*mData)["o_jy"].(map[string]interface{})
-    if len(ojy) > 0 {
-        if ojy["i_new"] != nil {
-            return util.IntAllDef(ojy["i_new"], 1)
-        }
-        optimalTime, _ := config.Sysconfig["optimalTime"].(string)
-        optime, _ := time.ParseInLocation(Date_Full_Layout, optimalTime, time.Local)
-        regtime, _ := (*mData)["l_registedate"].(int64)
-        //如果a_key 存在 即为老用户
-        if (ojy["a_key"] == nil && time.Unix(regtime, 0).Before(optime)) || (time.Unix(regtime, 0).After(optime)) {
-            return 1
-        }
-    }
-    return 0
+	if len(*mData) == 0 || mData == nil {
+		return 1
+	}
+	ojy, _ := (*mData)["o_jy"].(map[string]interface{})
+	if len(ojy) > 0 {
+		if ojy["i_new"] != nil {
+			return util.IntAllDef(ojy["i_new"], 1)
+		}
+		optimalTime, _ := config.Sysconfig["optimalTime"].(string)
+		optime, _ := time.ParseInLocation(Date_Full_Layout, optimalTime, time.Local)
+		regtime, _ := (*mData)["l_registedate"].(int64)
+		//如果a_key 存在 即为老用户
+		if (ojy["a_key"] == nil && time.Unix(regtime, 0).Before(optime)) || (time.Unix(regtime, 0).After(optime)) {
+			return 1
+		}
+	}
+	return 0
 }

+ 1 - 0
src/jfw/modules/app/src/config.yaml

@@ -4,3 +4,4 @@ etcd:
 userCenterKey: "usercenter.rpc" #用户中台rpc
 powerCheckCenterKey: "powercheck.rpc" #权益校验中台
 entManageApplication: "entmanageapplication.rpc" #企业管理中台
+GuideRegistedate: 1735034400  #该时间之前注册的付费用户不用进订阅向导

+ 2 - 0
src/jfw/modules/app/src/jfw/config/config.go

@@ -26,6 +26,7 @@ var (
 	Middleground          *middleground.Middleground
 	IpList                *ipmatch.WhiteIp
 	IpInitLock            sync.RWMutex //锁
+	GuideRegistedate      int64        //该时间之前注册的付费用户不用进订阅向导
 )
 
 func init() {
@@ -52,6 +53,7 @@ func init() {
 		RegPowerCheckCenter(g.Cfg().MustGet(ctx, "powerCheckCenterKey").String()).
 		RegEntManageApplication(g.Cfg().MustGet(ctx, "entManageApplication").String()).
 		RegPublicservice(g.Cfg().MustGet(ctx, "publicserviceKey").String())
+	GuideRegistedate = g.Cfg().MustGet(ctx, "GuideRegistedate").Int64()
 }
 
 func IpInit() {

+ 7 - 0
src/jfw/modules/app/src/web/staticres/jyapp/vipsubscribe/css/base.css

@@ -129,3 +129,10 @@ em,i{
   color: #5F5E64!important;
   text-align: justify!important;
 }
+.refund-success-tip {
+  margin-left: .4rem;
+  font-size: .28rem;
+  color: #FB483D;
+  line-height: .4rem;
+  font-weight: 400;
+}

+ 19 - 2
src/jfw/modules/app/src/web/staticres/jyapp/vipsubscribe/css/vip_index_new.css

@@ -114,7 +114,7 @@
 }
 .sub-box{
   background: url(../image/vip-index-bg.png) no-repeat center top #fff;
-  background-size: 100% 3rem;
+  background-size: 100% 2.84rem;
   padding-top: 21.33333vw;
 }
 .sub-info{
@@ -122,11 +122,12 @@
   background: linear-gradient(270deg, #F1D090 0%, #FAE7CA 100%);
   box-shadow: 0px 12px 16px rgba(250, 231, 202, 0.32);
   padding: .16rem .32rem;
-  margin: 0.24rem .24rem;
+  margin: .24rem .24rem 0;
 }
 .sub-info .item-label{
   font-size: .3rem;
   color: #1B1A2A;
+  font-weight: bold;
 }
 .sub-info .icon-arrow{
   font-size: .28rem;
@@ -880,4 +881,20 @@
 .icon_vip{
   background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAANpSURBVHgB7VdNTttAFH5jxyZIXaS70iKRnKBhE1p1AZyg7QkwJ4CeoOQEwAmAEwAnwCwq1IBKbpC0lQjtBi8qQW3PTN9z7MgEz9jgdJcvijyen+dv5v0OwBRTTKEFgwngdnBWN8HcQ2lNkFDDLpcDX5+de9uHkihNMCLHzMuYWFqy54fB6rP5d10oAQNKwjTMzw/IEbDPNq1tKInSBJHIB+UYqbwkyhP8z5jECXY1Y0dQEqUJkrfio58x1MexNpREJf0S/DxfAQveSymbjLFuKMPdSYQKHWTvshZWww3BRJNJ5vk82E17/ijMhIOLNQFif2w9ncKqiuSf31+aNrcOsVmHbGjXx/HzZHy9kOJT9eWbnRFB2kUwG/QywwUGXXuutZruSHYtQW5BATBgWyGEB+NE/V+dPRDgZCzwrFurwRqLXkSQVCsr8kT1ASTIbntndcu0mtKWy0jMUWxGx9IjpzEC41gYom/Pt7r+dedGJUcK+XHm1dJRZIO4oMY0ScUfdGQ0D38g4WkYEnGEJZxYplYWcvLoGRG0fdtFFXuPPpUE8engrr+Pugy2gI8VUNunDv3qXbU7FB0DDdbBnLr9KJJITHK5TqrIGs6x7UIy7+mVvMoQhoO7X4bh7vXgsI62tD9aj3aatGcbQ4dAVfagyCliwJdMHlMkSTtTpuHF7t/Lk2ndWc/J06gdXJ9vY/zcvDdhqPpCpxeHI3e8PzOTRDsg4TlIyBEouD+YUFS1+K0sckqCkWwujyEH8urbQtKOUp6EXWy68EgIIU5VY2qCTOYWmqERjFRKp26/bG1SUKe4SSqD4mSV85TBr6gdAhUKHNrc5G5WSvOvOjv4lQ2dAMy/i6rKW1vyF/ZASJEd3kfaCdkCG+3jiTdUg/pyS0KuHY6hjn8Hq5KdpKNANeTqBrUEOeNPuvAYzLgpPJnDqW64ohvEdHMUVIM9tezIEQCDe43yedz2KHUmc6JCRJN0yXZBg9xrp84O04E6C6p6L/X1rv2itQgaaE8wAtmhwguDmeAk/HHRxpDk0Z8H3DMtk06yySrsdW5ZprvPFCWIGcLF8j87TOC1Esunw+TVNM30OsiVLfKTQe6lKW1Pk0YR2bkEycZQVQcwaWBa1Nnv6PtQEH8HX/ex6l6DCYA2PDO35MAUU0xRHv8Al8ebBRh7GtgAAAAASUVORK5CYII=);
   background-size: 24px;
+}
+
+.subscribe-manage-tips {
+  padding: .24rem .24rem 0;
+  background: #fff;
+}
+.subscribe-manage-tips > span {
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  padding: .12rem 0;
+  font-size: .26rem;
+  color: #2ABED1;
+  border-radius: .32rem;
+  line-height: .4rem;
+  background: rgba(42, 190, 209, 0.08);
 }

+ 6 - 0
src/jfw/modules/app/src/web/staticres/jyapp/vipsubscribe/css/vip_pay_success.css

@@ -48,6 +48,12 @@
   background-color: #EDEFF2;
 }
 
+.bottom_button .left_btn > p {
+  line-height: .24rem;
+  font-size: .24rem;
+  color: #2ABED1;
+}
+
 .bottom_button .right_btn {
   /* color: #F1D090;
   background-color: #1B1A2A; */

+ 26 - 1
src/jfw/modules/app/src/web/staticres/jyapp/vipsubscribe/js/vip_index_new.js

@@ -28,7 +28,13 @@ var subNode = new Vue({
       vSwitch: '', // 用户权限
       freeUserArea: {}, // 购买省份订阅包的用户所选择的地区
       isNewVip: 0,
-      entVipPower: false
+      entVipPower: false,
+      infoRoot: {}
+    }
+  },
+  computed: {
+    isFree () {
+      return this.infoRoot?.isFree
     }
   },
   created () {
@@ -49,6 +55,23 @@ var subNode = new Vue({
     })
   },
   methods: {
+    // 判断是否进入(新)订阅向导
+    // 需求:进入“我的订阅管理(免费、超级订阅、大会员、商机管理)”页:在该用户身份下,未完成过订阅向导,则默认进入“订阅向导”页,否则进入“我的订阅管理”页
+    linkToSubscribeGuide: function() {
+      var _this = this
+      var vType = _this.vSwitch ? _this.vSwitch + 'Type' : 'fType'
+      $.ajax({
+        url: '/jyapi/jybx/subscribe/' + vType + '/someInfo?t=' + Date.now(),
+        type: 'POST',
+        success: function (res) {
+          if (res) {
+            if (res.data.isInTSguide) {
+              location.href = '/jy_mobile/subscribe/guide'
+            }
+          }
+        }
+      })
+    },
     // 省份订阅包续费
     renewBtn: function () {
       location.href = '/jy_mobile/common/order/create/areapack?type=renew'
@@ -161,6 +184,7 @@ var subNode = new Vue({
         url: '/bigmember/use/isAdd',
         type: 'POST',
         success: function (res) {
+          _this.infoRoot = res.data || {}
           // 如果是商机管理、大会员、超级订阅会员有筛选权限
           if (res.data.vipStatus > 0 && res.data.memberStatus > 0 && !res.data.isSubCount) {
             $('.custom-header-right').show()
@@ -184,6 +208,7 @@ var subNode = new Vue({
         success: function (res) {
           if (res.data) {
             _this.vSwitch = res.data.vt || 'f'
+            _this.linkToSubscribeGuide()
             // f 免费 m 大会员 v 超级订阅
             if (res.data.vt == 'm') {
               _this.vipLink = 'javascript:;'

+ 13 - 4
src/jfw/modules/app/src/web/staticres/jyapp/vipsubscribe/js/vip_order_detail.js

@@ -48,7 +48,15 @@ $(function () {
             		$(".discountPrice").parent().hide();
             }
             //价格
-            $(".price").text("¥ " + formatMoney(parseFloat(r.data.order.pay_money  || r.data.order.order_money) / 100));
+            if(r.data.order.refund_status && r.data.order.refund_status > 0){
+              const domSpan = '<span class="refund-success-tip">退款成功</span>'
+              $(".price").html("¥ " + formatMoney(parseFloat(r.data.order.pay_money  || r.data.order.order_money) / 100) + domSpan);
+              $('.refund-success-tip').show()
+            } else {
+              $(".price").text("¥ " + formatMoney(parseFloat(r.data.order.pay_money  || r.data.order.order_money) / 100));
+              $('.refund-success-tip').hide()
+            }
+            
             $(".totalPrice").text("¥ " + formatMoney(parseFloat(r.data.order.order_money) / 100) + "元");
             if (!r.data.order.isLiveActive) {
                 $(".origin-price-container").hide();
@@ -504,7 +512,7 @@ $(function () {
                         
                     } 
                         //已支付已申请发票
-                        if(r.data.order.invoice_show){
+                        if(r.data.order.invoice_show ){
                         pay_again += "<button class=\"j-button-cancel\" onclick= 'checkinvoice(" + r.data.order.applybill_status + ")' style='width: 100%!important;'>查看发票</button >"
                         // $(".invoice").css("display", "none");
                         }
@@ -519,8 +527,9 @@ $(function () {
                                 $(".taxpayer_number").html(r.data.order.applybill_taxnum);
                                 break;
                         }
-                    
-                       $(".j-footer").show().html(pay_again)     
+                        if (!r.data.order.refund_status) {
+                          $(".j-footer").show().html(pay_again)     
+                        }
                 
             } else if (r.data.order.order_status == -2 || r.data.order.order_status == -3) {
                 if( r.data.order.pay_way === "transferAccounts" && r.data.order.course_status === 3){

+ 3 - 1
src/jfw/modules/app/src/web/templates/big-member/page_orderdetail_aiForecastPack.html

@@ -230,7 +230,9 @@
                       //已支付已申请发票
                       pay_again += "<button class=\"j-button-cancel\" style=\"width: 100%!important;height: 0.92rem!important;\" onclick='checkinvoice(" + r.data.applybill_status + ")'>查看发票</button>"
                   }
-                  $('.j-footer').show().html(pay_again);
+                  if (!r.data.refund_status) {
+                    $('.j-footer').show().html(pay_again);
+                  }
                 }
                 //支付方式
                 if(r.data.billingMode){

+ 11 - 5
src/jfw/modules/app/src/web/templates/big-member/page_orderdetail_member.html

@@ -419,9 +419,14 @@
                 var priceText = "¥ " + formatMoney((r.data.order_money / 100));
                 ;
                 if (r.data.order_status == 1) {
+                  if (r.data.refund_status && r.data.refund_status > 0) {
+                    const domSpan = '<span class="refund-success-tip">退款成功</span>'
+                    priceText = "¥ " + formatMoney((r.data.pay_money / 100)) + domSpan;
+                  } else {
                     priceText = "¥ " + formatMoney((r.data.pay_money / 100));
+                  }
                 }
-                $(".price").text(priceText);
+                $(".price").html(priceText);
                 // 优惠金额
                 if (r.data.discount_price) {
                   $('.discount').show()
@@ -443,8 +448,8 @@
                 cycle = filterObj.cycle + "天"
             }else {
                 cycle = filterObj.cycle + "年"
-                var createType = filterObj.createType
-                if (createType||filterObj.cycleType===0){
+                // var createType = filterObj.createType
+                if (filterObj.cycleType===0){
                   cycle = filterObj.cycle + "个月";
                 }
             }
@@ -476,8 +481,9 @@
                         //已支付已申请发票
                         pay_again += "<button class=\"j-button-cancel\" style=\"width: 100%!important;height: 0.92rem!important;\" onclick='checkinvoice(" + r.data.applybill_status + ")'>查看发票</button>"
                     }
-                  
+                    if (!r.data.refund_status) {
                       $('.j-footer').show().html(pay_again);
+                    }
                     
                 
                 //支付方式
@@ -511,7 +517,7 @@
 
 
                 $(".l-item.paymoney").css("display", "");
-                $(".price").text("¥ " + formatMoney(r.data.pay_money / 100));
+                // $(".price").text("¥ " + formatMoney(r.data.pay_money / 100));
                 //兑换码 不展示支付时间 p307
                 if (r.data.pay_time&&filterObj.badge!="exchange") {
                     $(".line_paytime").css("display", "");

+ 9 - 2
src/jfw/modules/app/src/web/templates/big-member/page_orderdetail_subAccount.html

@@ -197,9 +197,14 @@
                 //价格
                 var priceText = "¥ " + formatMoney((r.data.order_money / 100))
                 if (r.data.order_status == 1) {
+                  const domSpan = '<span class="refund-success-tip">退款成功</span>'
+                  if (r.data.refund_status && r.data.refund_status > 0) {
+                    priceText = "¥ " + formatMoney((r.data.pay_money / 100)) + domSpan
+                  } else {
                     priceText = "¥ " + formatMoney((r.data.pay_money / 100));
+                  }
                 }
-                $(".price").text(priceText);
+                $(".price").html(priceText);
             }
             //
             var level_value = filterObj.areaCount?r.data.combo:level_map.get(filterObj.level).get("level");
@@ -234,7 +239,9 @@
                       //已支付已申请发票
                       pay_again += "<button class=\"j-button-cancel\" style=\"width: 100%!important;height: 0.92rem!important;\" onclick='checkinvoice(" + r.data.applybill_status + ")'>查看发票</button>"
                   }
-                  $('.j-footer').show().html(pay_again);
+                  if (!r.data.refund_status) {
+                    $('.j-footer').show().html(pay_again);
+                  }
                 }
 
                 //支付方式

+ 3 - 2
src/jfw/modules/app/src/web/templates/commonPay/areaPack/orderDetail.html

@@ -41,6 +41,7 @@
                                 <span class="rp-right">
                                     <span class="product-type">${ orderInfo.productType }</span>
                                     <span class="pay-money">&yen; ${ orderInfo.payMoney }</span>
+                                    <span v-if="orderInfo.refund_status && orderInfo.refund_status > 0" class="refund-success-tip">退款成功</span>
                                 </span>
                             </div>
                             <div class="j-card product-info">
@@ -83,11 +84,11 @@
                         @click="onConfirmPay">立即支付</button>
                     <button
                         class="j-button-cancel invoke"
-                        v-if="orderStateMap[orderInfo.state].bottomButtonShow.invoke"
+                        v-if="orderStateMap[orderInfo.state].bottomButtonShow.invoke && !orderInfo.refund_status"
                         @click="lookInvoke">${ invokeButtonText }</button>
                         <button
                         class="j-button-cancel invoke"
-                        v-if="orderStateMap[orderInfo.state].bottomButtonShow.lookInvoice"
+                        v-if="orderStateMap[orderInfo.state].bottomButtonShow.lookInvoice && !orderInfo.refund_status"
                         @click="lookInvoke('look')">查看发票</button>
                     <button
                         class="j-button-confirm buy-again"

+ 16 - 2
src/jfw/modules/app/src/web/templates/commonPay/bidfile/bidfileDetail.html

@@ -126,6 +126,7 @@
                         <p class="l-item paymoney" style="display: none">
                             <span class="label" id="price">实付金额:</span>
                             <span class="price value"></span>
+                            <span style="display: none;" class="refund-success-tip">退款成功</span>
                         </p>
                     </div>
                 </div>
@@ -167,6 +168,12 @@
                     $(".nothing").show();
                     $("#order_detail").hide();
                 }
+                // 是否显示退款成功提示
+                if (r.data.refund_status && r.data.refund_status > 0) {
+                  $('.refund-success-tip').show()
+                } else {
+                  $('.refund-success-tip').hide()
+                }
 
                 //下单时间
                 if (r.data.create_time) {
@@ -178,7 +185,12 @@
                 if (r.data.order_status == 1) {
                     priceText = "¥ " + formatMoney((r.data.pay_money / 100));
                 }
-                $(".price").text(priceText);
+                const domSpan = '<span style="display: none;" class="refund-success-tip">退款成功</span>'
+                if (r.data?.refund_status && r.data?.refund_status > 0) {
+                  $(".price").html(priceText + domSpan)
+                } else {
+                  $(".price").text(priceText);
+                }
             }
             //
             //
@@ -202,7 +214,9 @@
                     //已支付已申请发票
                     pay_again += "<button class=\"j-button-cancel\" style=\"width: 100%!important;height: 0.92rem!important;\" onclick='checkinvoice(" + r.data.applybill_status + ")'>查看发票</button>"
                 }
-                $('.j-footer').show().html(pay_again);
+                if (!r.data.refund_status) {
+                  $('.j-footer').show().html(pay_again);
+                }
 
                 //支付方式
                 if (r.data.pay_way.indexOf("wx") > -1) {

+ 3 - 2
src/jfw/modules/app/src/web/templates/commonPay/buyerPortraitPack/orderDetail.html

@@ -41,6 +41,7 @@
                                 <span class="rp-right">
                                     <span class="product-type">${ orderInfo.productType }</span>
                                     <span class="pay-money">&yen; ${ orderInfo.payMoney }</span>
+                                    <span v-if="orderInfo.refund_status && orderInfo.refund_status > 0" class="refund-success-tip">退款成功</span>
                                 </span>
                             </div>
                             <div class="j-card product-info">
@@ -83,11 +84,11 @@
                         @click="onConfirmPay">立即支付</button>
                     <button
                         class="j-button-cancel invoke"
-                        v-if="orderStateMap[orderInfo.state].bottomButtonShow.invoke"
+                        v-if="orderStateMap[orderInfo.state].bottomButtonShow.invoke && !orderInfo.refund_status"
                         @click="lookInvoke">${ invokeButtonText }</button>
                         <button
                         class="j-button-cancel invoke"
-                        v-if="orderStateMap[orderInfo.state].bottomButtonShow.lookInvoice"
+                        v-if="orderStateMap[orderInfo.state].bottomButtonShow.lookInvoice && !orderInfo.refund_status"
                         @click="lookInvoke('look')">查看发票</button>    
                     <button
                         class="j-button-confirm buy-again"

+ 3 - 2
src/jfw/modules/app/src/web/templates/commonPay/dataFile/orderDetail.html

@@ -41,6 +41,7 @@
                                 <span class="rp-right">
                                     <span class="product-type">${ orderInfo.productType }</span>
                                     <span class="pay-money">&yen; ${ orderInfo.payMoney }</span>
+                                    <span v-if="orderInfo.refund_status && orderInfo.refund_status > 0" class="refund-success-tip">退款成功</span>
                                 </span>
                             </div>
                             <div class="j-card product-info">
@@ -83,11 +84,11 @@
                         @click="onConfirmPay">立即支付</button>
                     <button
                         class="j-button-cancel invoke"
-                        v-if="orderStateMap[orderInfo.state].bottomButtonShow.invoke"
+                        v-if="orderStateMap[orderInfo.state].bottomButtonShow.invoke && !orderInfo.refund_status"
                         @click="lookInvoke">${ invokeButtonText }</button>
                     <button
                         class="j-button-cancel invoke"
-                        v-if="orderStateMap[orderInfo.state].bottomButtonShow.lookInvoice"
+                        v-if="orderStateMap[orderInfo.state].bottomButtonShow.lookInvoice && !orderInfo.refund_status"
                         @click="lookInvoke('look')">查看发票</button>
                     <button
                         class="j-button-confirm buy-again"

+ 3 - 2
src/jfw/modules/app/src/web/templates/commonPay/dataPack/orderDetail.html

@@ -41,6 +41,7 @@
                                 <span class="rp-right">
                                     <span class="product-type">${ orderInfo.productType }</span>
                                     <span class="pay-money">&yen; ${ orderInfo.payMoney }</span>
+                                    <span v-if="orderInfo.refund_status && orderInfo.refund_status > 0" class="refund-success-tip">退款成功</span>
                                 </span>
                             </div>
                             <div class="j-card product-info">
@@ -83,11 +84,11 @@
                         @click="onConfirmPay">立即支付</button>
                     <button
                         class="j-button-cancel invoke"
-                        v-if="orderStateMap[orderInfo.state].bottomButtonShow.invoke"
+                        v-if="orderStateMap[orderInfo.state].bottomButtonShow.invoke && !orderInfo.refund_status"
                         @click="lookInvoke">${ invokeButtonText }</button>
                     <button
                         class="j-button-cancel invoke"
-                        v-if="orderStateMap[orderInfo.state].bottomButtonShow.lookInvoice"
+                        v-if="orderStateMap[orderInfo.state].bottomButtonShow.lookInvoice && !orderInfo.refund_status"
                         @click="lookInvoke('look')">查看发票</button>    
                     <button
                         class="j-button-confirm buy-again"

+ 3 - 2
src/jfw/modules/app/src/web/templates/commonPay/docMember/orderDetail.html

@@ -41,6 +41,7 @@
                                 <span class="rp-right">
                                     <span class="product-type">${ orderInfo.productType }</span>
                                     <span class="pay-money">&yen; ${ orderInfo.payMoney }</span>
+                                    <span v-if="orderInfo.refund_status && orderInfo.refund_status > 0" class="refund-success-tip">退款成功</span>
                                 </span>
                             </div>
                             <div class="j-card product-info">
@@ -83,11 +84,11 @@
                         @click="onConfirmPay">立即支付</button>
                     <button
                         class="j-button-cancel invoke"
-                        v-if="orderStateMap[orderInfo.state].bottomButtonShow.invoke"
+                        v-if="orderStateMap[orderInfo.state].bottomButtonShow.invoke && !orderInfo.refund_status"
                         @click="lookInvoke">${ invokeButtonText }</button>
                         <button
                         class="j-button-cancel invoke"
-                        v-if="orderStateMap[orderInfo.state].bottomButtonShow.lookInvoice"
+                        v-if="orderStateMap[orderInfo.state].bottomButtonShow.lookInvoice && !orderInfo.refund_status"
                         @click="lookInvoke('look')">查看发票</button>
                     <button
                         class="j-button-confirm buy-again"

+ 3 - 2
src/jfw/modules/app/src/web/templates/commonPay/enterpriseAnalysis/orderDetail.html

@@ -41,6 +41,7 @@
                                 <span class="rp-right">
                                     <span class="product-type">${ orderInfo.productType }</span>
                                     <span class="pay-money">&yen; ${ orderInfo.payMoney }</span>
+                                    <span v-if="orderInfo.refund_status && orderInfo.refund_status > 0" class="refund-success-tip">退款成功</span>
                                 </span>
                             </div>
                             <div class="j-card product-info">
@@ -83,11 +84,11 @@
                         @click="onConfirmPay">立即支付</button>
                     <button
                         class="j-button-cancel invoke"
-                        v-if="orderStateMap[orderInfo.state].bottomButtonShow.invoke"
+                        v-if="orderStateMap[orderInfo.state].bottomButtonShow.invoke && !orderInfo.refund_status"
                         @click="lookInvoke">${ invokeButtonText }</button>
                         <button
                         class="j-button-cancel invoke"
-                        v-if="orderStateMap[orderInfo.state].bottomButtonShow.lookInvoice"
+                        v-if="orderStateMap[orderInfo.state].bottomButtonShow.lookInvoice && !orderInfo.refund_status"
                         @click="lookInvoke('look')">查看发票</button>
                     <button
                         class="j-button-confirm buy-again"

+ 3 - 2
src/jfw/modules/app/src/web/templates/commonPay/filePack/orderDetail.html

@@ -41,6 +41,7 @@
                                 <span class="rp-right">
                                     <span class="product-type">${ orderInfo.productType }</span>
                                     <span class="pay-money">&yen; ${ orderInfo.payMoney }</span>
+                                    <span v-if="orderInfo.refund_status && orderInfo.refund_status > 0" class="refund-success-tip">退款成功</span>
                                 </span>
                             </div>
                             <div class="j-card product-info">
@@ -83,11 +84,11 @@
                         @click="onConfirmPay">立即支付</button>
                     <button
                         class="j-button-cancel invoke"
-                        v-if="orderStateMap[orderInfo.state].bottomButtonShow.invoke"
+                        v-if="orderStateMap[orderInfo.state].bottomButtonShow.invoke && !orderInfo.refund_status"
                         @click="lookInvoke">${ invokeButtonText }</button>
                     <button
                         class="j-button-cancel invoke"
-                        v-if="orderStateMap[orderInfo.state].bottomButtonShow.lookInvoice"
+                        v-if="orderStateMap[orderInfo.state].bottomButtonShow.lookInvoice && !orderInfo.refund_status"
                         @click="lookInvoke('look')">查看发票</button>    
                     <button
                         class="j-button-confirm buy-again"

+ 14 - 4
src/jfw/modules/app/src/web/templates/commonPay/integral/integralDetail.html

@@ -134,6 +134,7 @@
                         <p class="l-item paymoney">
                             <span class="label" id="price">实付金额:</span>
                             <span class="price value">-</span>
+                            <span style="display: none;" class="refund-success-tip">退款成功</span>
                         </p>
                     </div>
                 </div>
@@ -182,9 +183,16 @@
                 }
                 //价格
                 var priceText = "¥ " + formatMoney((r.data.order_money / 100));
-                $(".order_price").text(priceText);
-                priceText = priceText + "元";
-                $(".price").text(priceText);
+                const domSpan = '<span class="refund-success-tip">退款成功</span>'
+                if(r.data?.refund_status && r.data?.refund_status > 0) {
+                  $('.refund-success-tip').show()
+                  $(".order_price").html(priceText + domSpan)
+                  $(".price").html(priceText + "元" + domSpan);
+                } else {
+                  $('.refund-success-tip').hide()
+                  $(".order_price").html(priceText);
+                  $(".price").html(priceText + "元");
+                }
                 if (r.data.order_status === 1) {
                     $("#card-header-bg").addClass("bg finish-bg")
                     $("#pageTitle").addClass("status")
@@ -204,7 +212,9 @@
                         //已支付已申请发票
                         pay_again += "<button class=\"j-button-cancel\" style=\"width: 100%!important;height: 0.92rem!important;\" onclick='checkinvoice(" + r.data.applybill_status + ")'>查看发票</button>"
                     }
-                    $('.j-footer').show().html(pay_again);
+                    if (!r.data.refund_status) {
+                      $('.j-footer').show().html(pay_again);
+                    }
 
                     //支付方式
                     if (r.data.pay_way.indexOf("wx") > -1) {

+ 3 - 2
src/jfw/modules/app/src/web/templates/commonPay/marketAnalysis/orderDetail.html

@@ -41,6 +41,7 @@
                                 <span class="rp-right">
                                     <span class="product-type">${ orderInfo.productType }</span>
                                     <span class="pay-money">&yen; ${ orderInfo.payMoney }</span>
+                                    <span v-if="orderInfo.refund_status && orderInfo.refund_status > 0" class="refund-success-tip">退款成功</span>
                                 </span>
                             </div>
                             <div class="j-card product-info">
@@ -83,11 +84,11 @@
                         @click="onConfirmPay">立即支付</button>
                     <button
                         class="j-button-cancel invoke"
-                        v-if="orderStateMap[orderInfo.state].bottomButtonShow.invoke"
+                        v-if="orderStateMap[orderInfo.state].bottomButtonShow.invoke && !orderInfo.refund_status"
                         @click="lookInvoke">${ invokeButtonText }</button>
                         <button
                         class="j-button-cancel invoke"
-                        v-if="orderStateMap[orderInfo.state].bottomButtonShow.lookInvoice"
+                        v-if="orderStateMap[orderInfo.state].bottomButtonShow.lookInvoice && !orderInfo.refund_status"
                         @click="lookInvoke('look')">查看发票</button>
                     <button
                         class="j-button-confirm buy-again"

+ 12 - 2
src/jfw/modules/app/src/web/templates/commonPay/medical/orderDetail.html

@@ -99,6 +99,7 @@
             <p class="origin-price">
               <span class="yen">&yen;</span>
               <span class="price-num">1222</span>
+              <span class="refund-success-tip">退款成功</span>
             </p>
           </div>
         </div>
@@ -255,8 +256,12 @@
         // }
 
         //价格
-        $(".price").text("¥ " + formatMoney(parseFloat(r.data.order.pay_money) / 100));
-
+        const domSpan = '<span style="display: none;" class="refund-success-tip">退款成功</span>'
+        if(r.data.order?.refund_status && r.data.order?.refund_status > 0) {
+          $(".price").html("¥ " + formatMoney(parseFloat(r.data.order.pay_money) / 100) + domSpan);
+        } else {
+          $(".price").text("¥ " + formatMoney(parseFloat(r.data.order.pay_money) / 100));
+        }
 
         if (JSON.parse(r.data.order.filter).area === '-') {
           $(".totalPrice").text('-');
@@ -314,6 +319,11 @@
             if (filterObj.original_price) {
               var originPrice = formatMoney(parseFloat(filterObj.original_price) / 100)
               $(".price-num").text(originPrice);
+              if(filterObj?.refund_status && filterObj?.refund_status > 0) {
+                $('.refund_status_tip').show()
+              } else {
+                $('.refund_status_tip').hide()
+              }
               $(".origin-price-container").show()
               $(".bill-origin-price").css("display", "flex");
             }

+ 2 - 1
src/jfw/modules/app/src/web/templates/commonPay/myOrder.html

@@ -85,6 +85,7 @@
                                                 <div class="p-num">&yen; ${ item.payPrice }</div>
                                             </div>
                                         </div>
+                                        <div class="refund-success" v-if="item.refund_status && item.refund_status > 0">退款成功</div>
                                         <div class="limited-countdown" v-if="item.countDown > serverInitTime && item.order_status == 0" v-text="'限时抢购支付倒计时 ' + diffCountdown(item)"> </div>
                                         <div class="o-i-f-button-group">
                                             <button
@@ -94,7 +95,7 @@
                                             <!-- 已完成订单才能开发票 -->
                                             <button
                                                     class="order-action-button click-active invoke"
-                                                    v-if="item.buttonConf.invokeButtonShow"
+                                                    v-if="item.buttonConf.invokeButtonShow && !item.refund_status"
                                                     @click="clickInvoke(item)">${ item.buttonConf.invokeButtonText }</button>
                                             <button
                                                     class="order-action-button click-active invoke"

+ 3 - 2
src/jfw/modules/app/src/web/templates/commonPay/ownerAnalysis/orderDetail.html

@@ -41,6 +41,7 @@
                                 <span class="rp-right">
                                     <span class="product-type">${ orderInfo.productType }</span>
                                     <span class="pay-money">&yen; ${ orderInfo.payMoney }</span>
+                                    <span v-if="orderInfo.refund_status && orderInfo.refund_status > 0" class="refund-success-tip">退款成功</span>
                                 </span>
                             </div>
                             <div class="j-card product-info">
@@ -83,11 +84,11 @@
                         @click="onConfirmPay">立即支付</button>
                     <button
                         class="j-button-cancel invoke"
-                        v-if="orderStateMap[orderInfo.state].bottomButtonShow.invoke"
+                        v-if="orderStateMap[orderInfo.state].bottomButtonShow.invoke && !orderInfo.refund_status"
                         @click="lookInvoke">${ invokeButtonText }</button>
                         <button
                         class="j-button-cancel invoke"
-                        v-if="orderStateMap[orderInfo.state].bottomButtonShow.lookInvoice"
+                        v-if="orderStateMap[orderInfo.state].bottomButtonShow.lookInvoice && !orderInfo.refund_status"
                         @click="lookInvoke('look')">查看发票</button>
                     <button
                         class="j-button-confirm buy-again"

+ 6 - 3
src/jfw/modules/app/src/web/templates/vipsubscribe/vip_index_new.html

@@ -87,7 +87,7 @@
     }
 
     .sub-info {
-      min-height: 1.48rem;
+      min-height: 1.12rem;
     }
 
     .banner-ad-box {
@@ -274,9 +274,9 @@
                 <i class="iconfont icon-arrow"></i>
               </div>
             </a>
-            <ul class="sub-info" :class="vSwitch !== 'm' && vSwitch !== 'v' ? 'go_to_levelup' : ''" @click="toPaySupSub" style="min-height: 1.48rem">
+            <ul class="sub-info" :class="vSwitch !== 'm' && vSwitch !== 'v' ? 'go_to_levelup' : ''" @click="toPaySupSub">
               <li class="cycle" v-show="vSwitch == 'm' || vSwitch == 'v'">
-                <a class="item-container" @click="toSubCycle" href="javascript:;">
+                <a class="item-container item-container-main" @click="toSubCycle" href="javascript:;">
                   <div class="item">
                     <span class="item-l">
                       <span class="item-label">订阅周期</span>
@@ -299,6 +299,9 @@
               </li>
             </ul>
           </li>
+          <div class="subscribe-manage-tips" v-if="!isFree">
+            <span>注:修改完订阅条件后,预计30分钟左右生效。</span>
+          </div>
           <sub-component ref="subComponent"  get-container="body" :linkobj="linkObj" :initdata="initData" :v-switch="vSwitch" @back-init="refreshInitdata"></sub-component>
           <div class="provincePayWarp" v-show="userType">
             <span class="provincePayTips">省份订阅包</span>

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

@@ -135,6 +135,7 @@
 										<p class="l-item paymoney">
 											<span class="label" id="price">实付金额:</span>
 											<span class="payPrice value price"></span><em class="qingdan valuationList" style="display:none">计费清单</em>
+                      <span style="display: none;" class="refund-success-tip">退款成功</span>
 										</p>
 										<!-- 订单状态为已完成时显示支付时间、支付方式和订单号,状态为待付款时不显示 -->
 										<p class="l-item line_paytime" style="display:none">

+ 5 - 2
src/jfw/modules/app/src/web/templates/vipsubscribe/vip_pay_success.html

@@ -73,9 +73,12 @@
             </div>
         </div>
         <div class="layout_footer">
-            <p class="invoce-tip-text">如需发票,可点击【查看订单】前往开票</p>
+            <p class="invoce-tip-text">点击“立即订阅”前往设置订阅区域、关键词等条件</p>
             <div class="bottom_button">
-                <button class="left_btn">查看订单</button>
+                <button class="left_btn">
+                  查看订单
+                  <p>(可点击前往开票)</p>
+                </button>
                 <button class="right_btn">立即订阅</button>
             </div>
         </div>

+ 8 - 7
src/jfw/modules/publicapply/src/applocation/entity/entity.go

@@ -25,7 +25,7 @@ func NewAppLoc(userId, longitude, latitude, calculate string, r http.Request) *A
 var AppLocLog = "apploc_log"
 var RedisUserKey = "apploc_%s"
 
-//保存定位信息
+// 保存定位信息
 func (this *AppLocStruct) SaveAppLocInfo() bool {
 	timeNow := time.Now()
 	ref := this.R.Referer()
@@ -43,14 +43,15 @@ func (this *AppLocStruct) SaveAppLocInfo() bool {
 		"hour":      timeNow.Hour(),
 		"minutes":   timeNow.Minute(),
 	}
-	if db.Mgo_Log.Save(AppLocLog, appLocInfo) != "" {
-		redis.Put("other", fmt.Sprintf(RedisUserKey, this.UserId), timeNow.Day(), ac.Apploctime)
-		return true
-	}
-	return false
+	go func(appLocInfo map[string]interface{}, userId string) {
+		if db.Mgo_Log.Save(AppLocLog, appLocInfo) != "" {
+			redis.Put("other", fmt.Sprintf(RedisUserKey, userId), timeNow.Day(), ac.Apploctime)
+		}
+	}(appLocInfo, this.UserId)
+	return true
 }
 
-//是否保存信息
+// 是否保存信息
 func (this *AppLocStruct) IsSaveBool() bool {
 	_day := time.Now().Day()
 	day := redis.GetInt("other", fmt.Sprintf(RedisUserKey, this.UserId))

+ 6 - 5
src/jfw/modules/publicapply/src/detail/dao/bidding.go

@@ -186,12 +186,13 @@ func SeeDetailLimitLogs(sessUser util.SessUserInfo, sid string) {
 		"createDate":   time.Now().Unix(),
 	})
 	if len(limitLogsData) > limitLogsCount {
-		tmp := limitLogsData
+		go func(tmp []map[string]interface{}) {
+			sb := db.Mgo_Log.SaveBulk("detail_limit_logs", tmp...)
+			if !sb {
+				log.Println("免费用户 访问 详情页 超限制日志存储 异常")
+			}
+		}(limitLogsData)
 		limitLogsData = make([]map[string]interface{}, 0)
-		sb := db.Mgo_Log.SaveBulk("detail_limit_logs", tmp...)
-		if !sb {
-			log.Println("免费用户 访问 详情页 超限制日志存储 异常")
-		}
 	}
 	limitLogsLock.Unlock()
 }

+ 8 - 10
src/jfw/modules/publicapply/src/drainage/entity/entity.go

@@ -9,14 +9,12 @@ import (
 	"time"
 
 	util "app.yhyue.com/moapp/jybase/common"
-	"app.yhyue.com/moapp/jybase/encrypt"
 	"app.yhyue.com/moapp/jybase/redis"
 )
 
 var BTCKey = "btc_%s"
 var BTCR = "other"
 
-//
 func randCopywriting(data []map[string]interface{}) (res map[string]interface{}) {
 	if len(data) > 0 {
 		cwlen := len(data)
@@ -30,7 +28,7 @@ func randCopywriting(data []map[string]interface{}) (res map[string]interface{})
 	return
 }
 
-//获取引流文案
+// 获取引流文案
 func GetDrainageDoc(subtype string) map[string]interface{} {
 	// log.Println("查询MySQL 引流文案库")
 	var _subtype = BidTypeMap[subtype]
@@ -52,7 +50,7 @@ func GetDrainageDoc(subtype string) map[string]interface{} {
 	return nil
 }
 
-//引流用户信息等
+// 引流用户信息等
 type DrainageUserInfo struct {
 	UserId       string `json:"userId"`       //用户id
 	UserType     string `json:"userType"`     //用户类型0:普通;1:超级订阅;2:大会员;3:商机管理;(可以存在1,2)
@@ -61,7 +59,6 @@ type DrainageUserInfo struct {
 	Platform     string `json:"platform"`     //平台类型 P:PC;W:微信;AA:APPAndroid;AI:APPIOS
 }
 
-//
 func DrainageUserLog(DUI DrainageUserInfo) string {
 	cwInfo := map[string]interface{}{
 		"date":         time.Now().Unix(),
@@ -75,13 +72,13 @@ func DrainageUserLog(DUI DrainageUserInfo) string {
 		"isICRP":       0, //是否触发留资
 		"isICRW":       0, //是否留资
 	}
-	if id := db.Mgo_Log.Save(BidType.Cwlogcoll, cwInfo); id != "" {
-		return encrypt.SE2.EncodeString(id)
-	}
+	//if id := db.Mgo_Log.Save(BidType.Cwlogcoll, cwInfo); id != "" {
+	//	return encrypt.SE2.EncodeString(id)
+	//}
+	go db.Mgo_Log.Save(BidType.Cwlogcoll, cwInfo)
 	return ""
 }
 
-//
 func UpdateDrainageUserLogById(id, P, orderCode string, price int) bool {
 	//是否点击购买按钮
 	var set = map[string]interface{}{
@@ -103,7 +100,8 @@ func UpdateDrainageUserLogById(id, P, orderCode string, price int) bool {
 			set = map[string]interface{}{"isICRW": 1}
 		}
 	}
-	return db.Mgo_Log.UpdateById(BidType.Cwlogcoll, id, map[string]interface{}{
+	go db.Mgo_Log.UpdateById(BidType.Cwlogcoll, id, map[string]interface{}{
 		"$set": set,
 	})
+	return true
 }

+ 2 - 1
src/jfw/modules/publicapply/src/drainage/entity/wxdreply.go

@@ -9,7 +9,8 @@ func UpdateDigitalReplyLogById(id, mold string) bool {
 	var set = map[string]interface{}{
 		mold: 1,
 	}
-	return db.Mgo_Log.UpdateById(BidType.Wxdrcoll, id, map[string]interface{}{
+	go db.Mgo_Log.UpdateById(BidType.Wxdrcoll, id, map[string]interface{}{
 		"$set": set,
 	})
+	return true
 }

+ 2 - 2
src/jfw/modules/publicapply/src/drainage/initjson/initjson.go

@@ -1,9 +1,9 @@
 package drainage
 
 import (
-	"jy/src/jfw/modules/publicapply/src/db"
-	"fmt"
 	util "app.yhyue.com/moapp/jybase/common"
+	"fmt"
+	"jy/src/jfw/modules/publicapply/src/db"
 	"strconv"
 	"strings"
 )

+ 3 - 4
src/jfw/modules/publicapply/src/drainage/service/buyerunit.go

@@ -8,7 +8,6 @@ import (
 	qu "app.yhyue.com/moapp/jybase/common"
 )
 
-//
 func (this *DrainageStruct) BuyerUnitLog() {
 	defer qu.Catch()
 	r := func() Result {
@@ -25,10 +24,10 @@ func (this *DrainageStruct) BuyerUnitLog() {
 			return Result{Data: nil, Error_msg: Error_msg_1002}
 		}
 		(*buyerUnit).UserId, _ = this.GetSession("userId").(string)
-		m, b := SaveBuyerUnitInfo(*buyerUnit)
+		go SaveBuyerUnitInfo(*buyerUnit)
 		return Result{Data: map[string]interface{}{
-			"id":     m,
-			"status": b,
+			"id":     "",
+			"status": true,
 		}}
 	}()
 	this.ServeJson(r)

+ 1 - 1
src/jfw/modules/publicapply/src/oneclick/entity/entity.go

@@ -429,7 +429,7 @@ func (o *OneClickInfo) phoneLogin(phone string) (map[string]interface{}, error)
 					}()
 				}
 				userInfo["isNewUser"] = true
-				jy.SaveUserLog(db.Mgo_Log, _id, phone, "phone", isAndroidOrIOS(client), platform, "", "", gconv.String(data["s_rsource"]), o.R.Proto, isAndroidOrIOS(client), gconv.String(common.If(isAndroidOrIOS(client) == "jyzbw", "jyzbw", "jybx")), "")
+				go jy.SaveUserLog(db.Mgo_Log, _id, phone, "phone", isAndroidOrIOS(client), platform, "", "", gconv.String(data["s_rsource"]), o.R.Proto, isAndroidOrIOS(client), gconv.String(common.If(isAndroidOrIOS(client) == "jyzbw", "jyzbw", "jybx")), "")
 				//用户中台同步
 				func(userid string) {
 					if ok := jy.AddUser(db.Mgo, userid, pb.UserAddReq{

+ 50 - 48
src/jfw/modules/publicapply/src/subscribePush/entity/keyWords.go

@@ -61,7 +61,7 @@ func (this *KeyWordsSet) UpdateKeyWords() map[string]interface{} {
 		case "DC": //删除分类
 			return DeleteClass(types, this.ClassifyIndex, this.UserId, this.Session)
 		case "directSubKWS": //搜索列表直接订阅关键词
-			return directSubKWS(types, this.KeyWordName, this.UserId, this.Session,this.MatchWay)
+			return directSubKWS(types, this.KeyWordName, this.UserId, this.Session, this.MatchWay)
 		}
 	} else {
 		this.ClassifyIndex = "0"
@@ -101,6 +101,7 @@ func directSubKWSFree(types string, keys string, session *httpsession.Session) m
 	} else {
 		//无关键词 直接添加
 		if ok := config.Compatible.Update(userId, bson.M{"$set": bson.M{
+			"i_ts_guide": 1,
 			fmt.Sprintf("%s.a_key", types): bson.A{
 				bson.M{
 					"key":        bson.A{keys},
@@ -560,23 +561,23 @@ func (this *UpdateOther) UpdateOther() map[string]interface{} {
 	}
 	setMap := func() map[string]interface{} {
 		switch this.PageType {
-        case "projectMatch": //项目匹配
-            return UpdateProjectMatch(types, this.Pmindex)
-        case "saveSeniorset": //关键词匹配方式
-            return UpdateSaveSeniorset(types, this.Matchtype)
-        case "infoType": //信息类型
-            return UpdateInfoType(types, this.InfoTypeArr)
-        case "other_buyerclass":
-            return UpdateOtherBuyerClass(types, this.OtherBuyerclass)
-        case "keytip": //关键词升级弹窗提示(一个用户只提示一次)
-            return UpdateKeyTip(types)
-        case "amount": //金额匹配
-            return UpdateAmount(types, this.Matchtype)
-        case "i_switch":
-            return UpdateSwitch(types, this.Matchtype)
-        case "matchmode": //项目匹配
-            return UpdateMatchmode(types, this.Matchtype)
-        }
+		case "projectMatch": //项目匹配
+			return UpdateProjectMatch(types, this.Pmindex)
+		case "saveSeniorset": //关键词匹配方式
+			return UpdateSaveSeniorset(types, this.Matchtype)
+		case "infoType": //信息类型
+			return UpdateInfoType(types, this.InfoTypeArr)
+		case "other_buyerclass":
+			return UpdateOtherBuyerClass(types, this.OtherBuyerclass)
+		case "keytip": //关键词升级弹窗提示(一个用户只提示一次)
+			return UpdateKeyTip(types)
+		case "amount": //金额匹配
+			return UpdateAmount(types, this.Matchtype)
+		case "i_switch":
+			return UpdateSwitch(types, this.Matchtype)
+		case "matchmode": //项目匹配
+			return UpdateMatchmode(types, this.Matchtype)
+		}
 		return nil
 	}()
 	flag := true
@@ -609,9 +610,9 @@ func UpdateProjectMatch(types string, pmindex int) map[string]interface{} {
 }
 
 func UpdateSaveSeniorset(types string, matchtype string) map[string]interface{} {
-    return map[string]interface{}{
-        types + ".i_matchmode": strings.Split(matchtype, ","),
-    }
+	return map[string]interface{}{
+		types + ".i_matchmode": strings.Split(matchtype, ","),
+	}
 }
 
 func UpdateInfoType(types string, infotype string) map[string]interface{} {
@@ -628,41 +629,41 @@ func UpdateInfoType(types string, infotype string) map[string]interface{} {
 
 func UpdateOtherBuyerClass(types string, other int) map[string]interface{} {
 	return map[string]interface{}{
-        types + ".i_matchbuyerclass_other": other,
-    }
+		types + ".i_matchbuyerclass_other": other,
+	}
 }
 
 // UpdateKeyTip 关键词升级提示
 func UpdateKeyTip(types string) map[string]interface{} {
-    return map[string]interface{}{
-        types + ".b_keytip": true,
-    }
+	return map[string]interface{}{
+		types + ".b_keytip": true,
+	}
 }
 func UpdateAmount(types, matchtype string) map[string]interface{} {
-    return map[string]interface{}{
-        types + ".amount": matchtype,
-    }
+	return map[string]interface{}{
+		types + ".amount": matchtype,
+	}
 }
 func UpdateSwitch(types, matchtype string) map[string]interface{} {
-    return map[string]interface{}{
-        types + ".i_switch": gconv.Int64(matchtype),
-    }
+	return map[string]interface{}{
+		types + ".i_switch": gconv.Int64(matchtype),
+	}
 }
 func UpdateMatchmode(types, matchtype string) map[string]interface{} {
-    return map[string]interface{}{
-        types + ".i_matchmode": strings.Split(matchtype, ","),
-    }
+	return map[string]interface{}{
+		types + ".i_matchmode": strings.Split(matchtype, ","),
+	}
 }
-func directSubKWS(updateItems string, keys string, userId string, session *httpsession.Session,matchWay int) map[string]interface{} {
-    flag := "n"
-    data := config.Compatible.Select(userId, fmt.Sprintf(`{"%s":1}`, updateItems))
-    var repleat = false
-    var classify_index = -1
-    var kwsCount = 0
-    if len([]rune(keys)) > 20 {
-        keys = qutil.SubString(keys, 0, 20)
-    }
-    if data != nil && len(*data) > 0 && keys != "" {
+func directSubKWS(updateItems string, keys string, userId string, session *httpsession.Session, matchWay int) map[string]interface{} {
+	flag := "n"
+	data := config.Compatible.Select(userId, fmt.Sprintf(`{"%s":1}`, updateItems))
+	var repleat = false
+	var classify_index = -1
+	var kwsCount = 0
+	if len([]rune(keys)) > 20 {
+		keys = qutil.SubString(keys, 0, 20)
+	}
+	if data != nil && len(*data) > 0 && keys != "" {
 		updateObj, _ := (*data)[updateItems].(map[string]interface{})
 		if updateObj["a_items"] != nil {
 			a_items := updateObj["a_items"].([]interface{})
@@ -690,8 +691,8 @@ func directSubKWS(updateItems string, keys string, userId string, session *https
 				classify_index = len(a_items)
 			}
 		} else {
-			//无关键词 直接添加
-			if ok := config.Compatible.Update(userId, bson.M{"$set": bson.M{fmt.Sprintf("%s.a_items", updateItems): bson.A{bson.M{"s_item": "未分类",
+			//无关键词 直接添加  更新
+			if ok := config.Compatible.Update(userId, bson.M{"$set": bson.M{"i_ts_guide": 1, fmt.Sprintf("%s.a_items", updateItems): bson.A{bson.M{"s_item": "未分类",
 				"a_key":        bson.A{bson.M{"key": bson.A{keys}, "matchway": matchWay}},
 				"l_modifydate": time.Now().Unix()}}}}); ok {
 				flag = "y"
@@ -717,7 +718,8 @@ func directSubKWS(updateItems string, keys string, userId string, session *https
 						},
 					},
 					"$set": bson.M{
-						updateItems + ".l_modifydate":                                        time.Now().Unix(),
+						"i_ts_guide":                  1,
+						updateItems + ".l_modifydate": time.Now().Unix(),
 						updateItems + ".a_items." + strconv.Itoa(classify_index) + ".s_item": classify_name,
 					},
 				})

+ 17 - 4
src/jfw/modules/subscribepay/src/config.json

@@ -176,9 +176,6 @@
       "weChatUrl": ""
     },
     "saleDep": {
-      "040000": true,
-      "040100": true,
-      "040200": true
     }
   },
   "payRaffle": {
@@ -218,5 +215,21 @@
   "orderEmailReminder": {
     "qmx": "duxin@topnet.net.cn",
     "jianyu": "duxin@topnet.net.cn"
-  }
+  },
+  "remindSubMsg": {
+    "open": true,
+    "siteMsg": {
+      "callPlatform": "subscribepay",
+      "msgType": 2,
+      "title": "订阅区域设置提醒",
+      "content": "您可点击前往设置订阅区域、关键词等条件,精准接收更多商机",
+      "link": "/page_workDesktop/work-bench/app/big/big_subscribe?vt=v",
+      "androidUrl": "/jyapp/vipsubscribe/toSubVipSetPage?vSwitch=v",
+      "iosUrl": "/jyapp/vipsubscribe/toSubVipSetPage?vSwitch=v",
+      "weChatUrl": "/front/sess/%s"
+    }
+  },
+  "wxProceduresMoney": 0.54,
+  "aliProceduresMoney": 0.6,
+  "corporateProceduresMoney": 0
 }

+ 21 - 2
src/jfw/modules/subscribepay/src/config/config.go

@@ -149,9 +149,28 @@ type config struct {
 			Name       string `json:"name"`
 		} `json:"activity"`
 	} `json:"payRaffle"`
-	NewOrderTime       int64             `json:"newOrderTime"`
-	OrderEmailReminder map[string]string `json:"orderEmailReminder"`
+	NewOrderTime             int64             `json:"newOrderTime"`
+	OrderEmailReminder       map[string]string `json:"orderEmailReminder"`
+	RemindSubMsg             SiteMsgStruct     `json:"remindSubMsg"` // p618 提醒超级订阅新购用户无免费设置被默认为北京的用户设置地区
+	WxProceduresMoney        float64           `json:"wxProceduresMoney"`
+	AliProceduresMoney       float64           `json:"aliProceduresMoney"`
+	CorporateProceduresMoney float64           `json:"corporateProceduresMoney"`
 }
+
+type SiteMsgStruct struct {
+	Open    bool `json:"open"`
+	SiteMsg struct {
+		CallPlatform string `json:"callPlatform"`
+		MsgType      int    `json:"msgType"`
+		Title        string `json:"title"`
+		Content      string `json:"content"`
+		Link         string `json:"link"`
+		AndroidUrl   string `json:"androidUrl"`
+		IosUrl       string `json:"iosUrl"`
+		WeChatUrl    string `json:"weChatUrl"`
+	} `json:"siteMsg"`
+}
+
 type mgoConf struct {
 	Address           string
 	Size              int

+ 1 - 1
src/jfw/modules/subscribepay/src/entity/dataReportStruct.go

@@ -149,7 +149,7 @@ func (this *dataReportStruct) FlushOrder(param frpc.JyPayOrderChangeParam) (stri
 	pay.CloseOrder(qutil.ObjToString((*res)["pay_way"]), qutil.ObjToString((*res)["out_trade_no"]))
 
 	//创建支付串
-	tradeno, prepayid, payParam, payErr := pay.CreateOrderPay(price, productSign, param.Ip, param.Openid, "", param.PayWay, param.OrderCode)
+	tradeno, prepayid, payParam, payErr := pay.CreateOrderPay(price, productSign, param.Ip, param.Openid, "", param.PayWay, param.OrderCode, 0)
 	if payErr != nil {
 		return "", payErr
 	}

+ 1 - 2
src/jfw/modules/subscribepay/src/entity/equityCode.go

@@ -578,7 +578,6 @@ func (e *EquityCode) ExchangeRecords() (*ExchangeRecords, error) {
 	return ers, nil
 }
 
-//
 func (e *EquityCode) Submit(codes []string, disChannel, productName, industryCode string, buyNum, number, timeType int) int {
 	_id, comAccountId, positionId, userId := e.CreateUser("权益码兑换创建用户", codes[0])
 	if _id == "" || comAccountId <= 0 || positionId <= 0 {
@@ -769,7 +768,7 @@ func (e *EquityCode) CreateUser(msg, miniprogramCode string) (string, int64, int
 				"s_phone":       e.Phone,
 			})
 			if _id != "" {
-				util.Mgo_log.Save("register_log", map[string]interface{}{
+				go util.Mgo_log.Save("register_log", map[string]interface{}{
 					"userid":      _id,
 					"phone":       e.Phone,
 					"way":         "equityCode",

+ 2 - 2
src/jfw/modules/subscribepay/src/entity/jyCourseOnlineStruct.go

@@ -137,7 +137,7 @@ func (this *jyCourseOnline) NewOrder(param frpc.JyPayOrderParam) (ordercode stri
 		}
 	}
 	//创建支付串
-	tradeno, prepayid, payParam, payErr := pay.CreateOrderPay(totalfee, productSign, param.Ip, param.Openid, "", param.PayWay, ordercode)
+	tradeno, prepayid, payParam, payErr := pay.CreateOrderPay(totalfee, productSign, param.Ip, param.Openid, "", param.PayWay, ordercode, 0)
 	if payErr != nil {
 		err = payErr
 		return
@@ -217,7 +217,7 @@ func (this *jyCourseOnline) FlushOrder(param frpc.JyPayOrderChangeParam) (string
 		return "", errors.New("查询金额异常" + param.OrderCode)
 	}
 	//创建支付串
-	tradeno, prepayid, payParam, payErr := pay.CreateOrderPay(price, productSign, param.Ip, param.Openid, "", param.PayWay, param.OrderCode)
+	tradeno, prepayid, payParam, payErr := pay.CreateOrderPay(price, productSign, param.Ip, param.Openid, "", param.PayWay, param.OrderCode, 0)
 	if payErr != nil {
 		return "", payErr
 	}

+ 1 - 0
src/jfw/modules/subscribepay/src/entity/order.go

@@ -932,6 +932,7 @@ func memberOrder(m map[string]interface{}, userId string, session *httpsession.S
 		"level":      level,
 		"source":     qu.ObjToString(m["source"]),
 		"createType": 1, //新购
+		"cycleType":  3,
 	}
 	filter, _ := json.Marshal(filter_map)
 	return &OrderInfo{

+ 21 - 14
src/jfw/modules/subscribepay/src/entity/payCommonEntity.go

@@ -13,27 +13,34 @@ import (
 // TakeEffectSale 销售业绩生效
 func TakeEffectSale(orderCode string, payMoney int) {
 	now := time.Now()
-
 	if !util.Mysql.ExecTx("销售业绩", func(tx *sql.Tx) bool {
 		res := util.Mysql.FindOne("order_sale_record", map[string]interface{}{
 			"ordercode": orderCode,
 		}, "state", "")
 		if res == nil || len(*res) == 0 {
+			//获取订单表下单渠道
+			var distribution_channel string = "x010"
+			if oMap := util.Mysql.FindOne("dataexport_order", map[string]interface{}{"order_code": orderCode}, "distribution_channel", ""); oMap != nil || len(*oMap) > 0 {
+				if t := gconv.String((*oMap)["distribution_channel"]); t != "" {
+					distribution_channel = t
+				}
+			}
 			//销售业绩
 			if util.Mysql.InsertByTx(tx, "order_sale_record", map[string]interface{}{
-				"state":           1,
-				"ordercode":       orderCode,
-				"saler_dept":      "运营部",
-				"saler_dept_id":   27103,
-				"saler_name":      "-",
-				"saler_Id":        -1,
-				"money":           payMoney,
-				"change_value":    payMoney,
-				"group_uuid":      uuid.New().String(),
-				"operator":        "系统自动",
-				"change_reason":   "回款成功",
-				"create_time":     FormatDate(&now, "2006-01-02 15:04:05"),
-				"statistics_time": FormatDate(&now, "2006-01-02 15:04:05"),
+				"state":                1,
+				"ordercode":            orderCode,
+				"saler_dept":           "运营部",
+				"saler_dept_id":        27103,
+				"saler_name":           "-",
+				"saler_Id":             -1,
+				"money":                payMoney,
+				"change_value":         payMoney,
+				"group_uuid":           uuid.New().String(),
+				"operator":             "系统自动",
+				"change_reason":        "回款成功",
+				"distribution_channel": distribution_channel,
+				"create_time":          FormatDate(&now, "2006-01-02 15:04:05"),
+				"statistics_time":      FormatDate(&now, "2006-01-02 15:04:05"),
 			}) <= 0 {
 				return false
 			}

+ 1 - 0
src/jfw/modules/subscribepay/src/entity/reWardStruct.go

@@ -26,6 +26,7 @@ func (r *reWardStruct) PayCallBack(param *CallBackParam) bool {
 		"product":        "",
 		"remark":         "用户打赏收入",
 		"source":         "qmx",
+		"originalAmount": param.TotalFee,
 	}
 	var (
 		filter, _ = json.Marshal(filterMap)

+ 68 - 0
src/jfw/modules/subscribepay/src/entity/returnMoney.go

@@ -0,0 +1,68 @@
+package entity
+
+import (
+	. "app.yhyue.com/moapp/jybase/date"
+	"github.com/gogf/gf/v2/util/gconv"
+	"jy/src/jfw/modules/subscribepay/src/pay"
+	"jy/src/jfw/modules/subscribepay/src/util"
+	"log"
+	"time"
+)
+
+// returnMoneyStruct管理后台回款
+type returnMoneyStruct struct{}
+
+var JyReturnMoneyStruct returnMoneyStruct
+
+func (m *returnMoneyStruct) PayCallBack(param *CallBackParam) bool {
+	now := time.Now()
+	if util.Mysql.Update("return_money_online", map[string]interface{}{
+		"out_trade_no": param.OutTradeno,
+		"status":       0,
+	}, map[string]interface{}{
+		"status":         1,
+		"pay_money":      param.CashFee,
+		"pay_time":       FormatDate(&now, Date_Full_Layout),
+		"transaction_id": param.TransactionId,
+	}) {
+		var orderCode string
+		if param.OrderCode != "" {
+			orderCode = param.OrderCode
+		} else {
+			if m := util.Mysql.FindOne("return_money_online", map[string]interface{}{
+				"out_trade_no": param.OutTradeno,
+			}, "order_code", ""); m != nil && len(*m) > 0 {
+				orderCode = gconv.String((*m)["order_code"])
+			}
+		}
+		if orderCode != "" {
+			go m.CloseOrder(orderCode)
+		}
+		return true
+	}
+	return false
+}
+
+// CloseOrder 关闭其他未支付的订单
+func (m *returnMoneyStruct) CloseOrder(orderOrder string) {
+	res := util.Mysql.Query("SELECT pay_way,out_trade_no FROM return_money_online WHERE status=0 and order_code=? and expire_time>?", orderOrder, time.Now().Format(time.DateTime))
+	util.Mysql.Update("return_money_online", map[string]interface{}{
+		"order_code": orderOrder,
+		"status":     0,
+	}, map[string]interface{}{
+		"status": -1,
+	})
+	if res != nil && len(*res) > 0 {
+		for _, m := range *res {
+			var (
+				pay_way      = gconv.String(m["pay_way"])
+				out_trade_no = gconv.String(m["out_trade_no"])
+				ok           bool
+			)
+			if pay.CloseOrder(out_trade_no, pay_way) {
+				ok = true
+			}
+			log.Printf("CloseReturnOrder 关闭支付 %s %s %v\n", orderOrder, out_trade_no, ok)
+		}
+	}
+}

+ 21 - 17
src/jfw/modules/subscribepay/src/entity/shareFission.go

@@ -35,12 +35,15 @@ func NewShareFission(userId, shareUid, newSource string) *ShareFission {
 
 // 活动赠送
 const (
-	SaleChannel051    = "x051"          // 销售渠道活动赠送
-	SaleChannel054    = "x054"          // 活动 新注册/绑定 订单
-	OrderPassed       = 3               // 订单审核状态-审核通过
-	TableAuditRecords = "audit_records" // 审核记录表
-	OperateCreate     = 1               // 审核轨迹操作类型-新增
-	AuditCreate       = 2               // 审核类型-创建订单
+	//销售渠道
+	SaleChannelDefault = "x051" // 销售渠道活动赠送
+	SaleChannel054     = "x054" // 活动 新注册/绑定 订单
+	//订单渠道
+	OrderChannelDefault = "xdqd06"
+	OrderPassed         = 3               // 订单审核状态-审核通过
+	TableAuditRecords   = "audit_records" // 审核记录表
+	OperateCreate       = 1               // 审核轨迹操作类型-新增
+	AuditCreate         = 2               // 审核类型-创建订单
 )
 
 var jianyubiReg = regexp.MustCompile(`达到(\d+)剑鱼币`)
@@ -105,14 +108,15 @@ types:订单类型  1: 仅延长周期  2: 开通权益
 func Order(userid, starttime, endtime string, types, dayNum int, remark, phone string) bool {
 	_, buyset, isvip := JyVipSubStruct.GetVipDetail(userid)
 	filter := VipSimpleMsg{
-		Area:       nil,
-		Industry:   nil,
-		NewBuyset:  buyset,
-		OrderType:  qu.IntAll(qu.If(isvip, 1, 5)),
-		Cycleunit:  3,
-		Cyclecount: dayNum,
-		Badge:      "give",
-		Remark:     remark,
+		Area:          nil,
+		Industry:      nil,
+		NewBuyset:     buyset,
+		OrderType:     qu.IntAll(qu.If(isvip, 1, 5)),
+		Cycleunit:     3,
+		Cyclecount:    dayNum,
+		Badge:         "give",
+		Remark:        remark,
+		ZeroOrderType: "赠送",
 	}
 	if types == 2 {
 		filter.Area = &map[string]interface{}{"北京": []string{}}
@@ -148,10 +152,10 @@ func Order(userid, starttime, endtime string, types, dayNum int, remark, phone s
 		"buy_subject":    buy_subject,
 		"ent_id":         entId,
 	}
+	insertMap["distribution_channel"] = SaleChannelDefault
+	insertMap["order_channel"] = OrderChannelDefault
 	// 如果备注为剑鱼币兑换
-	if jianyubiReg.MatchString(remark) {
-		insertMap["distribution_channel"] = SaleChannel051 // 销售渠道
-	} else if regOrBindReg.MatchString(remark) {
+	if regOrBindReg.MatchString(remark) {
 		insertMap["distribution_channel"] = SaleChannel054
 		insertMap["user_phone"] = phone
 	}

+ 41 - 2
src/jfw/modules/subscribepay/src/entity/subscribeVip.go

@@ -218,8 +218,9 @@ func (this *vipSubscribeStruct) PayCallBack(param *CallBackParam) bool {
 	//A.购买超级订阅前是免费用户:则区域默认为免费订阅区域,免费区域为空则默认为北京;
 	//B.购买超级订阅前是省份订阅包用户:则区域默认为省份订阅包区域,如超级订阅可订阅省份<省份订阅包可用省份,则随机展示省份订阅包的部分区域;
 	//C.购买超级订阅后,按照默认区域进行推送。
+	var isDefaultArea bool
 	if vmsg.OrderType == 1 { //新订单
-		vmsg.Area = getUserArea(userId, vmsg.NewBuyset.AreaCount) // 处理订阅区域
+		vmsg.Area, isDefaultArea = getUserArea(userId, vmsg.NewBuyset.AreaCount) // 处理订阅区域
 		flag = JyVipSubStruct.StartSubVip(userid, vmsg, startTime, endTime, false, positionType, entId, entUserId)
 	} else if vmsg.OrderType == 2 { //仅续费
 		flag = JyVipSubStruct.RenewSubVip(userid, qutil.ObjToString((*orderdata)["vip_endtime"]))
@@ -307,6 +308,41 @@ func (this *vipSubscribeStruct) PayCallBack(param *CallBackParam) bool {
 			}
 			equityActive.SendPayRaffleMsg()
 		}
+		if config.Config.RemindSubMsg.Open && isDefaultArea { // p618
+			// 取mgoid 判断订单里的id是不是mgo 不是的话,取缓存中的信息  如果取到mgoid再发消息
+			mgoUid := ""
+			if mgo.IsObjectIdHex(userId) {
+				mgoUid = userId
+			} else {
+				orderKey := fmt.Sprintf("order_%s", orderCode)
+				rs := redis.Get("other", orderKey)
+				info := qutil.ObjToMap(rs)
+				if info != nil && len(*info) > 0 {
+					log.Println("RemindSubMsg 获取到redis保存的用户身份信息:", orderKey, info)
+					mgoUid = qutil.ObjToString((*info)["mgoId"])
+				}
+			}
+			if mgoUid != "" {
+				siteMsg := config.Config.RemindSubMsg.SiteMsg
+				sessData := fmt.Sprintf("%s,_id,%s,subVipSetPage", mgoUid, now)
+
+				weChatUrl := fmt.Sprintf(siteMsg.WeChatUrl, util.Se_Topnet.EncodeString(sessData))
+				// 发送站内信
+				p := util.MessageParam{
+					UserIds:    mgoUid,
+					Title:      siteMsg.Title,
+					Content:    siteMsg.Content,
+					MsgType:    siteMsg.MsgType,
+					SendMode:   2,
+					Link:       siteMsg.Link,
+					IosUrl:     siteMsg.IosUrl,
+					AndroidUrl: siteMsg.AndroidUrl,
+					WeChatUrl:  weChatUrl,
+				}
+
+				util.EquityActiveSend.SendStationMessages(p)
+			}
+		}
 
 	}
 	return flag
@@ -315,7 +351,8 @@ func (this *vipSubscribeStruct) PayCallBack(param *CallBackParam) bool {
 // 获取用户设置的区域
 // A.购买超级订阅前是免费用户:则区域默认为免费订阅区域,免费区域为空则默认为北京;
 // B.购买超级订阅前是省份订阅包用户:则区域默认为省份订阅包区域,如超级订阅可订阅省份<省份订阅包可用省份,则随机展示省份订阅包的部分区域;
-func getUserArea(userId string, areaCount int) (area *map[string]interface{}) {
+// isDefaultArea 是否是默认的区域  true:是
+func getUserArea(userId string, areaCount int) (area *map[string]interface{}, isDefaultArea bool) {
 	if areaCount == -1 {
 		area = &map[string]interface{}{}
 		return
@@ -347,7 +384,9 @@ func getUserArea(userId string, areaCount int) (area *map[string]interface{}) {
 	o_area := qutil.ObjToMap((*ojy)["o_area"])
 	if o_area != nil && len(*o_area) > 0 {
 		area = o_area
+		return
 	}
+	isDefaultArea = true // 默认的区域
 	return
 }
 

+ 2 - 0
src/jfw/modules/subscribepay/src/go.mod

@@ -101,11 +101,13 @@ require (
 	github.com/spf13/pflag v1.0.5 // indirect
 	github.com/spf13/viper v1.15.0 // indirect
 	github.com/subosito/gotenv v1.4.2 // indirect
+	github.com/thinxer/go-word2vec v0.0.0-20150917053916-5c19ec7379ed // indirect
 	github.com/xdg-go/pbkdf2 v1.0.0 // indirect
 	github.com/xdg-go/scram v1.1.2 // indirect
 	github.com/xdg-go/stringprep v1.0.4 // indirect
 	github.com/youmark/pkcs8 v0.0.0-20201027041543-1326539a0a0a // indirect
 	github.com/zeromicro/go-zero v1.6.4 // indirect
+	github.com/ziutek/blas v0.0.0-20190227122918-da4ca23e90bb // indirect
 	go.etcd.io/etcd/api/v3 v3.5.13 // indirect
 	go.etcd.io/etcd/client/pkg/v3 v3.5.13 // indirect
 	go.etcd.io/etcd/client/v3 v3.5.13 // indirect

+ 4 - 0
src/jfw/modules/subscribepay/src/go.sum

@@ -1724,6 +1724,8 @@ github.com/subosito/gotenv v1.4.2 h1:X1TuBLAMDFbaTAChgCBLu3DU3UPyELpnF2jjJ2cz/S8
 github.com/subosito/gotenv v1.4.2/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0=
 github.com/tealeg/xlsx v1.0.5 h1:+f8oFmvY8Gw1iUXzPk+kz+4GpbDZPK1FhPiQRd+ypgE=
 github.com/tealeg/xlsx v1.0.5/go.mod h1:btRS8dz54TDnvKNosuAqxrM1QgN1udgk9O34bDCnORM=
+github.com/thinxer/go-word2vec v0.0.0-20150917053916-5c19ec7379ed h1:1+oKuPuDQ4AbN1WRMFxl9WQClH80GuZ81X/4FsOshjI=
+github.com/thinxer/go-word2vec v0.0.0-20150917053916-5c19ec7379ed/go.mod h1:WE5pZgSp3RwicfhHQmOJOexA0n4AKTzBqmnSu7R8Nbk=
 github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk=
 github.com/tklauser/go-sysconf v0.3.10/go.mod h1:C8XykCvCb+Gn0oNCWPIlcb0RuglQTYaQ2hGm7jmxEFk=
 github.com/tklauser/numcpus v0.4.0/go.mod h1:1+UI3pD8NW14VMwdgJNJ1ESk2UnwhAnz5hMwiKKqXCQ=
@@ -1772,6 +1774,8 @@ github.com/zeromicro/go-zero v1.5.5/go.mod h1:AGCspTFitHzYjl5ddAmYWLfdt341+Brhef
 github.com/zeromicro/go-zero v1.5.6/go.mod h1:FX2a2MQd5EvAYO7neJBm2GAmPU5XfFnj3JMM/qj+kpY=
 github.com/zeromicro/go-zero v1.6.4 h1:GvZXxxwl1Lby/gIHxHwN/ZNmXl1WFJa1DvoVgqgttUs=
 github.com/zeromicro/go-zero v1.6.4/go.mod h1:dQ39Zoz20/6x/SUhFXyEEg8lWjl+CO3dzg8Je2xG63Q=
+github.com/ziutek/blas v0.0.0-20190227122918-da4ca23e90bb h1:uWiILQloLUVdtPYr1ZZo2zqtlpzo4G8vUpglo/Fs2H8=
+github.com/ziutek/blas v0.0.0-20190227122918-da4ca23e90bb/go.mod h1:J3xKssoVdrwZ2E29fIox/EKxOZWimS7AZ4fOTCFkOLo=
 github.com/ziutek/mymysql v1.5.4/go.mod h1:LMSpPZ6DbqWFxNCHW77HeMg9I646SAhApZ/wKdgO/C0=
 go.etcd.io/etcd/api/v3 v3.5.2/go.mod h1:5GB2vv4A4AOn3yk7MftYGHkUfGtDHnEraIjym4dYz5A=
 go.etcd.io/etcd/api/v3 v3.5.4/go.mod h1:5GB2vv4A4AOn3yk7MftYGHkUfGtDHnEraIjym4dYz5A=

+ 33 - 17
src/jfw/modules/subscribepay/src/pay/aliPay.go

@@ -90,22 +90,23 @@ const (
 	ALI_DATAREPORT_APP    = "X" //支付宝数据报告-app支付
 	ALI_DATAREPORT_NATIVE = "x" //支付宝数据报告-扫码支付
 
-	ALI_SUBVIP_NATIVE         = "y"  //支付宝vip订阅-扫码支付
-	ALI_SUBVIP_APP            = "Y"  //支付宝数vip订阅--扫码支付
-	ALI_COURSE_NATIVE         = "v"  //剑鱼招投标课程-扫码支付
-	ALI_COURSE_APP            = "V"  //剑鱼招投标课程-app支付
-	ALI_ENTNICHE_APP          = "U"  //支付宝企业商机管理--app支付
-	ALI_ENTNICHE_NATIVE       = "u"  //支付宝企业商机管理--pc支付
-	ALI_COURSEONLINE_NATIVE   = "t"  //剑鱼线上课程-扫码支付
-	ALI_COURSEONLINE_APP      = "T"  //剑鱼线上课程-app支付
-	ALI_MEMBER_NATIVE         = "s"  //剑鱼大会员-扫码支付
-	ALI_MEMBER_APP            = "S"  //剑鱼大会员-扫码支付
-	ALI_AIFORECASTPACK_NATIVE = "r"  //剑鱼大会员-ai中标预测包-扫码支付
-	ALI_AIFORECASTPACK_APP    = "R"  //剑鱼大会员-ai中标预测包-扫码支付
-	ALI_BIDFILE_NATIVE        = "q"  //招标文件解读扫码支付
-	ALI_BIDFILE_APP           = "Q"  //招标文件解读app支付
-	ALI_INTEGRAL_NATIVE       = "aa" //剑鱼币扫码支付
-	ALI_INTEGRAL_APP          = "AB" //剑鱼币app支付
+	ALI_SUBVIP_NATIVE         = "y"   //支付宝vip订阅-扫码支付
+	ALI_SUBVIP_APP            = "Y"   //支付宝数vip订阅--扫码支付
+	ALI_COURSE_NATIVE         = "v"   //剑鱼招投标课程-扫码支付
+	ALI_COURSE_APP            = "V"   //剑鱼招投标课程-app支付
+	ALI_ENTNICHE_APP          = "U"   //支付宝企业商机管理--app支付
+	ALI_ENTNICHE_NATIVE       = "u"   //支付宝企业商机管理--pc支付
+	ALI_COURSEONLINE_NATIVE   = "t"   //剑鱼线上课程-扫码支付
+	ALI_COURSEONLINE_APP      = "T"   //剑鱼线上课程-app支付
+	ALI_MEMBER_NATIVE         = "s"   //剑鱼大会员-扫码支付
+	ALI_MEMBER_APP            = "S"   //剑鱼大会员-扫码支付
+	ALI_AIFORECASTPACK_NATIVE = "r"   //剑鱼大会员-ai中标预测包-扫码支付
+	ALI_AIFORECASTPACK_APP    = "R"   //剑鱼大会员-ai中标预测包-扫码支付
+	ALI_BIDFILE_NATIVE        = "q"   //招标文件解读扫码支付
+	ALI_BIDFILE_APP           = "Q"   //招标文件解读app支付
+	ALI_INTEGRAL_NATIVE       = "aa"  //剑鱼币扫码支付
+	ALI_INTEGRAL_APP          = "AB"  //剑鱼币app支付
+	ALI_RETURN_NATIVE         = "art" //管理后台扫码回款
 
 	/*新命名规范
 	  Ali 「app支付」 ali 「pc扫码支付」
@@ -168,6 +169,8 @@ func (w *aliPayStruct) GetTradeno(tradenoSign string, productType ...string) (st
 			t = fmt.Sprintf("剑鱼标讯-%s", productType[0])
 		}
 		subject = t
+	} else {
+		subject = "剑鱼标讯"
 	}
 
 	lenRandom := 6 - len([]rune(tradenoSign)) //控制长度
@@ -177,7 +180,7 @@ func (w *aliPayStruct) GetTradeno(tradenoSign string, productType ...string) (st
 }
 
 // 获取网页支付二维码地址
-func (a *aliPayStruct) GetOrderPayParam(order_money float64, tradenoSign string, msg ...string) (string, string, error) {
+func (a *aliPayStruct) GetOrderPayParam(order_money float64, tradenoSign string, timeExpire int64, msg ...string) (string, string, error) {
 	//测试环境,1分钱
 	if config.Config.AllPayMoney > 0 {
 		order_money = float64(config.Config.AllPayMoney)
@@ -200,6 +203,12 @@ func (a *aliPayStruct) GetOrderPayParam(order_money float64, tradenoSign string,
 			ProductCode:    "QUICK_MSECURITY_PAY",
 			TimeoutExpress: "2h",
 		}
+
+		if timeExpire > 0 {
+			if now := time.Now().Unix(); timeExpire > now {
+				bizContent.TimeoutExpress = fmt.Sprintf("%dh", (timeExpire-now)/(60*60))
+			}
+		}
 		bizByte, _ = json.Marshal(bizContent)
 		methodStr = Method_Type_Create_App
 	} else { //扫码支付
@@ -220,6 +229,13 @@ func (a *aliPayStruct) GetOrderPayParam(order_money float64, tradenoSign string,
 			Qrcode_width:   250,
 			TimeoutExpress: "2h",
 		}
+
+		if timeExpire > 0 {
+			if now := time.Now().Unix(); timeExpire > now {
+				bizContent.TimeoutExpress = fmt.Sprintf("%dh", (timeExpire-now)/(60*60))
+			}
+		}
+
 		bizByte, _ = json.Marshal(bizContent)
 		methodStr = Method_Type_Create_Pc
 	}

+ 3 - 3
src/jfw/modules/subscribepay/src/pay/util.go

@@ -267,7 +267,7 @@ payWay 支付方式
 
 ⚠️ 需缓存tradeno
 */
-func CreateOrderPay(price int, productSign, ip, openid, appid, payWay, orderCode string, msg ...string) (tradeno, prepayid, payParam string, err error) {
+func CreateOrderPay(price int, productSign, ip, openid, appid, payWay, orderCode string, timeExpire int64, msg ...string) (tradeno, prepayid, payParam string, err error) {
 	var detailMsg string
 	if len(msg) > 0 {
 		detailMsg = msg[0]
@@ -276,7 +276,7 @@ func CreateOrderPay(price int, productSign, ip, openid, appid, payWay, orderCode
 	case "wx_js", "wx_app", "wx_pc": //微信公众号支付,微信app支付,微信扫码支付
 		var ret *map[string]string
 
-		tradeno, ret = WxStruct.CreatePrepayOrder(productSign, ip, openid, appid, detailMsg, price)
+		tradeno, ret = WxStruct.CreatePrepayOrder(productSign, ip, openid, appid, detailMsg, price, timeExpire)
 		log.Println(tradeno, ret)
 		if ret == nil {
 			err = errors.New("创建异常")
@@ -301,7 +301,7 @@ func CreateOrderPay(price int, productSign, ip, openid, appid, payWay, orderCode
 			payParam = (*ret)["codeurl"]
 		}
 	case "ali_app", "ali_pc": //支付宝app支付,支付宝扫码支付
-		payParam, tradeno, err = Alipay.GetOrderPayParam(qutil.Float64All(price), productSign, detailMsg)
+		payParam, tradeno, err = Alipay.GetOrderPayParam(qutil.Float64All(price), productSign, timeExpire, detailMsg)
 		if err != nil {
 			err = errors.New("创建支付宝订单出错")
 			return

+ 44 - 35
src/jfw/modules/subscribepay/src/pay/wxPay.go

@@ -13,36 +13,37 @@ import (
 )
 
 const (
-	WX_REWARD_JSAPI          = "a"  //微信打赏
-	WX_DATAEXPORT_NATIVE     = "b"  //数据导出-扫码支付
-	WX_DATAEXPORT_JSAPI      = "c"  //数据导出-微信js支付
-	WX_DATAEXPORT_APP        = "C"  //数据导出-微信app支付
-	WX_DATAREPORT_JSAPI      = "d"  //数据报告-微信js支付
-	WX_DATAREPORT_APP        = "D"  //数据报告-微信app支付
-	WX_SUBVIP_JSAPI          = "e"  //VIP订阅-js支付
-	WX_SUBVIP_APP            = "E"  //VIP订阅-APP支付
-	WX_COURSE_JSAPI          = "f"  //剑鱼招投标课程-js支付
-	WX_COURSE_APP            = "F"  //剑鱼招投标课程-APP支付
-	WX_COURSE_NATIVE         = "g"  //剑鱼招投标课程-扫码支付
-	WX_ENTNICHE_APP          = "H"  //企业商机管理-APP支付
-	WX_COURSEONLINE_JSAPI    = "i"  //课程线上课程-js支付
-	WX_COURSEONLINE_APP      = "I"  //剑鱼线上课程-APP支付
-	WX_COURSEONLINE_NATIVE   = "j"  //剑鱼线上课程-扫码支付
-	WX_DATAREPORT_NATIVE     = "k"  //数据报告-扫码支付
-	WX_SUBVIP_NATIVE         = "l"  //VIP订阅-扫码支付
-	WX_ENTNICHE_NATIVE       = "m"  //商机管理-pc支付
-	WX_MEMBER_JSAPI          = "n"  //大会员-微信js支付
-	WX_MEMBER_APP            = "N"  //大会员-APP支付
-	WX_MEMBER_NATIVE         = "o"  //大会员-PC支付
-	WX_AIFORECASTPACK_JSAPI  = "P"  //大会员-AI中标预测包-微信js支付
-	WX_AIFORECASTPACK_APP    = "p"  //大会员-AI中标预测包-APP支付
-	WX_AIFORECASTPACK_NATIVE = "q"  //大会员-AI中标预测包-PC支付
-	WX_BIDFILE_JSAPI         = "R"  //招标文件解读-微信js支付
-	WX_BIDFILE_APP           = "r"  //招标文件解读-APP支付
-	WX_BIDFILE_NATIVE        = "S"  //招标文件解读-PC支付
-	WX_INTEGRAL_JSAPI        = "AA" //剑鱼币-微信js支付
-	WX_INTEGRAL_APP          = "AB" //剑鱼币-APP支付
-	WX_INTEGRAL_NATIVE       = "AC" //剑鱼币-PC支付
+	WX_REWARD_JSAPI          = "a"   //微信打赏
+	WX_DATAEXPORT_NATIVE     = "b"   //数据导出-扫码支付
+	WX_DATAEXPORT_JSAPI      = "c"   //数据导出-微信js支付
+	WX_DATAEXPORT_APP        = "C"   //数据导出-微信app支付
+	WX_DATAREPORT_JSAPI      = "d"   //数据报告-微信js支付
+	WX_DATAREPORT_APP        = "D"   //数据报告-微信app支付
+	WX_SUBVIP_JSAPI          = "e"   //VIP订阅-js支付
+	WX_SUBVIP_APP            = "E"   //VIP订阅-APP支付
+	WX_COURSE_JSAPI          = "f"   //剑鱼招投标课程-js支付
+	WX_COURSE_APP            = "F"   //剑鱼招投标课程-APP支付
+	WX_COURSE_NATIVE         = "g"   //剑鱼招投标课程-扫码支付
+	WX_ENTNICHE_APP          = "H"   //企业商机管理-APP支付
+	WX_COURSEONLINE_JSAPI    = "i"   //课程线上课程-js支付
+	WX_COURSEONLINE_APP      = "I"   //剑鱼线上课程-APP支付
+	WX_COURSEONLINE_NATIVE   = "j"   //剑鱼线上课程-扫码支付
+	WX_DATAREPORT_NATIVE     = "k"   //数据报告-扫码支付
+	WX_SUBVIP_NATIVE         = "l"   //VIP订阅-扫码支付
+	WX_ENTNICHE_NATIVE       = "m"   //商机管理-pc支付
+	WX_MEMBER_JSAPI          = "n"   //大会员-微信js支付
+	WX_MEMBER_APP            = "N"   //大会员-APP支付
+	WX_MEMBER_NATIVE         = "o"   //大会员-PC支付
+	WX_AIFORECASTPACK_JSAPI  = "P"   //大会员-AI中标预测包-微信js支付
+	WX_AIFORECASTPACK_APP    = "p"   //大会员-AI中标预测包-APP支付
+	WX_AIFORECASTPACK_NATIVE = "q"   //大会员-AI中标预测包-PC支付
+	WX_BIDFILE_JSAPI         = "R"   //招标文件解读-微信js支付
+	WX_BIDFILE_APP           = "r"   //招标文件解读-APP支付
+	WX_BIDFILE_NATIVE        = "S"   //招标文件解读-PC支付
+	WX_INTEGRAL_JSAPI        = "AA"  //剑鱼币-微信js支付
+	WX_INTEGRAL_APP          = "AB"  //剑鱼币-APP支付
+	WX_INTEGRAL_NATIVE       = "AC"  //剑鱼币-PC支付
+	WX_RETURN_NATIVE         = "WRT" //管理后台微信回款-js支付
 
 	/*新命名规范
 	  A 「ali阿里支付宝支付」 W 「wx微信支付」
@@ -140,7 +141,7 @@ func (w *WeixinStruct) GetTradeno(tp string) string {
 }
 
 // tradeno a:打赏 b:pc端数据导出 c:移动端微信数据导出 C:app数据导出  d:微信端数据报告 D:app端数据报告
-func (w *WeixinStruct) CreatePrepayOrder(tradeno, ip, openid, appid, detailmsg string, totalfee int) (string, *map[string]string) {
+func (w *WeixinStruct) CreatePrepayOrder(tradeno, ip, openid, appid, detailmsg string, totalfee int, expire int64) (string, *map[string]string) {
 	defer util.Catch()
 	//测试环境,1分钱
 	if config.Config.AllPayMoney > 0 {
@@ -156,7 +157,7 @@ func (w *WeixinStruct) CreatePrepayOrder(tradeno, ip, openid, appid, detailmsg s
 	attachmsg, bodymsg, detailmsg = w.getPayShwoMsg(tradeno, detailmsg)
 	//支付类型分类
 	tradeType := ""
-	if tradeno == WX_REWARD_JSAPI || tradeno == WX_DATAEXPORT_JSAPI || tradeno == WX_DATAREPORT_JSAPI || tradeno == WX_SUBVIP_JSAPI || tradeno == WX_COURSE_JSAPI || tradeno == WX_COURSEONLINE_JSAPI || tradeno == WX_MEMBER_JSAPI || tradeno == WX_AIFORECASTPACK_JSAPI || tradeno == WX_BIDFILE_JSAPI || tradeno == WX_INTEGRAL_JSAPI || tradeno == WX_DATAPACK_JSAIP || tradeno == WX_AREAPACK_JSAPI || tradeno == WX_FILEPACK_JSAPI || tradeno == WX_BUYERPORTRAITPACK_JSAPI || tradeno == WX_DOCMEMBER_JSAPI || tradeno == WX_DENRISPRODUCT || tradeno == WX_PDFEXPORT_JSAPI { //微信js支付
+	if tradeno == WX_REWARD_JSAPI || tradeno == WX_DATAEXPORT_JSAPI || tradeno == WX_DATAREPORT_JSAPI || tradeno == WX_SUBVIP_JSAPI || tradeno == WX_COURSE_JSAPI || tradeno == WX_COURSEONLINE_JSAPI || tradeno == WX_MEMBER_JSAPI || tradeno == WX_AIFORECASTPACK_JSAPI || tradeno == WX_BIDFILE_JSAPI || tradeno == WX_INTEGRAL_JSAPI || tradeno == WX_DATAPACK_JSAIP || tradeno == WX_AREAPACK_JSAPI || tradeno == WX_FILEPACK_JSAPI || tradeno == WX_BUYERPORTRAITPACK_JSAPI || tradeno == WX_DOCMEMBER_JSAPI || tradeno == WX_DENRISPRODUCT || tradeno == WX_PDFEXPORT_JSAPI || tradeno == WX_RETURN_NATIVE { //微信js支付
 		tradeType = "JSAPI"
 	} else if tradeno == WX_DATAEXPORT_APP || tradeno == WX_DATAREPORT_APP || tradeno == WX_SUBVIP_APP || tradeno == WX_COURSE_APP || tradeno == WX_ENTNICHE_APP || tradeno == WX_COURSEONLINE_APP || tradeno == WX_MEMBER_APP || tradeno == WX_AIFORECASTPACK_APP || tradeno == WX_BIDFILE_APP || tradeno == WX_INTEGRAL_APP || tradeno == WX_DATAPACK_APP || tradeno == WX_AREAPACK_APP || tradeno == WX_FILEPACK_APP || tradeno == WX_BUYERPORTRAITPACK_APP || tradeno == WX_DOCMEMBER_APP || tradeno == WX_PDFEXPORT_APP { //app支付
 		tradeType = "APP"
@@ -172,8 +173,7 @@ func (w *WeixinStruct) CreatePrepayOrder(tradeno, ip, openid, appid, detailmsg s
 			openid = oid.(string)
 		}
 	}
-	//获取预订单号
-	ret, err := w.GetPrepayId(config.Config.Weixinrpc, map[string]string{
+	param := map[string]string{
 		"attachmsg":  attachmsg,
 		"bodymsg":    bodymsg,
 		"detailmsg":  detailmsg,
@@ -186,7 +186,16 @@ func (w *WeixinStruct) CreatePrepayOrder(tradeno, ip, openid, appid, detailmsg s
 		"notifyUrl":  notifyUrl,
 		"appid":      appid,
 		"tradeType":  tradeType, //NATIVE JSAPI APP
-	})
+	}
+
+	if expire > 0 {
+		if expireTime := time.Unix(expire, 0); expireTime.After(time.Now()) {
+			param["time_expire"] = expireTime.Format("20060102150405")
+		}
+	}
+
+	//获取预订单号
+	ret, err := w.GetPrepayId(config.Config.Weixinrpc, param)
 	if err != nil {
 		log.Println("GetPrepayId err", err)
 	}

+ 69 - 0
src/jfw/modules/subscribepay/src/rpcfollow/returnMoney.go

@@ -0,0 +1,69 @@
+package rpcfollow
+
+import (
+	. "app.yhyue.com/moapp/jybase/date"
+	"jy/src/jfw/modules/subscribepay/src/entity"
+	"jy/src/jfw/modules/subscribepay/src/pay"
+	"jy/src/jfw/modules/subscribepay/src/util"
+	"log"
+	"time"
+)
+
+type ReturnRecordParam struct {
+	OrderCode       string `json:"orderCode"`
+	Price           int    `json:"price"`
+	PayWay          int    `json:"payWay"` //1微信 2支付宝
+	ExpireTimeStamp int64  `json:"expireTimeStamp"`
+}
+
+// CreateReturnRecord 管理后台-微信支付宝回款
+func (this *JyPayRpc) CreateReturnRecord(param *ReturnRecordParam, ret *string) error {
+	defer func() {
+		log.Printf("线下支付结果 %s ,参数 %+v \v", *ret, param)
+	}()
+
+	var (
+		payWay            string
+		tradeno, payParam string
+		err               error
+	)
+	switch param.PayWay {
+	case 1:
+		payWay = "wx_pc"
+		tradeno, _, payParam, err = pay.CreateOrderPay(param.Price, pay.WX_RETURN_NATIVE, "", "", "", payWay, param.OrderCode, param.ExpireTimeStamp)
+		if err != nil {
+			return err
+		}
+		*ret = payParam
+	case 2:
+		payWay = "ali_pc"
+		tradeno, _, payParam, err = pay.CreateOrderPay(param.Price, pay.ALI_RETURN_NATIVE, "", "", "", payWay, param.OrderCode, param.ExpireTimeStamp)
+		if err != nil {
+			return err
+		}
+		*ret = payParam
+	}
+	//保存数据库
+	now := time.Now()
+	if id := util.Mysql.Insert("return_money_online", map[string]interface{}{
+		"status":       0,
+		"order_code":   param.OrderCode,
+		"pay_param":    payParam,
+		"return_money": param.Price,
+		"out_trade_no": tradeno,
+		"pay_way":      payWay,
+		"expire_time":  time.Unix(param.ExpireTimeStamp, 0).Format(Date_Full_Layout),
+		"creat_time":   FormatDate(&now, Date_Full_Layout),
+	}); id <= 0 {
+		return err
+	}
+	return nil
+}
+
+func (this *JyPayRpc) CloseReturnOrder(orderCode *string, ret *string) error {
+	defer func() {
+		log.Printf("CloseReturnOrder 关闭支付失败 %s \v", *orderCode)
+	}()
+	entity.JyReturnMoneyStruct.CloseOrder(*orderCode)
+	return nil
+}

+ 155 - 28
src/jfw/modules/subscribepay/src/service/commonAction.go

@@ -3,17 +3,20 @@ package service
 import (
 	. "app.yhyue.com/moapp/jybase/api"
 	. "app.yhyue.com/moapp/jybase/date"
+	"app.yhyue.com/moapp/jypkg/public"
 	"database/sql"
 	"encoding/base64"
 	"encoding/json"
 	"errors"
 	"fmt"
+	"github.com/gogf/gf/v2/util/gconv"
 	"github.com/google/uuid"
 	"jy/src/jfw/modules/subscribepay/src/config"
 	"jy/src/jfw/modules/subscribepay/src/entity"
 	"jy/src/jfw/modules/subscribepay/src/pay"
 	"jy/src/jfw/modules/subscribepay/src/util"
 	"log"
+	"math"
 	"net/rpc"
 	"regexp"
 	"strconv"
@@ -31,16 +34,18 @@ import (
 // 付费公用方法
 type CommonAction struct {
 	*xweb.Action
-	getwxSdkSign         xweb.Mapper `xweb:"/wx/getwxSdkSign"`             //微信js参数
-	getDomain            xweb.Mapper `xweb:"/getDomain"`                   //微信js参数
-	getCommonOrderPrice  xweb.Mapper `xweb:"/common/getOrderPrice"`        //获取订单价格
-	getCommonPayParam    xweb.Mapper `xweb:"/common/getPayParam"`          //公共获取支付方法
-	saveTransferAccounts xweb.Mapper `xweb:"/common/saveTransferAccounts"` //公共对公转账接口
-	isPaySuccess         xweb.Mapper `xweb:"/isPaySuccess"`                //是否支付成功
-	deleteOrder          xweb.Mapper `xweb:"/deleteOrder"`                 //删除订单
-	applyInvoice         xweb.Mapper `xweb:"/applyInvoice"`                //申请发票
-	sendMailNote         xweb.Mapper `xweb:"/sendMailNote/(.*)"`           //发送附件邮件通知
-	createorder          xweb.Mapper `xweb:"/common/createorder"`          //创建订单公共方法
+	getwxSdkSign         xweb.Mapper `xweb:"/wx/getwxSdkSign"`                 //微信js参数
+	getDomain            xweb.Mapper `xweb:"/getDomain"`                       //微信js参数
+	getCommonOrderPrice  xweb.Mapper `xweb:"/common/getOrderPrice"`            //获取订单价格
+	getCommonPayParam    xweb.Mapper `xweb:"/common/getPayParam"`              //公共获取支付方法
+	saveTransferAccounts xweb.Mapper `xweb:"/common/saveTransferAccounts"`     //公共对公转账接口
+	isPaySuccess         xweb.Mapper `xweb:"/isPaySuccess"`                    //是否支付成功
+	deleteOrder          xweb.Mapper `xweb:"/deleteOrder"`                     //删除订单
+	applyInvoice         xweb.Mapper `xweb:"/applyInvoice"`                    //申请发票
+	sendMailNote         xweb.Mapper `xweb:"/sendMailNote/(.*)"`               //发送附件邮件通知
+	createorder          xweb.Mapper `xweb:"/common/createorder"`              //创建订单公共方法
+	getWxReturnPayParam  xweb.Mapper `xweb:"/free/common/getWxReturnPayParam"` //获取微信回款支付参数
+	getReturnResult      xweb.Mapper `xweb:"/free/common/getReturnResult"`     //获取微信回款结果
 }
 
 var pdfNameReg = regexp.MustCompilePOSIX(`[^//]*\.pdf`)
@@ -389,7 +394,7 @@ func (this *CommonAction) GetCommonPayParam() {
 		if !ok {
 			return &entity.FuncResult{false, errors.New("未知支付类型:" + payway_req), nil}
 		}
-		tradeno, prepayid, payParam, err := pay.CreateOrderPay(totalfee, productFlag, this.IP(), qutil.ObjToString(this.GetSession("s_m_openid")), "", payway_req, orderCode, product_type)
+		tradeno, prepayid, payParam, err := pay.CreateOrderPay(totalfee, productFlag, this.IP(), qutil.ObjToString(this.GetSession("s_m_openid")), "", payway_req, orderCode, 0, product_type)
 		if err != nil {
 			return &entity.FuncResult{false, errors.New(fmt.Sprintf("创建支付失败[%v]", err)), nil}
 		}
@@ -442,7 +447,7 @@ func (this *CommonAction) SaveTransferAccounts() {
 			return &entity.FuncResult{false, errors.New("上传图片异常"), nil}
 		}
 		query := map[string]interface{}{"order_code": orderCode, "user_id": userId}
-		rSearch := util.Mysql.FindOne("dataexport_order", query, "order_channel,order_status,product_type,filter,course_status,out_trade_no,pay_way,create_time,order_code,user_phone", "")
+		rSearch := util.Mysql.FindOne("dataexport_order", query, "order_channel,order_status,product_type,filter,course_status,out_trade_no,pay_way,create_time,order_code,user_phone,order_money", "")
 		if rSearch == nil || len(*rSearch) == 0 {
 			return &entity.FuncResult{false, errors.New("未查到订单数据"), nil}
 		}
@@ -461,17 +466,17 @@ func (this *CommonAction) SaveTransferAccounts() {
 		}
 		mapTmp["transferV"] = transferV
 		mapTmp["transferVTime"] = time.Now().Format(Date_Full_Layout)
-
+		mapTmp["originalAmount"] = (*rSearch)["order_money"]
 		finalStr, err := json.Marshal(mapTmp)
 		if err != nil || string(filterStr) == "" {
 			return &entity.FuncResult{false, errors.New("存储失败"), nil}
 		}
 		//保存更新filter--end
-
 		saveFlag := util.Mysql.Update("dataexport_order", query, map[string]interface{}{
-			"course_status": 2, //公对公转账审核中----
-			"pay_way":       "transferAccounts",
-			"filter":        string(finalStr),
+			"course_status":    2, //公对公转账审核中----
+			"pay_way":          "transferAccounts",
+			"procedures_money": math.Round(qutil.Float64All((*rSearch)["order_money"]) * config.Config.CorporateProceduresMoney / 100),
+			"filter":           string(finalStr),
 		})
 
 		if !saveFlag {
@@ -631,17 +636,18 @@ func (this *CommonAction) Createorder() {
 			}
 			//销售业绩
 			if util.Mysql.InsertByTx(tx, "order_sale_record", map[string]interface{}{
-				"state":         2,
-				"ordercode":     inserMap.OrderCode,
-				"saler_dept":    "运营部",
-				"saler_dept_id": 27103,
-				"saler_name":    "-",
-				"saler_Id":      -1,
-				"change_value":  inserMap.OrderMoney,
-				"money":         inserMap.OrderMoney,
-				"group_uuid":    uuid.New().String(),
-				"operator":      "系统自动",
-				"create_time":   FormatDate(&now, Date_Full_Layout),
+				"state":                2,
+				"ordercode":            inserMap.OrderCode,
+				"saler_dept":           "运营部",
+				"saler_dept_id":        27103,
+				"saler_name":           "-",
+				"saler_Id":             -1,
+				"change_value":         inserMap.OrderMoney,
+				"money":                inserMap.OrderMoney,
+				"group_uuid":           uuid.New().String(),
+				"operator":             "系统自动",
+				"distribution_channel": distributionChannel,
+				"create_time":          FormatDate(&now, Date_Full_Layout),
 			}) <= 0 {
 				return false
 			}
@@ -725,3 +731,124 @@ func (this *CommonAction) Createorder() {
 	//创建完订单后更新卡券信息
 	this.ServeJson(NewResult(rData, errMsg))
 }
+
+func (this *CommonAction) GetWxReturnPayParam() {
+	var (
+		token     = this.GetString("token")
+		payWayReq = this.GetString("pay_way")
+	)
+	rData, errMsg := func() (interface{}, error) {
+		if !(payWayReq == "wx_js" || payWayReq == "ali_pc") {
+			return nil, fmt.Errorf("未知支付方式")
+		}
+
+		rList := util.Mysql.SelectBySql("SELECT return_money,expire_time,pay_way,pay_param,pay_way,return_money,order_code FROM return_money_online r WHERE r.status=0 and r.token=? ", token)
+		if rList == nil || len(*rList) == 0 {
+			return nil, fmt.Errorf("未知回款单")
+		}
+		var (
+			rMap        = (*rList)[0]
+			expireTime  = gconv.String(rMap["expire_time"])
+			pay_param   = gconv.String(rMap["pay_param"])
+			payWay      = gconv.String(rMap["pay_way"])
+			returnMoney = gconv.Int(rMap["return_money"])
+			OrderCode   = gconv.String(rMap["order_code"])
+		)
+		if pay_param != "" {
+			if payWay == payWayReq {
+				return pay_param, nil
+			}
+			return "", fmt.Errorf("支付方式更变")
+		}
+		var (
+			tradeno, payParam string
+			err               error
+		)
+		expire, dateErr := time.ParseInLocation(time.DateTime, expireTime, time.Local)
+		if dateErr == nil {
+
+		}
+		if time.Now().After(expire) {
+			go public.Mysql.Update("return_money_online", map[string]interface{}{"token": token, "status": 0}, map[string]interface{}{"status": -1})
+			return nil, fmt.Errorf("回款单已过期,请重新联系销售")
+		}
+
+		switch payWayReq {
+		case "wx_js":
+			var (
+				sessVal = this.Session().GetMultiple()
+				openId  = qutil.ObjToString(sessVal["s_m_openid"])
+			)
+			if openId == "" {
+				openId = qutil.ObjToString(sessVal["openid_returnMoney"])
+			}
+			if openId == "" {
+				return nil, fmt.Errorf("创建微信支付参数异常")
+			}
+			tradeno, _, payParam, err = pay.CreateOrderPay(returnMoney, pay.WX_RETURN_NATIVE, "", openId, "", payWay, OrderCode, expire.Unix())
+			if err != nil {
+				return nil, fmt.Errorf("创建微信支付异常")
+			}
+		case "ali_pc":
+			tradeno, _, payParam, err = pay.CreateOrderPay(returnMoney, pay.ALI_RETURN_NATIVE, "", "", "", payWay, OrderCode, expire.Unix())
+			if err != nil {
+				return nil, fmt.Errorf("创建支付宝支付异常")
+			}
+		}
+		//更新支付串
+		now := time.Now()
+		if !util.Mysql.Update("return_money_online", map[string]interface{}{
+			"status": 0,
+			"token":  token,
+		}, map[string]interface{}{
+			"order_code":   OrderCode,
+			"pay_param":    payParam,
+			"out_trade_no": tradeno,
+			"pay_way":      payWay,
+			"creat_time":   FormatDate(&now, Date_Full_Layout),
+		}) {
+			return nil, fmt.Errorf("数据保存异常")
+		}
+		return payParam, nil
+	}()
+	if errMsg != nil {
+		log.Printf("GetWxReturnPayParam %s获取回款支付参数异常%v", token, errMsg)
+	}
+	this.ServeJson(NewResult(rData, errMsg))
+}
+
+func (this *CommonAction) GetReturnResult() {
+	var token = this.GetString("token")
+	rData, errMsg := func() (interface{}, error) {
+		if token == "" {
+			return nil, fmt.Errorf("缺少参数")
+		}
+		rData := util.Mysql.FindOne("return_money_online", map[string]interface{}{
+			"token": token,
+		}, "transaction_id,pay_time,status,order_code,pay_money,return_money", "")
+		if rData == nil || len(*rData) == 0 {
+			return nil, fmt.Errorf("未知回款单")
+		}
+		var (
+			r      = map[string]interface{}{}
+			status = gconv.Int((*rData)["status"])
+		)
+		r["success"] = status > 0
+		if status > 0 {
+			r["order_code"] = (*rData)["order_code"]
+			r["transaction_id"] = (*rData)["transaction_id"]
+			r["pay_money"] = (*rData)["pay_money"]
+			r["return_money"] = (*rData)["return_money"]
+			if payTime := gconv.String((*rData)["pay_time"]); payTime != "" {
+				if t, e := time.ParseInLocation(time.DateTime, payTime, time.Local); e == nil {
+					r["pay_time"] = t.Unix()
+				}
+			}
+		}
+		return r, nil
+	}()
+	if errMsg != nil {
+		log.Printf("GetReturnResult %s获取回款支付异常%v", token, errMsg)
+	}
+	this.ServeJson(NewResult(rData, errMsg))
+}

+ 10 - 10
src/jfw/modules/subscribepay/src/service/courseAction.go

@@ -263,7 +263,7 @@ func (this *CourseAction) Reserve() {
 		course_status := 0      //课程状态-默认:0;选择对公转账则是1;1:对公转账未上传凭证;2:对公转账审核中;3:对公转账审核未通过;4:对公转账审核通过(同时修改订单状态为已完成);5:退款审核中;6:已退款;(1,2,3为订单未支付状态;4,5,6为订单完成状态)
 		if payWay == "wx_app" { //"wx_app" app微信支付
 			var ret *map[string]string
-			tradeno, ret = pay.WxStruct.CreatePrepayOrder(pay.WX_COURSE_APP, this.IP(), "", "", "", final_price)
+			tradeno, ret = pay.WxStruct.CreatePrepayOrder(pay.WX_COURSE_APP, this.IP(), "", "", "", final_price, 0)
 			if ret == nil || (*ret)["status"] != "1" {
 				return &entity.FuncResult{false, errors.New("APP微信支付生成订单出错"), nil}
 			}
@@ -271,7 +271,7 @@ func (this *CourseAction) Reserve() {
 			payStr = pay.WxStruct.GetAppWxPayStr(prepayid)
 		} else if payWay == "wx_js" { //微信端js支付
 			var ret *map[string]string
-			tradeno, ret = pay.WxStruct.CreatePrepayOrder(pay.WX_COURSE_JSAPI, this.IP(), openId, "", "", final_price)
+			tradeno, ret = pay.WxStruct.CreatePrepayOrder(pay.WX_COURSE_JSAPI, this.IP(), openId, "", "", final_price, 0)
 			if ret == nil || (*ret)["status"] != "1" {
 				return &entity.FuncResult{false, errors.New("微信JS支付生成订单出错"), nil}
 			}
@@ -279,7 +279,7 @@ func (this *CourseAction) Reserve() {
 			payStr = pay.WxStruct.GetWxjsPaySign(prepayid, "")
 		} else if payWay == "wx_pc" { //pc端微信扫码支付
 			var ret *map[string]string
-			tradeno, ret = pay.WxStruct.CreatePrepayOrder(pay.WX_COURSE_NATIVE, this.IP(), openId, "", "", final_price)
+			tradeno, ret = pay.WxStruct.CreatePrepayOrder(pay.WX_COURSE_NATIVE, this.IP(), openId, "", "", final_price, 0)
 			if ret == nil || (*ret)["status"] != "1" {
 				return &entity.FuncResult{false, errors.New("pc微信扫码支付生成订单出错"), nil}
 			}
@@ -287,13 +287,13 @@ func (this *CourseAction) Reserve() {
 			payStr = (*ret)["codeurl"]
 		} else if payWay == "ali_app" { //"ali_app" APP支付宝支付
 			var err error
-			payStr, tradeno, err = pay.Alipay.GetOrderPayParam((qutil.Float64All(final_price)), pay.ALI_COURSE_APP)
+			payStr, tradeno, err = pay.Alipay.GetOrderPayParam((qutil.Float64All(final_price)), pay.ALI_COURSE_APP, 0)
 			if err != nil {
 				return &entity.FuncResult{false, errors.New("支付宝APP订单生成出错"), nil}
 			}
 		} else if payWay == "ali_pc" { //pc端支付宝扫码支付
 			var err error
-			payStr, tradeno, err = pay.Alipay.GetOrderPayParam(qutil.Float64All(final_price), pay.ALI_COURSE_NATIVE)
+			payStr, tradeno, err = pay.Alipay.GetOrderPayParam(qutil.Float64All(final_price), pay.ALI_COURSE_NATIVE, 0)
 			if err != nil {
 				return &entity.FuncResult{false, errors.New("pc支付宝扫码生成出错"), nil}
 			}
@@ -407,7 +407,7 @@ func (this *CourseAction) CodePay() {
 		now := time.Now()
 		prepay_time := FormatDate(&now, Date_Full_Layout)
 		if pay_way == "wx_pc" { //pc端重生支付码 更新数据库
-			tradeno, ret := pay.WxStruct.CreatePrepayOrder(pay.WX_COURSE_NATIVE, this.IP(), openId, "", "", orderMoney)
+			tradeno, ret := pay.WxStruct.CreatePrepayOrder(pay.WX_COURSE_NATIVE, this.IP(), openId, "", "", orderMoney, 0)
 			if ret != nil && (*ret)["status"] == "1" {
 				if util.Mysql.Update("dataexport_order", map[string]interface{}{
 					"id": orderId,
@@ -429,7 +429,7 @@ func (this *CourseAction) CodePay() {
 				return &entity.FuncResult{false, errors.New(pay_way + "创建微信订单出错"), nil}
 			}
 		} else if pay_way == "ali_pc" {
-			if qr_url, tradeno, err := pay.Alipay.GetOrderPayParam(qutil.Float64All(orderMoney), pay.ALI_COURSE_NATIVE); err == nil {
+			if qr_url, tradeno, err := pay.Alipay.GetOrderPayParam(qutil.Float64All(orderMoney), pay.ALI_COURSE_NATIVE, 0); err == nil {
 				if util.Mysql.Update("dataexport_order", map[string]interface{}{
 					"id": orderId,
 				}, map[string]interface{}{
@@ -505,7 +505,7 @@ func (this *CourseAction) OrderPay() {
 		tradeno, prepayid := "", ""
 		if payway == "wx_js" { //微信js支付
 			var ret *map[string]string
-			tradeno, ret = pay.WxStruct.CreatePrepayOrder(pay.WX_COURSE_JSAPI, this.IP(), qutil.ObjToString(this.GetSession("s_m_openid")), "", "", totalfee)
+			tradeno, ret = pay.WxStruct.CreatePrepayOrder(pay.WX_COURSE_JSAPI, this.IP(), qutil.ObjToString(this.GetSession("s_m_openid")), "", "", totalfee, 0)
 			if ret == nil || (*ret)["status"] != "1" {
 				errMsg := "创建微信订单出错"
 				if (*ret)["errcodedes"] != "" {
@@ -519,7 +519,7 @@ func (this *CourseAction) OrderPay() {
 			jsPayParam = pay.GetWxJsPayStr(prepayid)
 		} else if payway == "wx_app" { //微信app支付
 			var ret *map[string]string
-			tradeno, ret = pay.WxStruct.CreatePrepayOrder(pay.WX_COURSE_APP, this.IP(), qutil.ObjToString(this.GetSession("s_m_openid")), "", "", totalfee)
+			tradeno, ret = pay.WxStruct.CreatePrepayOrder(pay.WX_COURSE_APP, this.IP(), qutil.ObjToString(this.GetSession("s_m_openid")), "", "", totalfee, 0)
 			if ret == nil || (*ret)["status"] != "1" {
 				errMsg := "创建微信订单出错"
 				if (*ret)["errcodedes"] != "" {
@@ -533,7 +533,7 @@ func (this *CourseAction) OrderPay() {
 			jsPayParam = pay.WxStruct.GetAppWxPayStr(prepayid)
 		} else if payway == "ali_app" { //支付宝app支付
 			var err error
-			jsPayParam, tradeno, err = pay.Alipay.GetOrderPayParam((qutil.Float64All(totalfee)), pay.ALI_COURSE_APP)
+			jsPayParam, tradeno, err = pay.Alipay.GetOrderPayParam((qutil.Float64All(totalfee)), pay.ALI_COURSE_APP, 0)
 			if err != nil {
 				return &entity.FuncResult{false, errors.New("创建支付宝订单出错"), nil}
 			}

+ 3 - 3
src/jfw/modules/subscribepay/src/service/dataReport.go

@@ -53,7 +53,7 @@ func (d *DataReport) ToWxjsPay() {
 		tradeno, prepayid, orderPay := "", "", ""
 		if pay_way == "wx_app" { //"wx_app" 微信支付
 			var ret *map[string]string
-			tradeno, ret = pay.WxStruct.CreatePrepayOrder("D", d.IP(), "", "", "", order_money)
+			tradeno, ret = pay.WxStruct.CreatePrepayOrder("D", d.IP(), "", "", "", order_money, 0)
 			if ret == nil || (*ret)["status"] != "1" {
 				return "", errors.New("微信生成订单出错")
 			}
@@ -61,14 +61,14 @@ func (d *DataReport) ToWxjsPay() {
 			orderPay = pay.WxStruct.GetAppWxPayStr(prepayid)
 		} else if pay_way == "ali_app" { //"ali_app"支付宝支付
 			var err error
-			orderPay, tradeno, err = pay.Alipay.GetOrderPayParam((qutil.Float64All(order_money)), pay.ALI_DATAREPORT_APP)
+			orderPay, tradeno, err = pay.Alipay.GetOrderPayParam((qutil.Float64All(order_money)), pay.ALI_DATAREPORT_APP, 0)
 			if err != nil {
 				return "", errors.New(fmt.Sprintf("支付宝订单生成出错:%v", err))
 			}
 		} else { //wx_js支付
 			var ret *map[string]string
 			openId := qutil.ObjToString(d.GetSession("s_m_openid"))
-			tradeno, ret = pay.WxStruct.CreatePrepayOrder("d", d.IP(), openId, "", "", order_money)
+			tradeno, ret = pay.WxStruct.CreatePrepayOrder("d", d.IP(), openId, "", "", order_money, 0)
 			if ret == nil || (*ret)["status"] != "1" {
 				return "", errors.New("微信生成订单出错")
 			}

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

@@ -61,7 +61,7 @@ func (this *DebrisProductAction) GetWxPayParam() {
 		)
 
 		//重新创建支付串
-		tradeno, prepayid, payParam, err := pay.CreateOrderPay(orderMoney, pay.WX_DENRISPRODUCT, this.IP(), openId, appId, "wx_js", orderCode, product_type)
+		tradeno, prepayid, payParam, err := pay.CreateOrderPay(orderMoney, pay.WX_DENRISPRODUCT, this.IP(), openId, appId, "wx_js", orderCode, 0, product_type)
 		if err != nil {
 			return nil, errors.New(fmt.Sprintf("创建支付失败[%v]", err))
 		}

+ 2 - 2
src/jfw/modules/subscribepay/src/service/entniche.go

@@ -117,7 +117,7 @@ func (e *Entniche) Pay() {
 		prepayid, payStr, tradeno := "", "", ""
 		if payway == "wx_app" {
 			var ret *map[string]string
-			tradeno, ret = pay.WxStruct.CreatePrepayOrder("H", e.IP(), "", "", "", order_money)
+			tradeno, ret = pay.WxStruct.CreatePrepayOrder("H", e.IP(), "", "", "", order_money, 0)
 			if ret == nil || (*ret)["status"] != "1" {
 				return 0, ""
 			}
@@ -128,7 +128,7 @@ func (e *Entniche) Pay() {
 			}
 		} else if payway == "ali_app" {
 			var err error
-			payStr, tradeno, err = pay.Alipay.GetOrderPayParam((qutil.Float64All(order_money)), pay.ALI_ENTNICHE_APP)
+			payStr, tradeno, err = pay.Alipay.GetOrderPayParam((qutil.Float64All(order_money)), pay.ALI_ENTNICHE_APP, 0)
 			if err != nil {
 				return 0, ""
 			}

+ 10 - 5
src/jfw/modules/subscribepay/src/service/orderListDetails.go

@@ -59,7 +59,7 @@ var (
 // 订单数据展示(订单详情页面)
 func (this *OrderListDetails) GetOrderPayAllMsg() {
 	userId := qutil.ObjToString(this.GetSession("userId"))
-	fields := "id,signing_subject,order_code,order_channel,prepay_time,del_status,create_time,pay_time,pay_way,original_price,order_money,pay_money,applybill_status,out_trade_no,filter,product_type,order_status,applybill_type,applybill_taxnum,applybill_company,vip_starttime,vip_endtime,vip_type,discount_price,d_relation_id,billingMode,return_status,is_backstage_order,vip_starttime,vip_endtime,expiration_time,buy_subject,buy_count,course_status"
+	fields := "id,signing_subject,order_code,order_channel,prepay_time,del_status,refund_status,create_time,pay_time,pay_way,original_price,order_money,pay_money,applybill_status,out_trade_no,filter,product_type,order_status,applybill_type,applybill_taxnum,applybill_company,vip_starttime,vip_endtime,vip_type,discount_price,d_relation_id,billingMode,return_status,is_backstage_order,vip_starttime,vip_endtime,expiration_time,buy_subject,buy_count,course_status"
 	data, t, transaction_id := CommonDetail(4, fields, userId, this.GetString("orderCode"), this.Session())
 	r := &entity.FuncResult{true, nil, map[string]interface{}{
 		"order":          data,
@@ -645,6 +645,9 @@ func (o *OrderListDetails) Datas(sql string, pageNum, pagesize_max int) (haveNex
 				isCanInvoic = IsAllowInvoice(result[i])
 			}
 			result[i]["is_can_invoice"] = isCanInvoic
+			if result[i]["refund_status"] == nil {
+				result[i]["refund_status"] = 0
+			}
 			//是否存在可查看发票
 			result[i]["invoice_show"] = len(ShowList(qutil.InterfaceToStr(result[i]["order_code"]))) > 0
 			if qutil.ObjToString(result[i]["pay_way"]) == "transferAccounts" {
@@ -847,7 +850,7 @@ func (o *OrderListDetails) IsOver() {
 // 大会员详情订单(AI中标预测包订单详情也查询此接口)
 func (o *OrderListDetails) GetMemberDetail() {
 	userId := qutil.ObjToString(o.GetSession("userId"))
-	fields := "id,signing_subject,order_code,order_status,create_time,pay_time,pay_way,out_trade_no,prepay_id,product_type,pay_money,order_money,filter,applybill_type,applybill_taxnum,applybill_company,applybill_status,vip_starttime,vip_endtime,course_status,is_backstage_order,return_status,billingMode,discount_price,buy_subject,buy_count,order_channel"
+	fields := "id,signing_subject,order_code,order_status,refund_status,create_time,pay_time,pay_way,out_trade_no,prepay_id,product_type,pay_money,order_money,filter,applybill_type,applybill_taxnum,applybill_company,applybill_status,vip_starttime,vip_endtime,course_status,is_backstage_order,return_status,billingMode,discount_price,buy_subject,buy_count,order_channel"
 	data, _, _ := CommonDetail(0, fields, userId, o.GetString("order_code"), o.Session())
 	o.ServeJson(map[string]interface{}{
 		"data": data,
@@ -856,7 +859,7 @@ func (o *OrderListDetails) GetMemberDetail() {
 
 func (o *OrderListDetails) GetBidfileDetail() {
 	userId := qutil.ObjToString(o.GetSession("userId"))
-	fields := "id,signing_subject,order_code,order_status,create_time,pay_time,pay_way,out_trade_no,prepay_id,product_type,pay_money,order_money,filter,applybill_type,applybill_taxnum,applybill_company,applybill_status,vip_starttime,vip_endtime,course_status,discount_price,d_relation_id,buy_subject,buy_count"
+	fields := "id,signing_subject,order_code,order_status,create_time,pay_time,pay_way,out_trade_no,prepay_id,product_type,refund_status,pay_money,order_money,filter,applybill_type,applybill_taxnum,applybill_company,applybill_status,vip_starttime,vip_endtime,course_status,discount_price,d_relation_id,buy_subject,buy_count"
 	data, _, _ := CommonDetail(1, fields, userId, o.GetString("order_code"), o.Session())
 	o.ServeJson(map[string]interface{}{
 		"data": data,
@@ -876,7 +879,9 @@ func CommonDetail(bigm int, fields, userId, order_code string, session *httpsess
 			}
 			data = *util.Mysql.FindOne(tableName_order, info, fields, "")
 			if data != nil {
-
+				if data["refund_status"] == nil {
+					data["refund_status"] = 0
+				}
 				layout := "2006-01-02 15:04:05"
 				create_time := qutil.InterfaceToStr(data["create_time"])
 				t, err := time.Parse(layout, create_time)
@@ -1067,7 +1072,7 @@ func deleteRepeat(slice []int) []int {
 // typ 类型
 // @return sql语句 countsql语句
 func getOrderSql(userId, fromPage, typ string) (string, string) {
-	sql := fmt.Sprintf(`select id,order_code,order_channel,signing_subject,filter_publishtime,create_time,data_spec,filter_id,filter_keys,order_money,pay_money,data_count,order_status,pay_way,product_type,filter,pay_time,vip_starttime,vip_endtime,applybill_status,applybill_type,applybill_taxnum,applybill_company,vip_type,course_status,discount_price,d_relation_id,billingMode,is_backstage_order,return_status,expiration_time,buy_subject,buy_count from dataexport_order
+	sql := fmt.Sprintf(`select id,order_code,order_channel,signing_subject,filter_publishtime,create_time,data_spec,filter_id,filter_keys,order_money,pay_money,data_count,order_status,refund_status,pay_way,product_type,filter,pay_time,vip_starttime,vip_endtime,applybill_status,applybill_type,applybill_taxnum,applybill_company,vip_type,course_status,discount_price,d_relation_id,billingMode,is_backstage_order,return_status,expiration_time,buy_subject,buy_count from dataexport_order
 		where  del_status=0 and audit_status=3 and (order_channel != 'xdqd04' or order_channel IS NULL or (order_channel = 'xdqd04' and order_status=1)) AND ((is_backstage_order =0 AND user_id ='%s')`, userId)
 	sqlC := fmt.Sprintf(`select count(1) from dataexport_order
 		where del_status=0 and audit_status=3  and (order_channel != 'xdqd04' or order_channel IS NULL or (order_channel = 'xdqd04' and order_status=1)) AND ((is_backstage_order =0 AND user_id ='%s')`, userId)

+ 74 - 29
src/jfw/modules/subscribepay/src/service/payCallback.go

@@ -9,6 +9,7 @@ import (
 	"jy/src/jfw/modules/subscribepay/src/pay"
 	"jy/src/jfw/modules/subscribepay/src/util"
 	"log"
+	"math"
 	"net/url"
 	"strings"
 	"time"
@@ -142,14 +143,24 @@ func (this *PayCallBackAction) TestPay() {
 			}
 		}
 		go func() {
-			orderData := util.Mysql.FindOne("dataexport_order", thisParam.GetPaySuccessOrderQuery(), "filter,order_money", "")
+			orderCodeMap := thisParam.GetPaySuccessOrderQuery()
+			orderData := util.Mysql.FindOne("dataexport_order", orderCodeMap, "filter,order_money", "")
 			if orderData != nil {
+				//手续费更新
+				upMap := make(map[string]interface{})
+				orderMoney := qutil.IntAll((*orderData)["order_money"])
+				if config.Config.AliProceduresMoney > 0 {
+					upMap["procedures_money"] = math.Round(float64(orderMoney) * config.Config.AliProceduresMoney / 100)
+				}
 				//新增保留支付金额字段
 				filter := qutil.ObjToString((*orderData)["filter"])
 				lastIndex := strings.LastIndex(filter, "}")
 				if lastIndex != -1 {
-					newFilter := filter[:lastIndex] + strings.Replace(filter[lastIndex:], "}", fmt.Sprintf(`,"originalAmount":%d}`, qutil.IntAll((*orderData)["order_money"])), 1)
-					util.Mysql.Update("dataexport_order", thisParam.GetPaySuccessOrderQuery(), map[string]interface{}{"filter": newFilter})
+					newFilter := filter[:lastIndex] + strings.Replace(filter[lastIndex:], "}", fmt.Sprintf(`,"originalAmount":%d}`, orderMoney), 1)
+					upMap["filter"] = newFilter
+				}
+				if len(upMap) > 0 {
+					util.Mysql.Update("dataexport_order", orderCodeMap, upMap)
 				}
 			}
 		}()
@@ -281,6 +292,11 @@ func (a *PayCallBackAction) AliPayCallback() {
 				log.Printf("支付宝pdf下载包支付回调更新执行出错 %+v\n", thisParam)
 				return false
 			}
+		} else if strings.HasPrefix(outTradeno, pay.ALI_RETURN_NATIVE) {
+			if !entity.JyReturnMoneyStruct.PayCallBack(thisParam) {
+				log.Printf("支付宝回款更新执行出错 %+v\n", thisParam)
+				return false
+			}
 		} else {
 			log.Printf("支付宝支付完成回调 未知订单类型%s\n", thisParam.OutTradeno)
 		}
@@ -288,20 +304,31 @@ func (a *PayCallBackAction) AliPayCallback() {
 			log.Printf("支付宝支付保存支付记录出错 %+v\n", thisParam)
 			return false
 		}
-		go func() {
-			orderData := util.Mysql.FindOne("dataexport_order", thisParam.GetPaySuccessOrderQuery(), "filter,order_money", "")
-			if orderData != nil {
-				//新增保留支付金额字段
-				filter := qutil.ObjToString((*orderData)["filter"])
-				lastIndex := strings.LastIndex(filter, "}")
-				if lastIndex != -1 {
-					newFilter := filter[:lastIndex] + strings.Replace(filter[lastIndex:], "}", fmt.Sprintf(`,"originalAmount":%d}`, qutil.IntAll((*orderData)["order_money"])), 1)
-					util.Mysql.Update("dataexport_order", thisParam.GetPaySuccessOrderQuery(), map[string]interface{}{"filter": newFilter})
+		if !strings.HasPrefix(outTradeno, pay.ALI_RETURN_NATIVE) {
+			go func() {
+				orderCodeMap := thisParam.GetPaySuccessOrderQuery()
+				orderData := util.Mysql.FindOne("dataexport_order", orderCodeMap, "filter,order_money", "")
+				if orderData != nil {
+					//手续费更新
+					upMap := make(map[string]interface{})
+					orderMoney := qutil.IntAll((*orderData)["order_money"])
+					if config.Config.AliProceduresMoney > 0 {
+						upMap["procedures_money"] = math.Round(float64(orderMoney) * config.Config.AliProceduresMoney / 100)
+					}
+					//新增保留支付金额字段
+					filter := qutil.ObjToString((*orderData)["filter"])
+					lastIndex := strings.LastIndex(filter, "}")
+					if lastIndex != -1 {
+						newFilter := filter[:lastIndex] + strings.Replace(filter[lastIndex:], "}", fmt.Sprintf(`,"originalAmount":%d}`, orderMoney), 1)
+						upMap["filter"] = newFilter
+					}
+					util.Mysql.Update("dataexport_order", orderCodeMap, upMap)
+
 				}
-			}
-		}()
-		//销售业绩同步生效
-		entity.TakeEffectSale(thisParam.OrderCode, thisParam.TotalFee)
+			}()
+			//销售业绩同步生效
+			entity.TakeEffectSale(thisParam.OrderCode, thisParam.TotalFee)
+		}
 		return true
 	}()
 	if ok {
@@ -410,6 +437,11 @@ func (p *PayCallBackAction) WxPayCallback() {
 			if update = entity.JyPdfExportPack.PayCallBack(thisParam); !update {
 				log.Printf("微信下载包支付回调更新执行出错 %+v\n", thisParam)
 			}
+		} else if strings.HasPrefix(outTradeno, pay.WX_RETURN_NATIVE) {
+			if update = entity.JyReturnMoneyStruct.PayCallBack(thisParam); !update {
+				log.Printf("微信回款更新执行出错 %+v\n", thisParam)
+				return false
+			}
 		} else {
 			log.Printf("微信支付完成回调 未知订单类型%s\n", thisParam.OutTradeno)
 		}
@@ -420,20 +452,33 @@ func (p *PayCallBackAction) WxPayCallback() {
 			log.Printf("微信支付保存支付记录出错 %+v\n", thisParam)
 			return false
 		}
-		go func() {
-			orderData := util.Mysql.FindOne("dataexport_order", thisParam.GetPaySuccessOrderQuery(), "filter,order_money", "")
-			if orderData != nil {
-				//新增保留支付金额字段
-				filter := qutil.ObjToString((*orderData)["filter"])
-				lastIndex := strings.LastIndex(filter, "}")
-				if lastIndex != -1 {
-					newFilter := filter[:lastIndex] + strings.Replace(filter[lastIndex:], "}", fmt.Sprintf(`,"originalAmount":%d}`, qutil.IntAll((*orderData)["order_money"])), 1)
-					util.Mysql.Update("dataexport_order", thisParam.GetPaySuccessOrderQuery(), map[string]interface{}{"filter": newFilter})
+		if !strings.HasPrefix(outTradeno, pay.WX_RETURN_NATIVE) {
+			go func() {
+				orderCodeMap := thisParam.GetPaySuccessOrderQuery()
+				orderData := util.Mysql.FindOne("dataexport_order", orderCodeMap, "filter,order_money", "")
+				if orderData != nil {
+					//手续费更新
+					upMap := make(map[string]interface{})
+					orderMoney := qutil.IntAll((*orderData)["order_money"])
+					if config.Config.WxProceduresMoney > 0 {
+						upMap["procedures_money"] = math.Round(float64(orderMoney) * config.Config.WxProceduresMoney / 100)
+					}
+					//新增保留支付金额字段
+					filter := qutil.ObjToString((*orderData)["filter"])
+					lastIndex := strings.LastIndex(filter, "}")
+					if lastIndex != -1 {
+						newFilter := filter[:lastIndex] + strings.Replace(filter[lastIndex:], "}", fmt.Sprintf(`,"originalAmount":%d}`, orderMoney), 1)
+						upMap["filter"] = newFilter
+					}
+					if len(upMap) > 0 {
+						util.Mysql.Update("dataexport_order", orderCodeMap, upMap)
+					}
 				}
-			}
-		}()
-		//销售业绩同步生效
-		entity.TakeEffectSale(thisParam.OrderCode, thisParam.TotalFee)
+			}()
+			//销售业绩同步生效
+			entity.TakeEffectSale(thisParam.OrderCode, thisParam.TotalFee)
+
+		}
 		return true
 	}()
 

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

@@ -67,7 +67,7 @@ func (p *RewardPayAction) WxPay() error {
 		totalfee := qutil.IntAll(tf * 100)
 		title := p.GetString("title")
 		detailmsg := fmt.Sprintf(pay.WxStruct.Dashang_detailmsg, title, fmt.Sprint(float64(totalfee)/100))
-		tradeno, ret := pay.WxStruct.CreatePrepayOrder("a", p.IP(), openId, "", detailmsg, totalfee)
+		tradeno, ret := pay.WxStruct.CreatePrepayOrder("a", p.IP(), openId, "", detailmsg, totalfee, 0)
 		if ret == nil {
 			p.ServeJson(map[string]interface{}{
 				"status": -1,

+ 14 - 13
src/jfw/modules/subscribepay/src/service/salesCreateOrder.go

@@ -237,17 +237,18 @@ func (this *SalesCreateOrder) CreateBySeller() {
 				return false
 			}
 			if util.Mysql.InsertByTx(tx, "order_sale_record", map[string]interface{}{
-				"state":         2,
-				"ordercode":     inserMap.OrderCode,
-				"saler_Id":      sellPid,
-				"saler_name":    sellPName,
-				"saler_dept":    saleDep,
-				"saler_dept_id": deptId,
-				"change_value":  inserMap.OrderMoney,
-				"money":         inserMap.OrderMoney,
-				"group_uuid":    uuid.New().String(),
-				"operator":      "系统自动",
-				"create_time":   FormatDate(&now, Date_Full_Layout),
+				"state":                2,
+				"ordercode":            inserMap.OrderCode,
+				"saler_Id":             sellPid,
+				"saler_name":           sellPName,
+				"saler_dept":           saleDep,
+				"saler_dept_id":        deptId,
+				"change_value":         inserMap.OrderMoney,
+				"money":                inserMap.OrderMoney,
+				"group_uuid":           uuid.New().String(),
+				"operator":             "系统自动",
+				"distribution_channel": "x020",
+				"create_time":          FormatDate(&now, Date_Full_Layout),
 			}) <= 0 {
 				return false
 			}
@@ -380,7 +381,7 @@ func (this *SalesCreateOrder) GetCommonPayParam() {
 		if !ok {
 			return &entity.FuncResult{false, errors.New("未知支付类型:" + payway_req), nil}
 		}
-		tradeno, prepayid, payParam, err := pay.CreateOrderPay(totalfee, productFlag, this.IP(), openid, "", payway_req, orderCode)
+		tradeno, prepayid, payParam, err := pay.CreateOrderPay(totalfee, productFlag, this.IP(), openid, "", payway_req, orderCode, 0)
 		if err != nil {
 			return &entity.FuncResult{false, errors.New(fmt.Sprintf("创建支付失败[%v]", err)), nil}
 		}
@@ -640,7 +641,7 @@ func (o *SalesCreateOrder) GetOrderPayAllMsg() {
 			//	r.Err = errors.New("获取订单信息失败")
 			//	goto env
 			//}
-			field := "id,signing_subject,order_code,del_status,prepay_time,create_time,pay_time,pay_way,user_phone,original_price,order_money,pay_money,applybill_status,out_trade_no,filter,product_type,order_status,applybill_type,applybill_taxnum,applybill_company,vip_starttime,vip_endtime,vip_type,discount_price,d_relation_id,billingMode,return_status,is_backstage_order,vip_starttime,vip_endtime"
+			field := "id,signing_subject,order_code,del_status,prepay_time,create_time,pay_time,pay_way,user_phone,original_price,order_money,refund_status,pay_money,applybill_status,out_trade_no,filter,product_type,order_status,applybill_type,applybill_taxnum,applybill_company,vip_starttime,vip_endtime,vip_type,discount_price,d_relation_id,billingMode,return_status,is_backstage_order,vip_starttime,vip_endtime"
 			data, t, transactionId = CommonDetail(4, field, userId, order_code, o.Session())
 			//如果手机号号为空查找通过userid查找手机号
 			//if qutil.InterfaceToStr(data["user_phone"]) == "" {

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

@@ -1049,7 +1049,7 @@ func (this *UserAccount) WxUnBind() {
 			if saveId == "" {
 				return nil, DBUPDATE_ERROR
 			}
-			jy.SaveUserLog(util.Mgo_log, saveId, phone, "phone", "wx", "wx", "", "", gconv.String(this.GetSession("RSource")), this.Request.Proto, this.UserAgent(), gconv.String(qutil.If(gconv.String((*unsetMap)["s_rsource"]) == "jyzbw", "jyzbw", "jybx")), "")
+			go jy.SaveUserLog(util.Mgo_log, saveId, phone, "phone", "wx", "wx", "", "", gconv.String(this.GetSession("RSource")), this.Request.Proto, this.UserAgent(), gconv.String(qutil.If(gconv.String((*unsetMap)["s_rsource"]) == "jyzbw", "jyzbw", "jybx")), "")
 
 			flushWxsession = true
 		}

+ 8 - 0
src/web/staticres/common-module/order-list/css/order-detail.css

@@ -237,3 +237,11 @@
 .van-dialog  .van-button--default {
   color: #171826;
 }
+
+.refund-success-tip {
+  margin-left: .4rem;
+  font-size: .28rem;
+  color: #FB483D;
+  line-height: .4rem;
+  font-weight: 400;
+}

+ 7 - 0
src/web/staticres/common-module/order-list/css/order-list.css

@@ -218,6 +218,13 @@
   margin-top: .1rem;
   white-space: nowrap;
 }
+.refund-success {
+  display: flex;
+  justify-content: flex-end;
+  color: #FF3A20;
+  line-height: 22px;
+  font-size:14px
+}
 .discount-info {
   height: .34rem;
   padding: 0 .12rem;

+ 1 - 1
src/web/staticres/common-module/order-list/js/order-detail.js

@@ -380,7 +380,7 @@ var vm = new Vue({
         {
           label: '实付金额',
           split: ':',
-          text: (order.pay_money >= 0||filterObj.badge=="exchange") && order.order_status === 1 ? '¥' + this.moneyFormat(order.pay_money) : ''
+          text: (order.pay_money >= 0||filterObj.badge=="exchange") && order.order_status === 1 ? '¥' + this.moneyFormat(order.pay_money) : '' + order.refund_status && order.refund_status > 0 ? '<span style="display: none;" class="refund-success-tip">退款成功</span>' : ''
         },
         {
           label: '产品类型',

+ 1 - 1
src/web/staticres/common-module/order-list/js/order-list.js

@@ -2628,7 +2628,7 @@ var vm = new Vue({
         duration.text = filterInfo.cycle + '天'
       } else {
         duration.text = filterInfo.cycle + '年'
-        if (filterInfo.createType || filterInfo.cycleType === 0) {
+        if (filterInfo.cycleType === 0) {
           duration.text = filterInfo.cycle + '个月'
         }
       }

+ 5 - 2
src/web/staticres/common-module/vipsubscribe/css/vip-subscribe-set-template.css

@@ -44,6 +44,9 @@
   display: block;
   padding: 0.3rem 0.32rem;
 }
+.vip-body .item-container-main {
+  padding: 0;
+}
 
 .vip-body .body-item .item,
 .vip-body .body-item .sub-item {
@@ -161,9 +164,9 @@
 .vip-body .push-set{
   margin-top: .16rem;
 }
-.vip-body .cycle {
+/* .vip-body .cycle {
   padding: 0.16rem 0;
-}
+} */
 
 .vip-body .cycle {
   /* margin: 0; */

+ 8 - 0
src/web/staticres/vipsubscribe/css/public.css

@@ -792,4 +792,12 @@ button[disabled] {
 }
 .weui-dialog__bd {
   font-weight: normal !important;
+}
+
+.refund-success-tip {
+  margin-left: .4rem;
+  font-size: .28rem;
+  color: #FB483D;
+  line-height: .4rem;
+  font-weight: 400;
 }

+ 22 - 5
src/web/staticres/vipsubscribe/css/vip_index_new.css

@@ -125,14 +125,14 @@
 }
 
 .sub-info{
-  min-height: 1.48rem;
+  min-height: 1.12rem;
   border-radius: 8px;
   background: linear-gradient(270deg, #F1D090 0%, #FAE7CA 100%);
   box-shadow: 0px 12px 16px rgba(250, 231, 202, 0.32);
   padding: .16rem .32rem;
-  margin: 0 .24rem;
+  margin: .24rem .24rem 0;
 }
-.sub-info .area,.sub-info .industry,.sub-info .cycle{
+.sub-info .area,.sub-info .industry{
   padding: 0.16rem 0;
 }
 .sub-info .cycle{
@@ -141,6 +141,7 @@
 .sub-info .item-label{
   color: #1B1A2A;
   font-size: .3rem;
+  font-weight: bold;
 }
 .sub-info .text{
   font-size: .24rem;
@@ -326,8 +327,9 @@
 }
 
 .vip-body .body-item .item .item-l {
-  font-size: 0.32rem;
-  color: #1d1d1d;
+  line-height: .4rem;
+  font-size: 0.28rem;
+  color: #1B1A2A;
 }
 
 .vip-body .body-item .item .item-r {
@@ -1382,3 +1384,18 @@
   color: #fff;
   margin-left: 0.36rem;
 }
+.subscribe-manage-tips {
+  padding: .24rem .24rem 0;
+  background: #fff;
+}
+.subscribe-manage-tips > span {
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  padding: .12rem 0;
+  font-size: .26rem;
+  color: #2ABED1;
+  border-radius: .32rem;
+  line-height: .4rem;
+  background: rgba(42, 190, 209, 0.08);
+}

+ 8 - 0
src/web/staticres/vipsubscribe/css/vip_pay_success.css

@@ -42,11 +42,19 @@ html,body{
 }
 
 .bottom_button .left_btn {
+  flex-direction: column;
   margin-right: .26rem;
   color: #5F5E64;
   background-color: #EDEFF2;
 }
 
+.bottom_button .left_btn > p {
+  line-height: .24rem;
+  font-size: .24rem;
+  color: #2ABED1;
+}
+
+
 .bottom_button .right_btn {
   /* color: #F1D090;
   background-color: #1B1A2A; */

+ 24 - 0
src/web/staticres/vipsubscribe/js/vip_index_new.js

@@ -28,12 +28,18 @@ var subNode = new Vue({
             tutorialShow: false // 教程是否显示
         }
     },
+    computed: {
+      isFree () {
+        return this.infoRoot?.isFree
+      }
+    },
     created () {
       if(getParam('vSwitch')) {
         this.vSwitch = getParam('vSwitch')
       } else {
         this.vSwitch = ''
       }
+      this.linkToSubscribeGuide()
     },
     mounted () {
         this.getUserStatus()
@@ -44,6 +50,23 @@ var subNode = new Vue({
         this.getShowTime()
     },
     methods: {
+      // 判断是否进入(新)订阅向导
+      // 需求:进入“我的订阅管理(免费、超级订阅、大会员、商机管理)”页:在该用户身份下,未完成过订阅向导,则默认进入“订阅向导”页,否则进入“我的订阅管理”页
+      linkToSubscribeGuide: function() {
+        var _this = this
+        var vType = _this.vSwitch ? _this.vSwitch + 'Type' : 'fType'
+        $.ajax({
+          url: '/jyapi/jybx/subscribe/' + vType + '/someInfo?t=' + Date.now,
+          type: 'POST',
+          success: function (res) {
+            if (res) {
+              if (res.data.isInTSguide) {
+                location.href = '/jy_mobile/subscribe/guide?v_switch=' + _this.vSwitch
+              }
+            }
+          }
+        })
+      },
       getUserStatus: function () {
           var _this = this
           $.ajax({
@@ -163,6 +186,7 @@ var subNode = new Vue({
                 success: function(res) {
                   if(res.error_code === 0) {
                     _this.vSwitch = res.data.vt || 'f'
+                    _this.linkToSubscribeGuide()
                     if (_this.vSwitch === 'v') {
                       sessionStorage.setItem('switch-product', 'supervip')
                       document.title = '订阅管理-超级订阅'

Datei-Diff unterdrückt, da er zu groß ist
+ 85 - 0
src/web/templates/common/returnMoney/aliReturnMoney.html


+ 390 - 0
src/web/templates/common/returnMoney/wxReturnMoney.html

@@ -0,0 +1,390 @@
+<!DOCTYPE html>
+<html lang="zh-CN">
+
+<head>
+    <meta charset="UTF-8">
+    <meta name="viewport"
+          content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no"/>
+    <meta name="apple-mobile-web-app-capable" content="yes">
+    <meta name="apple-mobile-web-app-status-bar-style" content="black">
+    <meta http-equiv="X-UA-Compatible" content="ie=edge">
+    <title>剑鱼标讯</title>
+    <script src="{{Msg "seo" "cdn"}}/js/rem.js"></script>
+    <link rel="stylesheet" href=//cdn-common.jianyu360.com/cdn/lib/reset-css/5.0.1/reset.min.css />
+    <link rel="stylesheet" href=//cdn-common.jianyu360.com/cdn/lib/vant/2.12.24/lib/index.css />
+    <link rel="stylesheet" href=//cdn-common.jianyu360.com/cdn/lib/vant/2.12.24/lib/icon/local.css />
+    <link rel="stylesheet" href="{{Msg "seo" "cdn"}}/wxCommonPay/css/weui.min.css?v={{Msg "seo" "version"}}">
+    <link rel="stylesheet" href="{{Msg "seo" "cdn"}}/wxCommonPay/css/base.css?v={{Msg "seo" "version"}}">
+    <link rel="stylesheet" href="{{Msg "seo" "cdn"}}/wxCommonPay/iconfont/iconfont.css?v={{Msg "seo" "version"}}">
+    <link rel="stylesheet" href="{{Msg "seo" "cdn"}}/wxCommonPay/css/public.css?v={{Msg "seo" "version"}}">
+    <link rel="stylesheet" type="text/css" href='{{Msg "seo" "cdn"}}/common-module/appPay/css/popup.css?v={{Msg "seo" "version"}}'/>
+    <style>
+        .j-body .need-pay {
+            display: flex;
+            flex-direction: column;
+            align-items: center;
+            justify-content: center;
+            height: 1.6rem;
+        }
+
+        .need-pay {
+            margin-bottom: .2rem;
+            background-color: #fff;
+        }
+
+        .need-pay .tip-text {
+            color: #9B9CA3;
+            font-size: .24rem;
+        }
+
+        .price-container {
+            margin-top: .03rem;
+            color: #FB483D;
+            font-size: .32rem;
+        }
+
+        .price-container .price {
+            font-size: .4rem;
+        }
+
+        .j-cell .iconfont {
+            color: #2ABED1;
+            font-size: .48rem;
+        }
+
+        .j-cell .icon-weixinzhifu {
+            color: #09BB07;
+        }
+
+
+        .j-cell .j-cell_right .iconfont {
+            visibility: hidden;
+        }
+
+        .j-cell.active .j-cell_right .iconfont {
+            visibility: visible;
+        }
+    </style>
+    {{include "/common/weixin.html"}}
+    <script>
+        var signature = {{.T.signature}};
+        var isConfigSuccess = true;
+        if (signature && signature.length === 4) {
+            wx.config({
+                debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
+                appId: signature[0], // 必填,公众号的唯一标识
+                timestamp: signature[1], // 必填,生成签名的时间戳
+                nonceStr: signature[2], // 必填,生成签名的随机串
+                signature: signature[3],// 必填,签名,见附录1
+                jsApiList: ['chooseWXPay', 'hideAllNonBaseMenuItem'] // 必填,需要使用的JS接口列表,所有JS接口列表见附录2
+            });
+            wx.ready(function () {
+                if (!isConfigSuccess) {
+                    return;
+                }
+                wx.hideAllNonBaseMenuItem();
+            });
+            wx.error(function (res) {
+                //config信息验证失败会执行error函数,如签名过期导致验证失败,具体错误信息可以打开config的debug模式查看,也可以在返回的res参数中查看,对于SPA可以在这里更新签名。
+                //alert(res);
+                isConfigSuccess = false;
+            });
+        }
+    </script>
+</head>
+
+<body>
+<div class="j-container">
+    <div class="j-body">
+        <div class="need-pay">
+            <div class="tip-text">需支付金额</div>
+            <div class="price-container">
+                <span class="yen">&yen;</span>
+                <span class="price">0</span>
+            </div>
+        </div>
+        <div class="j-cells">
+            <div class="j-cell active" data-pay-mode="weixin">
+                <div class="j-cell_left iconfont icon-weixinzhifu"></div>
+                <div class="j-cell_right">
+                    <div class="j-cell_rl">微信支付</div>
+                    <div class="j-cell_rr iconfont icon-shezhichenggong"></div>
+                </div>
+            </div>
+        </div>
+    </div>
+    <div class="j-footer j-button-group">
+        <button class="j-button-confirm">去支付</button>
+    </div>
+</div>
+<script src=//cdn-common.jianyu360.com/cdn/lib/vue/2.6.11/vue.min.js></script>
+<script src=//cdn-common.jianyu360.com/cdn/lib/vant/2.12.24/lib/vant.min.js></script>
+<script src="https://cdn-common.jianyu360.com/cdn/lib/jquery/3.6.0/jquery.min.js"></script>
+<script src='{{Msg "seo" "cdn"}}/big-member/js/utils.js?v={{Msg "seo" "version"}}'></script>
+<script src='{{Msg "seo" "cdn"}}/common-module/appPay/js/popup.js?v={{Msg "seo" "version"}}'></script>
+<script src='{{Msg "seo" "cdn"}}/common-module/appPay/js/appPay.js?v={{Msg "seo" "version"}}'></script>
+<script>
+    $(function () {
+        var checkout = {
+            modeMap: {
+                'weixin': 'wx_js',
+            },
+            payParam: {{.T.pay_param}},
+            errorMap: {
+                0: '操作失败',
+                1: '操作成功'
+            },
+            mode: 'wx_js',
+            loading: null,
+            init: function () {
+              this.show()
+              this.clickEventsWithPayMode()
+              this.confirmPayEvent()
+            },
+            show: function () {
+              $(".price-container .price").text(checkout.formatMoney({{.T.data.return_money}} / 100));
+            },
+            clickEventsWithPayMode: function () {
+                var that = this
+                $('.j-cells').on('click', '.j-cell_right', function () {
+                    $(this).parents('.j-cell').addClass('active').siblings().removeClass('active')
+                    var m = $('.j-cell.active').attr('data-pay-mode')
+                    that.mode = that.modeMap[m]
+                    console.log(that.mode);
+                })
+            },
+            confirmPayEvent: function () {
+                $('.j-button-confirm').on('click', function () {
+                    // 如果loading有值说明正在请求中
+                    if (checkout.loading) return
+                    checkout.loading = checkout.jLoading({
+                        content: '加载中...',
+                    })
+                    if(checkout.payParam){
+                      checkout.loading.hide(function () {
+                        checkout.loading = null
+                        checkout.onBridgeReady(checkout.payParam)
+                      })
+                    }else {
+                      //如果支付参数为空则获取支付参数
+                      $.ajax({
+                        url: '/jypay/free/common/getWxReturnPayParam',
+                        type: 'POST',
+                        data: {
+                          token: {{.T.token}},
+                          pay_way: 'wx_js',
+                        },
+                        success: function (res) {
+                          checkout.loading.hide(function () {
+                            checkout.loading = null
+                            if (res.error_code==0) {
+                              checkout.onBridgeReady(JSON.parse(res.data))
+                            } else {
+                              // checkout.jLoading({
+                              //   content: res.error_msg,
+                              //   iconHide: true,
+                              //   duration: 1500
+                              // })
+                              location.reload();
+                            }
+                          })
+                        },
+                        error: function (err) {
+                          console.log(err);
+                        }
+                      })
+                    }
+                })
+            },
+            onBridgeReady(res) { //调用微信支付
+                WeixinJSBridge.invoke('getBrandWCPayRequest', {
+                        "appId": res["appId"],
+                        "timeStamp": res["timestamp"],
+                        "nonceStr": res["nonceStr"],
+                        "package": res["prepayId"],
+                        "signType": res["signType"],
+                        "paySign": res["sign"]
+                    },
+                    function (r) {
+                        if (r.err_msg === "get_brand_wcpay_request:ok") {
+                            checkout.checkIsPaySuccess()//校验数据库是否是支付
+                        } else if (r.err_msg === "get_brand_wcpay_request:cancel") {
+
+                        } else {
+                            EasyAlert.show("系统异常,请稍微再试", "", 3000);
+                        }
+                    });
+            },
+            checkPaySuccessTimer: null,
+            checkIsPaySuccess: function () {
+                checkout.checkPaySuccessTimer = setInterval(function () {
+                    $.ajax({
+                        url: '/jypay/free/common/getReturnResult',
+                        type: 'POST',
+                        data: {
+                            token: {{.T.token}},
+                        },
+                        success: function (response) {
+                            var res = response.data
+                            if (res.success) {
+                                // 清除购买页面的缓存
+                                // 直到找到支付完成订单,关闭加载动画
+                                clearInterval(checkout.checkPaySuccessTimer)
+                                // 显示支付成功提示,成功后跳转
+                                checkout.jLoading({
+                                    content: '支付成功',
+                                    iconHide: true,
+                                    duration: 1500,
+                                    callback: function () {
+                                        // 支付成功 判断有没有引流语id,有 需要埋点
+                                        checkout.buryingPoint()
+
+                                        var  bigmemberBid=checkout.getUrlParam("b");
+                                        var href ="/weixin/backend/paySuccess?orderCode=" + res.order_code + "&payTime=" + res.pay_time + "&price=" + res.return_money + "&t={{.T.t}}"
+
+                                        if(bigmemberBid==="1"){
+                                          href="/weixin/aiForecastPack/paySuccess?orderCode=" + res.order_code + "&email=" + res.email + "&payTime=" + res.payTime + "&price=" + res.price + "&t={{.T.t}}"
+                                        }
+
+                                        if (res.filter) {
+                                            href += ('&filter=' + encodeURIComponent(res.filter))
+                                        }
+
+                                        var docsId=checkout.getUrlParam("docId")
+                                        if (docsId!=null){
+                                          href +="&docsId="+docsId
+                                        }
+                                        setTimeout(function() {
+                                          location.replace(href);
+                                        }, 300)
+                                    }
+                                })
+                            }
+                        }
+                    })
+                }, 2000)
+            },
+            formatMoney: function (s, n) {
+                if (n === undefined) {
+                    n = -1
+                } else {
+                    n = n > 0 && n <= 20 ? n : 2;
+                }
+                var intS = parseInt(s)
+                var point = '.'
+                var left;
+                var right;
+                s = parseFloat((s + '').replace(/[^\d\.-]/g, ''))
+                // 没传n,默认(如果为整数,则不保留小数。如果为浮点数,则保留两位小数)
+                if (n === -1) {
+                    if (s === intS) {
+                        n = 0
+                        right = ''
+                        point = ''
+                    } else {
+                        n = 2
+                        s = s.toFixed(n);
+                        right = s.split('.')[1];
+                    }
+                    s = s + ''
+                    left = s.split('.')[0].split('').reverse();
+                } else {
+                    s = parseFloat((s + '').replace(/[^\d\.-]/g, '')).toFixed(n) + '';
+                    left = s.split('.')[0].split('').reverse();
+                    right = s.split('.')[1];
+                }
+
+                t = '';
+                for (i = 0; i < left.length; i++) {
+                    t += left[i] + ((i + 1) % 3 == 0 && (i + 1) != left.length ? ',' : '');
+                }
+
+                var money = t.split('').reverse().join('') + point + right;
+                return money;
+            },
+            jLoading: function (options) {
+                // 设置options参数的默认值
+                options.content = options.content || 'loading...'
+                options.bgc = options.bgc || 'transparent'
+                options.icon = options.icon || 'j-loading-icon'
+                options.duration = options.duration || 0
+                // 将其拼接成width: 5rem;的形式
+                options.width = options.width ? 'width:' + options.width + ';' : ''
+                var that = this
+                var bgcClassMap = {
+                    transparent: '',
+                    black: 'black'
+                }
+
+                var icon = options.iconHide ? '' : 'icon';
+                var html = '<div class="j-loading"><div class="j-mask ' + bgcClassMap[options.bgc] + '"></div><div class="j-toast ' + icon + '" style="' + options.width + '"><i class="j-toast_icon ' + options.icon + '"></i><p class="j-toast_content">' + options.content + '</p></div></div>'
+                var _html = $(html)
+                $('body').append(_html)
+                _html.fadeIn(this.loadingTransition)
+
+                var _loading = {
+                    _html: _html,
+                    hide: function (callback) {
+                        this._html.fadeOut(that.loadingTransition, function () {
+                            this.remove()
+                            callback && callback()
+                        })
+                    }
+                }
+
+                if (options.duration > 0) {
+                    setTimeout(function () {
+                        _loading.hide(options.callback)
+                    }, options.duration)
+                }
+
+                return _loading
+            },
+            getUrlParam:function(name) {
+                var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
+                var r = window.location.search.substr(1).match(reg);
+                if (r != null)
+                    return unescape(r[2]);
+                return null;
+            },
+            // 埋点
+            buryingPoint: function () {
+                if (checkout.getUrlParam('mid')) {
+                    try {
+                        $.ajax({
+                            type: "POST",
+                            url: "/publicapply/drainage/bmt/" + checkout.getUrlParam('mid'),
+                            data: {
+                                p: 'Paid'
+                            }
+                        })
+                    } catch (error) {
+                        console.log(error)
+                    }
+                }
+                    // 采购单位画像引流过来的埋点
+                if (checkout.getUrlParam('bid')) {
+                    try {
+                        var params = {
+                            mold: 'isPaid'
+                        }
+                        $.ajax({
+                            type: 'POST',
+                            url: '/publicapply/drainage/buyerunit',
+                            contentType: "application/json",
+                            data: JSON.stringify(params)
+                        })
+                    } catch (error) {
+                        console.log(error)
+                    }
+                }
+            }
+        }
+        checkout.init()
+        window.checkout = checkout
+    })
+</script>
+{{include "/common/baiducc.html"}}
+</body>
+
+</html>

+ 8 - 2
src/web/templates/order/pc/buyerPortraitPack/detail.html

@@ -145,7 +145,13 @@
                         // 已取消和已退款订单不显示优惠信息
                         if (r.data.order.order_status != -2 && r.data.order.order_status != -3) {
                             if (getPayMoney) {
-                                insetDom.after('<p>实付金额:¥' + formatMoney(getPayMoney) +'元</p>')
+                                // insetDom.after('<p>实付金额:¥' + formatMoney(getPayMoney) +'元</p>')
+                                if(!r.data.order.refund_status) {
+                                  insetDom.after('<p>实付金额:¥' + formatMoney(getPayMoney) +'元</p>')
+                                } else {
+                                  const dom = `<span style="margin-left: 20px;color: #FF3A20;font-size:14px">退款成功</span>`
+                                  insetDom.after('<p>实付金额:¥' + formatMoney(getPayMoney) +'元'+ dom + '</p>')
+                                }
                             }
                             if (getCouponMoney) {
                                 insetDom.after('<p>优惠金额:-¥' + formatMoney(getCouponMoney) +'元</p>')
@@ -190,7 +196,7 @@
                             $(".pay_num_p").css("display", "");
                             if (r.data.transaction_id) $(".pay_num").text(r.data.transaction_id);
                             //发票
-                            if (r.data.order.is_can_invoice) {
+                            if (r.data.order.is_can_invoice && !r.data.order.refund_status) {
                                 $(".openinvoice").css("display", "");
                             }
                             if (r.data.invoice_show) {

+ 8 - 2
src/web/templates/order/pc/docMember/detail.html

@@ -204,7 +204,13 @@
                     // 已取消和已退款订单不显示优惠信息
                     if (r.data.order.order_status != -2 && r.data.order.order_status != -3) {
                       if (r.data.order.order_status != 0) {
-                          insetDom.after('<p>实付金额:¥' + formatMoney(getPayMoney) + '元</p>')
+                          // insetDom.after('<p>实付金额:¥' + formatMoney(getPayMoney) + '元</p>')
+                          if(!r.data.order.refund_status) {
+                            insetDom.after('<p>实付金额:¥' + formatMoney(getPayMoney) +'元</p>')
+                          } else {
+                            const dom = `<span style="margin-left: 20px;color: #FF3A20;font-size:14px">退款成功</span>`
+                            insetDom.after('<p>实付金额:¥' + formatMoney(getPayMoney) +'元'+ dom + '</p>')
+                          }
                       }
                       // insetDom.after('<p>优惠金额:-¥' + formatMoney(prodMoney / 100) + '元</p>')
                       if (getCouponMoney) {
@@ -283,7 +289,7 @@
                           }
                       }
                       //发票
-                      if (r.data.order.is_can_invoice) {
+                      if (r.data.order.is_can_invoice && !r.data.order.refund_status) {
                           $(".openinvoice").css("display", "");
                       }
                       if (r.data.order.invoice_show) {

+ 8 - 2
src/web/templates/order/pc/filePack/detail.html

@@ -145,7 +145,13 @@
                         // 已取消和已退款订单不显示优惠信息
                         if (r.data.order.order_status != -2 && r.data.order.order_status != -3) {
                             if (getPayMoney) {
-                                insetDom.after('<p>实付金额:¥' + formatMoney(getPayMoney) +'元</p>')
+                                // insetDom.after('<p>实付金额:¥' + formatMoney(getPayMoney) +'元</p>')
+                                if(!r.data.order.refund_status) {
+                                  insetDom.after('<p>实付金额:¥' + formatMoney(getPayMoney) +'元</p>')
+                                } else {
+                                  const dom = `<span style="margin-left: 20px;color: #FF3A20;font-size:14px">退款成功</span>`
+                                  insetDom.after('<p>实付金额:¥' + formatMoney(getPayMoney) +'元'+ dom + '</p>')
+                                }
                             }
                             if (getCouponMoney) {
                                 insetDom.after('<p>优惠金额:-¥' + formatMoney(getCouponMoney) +'元</p>')
@@ -190,7 +196,7 @@
                             $(".pay_num_p").css("display", "");
                             if (r.data.transaction_id) $(".pay_num").text(r.data.transaction_id);
                             //发票
-                            if (r.data.order.is_can_invoice) {
+                            if (r.data.order.is_can_invoice && !r.data.order.refund_status) {
                                 $(".openinvoice").css("display", "");
                             }
                             if (r.data.invoice_show) {

+ 6 - 1
src/web/templates/order/pc/integral/integralDetail.html

@@ -160,7 +160,12 @@
                     // 已取消和已退款订单不显示优惠信息
                     if (r.data.order_status != -2 && r.data.order_status != -3) {
                         if (getPayMoney) {
+                          if(!r.data.refund_status) {
                             insetDom.after('<p>实付金额:¥' + formatMoney(getPayMoney) +'元</p>')
+                          } else {
+                            const dom = `<span style="margin-left: 20px;color: #FF3A20;font-size:14px">退款成功</span>`
+                            insetDom.after('<p>实付金额:¥' + formatMoney(getPayMoney) +'元'+ dom + '</p>')
+                          }
                         }
                         if (getCouponMoney) {
                             insetDom.after('<p>优惠金额:-¥' + formatMoney(getCouponMoney) +'元</p>')
@@ -200,7 +205,7 @@
                             $(".pay_num_p").show();
                         }
                         //发票
-                        if (r.data.is_can_invoice) {
+                        if (r.data.is_can_invoice && r.data.refund_status) {
                             $(".openinvoice").css("display", "");
                         }
                         if (r.data.invoice_show) {

+ 9 - 2
src/web/templates/order/pc/reportDownloadPack/detail.html

@@ -156,7 +156,14 @@
               // 已取消和已退款订单不显示优惠信息
               if (r.data.order.order_status != -2 && r.data.order.order_status != -3) {
                 if (getPayMoney) {
-                  insetDom.after('<p>实付金额:¥' + formatMoney(getPayMoney) +'元</p>')
+                  // const dom = `<span style="color: #FF3A20;font-size:14px">退款成功</span>`
+                  // insetDom.after('<p>实付金额:¥' + formatMoney(getPayMoney) +'元'+ dom + '</p>')
+                  if(!r.data.order.refund_status) {
+                    insetDom.after('<p>实付金额:¥' + formatMoney(getPayMoney) +'元</p>')
+                  } else {
+                    const dom = `<span style="margin-left: 20px;color: #FF3A20;font-size:14px">退款成功</span>`
+                    insetDom.after('<p>实付金额:¥' + formatMoney(getPayMoney) +'元'+ dom + '</p>')
+                  }
                 }
                 if (getCouponMoney) {
                   insetDom.after('<p>优惠金额:-¥' + formatMoney(getCouponMoney) +'元</p>')
@@ -201,7 +208,7 @@
                 $(".pay_num_p").css("display", "");
                 if (r.data.transaction_id) $(".pay_num").text(r.data.transaction_id);
                 //发票
-                if (r.data.order.is_can_invoice) {
+                if (r.data.order.is_can_invoice && r.data.order.refund_status) {
                   $(".openinvoice").css("display", "");
                 }
                 if (r.data.invoice_show) {

+ 5 - 2
src/web/templates/pc/entniche_orderDetail.html

@@ -100,8 +100,11 @@
                         <p>产品类型:企业商机管理<span class="vip_type"></span></p>
                         <p class="pay_way_p" style="display:none">支付方式:<span class="pay_way"></span></p>
                         <p class="pay_num_p" style="display:none">支付单号:<span class="pay_num"></span></p>
-                        <p class="price_p">实付金额:¥<span class="price"></span>元 &nbsp; <span class="valuationList"
-                                                                                           style="color:#2CB7CA;display:none;cursor:pointer">计费清单</span>
+                        <p class="price_p">
+                          实付金额:¥
+                          <span class="price"></span>
+                          元 &nbsp; 
+                          <span class="valuationList" style="color:#2CB7CA;display:none;cursor:pointer">计费清单</span>
                         </p>
                     </div>
                 </div>

+ 8 - 2
src/web/templates/pc/medaratus_orderDetail.html

@@ -205,7 +205,13 @@
                         // 已取消和已退款订单不显示优惠信息
                         if (r.data.order.order_status != -2 && r.data.order.order_status != -3) {
                                 if (r.data.order.order_status!=0){
-                                  insetDom.after('<p>实付金额:¥' + formatMoney(getPayMoney) +'元</p>')
+                                  // insetDom.after('<p>实付金额:¥' + formatMoney(getPayMoney) +'元</p>')
+                                  if(!r.data.order.refund_status) {
+                                    insetDom.after('<p>实付金额:¥' + formatMoney(getPayMoney) +'元</p>')
+                                  } else {
+                                    const dom = `<span style="margin-left: 20px;color: #FF3A20;font-size:14px">退款成功</span>`
+                                    insetDom.after('<p>实付金额:¥' + formatMoney(getPayMoney) +'元'+ dom + '</p>')
+                                  }
                                 }
                             if (getCouponMoney) {
                                 insetDom.after('<p>优惠金额:-¥' + formatMoney(getCouponMoney) +'元</p>')
@@ -293,7 +299,7 @@
                                 $(".pay_num").text(r.data.transaction_id);
                             }
                             //发票
-                            if (r.data.is_can_invoice) {
+                            if (r.data.is_can_invoice && !r.data.refund_status) {
                                 $(".openinvoice").css("display", "");
                             } 
                             if (r.data.invoice_show) {

+ 8 - 3
src/web/templates/pc/member_orderDetail.html

@@ -274,7 +274,12 @@
                     $(".price").text("¥ " + formatMoney(prodMoney / 100) + "元");
                     if (r.data.order_status != -2 && r.data.order_status != -3) {
                         if (getPayMoney) {
-                            insetDom.after('<p>实付金额:¥' + formatMoney(getPayMoney) +'元</p>')
+                            if(!r.data.refund_status) {
+                              insetDom.after('<p>实付金额:¥' + formatMoney(getPayMoney) +'元</p>')
+                            } else {
+                              const dom = `<span style="margin-left: 20px;color: #FF3A20;font-size:14px">退款成功</span>`
+                              insetDom.after('<p>实付金额:¥' + formatMoney(getPayMoney) +'元'+ dom + '</p>')
+                            }
                         }
                         if (getCouponMoney) {
                             insetDom.after('<p>优惠金额:-¥' + formatMoney(getCouponMoney) +'元</p>')
@@ -294,7 +299,7 @@
                       cycle+="天"
                       $(".vip_type").text("-试用版")
                     }else{
-                      if (filterObj.createType||filterObj.cycleType===0){
+                      if (filterObj.cycleType===0){
                         cycle+="个月";
                       }else{
                         cycle+="年"
@@ -351,7 +356,7 @@
                           $(".pay_num").text(r.data.prepay_id);
                            $(".pay_num_p").show();
                         }
-                        if (r.data.is_can_invoice) {
+                        if (r.data.is_can_invoice && !r.data.refund_status) {
                             $(".openinvoice").css("display", "").on("click", function () {
                                 // return false // 待可开发票时删除
                                 window.open("/front/order/invoice/" + orderCode, '_self');

+ 12 - 6
src/web/templates/pc/myOrder.html

@@ -481,6 +481,7 @@
                       <span v-else>-¥@#getProdMoney(item) | FormatNum#@</span>
                     </div>
                     <div>实付金额:<span class="ss">¥@#item.pay_money | FormatNum#@</span></div>
+                    <!-- <div><span style="margin-left: 20px; color: #FF3A20;font-size:14px">退款成功</span></div> -->
                   </div>
                   <!-- 权益码单独处理商品价格 -->
                   <div class="money-group" v-else-if="item.filter.badge === 'exchange'">
@@ -509,8 +510,13 @@
                     <div v-if="item.discount_price && item.order_status != -2 && item.order_status != -3">
                       优惠金额:<span>-¥@#item.discount_price | FormatNum#@</span></div>
 
-                    <div v-if="(item.pay_money || item.pay_money === 0) && item.order_status != -2 && item.order_status != -3">实付金额:<span
-                        class="ss">¥@#item.pay_money | FormatNum#@</span></div>
+                    <div v-if="(item.pay_money || item.pay_money === 0) && item.order_status != -2 && item.order_status != -3">
+                      实付金额:
+                      <span class="ss">¥@#item.pay_money | FormatNum#@</span>
+                    </div>
+                    <div v-if="item.refund_status && item.refund_status > 0" style="justify-content: flex-end;">
+                      <span style="margin-left: 20px; color: #FF3A20;font-size:14px">退款成功</span>
+                    </div>
                   </div>
 
 
@@ -576,7 +582,7 @@
                           '再次' : '去'#@支付</a></p>
                       <p><a data-jy-track="click-hover" @click="goCancel(item)">取消订单</a></p>
                     </div>
-                    <div v-if="item.order_status === 1 && item.filter.badge!='exchange'">
+                    <div v-if="item.order_status === 1 && item.filter.badge!='exchange' && !item.refund_status">
                       <p><a v-if="item.is_can_invoice" data-jy-track="click-hover"
                           @click="goInvoice(item)">开发票</a></p>
                       <p><a v-if="item.invoice_show" data-jy-track="click-hover" @click="goInvoice(item, 'info')">发票信息</a></p>
@@ -594,7 +600,7 @@
                       <p><a class="go_pay" data-jy-track="click-hover" @click="goPay(item)">去支付</a></p>
                       <p><a data-jy-track="click-hover" @click="goCancel(item)">取消订单</a></p>
                     </div>
-                    <div v-if="item.order_status === 1 && item.filter.badge!='exchange'">
+                    <div v-if="item.order_status === 1 && item.filter.badge!='exchange' && !item.refund_status">
                       <!--                                        <div v-if="(item.filter.canInvoice !=undefined  && !item.filter.canInvoice)">-->
                       <p><a v-if="item.is_can_invoice" data-jy-track="click-hover"
                           @click="goInvoice(item)">开发票</a></p>
@@ -614,7 +620,7 @@
                     <p v-if="item.order_status === 0"><a data-jy-track="click-hover" @click="goCancel(item)">取消订单</a>
                     </p>
                     <!--已完成 && && item.filter.badge!='exchange' P307 权益码兑换 不开发票-->
-                    <p v-if="item.order_status === 1 && item.filter.badge!='exchange'"><a
+                    <p v-if="item.order_status === 1 && item.filter.badge!='exchange' && !item.refund_status"><a
                         v-if="item.is_can_invoice"
                         data-jy-track="click-hover" @click="goInvoice(item)">开发票</a></p>
                     <p v-if="item.order_status === 1"><a v-if="item.invoice_show" data-jy-track="click-hover" @click="goInvoice(item, 'info')">发票信息</a></p>
@@ -995,7 +1001,7 @@
               v.memberInfo.cycle = v.filter.cycle + "天";
             } else {
               v.memberInfo.cycle = v.filter.cycle + "年";
-              if (v.filter.createType || v.filter.cycleType === 0) {
+              if (v.filter.cycleType === 0) {
                 v.memberInfo.cycle = v.filter.cycle + "个月";
               }
             }

Einige Dateien werden nicht angezeigt, da zu viele Dateien in diesem Diff geändert wurden.