Authored by 王水玲

Merge branch 'feature/protocol' into 'release/6.8.4'

Feature/protocol

服务协议添加下载按钮,注册协议默认不勾选

See merge request !410
... ... @@ -79,6 +79,7 @@ exports.detail = (req, res, next) => {
res.render('detail', Object.assign({
module: 'help',
page: 'help',
isProtocol: +req.query.contId === 197,
content: Object.assign({
isHelp: true,
pathNav: nav,
... ...
... ... @@ -10,7 +10,7 @@
<div class="help-cont">
{{#cont}}
<h2 class="nav-title">{{caption}}</h2>
<h2 class="nav-title">{{caption}} {{#if @root.isProtocol}}<a class="download-protocol" href="https://cdn.yoho.cn/yohobuy/pdf/YOHO!BUY有货用户服务协议2.pdf">下载</a>{{/if}}</h2>
<div class="cont">{{{content}}}</div>
{{/cont}}
</div>
... ...
... ... @@ -43,7 +43,7 @@
</li>
<li class="items-container clearfix">
<input id="agree-terms" class="agree-terms" type="checkbox" checked="">
<input id="agree-terms" class="agree-terms" type="checkbox">
<span>
我已阅读并同意遵守
<a class="link go-yoho-items" href="{{itemUrl}}" target="_blank">YOHO!BUY 有货服务条款</a>
... ...
... ... @@ -361,27 +361,13 @@ $(window).resize(function() {
exports.init = function(page) {
$('#agree-terms').click(function() {
var $this = $(this),
i,
passI = 0;
var $this = $(this);
if ($this.attr('notchecked')) {
$this.removeAttr('notchecked');
// 勾选
for (i = 0; i < validateResult.length; i++) {
if (validateResult[i].status) {
passI++;
}
}
if (passI === validateResult.length) {
$registerBtn.removeClass('disable').removeAttr('disabled');
}
} else {
// 取消勾选
$registerBtn.addClass('disable').attr('disabled', 'disabled');
$this.attr('notchecked', 'notchecked');
}
});
... ... @@ -416,7 +402,7 @@ exports.init = function(page) {
}
if (statusLen === validateResult.length && !$('#agree-terms').attr('notchecked')) {
if (statusLen === validateResult.length) {
$registerBtn.removeClass('disable').removeAttr('disabled');
} else {
$registerBtn.addClass('disable').attr('disabled', 'disabled');
... ... @@ -528,6 +514,11 @@ exports.init = function(page) {
return;
}
if (!$('#agree-terms').attr('notchecked')) {
alert('您必须同意YOHO!BUY有货服务条款后,才能进行注册!');
return;
}
isRegRequesting = true;
// ajax提交
... ...
... ... @@ -111,6 +111,21 @@
margin: 0 auto;
padding-left: 15px;
box-sizing: border-box;
position: relative;
.download-protocol {
width: 44px;
height: 17px;
line-height: 17px;
text-align: center;
box-sizing: border-box;
border: 1px solid #444;
float: right;
font-size: 12px;
position: absolute;
right: 20px;
top: 7px;
}
}
.menu-common {
... ...