xiaoshushu 3 роки тому
батько
коміт
4f14d985ea

+ 19 - 0
smart-admin/src/main/java/com/huijy/web/controller/api/ApiIndexController.java

@@ -357,6 +357,25 @@ public class ApiIndexController extends ApiAbstractController {
     }
 
     //酒店详情
+    @GetMapping("/shopManage")
+    @ApiOperation("店铺管理")
+    public AjaxResult shopManage(@LoginMember Member member, Long shopId) {
+        AjaxResult result = new AjaxResult();
+        Shop shop = shopService.selectShopByShopId(shopId);
+        if (shop != null) {
+            //商家未处理的预定订单
+            ShopRoomOrder order = new ShopRoomOrder();
+            order.setState(0);
+            order.setMemberId(member.getMemberId());
+            order.setRole("sale");
+            List<ShopRoomOrder> orders = orderService.selectShopRoomOrder(order);
+            result.put("orders", orders);
+        }
+        result.put("shop", shop);
+        return AjaxResult.success(result);
+    }
+
+    //酒店详情
     @GetMapping("/hotelDetail")
     @ApiOperation("酒店详情")
     public AjaxResult hotelDetail(Long shopId) {

+ 1 - 1
smart-ui-app/App.vue

@@ -25,7 +25,7 @@ button::after { border: none }
 /**挂载iconfont图表*/
 @font-face {
 	font-family: 'iconfont';
-	src: url('https://at.alicdn.com/t/font_2816842_tkwqsdidrg.ttf?t=1636688754837') format('truetype'); //在线
+	src: url('https://at.alicdn.com/t/font_2816842_1l3fuakq9oi.ttf?t=1636788436204') format('truetype'); //在线
 	// src: url('~@/static/font/iconfont.ttf') format('truetype'); //本地
 }
 .icon {

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

@@ -1,6 +1,6 @@
-const ip = 'http://127.0.0.1:8080';
+//const ip = 'http://127.0.0.1:8080';
 //const ip = 'https://qfnj.gaswkj.com/prod-api';
-//const ip = 'http://192.168.2.101:8080';
+const ip = 'http://192.168.0.100:8080';
 //const ip = 'https://xdmly.qiyiiot.com/prod-api';
 /**
  * 全部接口(集中管理)
@@ -23,6 +23,7 @@ const urls = {
 	roomAdd: ip + '/api/index/roomAdd', //商家添加,编辑酒店房间
 	hotelList: ip + '/api/index/hotelList', //酒店列表
 	hotelDetail: ip + '/api/index/hotelDetail', //酒店详情
+	shopManage: ip + '/api/index/shopManage', //店铺管理
 	hotelBook: ip + '/api/index/hotelBook', //酒店房间预订
 	order: ip + '/api/index/order', //预订房间订单
 	orderDeal: ip + '/api/index/orderDeal', //商家订单处理

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

@@ -4,20 +4,20 @@
 	},
 	"pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
 		{
-			"path": "pages/shop/hotel/detail",
-			"style": {
-				"navigationBarTitleText": "酒店详情",
-				"enablePullDownRefresh": false
-			}
-
-		},
-		{
 			"path": "pages/index/index2",
 			"style": {
 				"navigationBarTitleText": "",
 				"enablePullDownRefresh": false,
 				"navigationStyle": "custom"
 			}
+		
+		},
+		{
+			"path": "pages/shop/detail",
+			"style": {
+				"navigationBarTitleText": "详情",
+				"enablePullDownRefresh": false
+			}
 
 		},
 		{
@@ -139,14 +139,14 @@
 		, {
 			"path": "pages/shop/hotel/index",
 			"style": {
-				"navigationBarTitleText": "酒店列表",
+				"navigationBarTitleText": "服务预订",
 				"enablePullDownRefresh": false
 			}
 
 		}, {
-			"path": "pages/shop/detail",
+			"path": "pages/shop/manage",
 			"style": {
-				"navigationBarTitleText": "店铺信息",
+				"navigationBarTitleText": "店铺管理",
 				"enablePullDownRefresh": false
 			}
 
@@ -192,10 +192,10 @@
 				"text": "景区"
 			},
 			{
-				"pagePath": "pages/government/index",
-				"iconPath": "static/tab/zd.png",
-				"selectedIconPath": "static/tab/zd_select.png",
-				"text": "党政服务"
+				"pagePath": "pages/shop/hotel/index",
+				"iconPath": "static/tab/fw.png",
+				"selectedIconPath": "static/tab/fw_select.png",
+				"text": "服务预订"
 			},
 			{
 				"pagePath": "pages/user/my",

+ 10 - 9
smart-ui-app/pages/shop/apply.vue

@@ -2,7 +2,6 @@
 	<view>
 		<view class="cn">
 			<u-steps :list="numList" mode="number" :current="item.auditFlag + 1" active-color="#c74547"></u-steps>
-			<view class="btg" v-if="item.auditFlag == 2">{{ item.msg }}</view>
 			<view class="info">
 				<view class="form_group hr">
 					<view class="lable">商铺类型</view>
@@ -21,10 +20,6 @@
 					<view class="dw icon" @click="wz(1)">&#xe64a;</view>
 				</view>
 				<view class="form_group hr">
-					<view class="lable">地图坐标</view>
-					<input type="number" placeholder="请在地图上选择坐标" @click="wz(2)" v-model="zb" :disabled="true" />
-				</view>
-				<view class="form_group hr">
 					<view class="lable">老板名称</view>
 					<input type="text" placeholder="请输入老板名称" v-model="item.bossName" />
 				</view>
@@ -54,7 +49,7 @@
 					></u-upload>
 				</view>
 				<view class="form_group">
-					<view class="lable">商铺展示</view>
+					<view class="lable">图片展示</view>
 					<view class="text">最多上传5张展示图片</view>
 				</view>
 				<view class="pl5">
@@ -90,7 +85,7 @@ export default {
 		return {
 			ip: this.$http.urls.ip,
 			numList: [{ name: '资料填写' }, { name: '资料审核' }, { name: '审核通过' }],
-			item: { showPictures: [],auditFlag: -1,pic:[]},
+			item: { showPictures: [], auditFlag: -1, pic: [] },
 			zb: '', //坐标
 			upload: {
 				header: { apiToken: this.$getUser().apiToken },
@@ -107,8 +102,14 @@ export default {
 			if (this.item.lat) {
 				this.zb = '纬度:' + this.item.lat + ' 经度:' + this.item.lng;
 			}
+			uni.setNavigationBarTitle({
+				title: '店铺信息'
+			});
 			if (this.item.auditFlag == 2) {
 				this.numList[2].name = '审核不通过';
+				uni.setNavigationBarTitle({
+					title: '重新提交审核'
+				});
 			}
 		}
 	},
@@ -166,8 +167,8 @@ export default {
 				return;
 			}
 			this.item.memberId = this.$getUser().memberId;
- 			this.item.showPictures =this.item.showPictures.toString();
-			this.item.pic =this.item.pic.toString();
+			this.item.showPictures = this.item.showPictures.toString();
+			this.item.pic = this.item.pic.toString();
 			this.$http.request({
 				method: 'POST',
 				url: this.item.shopId ? this.$http.urls.updateShop : this.$http.urls.shopApply,

+ 115 - 36
smart-ui-app/pages/shop/detail.vue

@@ -5,38 +5,55 @@
 			<view class="name">{{ item.name }}</view>
 			<view class="address">
 				<view class="dz">{{ item.addres }}</view>
+				<view class="dh" @click="dh()">导航</view>
 			</view>
-			<map
-				style="width: 100%; height: 100px;margin-top: 20px;border-radius:5px;"
-				:latitude="item.lat"
-				:longitude="item.lng"
-				:markers="[{ latitude: item.lat, longitude: item.lng }]"
-			></map>
+			<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 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>
-			<u-grid :col="3" class="cd">
-				<u-grid-item>
-					<view class="icon" style="background-color: red">&#xe610;</view>
-					<view class="grid-text">店铺信息</view>
-				</u-grid-item>
-				<u-grid-item>
-					<view class="icon" style="background-color: red">&#xebb3;</view>
-					<view class="grid-text">上报数据</view>
-				</u-grid-item>
-				<u-grid-item>
-					<view class="icon" style="background-color: red">&#xe736;</view>
-					<view class="grid-text">房间管理</view>
-				</u-grid-item>
-				<u-grid-item>
-					<view class="icon" style="background-color: red">&#xe705;</view>
-					<view class="grid-text">预订订单</view>
-				</u-grid-item>
-			</u-grid>
 		</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>
 
@@ -45,13 +62,18 @@ export default {
 	data() {
 		return {
 			ip: this.$http.urls.ip,
-			item: {}
+			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: 30 },
+			data: { shopId: e.shopId },
 			success: res => {
 				this.item = res.data.data;
 				this.item.imgs = []; //轮播图
@@ -63,22 +85,79 @@ export default {
 		});
 	},
 	methods: {
-		dh() {}
+		//导航
+		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;
-}
-.cd {
-	margin-top: 10px;
-	.icon {
-		font-size: 30px;
-		padding: 5px 8px;
-		background-color: red;
-		color: white;
+	.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>

+ 19 - 59
smart-ui-app/pages/shop/hotel/detail.vue

@@ -1,23 +1,16 @@
 <template>
 	<view class="page">
 		<u-swiper :list="item.imgs" :effect3d="true" :height="300"></u-swiper>
-		<view class="item">
+		<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>
-			<view class="">
-				<map
-					style="width: 100%; height: 100px;margin-top: 20px;border-radius:5px;"
-					:latitude="item.lat"
-					:longitude="item.lng"
-					:markers="[{ latitude: item.lat, longitude: item.lng }]"
-				></map>
-			</view>
+			<map class="map" :latitude="item.lat" :longitude="item.lng" :markers="[{ latitude: item.lat, longitude: item.lng }]"></map>
 		</view>
-		<view class="item">
-			<view class="title">
+		<view class="hotel_item">
+			<view class="v_title">
 				<image src="../../../static/lo.png" class="lo" mode="widthFix"></image>
 				<view class="hd">预订房间</view>
 			</view>
@@ -80,7 +73,7 @@ export default {
 	onLoad(e) {
 		this.$http.request({
 			url: this.$http.urls.hotelDetail,
-			data: { shopId: 30 },
+			data: { shopId: e.shopId },
 			success: res => {
 				this.item = res.data.data;
 				this.item.imgs = []; //轮播图
@@ -144,54 +137,21 @@ export default {
 <style lang="scss">
 .page {
 	padding: 12px;
-	.item {
-		margin-top: 10px;
-		padding: 10px;
+	.map {
+		width: 100%;
+		height: 100px;
+		margin-top: 20px;
 		border-radius: 5px;
-		box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
-		.name {
-			font-size: 20px;
-			font-weight: bold;
-			border-bottom: 1px solid #f2e6e6;
-			padding: 0px 10px 10px 10px;
-		}
-		.address {
-			color: $dar2;
-			padding: 10px;
-			.dz {
-				width: 87%;
-				float: left;
-			}
-			.dh {
-				width: 13%;
-				float: left;
-				color: #03a9f4;
-				text-align: right;
-			}
-		}
-		.title {
-			font-size: 20px;
-			font-weight: bold;
-			color: #333;
-			.lo {
-				width: 150px;
-			}
-			.hd {
-				position: absolute;
-				left: 35px;
-				margin-top: -36px;
-			}
-		}
-		.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;
-			}
+	}
+	.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 {

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

@@ -1,7 +1,7 @@
 <template>
 	<view>
 		<view class="list">
-			<u-divider style="padding-top: 10px;">精选酒店</u-divider>
+			<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">
@@ -45,7 +45,7 @@ export default {
 		},
 		//详情
 		detail(item) {
-			uni.navigateTo({ url: '/pages/shop/hotel/detail?shopId=' + item.shopId});
+			uni.navigateTo({ url: '/pages/shop/hotel/detail?shopId=' + item.shopId });
 		}
 	}
 };
@@ -53,7 +53,7 @@ export default {
 
 <style lang="scss">
 .list {
-	padding: 0px 10px 70px 10px;
+	padding: 10px 10px 70px 10px;
 	.ms {
 		color: $dar2;
 	}

+ 21 - 48
smart-ui-app/pages/shop/hotel/room.vue

@@ -1,13 +1,16 @@
 <template>
 	<view>
 		<view class="list">
-			<view class="item" v-for="(it, index) in list" :key="index" @click="popup(it)">
+			<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="con">
 					<view class="title omit">{{ it.title }}</view>
-					<view class="ms">¥{{ it.price }}/晚</view>
+					<view class="ms">
+						<text class="rmb">¥{{ it.price }}</text>
+						<text>起</text>
+					</view>
 					<view class="ms">共有{{ it.nums }}间</view>
-					<view class="del" @click.stop="del(it)">删除</view>
+					<view class="btn" @click.stop="del(it)">删除</view>
 				</view>
 				<view class="clear"></view>
 			</view>
@@ -72,8 +75,8 @@ export default {
 			}
 		};
 	},
-	onLoad() {
-		this.shopId = 30;
+	onLoad(e) {
+		this.shopId = e.shopId;
 		this.getData();
 	},
 	methods: {
@@ -85,15 +88,15 @@ export default {
 				success: res => {
 					this.list = res.data.data;
 					this.list.forEach(item => {
-						item.pic=item.pic.split(",");
+						item.pic = item.pic.split(',');
 					});
 				}
 			});
 		},
 		popup(item) {
 			if (item) {
-				item=JSON.stringify(item);
-				this.item =JSON.parse(item);
+				item = JSON.stringify(item);
+				this.item = JSON.parse(item);
 				this.popup_title = '编辑房间';
 			} else {
 				this.item = {};
@@ -143,7 +146,7 @@ export default {
 							url: this.$http.urls.roomDel,
 							data: { id: item.id },
 							success: res => {
-								uni.showToast({ title: '添加成功' });
+								uni.showToast({ title: '删除成功' });
 								this.list.splice(this.list.indexOf(item), 1);
 							}
 						});
@@ -158,45 +161,15 @@ export default {
 <style lang="scss">
 .list {
 	padding: 0px 10px 70px 10px;
-	.item {
-		background-color: white;
-		padding: 15px 8px 15px 8px;
-		border-bottom: 1px solid #e5e5e5;
-		border-radius: 5px;
-		margin-top: 10px;
-		box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.2);
-		.lef {
-			float: left;
-			width: 30%;
-			position: relative;
-			overflow: hidden;
-			height: 85px;
-			border-radius: 4px;
-			.pic {
-				width: 100%;
-				height: 85px;
-				background-color: #dcdcdc;
-			}
-		}
-		.con {
-			padding-left: 30px;
-			width: 60%;
-			float: left;
-			.title {
-				font-size: 15px;
-				text-align: left;
-				color: #252525;
-				font-weight: bold;
-			}
-			.ms {
-				margin-top: 5px;
-			}
-			.del {
-				float: right;
-				margin-top: -20px;
-				color: $theme-color;
-				margin-right: -25px;
-			}
+	.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;
 		}
 	}
 }

+ 4 - 12
smart-ui-app/pages/shop/list.vue

@@ -4,7 +4,7 @@
 			<view class="item" v-for="(item, index) in list" :key="index" @click="detail(item)">
 				<view class="lef">
 					<image :src="ip + item.showPictures[0]" mode="aspectFill" class="pic"></image>
-					 <view class="tag">{{ item.shopType == 1 ? '门店' : '酒店' }}</view>
+					<view class="tag">{{ item.shopType == 1 ? '经营门店' : '经营酒店' }}</view>
 				</view>
 				<view class="con">
 					<view class="title omit">{{ item.name }}</view>
@@ -40,13 +40,10 @@ export default {
 		return {
 			ip: this.$http.urls.ip,
 			list: [],
-			param: { pageNum: 1, pageSize: 10, memberId: this.$getUser().memberId}
+			param: { pageNum: 1, pageSize: 10 }
 		};
 	},
 	onLoad() {
-		uni.$on('shop', res => {
-			this.getData();
-		});
 		this.getData();
 	},
 	methods: {
@@ -58,23 +55,18 @@ export default {
 				success: res => {
 					this.list = res.data.data.list;
 					this.list.forEach(item => {
-						item.showPictures =item.showPictures.split(",");
-						item.pic=item.pic.split(",");
+						item.showPictures = item.showPictures.split(',');
 					});
 				}
 			});
 		},
-		//上报数据
-		up(item) {
-			uni.navigateTo({ url: '/pages/shop/up?item=' + JSON.stringify(item) });
-		},
 		//开通店铺
 		go() {
 			uni.navigateTo({ url: '/pages/shop/apply' });
 		},
 		//详情
 		detail(item) {
-			uni.navigateTo({ url: '/pages/shop/detail'});
+			uni.navigateTo({ url: '/pages/shop/manage?shopId=' + item.shopId });
 		}
 	},
 	//下拉刷新

+ 106 - 0
smart-ui-app/pages/shop/manage.vue

@@ -0,0 +1,106 @@
+<template>
+	<view class="page">
+		<view class="btg" v-if="item.auditFlag == 0" style="margin: 0px 0px 12px 0px;background-color: #f0f9eb;color: #67c23a;">后台审核中..... 审核通过后才能展示出来</view>
+		<view class="btg" v-if="item.orders" style="margin: 0px 0px 12px 0px;background-color: #f0f9eb;color: #67c23a;" @click="navigate('/pages/order/sale')">
+			<text>你有{{ item.orders }}条待处理订单,请尽快处理</text>
+			<text class="icon">&#xe62d;</text>
+		</view>
+		<view class="btg" v-if="item.auditFlag == 2" style="margin: 0px 0px 12px 0px;" @click="navigate('/pages/shop/apply?item=' + JSON.stringify(item))">
+			<text>审核不通过: {{ item.msg }}</text>
+			<text class="icon">&#xe62d;</text>
+		</view>
+		<view class="hotel_item">
+			<u-grid :col="3" class="cd">
+				<u-grid-item @click="navigate('/pages/shop/apply?item=' + JSON.stringify(item))">
+					<u-badge :is-dot="true" :offset="[25, 40]" v-if="item.auditFlag == 2"></u-badge>
+					<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)">
+					<view class="icon" style="background-color: #67c23a">&#xec86;</view>
+					<view class="grid-text">店铺预览</view>
+				</u-grid-item>
+				<u-grid-item @click="navigate('/pages/shop/up?item=' + JSON.stringify(item))">
+					<view class="icon" style="background-color: #607D8B">&#xebb3;</view>
+					<view class="grid-text">上报数据</view>
+				</u-grid-item>
+			</u-grid>
+			<view v-if="item.shopType == 2">
+				<u-divider style="padding-top: 10px;">酒店预订</u-divider>
+				<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>
+						<view class="grid-text">房间管理</view>
+					</u-grid-item>
+					<u-grid-item @click="navigate('/pages/order/sale')">
+						<u-badge :count="item.orders" :offset="[20, 30]" v-if="item.auditFlag == 1"></u-badge>
+						<view class="icon" style="background-color: #9E9E9E">&#xe705;</view>
+						<view class="grid-text">预订订单</view>
+					</u-grid-item>
+				</u-grid>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+export default {
+	data() {
+		return {
+			ip: this.$http.urls.ip,
+			item: {},
+			shopId: '' //店铺id
+		};
+	},
+	onLoad(e) {
+		this.shopId = e.shopId;
+		this.getData();
+	},
+	methods: {
+		//获取数据
+		getData() {
+			this.$http.request({
+				url: this.$http.urls.shopManage,
+				data: { shopId: this.shopId },
+				success: res => {
+					this.item = res.data.data.shop;
+					//待处理订单
+					if (res.data.data.orders) {
+						this.item.orders = res.data.data.orders.length;
+					}
+					this.item.imgs = []; //轮播图
+					this.item.showPictures = this.item.showPictures.split(',');
+					this.item.pic = this.item.pic.split(',');
+					this.item.showPictures.forEach(item => {
+						this.item.imgs.push({ image: this.ip + item });
+					});
+				}
+			});
+		},
+		navigate(url) {
+			if (url.indexOf('/apply') == -1 && this.item.auditFlag != 1) {
+				uni.showModal({ content: '审核通过后才能操作', showCancel: false });
+				return;
+			}
+			uni.navigateTo({ url: url });
+		}
+	}
+};
+</script>
+<style lang="scss">
+.page {
+	padding: 12px;
+}
+.cd {
+	margin-top: 10px;
+	text-align: center;
+	.icon {
+		font-size: 30px;
+		padding: 5px 8px;
+		background-color: red;
+		color: white;
+		margin-bottom: 5px;
+		border-radius: 5px;
+	}
+}
+</style>

BIN
smart-ui-app/static/tab/dz.png


BIN
smart-ui-app/static/tab/dz_select.png


BIN
smart-ui-app/static/tab/fw.png


BIN
smart-ui-app/static/tab/fw_select.png


BIN
smart-ui-app/static/tab/jq.png


BIN
smart-ui-app/static/tab/jq_select.png


+ 216 - 0
smart-ui-app/uview-ui/components/u-badge/u-badge.vue

@@ -0,0 +1,216 @@
+<template>
+	<view v-if="show" class="u-badge" :class="[
+			isDot ? 'u-badge-dot' : '', 
+			size == 'mini' ? 'u-badge-mini' : '',
+			type ? 'u-badge--bg--' + type : ''
+		]" :style="[{
+			top: offset[0] + 'rpx',
+			right: offset[1] + 'rpx',
+			fontSize: fontSize + 'rpx',
+			position: absolute ? 'absolute' : 'static',
+			color: color,
+			backgroundColor: bgColor
+		}, boxStyle]"
+	>
+		{{showText}}
+	</view>
+</template>
+
+<script>
+	/**
+	 * badge 角标
+	 * @description 本组件一般用于展示头像的地方,如个人中心,或者评论列表页的用户头像展示等场所。
+	 * @tutorial https://www.uviewui.com/components/badge.html
+	 * @property {String Number} count 展示的数字,大于 overflowCount 时显示为 ${overflowCount}+,为0且show-zero为false时隐藏
+	 * @property {Boolean} is-dot 不展示数字,只有一个小点(默认false)
+	 * @property {Boolean} absolute 组件是否绝对定位,为true时,offset参数才有效(默认true)
+	 * @property {String Number} overflow-count 展示封顶的数字值(默认99)
+	 * @property {String} type 使用预设的背景颜色(默认error)
+	 * @property {Boolean} show-zero 当数值为 0 时,是否展示 Badge(默认false)
+	 * @property {String} size Badge的尺寸,设为mini会得到小一号的Badge(默认default)
+	 * @property {Array} offset 设置badge的位置偏移,格式为 [x, y],也即设置的为top和right的值,单位rpx。absolute为true时有效(默认[20, 20])
+	 * @property {String} color 字体颜色(默认#ffffff)
+	 * @property {String} bgColor 背景颜色,优先级比type高,如设置,type参数会失效
+	 * @property {Boolean} is-center 组件中心点是否和父组件右上角重合,优先级比offset高,如设置,offset参数会失效(默认false)
+	 * @example <u-badge type="error" count="7"></u-badge>
+	 */
+	export default {
+		name: 'u-badge',
+		props: {
+			// primary,warning,success,error,info
+			type: {
+				type: String,
+				default: 'error'
+			},
+			// default, mini
+			size: {
+				type: String,
+				default: 'default'
+			},
+			//是否是圆点
+			isDot: {
+				type: Boolean,
+				default: false
+			},
+			// 显示的数值内容
+			count: {
+				type: [Number, String],
+			},
+			// 展示封顶的数字值
+			overflowCount: {
+				type: Number,
+				default: 99
+			},
+			// 当数值为 0 时,是否展示 Badge
+			showZero: {
+				type: Boolean,
+				default: false
+			},
+			// 位置偏移
+			offset: {
+				type: Array,
+				default: () => {
+					return [20, 20]
+				}
+			},
+			// 是否开启绝对定位,开启了offset才会起作用
+			absolute: {
+				type: Boolean,
+				default: true
+			},
+			// 字体大小
+			fontSize: {
+				type: [String, Number],
+				default: '24'
+			},
+			// 字体演示
+			color: {
+				type: String,
+				default: '#ffffff'
+			},
+			// badge的背景颜色
+			bgColor: {
+				type: String,
+				default: ''
+			},
+			// 是否让badge组件的中心点和父组件右上角重合,配置的话,offset将会失效
+			isCenter: {
+				type: Boolean,
+				default: false
+			}
+		},
+		computed: {
+			// 是否将badge中心与父组件右上角重合
+			boxStyle() {
+				let style = {};
+				if(this.isCenter) {
+					style.top = 0;
+					style.right = 0;
+					// Y轴-50%,意味着badge向上移动了badge自身高度一半,X轴50%,意味着向右移动了自身宽度一半
+					style.transform = "translateY(-50%) translateX(50%)";
+				} else {
+					style.top = this.offset[0] + 'rpx';
+					style.right = this.offset[1] + 'rpx';
+					style.transform = "translateY(0) translateX(0)";
+				}
+				// 如果尺寸为mini,后接上scal()
+				if(this.size == 'mini') {
+					style.transform = style.transform + " scale(0.8)";
+				}
+				return style;
+			},
+			// isDot类型时,不显示文字
+			showText() {
+				if(this.isDot) return '';
+				else {
+					if(this.count > this.overflowCount) return `${this.overflowCount}+`;
+					else return this.count;
+				}
+			},
+			// 是否显示组件
+			show() {
+				// 如果count的值为0,并且showZero设置为false,不显示组件
+				if(this.count == 0 && this.showZero == false) return false;
+				else return true;
+			}
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	@import "../../libs/css/style.components.scss";
+	
+	.u-badge {
+		/* #ifndef APP-NVUE */
+		display: inline-flex;
+		/* #endif */
+		justify-content: center;
+		align-items: center;
+		line-height: 24rpx;
+		padding: 4rpx 8rpx;
+		border-radius: 100rpx;
+		z-index: 9;
+		
+		&--bg--primary {
+			background-color: $u-type-primary;
+		}
+		
+		&--bg--error {
+			background-color: $u-type-error;
+		}
+		
+		&--bg--success {
+			background-color: $u-type-success;
+		}
+		
+		&--bg--info {
+			background-color: $u-type-info;
+		}
+		
+		&--bg--warning {
+			background-color: $u-type-warning;
+		}
+	}
+	
+	.u-badge-dot {
+		height: 16rpx;
+		width: 16rpx;
+		border-radius: 100rpx;
+		line-height: 1;
+	}
+	
+	.u-badge-mini {
+		transform: scale(0.8);
+		transform-origin: center center;
+	}
+	
+	// .u-primary {
+	// 	background: $u-type-primary;
+	// 	color: #fff;
+	// }
+	
+	// .u-error {
+	// 	background: $u-type-error;
+	// 	color: #fff;
+	// }
+	
+	// .u-warning {
+	// 	background: $u-type-warning;
+	// 	color: #fff;
+	// }
+	
+	// .u-success {
+	// 	background: $u-type-success;
+	// 	color: #fff;
+	// }
+	
+	// .u-black {
+	// 	background: #585858;
+	// 	color: #fff;
+	// }
+	
+	.u-info {
+		background-color: $u-type-info;
+		color: #fff;
+	}
+</style>