Browse Source

wip:换开提醒 入口开关

wangshan 1 year ago
parent
commit
e915163d95

+ 2 - 2
src/db.json

@@ -70,9 +70,9 @@
   "mysql": {
     "main": {
       "dbName": "jianyu",
-      "address": "192.168.3.149:3306",
+      "address": "192.168.3.217:4000",
       "userName": "root",
-      "passWord": "Topnet123",
+      "passWord": "=PDT49#80Z!RVv52_z",
       "maxOpenConns": 10,
       "maxIdleConns": 5
     },

+ 3 - 3
src/jfw/modules/app/src/db.json

@@ -46,9 +46,9 @@
     "mysql": {
 	    "main": {
 	        "dbName": "jianyu",
-	        "address": "192.168.3.149:3306",
-	        "userName": "root",
-	        "passWord": "Topnet123",
+        "address": "192.168.3.217:4000",
+        "userName": "root",
+        "passWord": "=PDT49#80Z!RVv52_z",
 			"maxOpenConns": 2,
 			"maxIdleConns": 2
 	    },

+ 49 - 1
src/jfw/modules/app/src/web/templates/invoice/check_invoice.html

@@ -80,8 +80,9 @@
             </div>
             <!-- 开票完成  -->
             <div class="j-button-group" id="change" style="display: none;">
+              <button class="j-button-cancel again_inv" >换开申请</button>
 
-                <button class="j-button-cancel again_inv" onclick="replaceInvoice()">换开申请</button>
+<!--                <button class="j-button-cancel again_inv" onclick="replaceInvoice()">换开申请</button>-->
                 <a id="show_invoice" download class="j-button-confirm checkbtn" >查看发票</a>
             </div>
         </div>
@@ -102,6 +103,18 @@
                 <a href="javascript:;" class="weui-dialog__btn weui-dialog__btn_primary know">我知道了</a>
             </div>
         </div>
+    </div>
+    <!-- 红冲弹窗 -->
+    <div class="js_dialog" id="switchModal" style="display:none;">
+      <div class="weui-mask"></div>
+      <div class="weui-dialog">
+        <div class="dialog_content weui-dialog__bd" style="text-align:justify;font-size: .32rem;line-height: .48rem;">
+          温馨提醒:<br>
+        </div>
+        <div class="weui-dialog__ft">
+          <a href="javascript:;" class="weui-dialog__btn weui-dialog__btn_primary red_know">我知道了</a>
+        </div>
+      </div>
     </div>
 	  <script src="https://cdn-common.jianyu360.com/cdn/lib/jquery/3.6.0/jquery.min.js"></script>
     <script src="{{Cdns .Host "seo" "cdn"|SafeUrl}}/jyapp/local/weui.min.js"></script>
@@ -115,6 +128,8 @@
     		var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Linux') > -1;
         var isOk =false;
         var interval;
+        var redInvoiceSwitch = false;
+        var redInvoiceMsg = "";
         $(function () {
             checkInvoiceStatus(order_code);
             function checkInvoiceStatus(order_code){
@@ -160,8 +175,36 @@
             }
         }
         checkInvoice.init()
+        //红冲
+        var redInvoice = {
+          init:function(){
+            this.redInvoiceFunc();
+            this.hideRedDialog();
+          },
+          redInvoiceFunc:function() {
+            $('.again_inv').on('click',function(){
+              if(!redInvoiceSwitch){
+                $('#switchModal').find('.dialog_content').append(redInvoiceMsg);
+                $('#switchModal').show();
+              }else {
+                window.location.href = "/jyapp/front/invoice/showpage?order_code="+order_code+"&c=1"
+              }
+            })
+          },
+          hideRedDialog:function(){
+            $('.red_know').on('click',function(){
+              $('#switchModal').hide()
+            })
+          }
+        }
+        redInvoice.init()
         function replaceInvoice(){
+          if(!redInvoiceSwitch){
+            $('#switchModal').find('#dialog_content').text(redInvoiceMsg);
+            $('#switchModal').show();
+          }else {
             window.location.href = "/jyapp/front/invoice/showpage?order_code="+order_code+"&c=1"
+          }
         }
         $("#show_invoice").on("click",function () {
             var url = $("#show_invoice").attr("href_");
@@ -214,6 +257,11 @@
                 data:{"order_code":order_code},
                 success:function (r) {
                     console.log("rrrr",r)
+                    //红冲开关
+                    if(r.redSwitchInfo){
+                      redInvoiceSwitch=r.redSwitchInfo.ris;
+                      redInvoiceMsg=r.redSwitchInfo.rim;
+                    }
                     if (r.data !=""){
                         $(".taitou").text(r.data.invoice_type)
                         $("#phone_num").text(r.data.phone);

+ 2 - 2
src/jfw/modules/bigmember/src/db.json

@@ -51,9 +51,9 @@
   "mysql": {
     "main": {
       "dbName": "jianyu",
-      "address": "192.168.3.149:3306",
+      "address" : "192.168.3.217:4000",
       "userName": "root",
-      "passWord": "Topnet123",
+      "passWord": "=PDT49#80Z!RVv52_z",
       "maxOpenConns": 5,
       "maxIdleConns": 5
     },

+ 25 - 15
src/jfw/modules/subscribepay/src/service/invoice.go

@@ -348,42 +348,52 @@ func (this *Invoice) Showinvoice() {
 	data := make(map[string]interface{})
 	data["order_code"] = order_code
 	status := util.Mysql.Find(dbname, data, "", "create_time", 0, 0)
+	//红冲发票开关
+	redSwitchInfo := map[string]interface{}{
+		"ris": config.InvoiceConfig.Red_invoice_switch,
+		"rim": config.InvoiceConfig.Red_invoice_msg,
+	}
 	if len(*status) != 0 {
 		if len(*status) > 1 {
 			if (*status)[1]["url"] != nil && (*status)[1]["url"] != "" {
 				this.ServeJson(map[string]interface{}{
-					"status":  "success",
-					"changed": true,
-					"data":    (*status)[1],
+					"status":        "success",
+					"changed":       true,
+					"data":          (*status)[1],
+					"redSwitchInfo": redSwitchInfo,
 				})
 			} else {
 				this.ServeJson(map[string]interface{}{
-					"status":  "processing",
-					"changed": true,
-					"data":    (*status)[1],
+					"status":        "processing",
+					"changed":       true,
+					"data":          (*status)[1],
+					"redSwitchInfo": redSwitchInfo,
 				})
 			}
 		} else {
 			if (*status)[0]["url"] != nil && (*status)[0]["url"] != "" {
 				this.ServeJson(map[string]interface{}{
-					"status":  "success",
-					"changed": false,
-					"data":    (*status)[0],
+					"status":        "success",
+					"changed":       false,
+					"data":          (*status)[0],
+					"redSwitchInfo": redSwitchInfo,
 				})
 			} else {
 				this.ServeJson(map[string]interface{}{
-					"status":  "processing",
-					"changed": false,
-					"data":    (*status)[0],
+					"status":        "processing",
+					"changed":       false,
+					"data":          (*status)[0],
+					"redSwitchInfo": redSwitchInfo,
 				})
 			}
 		}
 	} else {
 		datas := util.Mysql.FindOne("dataexport_order", data, "order_status,applybill_status,order_code,user_mail,applybill_type,applybill_company,user_phone,applybill_taxnum", "")
 		this.ServeJson(map[string]interface{}{
-			"status": "fail",
-			"data":   "",
-			"datas":  datas,
+			"status":        "fail",
+			"data":          "",
+			"datas":         datas,
+			"redSwitchInfo": redSwitchInfo,
 		})
 	}
 

+ 42 - 0
src/web/staticres/electronic_invoice/css/check_invoice.css

@@ -303,3 +303,45 @@
   color: #fff;
   outline: 0;
 }
+
+#check_invoice #switchModal .modal-header {
+  padding: 32px 15px 24px;
+  border-bottom: 0;
+}
+
+#check_invoice #switchModal .modal-content {
+  max-width: 540px;
+}
+
+#check_invoice #switchModal .modal-title {
+  font-size: 18px;
+  line-height: 24px;
+  color: #1D1D1D;
+  text-align: center;
+}
+
+#check_invoice #switchModal .modal-body {
+  padding: 0 30px;
+}
+
+#check_invoice #switchModal .modal-body .text {
+  font-size: 14px;
+  line-height: 24px;
+  color: #1D1D1D;
+}
+
+#check_invoice #switchModal .modal-footer {
+  border-top: 0;
+  text-align: center;
+  padding: 32px 15px;
+}
+
+#check_invoice #switchModal .modal-footer .btn-default {
+  width: 132px;
+  height: 46px;
+  background: #2CB7CA;
+  border-radius: 6px;
+  border: 0;
+  color: #fff;
+  outline: 0;
+}

+ 27 - 3
src/web/templates/pc/check_invoice.html

@@ -111,6 +111,21 @@
                 </div>
             </div>
         </div>
+        <div class="modal fade" id="switchModal" tabindex="-1" role="dialog" data-backdrop="static" aria-labelledby="myModalLabel" aria-hidden="true">
+          <div class="modal-dialog" style="max-width:400px;">
+            <div class="modal-content">
+              <div class="modal-header">
+                <h4 class="modal-title" style="font-weight: 700;">温馨提醒</h4>
+              </div>
+              <div class="modal-body">
+                <div class="text"></div>
+              </div>
+              <div class="modal-footer">
+                <button type="button" class="btn btn-default" data-dismiss="modal" id="i-know-btn">我知道了</button>
+              </div>
+            </div>
+          </div>
+        </div>
     </div>
     <!-- main END -->
     <!-- footer -->
@@ -135,8 +150,8 @@
 			var changed = false;
 			var interval;
 			var isOk =false;
-      var red_invoice_switch = false;
-      var red_invoice_msg = "";
+      var redInvoiceSwitch = false;
+      var redInvoiceMsg = "";
 			function checkInvoice(order_code) {
 				if (interval) {
 					clearInterval(interval);
@@ -252,7 +267,11 @@
 			}
 
 			$("#again_invoice").on("click",function(){
-				window.location.href = "/front/order/invoice/"+ order_code +"?changed=true";
+        if(!redInvoiceSwitch){
+          $('#switchModal').modal('show').find('.text').text(redInvoiceMsg);
+        }else{
+				  window.location.href = "/front/order/invoice/"+ order_code +"?changed=true";
+        }
 			})
 
 			function viewInvoice(order_code){
@@ -263,6 +282,11 @@
 					}else{
 						$("#l").text("已提交");
 					}
+          //红冲开关
+          if(r.redSwitchInfo){
+            redInvoiceSwitch=r.redSwitchInfo.ris;
+            redInvoiceMsg=r.redSwitchInfo.rim;
+          }
 					if (r.status=="success") {
 						$(".backInvoice").hide();
 						$("#fptt").text(r.data.invoice_type);

+ 50 - 7
src/web/templates/weixin/invoice/check_invoice.html

@@ -81,7 +81,8 @@
             </div>
             <!-- 开票完成  -->
             <div class="j-button-group" id="change" style="display: none;">
-                <button class="j-button-cancel again_inv" onclick=replaceInvoice()>换开申请</button>
+<!--                <button class="j-button-cancel again_inv" onclick=replaceInvoice()>换开申请</button>-->
+                <button class="j-button-cancel again_inv">换开申请</button>
                 <a id="show_invoice" href="" download class="j-button-confirm">查看发票</a>
             </div>
         </div>
@@ -102,6 +103,18 @@
                 <a href="javascript:;" class="weui-dialog__btn weui-dialog__btn_primary know">我知道了</a>
             </div>
         </div>
+    </div>
+    <!-- 红冲弹窗 -->
+    <div class="js_dialog" id="switchModal" style="display:none;">
+      <div class="weui-mask"></div>
+      <div class="weui-dialog">
+        <div class="dialog_content weui-dialog__bd" style="text-align:justify;font-size: .32rem;line-height: .48rem;">
+          温馨提醒:<br>
+        </div>
+        <div class="weui-dialog__ft">
+          <a href="javascript:;" class="weui-dialog__btn weui-dialog__btn_primary red_know">我知道了</a>
+        </div>
+      </div>
     </div>
 	<script src="{{Msg "seo" "cdn"}}/invoice/js/jquery.min.js"></script>
     <script src="{{Msg "seo" "cdn"}}/invoice/js/weui.min.js"></script>
@@ -112,6 +125,8 @@
         var changed = ""
         var isOk =false;
         var interval;
+        var redInvoiceSwitch = false;
+        var redInvoiceMsg = "";
         $(function () {
             checkInvoiceStatus(order_code);
             function checkInvoiceStatus(order_code){
@@ -120,11 +135,7 @@
                 }
                 clicktime()
                 interval = setInterval(clicktime,2000)
-
             }
-
-
-
             if (getParam("cc")=="replaceInv"){
               $(".again_inv").hide();
             }
@@ -157,8 +168,35 @@
             }
         }
         checkInvoice.init()
+        //红冲
+        var redInvoice = {
+          init:function(){
+            this.redInvoiceFunc();
+            this.hideRedDialog();
+          },
+          redInvoiceFunc:function() {
+            $('.again_inv').on('click',function(){
+              if(!redInvoiceSwitch){
+                $('#switchModal').find('.dialog_content').append(redInvoiceMsg);
+                $('#switchModal').show();
+              }else {
+                window.location.href = "/jyapp/front/invoice/showpage?order_code="+order_code+"&c=1"
+              }
+            })
+          },
+          hideRedDialog:function(){
+            $('.red_know').on('click',function(){
+              $('#switchModal').hide()
+            })
+          }
+        }
+        redInvoice.init()
         function replaceInvoice(){
-            window.location.href = "/front/invoice/showpage?order_code="+order_code+"&c=1"
+          if(!redInvoiceSwitch){
+            $('#switchModal').modal('show').find('#dialog_content').text(redInvoiceMsg);
+          }else {
+            window.location.href = "/front/invoice/showpage?order_code=" + order_code + "&c=1"
+          }
         }
 
       /******* 获取url参数(正则)********/
@@ -198,6 +236,11 @@
                 data:{"order_code":order_code},
                 success:function (r) {
                     console.log("rr",r)
+                    //红冲开关
+                    if(r.redSwitchInfo){
+                      redInvoiceSwitch=r.redSwitchInfo.ris;
+                      redInvoiceMsg=r.redSwitchInfo.rim;
+                    }
                     if (r.data !=""){
                         $(".taitou").text(r.data.invoice_type)
                         $("#phone_num").text(r.data.phone);
@@ -264,4 +307,4 @@
         }
     </script>
 </body>
-</html>
+</html>