Просмотр исходного кода

Merge branch 'release' into dev4.6.3.3

luwenna 3 лет назад
Родитель
Сommit
441c0aef07

+ 221 - 0
src/web/staticres/frontRouter/pc/fileHistory/js/index-pc.js

@@ -0,0 +1,221 @@
+function getShortName (comName) {
+  var areaMap = chinaMapJSON || []
+  var shortname = comName
+  // 1. 循环省份城市进行替换
+  areaMap.forEach(function (item) {
+    var p = item.name.replace(/[省市]/, '')
+    if (shortname.indexOf(p) !== -1) {
+      shortname = shortname.replace(item.name, '').replace(p, '')
+      console.log(p + ' -> \'\'')
+    }
+    item.city.forEach(function (iitem) {
+      var c = iitem.name.replace(/[省市]/, '')
+      if (shortname.indexOf(c) !== -1) {
+        shortname = shortname.replace(iitem.name, '').replace(c, '')
+        console.log(c + ' -> \'\'')
+      }
+      iitem.area.forEach(function (iiitem) {
+        if (shortname.indexOf(iiitem) !== -1) {
+          shortname = shortname.replace(iiitem, '')
+          console.log(iiitem + ' -> \'\'')
+        }
+      })
+    })
+  })
+  var matchRes = shortname.match(/[\u4e00-\u9fa5]{4}/gm)
+  var shortname = matchRes ? matchRes[0] : shortname.slice(0, 4)
+  if (shortname.length < 4) {
+    shortname = shortname.slice(0, 4)
+  }
+  return shortname
+}
+function debounce(func, wait) {
+  var timeout;
+  return function () {
+    var context = this;
+    var args = Array.prototype.slice.call(arguments);
+    if (timeout) clearTimeout(timeout);
+    var callNow = !timeout;
+    timeout = setTimeout(function () {
+      timeout = null;
+    }, wait);
+    if (callNow) func.apply(context, args);
+  };
+}
+function downFile (src, name) {
+  var a = document.createElement('a')
+  var event = new MouseEvent('click')
+  a.download = name || '附件名称'
+  a.href = src
+  a.dispatchEvent(event)
+}
+
+var downFileOfURL = debounce(function (src , name) {
+  return downFile(src, name)
+}, 1500)
+
+var vm = new Vue({
+  el: '.see-container',
+  delimiters: ['{', '}'],
+  data () {
+    return {
+      working: false,
+      empty: false,
+      dateVal: '',
+      years: '',
+      months: '',
+      points: {},
+      statusEnum: ['存续', '吊销', '注销', '撤销'],
+      statusColors: ['#2CB7CA', '#F5AF5C', '#58A1E7', '#51CEA2'],
+      seeList: {
+        pageNum: 1, // 当前页
+        pageSize: 10, // 每页多少条数据
+        total: 0, // 总页数
+        list: [] // 返回的数据
+      },
+      helpDialog: false,
+      tipDialog: false
+    }
+  },
+  computed: {
+    dialogBtnText: function() {
+      if (this.points.provin == -1) {
+        return '联系客服'
+      } else {
+        return '前往升级'
+      }
+    }
+  },
+  created () {
+    this.years = new Date().getFullYear()
+    this.months = parseInt(new Date().getMonth() + 1)
+    this.dateVal = new Date()
+    this.subPoint()
+    this.subRecord()
+  },
+  methods: {
+    cellClick (row, column, cell, event) {
+      console.log(row, column, cell, event)
+      if (column.label === '附件') {
+    	$.ajax({
+	        type: 'post',
+	        url: '/jypay/resourcePack/consumePack',
+	        data: {
+	            productName: '附件下载包',
+	            platform: 'PC',
+	            fileName: row.s_fileName,
+	            id: row.s_id,
+	            title: row.s_title
+	        },
+	        success: function (r) {
+				if (r && r.m === '' && r.r) {
+					downFileOfURL(r.r.downUrl, row.s_fileName);
+                }else{
+                	console.log("附件下载异常,请联系管理员,谢谢!")
+                }
+			}
+		})
+        return
+      }
+      if (column.label === '公告来源') {
+        location.href = row.articleUrl
+      }
+    },
+    indexMethod (index) {
+      return ((this.seeList.pageNum - 1) * this.seeList.pageSize) + index + 1
+    },
+    showTip () {
+      this.tipDialog = true
+    },
+    goHandle (item) {
+      if (item == '前往升级') {
+        window.open('/swordfish/page_big_pc/free/svip/buy?type=upgrade')
+        this.tipDialog = false
+      } else {
+        $('.open-customer').unbind('click').trigger('click')
+        this.tipDialog = false
+      }
+    },
+    subPoint () {
+      var _this = this
+      $.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) {
+            this.points = {
+              total: 0,
+              usage: 0
+            }
+            try {
+              var tempInfo = res.data.data[0]
+              this.points = {
+                total: tempInfo.number,
+                usage: tempInfo.number
+              }
+              if (this.points.usage > tempInfo.thirtyNum) {
+                this.points.usage = tempInfo.thirtyNum
+              }
+            } catch (e) {
+              console.warn(e)
+          }
+          }
+      })
+    },
+    getDatas () {
+      return {
+        queryTime: new Date(this.years, this.months - 1, 1).pattern('yyyy-MM'),
+        platform: 'PC',
+        productName: '附件下载包',
+        pageSize: this.seeList.pageSize,
+        pageNum: this.seeList.pageNum
+      }
+    },
+    subRecord () {
+      this.working = true
+      this.empty = false
+      $.ajax({
+       url: '/jypay/resourcePack/recordList',
+        type: 'POST',
+        contentType: 'application/x-www-form-urlencoded',
+        data: this.getDatas(),
+        dataType: 'json'
+      }).done(res => {
+        var _this = this
+        if (res.error_code === 0) {
+          this.working = false
+          this.empty = true
+          if (res.data.total) {
+            this.seeList.total = res.data.total
+          }
+          if (!res.data.list) {
+            res.data.list = []
+            return
+          }
+          this.seeList.list = this.seeList.list.concat(res.data.list)
+        }
+      })
+    },
+    onPageChange (page) {
+      this.seeList.pageNum = page
+      this.seeList.list = []
+      this.subRecord()
+    },
+    dateHandler (val) {
+      this.years = val.getFullYear()
+      this.months = val.getMonth() + 1
+      this.seeList.pageNum = 1
+      this.seeList.total = 0
+      this.seeList.list = []
+      this.subRecord()
+    },
+    detailed (ids) {
+      window.open('/swordfish/page_big_pc/unit_portrayal/' + ids, '_blank')
+    }
+  }
+})

+ 22 - 84
src/web/staticres/frontRouter/pc/seeBuyerHistory/js/index-pc.js

@@ -29,31 +29,6 @@ function getShortName (comName) {
   }
   return shortname
 }
-function debounce(func, wait) {
-  var timeout;
-  return function () {
-    var context = this;
-    var args = Array.prototype.slice.call(arguments);
-    if (timeout) clearTimeout(timeout);
-    var callNow = !timeout;
-    timeout = setTimeout(function () {
-      timeout = null;
-    }, wait);
-    if (callNow) func.apply(context, args);
-  };
-}
-function downFile (src, name) {
-  var a = document.createElement('a')
-  var event = new MouseEvent('click')
-  a.download = name || '附件名称'
-  a.href = src
-  a.dispatchEvent(event)
-}
-
-var downFileOfURL = debounce(function (src , name) {
-  return downFile(src, name)
-}, 1500)
-
 var vm = new Vue({
   el: '.see-container',
   delimiters: ['{', '}'],
@@ -94,36 +69,6 @@ var vm = new Vue({
     this.subRecord()
   },
   methods: {
-    cellClick (row, column, cell, event) {
-      console.log(row, column, cell, event)
-      if (column.label === '附件') {
-    	$.ajax({
-	        type: 'post',
-	        url: '/jypay/resourcePack/consumePack',
-	        data: {
-	            productName: '附件下载包',
-	            platform: 'PC',
-	            fileName: row.s_fileName,
-	            id: row.s_id,
-	            title: row.s_title
-	        },
-	        success: function (r) {
-				if (r && r.m === '' && r.r) {
-					downFileOfURL(r.r.downUrl, row.s_fileName);
-                }else{
-                	console.log("附件下载异常,请联系管理员,谢谢!")
-                }
-			}
-		})
-        return
-      }
-      if (column.label === '公告来源') {
-        location.href = row.articleUrl
-      }
-    },
-    indexMethod (index) {
-      return ((this.seeList.pageNum - 1) * this.seeList.pageSize) + index + 1
-    },
     showTip () {
       this.tipDialog = true
     },
@@ -139,48 +84,34 @@ var vm = new Vue({
     subPoint () {
       var _this = this
       $.ajax({
-        url: '/jypay/resourcePack/account',
+        url: '/bigmember/portrait/subVipPortrait/usage?p_type=1',
         type: 'POST',
         contentType: 'application/x-www-form-urlencoded',
-        data: {
-          product: 'attachmentDownPack'
-        },
+        data: '',
         dataType: 'json'
       }).done(res => {
-          if (res.error_msg === '' && res.data && res.data.data) {
-            this.points = {
-              total: 0,
-              usage: 0
-            }
-            try {
-              var tempInfo = res.data.data[0]
-              this.points = {
-                total: tempInfo.number,
-                usage: tempInfo.number
-              }
-              if (this.points.usage > tempInfo.thirtyNum) {
-                this.points.usage = tempInfo.thirtyNum
-              }
-            } catch (e) {
-              console.warn(e)
-          }
+        if (res.error_code == 0) {
+          _this.points = res.data
+          if (res.data.total == res.data.usage) {
+            _this.tipDialog = true
           }
+        }
       })
     },
     getDatas () {
       return {
-        queryTime: new Date(this.years, this.months - 1, 1).pattern('yyyy-MM'),
-        platform: 'PC',
-        productName: '附件下载包',
+        year: this.years,
+        month: this.months,
         pageSize: this.seeList.pageSize,
-        pageNum: this.seeList.pageNum
+        pageNum: this.seeList.pageNum - 1,
+        p_type: 1
       }
     },
     subRecord () {
       this.working = true
       this.empty = false
       $.ajax({
-       url: '/jypay/resourcePack/recordList',
+        url: '/bigmember/portrait/subVipPortrait/record',
         type: 'POST',
         contentType: 'application/x-www-form-urlencoded',
         data: this.getDatas(),
@@ -197,7 +128,15 @@ var vm = new Vue({
             res.data.list = []
             return
           }
-          this.seeList.list = this.seeList.list.concat(res.data.list)
+          this.seeList.list = this.seeList.list.concat(res.data.list.map(function (v) {
+            return {
+              name: v.name,
+              province: v.province,
+              city: v.city,
+              buyerclass: v.buyerclass,
+              checked: false
+            }
+          }))
         }
       })
     },
@@ -210,7 +149,6 @@ var vm = new Vue({
       this.years = val.getFullYear()
       this.months = val.getMonth() + 1
       this.seeList.pageNum = 1
-      this.seeList.total = 0
       this.seeList.list = []
       this.subRecord()
     },
@@ -218,4 +156,4 @@ var vm = new Vue({
       window.open('/swordfish/page_big_pc/unit_portrayal/' + ids, '_blank')
     }
   }
-})
+})

+ 3 - 3
src/web/templates/frontRouter/pc/fileHistory/sess/index.html

@@ -126,10 +126,10 @@
   <section class="see-container" v-cloak>
     <div class="see-header flex w">
       <div class="w1080">
-        <h3 class="tab-title">线上自助充值帐户</h3>
+        <h3 class="tab-title">附件下载包</h3>
         <div class="show-total-info-group">
           <div class="show-total-info-item">
-            <div>附件下载包帐户余额<span class="file-pack-total">{points.total?points.total:0}</span>个</div>
+            <div>当月附件下载余额<span class="file-pack-total">{points.total?points.total:0}</span>个</div>
             <span>注:超级订阅用户每月享有下载10个附件的权限,也可充值附件下载包增加当月附件下载个数;每月1号上月附件下载余额清零重新计算。</span>
           </div>
           <button onclick="location.href = '/swordfish/page_big_pc/free/filePack/buy'">立即充值</button>
@@ -255,7 +255,7 @@
       $(".dialog").css("display", "unset")
     }
   </script>
-  <script src='{{Msg "seo" "cdn"}}/frontRouter/pc/seeBuyerHistory/js/index-pc.js?v={{Msg "seo" "version"}}'></script>
+  <script src='{{Msg "seo" "cdn"}}/frontRouter/pc/fileHistory/js/index-pc.js?v={{Msg "seo" "version"}}'></script>
 </body>
 
 </html>