xiaoshushu 3 年之前
父節點
當前提交
37f318a200

+ 54 - 28
smart-admin/src/main/java/com/huijy/web/controller/api/ApiIndexController.java

@@ -2,6 +2,9 @@ package com.huijy.web.controller.api;
 
 import cn.binarywang.wx.miniapp.bean.WxMaJscode2SessionResult;
 import cn.binarywang.wx.miniapp.bean.WxMaPhoneNumberInfo;
+import cn.hutool.http.HttpUtil;
+import cn.hutool.json.JSONObject;
+import cn.hutool.json.JSONUtil;
 import com.huijy.common.annotation.LoginMember;
 import com.huijy.common.annotation.UnLogin;
 import com.huijy.common.config.RuoYiConfig;
@@ -17,6 +20,7 @@ import com.huijy.management.service.*;
 import com.huijy.management.vo.WxPhoneFrom;
 import com.huijy.system.service.ISysDictDataService;
 import com.huijy.weixin.config.WxMaConfiguration;
+import com.huijy.weixin.config.WxMaProperties;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiImplicitParams;
@@ -67,6 +71,7 @@ public class ApiIndexController extends ApiAbstractController {
     @Autowired
     private IShopRoomOrderService orderService;
 
+    private static WxMaProperties wxMaProperties;
 
     //绑定手机号
     @PostMapping("/bindMobile")
@@ -292,31 +297,6 @@ public class ApiIndexController extends ApiAbstractController {
         return AjaxResult.error("店铺信息不允许更新");
     }
 
-    //更新门店坐标
-    @PostMapping("/updateLatLng")
-    @ApiOperation("更新门店坐标")
-    @ApiImplicitParams({
-            @ApiImplicitParam(name = "shopId", value = "商铺id", required = true, paramType = "body"),
-            @ApiImplicitParam(name = "lat", value = "坐标的lat", paramType = "body"),
-            @ApiImplicitParam(name = "lng", value = "坐标的lng", paramType = "body")
-    })
-    public AjaxResult storeApply(@ApiIgnore @LoginMember Member member, @RequestBody Map params) {
-        String lat = (String) params.get("lat");
-        String lng = (String) params.get("lng");
-        Integer shopId = (Integer) params.get("shopId");
-        if (shopId == null || shopId <= 0) {
-            return AjaxResult.error("店铺id不能为空");
-        }
-        Shop shop = shopService.selectShopByShopId(shopId.longValue());
-        if (shop == null) {
-            return AjaxResult.error("获取店铺信息出错");
-        }
-        shop.setLat(lat);
-        shop.setLng(lng);
-        shopService.updateShop(shop);
-        return AjaxResult.success();
-    }
-
     //门店数据上报
     @PostMapping("/pushRecord")
     @ApiOperation("门店数据上报")
@@ -349,6 +329,7 @@ public class ApiIndexController extends ApiAbstractController {
     }
 
     //酒店列表
+    @UnLogin
     @GetMapping("/hotelList")
     @ApiOperation("酒店列表")
     public AjaxResult hotelList() {
@@ -376,6 +357,7 @@ public class ApiIndexController extends ApiAbstractController {
     }
 
     //酒店详情
+    @UnLogin
     @GetMapping("/hotelDetail")
     @ApiOperation("酒店详情")
     public AjaxResult hotelDetail(Long shopId) {
@@ -387,6 +369,15 @@ public class ApiIndexController extends ApiAbstractController {
         return AjaxResult.success(shop);
     }
 
+    //首页数据
+    @UnLogin
+    @PostMapping("/home")
+    @ApiOperation("首页数据")
+    public AjaxResult home() {
+
+        return AjaxResult.success();
+    }
+
     //酒店预订
     @PostMapping("/hotelBook")
     @ApiOperation("酒店预订")
@@ -407,7 +398,16 @@ public class ApiIndexController extends ApiAbstractController {
     @PostMapping("/orderDeal")
     @ApiOperation("商家订单处理")
     public AjaxResult orderDeal(@RequestBody ShopRoomOrder order) {
-        return AjaxResult.success(orderService.updateShopRoomOrder(order));
+        order.setCreateTime(null);
+        int row = orderService.updateShopRoomOrder(order);
+        //发送小程序订阅消息
+        if (row > 0 && order.getState() == 1) {
+            sendMessage("酒店预订成功通知", order);
+        }
+        if (row > 0 && order.getState() == 2) {
+            sendMessage("酒店预订失败通知", order);
+        }
+        return AjaxResult.success(row);
     }
 
     //商家订单删除
@@ -437,8 +437,7 @@ public class ApiIndexController extends ApiAbstractController {
         return AjaxResult.success(resultObj);
     }
 
-    //
-
+    //根据标记物类型分页获取标记物信息
     @GetMapping("/getPageMarker")
     @ApiOperation("根据标记物类型分页获取标记物信息")
     @ApiImplicitParams({
@@ -503,4 +502,31 @@ public class ApiIndexController extends ApiAbstractController {
 
     }
 
+    //订阅消息
+    private String sendMessage(String type, ShopRoomOrder order) {
+        JSONObject jsonObject = JSONUtil.parseObj(HttpUtil.get("https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=" + WxMaConfiguration.getMaService().getWxMaConfig().getAppid() + "&secret=" + WxMaConfiguration.getMaService().getWxMaConfig().getSecret()));
+        JSONObject body = new JSONObject();
+        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()));
+        }
+        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", "入住的时间段酒店客房已满,无法安排入住"));
+        }
+        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());
+        System.out.println("订单信息:" + order.toString());
+        System.out.println("小程序订阅消息:" + result);
+        return result;
+    }
+
 }

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

@@ -77,7 +77,29 @@ public class ShopRoomOrder extends BaseEntity {
 
     private String shopName;
     private String shopId;
+    private String bossPhone;
     private String role;
+    private String openid;
+
+    public String getOpenid() {
+        return openid;
+    }
+
+    public void setOpenid(String openid) {
+        this.openid = openid;
+    }
+
+    public void setShopName(String shopName) {
+        this.shopName = shopName;
+    }
+
+    public String getBossPhone() {
+        return bossPhone;
+    }
+
+    public void setBossPhone(String bossPhone) {
+        this.bossPhone = bossPhone;
+    }
 
     public String getRole() {
         return role;
@@ -87,6 +109,7 @@ public class ShopRoomOrder extends BaseEntity {
         this.role = role;
     }
 
+
     public String getShopId() {
         return shopId;
     }

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

@@ -18,6 +18,8 @@
         <result property="days" column="days"/>
         <result property="shopId" column="shopId"/>
         <result property="shopName" column="shopName"/>
+        <result property="bossPhone" column="bossPhone"/>
+        <result property="openid" column="openid"/>
         <association property="shopRoom" javaType="ShopRoom" resultMap="ShopRoomResult"/>
     </resultMap>
 
@@ -47,12 +49,14 @@
     </select>
 
     <select id="selectShopRoomOrder" resultMap="ShopRoomOrderResult">
-        SELECT o.*,r.title,r.pic,r.price,s.name AS shopName,s.shop_id AS shopId FROM tb_shop_room_order o
+        SELECT o.*,r.title,r.pic,r.price,s.name AS shopName,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
         <if test="role =='member'">WHERE o.member_id=#{memberId}</if>
         <if test="role =='sale'">WHERE s.member_id=#{memberId}</if>
         <if test="state != null ">AND o.state = #{state}</if>
+        ORDER BY create_time DESC
     </select>
 
     <insert id="insertShopRoomOrder" parameterType="ShopRoomOrder" useGeneratedKeys="true" keyProperty="id">
@@ -68,6 +72,7 @@
             <if test="max != null">max,</if>
             <if test="createTime != null">create_time,</if>
             <if test="days != null">days,</if>
+            <if test="openid != null">openid,</if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="roomId != null">#{roomId},</if>
@@ -80,6 +85,7 @@
             <if test="max != null">#{max},</if>
             <if test="createTime != null">#{createTime},</if>
             <if test="days != null">#{days},</if>
+            <if test="openid != null">#{openid},</if>
         </trim>
     </insert>
 
@@ -96,6 +102,7 @@
             <if test="max != null">max = #{max},</if>
             <if test="createTime != null">create_time = #{createTime},</if>
             <if test="days != null">days = #{days},</if>
+            <if test="openid != null">openid = #{openid},</if>
         </trim>
         where id = #{id}
     </update>

+ 11 - 0
smart-ui-app/common/common.scss

@@ -48,6 +48,9 @@
 		text-align: right;
 	}
 }
+.call{
+	color: #67c23a;
+}
 .r_item {
 	background-color: white;
 	padding: 15px 8px 15px 8px;
@@ -72,6 +75,14 @@
 			color: #252525;
 			font-weight: bold;
 		}
+		.btn {
+			float: right;
+			margin-top: -54px;
+			padding: 5px 25px;
+			border-radius: 20px;
+			background-color: orange;
+			margin-right: -34px;
+		}
 		.ms {
 			margin-top: 5px;
 			color: $dar2;

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

@@ -1,7 +1,7 @@
 //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 = 'https://xdmly.qiyiiot.com/prod-api';
+//const ip = 'http://192.168.0.100:8080';
+const ip = 'https://xdmly.qiyiiot.com/prod-api';
 /**
  * 全部接口(集中管理)
  */

+ 18 - 15
smart-ui-app/pages.json

@@ -13,19 +13,27 @@
 		
 		},
 		{
-			"path": "pages/shop/detail",
+			"path": "pages/shop/list",
 			"style": {
-				"navigationBarTitleText": "详情",
+				"navigationBarTitleText": "我的店铺",
+				"enablePullDownRefresh": true,
+				"backgroundTextStyle": "dark"
+			}
+		
+		},
+		{
+			"path": "pages/shop/manage",
+			"style": {
+				"navigationBarTitleText": "店铺管理",
 				"enablePullDownRefresh": false
 			}
 
 		},
 		{
-			"path": "pages/shop/list",
+			"path": "pages/shop/detail",
 			"style": {
-				"navigationBarTitleText": "我的店铺",
-				"enablePullDownRefresh": true,
-				"backgroundTextStyle": "dark"
+				"navigationBarTitleText": "详情",
+				"enablePullDownRefresh": false
 			}
 
 		},
@@ -123,7 +131,8 @@
 			"path": "pages/government/activity",
 			"style": {
 				"navigationBarTitleText": "热门活动",
-				"enablePullDownRefresh": false
+				"enablePullDownRefresh": true,
+				"backgroundTextStyle": "dark"
 			}
 
 		}, {
@@ -144,13 +153,6 @@
 			}
 
 		}, {
-			"path": "pages/shop/manage",
-			"style": {
-				"navigationBarTitleText": "店铺管理",
-				"enablePullDownRefresh": false
-			}
-
-		}, {
 			"path": "pages/shop/hotel/room",
 			"style": {
 				"navigationBarTitleText": "房间管理",
@@ -161,7 +163,8 @@
 			"path": "pages/order/my",
 			"style": {
 				"navigationBarTitleText": "我的预订",
-				"enablePullDownRefresh": false
+				"enablePullDownRefresh": true,
+				"backgroundTextStyle": "dark"
 			}
 
 		}, {

+ 43 - 9
smart-ui-app/pages/government/activity.vue

@@ -1,13 +1,20 @@
 <template>
 	<view>
 		<view class="list">
-			<view class="t_item" v-for="(item, index) in list" :key="index" @click="detail(item)">
-				<view class="r63">
-					<view class="title">{{ item.title }}</view>
-				</view>
-				<view class="r35 day">{{ item.createTime.substring(0, 11) }}</view>
-				<view class="clear"></view>
-			</view>
+			<u-time-line>
+				<u-time-line-item nodeTop="2" v-for="(item, index) in list" :key="index">
+					<template v-slot:node>
+						<view class="u-node" style="background: #19be6b;"><u-icon name="volume-up" color="#fff" :size="30"></u-icon></view>
+					</template>
+					<template v-slot:content>
+						<view class="content" @click="detail(item)">
+							<view class="title">{{ item.title }}</view>
+							<view class="ck">点击查看活动内容</view>
+							<view class="time">{{ item.createTime }}</view>
+						</view>
+					</template>
+				</u-time-line-item>
+			</u-time-line>
 			<view class="loading"><u-loadmore :status="loadMore ? 'loading' : 'nomore'" /></view>
 		</view>
 	</view>
@@ -33,7 +40,6 @@ export default {
 				data: this.param,
 				loading: 'false',
 				success: res => {
-					console.log(JSON.stringify(res));
 					this.loadMore = res.data.pages > this.param.pageNum ? true : false;
 					res.data.rows.forEach(item => {
 						this.list.push(item);
@@ -72,6 +78,34 @@ export default {
 
 <style lang="scss">
 .list {
-	padding: 0px 10px 70px 10px;
+	padding: 15px 20px 30px 20px;
+	.u-node {
+		width: 44rpx;
+		height: 44rpx;
+		border-radius: 100rpx;
+		display: flex;
+		justify-content: center;
+		align-items: center;
+	}
+	.content {
+		box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
+		padding: 13px;
+		border-radius: 5px;
+	}
+	.title {
+		color: #333333;
+		font-weight: bold;
+		font-size: 17px;
+	}
+	.ck {
+		color: $dar2;
+		font-size: 13px;
+		padding-top: 5px;
+	}
+	.time {
+		font-size: 13px;
+		padding-top: 5px;
+		color: $dar2;
+	}
 }
 </style>

+ 0 - 1
smart-ui-app/pages/government/index.vue

@@ -33,7 +33,6 @@ export default {
 				data: this.param,
 				loading: 'false',
 				success: res => {
-					console.log(JSON.stringify(res));
 					this.loadMore = res.data.pages > this.param.pageNum ? true : false;
 					res.data.rows.forEach(item => {
 						this.list.push(item);

+ 12 - 5
smart-ui-app/pages/index/index2.vue

@@ -26,15 +26,15 @@
 				<view class="icon" style="background-color: #e23e33;">&#xe645;</view>
 				<view class="title">热门活动</view>
 			</view>
-			<view class="f" @click="tab('/pages/government/index')">
+			<view class="f" @click="navigate('/pages/government/index')">
 				<view class="icon" style="background-color: #e23e33;">&#xe695;</view>
 				<view class="title">党政服务</view>
 			</view>
 		</view>
 		<view class="flex" style="margin-top: 10px;">
-			<view class="f a1"><image src="../../static/img11.jpg" style="height: 170px;width: 93%;"></image></view>
+			<view class="f a1"><image @click="tab('/pages/travel/index')" src="../../static/img11.jpg" style="height: 170px;width: 93%;"></image></view>
 			<view class="f a1">
-				<image src="../../static/aa2.jpg" style="height: 80px;width: 100%;"></image>
+				<image @click="tab('/pages/shop/hotel/index')" src="../../static/aa2.jpg" style="height: 80px;width: 100%;"></image>
 				<image src="../../static/aa3.jpg" style="height: 80px;width: 100%;margin-top: 5px;position: relative;">
 					<button class="feedback" open-type="feedback">我要投诉</button>
 				</image>
@@ -44,7 +44,10 @@
 			<view class="title">
 				<image src="../../static/lo.png" class="lo" mode="widthFix"></image>
 				<view class="hd">热门景区</view>
-				<view class="more">更多 <text class="arrow icon">&#xe62d;</text></view>
+				<view class="more" @click="tab('/pages/travel/index')">
+					更多
+					<text class="arrow icon">&#xe62d;</text>
+				</view>
 				<view class="clear"></view>
 			</view>
 			<view class="item">
@@ -60,7 +63,10 @@
 			<view class="title">
 				<image src="../../static/lo.png" class="lo" mode="widthFix"></image>
 				<view class="hd">攻略指南</view>
-				<view class="more">更多 <text class="arrow icon">&#xe62d;</text></view>
+				<view class="more" @click="navigate('/pages/travel/introduction')">
+					更多
+					<text class="arrow icon">&#xe62d;</text>
+				</view>
 				<view class="clear"></view>
 			</view>
 			<view class="item flex">
@@ -153,6 +159,7 @@ export default {
 			});
 		},
 		tab(url) {
+			console.log('zxx');
 			uni.switchTab({
 				url: url
 			});

+ 32 - 30
smart-ui-app/pages/order/my.vue

@@ -3,12 +3,13 @@
 		<u-tabs :list="tab" active-color="#c74547" :is-scroll="false" :current="current" @change="change"></u-tabs>
 		<view class="list">
 			<view class="item" v-for="(item, index) in list" :key="index" @click="detail(item)">
-				<view class="order_title">
+				<view class="order_title" @click.stop="go(item)">
 					<text>{{ item.shopName }}</text>
+					<text class="icon">&#xe62d;</text>
 					<view class="zhu">
-						<text class="theme_bg" v-if="item.state == 0">待受理</text>
-						<text v-if="item.state == 1">已受理</text>
-						<text v-if="item.state == 2">订单</text>
+						<text v-if="item.state == 0" style="color:#67c23a;">待酒店方确认</text>
+						<text v-if="item.state == 1" style="color:#67c23a;">预定确认</text>
+						<text v-if="item.state == 2" style="color:orange;">预定取消</text>
 					</view>
 				</view>
 				<view class="r_item">
@@ -19,29 +20,28 @@
 							<text class="rmb">¥{{ item.shopRoom.price }}</text>
 							<text>起</text>
 						</view>
-						<view class="ms"><view class="icon phone">&#xe619;</view></view>
+						<view class="btn" @click="call(item.bossPhone)" style="margin:-26px -27px 0px 0px">电话</view>
 					</view>
 					<view class="clear"></view>
 				</view>
 				<view class="hj">{{ item.createTime }}</view>
 				<view class="clear"></view>
-				<view class="tk" v-if="item.state == 2">抱歉,由于酒店房间客满的原因,我们无法提供服务。</view>
+				<view class="tk" v-if="item.state == 2">抱歉,入住的时间段酒店客房已满,无法安排入住。</view>
 			</view>
 			<view class="loading"><u-loadmore :status="loadMore ? 'loading' : 'nomore'" /></view>
 		</view>
 		<!--预订订单信息-->
 		<u-popup v-model="popup_show" :mask-close-able="false" mode="center" border-radius="14" width="90%" height="auto" :closeable="true">
 			<view class="u-popup">
-				<view class="tttt" style="font-weight: bolder;">预订房间</view>
-				<u-steps :list="numList" mode="number" :current="0" active-color="#c74547" style="margin: 20px 0px 20px 0px;"></u-steps>
+				<view class="tttt" style="font-weight: bolder;">预订信息</view>
+				<u-steps :list="numList" mode="number" :current="-1" active-color="#c74547" style="margin: 20px 0px 20px 0px;"></u-steps>
 				<view class="form_group hr">
-					<view class="lable">客户姓名</view>
-					<input v-model="book.name" :disabled="true" />
+					<view class="lable">我的姓名</view>
+					<input v-model="book.name" :disabled="true" style="margin-left: -9px;" />
 				</view>
 				<view class="form_group hr">
 					<view class="lable">联系方式</view>
-					<input type="number" v-model="book.phone" :disabled="true" />
-					<text class="call" @click="call()">拨打</text>
+					<input type="number" v-model="book.phone" :disabled="true" style="margin-left: -9px;" />
 				</view>
 				<view class="form_group hr">
 					<view class="lable">入住日期</view>
@@ -49,11 +49,9 @@
 				</view>
 				<view class="form_group">
 					<view class="lable">入住天数</view>
-					<input :value="book.days + '天'" :disabled="true" />
+					<input :value="book.days + '天'" :disabled="true" style="margin-left: -9px;" />
 				</view>
-				<u-divider style="padding-top: 10px;">订单处理</u-divider>
-				<button class="btn" style="background-color: #19BE6B;" @click="op(1)">确认</button>
-				<button class="btn" @click="op(2)">拒绝</button>
+				<button class="btn" @click="op()" v-if="book.state==0">取消预定</button>
 			</view>
 		</u-popup>
 	</view>
@@ -64,8 +62,8 @@ export default {
 	data() {
 		return {
 			ip: this.$http.urls.ip,
-			tab: [{ name: '所有预订', state: '' }, { name: '待受理', state: 0 }, { name: '已完成', state: 1 }],
-			numList: [{ name: '客户资料' }, { name: '订单确认' }, { name: '登记入住' }],
+			tab: [{ name: '所有预订', state: '' }, { name: '待确认', state: 0 }, { name: '已确认', state: 1 }, { name: '已取消', state: 2 }],
+			numList: [{ name: '我的信息' }, { name: '订单确认' }, { name: '登记入住' }],
 			current: 0,
 			list: [],
 			param: { pageNum: 1, state: '', role: 'sale', orderByColumn: 'id', isAsc: 'desc' },
@@ -98,25 +96,32 @@ export default {
 			this.param.state = this.tab[index].state;
 			this.refresh();
 		},
+		go(item) {
+			uni.navigateTo({ url: '/pages/shop/detail?shopId=' + item.shopId });
+		},
 		detail(item) {
 			this.book = item;
 			this.book.day = item.min + ' 至 ' + item.max;
 			this.popup_show = true;
 		},
-		call() {},
-		//处理订单
-		op(index) {
+		//拨打电话
+		call(phoneNumber) {
+			uni.makePhoneCall({
+				phoneNumber: phoneNumber
+			});
+		},
+		//取消预约
+		op() {
 			uni.showModal({
 				title: '提示',
-				content: '是否处理该订单?',
+				content: '是否取消预约?',
 				success: res => {
 					if (res.confirm) {
 						this.$http.request({
-							url: this.$http.urls.orderDeal,
-							data: { id: this.book.id, state: index },
-							method: 'POST',
+							url: this.$http.urls.orderDelete,
+							data: { id: this.book.id},
 							success: res => {
-								uni.showToast({ title: '操作成功' });
+								uni.showToast({ title: '取消成功' });
 								this.popup_show = false;
 								this.refresh();
 							}
@@ -160,7 +165,7 @@ page {
 		background-color: white;
 		padding: 5px 13px 13px 13px;
 		margin-top: 10px;
-		border-radius: 5px;
+		border-radius: 4px;
 		.hj {
 			text-align: right;
 			padding-top: 13px;
@@ -168,7 +173,4 @@ page {
 		}
 	}
 }
-.call {
-	color: #03a9f4;
-}
 </style>

+ 24 - 23
smart-ui-app/pages/order/sale.vue

@@ -3,13 +3,13 @@
 		<u-tabs :list="tab" active-color="#c74547" :is-scroll="false" :current="current" @change="change"></u-tabs>
 		<view class="list">
 			<view class="item" v-for="(item, index) in list" :key="index" @click="detail(item)">
-				<view class="order_title">
+				<view class="order_title" @click.stop="go(item)">
 					<text>{{ item.shopName }}</text>
 					<text class="icon">&#xe62d;</text>
 					<view class="zhu">
-						<text class="theme_bg" v-if="item.state == 0">待受理</text>
-						<text v-if="item.state == 1" style="color:#4CAF50;">已受理</text>
-						<text v-if="item.state == 2" style="color:orange;">订单取消</text>
+						<text v-if="item.state == 0" style="color:#67c23a;">待确认</text>
+						<text v-if="item.state == 1" style="color:#67c23a;">预定确认</text>
+						<text v-if="item.state == 2" style="color:orange;">预定取消</text>
 					</view>
 				</view>
 				<view class="r_item">
@@ -20,21 +20,20 @@
 							<text class="rmb">¥{{ item.shopRoom.price }}</text>
 							<text>起</text>
 						</view>
-						<view class="ms"><view class="icon phone">&#xe619;</view></view>
 					</view>
 					<view class="clear"></view>
 				</view>
 				<view class="hj">{{ item.createTime }}</view>
 				<view class="clear"></view>
-				<view class="tk" v-if="item.state == 2">抱歉,由于酒店房间客满的原因,我们无法提供服务。</view>
+				<view class="tk" v-if="item.state == 2">您取消了该客户的预定。</view>
 			</view>
 			<view class="loading"><u-loadmore :status="loadMore ? 'loading' : 'nomore'" /></view>
 		</view>
 		<!--预订订单信息-->
 		<u-popup v-model="popup_show" :mask-close-able="false" mode="center" border-radius="14" width="90%" height="auto" :closeable="true">
 			<view class="u-popup">
-				<view class="tttt" style="font-weight: bolder;">预订房间</view>
-				<u-steps :list="numList" mode="number" :current="0" active-color="#c74547" style="margin: 20px 0px 20px 0px;"></u-steps>
+				<view class="tttt" style="font-weight: bolder;">预订信息</view>
+				<u-steps :list="numList" mode="number" :current="-1" active-color="#c74547" style="margin: 20px 0px 20px 0px;"></u-steps>
 				<view class="form_group hr">
 					<view class="lable">客户姓名</view>
 					<input v-model="book.name" :disabled="true" style="margin-left: -9px;" />
@@ -42,7 +41,7 @@
 				<view class="form_group hr">
 					<view class="lable">联系方式</view>
 					<input type="number" v-model="book.phone" :disabled="true" />
-					<text class="call" @click="call()">拨打</text>
+					<text class="call" @click="call(book.phone)">拨打</text>
 				</view>
 				<view class="form_group hr">
 					<view class="lable">入住日期</view>
@@ -53,7 +52,7 @@
 					<input :value="book.days + '天'" :disabled="true" style="margin-left: -9px;" />
 				</view>
 				<u-divider style="padding-top: 10px;">订单处理</u-divider>
-				<button class="btn" style="background-color:#607D8B;" @click="op(1)">受理</button>
+				<button class="btn" style="background-color:#67c23a;" @click="op(1)">确认</button>
 				<button class="btn" @click="op(2)">取消</button>
 			</view>
 		</u-popup>
@@ -65,11 +64,11 @@ export default {
 	data() {
 		return {
 			ip: this.$http.urls.ip,
-			tab: [{ name: '所有预订', state: '' }, { name: '待受理', state: 0 }, { name: '已完成', state: 1 }],
+			tab: [{ name: '所有预订', state: '' }, { name: '待确认', state: 0 }, { name: '已确认', state: 1 }, { name: '已取消', state: 2 }],
 			numList: [{ name: '客户资料' }, { name: '订单确认' }, { name: '登记入住' }],
 			current: 0,
 			list: [],
-			param: { pageNum: 1, state: '', role: 'sale', orderByColumn: 'id', isAsc: 'desc' },
+			param: { pageNum: 1, state: '', role: 'sale'},
 			loadMore: true,
 			popup_show: false,
 			book: {}
@@ -99,12 +98,21 @@ export default {
 			this.param.state = this.tab[index].state;
 			this.refresh();
 		},
+		go(item) {
+			uni.navigateTo({ url: '/pages/shop/detail?shopId=' + item.shopId });
+		},
 		detail(item) {
-			this.book = item;
+			this.book =JSON.parse(JSON.stringify(item));
+			delete this.book.createTime;
 			this.book.day = item.min + ' 至 ' + item.max;
 			this.popup_show = true;
 		},
-		call() {},
+		//拨打电话
+		call(phoneNumber) {
+			uni.makePhoneCall({
+				phoneNumber: phoneNumber
+			});
+		},
 		//处理订单
 		op(index) {
 			uni.showModal({
@@ -112,9 +120,10 @@ export default {
 				content: '是否处理该订单?',
 				success: res => {
 					if (res.confirm) {
+						this.book.state=index;
 						this.$http.request({
 							url: this.$http.urls.orderDeal,
-							data: { id: this.book.id, state: index },
+							data:this.book,
 							method: 'POST',
 							success: res => {
 								uni.showToast({ title: '操作成功' });
@@ -169,12 +178,4 @@ page {
 		}
 	}
 }
-.call {
-	color: #03a9f4;
-}
-.del {
-	text-align: center;
-	margin-top: 15px;
-	color: $theme-color;
-}
 </style>

+ 6 - 12
smart-ui-app/pages/shop/apply.vue

@@ -20,12 +20,12 @@
 					<view class="dw icon" @click="wz(1)">&#xe64a;</view>
 				</view>
 				<view class="form_group hr">
-					<view class="lable">老板名称</view>
-					<input type="text" placeholder="请输入老板名称" v-model="item.bossName" />
+					<view class="lable">负责人</view>
+					<input type="text" placeholder="请输入负责人" v-model="item.bossName" />
 				</view>
 				<view class="form_group hr">
-					<view class="lable">老板电话</view>
-					<input type="number" placeholder="请输入老板电话" v-model="item.bossPhone" />
+					<view class="lable">联系电话</view>
+					<input type="number" placeholder="请输入联系电话" v-model="item.bossPhone" />
 				</view>
 				<view class="form_group">
 					<view class="lable">营业执照</view>
@@ -86,7 +86,6 @@ export default {
 			ip: this.$http.urls.ip,
 			numList: [{ name: '资料填写' }, { name: '资料审核' }, { name: '审核通过' }],
 			item: { showPictures: [], auditFlag: -1, pic: [] },
-			zb: '', //坐标
 			upload: {
 				header: { apiToken: this.$getUser().apiToken },
 				name: 'img',
@@ -99,9 +98,6 @@ export default {
 	onLoad(e) {
 		if (e.item) {
 			this.item = JSON.parse(e.item);
-			if (this.item.lat) {
-				this.zb = '纬度:' + this.item.lat + ' 经度:' + this.item.lng;
-			}
 			uni.setNavigationBarTitle({
 				title: '店铺信息'
 			});
@@ -121,7 +117,6 @@ export default {
 					if (index == 1) {
 						this.item.addres = r.address;
 					}
-					this.zb = '纬度:' + r.latitude + ' 经度:' + r.longitude;
 					this.item.lat = r.latitude;
 					this.item.lng = r.longitude;
 					this.$forceUpdate();
@@ -156,9 +151,8 @@ export default {
 			let rule = [
 				{ name: 'name', checkType: 'notnull', errorMsg: '请输入商铺名称' },
 				{ name: 'addres', checkType: 'notnull', errorMsg: '请输入商铺地址' },
-				{ name: 'bossName', checkType: 'notnull', errorMsg: '请输入老板名称' },
-				{ name: 'bossPhone', checkType: 'notnull', errorMsg: '请输入老板电话' },
-				{ name: 'lat', checkType: 'notnull', errorMsg: '请在地图上选择坐标' },
+				{ name: 'bossName', checkType: 'notnull', errorMsg: '请输入负责人' },
+				{ name: 'bossPhone', checkType: 'notnull', errorMsg: '请输入联系电话' },
 				{ name: 'pic', checkType: 'notnull', errorMsg: '请上传营业执照' },
 				{ name: 'showPictures', checkType: 'notnull', errorMsg: '请上传至少1张展示图' }
 			];

+ 30 - 22
smart-ui-app/pages/shop/detail.vue

@@ -9,12 +9,12 @@
 			</view>
 			<map class="map" :latitude="item.lat" :longitude="item.lng" :markers="[{ latitude: item.lat, longitude: item.lng }]"></map>
 		</view>
-		<view class="hotel_item">
+		<view class="hotel_item" v-if="item.shopType == 2">
 			<view class="v_title">
 				<image src="../../static/lo.png" class="lo" mode="widthFix"></image>
 				<view class="hd">预订房间</view>
 			</view>
-			<view class="r_item" v-for="(it, index) in item.rooms" :key="index">
+			<view class="r_item" v-for="(it, index) in item.rooms" :key="index" @click="popup(it)">
 				<image :src="ip + it.pic" mode="aspectFill" class="pic"></image>
 				<view class="con">
 					<view class="title omit">{{ it.title }}</view>
@@ -22,11 +22,15 @@
 						<text class="rmb">¥{{ it.price }}</text>
 						<text>起</text>
 					</view>
-					<view class="ms">还剩13间房</view>
-					<view class="btn" @click="popup(it)">预订</view>
+					<view class="ms">{{it.nums}}间房</view>
+					<view class="btn">预订</view>
 				</view>
 				<view class="clear"></view>
 			</view>
+			<view class="noLogin" v-if="item.rooms.length==0">
+				<image class="u-error-icon" src="../../static/sj.png" mode="widthFix"></image>
+				<view class="dll" style="border: 0px;padding-bottom: 20px;">暂无房间</view>
+			</view>
 		</view>
 		<!--预订房间-->
 		<u-popup v-model="popup_show" :mask-close-able="false" mode="center" border-radius="14" width="90%" height="auto" :closeable="true">
@@ -47,10 +51,11 @@
 				</view>
 				<view class="form_group">
 					<view class="lable">入住日期</view>
-					<input placeholder="请选择入住日期" v-model="book.day" :disabled="true" @click="show = true" />
+					<input placeholder="请选择入住日期" v-model="book.day" :disabled="true" @click="calendar_show = true" />
 					<text class="day" v-if="book.days">{{ book.days }}天</text>
-					<u-calendar v-model="show" mode="range" :start-text="'入住'" :end-text="'退房'" @change="change" max-date="2050" :min-date="min_date"></u-calendar>
+					<u-calendar v-model="calendar_show" mode="range" :start-text="'入住'" :end-text="'退房'" @change="change" max-date="2050" :min-date="min_date"></u-calendar>
 				</view>
+				<view class="tk" style="background-color: #DCDFE6;color: #7d7d7d;">仅作基本的订房操作,实际情况以酒店方为准</view>
 				<button class="btn" @click="add()">确认</button>
 			</view>
 		</u-popup>
@@ -67,7 +72,7 @@ export default {
 			book: {}, //预订房间
 			min_date: this.$util.getDate('day'),
 			popup_show: false,
-			show: false
+			calendar_show: false
 		};
 	},
 	onLoad(e) {
@@ -110,6 +115,7 @@ export default {
 			this.book.roomId = item.id;
 			this.popup_show = true;
 		},
+		//房间预定
 		add() {
 			let rule = [
 				{ name: 'name', checkType: 'notnull', errorMsg: '请输入你的姓名' },
@@ -121,13 +127,23 @@ export default {
 				return;
 			}
 			this.book.memberId = this.$getUser().memberId;
-			this.$http.request({
-				method: 'POST',
-				url: this.$http.urls.hotelBook,
-				data: this.book,
-				success: res => {
-					uni.showToast({ title: '操作成功' });
-					this.popup_show = false;
+			this.book.openid = this.$getUser().openid;
+			//订阅通知
+			uni.requestSubscribeMessage({
+				tmplIds: ['Lh41ftWaZxG8mycje0XQLpylac30ftS4nAXM28iwi8I', 'iEMHyeeuqs-MFa1J4QgT7n0mfnOb-h93oc21b1O3pK8'],
+				complete: c => {
+					this.$http.request({
+						method: 'POST',
+						url: this.$http.urls.hotelBook,
+						data: this.book,
+						success: res => {
+							uni.showToast({ title: '操作成功' });
+							this.popup_show = false;
+							uni.redirectTo({
+								url: '/pages/order/my'
+							});
+						}
+					});
 				}
 			});
 		}
@@ -145,14 +161,6 @@ export default {
 	}
 	.r_item {
 		box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0);
-		.btn {
-			float: right;
-			margin-top: -54px;
-			padding: 5px 25px;
-			border-radius: 20px;
-			background-color: orange;
-			margin-right: -34px;
-		}
 	}
 	.day {
 		position: absolute;

+ 0 - 163
smart-ui-app/pages/shop/hotel/detail.vue

@@ -1,163 +0,0 @@
-<template>
-	<view class="page">
-		<u-swiper :list="item.imgs" :effect3d="true" :height="300"></u-swiper>
-		<view class="hotel_item">
-			<view class="name">{{ item.name }}</view>
-			<view class="address">
-				<view class="dz">{{ item.addres }}</view>
-				<view class="dh" @click="dh()">导航</view>
-			</view>
-			<map class="map" :latitude="item.lat" :longitude="item.lng" :markers="[{ latitude: item.lat, longitude: item.lng }]"></map>
-		</view>
-		<view class="hotel_item">
-			<view class="v_title">
-				<image src="../../../static/lo.png" class="lo" mode="widthFix"></image>
-				<view class="hd">预订房间</view>
-			</view>
-			<view class="r_item" v-for="(it, index) in item.rooms" :key="index">
-				<image :src="ip + it.pic" mode="aspectFill" class="pic"></image>
-				<view class="con">
-					<view class="title omit">{{ it.title }}</view>
-					<view class="ms">
-						<text class="rmb">¥{{ it.price }}</text>
-						<text>起</text>
-					</view>
-					<view class="ms">还剩13间房</view>
-					<view class="btn" @click="popup(it)">预订</view>
-				</view>
-				<view class="clear"></view>
-			</view>
-		</view>
-		<!--预订房间-->
-		<u-popup v-model="popup_show" :mask-close-able="false" mode="center" border-radius="14" width="90%" height="auto" :closeable="true">
-			<view class="u-popup">
-				<view class="tttt" style="font-weight: bolder;">预订房间</view>
-				<u-steps :list="numList" mode="number" :current="0" active-color="#c74547" style="margin: 20px 0px 20px 0px;"></u-steps>
-				<view class="form_group hr">
-					<view class="lable">房型</view>
-					<input :value="book.room + '(¥' + book.price + '起)'" :disabled="true" />
-				</view>
-				<view class="form_group hr">
-					<view class="lable">姓名</view>
-					<input placeholder="请输入姓名" v-model="book.name" />
-				</view>
-				<view class="form_group hr">
-					<view class="lable">手机号</view>
-					<input type="number" placeholder="请输入手机号" v-model="book.phone" />
-				</view>
-				<view class="form_group">
-					<view class="lable">入住日期</view>
-					<input placeholder="请选择入住日期" v-model="book.day" :disabled="true" @click="show = true" />
-					<text class="day" v-if="book.days">{{ book.days }}天</text>
-					<u-calendar v-model="show" mode="range" :start-text="'入住'" :end-text="'退房'" @change="change" max-date="2050" :min-date="min_date"></u-calendar>
-				</view>
-				<button class="btn" @click="add()">确认</button>
-			</view>
-		</u-popup>
-	</view>
-</template>
-
-<script>
-export default {
-	data() {
-		return {
-			ip: this.$http.urls.ip,
-			numList: [{ name: '资料填写' }, { name: '酒店确认' }, { name: '登记入住' }],
-			item: {}, //酒店信息
-			book: {}, //预订房间
-			min_date: this.$util.getDate('day'),
-			popup_show: false,
-			show: false
-		};
-	},
-	onLoad(e) {
-		this.$http.request({
-			url: this.$http.urls.hotelDetail,
-			data: { shopId: e.shopId },
-			success: res => {
-				this.item = res.data.data;
-				this.item.imgs = []; //轮播图
-				this.item.showPictures = this.item.showPictures.split(',');
-				this.item.showPictures.forEach(item => {
-					this.item.imgs.push({ image: this.ip + item });
-				});
-			}
-		});
-	},
-	methods: {
-		//导航
-		dh() {
-			uni.openLocation({
-				latitude: Number(this.item.lat),
-				longitude: Number(this.item.lng),
-				address: this.item.addres,
-				success: res => {},
-				fail: error => {
-					console.log(error);
-				}
-			});
-		},
-		change(e) {
-			this.book.day = e.startMonth + '-' + e.startDay + ' 至 ' + e.endMonth + '-' + e.endDay;
-			this.book.min = e.startDate;
-			this.book.max = e.endDate;
-			this.book.days = this.$util.getDaysBetween(e.startDate, e.endDate);
-		},
-		popup(item) {
-			this.book = {};
-			this.book.room = item.title;
-			this.book.price = item.price;
-			this.book.roomId = item.id;
-			this.popup_show = true;
-		},
-		add() {
-			let rule = [
-				{ name: 'name', checkType: 'notnull', errorMsg: '请输入你的姓名' },
-				{ name: 'phone', checkType: 'notnull', errorMsg: '请输入你的手机号' },
-				{ name: 'day', checkType: 'notnull', errorMsg: '请选择入住日期' }
-			];
-			if (!this.$verify.check(this.book, rule)) {
-				uni.showModal({ content: this.$verify.error, showCancel: false });
-				return;
-			}
-			this.book.memberId = this.$getUser().memberId;
-			this.$http.request({
-				method: 'POST',
-				url: this.$http.urls.hotelBook,
-				data: this.book,
-				success: res => {
-					uni.showToast({ title: '操作成功' });
-					this.popup_show = false;
-				}
-			});
-		}
-	}
-};
-</script>
-<style lang="scss">
-.page {
-	padding: 12px;
-	.map {
-		width: 100%;
-		height: 100px;
-		margin-top: 20px;
-		border-radius: 5px;
-	}
-	.r_item {
-		box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0);
-		.btn {
-			float: right;
-			margin-top: -54px;
-			padding: 5px 25px;
-			border-radius: 20px;
-			background-color: orange;
-			margin-right: -34px;
-		}
-	}
-	.day {
-		position: absolute;
-		color: orange;
-		right: 12px;
-	}
-}
-</style>

+ 22 - 11
smart-ui-app/pages/shop/hotel/index.vue

@@ -1,18 +1,24 @@
 <template>
 	<view>
 		<view class="list">
-			<u-divider style="padding-top: 10px;">住哪儿</u-divider>
-			<view class="r_item" v-for="(item, index) in list" :key="index" @click="detail(item)">
-				<image :src="ip + item.showPictures[0]" mode="aspectFill" class="pic"></image>
-				<view class="con">
-					<view class="title omit">{{ item.name }}</view>
-					<view class="ms omit">{{ item.addres }}</view>
-					<view class="ms">
-						<u-rate :count="5" v-model="value" active-color="#FF9800"></u-rate>
-						(5.0)
+			<u-subsection :list="tab" :current="current" active-color="#FF9800" @change="change" style="margin-bottom: 15px;"></u-subsection>
+			<view v-show="current == 0">
+				<view class="r_item" v-for="(item, index) in list" :key="index" @click="detail(item)">
+					<image :src="ip + item.showPictures[0]" mode="aspectFill" class="pic"></image>
+					<view class="con">
+						<view class="title omit">{{ item.name }}</view>
+						<view class="ms omit">{{ item.addres }}</view>
+						<view class="ms">
+							<u-rate :count="5" v-model="value" active-color="#FF9800" :disabled="true"></u-rate>
+							<text>(5.0)</text>
+						</view>
 					</view>
+					<view class="clear"></view>
 				</view>
-				<view class="clear"></view>
+			</view>
+			<view class="noLogin" v-show="current != 0">
+				<image class="u-error-icon" src="../../../static/sj.png" mode="widthFix"></image>
+				<view class="dll" @click="go()">暂无服务</view>
 			</view>
 		</view>
 	</view>
@@ -23,6 +29,8 @@ export default {
 	data() {
 		return {
 			ip: this.$http.urls.ip,
+			current: 0,
+			tab: [{name: '酒店'},{name: '商铺'},{name: '景区'}],
 			value: 5,
 			list: []
 		};
@@ -43,9 +51,12 @@ export default {
 				}
 			});
 		},
+		change(index) {
+			this.current = index;
+		},
 		//详情
 		detail(item) {
-			uni.navigateTo({ url: '/pages/shop/hotel/detail?shopId=' + item.shopId });
+			uni.navigateTo({ url: '/pages/shop/detail?shopId=' + item.shopId });
 		}
 	}
 };

+ 4 - 2
smart-ui-app/pages/shop/hotel/room.vue

@@ -2,7 +2,7 @@
 	<view>
 		<view class="list">
 			<view class="r_item" v-for="(it, index) in list" :key="index" @click="popup(it)">
-				<view class="lef"><image :src="ip + it.pic" mode="aspectFill" class="pic"></image></view>
+				<view class="lef"><image :src="ip + it.pic[0]" mode="aspectFill" class="pic"></image></view>
 				<view class="con">
 					<view class="title omit">{{ it.title }}</view>
 					<view class="ms">
@@ -36,7 +36,7 @@
 					<input type="number" placeholder="请输入房间数量" v-model="item.nums" />
 				</view>
 				<view class="form_group"><view class="lable">房间图片</view></view>
-				<view class="pl5">
+				<view class="pl5" v-if="popup_show">
 					<u-upload
 						:ip="ip"
 						:action="upload.action"
@@ -86,10 +86,12 @@ export default {
 				url: this.$http.urls.roomList,
 				data: { shopId: this.shopId },
 				success: res => {
+					console.log("zx:"+JSON.stringify(res));
 					this.list = res.data.data;
 					this.list.forEach(item => {
 						item.pic = item.pic.split(',');
 					});
+					this.$forceUpdate();
 				}
 			});
 		},

+ 3 - 0
smart-ui-app/pages/shop/list.vue

@@ -44,6 +44,9 @@ export default {
 		};
 	},
 	onLoad() {
+		uni.$on('shop', res => {
+			this.getData();
+		});
 		this.getData();
 	},
 	methods: {

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

@@ -16,7 +16,7 @@
 					<view class="icon" style="background-color: #F44336">&#xe610;</view>
 					<view class="grid-text">店铺信息</view>
 				</u-grid-item>
-				<u-grid-item @click="navigate('/pages/shop/detail?shopId=' +item.shopId)">
+				<u-grid-item @click="navigate('/pages/shop/detail?shopId=' + item.shopId)">
 					<view class="icon" style="background-color: #67c23a">&#xec86;</view>
 					<view class="grid-text">店铺预览</view>
 				</u-grid-item>
@@ -26,7 +26,7 @@
 				</u-grid-item>
 			</u-grid>
 			<view v-if="item.shopType == 2">
-				<u-divider style="padding-top: 10px;">酒店预订</u-divider>
+				<view style="margin: 20px 0px 20px 0px;"><u-divider>酒店预订</u-divider></view>
 				<u-grid :col="3" class="cd">
 					<u-grid-item @click="navigate('/pages/shop/hotel/room?shopId=' + item.shopId)">
 						<view class="icon" style="background-color: #FF9800">&#xe736;</view>

+ 1 - 1
smart-ui-app/pages/user/my.vue

@@ -15,7 +15,7 @@
 		<view class="sjia" @click="navigate('/pages/shop/list')" v-if="user != ''"><text>商家中心</text></view>
 		<view class="main">
 			<view class="flex menu">
-				<view class="f">
+				<view class="f" @click="navigate('/pages/order/my')">
 					<view class="icon" style="background-color: #607D8B">&#xe636;</view>
 					<view class="title">我的预约</view>
 				</view>

+ 1 - 0
smart-ui-app/uview-ui/components/u-upload/u-upload.vue

@@ -271,6 +271,7 @@ export default {
 		fileList: {
 			immediate: true,
 			handler(val) {
+				console.log("asd:"+typeof val)
 				if(typeof val!='string'){
 					val.map(value => {
 						// 首先检查内部是否已经添加过这张图片,因为外部绑定了一个对象给fileList的话(对象引用),进行修改外部fileList