Procházet zdrojové kódy

Merge branch 'dev4.6.2.17' of http://192.168.3.207:8080/qmx/jy into dev4.6.2.17

zhangxinlei1996 před 3 roky
rodič
revize
178f5b5ea6

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

@@ -66,6 +66,10 @@
           color: #9B9CA3;
           line-height: 0.4rem;
       }
+      [v-cloak] {
+          opacity: 0;
+          transition: all 0.2s;
+      }
     </style>
 </head>
 <body>
@@ -107,7 +111,7 @@
               @cancel="canceled"
             />
           </van-popup>
-          <div class="c-list" v-show="list.length !== 0 && empty">
+          <div class="c-list">
             <van-list
               v-model="listInfo.loading"
               :finished="listInfo.finished"
@@ -130,7 +134,7 @@
                </div>
             </van-list>
           </div>
-          <van-loading size="24px" vertical v-if="working">加载中...</van-loading>
+<!--          <van-loading size="24px" vertical v-if="working">加载中...</van-loading>-->
           <div class="emptycom" v-if="list.length==0 && empty">
             <div class="emptyimg">
               <img src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/common-module/collection/image/img-empty.png?v={{Msg "seo" "version"}}' alt="">

+ 27 - 1
src/web/staticres/common-module/file-pack/js/index-wx.js

@@ -30,6 +30,32 @@ function getShortName (comName) {
   return shortname
 }
 
+function mySysIsIos() {
+  //ios终端
+  var flag1 = !!navigator.userAgent.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/);
+  var flag2 = !!navigator.userAgent.match(/\(M[^;]+; Intel Mac OS X/);
+  return flag1 || flag2
+
+}
+
+function openFileDown (url) {
+  try {
+    if (!mySysIsIos() && /\.(jpeg|jpg|png)$/.test(url)) {
+      wx.previewImage({
+        current: url, // 当前显示图片的http链接
+        urls: [url] // 需要预览的图片http链接列表
+      })
+    } else {
+      location.href = url
+    }
+  } catch (e) {
+    console.log(e)
+    if (vm && typeof vm.$toast === 'function') {
+      vm.$toast("附件微信端打开失败,请联系客服!");
+    }
+  }
+}
+
 var formatter11 = (type, val) => {
   if (type === 'year') {
     return `${val}年`;
@@ -201,7 +227,7 @@ var vm = new Vue({
 	        },
 	        success: function (r) {
 				if (r && r.m === '' && r.r) {
-      				location.href = r.r.downUrl
+                  openFileDown(r.r.downUrl)
                 }else{
                 	vant.Dialog.alert({
                         message: '附件下载异常,请联系管理员,谢谢!',

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

@@ -20,6 +20,7 @@
     <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"}}/big-member/css/public.css">
     <link rel="stylesheet" href='{{Msg "seo" "cdn"}}/common-module/portraitRecord/css/index.css?v={{Msg "seo" "version"}}' />
     <script src='https://cdn-common.jianyu360.com/cdn/lib/jquery/3.6.0/jquery.min.js'></script>
     <script src="https://cdn-common.jianyu360.com/cdn/lib/loadjs/4.2.0/dist/loadjs.umd.js"></script>
@@ -93,7 +94,12 @@
           color: #9B9CA3;
           line-height: 0.4rem;
       }
+      [v-cloak] {
+          opacity: 0;
+          transition: all 0.2s;
+      }
     </style>
+    <script type="text/javascript" src="https://res.wx.qq.com/open/js/jweixin-1.4.0.js"></script>
 </head>
 <body>
   <div class="j-container">
@@ -133,7 +139,7 @@
               @cancel="canceled"
             />
           </van-popup>
-          <div class="c-list" v-show="list.length !== 0 && empty">
+          <div class="c-list">
             <van-list
               v-model="listInfo.loading"
               :finished="listInfo.finished"
@@ -156,7 +162,6 @@
                 </div>
             </van-list>
           </div>
-          <van-loading size="24px" vertical v-if="working">加载中...</van-loading>
           <div class="emptycom" v-if="list.length==0 && empty">
             <div class="emptyimg">
               <img src='{{Msg "seo" "cdn"}}/common-module/collection/image/img-empty.png?v={{Msg "seo" "version"}}' alt="">

+ 2 - 2
src/web/templates/pc/biddetail_rec.html

@@ -3523,7 +3523,7 @@ function fromwhere(text){
               if (!data.r["isExists"]){
                 $(".file-count").text($(".file-count").text()-1);
               }
-              location.href = url
+              location.href = data.r["downUrl"]
               //goDownload(data.r["downUrl"])
 					  }
           }
@@ -3575,10 +3575,10 @@ function fromwhere(text){
             // 弹窗留资弹框,第一个参数为source,第二个是留资成功后是否需要刷新页面 可不传,不传即为不刷新
             vm.noCallApiFn('article_attach_freeuser', true)
 					}else if (window.freeFile > 0 ){
+            window.freeFile = -1
 						// 留过资 更新下载次数 进入附件下载页面
 						cjdyDownload(fname)
 					}else {
-            window.freeFile == -1
 						// 免费用户 体验过 下载次数为-1 弹框提醒跳至超级订阅购买页
 						bidVue.$alert('您已经免费解锁过【附件下载】权益1次,暂无免费查看权限。如需查看更多,请开通超级订阅获取更多权限。', '开通超级订阅', {
 							showClose:false,

+ 37 - 15
src/web/templates/weixin/wxinfocontent_rec.html

@@ -1714,6 +1714,23 @@ function getDrainInfo () {
 		})
 }
 
+function openFileDown (url) {
+	try {
+		if (!mySysIsIos() && /\.(jpeg|jpg|png)$/.test(url)) {
+			wx.previewImage({
+				current: url, // 当前显示图片的http链接
+				urls: [url] // 需要预览的图片http链接列表
+			})
+		} else {
+			location.href = url
+		}
+	} catch (e) {
+		console.log(e)
+		EasyAlert.show("附件微信端打开失败,请联系客服!");
+	}
+
+}
+
 andownload()
 // 附件下载展示
 function andownload() {
@@ -1782,13 +1799,18 @@ function andownload() {
                     // 付费用户
                     // 大会员用户 有下载权限
                     if (window.isMemberAndPower) {
-                      return location.href = '/big/wx/page/open_app?type=article-file-download'
-                      if(mySysIsIos()){
-                        iosShow(url)
-                      } else {
-                        location.href = url
-                      }
-                      return
+                      // return location.href = '/big/wx/page/open_app?type=article-file-download'
+                      // if(mySysIsIos()){
+                      //   iosShow(url)
+                      // } else {
+						try {
+							openFileDown($(this).find('a').attr('data-href') || url)
+						} catch (e) {
+							console.log(e)
+							openFileDown(url)
+						}
+					  return
+                      // }
                     }
                     //超级订阅
                     if (window.vipStatus>0){
@@ -1826,7 +1848,7 @@ function andownload() {
                                       window.fileNum = window.fileNum - 1;
                                       $('.file-count').html($('.file-count').text()-1)
                                     }
-              						          location.href = url
+									  openFileDown(url)
                                   } else {
                                       EasyAlert.show('获取附件地址失败');
                                   }
@@ -1872,8 +1894,8 @@ function andownload() {
                       return
                     }
                   }
-                  return location.href = '/big/wx/page/open_app?type=article-file-download'
-                  // gotoFilePage($(this).find('a').text())
+                  // return location.href = '/big/wx/page/open_app?type=article-file-download'
+                  gotoFilePage($(this).find('a').text())
                 })
                 //if (window.isNoMember) {
                   //向所有用户开放
@@ -1908,11 +1930,11 @@ function gotoFilePage(name){
               if (name!=""&&name == r.data.attachment[i].filename){
                 var url = r.data.attachment[i].downurl
                 if (url){
-                  if(mySysIsIos()){
-                      iosShow(url)
-                  } else {
-                      location.href = url
-                  }
+                  // if(mySysIsIos()){
+                  //     iosShow(url)
+                  // } else {
+						openFileDown(url)
+                  // }
                 }
                 break
               }