我要咨询页面提交功能实现 code review by zhaobiao
Showing
5 changed files
with
12 additions
and
8 deletions
@@ -10,9 +10,6 @@ var $ = require('jquery'), | @@ -10,9 +10,6 @@ var $ = require('jquery'), | ||
10 | var $consultForm = $('.consult-form'), | 10 | var $consultForm = $('.consult-form'), |
11 | $submit = $('#submit'), | 11 | $submit = $('#submit'), |
12 | $content = $('#content'), | 12 | $content = $('#content'), |
13 | - $footer = $('#yoho-footer'), | ||
14 | - $navTitle = $('.nav-title'), | ||
15 | - navTitle = $navTitle.html(), | ||
16 | productId = $('#product_id').val(), | 13 | productId = $('#product_id').val(), |
17 | isSubmiting; | 14 | isSubmiting; |
18 | 15 | ||
@@ -39,6 +36,7 @@ $content.on('focus', function() { | @@ -39,6 +36,7 @@ $content.on('focus', function() { | ||
39 | // 提交表单请求 | 36 | // 提交表单请求 |
40 | $consultForm.on('submit', function() { | 37 | $consultForm.on('submit', function() { |
41 | var content; | 38 | var content; |
39 | + | ||
42 | if (isSubmiting) { | 40 | if (isSubmiting) { |
43 | return false; | 41 | return false; |
44 | } | 42 | } |
@@ -3,7 +3,7 @@ | @@ -3,7 +3,7 @@ | ||
3 | <form class="consult-form" url="{{formUrl}}"> | 3 | <form class="consult-form" url="{{formUrl}}"> |
4 | <textarea id="content" name="content">请输入咨询内容</textarea> | 4 | <textarea id="content" name="content">请输入咨询内容</textarea> |
5 | <input type="hidden" id="product_id" value="{{productId}}"> | 5 | <input type="hidden" id="product_id" value="{{productId}}"> |
6 | - <a type="submit">提交</a> | 6 | + <a type="submit" id="submit">提交</a> |
7 | </form> | 7 | </form> |
8 | </div> | 8 | </div> |
9 | {{> layout/footer}} | 9 | {{> layout/footer}} |
@@ -95,7 +95,7 @@ | @@ -95,7 +95,7 @@ | ||
95 | {{else}} | 95 | {{else}} |
96 | <div class="nodata"> | 96 | <div class="nodata"> |
97 | <span>暂无商品评价和咨询</span> | 97 | <span>暂无商品评价和咨询</span> |
98 | - <a href="/product/detail/consultform" class="go-consult">我要咨询<span class="iconfont"></span></a> | 98 | + <a href="{{link}}" class="go-consult">我要咨询<span class="iconfont"></span></a> |
99 | </div> | 99 | </div> |
100 | {{/if}} | 100 | {{/if}} |
101 | {{/if}} | 101 | {{/if}} |
@@ -130,10 +130,10 @@ | @@ -130,10 +130,10 @@ | ||
130 | </div> | 130 | </div> |
131 | {{/cartInfo}} | 131 | {{/cartInfo}} |
132 | {{#if introUrl}} | 132 | {{#if introUrl}} |
133 | - <input id="introUrl" type="hidden" value={{introUrl}}> | 133 | + <input id="introUrl" type="hidden" value='{{introUrl}}'> |
134 | {{/if}} | 134 | {{/if}} |
135 | {{#if id}} | 135 | {{#if id}} |
136 | - <input id="productId" type="hidden" value={{id}}> | 136 | + <input id="productId" type="hidden" value='{{id}}'> |
137 | {{/if}} | 137 | {{/if}} |
138 | 138 | ||
139 | </div> | 139 | </div> |
@@ -59,7 +59,7 @@ | @@ -59,7 +59,7 @@ | ||
59 | <span class="iconfont"></span>暂无咨询 | 59 | <span class="iconfont"></span>暂无咨询 |
60 | </div> | 60 | </div> |
61 | <div class="consult-content-footer"> | 61 | <div class="consult-content-footer"> |
62 | - <a href="/product/detail/consultform"> | 62 | + <a href="{{link}}"> |
63 | 我要咨询 | 63 | 我要咨询 |
64 | <span class="iconfont"></span></a> | 64 | <span class="iconfont"></span></a> |
65 | </div> | 65 | </div> |
-
Please register or login to post a comment