Browse Source

开发票

zhangxinlei1996 5 năm trước cách đây
mục cha
commit
50cb942f2f

+ 8 - 0
src/jfw/front/vipsubscribe.go

@@ -35,6 +35,8 @@ type Subscribepay struct {
 	renewPage    xweb.Mapper `xweb:"/front/vipsubscribe/renewPage/(.*)"` //订阅到期(will:即将到期,exprie:已到期)
 	renewPayPage xweb.Mapper `xweb:"/front/vipsubscribe/renewPayPage"`   //订阅到期续费
 
+	//发票
+	openInvoice xweb.Mapper `xweb:"/front/vipsubscribe/openInvoice/(\\w+)"` //开发票
 }
 
 func init() {
@@ -143,3 +145,9 @@ func (s *Subscribepay) RenewPage(sign string) {
 func (s *Subscribepay) RenewPayPage() {
 	s.Render("/weixin/vipsubscribe/renew_pay.html")
 }
+
+//开发票
+func (s *Subscribepay) OpenInvoice(order_code string) {
+	s.T["order_code"] = order_code
+	s.Render("/weixin/dataExport/dataExport_applyInvoice.html", &s.T)
+}

+ 3 - 2
src/jfw/modules/subscribepay/src/service/order.go

@@ -90,10 +90,11 @@ func (this *Order) GetOrderPayAllMsg() {
 		}
 		query := map[string]interface{}{
 			"user_id":    "5db11594f4e498161c85fcf2",
-			"order_code": "114108076392",
+			"order_code": orderCode,
 			//"order_status": 1,
 		}
-		oData := util.Mysql.FindOne("dataexport_order", query, "prepay_time,pay_time,pay_way,original_price,applybill_status,out_trade_no,filter,product_type,order_status", "")
+		oData := util.Mysql.FindOne("dataexport_order", query, "prepay_time,pay_time,pay_way,original_price,applybill_status,out_trade_no,filter,product_type,order_status,applybill_type,applybill_taxnum,applybill_company", "")
+		log.Println("odata:", oData)
 		//查询订单信息
 		if oData == nil || len(*oData) == 0 {
 			return &orderResult{false, errors.New("未找到此订单"), nil}

+ 2 - 8
src/web/templates/weixin/dataExport/dataExport_applyInvoice.html

@@ -327,13 +327,7 @@
 					}
 				}
 				if (submitBl){
-					$.ajax({
-						type:'post',
-						url:'/front/wxMyOrder/wxApplyInvoice',
-						data:formParam+"&demo-radio="+$(".type").html(),
-						cache:false,
-						dataType:'json', 
-					 	success:function(data){ 
+					$.post('/front/wxMyOrder/wxApplyInvoice',formParam+"&demo-radio="+$(".type").html(),function(data){ 
 										if(data.flag){
 											//window.location.href="/front/wxMyorder/wxPaySuccess/" + {{.T.order_code}}
 											sessionStorage.applysuccess="1";
@@ -354,7 +348,7 @@
 											}, 2000);
 										}
 								}
-					})
+					)
 				}
 			}
             

+ 0 - 10
src/web/templates/weixin/dataExport/dataExport_invoiceSuccess.html

@@ -53,16 +53,6 @@
 			 
 			}
 			
-//			//禁止手机物理返回键
-//			$(document).ready(function() {
-//		  if (window.history && window.history.pushState) {
-//		    $(window).on('popstate', function () {
-//		       window.history.pushState('forward', null, '#');
-//		       window.history.forward(1); });
-//		     }
-//	       window.history.pushState('forward', null, '#'); //在IE中必须得有这两行
-//	       window.history.forward(1);
-//		   });
         </script>
 	{{include "/common/baiducc.html"}}
     </body>

+ 17 - 6
src/web/templates/weixin/vipsubscribe/vip_order_detail.html

@@ -44,10 +44,10 @@
                         <!--  单位发票-->
                         <div class="unit" style="display: none;">
                             <p><span>发票类型:</span><span>普通发票(电子发票)</span></p>
-                            <p><span>发票内容:</span><span>明细</span></p>
+                            <p><span>发票内容</span><span>明细</span></p>
                             <p><span>发票抬头:</span><span>单位</span></p>
-                            <p><span>单位名称:</span><span>某某网络科技有限公司某某网络科技有限公司某某网络科技有限公司某某网络科技有</span></p>
-                            <p><span>纳税人识别号:</span><span>97632813007812341T</span></p>
+                            <p><span>单位名称:</span><span class="company_name"></span></p>
+                            <p><span>纳税人识别号:</span><span class="taxpayer_number"></span></p>
                         </div>
                         <!-- 个人发票 -->
                         <div class="person" style="display: none;">
@@ -230,12 +230,23 @@ if(signature && signature.length == 4){
           //发票
           if(r.data.order.applybill_status==0){ 
             //已支付未申请发票
-            $(".invoice .invoicing").css("display","").on("click",function(){
-            	window.location.replace("/front/vipsubscribe/openInvoice");
+            $(".invoice .invoicing").css("display","");
+            $(".invoicing").on("click",function(){
+            	window.location.href="/front/vipsubscribe/openInvoice/"+orderCode;
             });
           }else{
             //已支付已申请发票
-            alert("铺发票信息")
+			$(".invoice").css("display","none");
+            switch (r.data.order.applybill_type){
+            	case 0:
+            	$(".person").css("display","");
+            	break;
+            	case 1:
+            	$(".unit").css("display","");
+            	$(".company_name").html(r.data.order.applybill_company);
+            	$(".taxpayer_number").html(r.data.order.applybill_taxnum);
+            	break;
+            }
           } 
           
           //有效周期