Browse Source

Merge branch 'master' of http://git.zthymaoyi.com/zyw/tourism

# Conflicts:
#	uni_applet/pages/food/food.vue
高敬炎 1 năm trước cách đây
mục cha
commit
3d883ca7e6

+ 1 - 1
uni_applet/App.vue

@@ -50,7 +50,7 @@
 		background-color: #F2F6F9;
 	}
 	.content{
-		padding-bottom:150rpx;
+		// padding-bottom:0rpx;
 	}
 	.wrap{
 		background:#fff;

+ 9 - 0
uni_applet/pageA/find/createLifeService.vue

@@ -128,6 +128,15 @@
 		},
 		methods: {
 			submit(){
+				uni.showModal({
+					title:'123',
+					success: () => {
+							console.log(123)
+					}
+				})
+				
+				
+				
 				if(this.form.mainBody=='商铺'){
 					this.content='确定提交店铺信息'
 				}else{

+ 205 - 0
uni_applet/pageA/food/detailMap.vue

@@ -0,0 +1,205 @@
+<template>
+	<view>
+		<map style="width: 100%; height: 100vh;" :show-location='true' ref="map" id="map" :latitude="latitude"
+			:longitude="longitude" :markers="marker" :scale="scale" :polyline="polyline" @callouttap='toDL(dataObj)'>
+			<cover-view slot="callout">
+				<block v-for="(item,index) in marker" :key="index">
+					<cover-view class="customCallout" :marker-id="item.id">
+						<cover-view class="content row1" style="margin-top: 0;">
+							{{dataObj.shopNames}}
+						</cover-view>
+						<cover-view class="content row2">
+							距离{{(info.distance/1000).toFixed(1)}}公里
+						</cover-view>
+						<cover-view class="content row3">
+							驾车约{{(info.duration/60).toFixed(0)}}分钟
+						</cover-view>
+						<cover-view class="dh" >
+							导航
+						</cover-view>
+					</cover-view>
+				</block>
+			</cover-view>
+
+			<!-- <view class="to-here">
+				<image src="../../static/image/to.png" mode="widthFix" style="width: 36rpx;">
+				</image>
+			</view> -->
+		</map>
+	</view>
+</template>
+
+<script>
+	var that;
+	var GDMapWX = require('@/js_sdk/js-amap/amap-wx.130.js');
+	import {
+		authorizedLocation
+	} from '@/util/util.js'
+	export default {
+		data() {
+			return {
+				polyline: [],
+				dataObj: {},
+				latitude: '', //纬度
+				longitude: '', //经度
+				marker: [],
+				scale: 14, //缩放级别
+				info: {},
+			};
+		},
+		onLoad(options) {
+			that = this
+			this.isdingwei()
+			this.dataObj = JSON.parse(options.val)
+			console.log(this.dataObj)
+
+		},
+		methods: {
+			getInfo(_origin, _destination) {
+				return new Promise((resolve, reject) => {
+					var amapPluginInstance = new GDMapWX.AMapWX({
+						key: '6bafe91754a563ff2b7c02542c1ef4e8'
+					});
+					amapPluginInstance.getDrivingRoute({
+						origin: _origin,
+						destination: _destination,
+						success: function(res) {
+							console.log(res)
+							resolve(res)
+							// let _content =  that.dataObj.shopNames+'\n'+"距离约"+1+'公里'+'\n'+'驾车约'+4+"分钟"
+							// console.log(_content)
+							// that.marker[0].callout = { //气泡窗口
+							// 	content: that.dataObj.shopNames+'\n'+"距离约"+1+'公里'+'\n'+'驾车约'+4+"分钟", //文本
+							// 	// color: '#ffffff',
+							// 	fontSize: 14,
+							// 	borderRadius: 15,
+							// 	padding: '10',
+							// 	bgColor: '#fff',
+							// 	display: 'ALWAYS', //常显
+							// }
+
+							//成功回调
+						},
+						fail: function(info) {
+							//失败回调
+							console.log(info)
+						}
+					})
+				})
+			},
+			toDL(val) {
+				console.log(val)
+				let _latitude = val.location.split(",")[0]
+				let _longitude = val.location.split(",")[1]
+				uni.openLocation({
+					latitude: Number(_latitude),
+					longitude: Number(_longitude),
+					success: function() {
+						console.log('success');
+					},
+					fail(fail) {
+						console.log(fail)
+					},
+				});
+			},
+			isdingwei() {
+				authorizedLocation().then(async res => {
+					let _obj = {}
+					if (res == '取消授权') {
+						
+					} else {
+						_obj = {
+							latitude: res.latitude,
+							longitude: res.longitude
+						}
+					}
+					this.longitude = _obj.longitude
+					this.latitude = _obj.latitude
+					let _origin = this.longitude + ',' + this.latitude
+					let _destination = this.dataObj.location.split(",")[1] + "," + this.dataObj.location.split(
+						",")[0]
+					let _info = await this.getInfo(_origin, _destination)
+					this.info = _info.paths[0]
+					this.marker[0] = {
+						id: Number(this.dataObj.id),
+						iconPath: '/static/image/food/location.png', //显示的图标
+						latitude: Number(this.dataObj.latitude),
+						longitude: Number(this.dataObj.longitude),
+						width: 20,
+						height: 20,
+
+						customCallout: {
+							// content: that.dataObj.shopNames + '\n' + "距离约" + 1 + '公里' + '\n' + '驾车约' + 4 +
+							// 	"分钟", //文本
+							// // color: '#ffffff',
+							// fontSize: 14,
+							// borderRadius: 15,
+							// padding: '10',
+							// bgColor: '#fff',
+							display: 'ALWAYS', //常显
+						}
+					}
+					let _polylineList = []
+					for (let i = 0; i < this.info.steps.length; i++) {
+						let _polyline = this.info.steps[i].polyline.split(";")
+						for (let j = 0; j < _polyline.length; j++) {
+							let _obj = {
+								latitude: _polyline[j].split(",")[1],
+								longitude: _polyline[j].split(",")[0]
+							}
+							_polylineList.push(_obj)
+						}
+
+					}
+					this.polyline = [{
+						points: _polylineList,
+						color: "#31c27c",
+						width: 5,
+						arrowLine: true,
+						// borderWidth: 2 //线的边框宽度,还有很多参数,请看文档 
+					}]
+					this.$forceUpdate()
+				})
+			},
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	.customCallout {
+		width: 400rpx;
+		position: relative;
+		background: #fff;
+		border-radius: 20rpx;
+		padding: 20rpx;
+
+		.content {
+			margin-top: 10rpx;
+		}
+
+		.row1 {
+			font-weight: 700;
+			font-size: 32rpx;
+		}
+
+		.row2,
+		.row3 {
+			font-size: 24rpx;
+		}
+
+		.dh {
+			font-size: 24rpx;
+			background: #eaad1a;
+			border-radius: 10rpx;
+			padding: 10rpx 20rpx;
+			display: flex;
+			justify-content: center;
+			align-items: center;
+			position: absolute;
+			right: 20rpx;
+			bottom: 20rpx;
+			color: #fff;
+			z-index: 9999;
+		}
+	}
+</style>

+ 3 - 2
uni_applet/pageA/food/fondMap.vue

@@ -6,7 +6,7 @@
 		<view class="floatBtn" :style="{bottom:(currentHeight+20)+'px'}" @click="onControltap">
 			<view class="header-avatar">
 			<image class="cover-image" src="@/static/image/food/dw.png"></image>
-			</view>
+			</view> 
 		</view>
 		<bab-Touchbox :minHeight="0.25" :maxHeight="0.7" :touchHeight="40" @currentHeight="setScrollHeight"
 			@maxtHeight="setScrollViewHeight">
@@ -244,7 +244,7 @@
 					})
 				})
 			},
-			async getStationList() {debugger
+			async getStationList() {
 				this.mapList = []
 				const data = await this.getList()
 				console.log('queryStationInfos,信息列表显示总数据', data);
@@ -314,6 +314,7 @@
 			},
 			setScrollHeight(val) { // 实时返回的滑动组件高度
 				this.currentHeight = val
+				console.log(this.currentHeight)
 			},
 			setScrollViewHeight(val) { //最大高度
 				this.scrollViewHeight = val

+ 9 - 2
uni_applet/pages.json

@@ -381,9 +381,16 @@
 						"navigationBarTitleText": "店铺信息",
 						"enablePullDownRefresh": false
 					}
-				
 				}
-				
+                ,{
+                    "path" : "food/detailMap",
+                    "style" :                                                                                    
+                {
+                    "navigationBarTitleText": "店铺详情",
+                    "enablePullDownRefresh": false
+                }
+                
+                }
             ]
 	}],
 	"preloadRule": {

+ 1 - 0
uni_applet/pages/food/food.vue

@@ -225,6 +225,7 @@
 			},
 			delSearchVal(){
 				this.searchVal = ''
+				
 				that.mescroll.resetUpScroll()
 			},
 			isdingwei() {

+ 7 - 6
uni_applet/uni_modules/bab-Touchbox/components/bab-Touchbox/bab-Touchbox.vue

@@ -92,11 +92,11 @@
 				  //#endif
 				// console.log(screenY)
 				// 这里特殊处理 解决:在滑动框内如果存在滚动元素,则会出现滑动时滑动框和内部滚动同时滑的问题
-				if (this.touchHeight !== 0) {
-					if (screenY - this.fixboxtop > this.touchHeight) {
-						return false;
-					}
-				}
+				// if (this.touchHeight !== 0) {
+				// 	if (screenY - this.fixboxtop > this.touchHeight) {
+				// 		return false;
+				// 	}
+				// }
 				this.isend = false
 				if (this.isfirst) {
 					this.isfirst = false
@@ -105,7 +105,8 @@
 				this.fixboxtop = screenY - this.tapboxtop
 				if (this.fixboxtop > this.firsttop) { // 往下滑 不允许
 					this.fixboxtop = this.firsttop
-				} else { // 往上滑
+				} else { 
+					// 往上滑
 					if (this.fixboxtop <= this.windowHeight * (1 - this.maxHeight)) {
 						this.fixboxtop = this.windowHeight * (1 - this.maxHeight)
 					}

+ 11 - 1
unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/tourism/impl/FoodInfoServiceImpl.java

@@ -48,6 +48,8 @@ public class FoodInfoServiceImpl implements IFoodInfoService {
 	private FoodGroupInfoMapper foodGroupInfoMapper;
 	@Autowired
 	private FoodGroupOrderInfoMapper foodGroupOrderInfoMapper;
+	@Autowired
+	private CommonUserInfoMapper commonUserInfoMapper;
 	/**
 	 * 地球半径,单位 km
 	 */
@@ -61,6 +63,10 @@ public class FoodInfoServiceImpl implements IFoodInfoService {
 		foodInfo.setGmtCreate(now);
 		foodInfo.setGmtUpdate(now);
 		foodInfo.setStatus("审核中");
+		CommonUserInfo commonUserInfo=commonUserInfoMapper.selectById(foodInfo.getCommonId());
+		if (commonUserInfo!=null){
+			commonUserInfo.setFoodEntry(commonUserInfo.getFoodEntry()+1);
+		}
 		return foodInfoMapper.insert(foodInfo)>0;
 	}
 
@@ -287,6 +293,10 @@ public class FoodInfoServiceImpl implements IFoodInfoService {
 			if(tmp != null){
 				tmp.setDeleteFlag(1l);
 				foodInfoMapper.updateById(tmp);
+				CommonUserInfo commonUserInfo=commonUserInfoMapper.selectById(tmp.getCommonId());
+				if (commonUserInfo!=null){
+					commonUserInfo.setFoodEntry(commonUserInfo.getFoodEntry()-1);
+				}
 			}
 		}
 		return true;
@@ -314,7 +324,7 @@ public class FoodInfoServiceImpl implements IFoodInfoService {
 			noticeMessageInfoMapper.insert(noticeMessageInfo);
 		}
 		//通过
-		else{
+		else if("显示中".equals(foodInfo.getStatus())){
 			NoticeMessageInfo noticeMessageInfo=new NoticeMessageInfo();
 			noticeMessageInfo.setNewsTitle("系统消息");
 			noticeMessageInfo.setNewsContent("您的入驻申请(餐饮),已通过审核。");

+ 23 - 5
unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/tourism/impl/HomestayInfoServiceImpl.java

@@ -2,9 +2,8 @@ package com.iotechn.unimall.admin.api.tourism.impl;
 
 import java.util.List;
 
-import com.iotechn.unimall.data.domain.DishClassifyInfo;
-import com.iotechn.unimall.data.domain.FoodInfo;
-import com.iotechn.unimall.data.domain.NoticeMessageInfo;
+import com.iotechn.unimall.data.domain.*;
+import com.iotechn.unimall.data.mapper.CommonUserInfoMapper;
 import com.iotechn.unimall.data.mapper.NoticeMessageInfoMapper;
 import org.apache.ibatis.session.RowBounds;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -16,7 +15,6 @@ import com.baomidou.mybatisplus.mapper.Wrapper;
 import com.iotechn.unimall.core.exception.ServiceException;
 import com.iotechn.unimall.data.util.ExcelUtil;
 import com.iotechn.unimall.data.mapper.HomestayInfoMapper;
-import com.iotechn.unimall.data.domain.HomestayInfo;
 import com.iotechn.unimall.admin.api.tourism.IHomestayInfoService;
 import com.iotechn.unimall.data.model.Page;
 import java.util.Date;
@@ -34,13 +32,24 @@ public class HomestayInfoServiceImpl implements IHomestayInfoService{
 	private HomestayInfoMapper homestayInfoMapper;
 	@Autowired
 	private NoticeMessageInfoMapper noticeMessageInfoMapper;
-	
+	@Autowired
+	private CommonUserInfoMapper commonUserInfoMapper;
+
 	@Override
 	public Boolean add(HomestayInfo homestayInfo) throws ServiceException {
 		Date now = new Date();
 		homestayInfo.setGmtCreate(now);
 		homestayInfo.setGmtUpdate(now);
 		homestayInfo.setStatus("审核中");
+		CommonUserInfo commonUserInfo=commonUserInfoMapper.selectById(homestayInfo.getCommonId());
+		if (commonUserInfo!=null){
+			if ("1".equals(homestayInfo.getType())){
+				commonUserInfo.setHomeEntry(commonUserInfo.getHomeEntry()+1);
+			}
+			else {
+				commonUserInfo.setHotelEntry(commonUserInfo.getHotelEntry()+1);
+			}
+		}
 		return homestayInfoMapper.insert(homestayInfo)>0;
 	}
 
@@ -92,6 +101,15 @@ public class HomestayInfoServiceImpl implements IHomestayInfoService{
 			if(tmp != null){
 				tmp.setDeleteFlag(1l);
 				homestayInfoMapper.updateById(tmp);
+				CommonUserInfo commonUserInfo=commonUserInfoMapper.selectById(tmp.getCommonId());
+				if (commonUserInfo!=null){
+					if ("1".equals(tmp.getType())){
+						commonUserInfo.setHomeEntry(commonUserInfo.getHomeEntry()-1);
+					}
+					else {
+						commonUserInfo.setHotelEntry(commonUserInfo.getHotelEntry()-1);
+					}
+				}
 			}
 		}
 		return true;

+ 16 - 10
unimall-data/src/main/java/com/iotechn/unimall/data/domain/CommonUserInfo.java

@@ -58,15 +58,20 @@ public class CommonUserInfo extends SuperDO {
     @TableField("automatic_skip")
     private Long automaticSkip;
 
-    /** 我的入驻 */
-    @Excel(name = "我的入驻")
-    @TableField("my_entry")
-    private Long myEntry;
+    /** 入驻餐饮数 */
+    @Excel(name = "入驻餐饮数")
+    @TableField("food_entry")
+    private Long foodEntry;
 
-    /** 默认入驻 */
-    @Excel(name = "默认入驻")
-    @TableField("default_entry")
-    private Long defaultEntry;
+    /** 入驻民宿数 */
+    @Excel(name = "入驻民宿数")
+    @TableField("home_entry")
+    private Long homeEntry;
+
+    /** 入驻酒店数 */
+    @Excel(name = "入驻酒店数")
+    @TableField("hotel_entry")
+    private Long hotelEntry;
 
     /** 0.冻结 1.激活 */
     @Excel(name = "0.冻结 1.激活")
@@ -104,8 +109,9 @@ public class CommonUserInfo extends SuperDO {
             .append("phone", getPhone())
             .append("realname", getRealname())
             .append("automaticSkip", getAutomaticSkip())
-            .append("myEntry", getMyEntry())
-            .append("defaultEntry", getDefaultEntry())
+            .append("foodEntry", getFoodEntry())
+            .append("homeEntry", getHomeEntry())
+            .append("hotelEntry", getHotelEntry())
             .append("status", getStatus())
             .append("gmtCreate", getGmtCreate())
             .append("gmtUpdate", getGmtUpdate())