From ede5c57e2b7072081714b4a1bb0f246f34eeea33 Mon Sep 17 00:00:00 2001 From: shirne Date: Sat, 17 Aug 2024 20:54:09 +0800 Subject: [PATCH] format --- resource/js/front.js | 58 ++-- resource/js/mobile.js | 2 +- resource/js/model/common.js | 28 +- resource/js/model/jquery.tag.js | 54 ++-- resource/js/model/location.js | 84 +++--- resource/js/model/map.js | 166 +++++------ resource/js/model/template.js | 146 ++++----- resource/less/blog.less | 20 +- resource/less/mobile.less | 477 +++++++++++++++++------------ resource/less/model/_article.less | 82 ++--- resource/less/model/_blog.less | 481 +++++++++++++++++------------- resource/less/model/_case.less | 57 ++-- resource/less/model/_common.less | 203 ++++++++----- resource/less/model/_footer.less | 36 ++- resource/less/model/_index.less | 304 ++++++++++--------- resource/less/model/_member.less | 14 +- resource/less/model/_order.less | 6 +- resource/less/model/_page.less | 23 +- resource/less/model/_product.less | 40 +-- resource/less/style.less | 28 +- 20 files changed, 1278 insertions(+), 1031 deletions(-) diff --git a/resource/js/front.js b/resource/js/front.js index 4068cb6b..8a09351c 100644 --- a/resource/js/front.js +++ b/resource/js/front.js @@ -1,72 +1,72 @@ function setNav(nav) { - - var current=findCurrentNav(nav); + + var current = findCurrentNav(nav); setNavHover(current); - var intval=0; - $('.nav-box .navbar-collapse').hover(function(){ + var intval = 0; + $('.nav-box .navbar-collapse').hover(function () { clearInterval(intval) - },function(){ - intval = setInterval(function(){ + }, function () { + intval = setInterval(function () { setNavHover(current); - },500) + }, 500) }) - $('.nav-box .nav-item').hover(function(){ + $('.nav-box .nav-item').hover(function () { var index = $('.main-nav .nav-item').index(this); setNavHover(index); - },function(){ + }, function () { }) } -function setNavHover(index){ - var items=$('.main-nav .nav-item'); +function setNavHover(index) { + var items = $('.main-nav .nav-item'); items.removeClass('active prev-hover') items.eq(index).addClass('active'); $('.main-nav .nav-item.active').prev().addClass('prev-hover'); - $('.nav-box .nav-bg').css('right',(items.length-index-1)*items.eq(0).outerWidth()) + $('.nav-box .nav-bg').css('right', (items.length - index - 1) * items.eq(0).outerWidth()) } -function findCurrentNav(nav){ - var items=$('.main-nav .nav-item'); - - for(var i=0;i=991){ +jQuery(function ($) { + if ($(window).width() >= 991) { $('.main-nav>.dropdown').hover( function () { - $(this).find('.dropdown-menu').stop(true,false).slideDown(); + $(this).find('.dropdown-menu').stop(true, false).slideDown(); }, function () { - $(this).find('.dropdown-menu').stop(true,false).slideUp(); + $(this).find('.dropdown-menu').stop(true, false).slideUp(); } ); - }else{ + } else { $('.main-nav>.dropdown>.dropdown-toggle').click(function (e) { e.preventDefault(); e.stopPropagation(); - var opened=$(this).data('opened'); + var opened = $(this).data('opened'); var p = $(this).parents('.dropdown'); - if(opened){ + if (opened) { p.find('.dropdown-menu').stop(true, false).slideUp(); - }else { + } else { p.siblings().children('.dropdown-menu').stop(true, false).slideUp(); - p.siblings().children('.dropdown-toggle').data('opened',false); + p.siblings().children('.dropdown-toggle').data('opened', false); p.find('.dropdown-menu').stop(true, false).slideDown(); } - $(this).data('opened',!opened); + $(this).data('opened', !opened); }) } }); \ No newline at end of file diff --git a/resource/js/mobile.js b/resource/js/mobile.js index 28776d19..e78de230 100644 --- a/resource/js/mobile.js +++ b/resource/js/mobile.js @@ -1,3 +1,3 @@ -jQuery(function($){ +jQuery(function ($) { $(''); }); \ No newline at end of file diff --git a/resource/js/model/common.js b/resource/js/model/common.js index cd7fe43d..692c15c8 100644 --- a/resource/js/model/common.js +++ b/resource/js/model/common.js @@ -1,12 +1,12 @@ -function del(obj,msg) { - dialog.confirm(msg,function(){ - location.href=$(obj).attr('href'); +function del(obj, msg) { + dialog.confirm(msg, function () { + location.href = $(obj).attr('href'); }); return false; } function lang(key) { - if(window.language && window.language[key]){ + if (window.language && window.language[key]) { return window.language[key]; } return key; @@ -14,21 +14,21 @@ function lang(key) { function randomString(len, charSet) { charSet = charSet || 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'; - var str = '',allLen=charSet.length; + var str = '', allLen = charSet.length; for (var i = 0; i < len; i++) { var randomPoz = Math.floor(Math.random() * allLen); - str += charSet.substring(randomPoz,randomPoz+1); + str += charSet.substring(randomPoz, randomPoz + 1); } return str; } -function copy_obj(arr){ +function copy_obj(arr) { return JSON.parse(JSON.stringify(arr)); } function isObjectValueEqual(a, b) { - if(!a && !b)return true; - if(!a || !b)return false; + if (!a && !b) return true; + if (!a || !b) return false; // Of course, we can do it use for in // Create arrays of property names @@ -56,11 +56,11 @@ function isObjectValueEqual(a, b) { return true; } -function array_combine(a,b) { - var obj={}; - for(var i=0;i'; - var item=$(this).parents('.form-control'); - var labelgroup=$(''); - var input=this; +jQuery.extend(jQuery.fn, { + tags: function (nm, onupdate) { + var data = []; + var tpl = '{@label}'; + var item = $(this).parents('.form-control'); + var labelgroup = $(''); + var input = this; this.before(labelgroup); - this.on('keyup',function(){ - var val=$(this).val().replace(/,/g,','); - var updated=false; - if(val && val.indexOf(',')>-1){ - var vals=val.split(','); - for(var i=0;i -1) { + var vals = val.split(','); + for (var i = 0; i < vals.length; i++) { + vals[i] = vals[i].replace(/^\s|\s$/g, ''); + if (vals[i] && data.indexOf(vals[i]) === -1) { data.push(vals[i]); - labelgroup.append(tpl.compile({label:vals[i]})); - updated=true; + labelgroup.append(tpl.compile({ label: vals[i] })); + updated = true; } } input.val(''); - if(updated && onupdate)onupdate(data); + if (updated && onupdate) onupdate(data); } - }).on('blur',function(){ - var val=$(this).val(); - if(val) { + }).on('blur', function () { + var val = $(this).val(); + if (val) { $(this).val(val + ',').trigger('keyup'); } }).trigger('blur'); - labelgroup.on('click','.close',function(){ - var tag=$(this).parents('.badge').find('input').val(); - var id=data.indexOf(tag); - if(id)data.splice(id,1); + labelgroup.on('click', '.close', function () { + var tag = $(this).parents('.badge').find('input').val(); + var id = data.indexOf(tag); + if (id) data.splice(id, 1); $(this).parents('.badge').remove(); - if(onupdate)onupdate(data); + if (onupdate) onupdate(data); }); - item.click(function(){ + item.click(function () { input.focus(); }); } diff --git a/resource/js/model/location.js b/resource/js/model/location.js index 18e86a95..4906e7b2 100644 --- a/resource/js/model/location.js +++ b/resource/js/model/location.js @@ -56,70 +56,70 @@ * s2-默认选中的市名称,用法同上。 * s3-默认选中的县区名称,用法同省。 */ -(function($) { - $.fn.jChinaArea = function(o) { +(function ($) { + $.fn.jChinaArea = function (o) { o = $.extend({ - aspnet:false, - s1:null, - s2:null, - s3:null, - onEmpty:function(){} - }, o || {}); - var wrap=$(this); - var sel=$("select",wrap); - var sProvince=sel.eq(0); - var sCity=sel.eq(1); - var sCounty=sel.eq(2); - var loc = new Location(); + aspnet: false, + s1: null, + s2: null, + s3: null, + onEmpty: function () { } + }, o || {}); + var wrap = $(this); + var sel = $("select", wrap); + var sProvince = sel.eq(0); + var sCity = sel.eq(1); + var sCounty = sel.eq(2); + var loc = new Location(); sProvince.empty(); sCity.empty(); sCounty.empty(); - loc.fillOption(sProvince , '0',o.s1); - loc.fillOption(sCity , '0,'+sProvince.val(),o.s2); - o.onEmpty(sCity); - loc.fillOption(sCounty , '0,' + sProvince.val() + ',' + sCity.val(),o.s3); - o.onEmpty(sCounty); + loc.fillOption(sProvince, '0', o.s1); + loc.fillOption(sCity, '0,' + sProvince.val(), o.s2); + o.onEmpty(sCity); + loc.fillOption(sCounty, '0,' + sProvince.val() + ',' + sCity.val(), o.s3); + o.onEmpty(sCounty); - if(o.aspnet){ - var input=$("input",wrap); - var tProvince=input.eq(0); - var tCity=input.eq(1); - var tCounty=input.eq(2); + if (o.aspnet) { + var input = $("input", wrap); + var tProvince = input.eq(0); + var tCity = input.eq(1); + var tCounty = input.eq(2); writeInput(); } - - sProvince.change(function() { + + sProvince.change(function () { sCity.empty(); - loc.fillOption(sCity , '0,'+sProvince.val()); - o.onEmpty(sCity); + loc.fillOption(sCity, '0,' + sProvince.val()); + o.onEmpty(sCity); sCounty.empty(); - loc.fillOption(sCounty , '0,' + sProvince.val() + ',' + sCity.val()); - o.onEmpty(sCounty); - if(o.aspnet){ + loc.fillOption(sCounty, '0,' + sProvince.val() + ',' + sCity.val()); + o.onEmpty(sCounty); + if (o.aspnet) { writeInput(); } }); - sCity.change(function() { + sCity.change(function () { sCounty.empty(); - loc.fillOption(sCounty , '0,' + sProvince.val() + ',' + sCity.val()); - o.onEmpty(sCounty); - if(o.aspnet){ + loc.fillOption(sCounty, '0,' + sProvince.val() + ',' + sCity.val()); + o.onEmpty(sCounty); + if (o.aspnet) { writeInput(); } }); - sCounty.change(function(){ - if(o.aspnet){ + sCounty.change(function () { + if (o.aspnet) { writeInput(); } }); - function writeInput(){ - tProvince.val($(":selected",sProvince).text()); - tCity.val($(":selected",sCity).text()); - tCounty.val($(":selected",sCounty).text()); + function writeInput() { + tProvince.val($(":selected", sProvince).text()); + tCity.val($(":selected", sCity).text()); + tCounty.val($(":selected", sCounty).text()); } }; - + })(jQuery); \ No newline at end of file diff --git a/resource/js/model/map.js b/resource/js/model/map.js index 6d90b679..d239294f 100644 --- a/resource/js/model/map.js +++ b/resource/js/model/map.js @@ -1,5 +1,5 @@ -(function(window,$) { +(function (window, $) { var apis = { @@ -16,12 +16,12 @@ document.body.appendChild(script); } - var mapObj,mapBox,onPick; + var mapObj, mapBox, onPick; - function InitMap(maptype,box,callback,locate) { + function InitMap(maptype, box, callback, locate) { if (mapObj) mapObj.hide(); - mapBox=$(box); - onPick=callback; + mapBox = $(box); + onPick = callback; switch (maptype.toLowerCase()) { case 'baidu': @@ -39,15 +39,15 @@ break; } if (!mapObj) return dialog.warning('不支持该地图类型'); - if(locate){ - if(typeof locate==='string'){ - var loc=locate.split(','); - locate={ - lng:parseFloat(loc[0]), - lat:parseFloat(loc[1]) + if (locate) { + if (typeof locate === 'string') { + var loc = locate.split(','); + locate = { + lng: parseFloat(loc[0]), + lat: parseFloat(loc[1]) } } - mapObj.locate=locate; + mapObj.locate = locate; } mapObj.setMap(); @@ -55,7 +55,7 @@ } function BaseMap(type) { - if(type !== undefined) { + if (type !== undefined) { var key = 'MAPKEY_' + type.toUpperCase(); if (!window[key]) { @@ -109,7 +109,7 @@ self.setMap(); delete window[func]; }; - var apiurl=apis[this.mapType].replace('__KEY__',this.mapkey); + var apiurl = apis[this.mapType].replace('__KEY__', this.mapkey); loadScript(apiurl + func); return false; } else { @@ -134,25 +134,25 @@ this.infoWindow.setContent(content); } }; - BaseMap.prototype.showAtCenter=function () { - var center=this.getCenter(); + BaseMap.prototype.showAtCenter = function () { + var center = this.getCenter(); this.showInfo(center); }; BaseMap.prototype.showLocationInfo = function (pt, rs) { this.showInfo(); - var address=this.getAddress(rs); - var addressComponent=this.getAddressComponent(rs); - var locate={}; + var address = this.getAddress(rs); + var addressComponent = this.getAddressComponent(rs); + var locate = {}; if (typeof (pt.lng) === 'function') { - locate.lng=pt.lng(); - locate.lat=pt.lat(); + locate.lng = pt.lng(); + locate.lat = pt.lat(); } else { - locate.lng=pt.lng; - locate.lat=pt.lat; + locate.lng = pt.lng; + locate.lat = pt.lat; } - onPick(address,locate,addressComponent); + onPick(address, locate, addressComponent); }; BaseMap.prototype.show = function () { this.ishide = false; @@ -191,9 +191,9 @@ map.addControl(new BMap.OverviewMapControl()); map.enableScrollWheelZoom(); - if(!this.locate)this.locate = this.getCenter() + if (!this.locate) this.locate = this.getCenter() var point = this.objectToPoint(this.locate); - + map.centerAndZoom(point, 15); //初始化地图中心点 this.marker = new BMap.Marker(point); //初始化地图标记 this.marker.enableDragging(); //标记开启拖拽 @@ -233,15 +233,15 @@ }; BaiduMap.prototype.pointToObject = function (point) { return { - lng:point.lng, - lat:point.lat + lng: point.lng, + lat: point.lat }; }; BaiduMap.prototype.objectToPoint = function (object) { - return new BMap.Point(parseFloat(object.lng),parseFloat(object.lat)); + return new BMap.Point(parseFloat(object.lng), parseFloat(object.lat)); }; BaiduMap.prototype.getCenter = function () { - var center=this.map.getCenter(); + var center = this.map.getCenter(); return this.pointToObject(center); }; @@ -251,9 +251,9 @@ this.toshow = true; return; } - if(point){ - this.locate=point; - this.marker.panTo(new BMap.Point(point.lng,point.lat)); + if (point) { + this.locate = point; + this.marker.panTo(new BMap.Point(point.lng, point.lat)); } this.setInfoContent(); @@ -261,7 +261,7 @@ }; BaiduMap.prototype.getAddress = function (rs) { var addComp = rs.addressComponents; - if(addComp) { + if (addComp) { return addComp.province + ", " + addComp.city + ", " + addComp.district + ", " + addComp.street + ", " + addComp.streetNumber; } }; @@ -317,17 +317,17 @@ }); //获取经纬度坐标值 - if(!this.locate)this.locate = this.getCenter() + if (!this.locate) this.locate = this.getCenter() var point = this.objectToPoint(this.locate); map.panTo(point); - this.marker = new google.maps.Marker({position: point, map: map, draggable: true}); + this.marker = new google.maps.Marker({ position: point, map: map, draggable: true }); var gc = new google.maps.Geocoder(); this.marker.addListener("dragend", function () { point = self.marker.getPosition(); - gc.geocode({'location': point}, function (rs) { + gc.geocode({ 'location': point }, function (rs) { self.showLocationInfo(point, rs); }); }); @@ -335,15 +335,15 @@ //添加标记点击监听 this.marker.addListener("click", function () { point = self.marker.getPosition(); - gc.geocode({'location': point}, function (rs) { + gc.geocode({ 'location': point }, function (rs) { self.showLocationInfo(point, rs); }); }); - gc.geocode({'location': point}, function (rs) { + gc.geocode({ 'location': point }, function (rs) { self.showLocationInfo(point, rs); }); - this.infoWindow = new google.maps.InfoWindow({map: map}); + this.infoWindow = new google.maps.InfoWindow({ map: map }); this.infoWindow.setPosition(point); this.isshow = true; @@ -355,15 +355,15 @@ GoogleMap.prototype.pointToObject = function (point) { return { - lng:point.lng, - lat:point.lat + lng: point.lng, + lat: point.lat }; }; GoogleMap.prototype.objectToPoint = function (object) { - return new google.maps.LatLng(parseFloat(object.lat),parseFloat(object.lng)); + return new google.maps.LatLng(parseFloat(object.lat), parseFloat(object.lng)); }; GoogleMap.prototype.getCenter = function () { - var center=this.map.getCenter(); + var center = this.map.getCenter(); return this.pointToObject(center); }; @@ -373,11 +373,11 @@ this.toshow = true; return; } - if(point){ - this.locate=point; + if (point) { + this.locate = point; this.marker.setPosition(this.objectToPoint(point)); } - this.infoWindow.setOptions({position: this.marker.getPosition()}); + this.infoWindow.setOptions({ position: this.marker.getPosition() }); this.setInfoContent(); }; @@ -387,15 +387,15 @@ } }; GoogleMap.prototype.getAddressComponent = function (rs, status) { - var result={}; + var result = {}; if (rs && rs[0]) { - var comps=rs[0].address_components - if(comps[0])result.country=comps[0].long_name - if(comps[1])result.province=comps[1].long_name - if(comps[2])result.city=comps[2].long_name - if(comps[3])result.district=comps[3].long_name - if(comps[4])result.street=comps[4].long_name - if(comps[5])result.address=comps[5].long_name + var comps = rs[0].address_components + if (comps[0]) result.country = comps[0].long_name + if (comps[1]) result.province = comps[1].long_name + if (comps[2]) result.city = comps[2].long_name + if (comps[3]) result.district = comps[3].long_name + if (comps[4]) result.street = comps[4].long_name + if (comps[5]) result.address = comps[5].long_name } return result; }; @@ -427,12 +427,12 @@ }; TencentMap.prototype.pointToObject = function (point) { return { - lng:point.getLng(), - lat:point.getLat() + lng: point.getLng(), + lat: point.getLat() }; }; TencentMap.prototype.objectToPoint = function (object) { - return new qq.maps.LatLng(parseFloat(object.lat),parseFloat(object.lng)); + return new qq.maps.LatLng(parseFloat(object.lat), parseFloat(object.lng)); }; TencentMap.prototype.setMap = function () { var self = this; @@ -441,7 +441,7 @@ //初始化地图 - var map = self.map = new qq.maps.Map(this.mapbox[0], {zoom: 15}); + var map = self.map = new qq.maps.Map(this.mapbox[0], { zoom: 15 }); //初始化地图控件 new qq.maps.ScaleControl({ align: qq.maps.ALIGN.BOTTOM_LEFT, @@ -452,7 +452,7 @@ //map.enableScrollWheelZoom(); //获取经纬度坐标值 - if(!this.locate)this.locate = this.getCenter() + if (!this.locate) this.locate = this.getCenter() var point = this.objectToPoint(this.locate); map.panTo(point); //初始化地图中心点 @@ -483,7 +483,7 @@ gc.getAddress(point); - this.infoWindow = new qq.maps.InfoWindow({map: map}); + this.infoWindow = new qq.maps.InfoWindow({ map: map }); this.isshow = true; if (this.toshow) { @@ -493,7 +493,7 @@ }; TencentMap.prototype.getCenter = function () { - var center=this.map.getCenter(); + var center = this.map.getCenter(); return this.pointToObject(center); }; @@ -503,8 +503,8 @@ this.toshow = true; return; } - if(point){ - this.locate=point; + if (point) { + this.locate = point; this.marker.setPosition(this.objectToPoint(point)); } this.infoWindow.setPosition(this.marker.getPosition()); @@ -513,20 +513,20 @@ }; TencentMap.prototype.getAddress = function (rs) { - if(rs && rs.detail) { + if (rs && rs.detail) { return rs.detail.address; } return ""; }; - + TencentMap.prototype.getAddressComponent = function (rs) { - if(rs && rs.detail) { + if (rs && rs.detail) { var comp = rs.detail.addressComponents - if(!comp.province){ - comp.province=comp.city; + if (!comp.province) { + comp.province = comp.city; } - if(comp.streetNumber){ - comp.address=comp.streetNumber + if (comp.streetNumber) { + comp.address = comp.streetNumber } return comp; } @@ -538,16 +538,16 @@ var self = this; var myGeo = new qq.maps.Geocoder({ complete: function (result) { - if(result && result.detail && result.detail.location){ - var point=result.detail.location; + if (result && result.detail && result.detail.location) { + var point = result.detail.location; self.map.setCenter(point); self.marker.setPosition(point); self.showLocationInfo(point, result); - }else{ + } else { alert("地址信息不正确,定位失败"); } }, - error:function(result){ + error: function (result) { alert("地址信息不正确,定位失败"); } }); @@ -594,11 +594,11 @@ //获取经纬度坐标值 - if(!this.locate)this.locate = this.getCenter() + if (!this.locate) this.locate = this.getCenter() var point = this.objectToPoint(this.locate); map.setCenter(point); - this.marker = new AMap.Marker({position: point, map: map}); //初始化地图标记 + this.marker = new AMap.Marker({ position: point, map: map }); //初始化地图标记 this.marker.setDraggable(true); //标记开启拖拽 @@ -635,15 +635,15 @@ }; GaodeMap.prototype.pointToObject = function (point) { return { - lng:point.getLng(), - lat:point.getLat() + lng: point.getLng(), + lat: point.getLat() }; }; GaodeMap.prototype.objectToPoint = function (object) { return new AMap.LngLat(object.lng, object.lat); }; GaodeMap.prototype.getCenter = function () { - var center=this.map.center(); + var center = this.map.center(); return this.pointToObject(center); }; @@ -653,7 +653,7 @@ this.toshow = true; return; } - if(point){ + if (point) { this.marker.setPosition(this.objectToPoint(point)); } this.setInfoContent(); @@ -685,5 +685,5 @@ }, ''); }; - window.InitMap=InitMap; -})(window,jQuery); \ No newline at end of file + window.InitMap = InitMap; +})(window, jQuery); \ No newline at end of file diff --git a/resource/js/model/template.js b/resource/js/model/template.js index cff0da95..0bc144ff 100644 --- a/resource/js/model/template.js +++ b/resource/js/model/template.js @@ -1,46 +1,46 @@ -Number.prototype.format=function(fix){ - if(fix===undefined)fix=2; - var num=this.toFixed(fix); - var z=num.split('.'); - var format=[],f=z[0].split(''),l=f.length; - for(var i=0;i0 && i % 3==0){ +Number.prototype.format = function (fix) { + if (fix === undefined) fix = 2; + var num = this.toFixed(fix); + var z = num.split('.'); + var format = [], f = z[0].split(''), l = f.length; + for (var i = 0; i < l; i++) { + if (i > 0 && i % 3 == 0) { format.unshift(','); } - format.unshift(f[l-i-1]); + format.unshift(f[l - i - 1]); } - return format.join('')+(z.length==2?'.'+z[1]:''); + return format.join('') + (z.length == 2 ? '.' + z[1] : ''); }; -if(!String.prototype.trim){ - String.prototype.trim=function () { - return this.replace(/(^\s+|\s+$)/g,''); +if (!String.prototype.trim) { + String.prototype.trim = function () { + return this.replace(/(^\s+|\s+$)/g, ''); } } -String.prototype.compile=function(data,list){ +String.prototype.compile = function (data, list) { - if(list){ - var temps=[]; - for(var i in data){ + if (list) { + var temps = []; + for (var i in data) { temps.push(this.compile(data[i])); } return temps.join("\n"); - }else{ - return this.replace(/\{if\s+([^\}]+)\}([\W\w]*?){\/if}/g,function(all, condition, cont){ + } else { + return this.replace(/\{if\s+([^\}]+)\}([\W\w]*?){\/if}/g, function (all, condition, cont) { var operation; - var conts=cont.split('{else}'); - if(operation=condition.match(/\s+(=+|<|>)\s+/)){ - operation=operation[0]; - var part=condition.split(operation); - if(part[0].indexOf('@')===0){ - part[0]=data[part[0].replace('@','')]; + var conts = cont.split('{else}'); + if (operation = condition.match(/\s+(=+|<|>)\s+/)) { + operation = operation[0]; + var part = condition.split(operation); + if (part[0].indexOf('@') === 0) { + part[0] = data[part[0].replace('@', '')]; } - if(part[1].indexOf('@')===0){ - part[1]=data[part[1].replace('@','')]; + if (part[1].indexOf('@') === 0) { + part[1] = data[part[1].replace('@', '')]; } - operation=operation.trim(); - var result=false; - switch (operation){ + operation = operation.trim(); + var result = false; + switch (operation) { case '==': result = part[0] == part[1]; break; @@ -54,70 +54,70 @@ String.prototype.compile=function(data,list){ result = part[0] < part[1]; break; } - if(result){ + if (result) { return cont; - }else if(conts[1]){ + } else if (conts[1]) { return conts[1]; } - }else { - if (data[condition.replace('@','')]) return conts[0]; - else if(conts[1]) return conts[1]; + } else { + if (data[condition.replace('@', '')]) return conts[0]; + else if (conts[1]) return conts[1]; } return ''; - }).replace(/\{@([\w\d\.]+)(?:\|([\w\d]+)(?:\s*=\s*([^\}]+))?)?\}/g,function(all,m1,func,args){ + }).replace(/\{@([\w\d\.]+)(?:\|([\w\d]+)(?:\s*=\s*([^\}]+))?)?\}/g, function (all, m1, func, args) { - if(m1.indexOf('.')>0){ - var keys=m1.split('.'),val=data; - for(var i=0;i 0) { + var keys = m1.split('.'), val = data; + for (var i = 0; i < keys.length; i++) { + if (val[keys[i]] !== undefined && val[keys[i]] !== null) { + val = val[keys[i]]; + } else { val = ''; break; } } - return callfunc(val,func,args); - }else{ - return callfunc(data[m1],func,args,data); + return callfunc(val, func, args); + } else { + return callfunc(data[m1], func, args, data); } }); } }; function tostring(obj) { - if(obj && obj.toString){ + if (obj && obj.toString) { return obj.toString(); } return ''; } -function callfunc(val,func,args,thisobj){ - if(!args){ - args=[val]; - }else{ - if(typeof args==='string')args=args.split(','); - var argidx=args.indexOf('###'); - if(argidx>=0){ - args[argidx]=val; - }else{ - args=[val].concat(args); +function callfunc(val, func, args, thisobj) { + if (!args) { + args = [val]; + } else { + if (typeof args === 'string') args = args.split(','); + var argidx = args.indexOf('###'); + if (argidx >= 0) { + args[argidx] = val; + } else { + args = [val].concat(args); } } - return window[func]?window[func].apply(thisobj,args):((val===undefined||val===null)?'':val); + return window[func] ? window[func].apply(thisobj, args) : ((val === undefined || val === null) ? '' : val); } -function html_encode(html){ - if(!html)return html; - var temp = document.createElement ("div"); - (temp.textContent != undefined ) ? (temp.textContent = html) : (temp.innerText = html); +function html_encode(html) { + if (!html) return html; + var temp = document.createElement("div"); + (temp.textContent != undefined) ? (temp.textContent = html) : (temp.innerText = html); var output = temp.innerHTML; temp = null; return output; } -function html_decode(text){ - if(!text)return text; +function html_decode(text) { + if (!text) return text; var temp = document.createElement("div"); temp.innerHTML = text; var output = temp.innerText || temp.textContent; @@ -125,7 +125,7 @@ function html_decode(text){ return output; } -function pad_zero(n, c){ +function pad_zero(n, c) { if ((n = n + "").length < c) { return new Array(++c - n.length).join("0") + n; } else { @@ -133,10 +133,10 @@ function pad_zero(n, c){ } } -function timestamp_date(timestamp, fmt){ - if(!timestamp)return ''; - var jsdate=new Date(timestamp*1000); - if(!fmt)fmt = 'Y-m-d H:i:s'; +function timestamp_date(timestamp, fmt) { + if (!timestamp) return ''; + var jsdate = new Date(timestamp * 1000); + if (!fmt) fmt = 'Y-m-d H:i:s'; var txt_weekdays = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]; var txt_ordin = { @@ -186,7 +186,7 @@ function timestamp_date(timestamp, fmt){ } else { if (a <= 2 && nd >= 4 && a >= (6 - nd)) { nd2 = new Date(jsdate.getFullYear() - 1 + "/12/31"); - return timestamp_date(Math.round(nd2.getTime() / 1000),"W"); + return timestamp_date(Math.round(nd2.getTime() / 1000), "W"); } else { return (1 + (nd <= 3 ? ((a + nd) / 7) : (a - (7 - nd)) / 7) >> 0); } @@ -312,11 +312,11 @@ function timestamp_date(timestamp, fmt){ }); } -function iif(v,m1,m2){ - if(v==='0')v=0; - return v?m1:m2; +function iif(v, m1, m2) { + if (v === '0') v = 0; + return v ? m1 : m2; } -window['default']=function (v,d) { - return v?v:d; +window['default'] = function (v, d) { + return v ? v : d; }; \ No newline at end of file diff --git a/resource/less/blog.less b/resource/less/blog.less index 8bcb7477..44921f1f 100644 --- a/resource/less/blog.less +++ b/resource/less/blog.less @@ -1,14 +1,14 @@ -@color-text:#3c3c3c; -@color-text-light:#999; -@color-text-dark:#666; -@color-eye:#00c4d4; -@color-eye-darker:#009dac; -@color-eye-dark:#005a5d; -@color-white:#fff; +@color-text: #3c3c3c; +@color-text-light: #999; +@color-text-dark: #666; +@color-eye: #00c4d4; +@color-eye-darker: #009dac; +@color-eye-dark: #005a5d; +@color-white: #fff; -@bg-grey:#f9f9f9; -@bg-hover:#e6ebe7; -@bg-active:#d4d2d0; +@bg-grey: #f9f9f9; +@bg-hover: #e6ebe7; +@bg-active: #d4d2d0; @import "model/_blog"; diff --git a/resource/less/mobile.less b/resource/less/mobile.less index 92d72b2b..4eedcc56 100644 --- a/resource/less/mobile.less +++ b/resource/less/mobile.less @@ -1,144 +1,175 @@ -html{ - font-size :12px; +html { + font-size: 12px; } -body,html { + +body, +html { height: 100%; -webkit-tap-highlight-color: transparent } + body { - font-family: -apple-system-font,Helvetica Neue,Helvetica,sans-serif + font-family: -apple-system-font, Helvetica Neue, Helvetica, sans-serif } -.page,body { + +.page, +body { background-color: #f8f8f8 } -.text-center{ - text-align:center; +.text-center { + text-align: center; } -.float-right{ - float:right; + +.float-right { + float: right; } -.badge{ - border-radius:3px; - background:#ddd; - display:inline-block; - line-height:1.6em; - padding:0 15px; - color:#111; +.badge { + border-radius: 3px; + background: #ddd; + display: inline-block; + line-height: 1.6em; + padding: 0 15px; + color: #111; } -.badge-danger{ - background:#aa0000; - color:#fff; + +.badge-danger { + background: #aa0000; + color: #fff; } -.badge-info{ + +.badge-info { background: #00a0e9; - color:#fff; + color: #fff; } -.badge-primary{ + +.badge-primary { background: #0bb20c; - color:#fff; + color: #fff; } -.badge-warning{ + +.badge-warning { background: orangered; - color:#fff; + color: #fff; } -.pagination{ +.pagination { display: block; text-align: center; - padding-top:20px; - .page-item{ - display:inline-block; - margin:0 5px; - color:#333; - line-height:2em; - .page-link{ - display:inline-block; - background:#eee; - border:1px #00a0e9 solid; - padding:0 15px; - border-radius:5px; - color:#333; + padding-top: 20px; + + .page-item { + display: inline-block; + margin: 0 5px; + color: #333; + line-height: 2em; + + .page-link { + display: inline-block; + background: #eee; + border: 1px #00a0e9 solid; + padding: 0 15px; + border-radius: 5px; + color: #333; } - &.disabled{ - color:#999; - .page-link{ - border-color:#ddd; - color:#999; + + &.disabled { + color: #999; + + .page-link { + border-color: #ddd; + color: #999; } } - &.active{ - color:#fff; - .page-link{ - background:#00a0e9; - color:#fff; + + &.active { + color: #fff; + + .page-link { + background: #00a0e9; + color: #fff; } } } } -.weui-btn{ - border-radius:2px; +.weui-btn { + border-radius: 2px; } -.weui-btn_primary{ - background:#cea883; + +.weui-btn_primary { + background: #cea883; } + .weui-btn_primary:not(.weui-btn_disabled):active { background-color: #cea883 } .weui-panel__ft { - border-top:1px solid #e5e5e5; + border-top: 1px solid #e5e5e5; + .weui-flex__item { text-align: center; color: #999; - padding:10px 0; - border-right:1px solid #e5e5e5; - &.primary{ - color:#0bb20c; + padding: 10px 0; + border-right: 1px solid #e5e5e5; + + &.primary { + color: #0bb20c; } - &.danger-btn{ + + &.danger-btn { color: orangered; } - &:last-child{ - border-right:0; + + &:last-child { + border-right: 0; } } } -.container, .page { +.container, +.page { position: absolute; top: 0; right: 0; bottom: 0; left: 0; } + .container { overflow: hidden } -.page{ + +.page { overflow-y: auto; -webkit-overflow-scrolling: touch; z-index: 1; } -.empty{ + +.empty { color: #999; padding: 50px 0; text-align: center; } + ul { list-style: none } + .link { color: #1aad19 } + .page__hd { padding: 20px } + .page__bd_spacing { padding: 0 15px } + .page__title { font-size: 20px; font-weight: 400 @@ -150,6 +181,7 @@ ul { text-align: left; font-size: 14px } + .page__ft { padding-top: 40px; padding-bottom: 10px; @@ -159,156 +191,190 @@ ul { .page__ft img { height: 19px } -.weui-article img{ - height :auto; + +.weui-article img { + height: auto; } -.weui-footer__links{ - margin:10px 0; + +.weui-footer__links { + margin: 10px 0; } -.weui-footer__text{ - border-top:1px #ccc solid; - padding:20px 0; + +.weui-footer__text { + border-top: 1px #ccc solid; + padding: 20px 0; } + .weui-tabbar__icon { line-height: 27px; } -.weui-tabbar__item.weui-bar__item_on .weui-tabbar__icon, .weui-tabbar__item.weui-bar__item_on .weui-tabbar__icon>i, .weui-tabbar__item.weui-bar__item_on .weui-tabbar__label{ - color:#cea883; + +.weui-tabbar__item.weui-bar__item_on .weui-tabbar__icon, +.weui-tabbar__item.weui-bar__item_on .weui-tabbar__icon>i, +.weui-tabbar__item.weui-bar__item_on .weui-tabbar__label { + color: #cea883; } -.swiper-container{ - height :300px; - .swiper-slide{ - background-size:cover; +.swiper-container { + height: 300px; + + .swiper-slide { + background-size: cover; } } -.index-card{ - .index-card-title{ - padding:20px 0; - h2{ +.index-card { + .index-card-title { + padding: 20px 0; + + h2 { text-align: center; - color:#5e5e5e; + color: #5e5e5e; } - p{ + + p { text-align: center; - color:#5e5e5e; + color: #5e5e5e; } } } -.mindex-bg{ - background:#292a2e; - .index-card{ - .index-card-title{ - h2{ - color:#fff; +.mindex-bg { + background: #292a2e; + + .index-card { + .index-card-title { + h2 { + color: #fff; } - p{ - color:#fff; + + p { + color: #fff; } } } } -.mindex-product{ - .prod-body{ - padding-bottom:20px; + +.mindex-product { + .prod-body { + padding-bottom: 20px; } - .card{ - background:#fff; - .card-img-top{ + + .card { + background: #fff; + + .card-img-top { text-align: center; - padding-top:80%; + padding-top: 80%; position: relative; - height :0; + height: 0; + .img-box { - width :100%; - height :90%; + width: 100%; + height: 90%; position: absolute; - left:0; - top:5%; + left: 0; + top: 5%; text-align: center; + img { - max-height : 100%; - max-width : 100%; + max-height: 100%; + max-width: 100%; } } } - .card-body{ - padding:10px 0 10px 10px; - .more a{ - color:#c9c9c9; - line-height:1.6em; - border-bottom:1px #cea883 solid; + + .card-body { + padding: 10px 0 10px 10px; + + .more a { + color: #c9c9c9; + line-height: 1.6em; + border-bottom: 1px #cea883 solid; } } } - .weui-flex__item{ - margin-right:10px; + + .weui-flex__item { + margin-right: 10px; } - .weui-flex__item:last-child{ - margin-right:0; + + .weui-flex__item:last-child { + margin-right: 0; } } -.mindex-point{ + +.mindex-point { .point-body { - padding-bottom:10px; + padding-bottom: 10px; + .weui-flex { - padding:10px 0; + padding: 10px 0; + .point-item { - padding-top : 40px; - background-size : 30px 30px; - background-position : center 5px; - background-repeat : no-repeat; + padding-top: 40px; + background-size: 30px 30px; + background-position: center 5px; + background-repeat: no-repeat; + span { - display : block; - color : #c9c9c9; - text-align : center; + display: block; + color: #c9c9c9; + text-align: center; } } } } } -.full-container{ +.full-container { width: 100%; - height :100%; - .left-cate{ - width:110px; - background:#f0f0f0; - a{ - display:block; + height: 100%; + + .left-cate { + width: 110px; + background: #f0f0f0; + + a { + display: block; text-align: center; - line-height:60px; - color:#8e8e8e; - &.active{ - background:#fff; - color:#111; + line-height: 60px; + color: #8e8e8e; + + &.active { + background: #fff; + color: #111; } } } - .main-list{ - background:#fff; - .cate-banner{ - margin :10px; - img{ + + .main-list { + background: #fff; + + .cate-banner { + margin: 10px; + + img { max-width: 100%; } } - .prod-item{ - .d-view{ - display:block; + + .prod-item { + .d-view { + display: block; text-align: center; - img{ + + img { max-width: 100%; - max-height :100%; + max-height: 100%; } } - .d-info{ - a{ - display:block; + + .d-info { + a { + display: block; text-align: center; - color:#333; + color: #333; } } } @@ -316,34 +382,39 @@ ul { } -.weui-btn-area{ - .text-center{ - padding:20px 0; - font-size:14px; - color:#999; - a{ - display:inline-block; - padding:0 15px 0 5px; +.weui-btn-area { + .text-center { + padding: 20px 0; + font-size: 14px; + color: #999; + + a { + display: inline-block; + padding: 0 15px 0 5px; color: #555; } } } -.orders{ +.orders { .weui-flex__item { padding: 20px 0; position: relative; + .item-icon { text-align: center; + img { width: 30px; height: 26px; } } + .item-text { text-align: center; color: #333; } + .counter { position: absolute; left: 52%; @@ -360,14 +431,16 @@ ul { } } -.weui-navbar{ - .weui-navbar__item{ - color:#666; +.weui-navbar { + .weui-navbar__item { + color: #666; position: relative; - &.active{ - color:#333; - background:#fff; + + &.active { + color: #333; + background: #fff; } + .counter { position: absolute; left: 65%; @@ -384,50 +457,60 @@ ul { } } -.member-menus{ - .weui-cell{ - .weui-cell__hd{ - img{ - width:20px;margin-right:5px;display:block; +.member-menus { + .weui-cell { + .weui-cell__hd { + img { + width: 20px; + margin-right: 5px; + display: block; } } - .weui-cell__bd{ - font-size:12px; + + .weui-cell__bd { + font-size: 12px; } } } -.userinfo{ - background:#111; - background-size:100% 200px; - height :200px; - .member_avatar{ - padding:45px 20px; - img{ +.userinfo { + background: #111; + background-size: 100% 200px; + height: 200px; + + .member_avatar { + padding: 45px 20px; + + img { width: 100px; - height :100px; - border-radius:1000px; - border:1px #fff solid; + height: 100px; + border-radius: 1000px; + border: 1px #fff solid; } } - .member_name{ - color:#fff; - font-weight:bold; - padding:70px 0; + + .member_name { + color: #fff; + font-weight: bold; + padding: 70px 0; } - .member_balance{ - padding:70px 20px; - color:#fff; + + .member_balance { + padding: 70px 20px; + color: #fff; white-space: nowrap; - line-height:2em; - span{ + line-height: 2em; + + span { white-space: nowrap; } } } -.weui-panel__hd{ - color:#333; - a{ - color:#8e8e8e; + +.weui-panel__hd { + color: #333; + + a { + color: #8e8e8e; } } \ No newline at end of file diff --git a/resource/less/model/_article.less b/resource/less/model/_article.less index e8221c1a..040f35ed 100644 --- a/resource/less/model/_article.less +++ b/resource/less/model/_article.less @@ -1,56 +1,66 @@ -.article-list{ - padding-top:2rem; - li{ - border-bottom:1px @bd-light solid; - padding-top:1rem; - padding-bottom:1rem; - .media-img{ +.article-list { + padding-top: 2rem; + + li { + border-bottom: 1px @bd-light solid; + padding-top: 1rem; + padding-bottom: 1rem; + + .media-img { width: 133px; height: 100px; - margin-right:1rem; + margin-right: 1rem; } - .media-body{ - h5{ - line-height:2rem; - a{ - color:@color-text; + + .media-body { + h5 { + line-height: 2rem; + + a { + color: @color-text; } } - div{ - line-height:1.6rem; - color:@color-text-light; - font-size:0.9rem; + + div { + line-height: 1.6rem; + color: @color-text-light; + font-size: 0.9rem; } - p{ - margin:0; + + p { + margin: 0; } } } } -.article-body{ - padding-top:4rem; +.article-body { + padding-top: 4rem; } -.article-title{ - font-size:2rem; - line-height:4rem; + +.article-title { + font-size: 2rem; + line-height: 4rem; text-align: center; } + .article-info { - margin-bottom : 1.5rem; + margin-bottom: 1.5rem; + a { - color : @color-text-dark; - display : inline-block; - border : 1px @bd-light solid; - padding : 0 10px; + color: @color-text-dark; + display: inline-block; + border: 1px @bd-light solid; + padding: 0 10px; } } -.article-content{ - background:@color-white; - border-radius:5px; - box-shadow: rgba(0,0,0,.1) 0 0 5px; - padding:50px; - min-height:500px; - margin-bottom:2rem; + +.article-content { + background: @color-white; + border-radius: 5px; + box-shadow: rgba(0, 0, 0, .1) 0 0 5px; + padding: 50px; + min-height: 500px; + margin-bottom: 2rem; } \ No newline at end of file diff --git a/resource/less/model/_blog.less b/resource/less/model/_blog.less index d8206444..514a1331 100644 --- a/resource/less/model/_blog.less +++ b/resource/less/model/_blog.less @@ -1,185 +1,213 @@ - -body{ - color:@color-text; - background:@bg-grey; +body { + color: @color-text; + background: @bg-grey; } -header{ - background:@color-white; - box-shadow: 1px 0 10px rgba(0,0,0,.1); + +header { + background: @color-white; + box-shadow: 1px 0 10px rgba(0, 0, 0, .1); } -.footer .container{ - padding-bottom:50px; +.footer .container { + padding-bottom: 50px; font-size: 12px; } -a{ - color:@color-eye-darker; - &:hover{ - color:@color-eye; +a { + color: @color-eye-darker; + + &:hover { + color: @color-eye; } - &:visited{ - color:@color-text-dark; + + &:visited { + color: @color-text-dark; } } -.empty{ +.empty { width: 100%; - padding:30px 0; + padding: 30px 0; text-align: center; - color:@color-text-dark; + color: @color-text-dark; } -.my-card{ - border-radius:0; - border:0; - .card-header{ - border-bottom:1px @color-eye-darker solid; - background:#fff; +.my-card { + border-radius: 0; + border: 0; + + .card-header { + border-bottom: 1px @color-eye-darker solid; + background: #fff; font-weight: bold; } } -.btn{ + +.btn { border-radius: 0; } -.input-group-text{ + +.input-group-text { border-radius: 0; border: 0; background: transparent; - border-bottom:1px #009dac solid; + border-bottom: 1px #009dac solid; } -.form-control{ + +.form-control { border-radius: 0; border: 0; - border-bottom:1px #009dac solid; + border-bottom: 1px #009dac solid; } -.nav-box{ - padding-top:0; - padding-bottom:0; - z-index:9; +.nav-box { + padding-top: 0; + padding-bottom: 0; + z-index: 9; - .navbar-brand{ - color:@color-eye; - padding:0; + .navbar-brand { + color: @color-eye; + padding: 0; } - .navbar-toggler-icon{ - &:before{ - font-size:30px; - color : @color-text-dark; + + .navbar-toggler-icon { + &:before { + font-size: 30px; + color: @color-text-dark; } } + .navbar-nav { .nav-link { - color : @color-text; - padding : 1rem 1.5rem; + color: @color-text; + padding: 1rem 1.5rem; } - >.nav-item>.nav-link{ + + >.nav-item>.nav-link { position: relative; - background : @color-white; + background: @color-white; z-index: 2; } - >.active>.nav-link{ - color : @color-eye; + + >.active>.nav-link { + color: @color-eye; } - .dropdown-menu{ - border:0; - border-radius:0; - margin:0; - box-shadow: 1px 0 10px rgba(0,0,0,.1); - z-index:1; + + .dropdown-menu { + border: 0; + border-radius: 0; + margin: 0; + box-shadow: 1px 0 10px rgba(0, 0, 0, .1); + z-index: 1; } } } -.carousel{ - .carousel-item{ - height:400px; - background:url(../images/blank.gif) center center no-repeat; - background-size:cover; - img{ - display:none; +.carousel { + .carousel-item { + height: 400px; + background: url(../images/blank.gif) center center no-repeat; + background-size: cover; + + img { + display: none; } } } -.subbanner{ - height:300px; - .inner{ - background:url(../images/blank.gif) center center no-repeat; - background-size:cover; + +.subbanner { + height: 300px; + + .inner { + background: url(../images/blank.gif) center center no-repeat; + background-size: cover; } } -.main{ - min-height:500px; +.main { + min-height: 500px; } -.index-body{ - padding-top:20px; +.index-body { + padding-top: 20px; } -.list-body{ - padding-top:20px; + +.list-body { + padding-top: 20px; } -.view-body{ - padding-top:20px; + +.view-body { + padding-top: 20px; + .col-md-9 { - background : @color-white; + background: @color-white; } } -.card-comment{ - border-radius:0; - border:0; - .card-header{ - border-bottom:1px @color-eye-darker solid; - background:#fff; +.card-comment { + border-radius: 0; + border: 0; + + .card-header { + border-bottom: 1px @color-eye-darker solid; + background: #fff; } } -.comment-form{ - padding-bottom:1rem; - border-bottom:1px #eee solid; - .avatar{ - width:40px;height:40px; +.comment-form { + padding-bottom: 1rem; + border-bottom: 1px #eee solid; + + .avatar { + width: 40px; + height: 40px; } - .form-control{ + + .form-control { border: 1px #eee solid; } } -.comment_list{ - .media{ - border-bottom:1px #eee solid; - .avatar{ - width:40px;height:40px; +.comment_list { + .media { + border-bottom: 1px #eee solid; + + .avatar { + width: 40px; + height: 40px; } - .comment-content{ - font-size:0.9rem; + + .comment-content { + font-size: 0.9rem; } - .comment-info{ - font-size:0.8rem; + + .comment-info { + font-size: 0.8rem; } } } -.sidecolumn{ - .card{ - margin-bottom:20px; - border-radius:0; - border:0; - .card-header{ - border-bottom:1px @color-eye-darker solid; - background:#fff; +.sidecolumn { + .card { + margin-bottom: 20px; + border-radius: 0; + border: 0; + + .card-header { + border-bottom: 1px @color-eye-darker solid; + background: #fff; } - .card-body{ - .list-group{ - .list-group-item{ - border-radius:0; - border:0; - &.active{ - background:@color-eye; + + .card-body { + .list-group { + .list-group-item { + border-radius: 0; + border: 0; + + &.active { + background: @color-eye; } } } @@ -187,70 +215,79 @@ a{ } } -.article-list{ - .list-group-item{ +.article-list { + .list-group-item { border: 0; border-radius: 0; margin-bottom: 20px; padding: 0; display: flex; transition: all .3s ease-out; - - .list-img{ - width:20%; - padding-top:15%; - flex:0 0 auto; + + .list-img { + width: 20%; + padding-top: 15%; + flex: 0 0 auto; height: 0; margin: 10px; - background:url(../images/blank.gif) center center no-repeat; - background-size:cover; - img{ - display:none; + background: url(../images/blank.gif) center center no-repeat; + background-size: cover; + + img { + display: none; } } - .art-view{ - flex:auto; - padding:.8rem 1rem; - display:flex; + + .art-view { + flex: auto; + padding: .8rem 1rem; + display: flex; flex-direction: column; - h3{ - font-size:18px; + + h3 { + font-size: 18px; } - .desc{ - flex:auto; - font-size:12px; - line-height:20px; - margin-bottom:.5em; - color:@color-text-dark; + + .desc { + flex: auto; + font-size: 12px; + line-height: 20px; + margin-bottom: .5em; + color: @color-text-dark; } - .text-muted{ - line-height:1.2em; - font-size:12px; + + .text-muted { + line-height: 1.2em; + font-size: 12px; } } - &:hover{ - box-shadow: 0 4px 12px 0 rgba(0,0,0,.1); - border-radius:3px; - transform:translateY(-2px); + + &:hover { + box-shadow: 0 4px 12px 0 rgba(0, 0, 0, .1); + border-radius: 3px; + transform: translateY(-2px); /*transform: scale(1.05);*/ } - &.empty-box:hover{ - background-color : @color-white; + + &.empty-box:hover { + background-color: @color-white; box-shadow: none; transform: none; } } } -.article-body{ +.article-body { padding: 20px; background: #fff; - .article-title{ + + .article-title { text-align: center; - font-size:24px; - font-weight:bold; + font-size: 24px; + font-weight: bold; } - .article-info{ + + .article-info { width: 60%; font-size: 0.8rem; margin: 0 auto; @@ -258,51 +295,60 @@ a{ padding-bottom: .5em; border-bottom: 1px #eee solid; } - - .article-content{ - margin-top:2em; + + .article-content { + margin-top: 2em; min-height: 500px; line-height: 1.6; - img{ + + img { max-width: 100%; } } - .article-slides{ - height:450px; - .carousel,.carousel-inner,.carousel-item { - height:100%; + + .article-slides { + height: 450px; + + .carousel, + .carousel-inner, + .carousel-item { + height: 100%; overflow: hidden; } - .carousel-item{ - background:center center no-repeat; - background-size:contain; - img{ + + .carousel-item { + background: center center no-repeat; + background-size: contain; + + img { display: none; } } - &+.article-content{ + &+.article-content { min-height: 200px; } } } -.loginbox{ - padding-top:10%; +.loginbox { + padding-top: 10%; } -.register{ - padding-top:30px; +.register { + padding-top: 30px; } -.sidecolumn{ - .card-header{ + +.sidecolumn { + .card-header { font-weight: bold; } - .list-side{ - a{ - display:block; - margin:8px 0; - line-height:1.2em; + + .list-side { + a { + display: block; + margin: 8px 0; + line-height: 1.2em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; @@ -311,83 +357,98 @@ a{ } } -.page-item{ - .page-link{ - color:#009dac; +.page-item { + .page-link { + color: #009dac; } - &.active{ - .page-link{ - color:#fff; + + &.active { + .page-link { + color: #fff; background-color: #009dac; border-color: #009dac; } } - &:first-child .page-link{ - border-top-left-radius: 0; - border-bottom-left-radius: 0; + + &:first-child .page-link { + border-top-left-radius: 0; + border-bottom-left-radius: 0; } - &:last-child .page-link{ - border-top-right-radius: 0; - border-bottom-right-radius: 0; + + &:last-child .page-link { + border-top-right-radius: 0; + border-bottom-right-radius: 0; } } @media (max-width: 991px) { - .carousel{ - .carousel-item{ - height:260px; + .carousel { + .carousel-item { + height: 260px; } } - .subbanner{ - height:120px; + + .subbanner { + height: 120px; } - header .container{ - padding:0; + + header .container { + padding: 0; } + .nav-box { - .navbar-collapse{ - border-top:1px @bg-hover solid; + .navbar-collapse { + border-top: 1px @bg-hover solid; } + .navbar-nav { .nav-link { - padding : 0.5rem 1rem; + padding: 0.5rem 1rem; } - .dropdown-menu{ - border:0; - border-radius:0; - margin:0; + + .dropdown-menu { + border: 0; + border-radius: 0; + margin: 0; box-shadow: none; - background:@bg-grey; - z-index:1; + background: @bg-grey; + z-index: 1; } } } - .list-body,.view-body{ - .sidecolumn{ + + .list-body, + .view-body { + .sidecolumn { display: none; } } - .article-body{ - .article-info{ + + .article-body { + .article-info { width: 95%; } } } + @media (max-width: 480px) { - .carousel{ - .carousel-item{ - height:150px; + .carousel { + .carousel-item { + height: 150px; } } - .subbanner{ - height:80px; + + .subbanner { + height: 80px; } - .article-list{ + + .article-list { .list-group-item { flex-wrap: wrap; + .list-img { - width : 100%; - padding-top:60%; + width: 100%; + padding-top: 60%; } } } diff --git a/resource/less/model/_case.less b/resource/less/model/_case.less index edabf777..9949bb29 100644 --- a/resource/less/model/_case.less +++ b/resource/less/model/_case.less @@ -1,36 +1,43 @@ -.case-list{ - padding:2rem 0; - .card{ - border-radius:0; - box-shadow: rgba(0,0,0,.08) 0 0 5px; +.case-list { + padding: 2rem 0; + + .card { + border-radius: 0; + box-shadow: rgba(0, 0, 0, .08) 0 0 5px; position: relative; transition: background-color .3s; - border:0; - .card-body{ + border: 0; + + .card-body { position: relative; - z-index:2; - h3{ + z-index: 2; + + h3 { transition: color .3s; } } - .mask{ - background:url(../images/eye.png) center -99px no-repeat rgba(0,0,0,0); - transition:background-color,background-position .5s; - z-index:1; - position:absolute; - left:0; - top:0; - width:100%; - height :100%; + + .mask { + background: url(../images/eye.png) center -99px no-repeat rgba(0, 0, 0, 0); + transition: background-color, background-position .5s; + z-index: 1; + position: absolute; + left: 0; + top: 0; + width: 100%; + height: 100%; } - &:hover{ - background:@color-text; - .card-body h3{ - color:@color-white; + + &:hover { + background: @color-text; + + .card-body h3 { + color: @color-white; } - .mask{ - background-color:rgba(0,0,0,.6); - background-position:center 72px; + + .mask { + background-color: rgba(0, 0, 0, .6); + background-position: center 72px; } } } diff --git a/resource/less/model/_common.less b/resource/less/model/_common.less index b64d3ee5..eb8f4937 100644 --- a/resource/less/model/_common.less +++ b/resource/less/model/_common.less @@ -1,129 +1,170 @@ -html{font-size:14px;} +html { + font-size: 14px; +} -body{background:@bg-light;} +body { + background: @bg-light; +} -h1{font-size:1.5rem;} -h2{font-size:1.4rem;} -h3{font-size:1.3rem;} -h4{font-size:1.2rem;} -h5{font-size:1.1rem;} -h6{ font-size :1rem;} +h1 { + font-size: 1.5rem; +} + +h2 { + font-size: 1.4rem; +} + +h3 { + font-size: 1.3rem; +} + +h4 { + font-size: 1.2rem; +} -.input-group-middle{ +h5 { + font-size: 1.1rem; +} + +h6 { + font-size: 1rem; +} + +.input-group-middle { display: -ms-flexbox; display: flex; - >.input-group-text{ - border-radius:0; - border-left:0; - border-right:0; + + >.input-group-text { + border-radius: 0; + border-left: 0; + border-right: 0; } } -.list-loading{ + +.list-loading { text-align: center; color: @color-text-light; - padding:20px 0; + padding: 20px 0; } -.empty{ +.empty { text-align: center; color: @color-text-light; - padding:50px 0; + padding: 50px 0; } -.media-left{ - width:100px; - height:60px; - overflow : hidden; - .media-object{ + +.media-left { + width: 100px; + height: 60px; + overflow: hidden; + + .media-object { max-width: 100%; - max-height:100%; + max-height: 100%; } } -.control-label{ - margin-bottom:0; - line-height :2.25rem; +.control-label { + margin-bottom: 0; + line-height: 2.25rem; } -.nav-box{ - border-bottom:1px @bd-dark solid; - padding:0; - line-height:2.5; + +.nav-box { + border-bottom: 1px @bd-dark solid; + padding: 0; + line-height: 2.5; } -.navbar-brand{ - padding:0.5rem 0; - margin-right:0; - img{ - display:block; + +.navbar-brand { + padding: 0.5rem 0; + margin-right: 0; + + img { + display: block; } } -.main-nav{ - margin-right:150px; - flex:1; -} -.nav-box .dropdown-menu{ - margin:0; - border-radius:0; - border-top:1px @color-eye-daker solid; - background:@bg-nav; - .dropdown-item{ - color:rgba(255,255,255,.5); - &:hover,&:focus{ - color:rgba(255,255,255,.9); - background:none; + +.main-nav { + margin-right: 150px; + flex: 1; +} + +.nav-box .dropdown-menu { + margin: 0; + border-radius: 0; + border-top: 1px @color-eye-daker solid; + background: @bg-nav; + + .dropdown-item { + color: rgba(255, 255, 255, .5); + + &:hover, + &:focus { + color: rgba(255, 255, 255, .9); + background: none; } } - .active{ - color:rgba(255,255,255,1); - background:none; + + .active { + color: rgba(255, 255, 255, 1); + background: none; } } -.subbanner .inner{ - height :250px; - background:url(../images/blank.gif) center center no-repeat @bg-dark; - background-size:cover; +.subbanner .inner { + height: 250px; + background: url(../images/blank.gif) center center no-repeat @bg-dark; + background-size: cover; } -.main{ - padding:0 0 1rem 0; - .container{ - margin-top:1rem; +.main { + padding: 0 0 1rem 0; + + .container { + margin-top: 1rem; } } -.nav-row{ - border-bottom:1px @bd-light solid; - .row-item{ +.nav-row { + border-bottom: 1px @bd-light solid; + + .row-item { text-align: center; - line-height :4rem; - margin-top:1rem; - color:@color-text-dark; + line-height: 4rem; + margin-top: 1rem; + color: @color-text-dark; } - .active{ - color:@color-eye; + + .active { + color: @color-eye; } } @media (max-width:992px) { - .navbar{ - .main-nav{ - .dropdown-item{ + .navbar { + .main-nav { + .dropdown-item { text-align: center; } } - ul.justify-content-end{ - display:flex; + + ul.justify-content-end { + display: flex; flex-direction: row; - border-top:1px #666 solid; - li{ - width :40%; - flex:1; - border-right:1px #666 solid; - &:last-child{ - border-right:0; + border-top: 1px #666 solid; + + li { + width: 40%; + flex: 1; + border-right: 1px #666 solid; + + &:last-child { + border-right: 0; } - .nav-link{ + + .nav-link { text-align: center; } } diff --git a/resource/less/model/_footer.less b/resource/less/model/_footer.less index 9e46f207..246ac933 100644 --- a/resource/less/model/_footer.less +++ b/resource/less/model/_footer.less @@ -1,22 +1,26 @@ +.footer { + padding-top: 70px; -.footer{ - padding-top:70px; - dd{ - margin-top:1.8rem; - line-height:1.8rem; - a{ - display:block; - color:@color-text-grey; + dd { + margin-top: 1.8rem; + line-height: 1.8rem; + + a { + display: block; + color: @color-text-grey; } } - hr{ - border-color:@bd-line-dark; + + hr { + border-color: @bd-line-dark; } - .copyright-row{ - line-height:40px; - padding-bottom:20px; - a{ - color:@color-text-grey; + + .copyright-row { + line-height: 40px; + padding-bottom: 20px; + + a { + color: @color-text-grey; } } -} +} \ No newline at end of file diff --git a/resource/less/model/_index.less b/resource/less/model/_index.less index dd00834e..6173ddbe 100644 --- a/resource/less/model/_index.less +++ b/resource/less/model/_index.less @@ -1,204 +1,238 @@ -#carouselBannerControls{ - height :597px; - .carousel-item{ - height :597px; +#carouselBannerControls { + height: 597px; + + .carousel-item { + height: 597px; overflow: hidden; - background:url(../images/blank.gif) center center no-repeat @bg-dark; - background-size:auto 100%; - img{ - display:none; + background: url(../images/blank.gif) center center no-repeat @bg-dark; + background-size: auto 100%; + + img { + display: none; } } } -.index-card{ - padding:30px; +.index-card { + padding: 30px; } -.index-bg{ - background:@color-white; + +.index-bg { + background: @color-white; } -.index-card-title{ - h2{ + +.index-card-title { + h2 { text-align: center; - color:@color-text-dark; - &::after{ - content:"."; - color:@color-eye; - font-size:2rem; + color: @color-text-dark; + + &::after { + content: "."; + color: @color-eye; + font-size: 2rem; line-height: 0.6; - font-weight:bold; + font-weight: bold; vertical-align: sub; } } - p{ + + p { text-align: center; - color:@color-text-lighter; + color: @color-text-lighter; } } -.index-card .slide{ - h2{ + +.index-card .slide { + h2 { + text-align: left; + } + + p { text-align: left; } - p{ - text-align: left; - } } -.service-body{ - padding-top:40px; - .figure{ - transition:opacity .3s; - &:hover{ +.service-body { + padding-top: 40px; + + .figure { + transition: opacity .3s; + + &:hover { opacity: .5; } - figcaption{ + + figcaption { text-align: center; white-space: nowrap; } - .figure-title{ - color:@color-text-dark; + + .figure-title { + color: @color-text-dark; } - .figure-caption{ - font-size:0.8rem; + + .figure-caption { + font-size: 0.8rem; } } } -.solution-body{ - .nav{ - background:@bg-light; +.solution-body { + .nav { + background: @bg-light; } - .nav-link{ - padding:24px 30px; - color:@color-text-dark; - border-radius:0; - position:relative; - border-bottom:1px @bd-light solid; - transition:background-color .3s; - &:last-child{ - border-bottom:0; - } - &:after{ - content:""; - display:block; + + .nav-link { + padding: 24px 30px; + color: @color-text-dark; + border-radius: 0; + position: relative; + border-bottom: 1px @bd-light solid; + transition: background-color .3s; + + &:last-child { + border-bottom: 0; + } + + &:after { + content: ""; + display: block; position: absolute; - top:0; - left:0; - height:100%; - width:0; - background:rgba(0,0,0,.1); - border-left:0; - transition:all .5s; - } - &.active{ - background:rgba(0,0,0,.1); - color:@color-text-dark; - &:after{ - left:-16px; - width:16px; - border-left:4px @color-text-dark solid; + top: 0; + left: 0; + height: 100%; + width: 0; + background: rgba(0, 0, 0, .1); + border-left: 0; + transition: all .5s; + } + + &.active { + background: rgba(0, 0, 0, .1); + color: @color-text-dark; + + &:after { + left: -16px; + width: 16px; + border-left: 4px @color-text-dark solid; } } - p{ - line-height:1.8rem; - margin:0; + + p { + line-height: 1.8rem; + margin: 0; } - .vice_title{ - color:@color-text-light; + + .vice_title { + color: @color-text-light; } } } -.cases-body{ - .card{ - border-radius:0; - box-shadow: rgba(0,0,0,.08) 0 0 5px; +.cases-body { + .card { + border-radius: 0; + box-shadow: rgba(0, 0, 0, .08) 0 0 5px; position: relative; transition: background-color .3s; - border:0; - .card-body{ + border: 0; + + .card-body { position: relative; - z-index:2; + z-index: 2; } - h3{ + + h3 { transition: color .3s; } - .mask{ - background:url(../images/eye.png) center -99px no-repeat rgba(0,0,0,0); - transition:background-color,background-position .5s; - z-index:1; - position:absolute; - left:0; - top:0; - width:100%; - height :100%; - } - &:hover{ - background:@color-text; - .mask{ - background-color:rgba(0,0,0,.6); - background-position:center 72px; + + .mask { + background: url(../images/eye.png) center -99px no-repeat rgba(0, 0, 0, 0); + transition: background-color, background-position .5s; + z-index: 1; + position: absolute; + left: 0; + top: 0; + width: 100%; + height: 100%; + } + + &:hover { + background: @color-text; + + .mask { + background-color: rgba(0, 0, 0, .6); + background-position: center 72px; } - h3{ - color:@color-white; + + h3 { + color: @color-white; } } } } -.about-body{ - padding-top:60px; +.about-body { + padding-top: 60px; } -.slide-box a{ - color:#fff; - line-height:3rem; - display:inline-block; - width:3rem; +.slide-box a { + color: #fff; + line-height: 3rem; + display: inline-block; + width: 3rem; text-align: center; - background:@color-text; - border-radius:5px; + background: @color-text; + border-radius: 5px; } -.news-body{ - a{ +.news-body { + a { text-decoration: none; } - .media{ - background:#fff; - transition:background-color .3s; - >img{ + + .media { + background: #fff; + transition: background-color .3s; + + >img { width: 133px; - height :100px; - } - .media-body{ - padding-top:1.6rem; - .badge{ - border-radius:0; - padding:0 10px; - color:@color-text-lighter; - border:1px @color-text-lighter solid; - background:transparent; - display:inline-block; - line-height :1.6rem; - margin-right:1rem; + height: 100px; + } + + .media-body { + padding-top: 1.6rem; + + .badge { + border-radius: 0; + padding: 0 10px; + color: @color-text-lighter; + border: 1px @color-text-lighter solid; + background: transparent; + display: inline-block; + line-height: 1.6rem; + margin-right: 1rem; } - .text-muted{ - color:@color-text-lighter; + + .text-muted { + color: @color-text-lighter; } - h4{ - color:@color-text; - transition:color .3s; - font-size:1rem; - margin-top:1rem; + + h4 { + color: @color-text; + transition: color .3s; + font-size: 1rem; + margin-top: 1rem; } } + &:hover { - background : @color-text; + background: @color-text; + .media-body { h4 { - color : #fff; + color: #fff; } } } diff --git a/resource/less/model/_member.less b/resource/less/model/_member.less index ec7ee5bb..c32d40e0 100644 --- a/resource/less/model/_member.less +++ b/resource/less/model/_member.less @@ -1,9 +1,11 @@ -.user-index{ - padding:0; - .user-header{ - background:#fff; +.user-index { + padding: 0; + + .user-header { + background: #fff; } - .list-group{ - margin-top:10px; + + .list-group { + margin-top: 10px; } } \ No newline at end of file diff --git a/resource/less/model/_order.less b/resource/less/model/_order.less index 4449b950..ff277b54 100644 --- a/resource/less/model/_order.less +++ b/resource/less/model/_order.less @@ -1,5 +1,5 @@ -.order-body{ - .card{ - margin-top:1rem; +.order-body { + .card { + margin-top: 1rem; } } \ No newline at end of file diff --git a/resource/less/model/_page.less b/resource/less/model/_page.less index c2dede39..5c8282fe 100644 --- a/resource/less/model/_page.less +++ b/resource/less/model/_page.less @@ -1,17 +1,18 @@ -.page-title{ +.page-title { text-align: center; - line-height:4rem; - margin-top:4rem; - &:after{ - content:""; - display:block; - width:60px; - height:0; - border-bottom:2px @color-eye solid; - margin:0 auto; + line-height: 4rem; + margin-top: 4rem; + + &:after { + content: ""; + display: block; + width: 60px; + height: 0; + border-bottom: 2px @color-eye solid; + margin: 0 auto; } } -.page-content{ +.page-content { min-height: 500px; } \ No newline at end of file diff --git a/resource/less/model/_product.less b/resource/less/model/_product.less index 09470cb2..6310df2f 100644 --- a/resource/less/model/_product.less +++ b/resource/less/model/_product.less @@ -1,26 +1,30 @@ -.product-list{ - padding:2rem 0; - .card{ - border-radius:0; - box-shadow: rgba(0,0,0,.08) 0 0 5px; +.product-list { + padding: 2rem 0; + + .card { + border-radius: 0; + box-shadow: rgba(0, 0, 0, .08) 0 0 5px; position: relative; transition: background-color .3s; - border:0; - background:@color-text; - .card-body{ + border: 0; + background: @color-text; + + .card-body { position: relative; - z-index:2; - h3{ - color:@color-white; + z-index: 2; + + h3 { + color: @color-white; } } - .mask{ - z-index:1; - position:absolute; - left:0; - top:0; - width:100%; - height :100%; + + .mask { + z-index: 1; + position: absolute; + left: 0; + top: 0; + width: 100%; + height: 100%; } } } \ No newline at end of file diff --git a/resource/less/style.less b/resource/less/style.less index 28ac6142..0d7be76a 100644 --- a/resource/less/style.less +++ b/resource/less/style.less @@ -1,18 +1,18 @@ -@color-text:#1f2326; -@color-text-light:#a1a1a1; -@color-text-lighter:#c2c2c2; -@color-text-grey:#898989; -@color-text-dark:#282828; -@color-eye:#bf1e2e; -@color-eye-daker:#992835; -@color-white:#fff; +@color-text: #1f2326; +@color-text-light: #a1a1a1; +@color-text-lighter: #c2c2c2; +@color-text-grey: #898989; +@color-text-dark: #282828; +@color-eye: #bf1e2e; +@color-eye-daker: #992835; +@color-white: #fff; -@bg-nav:#343a40; -@bg-dark:#272727; -@bg-light:#f5f5f5; -@bd-dark:#2b2b2c; -@bd-light:#e6e6e6; -@bd-line-dark:#3e4044; +@bg-nav: #343a40; +@bg-dark: #272727; +@bg-light: #f5f5f5; +@bd-dark: #2b2b2c; +@bd-light: #e6e6e6; +@bd-line-dark: #3e4044;