浏览代码

Merge remote-tracking branch 'origin/dev4.4' into dev4.4

wangkaiyue 4 年之前
父节点
当前提交
9969f58426

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

@@ -246,6 +246,13 @@ func (s *Subscribepay) TrialInfo() error {
 
 //订阅收费购买页面
 func (s *Subscribepay) ToPurchasePage(flag string) {
+	m, ok := public.MQFW.FindById("user", userId, `{"o_vipjy":1,"i_vip_status":1}`)
+	if !ok {
+		return s.Redirect("/swordfish/about?v=2")
+	}
+	if util.IntAll((*m)["i_vip_status"]) > 0 && flag == "new" {
+		return s.Redirect("/front/vipsubscribe/introducePage")
+	}
 	//直播活动
 	nowTime := time.Now().Unix()
 	if nowTime >= liveActiveStartTime && nowTime < liveActiveEndTime {

+ 3 - 3
src/jfw/modules/app/src/web/staticres/jyapp/vipsubscribe/js/vip_entSearch.js

@@ -51,14 +51,14 @@ var vNode = {
         }
         $.ajax({
             type: 'POST',
-            url: '/bigmember/follow/ent/association',
+            url: '/bigmember/search/ent/association',
             data: {
-                entName: searchEntName
+                name: searchEntName
             },
             success: function (res) {
                 if (res.error_code == 0) {
                     if (res.data) {
-                        _this.entList = res.data
+                        _this.entList = res.data.list
                     }
                 } else {
                     _this.$toast(res.error_msg)

+ 13 - 22
src/jfw/modules/app/src/web/staticres/jyapp/vipsubscribe/js/vip_renew.js

@@ -115,24 +115,17 @@ var renew = {
         this.price = price
         coupon.updatePrice(this.price / 100)
     },
-    // 根据选中结果得到一个时间段的时间戳
+    // 根据选中结果得到续费了多长时间的字符串
     getDuration: function (timeSelect) {
-        var dStamp = 0
-        var s = ''
-        var perMonthStamp = 1000 * 60 * 60 * 24 * 30
+        var durationStr = ''
         if (timeSelect[1] === 1) {
             // 年
-            dStamp = timeSelect[0] * 12 * perMonthStamp
-            s = timeSelect[0] + '年'
+            durationStr = timeSelect[0] + '年'
         } else if (timeSelect[1] === 2) {
             // 月
-            dStamp = timeSelect[0] * perMonthStamp
-            s = timeSelect[0] + '个月'
-        }
-        return {
-            stamp: dStamp,
-            s: s
+            durationStr = timeSelect[0] + '个月'
         }
+        return durationStr
     },
     // 计算续费后的日期区间
     calcDuration: function (needSet) {
@@ -142,11 +135,10 @@ var renew = {
             $('.select_cycle .duration').hide()
             return
         }
-        var durationInfo = this.getDuration(this.timeSelect)
-        var durationStamp = durationInfo.stamp // 续费时间段时间戳
-        var durationStr = durationInfo.s // 续费时间段字符串
+        var durationStamp = getVipEndDate(this.timeSelect[1], this.timeSelect[0], endTime) - endTime // 续费时间段时间戳
+        var durationStr = this.getDuration(this.timeSelect) // 续费时间段字符串
         var buyEndTimeString = new Date(endTime * 1000).pattern('yyyy年MM月dd日') // svip到期时间
-        var renewEndTimeString = new Date(endTime * 1000 + durationStamp).pattern('yyyy年MM月dd日') //续费后到期时间
+        var renewEndTimeString = new Date((endTime + durationStamp) * 1000).pattern('yyyy年MM月dd日') //续费后到期时间
 
         if (needSet) {
             $('.select_cycle .month').text(durationStr)
@@ -183,17 +175,16 @@ var renew = {
             return
         }
         var maxEndMonth = 36 // 最大续费36个月
-        var durationInfo = this.getDuration(timeSelect)
-        var durationStamp = durationInfo.stamp // 续费时间段时间戳
+        var durationStamp = getVipEndDate(timeSelect[1], timeSelect[0], endTime) - endTime // 续费时间段时间戳
 
         // 最长订阅周期不可超过3年 ------------
         var nowStamp = Math.floor(Date.now() / 1000)
         // 已购买的套餐剩余月数
         var lastMonthStamp = endTime - nowStamp
-        var lastMonth = Math.ceil(lastMonthStamp / (60 * 60 * 24 * 30))
+        var lastMonth = Math.round(lastMonthStamp / (60 * 60 * 24 * 30))
         // 续费后套餐剩余月数(需要加上原剩余月数lastMonth)
-        var renewMonthTotalStamp = lastMonthStamp + (durationStamp / 1000)
-        var renewMonthTotal = Math.ceil(renewMonthTotalStamp / (60 * 60 * 24 * 30))
+        var renewMonthTotalStamp = lastMonthStamp + durationStamp
+        var renewMonthTotal = Math.round(renewMonthTotalStamp / (60 * 60 * 24 * 30))
 
         if (renewMonthTotal > maxEndMonth) {
             var showTipText = '<div style="white-space: nowrap;">最长订阅周期不可超过3年</div>剩余周期:' + this.monthToYear(lastMonth).str
@@ -297,7 +288,7 @@ var renew = {
             var data = {
                 userLotteryId :coupon.$refs.couponRef.coupon.userLotteryId,
                 lotteryId : coupon.$refs.couponRef.coupon.lotteryId,
-                time : _this.getDuration(_this.timeSelect).s.trim(),
+                time : _this.getDuration(_this.timeSelect).trim(),
                 orderType: 5,
                 disWord :GetQueryString('disWord'),
                 price: _this.price

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

@@ -94,7 +94,7 @@
                 :key="index"
                 @click="toEntDetail(item)"
                 >
-                <span class="ent-name" v-html="highlightText(item.entName)"></span>
+                <span class="ent-name" v-html="highlightText(item.name)"></span>
               </li>
             </ul>
           </div>

+ 1 - 1
src/jfw/modules/weixin/src/config.json

@@ -113,7 +113,7 @@
 	},
 	"reply":[
         {
-        		"text":"Hi~欢迎关注剑鱼标讯!\n\n每日更新10万+招标采购信息,\n定制项目监控,实时跟踪全部销售线索,\n已帮助数百万用户获取全网商机!\n\n点击这里<a href='%s'>免费订阅</a>,帮你抓住每个业务机会!\n\n【超级订阅】\n<a href='%s'>点击订阅</a>,立享380-100。\n●直接对接项目联系人!\n● 招标动态第一时间推送!\n● 大容量300组关键词。\n● 每日可查看2000条招标采购信息。\n● 提供企业画像,透视中标项目、重点客户。\n● 搜索全国七千万企业信息,获取商业情报。",
+        		"text":"Hi~欢迎关注剑鱼标讯!\n\n每日更新10万+招标采购信息,\n定制项目监控,实时跟踪全部销售线索,\n已帮助数百万用户获取全网商机!\n\n点击这里<a href='%s'>免费订阅</a>,帮你抓住每个业务机会!\n\n【超级订阅】\n<a href='%s'>点击订阅</a>,立享380-100,2000-1000。\n●直接对接项目联系人!\n● 招标动态第一时间推送!\n● 大容量300组关键词。\n● 每日可查看2000条招标采购信息。\n● 提供企业画像,透视中标项目、重点客户。\n● 搜索全国七千万企业信息,获取商业情报。",
 			"href":["keysetIndex","viphomepage_new"]
         }
 	],

+ 13 - 22
src/web/staticres/vipsubscribe/js/vip_renew.js

@@ -115,24 +115,17 @@ var renew = {
         this.price = price
         coupon.updatePrice(this.price / 100)
     },
-    // 根据选中结果得到一个时间段的时间戳
+    // 根据选中结果得到续费了多长时间的字符串
     getDuration: function (timeSelect) {
-        var dStamp = 0
-        var s = ''
-        var perMonthStamp = 1000 * 60 * 60 * 24 * 30
+        var durationStr = ''
         if (timeSelect[1] === 1) {
             // 年
-            dStamp = timeSelect[0] * 12 * perMonthStamp
-            s = timeSelect[0] + '年'
+            durationStr = timeSelect[0] + '年'
         } else if (timeSelect[1] === 2) {
             // 月
-            dStamp = timeSelect[0] * perMonthStamp
-            s = timeSelect[0] + '个月'
-        }
-        return {
-            stamp: dStamp,
-            s: s
+            durationStr = timeSelect[0] + '个月'
         }
+        return durationStr
     },
     // 计算续费后的日期区间
     calcDuration: function (needSet) {
@@ -142,11 +135,10 @@ var renew = {
             $('.select_cycle .duration').hide()
             return
         }
-        var durationInfo = this.getDuration(this.timeSelect)
-        var durationStamp = durationInfo.stamp // 续费时间段时间戳
-        var durationStr = durationInfo.s // 续费时间段字符串
+        var durationStamp = getVipEndDate(this.timeSelect[1], this.timeSelect[0], endTime) - endTime // 续费时间段时间戳
+        var durationStr = this.getDuration(this.timeSelect) // 续费时间段字符串
         var buyEndTimeString = new Date(endTime * 1000).pattern('yyyy年MM月dd日') // svip到期时间
-        var renewEndTimeString = new Date(endTime * 1000 + durationStamp).pattern('yyyy年MM月dd日') //续费后到期时间
+        var renewEndTimeString = new Date((endTime + durationStamp) * 1000).pattern('yyyy年MM月dd日') //续费后到期时间
 
         if (needSet) {
             $('.select_cycle .month').text(durationStr)
@@ -183,17 +175,16 @@ var renew = {
             return
         }
         var maxEndMonth = 36 // 最大续费36个月
-        var durationInfo = this.getDuration(timeSelect)
-        var durationStamp = durationInfo.stamp // 续费时间段时间戳
+        var durationStamp = getVipEndDate(timeSelect[1], timeSelect[0], endTime) - endTime // 续费时间段时间戳
 
         // 最长订阅周期不可超过3年 ------------
         var nowStamp = Math.floor(Date.now() / 1000)
         // 已购买的套餐剩余月数
         var lastMonthStamp = endTime - nowStamp
-        var lastMonth = Math.ceil(lastMonthStamp / (60 * 60 * 24 * 30))
+        var lastMonth = Math.round(lastMonthStamp / (60 * 60 * 24 * 30))
         // 续费后套餐剩余月数(需要加上原剩余月数lastMonth)
-        var renewMonthTotalStamp = lastMonthStamp + (durationStamp / 1000)
-        var renewMonthTotal = Math.ceil(renewMonthTotalStamp / (60 * 60 * 24 * 30))
+        var renewMonthTotalStamp = lastMonthStamp + durationStamp
+        var renewMonthTotal = Math.round(renewMonthTotalStamp / (60 * 60 * 24 * 30))
 
         if (renewMonthTotal > maxEndMonth) {
             var showTipText = '<div style="white-space: nowrap;">最长订阅周期不可超过3年</div>剩余周期:' + this.monthToYear(lastMonth).str
@@ -297,7 +288,7 @@ var renew = {
             var data = {
                 userLotteryId :coupon.$refs.couponRef.coupon.userLotteryId,
                 lotteryId : coupon.$refs.couponRef.coupon.lotteryId,
-                time : _this.getDuration(_this.timeSelect).s.trim(),
+                time : _this.getDuration(_this.timeSelect).trim(),
                 orderType: 5,
                 disWord :GetQueryString('disWord'),
                 price: _this.price

+ 2 - 1
src/web/staticres/vipsubscribe/js/vip_upgrade.js

@@ -78,7 +78,7 @@ var purchase = {
       //加载价格
       $DoPost("/subscribepay/vipsubscribe/getPrice", {}, function (r) {
         if (r) {
-          purchase.price = r.new;
+          purchase.price = r;
           purchase.can1111 = r.isActiving && r.isWritten === 0
           if (purchase.can1111) {
             if (!sessionStorage.getItem("vipSubSelectTime")) {
@@ -123,6 +123,7 @@ var purchase = {
     //     old.areacount = purchase.nowBuyset.areacount
     //   }
     // }
+    console.log(old)
     Calculation.Init(this.isTrial,new Buyset(old.areacount, old.newcitys, old.buyerclasscount,old.upgrade),this.renewList, purchase.price, this.endTime)
   },
   showArea: function () {