xiaoshushu vor 3 Jahren
Ursprung
Commit
067ca97318

+ 7 - 9
smart-admin/src/main/java/com/huijy/web/controller/api/ApiIndexController.java

@@ -535,18 +535,16 @@ public class ApiIndexController extends ApiAbstractController {
         body.set("touser", order.getOpenid());
         JSONObject content = new JSONObject();
         if (type.equals("酒店预订成功通知")) {
-            body.set("template_id", "Lh41ftWaZxG8mycje0XQLpylac30ftS4nAXM28iwi8I");
-            content.set("thing4", new JSONObject().set("value", order.getName()));
-            content.set("phone_number5", new JSONObject().set("value", order.getPhone()));
-            content.set("time2", new JSONObject().set("value", order.getMin()));
+            body.set("template_id", "n8RXfziuC2B1UmBThhxNuo45QufO8xd5QepzghBfVJc");
+            content.set("thing1", new JSONObject().set("value", order.getShopName()));
+            content.set("thing4", new JSONObject().set("value", order.getAddres()));
+            content.set("date5", new JSONObject().set("value", order.getMin()));
         }
         if (type.equals("酒店预订失败通知")) {
-            body.set("template_id", "iEMHyeeuqs-MFa1J4QgT7n0mfnOb-h93oc21b1O3pK8");
-            content.set("thing2", new JSONObject().set("value", order.getMin().substring(5, 10) + "至" + order.getMax().substring(5, 10)));
-            content.set("thing3", new JSONObject().set("value", order.getShopRoom().getTitle()));
-            content.set("thing5", new JSONObject().set("value", order.getMsg()));
+            body.set("template_id", "-7bgeC4AoVA-GHLmVCVnPB6Ja_1Tru54qsYnQK4baOE");
+            content.set("thing5", new JSONObject().set("value", "预订" + order.getShopName() + order.getShopRoom().getTitle()));
+            content.set("thing6", new JSONObject().set("value", order.getMsg()));
         }
-        content.set("thing1", new JSONObject().set("value", order.getShopName()));
         body.set("data", content);
         String result = HttpUtil.post("https://api.weixin.qq.com/cgi-bin/message/subscribe/send?access_token=" + jsonObject.getStr("access_token"), body.toString());
         System.out.println("订单信息:" + content.toString());

+ 9 - 0
smart-system/src/main/java/com/huijy/management/domain/ShopRoomOrder.java

@@ -82,11 +82,20 @@ public class ShopRoomOrder extends BaseEntity {
     private String bossPhone;
     private String role;
     private String openid;
+    private String addres;
 
     public String getMsg() {
         return msg;
     }
 
+    public String getAddres() {
+        return addres;
+    }
+
+    public void setAddres(String addres) {
+        this.addres = addres;
+    }
+
     public void setMsg(String msg) {
         this.msg = msg;
     }

+ 2 - 1
smart-system/src/main/resources/mapper/management/ShopRoomOrderMapper.xml

@@ -20,6 +20,7 @@
         <result property="shopId" column="shopId"/>
         <result property="shopName" column="shopName"/>
         <result property="bossPhone" column="bossPhone"/>
+        <result property="addres" column="addres"/>
         <result property="openid" column="openid"/>
         <association property="shopRoom" javaType="ShopRoom" resultMap="ShopRoomResult"/>
     </resultMap>
@@ -50,7 +51,7 @@
     </select>
 
     <select id="selectShopRoomOrder" resultMap="ShopRoomOrderResult">
-        SELECT o.*,r.title,r.pic,r.price,s.name AS shopName,s.shop_id AS shopId,s.boss_phone AS bossPhone FROM
+        SELECT o.*,r.title,r.pic,r.price,s.name AS shopName,s.addres,s.shop_id AS shopId,s.boss_phone AS bossPhone FROM
         tb_shop_room_order o
         LEFT JOIN tb_shop_room r ON r.id=o.room_id
         LEFT JOIN t_shop s ON s.shop_id=r.shop_id

+ 1 - 2
smart-ui-app/common/http.js

@@ -1,6 +1,5 @@
 //const ip = 'http://127.0.0.1:8080';
-//const ip = 'https://qfnj.gaswkj.com/prod-api';
-//const ip = 'http://192.168.0.100:8080';
+//const ip = 'http://192.168.2.102:8080';
 const ip = 'https://xdmly.qiyiiot.com/prod-api';
 /**
  * 全部接口(集中管理)

+ 2 - 2
smart-ui-app/pages/shop/detail.vue

@@ -138,7 +138,7 @@ export default {
 		add() {
 			let rule = [
 				{ name: 'name', checkType: 'notnull', errorMsg: '请输入你的姓名' },
-				{ name: 'phone', checkType: 'notnull', errorMsg: '请输入你的手机号' },
+				{ name: 'phone', checkType: 'phoneno', errorMsg: '请输入正确手机号' },
 				{ name: 'day', checkType: 'notnull', errorMsg: '请选择入住日期' }
 			];
 			if (!this.$verify.check(this.book, rule)) {
@@ -149,7 +149,7 @@ export default {
 			this.book.openid = this.$getUser().openid;
 			//订阅通知
 			uni.requestSubscribeMessage({
-				tmplIds: ['Lh41ftWaZxG8mycje0XQLpylac30ftS4nAXM28iwi8I', 'iEMHyeeuqs-MFa1J4QgT7n0mfnOb-h93oc21b1O3pK8'],
+				tmplIds: ['n8RXfziuC2B1UmBThhxNuo45QufO8xd5QepzghBfVJc', '-7bgeC4AoVA-GHLmVCVnPB6Ja_1Tru54qsYnQK4baOE'],
 				complete: c => {
 					this.$http.request({
 						method: 'POST',