Page for productDisplay V2

master
201530126012@qq.com 7 years ago
parent 9917b19811
commit 693424079a

@ -0,0 +1,100 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>tbdvalidate</title>
<link rel="stylesheet" href="main.css" />
</head>
<body>
<h3 style="font-size:20px; text-align:center; font-weight:bold;"></h3>
<br /><br />
<br /><br />
<!--中心-->
<div class="content">
<div class="login-box"> </div>
</div>
<br /><br />
<h4 style="font-size:16px; text-align:center; font-weight:bold;">demo2 </h4>
<br /><br />
<!--中心-->
<div class="content">
<div class="register-box">
<div class="wrap">
<div class="register-box-con2">
<div class="register-box-con2-box clearfix mar-bottom20">
<label class="register-box-con2-box-left"><em class="bitian"></em>产品名</label>
<div class="register-box-con2-box-right">
<input type="text" class="login-box-cen-form-input w358" placeholder="产品名字" id="name"/>
<label id="reg_info_company_text" class="err err-top40">请输入与工商营业执照一致的公司名称不超过20个字</label>
</div>
</div>
<div class="register-box-con2-box clearfix mar-bottom20">
<label class="register-box-con2-box-left"><em class="bitian"></em>产品信息1</label>
<div class="register-box-con2-box-right">
<input type="text" class="login-box-cen-form-input w358" placeholder="产品信息1" id="r" />
<label class="err err-top40" id="r">请输入正确的网址</label>
</div>
</div>
<div class="register-box-con2-box clearfix mar-bottom20">
<label class="register-box-con2-box-left"><em class="bitian"></em>产品信息2</label>
<div class="register-box-con2-box-right">
<input type="text" class="login-box-cen-form-input w358" placeholder="产品信息2" id="产品信息2" />
<label class="err err-top40" id="information2">公司所在地址不超过40个字</label>
</div>
</div>
<div class="register-box-con2-box clearfix mar-bottom20">
<label class="register-box-con2-box-left"><em class="bitian"></em>产品简介</label>
<div class="register-box-con2-box-right">
<textarea class="login-box-cen-form-textarea w358 h88" id="reg_info_textarea" placeholder="简介不超过200个字....."></textarea>
<label class="err err-top90" id="reg_info_textarea_text">简介不超过200个字</label>
</div>
</div>
<div class="register-box-con2-box clearfix mar-bottom20">
<label class="register-box-con2-box-left"><em class="bitian"></em>产品信息3</label>
<div class="register-box-con2-box-right">
<input type="text" class="login-box-cen-form-input w358" placeholder="请输入 " id="reg_info_name" />
<label class="err err-top40" id="reg_info_name_text">请输入</label>
</div>
</div>
<div class="register-box-con2-box clearfix mar-bottom20">
<label class="register-box-con2-box-left"><em class="bitian">*</em>产品信息3</label>
<div class="register-box-con2-box-right">
<input type="text" class="login-box-cen-form-input w358" placeholder="、" id="reg_info_m" />
<label class="err err-top40" id="reg_info_email_text">请输入有效邮箱,用于接收平台审核等重要消息通知</label>
</div>
</div>
<div class="register-box-con2-box clearfix mar-bottom20">
<label class="register-box-con2-box-left"><em class="bitian">*</em>图 片</label>
<div class="register-box-con2-box-right">
<label class="register-box-con2-box-upload">
<input type="file" name="file" id="reg_info_file" />
<div class="register-box-con2-box-upload-ti"><em id="reg_info_file_w">上传</em><img id="reg_info_file_base64" style="display:none;"/></div>
</label>
</div>
</div>
<div class="register-box-con2-box clearfix mar-bottom20 mar-top50">
<label class="register-box-con2-box-left"></label>
<div class="register-box-con2-box-right">
<input type="submit" value="提交" class="login-box-cen-form-button w380" id="reg_info_submit" />
</div>
</div>
</div>
</div>
</div>
</div>
<br /><br />
<br /><br />
<!--中心-->
<div class="content">
<div class="register-box">
<div class="wrap"> </div>
</div>
</div>
</body>
</html>

File diff suppressed because one or more lines are too long

@ -0,0 +1,76 @@
*{ padding:0; margin:0;}
html{height: 100%;}
body{ font-size:12px; min-width:900px; font-family:'微软雅黑';}
a{ color:#222; text-decoration:none;}
.clearfix:after{ clear:both; display:block; content:'';}
.clearfix{ zoom:1;}
.wrap{ width:1000px; margin:0 auto; }
input:focus,textarea:focus{box-shadow:0 0 3px 1px rgba(32, 127, 179, 0.4);outline: 0 none;}
/******************************* 其他样式 *******************************/
/*错误提示*/
.err{ float:left; height:20px; line-height:20px; text-align:right; font-size:12px; width:100%; color:red; display:none; position:absolute; left:0px;}
.err img{ margin-top:2px; margin-right:2px;}
.err-top40{ top:40px;}
.err-top20{ top:20px;}
.err-top160{ top:160px;}
.err-top90{ top:90px;}
/*上传*/
#reg_info_file_base64 {filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=image);}
/*登录*/
.login-box-cen{ width:240px; border:1px solid #cccccc; margin:0px auto 0px; height:318px; border-radius:10px; padding:0 64px; background:#fff;}
.login-box-cen-ti{ height:76px; line-height:76px; text-align:center; color:#222222; font-size:16px}
.login-box-cen-form{ position:relative;}
.login-box-cen-form-input{ float:left; padding-left:20px; border:1px solid #ccc; height:38px; line-height:38px; font-size:14px; color:#999999;}
.login-box-cen-form-button{float:left; height:40px; line-height:40px; font-size:14px; color:#fff; text-align:center; background:#207fb3; cursor:pointer;}
.login-box-cen-form-ot{ height:30px; line-height:30px; text-align:right; font-size:12px;}
.login-box-cen-form-ot span{color:#999999;}
.login-box-cen-form-ot a{ color:#207fb3;}
.w218{ width:218px;}
.w238{ width:238px;}
.mar-bottom10{ margin-bottom:10px;}
/*注册*/
.register-box-step{ height:30px; margin:0px auto; width:382px; padding:40px 0;}
.register-box-step span{ float:left; line-height:26px; height:30px; width:30px; text-align:center;color:#207fb3; font-size:16px;background: url("register_02.png")/*tpa=http://www.17sucai.com/preview/1266961/2018-07-10/validate/images/register_02.png*/ center top no-repeat;}
.register-box-step span.step-active{ color:#fff;background: url("register_01.png")/*tpa=http://www.17sucai.com/preview/1266961/2018-07-10/validate/images/register_01.png*/ center top no-repeat;}
.register-box-step em{ float:left; width:130px; background:#207fb3; margin-top:13px; height:2px;}
.register-box-step-first{ margin-left:16px;}
.register-box-con{ width:380px; padding: 0 310px; background:#fff; padding-bottom:180px;}
.register-box-con-ti{ height:114px; line-height:114px; text-align:center; font-size:14px; color:#222222; letter-spacing:1px;}
.login-box-cen-form-img{ float:left; height:40px; line-height:40px;overflow:hidden; background:#207fb3;}
.login-box-cen-form-mes{ float:left;border:none; height:40px; line-height:40px; text-align:center;font-size:14px; color:#fff; background:#207fb3; cursor:pointer; border-radius:5px;}
.register-box-cen-form{ position:relative;}
.register-box-cen-form-xieyi{ height:16px; line-height:16px;}
.register-box-cen-form-xieyi span{ display:inline-block; position:relative; height:16px; line-height:16px; width:17px; vertical-align:top; margin:0 36px 0 44px; cursor:pointer; background-image:url("register_03.png")/*tpa=http://www.17sucai.com/preview/1266961/2018-07-10/validate/images/register_03.png*/; background-repeat:no-repeat; background-position:0px 0px;}
.register-box-cen-form-xieyi span.ok{background-position:-17px 0px;}
.register-box-cen-form-xieyi em{display:inline-block; height:16px; line-height:16px;vertical-align:top; font-size:14px;}
.register-box-cen-form-xieyi a{ color:#207fb3;}
.register-box-con2-box{}
.register-box-con2-box-left{ height:40px; line-height:40px; text-align:right; float:left; width:293px; color:#222222; font-size:16px;}
.register-box-con2-box-left strong{ font-weight: bold;}
.register-box-con2-box-right{float:left; width:380px; margin-left:20px; position:relative;}
.register-box-con2-box-right .register-box-con2-box-right-text{ font-size:16px; color:#207fb3; margin-left:20px; line-height:40px;}
.login-box-cen-form-textarea{float:left; padding-left:20px; border:1px solid #ccc;line-height:38px; font-size:14px; color:#999999; resize:none;}
.register-box-con2-box-upload{ position:relative; width:165px; height:98px; float:left;border:1px solid #ccc; margin-bottom:12px; float:left;}
.register-box-con2-box-upload .register-box-con2-box-upload-ti{ position:absolute; left:0px; top:0px;width:165px; height:98px; text-align:center; line-height:98px; font-size:18px; color:#207fb3; z-index:9; overflow:hidden; text-align:center; display:table-cell; }
.register-box-con2-box-upload .register-box-con2-box-upload-ti img{vertical-align:middle;}
.register-box-con2-box-upload input{ position:absolute; left:0px; top:0px;width:165px;z-index:99; opacity:0;filter:alpha(opacity=0);}
.register-box-con2-box-pw{ height:25px; line-height:25px; font-size:14px; color:#222222; float:left; width:380px;}
.register-box-con-good{ padding:20px 0 410px;color:#222222l}
.register-box-con-good img{ display:block; margin:0 auto;}
.register-box-con-good-p1{ font-size:18px;padding:40px 0 20px; text-align:center; line-height:20px;font-weight:500;}
.register-box-con-good-p2{ font-size:14px;text-align:center; line-height:26px;}
.w358{ width:358px;}
.w228{ width:228px;}
.w120{ width:120px;}
.w380{ width:380px;}
.w278{ width:278px;}
.h88{ height:88px;}
.mar-top50{ margin-top:50px;}
.mar-left10{ margin-left:10px;}
.mar-bottom20{ margin-bottom:20px;}
.bitian{ color:#dc2b2b;}

@ -0,0 +1,70 @@
//date: 2016-11-16 author: dgx note:必填正则验证工具
function tbdValidate(elelist,objs){
var errlen=0;//错误个数
var errlist=[];//错误输入框ID
for(var i=0;i<elelist.length;i++){ //失去焦点操作
(function(eleinput,eletext,rule){
document.getElementById(eleinput).onblur=function(){
var intval=this.value.replace(/(^\s*)|(\s*$)/g, "");
for(var j=0;j<rule.length;j++){
var resreg=rule[j].reg.test(intval);
if(resreg){
document.getElementById(eletext).style.display="none";
}else{
document.getElementById(eletext).innerHTML=rule[j].text;
document.getElementById(eletext).style.display="block";
break;
};
};
};
})(elelist[i].eleinput,elelist[i].eletext,elelist[i].rule);
};
document.getElementById(objs.elesubmit).onclick=function(){//提交操作
errlen=0;
errlist=[];
for(var i=0;i<elelist.length;i++){
(function(eleinput,eletext,rule){
var intval=document.getElementById(eleinput).value.replace(/(^\s*)|(\s*$)/g, "");
for(var j=0;j<rule.length;j++){
var resreg=rule[j].reg.test(intval);
if(resreg){
document.getElementById(eletext).style.display="none";
}else{
document.getElementById(eletext).innerHTML=rule[j].text;
document.getElementById(eletext).style.display="block";
errlen+=1;
errlist.push(eleinput);
break;
};
};
})(elelist[i].eleinput,elelist[i].eletext,elelist[i].rule);
};
if(errlen==0){//回调
objs.funsubmit();
}else{
objs.funerr();
objs.funerrlist(errlist);
};
};
};
//date: 2016-11-17 author: dgx note:非必填正则验证工具
function tbdnoValidate(elelist){
for(var i=0;i<elelist.length;i++){ //失去焦点操作
(function(eleinput,eletext,rule){
document.getElementById(eleinput).onblur=function(){
var intval=this.value.replace(/(^\s*)|(\s*$)/g, "");
for(var j=0;j<rule.length;j++){
var resreg=rule[j].reg.test(intval);
if(resreg){
document.getElementById(eletext).style.display="none";
}else{
document.getElementById(eletext).innerHTML=rule[j].text;
document.getElementById(eletext).style.display="block";
this.value="";
break;
};
};
};
})(elelist[i].eleinput,elelist[i].eletext,elelist[i].rule);
};
};

@ -0,0 +1,95 @@
//注册-填写身份信息 上传
var reg_info_file=document.getElementById("reg_info_file");
reg_info_file.onchange=function(){
if(window.FileReader){//ie10 ie10+ w3c
var file = reg_info_file.files[0];
//console.log(file.size);
//console.log(file.type);
if(/(image\/jpeg)|(image\/png)/.test(file.type)){
$("#reg_info_file_text").hide();
}else{
$("#reg_info_file_text").html('支持图片格式JPG/PNG').show();
return false;
};
if(file.size<2*1024*1024){
$("#reg_info_file_text").hide();
}else{
$("#reg_info_file_text").html('图片大小不超过2M').show();
return false;
};
var fr = new FileReader();
fr.readAsDataURL(file);
$("#reg_info_file_base64").removeAttr("width");
$("#reg_info_file_base64").removeAttr("height");
fr.onloadend = function(e) {
$("#reg_info_file_w").hide();
$("#reg_info_file_base64").show();
$("#reg_info_file_base64").attr("src",e.target.result);
$("#reg_info_file_base64")[0].onload=function(){
var upimgw=$("#reg_info_file_base64").width();
var upimgh=$("#reg_info_file_base64").height();
$("#reg_info_file_base64").attr("width",imgPercentScale(165,98,upimgw,upimgh).w);
$("#reg_info_file_base64").attr("height",imgPercentScale(165,98,upimgw,upimgh).h);
};
};
}else{ //ie9-
$("#reg_info_file_w").hide();
$("#reg_info_file_base64").show();
var sFilter='filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale,src="';
reg_info_file.select();
reg_info_file.blur();
var src = document.selection.createRange().text;
//$("#reg_info_file_base64")[0].filters.item('DXImageTransform.Microsoft.AlphaImageLoader').src = src;
$("#reg_info_file_base64")[0].src=src;
$("#reg_info_file_base64")[0].onload=function(){
var upimgw=$("#reg_info_file_base64").width();
var upimgh=$("#reg_info_file_base64").height();
$("#reg_info_file_base64").attr("width",imgPercentScale(165,98,upimgw,upimgh).w);
$("#reg_info_file_base64").attr("height",imgPercentScale(165,98,upimgw,upimgh).h);
};
alert("名片上传不被浏览器支持,请更换浏览器打开网站");
};
};
//date: 2016-12-5 author: 杜关兴 note: 图片比例缩放算法
/*
boxw:容器宽度
boxh:容器高度
imgw:图片宽度
imgh:图片高度
*/
function imgPercentScale(boxw,boxh,imgw,imgh){
var res={};
var wper=imgw/boxw;
var hper=imgh/boxh;
if(wper<=1 && hper<1){
res.w=imgw;
res.h=imgh;
return res;
};
if(wper>1 && hper<1){
res.w=boxw;
var rhper=boxw/imgw;
res.h=imgh*rhper;
return res;
};
if(wper<=1 && hper>1){
res.h=boxh;
var rwper=boxh/imgh;
res.w=imgw*rwper;
return res;
};
if(wper>1 && hper>1){
if(wper>=hper){
res.w=boxw;
var rhper=boxw/imgw;
res.h=imgh*rhper;
return res;
}else{
res.h=boxh;
var rwper=boxh/imgh;
res.w=imgw*rwper;
return res;
};
};
};
Loading…
Cancel
Save