Authored by 梁志锋

我要咨询页面提交功能实现 code review by zhaobiao

... ... @@ -10,9 +10,6 @@ var $ = require('jquery'),
var $consultForm = $('.consult-form'),
$submit = $('#submit'),
$content = $('#content'),
$footer = $('#yoho-footer'),
$navTitle = $('.nav-title'),
navTitle = $navTitle.html(),
productId = $('#product_id').val(),
isSubmiting;
... ... @@ -39,6 +36,7 @@ $content.on('focus', function() {
// 提交表单请求
$consultForm.on('submit', function() {
var content;
if (isSubmiting) {
return false;
}
... ...
... ... @@ -3,7 +3,7 @@
<form class="consult-form" url="{{formUrl}}">
<textarea id="content" name="content">请输入咨询内容</textarea>
<input type="hidden" id="product_id" value="{{productId}}">
<a type="submit">提交</a>
<a type="submit" id="submit">提交</a>
</form>
</div>
{{> layout/footer}}
\ No newline at end of file
... ...
... ... @@ -95,7 +95,7 @@
{{else}}
<div class="nodata">
<span>暂无商品评价和咨询</span>
<a href="/product/detail/consultform" class="go-consult">我要咨询<span class="iconfont">&#xe604;</span></a>
<a href="{{link}}" class="go-consult">我要咨询<span class="iconfont">&#xe604;</span></a>
</div>
{{/if}}
{{/if}}
... ... @@ -130,10 +130,10 @@
</div>
{{/cartInfo}}
{{#if introUrl}}
<input id="introUrl" type="hidden" value={{introUrl}}>
<input id="introUrl" type="hidden" value='{{introUrl}}'>
{{/if}}
{{#if id}}
<input id="productId" type="hidden" value={{id}}>
<input id="productId" type="hidden" value='{{id}}'>
{{/if}}
</div>
... ...
<script>
seajs.use('js/common');
</script>
<script>
seajs.use('js/product/detail/consultform');
</script>
{{!-- 逛(PLUS+STAR) --}}
{{#if psList}}
<script>
... ...
... ... @@ -59,7 +59,7 @@
<span class="iconfont">&#xe63d;</span>暂无咨询
</div>
<div class="consult-content-footer">
<a href="/product/detail/consultform">
<a href="{{link}}">
我要咨询
<span class="iconfont">&#xe604;</span></a>
</div>
... ...