Przeglądaj źródła

Merge branch 'dev/v4.8.72_zsy' of qmx/jy into feature/v4.8.72

zhangsiya 1 rok temu
rodzic
commit
51abdb4fa0

+ 2 - 2
src/jfw/modules/app/src/web/templates/frontRouter/fileRecord/sess/index.html

@@ -3,7 +3,7 @@
 <head>
     <!--引入公共资源头部-->
     {{include "/big-member/meta.html"}}
-    <title>附件下载</title>
+    <title>附件下载</title>
     <!--S-当前页面的css资源-->
     <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 />
@@ -259,7 +259,7 @@
                             <div class="p-row upgrade-row">
                                 <p class="row-top">
                                     <span>1、服务升级</span>
-                                    <span class="handle-text"   @click="consultKf">咨询客服 <em class="j-icon icon-arrow-right"></em></span>
+                                    <span class="handle-text"   @click="consultKf">联系客服 <em class="j-icon icon-arrow-right"></em></span>
                                 </p>
                                 <p>您当前是大会员用户,目前不享有附件下载权益。您可以联系客服进行服务升级后获得。</p>
                             </div>

+ 35 - 5
src/jfw/modules/app/src/web/templates/weixin/wxinfocontent.html

@@ -2084,6 +2084,31 @@
         })
     }
 
+    // 获取当前用户剑鱼币兑换的数量(免费用户下载次数判断需要)
+    var freeDownloadNum = 0
+    function subPoint() {
+      $.ajax({
+        url: '/jypay/resourcePack/account',
+        type: 'POST',
+        contentType: 'application/x-www-form-urlencoded',
+        data: {
+          product: 'attachmentDownPack'
+        },
+        dataType: 'json'
+      }).done(res => {
+        if (res.error_msg === '' && res.data && res.data.data) {
+          try {
+            if(window.isFree) {
+              freeDownloadNum =  res.data.data[0].number
+              var str = '免费用户享有' + freeDownloadNum + '次附件下载权益'
+              $('.free-down-text').text(str)
+            }
+          } catch (e) {
+            console.warn(e)
+          }
+        }
+      })
+    }
     // 附件下载展示
     function andownload() {
         $.ajax({
@@ -2113,7 +2138,7 @@
                       var url = $(this).find('a').attr('data-href')
                       var size = $(this).find('a').attr('date-size')
                       var fileName = $(this).find('a').text()
-                      console.log(window.isNoMember, window.isFree,window.freeFile, window.vipStatus, window.viper)
+                      console.log(window.isNoMember, window.isFree,window.freeFile, freeDownloadNum,window.vipStatus, window.viper)
                       // 免费用户
                       if (window.isFree) {
                         // 判断有无体验过 0:未体验过
@@ -2121,11 +2146,12 @@
                           // 判断有无留过资 且未体验过 - 去留资
                           location.href = '/jyapp/frontPage/bigmember/free/perfect_info?source=article_attach_freeuser'
                           return
-                        } else if (window.freeFile < 0 ) {
-                          // 免费用户 体验过 下载次数为-1 弹框提醒跳至超级订阅购买页
+                        } else if (window.freeFile < 0 && freeDownloadNum <= 0) {
+                          // 免费用户 体验过(freeFile=-1) 剩余下载次数 弹框提醒跳至超级订阅购买页
+                          // message: '您已经免费解锁过【附件下载】权益1次,暂无免费查看权限。如需查看更多,请开通超级订阅获取更多权限。',
                           vant.Dialog.confirm({
                             title: '开通超级订阅',
-                            message: '您已经免费解锁过【附件下载】权益1次,暂无免费查看权限。如需查看更多,请开通超级订阅获取更多权限。',
+                            message: '您的免费【附件下载】次数已使用完,暂无免费查看权限。如需查看更多,请开通超级订阅获取更多权限。',
                             showCancelButton: true,
                             confirmButtonText: '去开通',
                             confirmButtonColor: '#2ABDD1',
@@ -3456,8 +3482,12 @@
           isPageHide = true;
       });
       if (canRead) {
+        subPoint()
         // 有权限查看的才会下载附件
-        andownload()
+        setTimeout(function(){
+          andownload()
+        }, 500)
+
       }
       // 收藏
       $('.collec_star').on('click', function () {

+ 34 - 1
src/web/staticres/me/js/phone_bind.js

@@ -41,7 +41,9 @@ var vm = new Vue({
         },
         conf: {
             phoneReg: /^1[3-9]\d{9}$/
-        }
+        },
+        // 剑鱼币任务信息
+        pointTaskInfo: {}
     },
     computed: {
         someText: function () {
@@ -112,6 +114,10 @@ var vm = new Vue({
           // 埋点--打开绑定手机号页面
           _this.trackClick('绑定-打开绑定手机号页面')
         }
+      // 获取剑鱼币任务信息
+      if(this.from === 'task' && this.type === 'bind'){
+        this.getPointsTask()
+      }
     },
     methods: {
         // 注册埋点
@@ -390,6 +396,9 @@ var vm = new Vue({
                 this.setPhone(function (state) {
                     _this.bindPhoneSuccess(state)
                 })
+                if(this.form === 'task'){
+                  _this.pointsTaskSuccessTip()
+                }
             } else {
                 console.log('更换手机号...')
                 this.setPhone(function () {
@@ -397,5 +406,29 @@ var vm = new Vue({
                 })
             }
         },
+        // 获取剑鱼币数据
+        getPointsTask: function() {
+          var _this = this
+          $.ajax({
+            type: 'POST',
+            url: '/jyActivity/task',
+            success: function (res) {
+              if (res.error_code == 0 && res.data) {
+                var arr = res.data.taskType === 1 ? res.data.limitedTask : res.data.newbieTask
+                var infoArr = arr.filter(function(item) {
+                  return item.type === 'bindPhone'
+                })
+                _this.pointTaskInfo = infoArr.length > 0 ? infoArr[0] : {}
+              } else {
+                _this.pointTaskInfo = {point: 0}
+              }
+            }
+          })
+        },
+        // 赚剑鱼币任务完成提示
+        pointsTaskSuccessTip () {
+          var point = this.pointTaskInfo.point || 0
+          this.showToast(`绑定手机号成功,获得${point}剑鱼币。`)
+        }
     }
 })

+ 2 - 2
src/web/templates/frontRouter/wx/fileRecord/sess/index.html

@@ -14,7 +14,7 @@
     <meta name="apple-mobile-web-app-capable" content="yes">
     <meta name="apple-mobile-web-app-status-bar-style" content="black">
     <meta name="format-detection" content="telephone=no">
-    <title>附件下载</title>
+    <title>附件下载</title>
     <script src="/big-member/js/rem.js"></script>
     <!--S-当前页面的css资源-->
     <link rel="stylesheet" href=//cdn-common.jianyu360.com/cdn/lib/reset-css/5.0.1/reset.min.css />
@@ -267,7 +267,7 @@
                             <div class="p-row upgrade-row">
                                 <p class="row-top">
                                     <span>1、服务升级</span>
-                                    <span class="handle-text"   @click="consultKf">咨询客服 <em class="j-icon icon-arrow-right"></em></span>
+                                    <span class="handle-text"   @click="consultKf">联系客服 <em class="j-icon icon-arrow-right"></em></span>
                                 </p>
                                 <p>您当前是大会员用户,目前不享有附件下载权益。您可以联系客服进行服务升级后获得。</p>
                             </div>

+ 34 - 6
src/web/templates/weixin/wxinfocontent_rec.html

@@ -2318,7 +2318,31 @@ function openFileDown (url) {
     }
 
     getCanBiaoInfo()
-
+    // 获取当前用户剑鱼币兑换的数量(免费用户下载次数判断需要)
+    var freeDownloadNum = 0
+    function subPoint() {
+      $.ajax({
+        url: '/jypay/resourcePack/account',
+        type: 'POST',
+        contentType: 'application/x-www-form-urlencoded',
+        data: {
+          product: 'attachmentDownPack'
+        },
+        dataType: 'json'
+      }).done(res => {
+        if (res.error_msg === '' && res.data && res.data.data) {
+          try {
+            if(window.isFree) {
+              freeDownloadNum =  res.data.data[0].number
+              var str = '免费用户享有' + freeDownloadNum + '次附件下载权益'
+              $('.free-down-text').text(str)
+            }
+          } catch (e) {
+            console.warn(e)
+          }
+        }
+      })
+    }
 // 附件下载展示
 function andownload() {
     $.ajax({
@@ -2362,11 +2386,12 @@ function andownload() {
                     if (window.freeFile==0) {
                       location.href = '/weixin/frontPage/bigmember/free/perfect_info?source=article_attach_freeuser'
                       return
-                    }else if (window.freeFile < 0 ) {
-                      // 免费用户 体验过 下载次数为-1 弹框提醒跳至超级订阅购买页
+                    }else if (window.freeFile < 0 && freeDownloadNum <= 0) {
+                      // 免费用户 体验过(freeFile=-1) 剩余下载次数 弹框提醒跳至超级订阅购买页
+                      // 您已经免费解锁过【附件下载】权益1次,暂无免费查看权限。如需查看更多,请开通超级订阅获取更多权限。
                       vant.Dialog.confirm({
                         title: '开通超级订阅',
-                        message: '您已经免费解锁过【附件下载】权益1次,暂无免费查看权限。如需查看更多,请开通超级订阅获取更多权限。',
+                        message: '您的免费【附件下载】次数已使用完,暂无免费查看权限。如需查看更多,请开通超级订阅获取更多权限。',
                         showCancelButton: true,
                         confirmButtonText: '去开通',
                         confirmButtonColor: '#2ABDD1',
@@ -2694,8 +2719,11 @@ $(function(){
         }
 	});
 	if (canRead) {
-		// 有权限查看的才会下载附件
-		andownload()
+      subPoint()
+      // 有权限查看的才会下载附件
+      setTimeout(function() {
+        andownload()
+      }, 500)
 	}
 	//
 	$(".null-no").click(function(){