zhangyuhan 3 лет назад
Родитель
Сommit
aaa0b91728

+ 59 - 36
src/web/staticres/js/dateFunc.js

@@ -1,53 +1,76 @@
-function dateTime (date, fmt='yyyy年MM月dd日 hh:mm') {// 时间戳转换
-  if (!date) return ''
-  d = new Date(date)
+"use strict";
+
+function dateTime(date, fmt) {
+  if (fmt === void 0) {
+    fmt = 'yyyy年MM月dd日 hh:mm';
+  }
+
+  // 时间戳转换
+  if (!date) return '';
+  d = new Date(date);
   var o = {
-    "M+": d.getMonth() + 1, //月份 
-    "d+": d.getDate(), //日 
-    "h+": d.getHours(), //小时 
-    "m+": d.getMinutes(), //分 
+    "M+": d.getMonth() + 1,
+    //月份
+    "d+": d.getDate(),
+    //日
+    "h+": d.getHours(),
+    //小时
+    "m+": d.getMinutes(),
+    //分
     "s+": d.getSeconds() //秒
-  }
 
-  // 根据y的长度来截取年
-  if (/(y+)/.test(fmt)){ 
-    fmt = fmt.replace(RegExp.$1, (d.getFullYear() + "").substr(4 - RegExp.$1.length))
+  }; // 根据y的长度来截取年
+
+  if (/(y+)/.test(fmt)) {
+    fmt = fmt.replace(RegExp.$1, (d.getFullYear() + "").substr(4 - RegExp.$1.length));
   }
-  for (var k in o){
-    if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)))
+
+  for (var k in o) {
+    if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, RegExp.$1.length == 1 ? o[k] : ("00" + o[k]).substr(("" + o[k]).length));
   }
-  return fmt
+
+  return fmt;
 }
-function dateYear () {// 获取当年的第一天
-  var date = new Date()
-  date.setDate(1)
-  date.setMonth(0)
-  return date.getTime()
+
+function dateYear() {
+  // 获取当年的第一天
+  var date = new Date();
+  date.setDate(1);
+  date.setMonth(0);
+  return date.getTime();
 }
-function dateLast () {// 获取昨天
-  var day = new Date()
-  day.setTime(day.getTime()-24*60*60*1000)
-  return dateTime(day,'yyyy/MM/dd')
+
+function dateLast() {
+  // 获取昨天
+  var day = new Date();
+  day.setTime(day.getTime() - 24 * 60 * 60 * 1000);
+  return dateTime(day, 'yyyy/MM/dd');
 }
-function dateMatter (time) {// 时间转换
-  var timeStr = ''
-  var currentDay = dateTime(time,'yyyy/MM/dd') // 当前日期
-  var lingDay = new Date(new Date().toLocaleDateString()).getTime() // 获取当天0点
-  var isTime = new Date(time) - lingDay
-  var diff = isTime < 0 ? '昨天' : ''
-  var isDate = new Date(time) - dateYear()
+
+function dateMatter(time) {
+  // 时间转换
+  var timeStr = '';
+  var currentDay = dateTime(time, 'yyyy/MM/dd'); // 当前日期
+
+  var lingDay = new Date(new Date().toLocaleDateString()).getTime(); // 获取当天0点
+
+  var isTime = new Date(time) - lingDay;
+  var diff = isTime < 0 ? '昨天' : '';
+  var isDate = new Date(time) - dateYear();
+
   if (isDate < 0) {
-    timeStr = dateTime(time)
+    timeStr = dateTime(time);
   } else {
     if (currentDay === dateLast()) {
-      timeStr = diff + dateTime(time,'hh:mm')
+      timeStr = diff + dateTime(time, 'hh:mm');
     } else {
       if (isTime < 0) {
-        timeStr = dateTime(time,'MM月dd日 hh:mm')
+        timeStr = dateTime(time, 'MM月dd日 hh:mm');
       } else {
-        timeStr = dateTime(time,'hh:mm')
+        timeStr = dateTime(time, 'hh:mm');
       }
     }
   }
-  return timeStr
-}
+
+  return timeStr;
+}

Разница между файлами не показана из-за своего большого размера
+ 139 - 139
src/web/staticres/js/pc-collect-user-info.js


+ 1 - 1
src/web/templates/common/baiducc.html

@@ -150,7 +150,7 @@
                 return b.url.length - a.url.length
             })
         },
-        getPageInfo () {
+        getPageInfo: function () {
             var tempInfo = this.findMapsForUrl(location.href)
             if (location.pathname === '/') {
                 tempInfo = [

+ 27 - 26
src/web/templates/pc/myOrder.html

@@ -679,16 +679,16 @@
         }
       },
       filters: {
-        FormatNum (value) {
+        FormatNum: function (value) {
           return FormatNum(value)
         },
-        FormatDateFn (value) {
+        FormatDateFn: function (value) {
           return new Date(value * 1000).Format('yyyy/MM/dd')
         },
-        formatAreaText (value, old) {
+        formatAreaText: function (value, old) {
             return value === -1  ? '全国' : ((old ? (value - old) : value)  + '个省')
         },
-        formatAreaTextBefore (type) {
+        formatAreaTextBefore: function (type) {
           var typeMap = {
               '1': '购买',
               '2': '升级',
@@ -696,7 +696,7 @@
           }
           return typeMap[type || '1']
         },
-        formatTimeText (type) {
+        formatTimeText: function (type) {
           var result = ''
           if (typeof type === "string") {
             type = type.replace(/-/g, '/')
@@ -707,7 +707,7 @@
           }
           return  result
         },
-        formatCycleText (type) {
+        formatCycleText: function (type) {
             var typeMap = {
                 '1': '1个月',
                 '2': '1季',
@@ -717,13 +717,14 @@
         }
       },
       computed: {
-        getList () {
-            return this.list.filter(v => {
+        getList: function () {
+            var _this = this
+            return this.list.filter(function (v) {
               if (v.product_type === '线上课程') {
                 v.product_type = '中标必听课'
               }
-              return this.typeEnum.indexOf(v.product_type) !== -1
-            }).map((v, index) => {
+              return _this.typeEnum.indexOf(v.product_type) !== -1
+            }).map(function (v, index) {
               // product_type
               if (v.product_type === '线上课程') {
                 v.product_type = '中标必听课'
@@ -744,14 +745,14 @@
               }
               // 大会员
               if (v.product_type === '大会员') {
-                v.icon = this.imgMap[v.product_type].icons[this.bigIndexMap[v.filter.level]].icon
+                v.icon = _this.imgMap[v.product_type].icons[_this.bigIndexMap[v.filter.level]].icon
               } else if (v.product_type === '大会员-子账号') {
-                v.icon = this.imgMap[v.product_type].icons[this.bigIndexMap[v.filter.level]].icon
+                v.icon = _this.imgMap[v.product_type].icons[_this.bigIndexMap[v.filter.level]].icon
               } else {
-                v.icon = this.imgMap[v.product_type].icon
+                v.icon = _this.imgMap[v.product_type].icon
               }
               v.memberInfo = {
-                level: this.bigIndexMap[v.filter.level],
+                level: _this.bigIndexMap[v.filter.level],
                 cycle: '-',
                 endTime: '-'
               }
@@ -886,7 +887,7 @@
               if (v.product_type === '大会员-子账号') {
                 // 大会员子账号
                 v.memberChildInfo = {
-                  level: this.bigIndexMap[v.filter.level],
+                  level: _this.bigIndexMap[v.filter.level],
                   endTime: '',
                   fee: v.filter.pay_sub_num,
                   free: v.filter.free_sub_num
@@ -899,7 +900,7 @@
             })
         }
       },
-      mounted () {
+      mounted: function () {
         this.changeAjaxParams({
           tabIndex: 0,
           pageNum: 1
@@ -913,7 +914,7 @@
           var prodMoney100 = (order_money * 100) + (discount_price * 100)
           return prodMoney100 / 100
         },
-        goPay (item) {
+        goPay: function (item) {
           var href = ''
           switch (item.product_type) {
             case '历史数据': {
@@ -976,7 +977,7 @@
           }
           location.href = href
         },
-        goCancel (item) {
+        goCancel: function (item) {
           var _this = this
           $.confirm({
             title: '订单取消',
@@ -1025,7 +1026,7 @@
             }
           });
         },
-        goInvoice (item) {
+        goInvoice: function (item) {
           if (item.applybill_status === 0) {
             if (item.product_type === '中标必听课') {
               var href = ''
@@ -1049,7 +1050,7 @@
             }
           }
         },
-        goShowTipForInvoice (str) {
+        goShowTipForInvoice: function (str) {
           var tempStr = str || '您已开具发票<br>如有问题请联系客服<br>400-108-6670'
           var showHtml = '<div style="width: 100%;height: 100%;z-index: 999; position: absolute;top: 0;background: rgba(0, 0, 0, 0.65);">   <div style="position: fixed;z-index: 9999;width: 540px;height: 262px;left: 50%;top: 30%;margin-left: -270px;background-color: #fff;border-radius: 6px;padding: 32px;display: flex;flex-direction: column;justify-items: center;align-items: center;">       <div class="invoice_title" style="color: #1D1D1D;font-size: 18px;line-height: 28px;">提示</div>       <div class="invoice_body"            style="height: 78px;margin: 20px 0px;font-size: 14px;line-height: 24px;text-align: center;">'+tempStr+'</div>       <div class="invoice_control"            style="width: 132px;height: 36px;text-align: center;background: #2CB7CA;border-radius: 6px;font-size: 16px;line-height: 36px;color: #FFFFFF;cursor: pointer;"            onclick="document.querySelector(\'#invoice_tip\').remove()"       >           我知道了       </div>   </div>\n</div>'
           var div_invoice_tip = document.createElement('div');
@@ -1058,7 +1059,7 @@
           document.body.appendChild(div_invoice_tip)
           return
         },
-        goLookInvoice (item) {
+        goLookInvoice: function (item) {
           var href = ''
           switch (item.product_type) {
             case '中标必听课': {
@@ -1076,7 +1077,7 @@
           }
           location.href = href
         },
-        goOpenInvoice (code) {
+        goOpenInvoice: function (code) {
           $.post("/subscribepay/orderListDetails/isOver", {"order_code": code}, function (r) {
             if (r.status !== 1) {
               window.open("/front/order/invoicetimeOut", '_self');
@@ -1085,7 +1086,7 @@
             }
           })
         },
-        goDetail (item) {
+        goDetail: function (item) {
           var href = ''
           switch (item.product_type) {
             case '历史数据': {
@@ -1147,7 +1148,7 @@
           }
           window.open(href)
         },
-        goDeleteOrder (item) {
+        goDeleteOrder: function (item) {
           var _this = this
           $.confirm({
             title: '订单删除',
@@ -1195,7 +1196,7 @@
             }
           });
         },
-        ajaxData () {
+        ajaxData: function () {
           var _this = this
           $.ajax({
             type: "post",
@@ -1226,7 +1227,7 @@
             }
           })
         },
-        changeAjaxParams (data) {
+        changeAjaxParams: function (data) {
           if (typeof data.tabIndex !== 'undefined') {
             this.ind = data.tabIndex
           }

+ 4 - 4
src/web/templates/pc/proproject.html

@@ -636,7 +636,7 @@ document.querySelector(".searchControl").oncopy = function(){
     el: '#searchInner',
     delimiters: ['${', '}'],
     components: {},
-    data () {
+    data: function () {
       return {
         showPage: true,
         listState: {
@@ -647,10 +647,10 @@ document.querySelector(".searchControl").oncopy = function(){
       }
     },
     watch: {
-      'listState.num' (newVal) {
+      'listState.num': function (newVal) {
         // console.log(newVal, '分页')
       },
-      'listState.total' (newVal) {
+      'listState.total': function (newVal) {
         console.log(newVal, '总页码')
       }
     },
@@ -658,7 +658,7 @@ document.querySelector(".searchControl").oncopy = function(){
       console.log('总页码:' + totalPage + ',当前页:' + currentPage + ',一页数量:' + pageSize)
     },
     methods: {
-      onPageChange (p) {
+      onPageChange: function (p) {
         currentPage = p
         this.listState.num = p
         $(".tabContainer").hide();

+ 9 - 14
src/web/templates/pc/supsearch.html

@@ -750,15 +750,15 @@ $(function(){
 <script language="javascript" type="text/javascript" src="{{Msg "seo" "cdn"}}/My97DatePicker/WdatePicker.js"></script>
 <script type="text/javascript">
 function adListInspect () {
-  setTimeout(() => {
-    (window.slotbydup = window.slotbydup || []).push({
+  setTimeout(function () {
+    ;(window.slotbydup = window.slotbydup || []).push({
         id: "u6603895",
         container: "_t3di2018y5",
         async: true
     });
   }, 1000)
-  setTimeout(() => {
-    (window.slotbydup = window.slotbydup || []).push({
+  setTimeout(function () {
+    ;(window.slotbydup = window.slotbydup || []).push({
         id: "u6603895",
         container: "_6omliqck79a",
         async: true
@@ -2149,7 +2149,7 @@ document.querySelector(".searchControl").oncopy = function(){
     el: '#searchInner',
     delimiters: ['${', '}'],
     components: {},
-    data () {
+    data: function () {
       return {
         showPage: true,
         listState: {
@@ -2173,15 +2173,10 @@ document.querySelector(".searchControl").oncopy = function(){
         return entniche || member || vip > 0
       }
     },
-    watch: {
-      'listState.num' (newVal, oldVal) {
-        // console.log(JSON.stringify(this.listState))
-      }
-    },
-    created () {
+    created: function () {
       this.getPower()
     },
-    mounted () {
+    mounted: function () {
       console.log('总页码:' + totalPage + ',当前页:' + currentPage + ',一页数量:' + pageSize + ',总条数:' + totalCount)
     },
     methods: {
@@ -2207,12 +2202,12 @@ document.querySelector(".searchControl").oncopy = function(){
           this.listState.total++
         }
       },
-      onPageChange (p) {
+      onPageChange: function (p) {
         // TODO 免费用户搜索结果查看大于11页时弹窗提示
         if (!vipState && p > 10) {
           openBigMemberDialog('招标搜索500条限制')
           this.listState.num = this.listState.prevPageNum
-          return 
+          return
         }
 
         currentPage = this.listState.num

Некоторые файлы не были показаны из-за большого количества измененных файлов