Commit 2660f4dc by 梁建民

js

parent 362a9f30
......@@ -2,15 +2,15 @@
<html lang="zh-CN">
<head>
<include file="public/header" />
<include file="public/header"/>
<link rel="stylesheet" type="text/css" href="__PUBLIC__/css/certification.css">
</head>
<body>
<div class="wrapper">
<include file="public/navleft" />
<include file="public/navleft"/>
<div class="wrapper_right">
<include file="public/top" />
<include file="public/top"/>
<div class="right_content certification_content">
<div class="content layui-form">
<div class="nav_title">认证管理 > 我的认证 > 添加认证</div>
......@@ -23,58 +23,38 @@
<span class="icon iconfont iconjuxing19 va-m"></span>
<span>请如实填写认证信息,不符合的认证将被拒绝</span>
</div>
<div class="certification-show clr" style="display: none">
<div class="fl l">
<div class="pic lineBlock va-m">
<img src="__PUBLIC__/images/test.jpg" alt="">
</div>
<div class="lineBlock va-m">
<p class="t1">深圳市猎芯科技有限公司</p>
<p class="t2">
<span class="">资质:<em>企业认证</em></span>
<span style="margin-left:90px;" class="">性质:<em>贸易商</em></span>
</p>
<div style="white-space: nowrap">
<a href="javascript:;" class="btn lineBlock">更新认证信息</a>
<p class="lineBlock t3 va-b">
<i class="iconfont iconjuxing20 va-m"></i>
<span>驳回理由:上传的资料不清晰,无法确认资质。</span>
</p>
</div>
</div>
</div>
<div class="fr r">
<img src="__PUBLIC__/images/sa.png" alt="" width="180" height="180">
</div>
</div>
<div class="form_content clr" style="display: block;">
<div class="form_left fl layui-form">
<div class="hq input_div ">
<div class="certis certification-show clr" style="display: none"></div>
<div class="certisno form_content clr layui-form" style="display: none;" lay-filter="editauth">
<div class="form_left fl">
<div class="hq input_div">
<span class="input_title lineBlock">认证类型:</span>
<div class="input_parent">
<input type="radio" name="auth_type" value="2" title="企业">
<input type="radio" name="auth_type" value="1" title="个人" checked>
<input type="radio" name="auth_type" value="2" title="企业" lay-filter="auth_type"/>
<input type="radio" name="auth_type" value="1" title="个人" checked lay-filter="auth_type"/>
</div>
</div>
<div class="hq input_div ">
<span class="input_title lineBlock">经营性质:</span>
<div class="input_parent">
<input type="radio" name="sex" value="" title="个人" checked>
<div class="cert_data">
<div class="hq input_div ">
<span class="input_title lineBlock">经营性质:</span>
<div class="input_parent">
<input type="radio" name="company_type" value="5" title="个人" checked>
</div>
</div>
</div>
<div class="xh input_div ">
<span class="input_title lineBlock">个人名称:</span>
<div class="input_parent">
<input type="text" placeholder="请输入个人名称" class="input boxsiz">
<div class="xh input_div ">
<span class="input_title lineBlock">个人名称:</span>
<div class="input_parent">
<input type="text" placeholder="请输入个人名称" class="input boxsiz" name="company_name">
</div>
</div>
</div>
<div class="btn_div">
<span class="lineBlock fb boxsiz">提交认证</span>
<span class="lineBlock fb boxsiz" lay-submit lay-filter="addauth">提交认证</span>
<span class="lineBlock cz boxsiz">重置</span>
</div>
</div>
<div class="form_right fl ">
<div class="sc">
<input type="hidden" name="auth_img" value="1.jpg">
<div class="icon iconfont iconjuxing16"></div>
<p>上传资料</p>
</div>
......@@ -86,7 +66,82 @@
</div>
</div>
</div>
<include file="public/foot" />
<include file="public/foot"/>
<script src="__PUBLIC__/js/certification/index.js"></script>
<script type="text/html" id="certtHtml">
{{# if (d == '1') { }}
<div class="hq input_div ">
<span class="input_title lineBlock">经营性质:</span>
<div class="input_parent">
<input type="radio" name="company_type" value="5" title="个人" checked>
</div>
</div>
<div class="xh input_div ">
<span class="input_title lineBlock">个人名称:</span>
<div class="input_parent">
<input type="text" placeholder="请输入个人名称" class="input boxsiz" name="company_name">
</div>
</div>
{{# } else { }}
<div class="hq input_div ">
<span class="input_title lineBlock">经营性质:</span>
<div class="input_parent">
<input type="radio" name="company_type" value="1" title="贸易商" checked/>
<input type="radio" name="company_type" value="2" title="代理商"/>
<input type="radio" name="company_type" value="3" title="原厂"/>
<input type="radio" name="company_type" value="4" title="制造商"/>
</div>
</div>
<div class="xh input_div ">
<span class="input_title lineBlock">个人名称:</span>
<div class="input_parent">
<input type="text" placeholder="请输入公司名称" class="input boxsiz" name="company_name">
</div>
</div>
{{# } }}
</script>
<script type="text/html" id="listHtml">
{{# layui.each(d, function(index, item){ }}
<div class="list clr" style="margin-bottom: 40px;">
<div class="fl l">
<div class="pic lineBlock va-m">
<img src="{{item.auth_img}}" alt="{{item.company_name}}" title="{{item.company_name}}">
</div>
<div class="lineBlock va-m">
<p class="t1">{{item.company_name}}</p>
<p class="t2">
<span class="">资质:<em>{{item.auth_type_val}}</em></span>
<span style="margin-left:90px;" class="">性质:<em>{{item.company_type_val}}</em></span>
</p>
<div style="white-space: nowrap">
{{# if (item.status== 2) { }}
<a href="javascript:;" class="btn lineBlock edit_info" data-id="{{item.id}}">重新提交信息</a>
{{# } else { }}
<a href="javascript:;" class="btn lineBlock edit_info" data-id="{{item.id}}">更新认证信息</a>
{{# } }}
{{# if (item.status== 2) { }}
<p class="lineBlock t3 va-b">
<i class="iconfont iconjuxing20 va-m"></i>
<span>驳回理由:{{item.reject_reason}}</span>
</p>
{{# } }}
</div>
</div>
</div>
<div class="fr r">
{{# if (item.status== 1) { }}
<img src="__PUBLIC__/images/bb.png" alt="" width="180" height="180">
{{# } else if(item.status== 2) { }}
<img src="__PUBLIC__/images/cc.png" alt="" width="180" height="180">
{{# } else if(item.status== 3) { }}
<img src="__PUBLIC__/images/sa.png" alt="" width="180" height="180">
{{# } else { }}
<img src="__PUBLIC__/images/bb.png" alt="" width="180" height="180">
{{# } }}
</div>
</div>
{{# }); }}
</script>
</body>
</html>
\ No newline at end of file
......@@ -114,7 +114,7 @@
//监听消息推送
Observer.on('switch', function (e) {
IcController.getData(apis.userSetmsg, 'POST', {token: opt.token, type: e.args.type, is_open: e.args.data}, function (res) {
IcController.getData(apis.userSetmsg, 'GET', {token: opt.token, type: e.args.type, is_open: e.args.data}, function (res) {
if (res.errcode == 0) {
......@@ -141,7 +141,7 @@
var params = $.extend({}, data.field, {token: opt.token});
IcController.getData(apis.userAccount, 'POST', params, function (res) {
IcController.getData(apis.userAccount, 'GET', params, function (res) {
if (res.errcode == 0) {
......@@ -203,7 +203,7 @@
};
IcController.getData(apis.regionPcd, 'POST', params, function (res) {
IcController.getData(apis.regionPcd, 'GET', params, function (res) {
if (res.errcode == 0) {
......
!function () {
window.CertificationController = {
isClick: false,
token: Util.getCookie('token') || '',
init: function () {
this.created(this).mounted(this).handleBind(this);
},
created: function (opt) {
var id = Util.getRequest('id');
IcController.getData(apis.authList, 'GET', {token: opt.token}, function (res) {
if (res.errcode === 0) {
//更新认证信息
if (id) {
$(".certisno").show();
layui.form.val("editauth", {
"auth_type": res.data[0].auth_type,
"company_type":res.data[0].company_type,
"company_name": res.data[0].company_name
});
layui.form.render();
} else {
if (res.data.length > 0) {
$(".certis").show();
var getTpl = listHtml.innerHTML;
layui.laytpl(getTpl).render(res.data, function (html) {
$(".certis").empty().html(html);
});
} else {
$(".certisno").show();
}
}
}
});
return this;
},
mounted: function (opt) {
return this;
},
handleBind: function (opt) {
//认证类型
layui.form.on('radio(auth_type)', function (data) {
var getTpl = certtHtml.innerHTML;
layui.laytpl(getTpl).render(data.value, function (html) {
$(".cert_data").empty().html(html);
layui.form.render();
});
});
//新增会员认证信息
layui.form.on('submit(addauth)', function (data) {
$(data.elem).addClass("layui-btn-disabled");
if (!opt.isClick) {
opt.isClick = true;
var params = $.extend({}, data.field, {token: opt.token});
IcController.getData(apis.addAuth, 'GET', params, function (res) {
if (res.errcode === 0) {
} else {
layer.msg(res.errmsg);
opt.isClick = false;
$(data.elem).removeClass("layui-btn-disabled");
}
});
}
});
//更新认证信息
$(document).on('click', '.edit_info', function (e) {
var id = $(this).attr('data-id');
window.location.href = '/cert?id=' + id;
});
return this;
},
}, $(function () {
CertificationController.init();
})
}();
\ No newline at end of file
......@@ -50,6 +50,18 @@
*/
authme: auth_url + '/auth/me',
/***
* 新增会员认证信息
*/
addAuth: user_url + '/user/addauth',
/***
* 更新会员认证信息
*/
editAuth: user_url + '/user/editauth',
/***
* 获取会员认证列表
*/
authList: user_url + '/user/authlist',
/***
* 上传文件的接口
*/
ossupload: goods_url + '/oss/upload',
......
......@@ -56,7 +56,7 @@
IcController.getData(apis.goodsAdd, 'POST', params, function (res) {
if (res.errcode == 0) {
if (res.errcode === 0) {
layer.msg('上传商品成功', {time: 2000}, 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