wangxiaogang 3 rokov pred
rodič
commit
af6081b91b

+ 15 - 25
src/jfw/modules/app/src/web/staticres/jyapp/js/dateFunc.js

@@ -1,33 +1,23 @@
-function dateTime(date, fmt) {
-  if (fmt === void 0) {
-    fmt = 'yyyy年MM月dd日 hh:mm';
-  }
-
-  // 时间戳转换
-  if (!date) return '';
-  var d = new Date(date);
+function dateTime (date, fmt='yyyy年MM月dd日 hh:mm') {// 时间戳转换
+  if (!date) return ''
+  var changes =  date ? String(date).replace(/-/g, '/') : ''
+  d = new Date(changes)
   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));
   }
 
-  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));
+  // 根据y的长度来截取年
+  if (/(y+)/.test(fmt)){ 
+    fmt = fmt.replace(RegExp.$1, (d.getFullYear() + "").substr(4 - RegExp.$1.length))
   }
-
-  return fmt;
+  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
 }
 
 function dateYear() {

+ 1 - 2
src/jfw/modules/app/src/web/staticres/jyapp/js/message-index.js

@@ -87,8 +87,7 @@ var vm = new Vue({
       }
     },
     gotoUrl() {
-      // location.href = '/jyapp/frontPage/messageCenter/sess/index'
-      window.open('/jyapp/frontPage/messageCenter/sess/index')
+      location.href = '/jyapp/frontPage/messageCenter/sess/index'
     },
     msgType(val) {
       const obj = {

+ 0 - 20
src/web/staticres/common-module/messageCenter/js/func.js

@@ -53,26 +53,6 @@ function getQueryString(name) {
   return context == null || context == "" || context == "undefined" ? "" : context;
 }
 
-function dateTime (date, 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(), //分 
-    "s+": d.getSeconds() //秒
-  }
-
-  // 根据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)))
-  }
-  return fmt
-}
 function dateTime (date, fmt='yyyy年MM月dd日 hh:mm') {// 时间戳转换
   if (!date) return ''
   var changes =  date ? String(date).replace(/-/g, '/') : ''

+ 6 - 6
src/web/staticres/common-module/messageCenter/js/index.js

@@ -77,12 +77,12 @@ var vm = new Vue({
         success:function () {
           _this.msgData()
           if (url) {
-        	if(getType()){
-				//链接中如果是www.jianyu360.cn域名,微信中会唤起app,该用window.open
-				window.open(url);
-			}else{
-	            location.href = url
-			}
+            if (getType()) {
+              //链接中如果是www.jianyu360.cn域名,微信中会唤起app,该用window.open
+              window.open(url)
+            } else {
+              location.href = url
+            }
           }
         }
       })

+ 6 - 3
src/web/staticres/common-module/messageCenter/js/message-template-index.js

@@ -30,7 +30,7 @@ var vm = new Vue({
         }
       })
     },
-    topRead(ids, type, url) {
+    topRead(ids, url, type) {
       const _this = this
       $.ajax({
         type: 'POST',
@@ -58,7 +58,9 @@ var vm = new Vue({
         } else {
           if (urls.weChatUrl) {
             //链接中如果是www.jianyu360.cn域名,微信中会唤起app,该用window.open
-            window.open(urls.weChatUrl);
+            window.open(urls.weChatUrl)
+          } else {
+            return
           }
         }
       } else {
@@ -86,7 +88,8 @@ var vm = new Vue({
       }
     },
     gotoUrl() {
-      location.href = '/weixin/frontPage/messageCenter/sess/index?msg=2'
+      // location.href = '/weixin/frontPage/messageCenter/sess/index?msg=2'
+      window.open('/weixin/frontPage/messageCenter/sess/index?msg=2')
     },
     msgType(val) {
       const obj = {

+ 1 - 1
src/web/staticres/js/login.js

@@ -423,7 +423,7 @@ function checkCounts() {
                         var isMsg = window.localStorage.getItem('noMesg')
                         if (num !== Number(isMsg)) {
                             var datas = r.data
-                            if (datas) {
+                            if (!$.isEmptyObject(datas)) {
                                 var notify = new Notification(datas.title,{
                                     icon: '../images/t3_new.jpg',
                                     body: datas.content