Эх сурвалжийг харах

Merge branch 'master' into feature/v4.8.83

lianbingjie 1 жил өмнө
parent
commit
e80f75d81c

+ 14 - 0
src/jfw/modules/subscribepay/src/entity/basePack.go

@@ -26,6 +26,18 @@ func (this *UseBalanceStruct) defaultConsume() (r map[string]interface{}, m stri
 	return
 }
 
+// KeyAccountConsume 大客户平台 无权限限制
+func (this *UseBalanceStruct) KeyAccountConsume() (r map[string]interface{}, m string, c int) {
+	_fileName := this.Remarks["fileName"].(string)
+	_id := this.Remarks["id"].(string)
+	if this.Remarks["infoType"] != nil && this.Remarks["infoType"].(string) == "S" {
+		r = SupplyInfoFile(_fileName, _id)
+	} else {
+		r = fileAttachRpc(_fileName, _id)
+	}
+	return
+}
+
 // 附件下载消费 fui:免费赠送已使用次数;pui:付费权限已使用次数
 func (this *UseBalanceStruct) fileConsume() (r map[string]interface{}, m string, c int) {
 	_fileName := this.Remarks["fileName"].(string)
@@ -240,6 +252,8 @@ func JyConsumePack(userId, product, platform string, remarks map[string]interfac
 	switch product {
 	case "附件下载包":
 		r, m, c = CStruct.fileConsume()
+	case "大客户平台":
+		r, m, c = CStruct.KeyAccountConsume()
 	default:
 		r, m, c = CStruct.defaultConsume()
 	}

+ 9 - 3
src/jfw/modules/subscribepay/src/service/basePack.go

@@ -4,6 +4,7 @@ import (
 	"fmt"
 	"jy/src/jfw/modules/subscribepay/src/entity"
 	"log"
+	"strings"
 	"time"
 
 	. "app.yhyue.com/moapp/jybase/api"
@@ -49,11 +50,16 @@ func (this *ResourcePack) ConsumePack() {
 			return nil, "参数有误"
 		}
 		remarks := map[string]interface{}{
-			"title":    this.GetString("title"),                                                                                                                              //详情页标题
-			"fileName": this.GetString("fileName"),                                                                                                                           //附件名称
-			"id":       qutil.If(infoType != "" && infoType == "S", encrypt.SE.DecodeString(this.GetString("id")), encrypt.DecodeArticleId2ByCheck(this.GetString("id"))[0]), //详情页id
+			"title":    this.GetString("title"),                                                                                                            //详情页标题
+			"fileName": this.GetString("fileName"),                                                                                                         //附件名称
+			"id":       qutil.If(infoType == "S", encrypt.SE.DecodeString(this.GetString("id")), encrypt.DecodeArticleId2ByCheck(this.GetString("id"))[0]), //详情页id
 			"infoType": infoType,
 		}
+		//是否是大客户平台的请求  P449
+		log.Println("-----------:", strings.Contains(this.Request.Referer(), "article/entservice"))
+		if strings.Contains(this.Request.Referer(), "article/entservice") {
+			productName = "大客户平台"
+		}
 		log.Println(infoType, "----", remarks)
 		Ret, Msg, Code := entity.JyConsumePack(userId, productName, platform, remarks, this.Session())
 		if Msg != "" && Code == 0 {

+ 17 - 12
src/jfw/modules/subscribepay/src/service/resourcePack.go

@@ -10,6 +10,7 @@ import (
 	"jy/src/jfw/modules/subscribepay/src/util"
 	"log"
 	"strconv"
+	"strings"
 	"time"
 
 	. "app.yhyue.com/moapp/jybase/api"
@@ -167,18 +168,22 @@ func (this *ResourcePack) Account() {
 		this.ServeJson(Result{Error_msg: "参数错误"})
 		return
 	}
-	vipMsg := jy.GetBigVipUserBaseMsg(this.Session(), *config.Middleground)
-	dbs := &entity.FindBalanceStruct{
-		AccountId:    userId,
-		ResourceType: config.ResConf.Product[product],
-		VipState:     vipMsg.VipStatus,
-	}
-	data, err := dbs.FindBalance()
-	if err != nil {
-		this.ServeJson(Result{Error_msg: "获取失败"})
-		return
-	}
-	this.ServeJson(Result{Data: data})
+	//非大客户平台访问 P449
+	if !strings.Contains(this.Request.Referer(), "article/entservice") {
+		vipMsg := jy.GetBigVipUserBaseMsg(this.Session(), *config.Middleground)
+		dbs := &entity.FindBalanceStruct{
+			AccountId:    userId,
+			ResourceType: config.ResConf.Product[product],
+			VipState:     vipMsg.VipStatus,
+		}
+		data, err := dbs.FindBalance()
+		if err != nil {
+			this.ServeJson(Result{Error_msg: "获取失败"})
+			return
+		}
+		this.ServeJson(Result{Data: data})
+	}
+	this.ServeJson(Result{Data: map[string]interface{}{"code": 1}})
 }
 
 func (this *ResourcePack) Price() {

Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 0 - 0
src/web/staticres/common-module/login-js/jy-login-mini.umd.js


Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 0 - 0
src/web/staticres/common-module/login-js/jy-login.umd.js


+ 82 - 65
src/web/staticres/public-pc/js/article-content.js

@@ -2409,48 +2409,58 @@ function cjdyDownload (fname) {
     title:goTemplateData.params.obj.title
 },
   success:function(data){
+      //P449 大客户附件下载无限制
     if(data){
-      if (data.r&&data.r.code&&data.r.code<0&&window.vipStatus>0){
-        // 次数用完提醒去充值
-        bidVue.$confirm('您本月附件下载机会已消耗完毕,如需下载更多附件,请前往充值。', {
-          showClose:false,
-          center: true,
-          confirmButtonText: '立即充值',
-          customClass: 'custom-alert',
-          showCancelButton: true,
-          confirmButtonClass: 'custom-confirm-btn',
-          cancelButtonClass: 'custom-cancel-btn',
-          cancelButtonText: '取消'
-        }).then(function(data){
-          location.href = '/swordfish/page_big_pc/free/filePack/buy'
-        }).catch(function(){
-          //$('.open-customer').trigger('click')
-          //$('body').trigger('click')
-        });
-      }else if ((data.m && data.m!="")||data.r["downUrl"]==undefined||data.r["downUrl"]==""){
-        bidVue.$confirm('附件下载异常,请前往联系客服。', {
-          showClose:false,
-          center: true,
-          confirmButtonText: '取消',
-          customClass: 'custom-alert',
-          showCancelButton: true,
-          confirmButtonClass: 'custom-cancel-btn',
-          cancelButtonClass: 'custom-confirm-btn',
-          cancelButtonText: '联系客服'
-        }).then(function(data){
+      if (!entService){
+        if (data.r&&data.r.code&&data.r.code<0&&window.vipStatus>0){
+          // 次数用完提醒去充值
+          bidVue.$confirm('您本月附件下载机会已消耗完毕,如需下载更多附件,请前往充值。', {
+            showClose:false,
+            center: true,
+            confirmButtonText: '立即充值',
+            customClass: 'custom-alert',
+            showCancelButton: true,
+            confirmButtonClass: 'custom-confirm-btn',
+            cancelButtonClass: 'custom-cancel-btn',
+            cancelButtonText: '取消'
+          }).then(function(data){
+            location.href = '/swordfish/page_big_pc/free/filePack/buy'
+          }).catch(function(){
+            //$('.open-customer').trigger('click')
+            //$('body').trigger('click')
+          });
+        }else if ((data.m && data.m!=="")||data.r["downUrl"]===undefined||data.r["downUrl"]===""){
+          bidVue.$confirm('附件下载异常,请前往联系客服。', {
+            showClose:false,
+            center: true,
+            confirmButtonText: '取消',
+            customClass: 'custom-alert',
+            showCancelButton: true,
+            confirmButtonClass: 'custom-cancel-btn',
+            cancelButtonClass: 'custom-confirm-btn',
+            cancelButtonText: '联系客服'
+          }).then(function(data){
 
-        }).catch(function(){
-          $('.open-customer').trigger('click')
-          $('body').trigger('click')
-        });
+          }).catch(function(){
+            $('.open-customer').trigger('click')
+            $('body').trigger('click')
+          });
+        }else{
+          if(data.r&&fname == data.r["fileName"]){
+            if (!data.r["isExists"]){
+              $(".file-count").text($(".file-count").text()-1);
+            }
+            getFilePackLastCount()
+            location.href = data.r["downUrl"] + '?response-content-type=application/octet-stream'
+            //goDownload(data.r["downUrl"])
+          }
+        }
       }else{
         if(data.r&&fname == data.r["fileName"]){
           if (!data.r["isExists"]){
             $(".file-count").text($(".file-count").text()-1);
           }
-          getFilePackLastCount()
           location.href = data.r["downUrl"] + '?response-content-type=application/octet-stream'
-          //goDownload(data.r["downUrl"])
         }
       }
     }
@@ -2486,8 +2496,12 @@ function getFileData () {
         $(".downs").click(function (){
           var name = $(this).find('a').text()
           var fname = name.replace(/^\d+./, '')
-          if(window.isFree){
-            if(window.freeFile == 0){
+          //P449
+          if(location.pathname.indexOf('entservice') !== -1){
+            // 大客户来源 进入附件下载页面
+            cjdyDownload(fname)
+          }else if(window.isFree){
+            if(window.freeFile === 0){
               // 判断有无留过资 且未体验过 - 去留资
               // 弹窗留资弹框,第一个参数为source,第二个是留资成功后是否需要刷新页面 可不传,不传即为不刷新
               // 不需要再调是否留资接口 只要isAdd接口里返回得对应参数值为0 即为需要留资 直接调noCallApiFn方法弹出弹框即可
@@ -2614,35 +2628,38 @@ function getFilePackLastCount () {
 
 // 根据isAdd接口 展示附件部分dom
 function showFileSomeDom () {
-  // 免费用户展示可下载一次提示(免费用户且没有体验过附件下载权益的展示)
-  $('.free-download .text').text(window.filePackAccount.number)
-  if (window.isFree) {
-    // 免费用户未留过资。次数为0,则值置为1,点击按钮引导留资
-    if (window.freeFile == 0 && window.filePackAccount.number == 0) {
-      $('.free-download .text').text(1)
-    }
-    if (window.freeFile == 0 || window.filePackAccount.number > 0) {
-      // 展示按钮
-      $('.free-download').css('display', 'inline-block')
-      $('.free-go-open').hide()
-    } else {
-      // 展示引导超级订阅
-      $('.free-go-open').css('display', 'inline-block')
-      $('.free-download').hide()
-    }
-  }
-  // 新超级订阅用户
-  if (window.vipStatus > 0 && window.viper) {
-    $('.super-vip-show').show()
-    $('.super-vip-show .file-count').html(window.filePackAccount.number)
-    $('.recharge-new').unbind("click").bind("click",function(){
-      //超级订阅附件下载立即充值页面
-      window.open("/swordfish/page_big_pc/free/filePack/buy")
-    })
-  }
-  // 大会员隐藏次数
-  if(window.memberStatus >0 && window.memberPower.indexOf(3) >= 0){
-    $('.super-vip-show').hide()
+  //非大客户来源 P449
+  if(location.pathname.indexOf('entservice') <0) {
+    // 免费用户展示可下载一次提示(免费用户且没有体验过附件下载权益的展示)
+    $('.free-download .text').text(window.filePackAccount.number)
+    if (window.isFree) {
+      // 免费用户未留过资。次数为0,则值置为1,点击按钮引导留资
+      if (window.freeFile == 0 && window.filePackAccount.number == 0) {
+        $('.free-download .text').text(1)
+      }
+      if (window.freeFile == 0 || window.filePackAccount.number > 0) {
+        // 展示按钮
+        $('.free-download').css('display', 'inline-block')
+        $('.free-go-open').hide()
+      } else {
+        // 展示引导超级订阅
+        $('.free-go-open').css('display', 'inline-block')
+        $('.free-download').hide()
+      }
+    }
+    // 新超级订阅用户
+    if (window.vipStatus > 0 && window.viper) {
+      $('.super-vip-show').show()
+      $('.super-vip-show .file-count').html(window.filePackAccount.number)
+      $('.recharge-new').unbind("click").bind("click", function () {
+        //超级订阅附件下载立即充值页面
+        window.open("/swordfish/page_big_pc/free/filePack/buy")
+      })
+    }
+    // 大会员隐藏次数
+    if (window.memberStatus > 0 && window.memberPower.indexOf(3) >= 0) {
+      $('.super-vip-show').hide()
+    }
   }
 }
 var isEntnicheNew = goTemplateData.params.isEntnicheNew

+ 4 - 0
src/web/templates/pc/biddetail_rec.html

@@ -1886,6 +1886,10 @@ var ucbs_source="pc_rec",ucbsId="{{.T.obj.ucbsId}}";
           $('.tabfat').show()
           $(".recoveryfat").show()
           $('.free-download').hide()
+          //P449
+          $(".download-list").show()
+          $('.super-vip-show').hide()
+          $('.free-go-open').hide()
           getFileData()
           return
         }

Энэ ялгаанд хэт олон файл өөрчлөгдсөн тул зарим файлыг харуулаагүй болно