Authored by dongjunjie

提交

... ... @@ -99,7 +99,7 @@
//时间格式转换
dateTransform(dateString){
if(dateString.length > 0){
var dateArray = dateString.split("/");
var dateArray = dateString.split("-");
return dateArray.join('');
}
}
... ...
... ... @@ -99,7 +99,7 @@
//时间格式转换
dateTransform(dateString){
if(dateString.length > 0){
var dateArray = dateString.split("/");
var dateArray = dateString.split("-");
return dateArray.join('');
}
}
... ...
... ... @@ -6,6 +6,9 @@
var $ = require('jquery');
var isMenuShow = false;
var localStorage = window.localStorage;
/**
* 左侧导航
*/
... ... @@ -25,10 +28,22 @@ $('#sidebar .nav .has-sub>a').click(function() {
child.slideUp('fast');
child.parent().removeClass('active');
}
//isMenuShow = true;
isMenuShow = true;
return false;
});
$("#sidebar .nav .sub-menu a").each(function() {
console.log('1');
var attr = $(this).attr('href');
if (!isMenuShow && attr == window.location.pathname + window.location.search) {
$(this).parents(".sub-menu").show();
$(this).parent("li").addClass("active");
$(this).parents(".has-sub ").addClass("active");
localStorage.setItem("router", attr);
localStorage.getItem("router");
isMenuShow = true;
}
});
/**
* 左侧最小化
... ...
require("../js.jquery/common/index.js");
\ No newline at end of file
/**
* index
* 默认依赖
*/
'use strict';
var $ = require('jquery');
var isMenuShow = false;
var localStorage = window.localStorage;
/**
* 左侧导航
*/
$('#sidebar .nav .has-sub>a').click(function() {
var child = $(this).parent().find('.sub-menu');
$('#sidebar .nav .has-sub>a').each(function() {
$(this).find('.sub-menu').slideUp('fast');
$(this).removeClass('active');
});
if (!child.is(':visible')) {
child.slideDown('fast');
if (!child.parent().hasClass('active'))
child.parent().addClass('active');
} else {
child.slideUp('fast');
child.parent().removeClass('active');
}
isMenuShow = true;
return false;
});
$("#sidebar .nav .sub-menu a").each(function() {
console.log('1');
var attr = $(this).attr('href');
if (!isMenuShow && attr == window.location.pathname + window.location.search) {
$(this).parents(".sub-menu").show();
$(this).parent("li").addClass("active");
$(this).parents(".has-sub ").addClass("active");
localStorage.setItem("router", attr);
localStorage.getItem("router");
isMenuShow = true;
}
});
/**
* 左侧最小化
*/
$(".sidebar-minify-btn").click(function(){
$("#page-container").toggleClass("page-sidebar-minified");
});
$(".dropdown").hover(function () {
$(".dropdown-menu").show();
}, function () {
$(".dropdown-menu").hide();
});
/**
* 切换店铺
*/
$('.shops_id').click(function (){
var shop_id = $(this).attr('data-shopid');
$.getJSON('/index/ajaxshop?shops_id='+shop_id, function (data){
if(data.code == 200){
window.location.href="/";
}else{
alert(data.message);
}
})
});
... ...