Authored by hongweigao

默认选中第一条

@@ -23,23 +23,19 @@ @@ -23,23 +23,19 @@
23 {{# express}} 23 {{# express}}
24 <h2>请填写寄回快递单号,以便我们查询</h2> 24 <h2>请填写寄回快递单号,以便我们查询</h2>
25 <div class="courier-code{{#unless id}} in-edit{{/unless}}"> 25 <div class="courier-code{{#unless id}} in-edit{{/unless}}">
26 - {{#with detail}}  
27 <ul style="display: none;"> 26 <ul style="display: none;">
28 {{# expressList}} 27 {{# expressList}}
29 <li class="company-list" data-id="{{id}}" data-name="{{company_name}}"></li> 28 <li class="company-list" data-id="{{id}}" data-name="{{company_name}}"></li>
30 {{/ expressList}} 29 {{/ expressList}}
31 </ul> 30 </ul>
32 - {{/with}}  
33 <p class="express-edit-box"> 31 <p class="express-edit-box">
34 <input type="hidden" id="express-old-id" value="{{id}}"> 32 <input type="hidden" id="express-old-id" value="{{id}}">
35 - {{#with detail}}  
36 <select id="express-company"> 33 <select id="express-company">
37 - <option value="0">选择快递公司</option> 34 + <option value="0" >选择快递公司</option>
38 {{# expressList}} 35 {{# expressList}}
39 <option value="{{id}}" selected="">{{company_name}}</option> 36 <option value="{{id}}" selected="">{{company_name}}</option>
40 {{/ expressList}} 37 {{/ expressList}}
41 </select> 38 </select>
42 - {{/with}}  
43 <input type="text" id="express-number" value="{{number}}" placeholder="请填写快递单号"> 39 <input type="text" id="express-number" value="{{number}}" placeholder="请填写快递单号">
44 <input type="hidden" id="return-id" value="{{returnId}}"> 40 <input type="hidden" id="return-id" value="{{returnId}}">
45 <button type="button" id="submit-btn">确定</button> 41 <button type="button" id="submit-btn">确定</button>
@@ -17,7 +17,7 @@ var $returnState = $('.visual-return-state li'), @@ -17,7 +17,7 @@ var $returnState = $('.visual-return-state li'),
17 $expressViewBox = $('.express-view-box > span'); 17 $expressViewBox = $('.express-view-box > span');
18 18
19 var returnId = $('#return-id').val(), 19 var returnId = $('#return-id').val(),
20 - expId = $('#express-old-id').val(), 20 + expId = $('#express-old-id').val() === '' ? '0' : $('#express-old-id').val(),
21 expNumber = $expressNumber.val(), 21 expNumber = $expressNumber.val(),
22 expCompany = '', 22 expCompany = '',
23 expList = {}, 23 expList = {},