Commit 3979a58f by 梁建民

css

parent 98094069
......@@ -77,7 +77,7 @@
title="期货" checked id="daytext">
<div class="lineBlock" id="day">
<input type="text" placeholder="输入时间" class="boxsiz day_input input"
lay-verify="required|number" name="day">
lay-verify="required" name="day">
<i class="day"></i>
</div>
</div>
......
......@@ -56,13 +56,11 @@
</div>
<div class="search_command clr">
<span class="fl comman_title">热门搜索:</span>
<div class="fl command_name">
<div class="fl">LM358</div>
<div class="fl">LM358</div>
<div class="fl">LM358</div>
<div class="fl">LM358</div>
<div class="fl">LM358</div>
<div class="fl">LM358</div>
<volist name="hot_goods" id="vo">
<a class="fl" href="{$vo.url}" title="{$vo.title}" target="_blank">{$vo.title}</a>
</volist>
</div>
</div>
</div>
......
......@@ -110,13 +110,14 @@
color: #8A9299;
width: 625px;
}
.home_content .search_section .search_command .command_name div {
.home_content .search_section .search_command .command_name a {
margin-left: 20px;
cursor: pointer;
transition: all 0.2s ease-in-out;
display: block;
}
.home_content .search_section .search_command .command_name div.active,
.home_content .search_section .search_command .command_name div:hover {
.home_content .search_section .search_command .command_name a.active,
.home_content .search_section .search_command .command_name a:hover {
color: #0D84D1;
}
.home_content .xj_title {
......
{"version":3,"sources":["home.less"],"names":[],"mappings":"AAAA,aACI;EACI,aAAA;EACA,sBAAA;EACA,6BAAA;EACA,eAAA;;AALR,aACI,WAMI;EACI,gBAAA;EACA,OAAO,kBAAP;EACA,mBAAA;;AAVZ,aACI,WAMI,aAKI;EACI,aAAA;EACA,YAAA;EACA,sBAAA;EACA,kBAAA;;AAhBhB,aACI,WAMI,aAYI;EACI,cAAA;EACA,OAAO,kBAAP;;AArBhB,aACI,WAMI,aAYI,WAII;EACI,eAAA;;AAxBpB,aACI,WAMI,aAYI,WASI;EACI,gBAAA;EACA,eAAA;EACA,mBAAA;;AA/BpB,aACI,WAMI,aAYI,WAeI;EACI,cAAA;EACA,eAAA;EACA,gBAAA;;AArCpB,aACI,WAMI,aAYI,WAeI,YAKI;EACI,kBAAA;;AAxCxB,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AII,aA4BI,KAGI;EACI,cAAA;;AAtRxB,aAkOI,QAgBI,aAII,aAoCI;EACI,UAAA;;AA3RpB,aAkOI,QAgBI,aAII,aAoCI,SAGI;EACI,eAAA;EACA,cAAA;EACA,yCAAA;EACA,8BAAA;EACA,gBAAA;EACA,kBAAA;;AAEA,aAnEpB,QAgBI,aAII,aAoCI,SAGI,MAQK;EACG,yCAAA;EACA,cAAA;;AAvS5B,aAkOI,QAgBI,aAII,aAoCI,SAiBI;EACI,cAAA;;AA5SxB,aAkOI,QAgBI,aAII,aA0DI;EACI,UAAA;;AAjTpB,aAkOI,QAgBI,aAII,aA+DI;EACI,WAAA;EACA,cAAA;EACA,SAAA;EACA,eAAA;;AAGJ,aA1FZ,QAgBI,aAII,aAsEK;EACG,qDAAA","file":"home.css"}
\ No newline at end of file
{"version":3,"sources":["home.less"],"names":[],"mappings":"AAAA,aACI;EACI,aAAA;EACA,sBAAA;EACA,6BAAA;EACA,eAAA;;AALR,aACI,WAMI;EACI,gBAAA;EACA,OAAO,kBAAP;EACA,mBAAA;;AAVZ,aACI,WAMI,aAKI;EACI,aAAA;EACA,YAAA;EACA,sBAAA;EACA,kBAAA;;AAhBhB,aACI,WAMI,aAYI;EACI,cAAA;EACA,OAAO,kBAAP;;AArBhB,aACI,WAMI,aAYI,WAII;EACI,eAAA;;AAxBpB,aACI,WAMI,aAYI,WASI;EACI,gBAAA;EACA,eAAA;EACA,mBAAA;;AA/BpB,aACI,WAMI,aAYI,WAeI;EACI,cAAA;EACA,eAAA;EACA,gBAAA;;AArCpB,aACI,WAMI,aAYI,WAeI,YAKI;EACI,kBAAA;;AAxCxB,aACI,WAMI,aAYI,WAeI,YAKI,OAGI;EACI,cAAA;;AA3C5B,aACI,WAiDI;EACI,gBAAA;EACA,kBAAA;EACA,YAAA;;AArDZ,aACI,WAiDI,YAKI;EACI,cAAA;;AAxDhB,aACI,WAiDI,YASI;EACI,eAAA;;AAEA,aA7DZ,WAiDI,YASI,KAGK;EACG,cA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,aAII,aAoCI,SAGI,MAQK;EACG,yCAAA;EACA,cAAA;;AAxS5B,aAmOI,QAgBI,aAII,aAoCI,SAiBI;EACI,cAAA;;AA7SxB,aAmOI,QAgBI,aAII,aA0DI;EACI,UAAA;;AAlTpB,aAmOI,QAgBI,aAII,aA+DI;EACI,WAAA;EACA,cAAA;EACA,SAAA;EACA,eAAA;;AAGJ,aA1FZ,QAgBI,aAII,aAsEK;EACG,qDAAA","file":"home.css"}
\ No newline at end of file
......@@ -136,10 +136,11 @@
color: #8A9299;
width: 625px;
div {
a {
margin-left: 20px;
cursor: pointer;
transition: all 0.2s ease-in-out;
display: block;
&.active ,&:hover{
color: #0D84D1;
......
! function () {
!function () {
window.AccountController = {
isClick: false,
token: Util.getCookie('token') || '',
......@@ -7,42 +7,42 @@
this.created(this).isIe(this).mounted(this).handleBind(this);
},
created: function (opt) {
//默认获取省
IcController.getData(apis.regionPcd, 'POST', {
token: opt.token
}, function (res) {
if (res.errcode === 0) {
var getTpl = provinceHtml.innerHTML;
layui.laytpl(getTpl).render(res.data, function (html) {
$("#province_id").empty().html(html);
layui.form.render();
});
}
});
return this;
},
mounted: function (opt) {
//获取会员信息
IcController.getData(apis.userInfo, 'GET', {
token: opt.token
}, function (res) {
if (res.errcode === 0) {
//手机号
$("input[name='mobile']").val(res.data.mobile);
//消息通知
layui.form.val("userInfo", {
"sys_msg": Number(res.data.sys_msg),
......@@ -55,12 +55,12 @@
$('#fileLoad img').attr('src', res.data.avatar)
} else {
//非ie低版本
$('#upload_section img').attr('src',res.data.avatar)
$('#upload_section img').attr('src', res.data.avatar)
}
}
if (res.data.province && res.data.city && res.data.district) {
//省
Observer.emit('region', {
type: 'province_id',
......@@ -70,10 +70,10 @@
detail_address: res.data.detail_address,
flag: true
});
//市
setTimeout(function () {
Observer.emit('region', {
type: 'city_id',
province_id: Number(res.data.province),
......@@ -82,15 +82,15 @@
detail_address: res.data.detail_address,
flag: true
});
}, 200)
}
}
});
return this;
},
uploadFun: function () {
......@@ -101,8 +101,8 @@
data: {
token: Util.getCookie('token'),
source: 2,
},
field: "upload",
before: function () {
......@@ -123,42 +123,62 @@
err: function () {
layer.closeAll('loading');
layer.msg('上传失败');
}
});
},
isIe: function (opt) {
if (navigator.appName == "Microsoft Internet Explorer" && (navigator.appVersion.split(";")[1].replace(/[ ]/g, "") == "MSIE8.0" || navigator.appVersion.split(";")[1].replace(/[ ]/g, "") == "MSIE9.0")) {
//ie版本
$('#fileLoad').show();
document.domain = cookieHostname; //设置domian跨域拿到iframe的内容
var iframe = document.getElementById("test");
if (iframe.attachEvent) {
iframe.attachEvent("onload", opt.iframeOnload);
} else {
iframe.onload = opt.iframeOnload;
};
}
opt.formSubmit();
$('#mineFiles').on('change', function () {
layer.load(1, {
offset: ['50%', "50%"],
shade: false
});
$('#fileLoad').submit();
})
} else {
//非ie低版本
$('.sc_div').show();
opt.uploadFun();
}
return this;
},
formSubmit: function () {
$('#fileLoad').submit(function () {
var uploadFileForm = document.getElementById("fileLoad");
uploadFileForm.action = apis.ossupload;
$('#token').val(Util.getCookie('token'));
$('#ie').val(cookieHostname);
})
},
......@@ -178,7 +198,7 @@
console.log(e)
layer.closeAll('loading');
layer.msg('上传失败');
}
if (json) {
layer.closeAll('loading');
......@@ -187,186 +207,186 @@
AccountController.imgUrl = json.data[0] || '';
} else {
layer.msg(json.errmsg)
}
}
},
handleBind: function (opt) {
//系统消息通知
layui.form.on('switch(sys_msg)', function (data) {
Observer.emit('switch', {
type: 1,
data: data.elem.checked ? 1 : 0
});
});
//业务通知
layui.form.on('switch(business_msg)', function (data) {
Observer.emit('switch', {
type: 2,
data: data.elem.checked ? 1 : 0
});
});
//活动通知
layui.form.on('switch(activity_msg)', function (data) {
Observer.emit('switch', {
type: 3,
data: data.elem.checked ? 1 : 0
});
});
//监听消息推送
Observer.on('switch', function (e) {
IcController.getData(apis.userSetmsg, 'GET', {
token: opt.token,
type: e.args.type,
is_open: e.args.data
}, function (res) {
if (res.errcode == 0) {
layer.msg('设置成功');
} else {
layer.msg(res.msg);
}
})
});
//账户设置
layui.form.on('submit(account)', function (data) {
$(data.elem).addClass("layui-btn-disabled");
if (!opt.isClick) {
opt.isClick = true;
var params = $.extend({}, data.field, {
token: opt.token,
avatar: opt.imgUrl
});
IcController.getData(apis.userAccount, 'GET', params, function (res) {
if (res.errcode === 0) {
layer.msg(res.errmsg);
opt.isClick = false;
$(data.elem).removeClass("layui-btn-disabled");
} else {
layer.msg(res.errmsg);
opt.isClick = false;
$(data.elem).removeClass("layui-btn-disabled");
}
});
}
});
//省
layui.form.on('select(province_id)', function (data) {
Observer.emit('region', {
type: 'province_id',
province_id: data.value,
city_id: ''
});
});
//市
layui.form.on('select(city_id)', function (data) {
Observer.emit('region', {
type: 'city_id',
province_id: $('select[name="province_id"]').val(),
city_id: data.value
});
});
//监听省市区
Observer.on('region', function (e) {
var getTpl = cityHtml.innerHTML,
getTpl1 = districtHtml.innerHTML,
tpl = '';
e.args.type == 'province_id' ? tpl = getTpl : tpl = getTpl1;
var params = {
token: opt.token,
province_id: e.args.province_id,
city_id: e.args.city_id
};
IcController.getData(apis.regionPcd, 'GET', params, function (res) {
if (res.errcode === 0) {
layui.laytpl(tpl).render(res.data, function (html) {
if (e.args.type == 'province_id') {
//省联动市
$("#city_id").empty().html(html);
$("#district_id").empty().html('<select name="district_id" lay-verify="required" lay-filter="district_id">' +
' <option value=""></option>' +
'</select>');
} else if (e.args.type == 'city_id') {
//市联动区
$("#district_id").empty().html(html);
}
//获取默认省市区
if (e.args.flag) {
layui.form.val("account", {
"province_id": e.args.province_id,
"city_id": e.args.city_id,
"district_id": e.args.district_id,
"detail_address": e.args.detail_address
})
}
layui.form.render();
});
}
}, false);
});
return this;
},
}, $(function () {
......
! function () {
!function () {
window.UploadSingleController = {
isClick: false,
token: Util.getCookie('token') || '',
......@@ -7,23 +7,23 @@
this.created(this).isIe(this).mounted(this).handleBind(this);
},
created: function (opt) {
//判断编辑 新增状态
var id = Util.getRequest('id'),
text = '';
id ? text = '编辑商品' : text = '上传商品';
$("#title").text(text);
return this;
},
mounted: function (opt) {
var id = Util.getRequest('id'),
text = '';
//编辑
if (id) {
IcController.getData(apis.goodsInfo, 'GET', {token: opt.token, 'goods_id/eq': id}, function (res) {
......@@ -39,14 +39,22 @@
"currency": res['goods_list'][id].currency,
"delivery_time": res['goods_list'][id].delivery_time
});
if (res['goods_list'][id].goods_images) {
opt.imgUrl = res['goods_list'][id].goods_images;
$('#fileLoad').hide();
$('.sc_div').hide();
$('.upload_result').show();
$('.upload_result img').attr('src',res['goods_list'][id].goods_images)
$('.upload_result img').attr('src', res['goods_list'][id].goods_images);
}
setTimeout(function () {
......@@ -58,7 +66,7 @@
setTimeout(function () {
layui.form.val("goodsave", {
"day": res['goods_list'][id].delivery_time
"day": res['goods_list'][id].delivery_time.replace('天', '')
});
......@@ -68,24 +76,24 @@
layui.form.render();
}
});
}
return this;
},
uploadFun: function () {
var self = this;
layui.upload.render({
elem: '#upload_section',
url: apis.ossupload,
data: {
token: Util.getCookie('token'),
source: 2,
source: 2
},
field: "upload",
before: function () {
......@@ -95,23 +103,34 @@
});
},
done: function (res) {
layer.closeAll('loading');
if (res.errcode == 103200) {
$('#upload_section').hide();
$('.upload_result').show();
$('.upload_result img').attr('src', res.data[0])
$('.upload_result img').attr('src', res.data[0]);
self.imgUrl = res.data[0] || '';
} else {
layer.msg(res.errmsg)
layer.msg(res.errmsg);
}
},
err: function () {
layer.closeAll('loading');
layer.msg('上传失败');
}
});
},
isIe: function (opt) {
if (navigator.appName == "Microsoft Internet Explorer" && (navigator.appVersion.split(";")[1].replace(/[ ]/g, "") == "MSIE8.0" || navigator.appVersion.split(";")[1].replace(/[ ]/g, "") == "MSIE9.0")) {
......@@ -123,7 +142,8 @@
iframe.attachEvent("onload", opt.iframeOnload);
} else {
iframe.onload = opt.iframeOnload;
};
}
;
opt.formSubmit();
$('#mineFiles').on('change', function () {
layer.load(1, {
......@@ -163,7 +183,7 @@
console.log(e)
layer.closeAll('loading');
layer.msg('上传失败');
}
if (json) {
layer.closeAll('loading');
......@@ -174,48 +194,51 @@
UploadSingleController.imgUrl = json.data[0] || '';
} else {
layer.msg(json.errmsg)
}
}
},
handleBind: function (opt) {
//货期选择
layui.form.on('radio(delivery)', function (data) {
var str = '期货';
data.value == '现货' ? str = '现货' : str = '期货';
var getTpl = deliveryHtml.innerHTML;
layui.laytpl(getTpl).render(str, function (html) {
$("#day").empty().html(html);
});
});
//天数同步期货
$(document).on('input propertychange', 'input[name="day"]', function () {
var val = $(this).val();
$("#daytext").val(val + '天');
});
//上传商品发布
layui.form.on('submit(add)', function (data) {
$(data.elem).addClass("layui-btn-disabled");
var id = Util.getRequest('id'),
params = {},
url = '';
if (!opt.isClick) {
opt.isClick = true;
id ? params = $.extend({}, data.field, {
goods_images: opt.imgUrl,
token: opt.token,
......@@ -224,48 +247,54 @@
goods_images: opt.imgUrl,
token: opt.token
});
id ? url = apis.goodsSave : url = apis.goodsAdd;
IcController.getData(url, 'GET', params, function (res) {
if (res.errcode === 0) {
layer.msg('上传商品成功', {
time: 2000
}, function () {
window.location.href = '/goodmanage';
});
} else {
layer.msg(res.errmsg);
opt.isClick = false;
$(data.elem).removeClass("layui-btn-disabled");
}
});
}
});
$('.form_content').on('click', '.deleteicon', function () {
if (navigator.appName == "Microsoft Internet Explorer" && (navigator.appVersion.split(";")[1].replace(/[ ]/g, "") == "MSIE8.0" || navigator.appVersion.split(";")[1].replace(/[ ]/g, "") == "MSIE9.0")) {
//ie版本
$('#fileLoad').show();
} else {
//非ie低版本
$('#upload_section').show();
}
$('.upload_result').hide();
$('.upload_result img').attr('src', '');
opt.imgUrl = "";
})
});
return this;
},
}, $(function () {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment