Authored by 王水玲

发票还原

@@ -23,21 +23,6 @@ var $invoice = $('.invoice'), @@ -23,21 +23,6 @@ var $invoice = $('.invoice'),
23 dispatchInfo, 23 dispatchInfo,
24 total; 24 total;
25 25
26 -var orderCont = window.cookie('order-info') && JSON.parse(window.cookie('order-info'));  
27 -var invoiceCont = {  
28 - 7: '服装',  
29 - 1: '图书',  
30 - 9: '配件',  
31 - 11: '日用品',  
32 - 3: '办公用品',  
33 - 6: '体育用品',  
34 - 10: '数码产品'  
35 - },  
36 - invoicesType = {  
37 - 1: '纸质',  
38 - 2: '电子'  
39 - };  
40 -  
41 require('../common'); 26 require('../common');
42 27
43 lazyLoad(); 28 lazyLoad();
@@ -122,19 +107,9 @@ $invoice.on('touchend', '.checkbox', function() { @@ -122,19 +107,9 @@ $invoice.on('touchend', '.checkbox', function() {
122 107
123 if ($this.hasClass('icon-cb-radio')) { 108 if ($this.hasClass('icon-cb-radio')) {
124 $invoice.addClass('focus'); 109 $invoice.addClass('focus');
125 - orderInfo('invoiceText', '');  
126 - orderInfo('invoiceType', '7');  
127 - orderInfo('receiverMobile', $('.user-mobile').val());  
128 - orderInfo('invoicesType', '2');  
129 - orderInfo('invoiceTitle', '个人');  
130 } 110 }
131 if ($this.hasClass('icon-radio')) { 111 if ($this.hasClass('icon-radio')) {
132 $invoice.removeClass('focus'); 112 $invoice.removeClass('focus');
133 - orderInfo('invoiceText', null);  
134 - orderInfo('invoiceType', null);  
135 - orderInfo('receiverMobile', null);  
136 - orderInfo('invoicesType', null);  
137 - orderInfo('invoiceTitle', null);  
138 } 113 }
139 }); 114 });
140 115
@@ -215,16 +190,16 @@ function submitOrder() { @@ -215,16 +190,16 @@ function submitOrder() {
215 return false; 190 return false;
216 } 191 }
217 192
218 - // if (orderInfo('invoice')) {  
219 - // if (!invoiceText) {  
220 - // tip.show('请输入发票抬头');  
221 - // return;  
222 - // }  
223 - // if (invoiceText.length > 30) {  
224 - // tip.show('发票抬头不得超过30个汉字');  
225 - // return;  
226 - // }  
227 - // } 193 + if (orderInfo('invoice')) {
  194 + if (!invoiceText) {
  195 + tip.show('请输入发票抬头');
  196 + return;
  197 + }
  198 + if (invoiceText.length > 30) {
  199 + tip.show('发票抬头不得超过30个汉字');
  200 + return;
  201 + }
  202 + }
228 203
229 if (msg) { 204 if (msg) {
230 if (msg.length > 40) { 205 if (msg.length > 40) {
@@ -400,9 +375,3 @@ if (orderInfo('address') && orderInfo('address').is_support === 'N') { @@ -400,9 +375,3 @@ if (orderInfo('address') && orderInfo('address').is_support === 'N') {
400 orderInfo('deliveryId', $('.delivery-id .icon-cb-radio').data('id')); 375 orderInfo('deliveryId', $('.delivery-id .icon-cb-radio').data('id'));
401 orderCompute(); 376 orderCompute();
402 } 377 }
403 -  
404 -if (orderCont.invoiceType) {  
405 - $('.invoice-type').text(invoiceCont[orderCont.invoiceType] + '(' + invoicesType[orderCont.invoicesType] + ')');  
406 -} else {  
407 - $('.invoice-type').text('服装(电子)');  
408 -}  
@@ -495,12 +495,6 @@ @@ -495,12 +495,6 @@
495 #invoice { 495 #invoice {
496 border-top: 1px solid #f7f7f7; 496 border-top: 1px solid #f7f7f7;
497 497
498 - .invoice-type {  
499 - float: right;  
500 - font-size: 28px;  
501 - color: #444;  
502 - }  
503 -  
504 label { 498 label {
505 display: block; 499 display: block;
506 border-top: 1px solid #f7f7f7; 500 border-top: 1px solid #f7f7f7;
@@ -144,11 +144,7 @@ @@ -144,11 +144,7 @@
144 <input type="hidden" class="user-mobile" value="{{userMobile}}" /> 144 <input type="hidden" class="user-mobile" value="{{userMobile}}" />
145 <span class="title">发票</span> 145 <span class="title">发票</span>
146 <span class="iconfont checkbox {{#if needInvoice}}icon-cb-radio{{else}}icon-radio{{/if}}"></span> 146 <span class="iconfont checkbox {{#if needInvoice}}icon-cb-radio{{else}}icon-radio{{/if}}"></span>
147 - <a id="invoice" class="invoice-info" href="invoiceInfo">  
148 - <span class="title">发票信息</span>  
149 - <span class="invoice-type"><i class="iconfont">&#xe614;</i></span>  
150 - </a>  
151 - <!-- <form id="invoice"> 147 + <form id="invoice">
152 <input type="text" name="invoice-title" value="{{invoiceText}}" maxlength="30" placeholder="发票抬头"> 148 <input type="text" name="invoice-title" value="{{invoiceText}}" maxlength="30" placeholder="发票抬头">
153 <label> 149 <label>
154 发票类型 150 发票类型
@@ -158,7 +154,7 @@ @@ -158,7 +154,7 @@
158 {{/ invoice}} 154 {{/ invoice}}
159 </select> 155 </select>
160 </label> 156 </label>
161 - </form> --> 157 + </form>
162 </li> 158 </li>
163 {{/if}} 159 {{/if}}
164 </ul> 160 </ul>