Browse Source

小程序更新

xiaoshushu 3 năm trước cách đây
mục cha
commit
c56b98a361

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

@@ -23,6 +23,7 @@ import io.swagger.annotations.ApiImplicitParams;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiOperation;
 import me.chanjar.weixin.common.error.WxErrorException;
 import me.chanjar.weixin.common.error.WxErrorException;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.multipart.MultipartHttpServletRequest;
 import org.springframework.web.multipart.MultipartHttpServletRequest;
 import springfox.documentation.annotations.ApiIgnore;
 import springfox.documentation.annotations.ApiIgnore;
@@ -310,10 +311,12 @@ public class ApiIndexController extends ApiAbstractController {
 
 
     @PostMapping("/pushRecord")
     @PostMapping("/pushRecord")
     @ApiOperation("门店数据上报")
     @ApiOperation("门店数据上报")
+    @Transactional
     public AjaxResult storeApply(@ApiIgnore @LoginMember Member member, @RequestBody ShopSalesRecord shopSalesRecord) {
     public AjaxResult storeApply(@ApiIgnore @LoginMember Member member, @RequestBody ShopSalesRecord shopSalesRecord) {
         if (shopSalesRecord == null) {
         if (shopSalesRecord == null) {
             AjaxResult.error("上传数据为空");
             AjaxResult.error("上传数据为空");
         }
         }
+        System.out.println("asdasd:"+shopSalesRecord.getShopGuestRecordList());
         shopSalesRecordService.insertShopSalesRecord(shopSalesRecord);
         shopSalesRecordService.insertShopSalesRecord(shopSalesRecord);
         return AjaxResult.success();
         return AjaxResult.success();
     }
     }

+ 1 - 0
smart-system/src/main/java/com/huijy/management/service/impl/ShopSalesRecordServiceImpl.java

@@ -22,6 +22,7 @@ public class ShopSalesRecordServiceImpl implements IShopSalesRecordService
     @Autowired
     @Autowired
     private ShopSalesRecordMapper shopSalesRecordMapper;
     private ShopSalesRecordMapper shopSalesRecordMapper;
 
 
+    @Autowired
     private IShopGuestRecordService shopGuestRecordService;
     private IShopGuestRecordService shopGuestRecordService;
 
 
     /**
     /**

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

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

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

@@ -4,20 +4,6 @@
 	},
 	},
 	"pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
 	"pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
 		{
 		{
-			"path": "pages/index/index",
-			"style": {
-				"navigationBarTitleText": "",
-				"navigationStyle": "custom"
-			}
-		},
-		{
-			"path": "pages/user/my",
-			"style": {
-				"navigationBarTitleText": "我的",
-				"navigationStyle": "custom"
-			}
-		},
-		{
 			"path": "pages/shop/list",
 			"path": "pages/shop/list",
 			"style": {
 			"style": {
 				"navigationBarTitleText": "我的店铺",
 				"navigationBarTitleText": "我的店铺",
@@ -35,6 +21,20 @@
 		
 		
 		},
 		},
 		{
 		{
+			"path": "pages/index/index",
+			"style": {
+				"navigationBarTitleText": "",
+				"navigationStyle": "custom"
+			}
+		},
+		{
+			"path": "pages/user/my",
+			"style": {
+				"navigationBarTitleText": "我的",
+				"navigationStyle": "custom"
+			}
+		},
+		{
 			"path": "pages/shop/apply",
 			"path": "pages/shop/apply",
 			"style": {
 			"style": {
 				"navigationBarTitleText": "店铺开通申请",
 				"navigationBarTitleText": "店铺开通申请",

+ 24 - 5
smart-ui-app/pages/shop/list.vue

@@ -2,7 +2,10 @@
 	<view>
 	<view>
 		<view class="list">
 		<view class="list">
 			<view class="item" v-for="(item, index) in list" :key="index" @click="detail(item)">
 			<view class="item" v-for="(item, index) in list" :key="index" @click="detail(item)">
-				<image :src="ip + item.showPictures[0].url" mode="aspectFill" class="pic"></image>
+				<view class="lef">
+					<image :src="ip + item.showPictures[0].url" mode="aspectFill" class="pic"></image>
+					<view class="tag">{{ item.shopType == 1 ? '门店' : '酒店' }}</view>
+				</view>
 				<view class="con">
 				<view class="con">
 					<view class="title omit">{{ item.name }}</view>
 					<view class="title omit">{{ item.name }}</view>
 					<view class="ms">
 					<view class="ms">
@@ -93,12 +96,28 @@ export default {
 		border-radius: 5px;
 		border-radius: 5px;
 		margin-top: 10px;
 		margin-top: 10px;
 		box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.2);
 		box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.2);
-		.pic {
+		.lef {
 			float: left;
 			float: left;
 			width: 30%;
 			width: 30%;
-			border-radius: 3px;
-			height: 80px;
-			background-color: #dcdcdc;
+			position: relative;
+			overflow: hidden;
+			.pic {
+				width: 100%;
+				border-radius: 3px;
+				height: 80px;
+				background-color: #dcdcdc;
+				overflow: hidden;
+			}
+			.tag {
+				position: absolute;
+				bottom: 0px;
+				width: 100%;
+				text-align: center;
+				background-color: red;
+				height: 20px;
+				opacity: 0.6;
+				color: white;
+			}
 		}
 		}
 		.con {
 		.con {
 			padding-left: 30px;
 			padding-left: 30px;

+ 121 - 15
smart-ui-app/pages/shop/up.vue

@@ -3,7 +3,8 @@
 		<view class="mtop"><text class="icon">&#xe617;</text></view>
 		<view class="mtop"><text class="icon">&#xe617;</text></view>
 		<view class="time">上次上报:{{ time }}</view>
 		<view class="time">上次上报:{{ time }}</view>
 		<view class="cn">
 		<view class="cn">
-			<view class="info">
+			<!--上传门店数据-->
+			<view class="info" v-if="item.shopType == 1">
 				<view class="form_group hr">
 				<view class="form_group hr">
 					<view class="lable">散客预约人数</view>
 					<view class="lable">散客预约人数</view>
 					<input type="number" placeholder="请输入散客预约人数" v-model="item.scatteredAppointment" />
 					<input type="number" placeholder="请输入散客预约人数" v-model="item.scatteredAppointment" />
@@ -26,22 +27,66 @@
 				</view>
 				</view>
 				<view class="form_group hr">
 				<view class="form_group hr">
 					<view class="lable">销售时间</view>
 					<view class="lable">销售时间</view>
-					<input type="text" placeholder="请选择销售时间" :disabled="true" v-model="item.salesTime" @click="show = true" />
-					<u-calendar v-model="show" @change="change"></u-calendar>
+					<input type="text" placeholder="请选择销售时间" :disabled="true" v-model="item.salesTime" @click="calendar_show = true" />
 				</view>
 				</view>
 			</view>
 			</view>
+			<!--上传酒店数据-->
+			<view v-else>
+				<view class="info">
+					<view class="item" v-for="(it, index) in item.shopGuestRecordList" :key="index">
+						<text>{{ it.guestName }}</text>
+						<text class="icon del" @click="del(it)">&#xe600;</text>
+					</view>
+				</view>
+				<view class="mt10">
+					<u-divider v-if="item.shopGuestRecordList.length > 0">共添加{{ item.shopGuestRecordList.length }}个游客</u-divider>
+				</view>
+			</view>
+			<button class="btn add" @click="popup" v-if="item.shopType == 2">添加游客</button>
 			<button class="btn" @click="up()">上报数据</button>
 			<button class="btn" @click="up()">上报数据</button>
 		</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>
+				<view class="form_group hr">
+					<view class="lable">游客姓名</view>
+					<input placeholder="请输入散客预约人数" v-model="guest.guestName" />
+				</view>
+				<view class="form_group hr">
+					<view class="lable">身份证号</view>
+					<input placeholder="请输入散客预约人数" v-model="guest.idCard" />
+				</view>
+				<view class="form_group hr">
+					<view class="lable">手机号码</view>
+					<input type="number" placeholder="请输入散客预约人数" v-model="guest.phone" />
+				</view>
+				<view class="form_group hr">
+					<view class="lable">入住日期</view>
+					<input :disabled="true" placeholder="请选择入住日期" @click="calendar_show = true" v-model="guest.checkInTime" />
+				</view>
+				<view class="form_group hr">
+					<view class="lable">游客类型</view>
+					<input :disabled="true" @click="guest_show = true" placeholder="请选择游客类型" v-model="guest.guestType" />
+				</view>
+				<button class="btn" @click="add()">保存并继续</button>
+			</view>
+		</u-popup>
+		<u-calendar v-model="calendar_show" @change="calendar"></u-calendar>
+		<u-select v-model="guest_show" :list="[{ label: '散客', value: '散客' }, { label: '团客', value: '团客' }]" @confirm="confirm"></u-select>
 	</view>
 	</view>
 </template>
 </template>
-
 <script>
 <script>
 export default {
 export default {
 	data() {
 	data() {
 		return {
 		return {
-			item: { shopType: 1 },
+			item: { shopType: 2, shopGuestRecordList: [] },
+			guest: { guestType: '散客', checkInTime: this.$util.getDate() }, //游客
+			guest_list: [],
 			time: '未上报过',
 			time: '未上报过',
-			show: false
+			popup_show: false,
+			calendar_show: false,
+			guest_show: false
 		};
 		};
 	},
 	},
 	onLoad(e) {
 	onLoad(e) {
@@ -55,6 +100,7 @@ export default {
 				});
 				});
 			}
 			}
 			if (this.item.shopType == 2) {
 			if (this.item.shopType == 2) {
+				this.item.shopGuestRecordList = [];
 				this.$nextTick(() => {
 				this.$nextTick(() => {
 					uni.setNavigationBarTitle({
 					uni.setNavigationBarTitle({
 						title: '酒店数据上报'
 						title: '酒店数据上报'
@@ -68,22 +114,57 @@ export default {
 		}
 		}
 	},
 	},
 	methods: {
 	methods: {
-		change(e) {
+		calendar(e) {
 			this.item.salesTime = e.result;
 			this.item.salesTime = e.result;
+			this.guest.checkInTime = e.result;
 		},
 		},
-		up() {
+		popup() {
+			this.guest = { guestName: '', idCard: '', phone: '', guestType: this.guest.guestType, checkInTime: this.guest.checkInTime };
+			this.popup_show = true;
+		},
+		//选择游客类型
+		confirm(e) {
+			this.guest.guestType = e[0].value;
+		},
+		add() {
 			let rule = [
 			let rule = [
-				{ name: 'scatteredAppointment', checkType: 'notnull', errorMsg: '请输入散客预约人数' },
-				{ name: 'scatteredReception', checkType: 'notnull', errorMsg: '请输入散客接待人数' },
-				{ name: 'groupAppointment', checkType: 'notnull', errorMsg: '请输入团客预约人数' },
-				{ name: 'groupReception', checkType: 'notnull', errorMsg: '请输入团客接待人数' },
-				{ name: 'salesAmount', checkType: 'notnull', errorMsg: '请输入销售金额' },
-				{ name: 'salesTime', checkType: 'notnull', errorMsg: '请选择销售时间' }
+				{ name: 'guestName', checkType: 'notnull', errorMsg: '请输入游客姓名' },
+				{ name: 'idCard', checkType: 'notnull', errorMsg: '请输入游客身份证号' },
+				{ name: 'checkInTime', checkType: 'notnull', errorMsg: '请选择游客入住日期' }
 			];
 			];
-			if (!this.$verify.check(this.item, rule)) {
+			if (!this.$verify.check(this.guest, rule)) {
 				uni.showModal({ content: this.$verify.error, showCancel: false });
 				uni.showModal({ content: this.$verify.error, showCancel: false });
 				return;
 				return;
 			}
 			}
+			this.item.shopGuestRecordList.push(JSON.parse(JSON.stringify(this.guest)));
+			uni.showToast({ title: '保存成功' });
+			this.guest = { guestName: '', idCard: '', phone: '', guestType: this.guest.guestType, checkInTime: this.guest.checkInTime };
+			this.$forceUpdate();
+		},
+		del(item) {
+			this.item.shopGuestRecordList.splice(this.item.shopGuestRecordList.indexOf(item), 1);
+			this.$forceUpdate();
+		},
+		up() {
+			if (this.item.shopType == 1) {
+				let rule = [
+					{ name: 'scatteredAppointment', checkType: 'notnull', errorMsg: '请输入散客预约人数' },
+					{ name: 'scatteredReception', checkType: 'notnull', errorMsg: '请输入散客接待人数' },
+					{ name: 'groupAppointment', checkType: 'notnull', errorMsg: '请输入团客预约人数' },
+					{ name: 'groupReception', checkType: 'notnull', errorMsg: '请输入团客接待人数' },
+					{ name: 'salesAmount', checkType: 'notnull', errorMsg: '请输入销售金额' },
+					{ name: 'salesTime', checkType: 'notnull', errorMsg: '请选择销售时间' }
+				];
+				if (!this.$verify.check(this.item, rule)) {
+					uni.showModal({ content: this.$verify.error, showCancel: false });
+					return;
+				}
+			} else {
+				if (this.item.shopGuestRecordList == 0) {
+					uni.showModal({ content: '请先添加游客再上传数据', showCancel: false });
+					return;
+				}
+			}
 			this.$http.request({
 			this.$http.request({
 				method: 'POST',
 				method: 'POST',
 				url: this.$http.urls.pushRecord,
 				url: this.$http.urls.pushRecord,
@@ -123,9 +204,34 @@ export default {
 		border-radius: 5px;
 		border-radius: 5px;
 		margin-top: 10px;
 		margin-top: 10px;
 		box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
 		box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
+		.item {
+			padding: 12px;
+			border-bottom: 1px solid #f0f0f0;
+			.del {
+				float: right;
+				color: $theme-color;
+				font-size: 21px;
+			}
+		}
+	}
+	.add {
+		background-color: #2979ff;
+		border: 1px solid #2979ff;
 	}
 	}
 	.btn {
 	.btn {
 		margin-top: 25px;
 		margin-top: 25px;
 	}
 	}
 }
 }
+.u-popup {
+	padding: 20px;
+	.tttt {
+		font-weight: bold;
+		font-size: 18px;
+		margin-bottom: 10px;
+	}
+	.inp {
+		text-align: right !important;
+		padding-right: 5px !important;
+	}
+}
 </style>
 </style>