zhangyuewww 2 年 前
コミット
c8a642522b

+ 4 - 0
.gitignore

@@ -77,3 +77,7 @@ unimall.log.*.tmp
 *.wxml
 xiaochengxu/unpackage/
 uni_merchants_enter/unpackage/dist/dev/
+uni_applet/unpackage/dist/dev/.sourcemap/mp-weixin/uni_modules/uni-tag/components/uni-tag/uni-tag.js.map
+uni_applet/unpackage/dist/dev/mp-weixin/pageA/food/food.js
+uni_applet/unpackage/dist/dev/mp-weixin/pageA/groupBuying/groupBuying.js
+uni_applet/unpackage/dist/dev/mp-weixin/uni_modules/uni-tag/components/uni-tag/uni-tag.js

+ 1 - 1
uni_applet/config/index.js

@@ -1,6 +1,6 @@
 const dev = {
 	// baseUrlNew: 'http://192.168.110.72:8182',
-	baseUrlNew: 'http://192.168.110.138:8182',
+	// baseUrlNew: 'http://192.168.110.138:8182',
 	baseUrlNew: 'http://192.168.110.138:8183',
 	// baseUrlNew: 'http://192.168.110.82:8182',
 	// baseUrlNew: 'https://cardapi.eliangeyun.com',

+ 8 - 0
uni_applet/pageA/food/groupBuying.vue

@@ -0,0 +1,8 @@
+<template>
+</template>
+
+<script>
+</script>
+
+<style>
+</style>

+ 387 - 0
uni_applet/pageA/food/search.vue

@@ -0,0 +1,387 @@
+<template>
+	<view>
+		<d-search-log :placeholder="'搜索美食'" :color_border="color_border" :color_text="color_border"
+			:search_list_old_man_num='15' :search_list_hot="search_list_hot" :store_key="store_key" :input_text="input_text"
+			@onClickDelAllApi="onClickDelAll" @onSearchNameApi="onSearchName" @onSearchvoiceApi='onSearchvoice'></d-search-log>
+		<u-popup :show="isRecorderManager" mode="bottom">
+			<view class="shqx" v-if="longPress == '2'">
+				上划取消
+			</view>
+			<view class="record-layer">
+				<view class="record-box">
+					<view class="record-btn-layer" v-if="tempFilePath == ''">
+						<view class="record-btn">
+							<image src="../../static/mic.png" mode="widthFix" style="width:120rpx;height: auto;"
+								@longpress="longpressBtn" @touchend="touchendBtn" @touchmove="handleTouchMove"></image>
+							<text class="text">{{longPress == '1' ? '按住说出姓名' : '松开自动识别'}}</text>
+						</view>
+					</view>
+					<view class="prompt-layer prompt-layer-1" v-if="longPress == '2'">
+						<view class="prompt-loader">
+							<view class="em" v-for="(item,index) in 15" :key="index"></view>
+						</view>
+					</view>
+				</view>
+			</view>
+		</u-popup>
+		<u-toast ref="uToast"></u-toast>
+	</view>
+</template>
+
+<script>
+	import dSearchLog from '@/uni_modules/d-search-log/components/d-search-log/d-search-log.vue'
+	const recorderManager = uni.getRecorderManager();
+	const innerAudioContext = uni.createInnerAudioContext();
+	var init // 录制时长计时器
+	var timer // 播放 录制倒计时
+	export default {
+		components: {
+			"dSearchLog": dSearchLog
+		},
+		data() {
+			return {
+
+				duration: 2000, //录音最大值ms 60000/1分钟
+				tempFilePath: '', //音频路径
+				playStatus: 0, //录音播放状态 0:未播放 1:正在播放
+				longPress: '1',
+				tempFilePath: '',
+				color_border: "#00aaff",
+				search_list_hot: [],
+				store_key: 'search_list',
+				isRecorderManager: false,
+				is_clock: true,
+				startPoint: "",
+				input_text:""
+			};
+		},
+		onLoad(options) {
+			if (options.mic == 1) {
+				this.isRecorderManager = true
+			}
+		},
+		methods: {
+			onSearchvoice(e){
+				this.isRecorderManager = true
+			},
+			handleTouchMove: function(e) {
+				console.log("滑动")
+				if (Math.abs(e.touches[e.touches.length - 1].clientY - this.startPoint.clientY) > 35) {
+
+					this.is_clock = false
+				} else {
+
+					this.is_clock = true
+				}
+			},
+			longpressBtn(e) {
+				this.longPress = '2';
+				this.is_clock = true,
+					console.log(e);
+				this.startPoint = e.touches[0],
+					recorderManager.onStop((res) => {
+						console.log("录音结束")
+						this.tempFilePath = res.tempFilePath;
+					})
+				const options = {
+					duration: this.duration, // 指定录音的时长,单位 ms
+					sampleRate: 16000, // 采样率
+					numberOfChannels: 1, // 录音通道数
+					encodeBitRate: 96000, // 编码码率
+					// format: 'mp3', // 音频格式,有效值 aac/mp3
+					frameSize: 10, // 指定帧大小,单位 KB
+				}
+				recorderManager.start(options);
+				// 监听音频开始事件
+				recorderManager.onStart((res) => {
+					console.log(res)
+				})
+			},
+			touchendBtn() {
+				console.log("录音结束")
+				let that = this
+				this.longPress = '1'; 
+				that.isRecorderManager = false
+				recorderManager.onStop((res) => {
+					this.tempFilePath = res.tempFilePath
+					let _file = ''
+					if (that.is_clock) {
+						_file = uni.getFileSystemManager().readFileSync(res.tempFilePath, "base64")
+						console.log(_file)
+						uni.showLoading({
+							title:"正在识别"
+						})
+						that.$request.baseRequest('admin.tourism.productManagement', 'speechRecognition', {
+							voiceMessage: _file,
+						}, failres => {
+							console.log('res+++++', failres.errmsg)
+							uni.hideLoading()
+							uni.showToast({
+								icon:"none",
+								title: failres.errmsg,
+								duration: 3000
+							});
+						}).then(res => {
+							uni.hideLoading()
+							console.log(res)
+							if(res.data.text.length>10){
+								var text = res.data.text.substring(0, 10)
+							}else{
+								var text = res.data.text
+							}
+							that.input_text = text
+							// uni.setStorageSync('search_val', text);
+							// uni.switchTab({
+							// 	url: "/pages/cardHolder/search"
+
+							// })
+
+						})
+					}
+					recorderManager.stop()
+				})
+			},
+			onClickDelAll() {},
+			onSearchName(e) {
+				if(e.length>10){
+					var text = e.substring(0, 10)
+				}else{
+					var text = e
+				}
+				
+				uni.setStorageSync('search_val', text);
+				uni.switchTab({
+					url: "/pages/food/food"
+				})
+			}
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	.shqx {
+		position: absolute;
+		top: -100rpx;
+		left: 0;
+		right: 0;
+		margin: auto;
+		text-align: center;
+		color: rgba(221, 221, 221, 1);
+	}
+
+	.record-box {
+		width: 100%;
+		position: relative;
+		top: 80rpx;
+	}
+
+	.record-btn-layer {
+		width: 100%;
+		display: flex;
+		justify-content: center;
+	}
+
+	.record-btn-layer button::after {
+		border: none;
+	}
+
+	.record-btn-layer button {
+		font-size: 14px;
+		line-height: 38px;
+		width: 100%;
+		height: 38px;
+		border-radius: 8px;
+		text-align: center;
+		background: rgba(56, 86, 156, 1);
+	}
+
+	.record-btn-layer button image {
+		width: 16px;
+		height: 16px;
+		margin-right: 4px;
+		vertical-align: middle;
+	}
+
+	.record-btn-layer .record-btn-2 {
+		background: rgba(56, 86, 156, 1);
+	}
+
+	.prompt-layer {
+		border-radius: 8px;
+		background: rgba(56, 86, 156, 1);
+		padding: 8px 16px;
+		box-sizing: border-box;
+		position: absolute;
+		left: 50%;
+		transform: translateX(-50%);
+	}
+
+	.prompt-layer::after {
+		content: '';
+		display: block;
+		border: 6px solid rgba(0, 0, 0, 0);
+		border-top-color: rgba(56, 86, 156, 1);
+		position: absolute;
+		bottom: -10px;
+		left: 50%;
+		transform: translateX(-50%);
+	}
+
+	.prompt-layer-1 {
+		font-size: 12px;
+		width: 128px;
+		text-align: center;
+		display: flex;
+		flex-direction: column;
+		align-items: center;
+		justify-content: center;
+		top: -240px;
+	}
+
+	.del {
+		position: absolute;
+		top: -200rpx;
+
+		.img {
+			width: 100rpx;
+		}
+	}
+
+	.prompt-layer-1 .p {
+		color: #000000;
+	}
+
+	.prompt-layer-1 .span {
+		color: #fff;
+	}
+
+	.prompt-loader .em {}
+
+	.prompt-loader {
+		width: 96px;
+		height: 20px;
+		display: flex;
+		align-items: center;
+		justify-content: space-between;
+		margin-bottom: 6px;
+	}
+
+	.prompt-loader .em {
+		display: block;
+		background: #fff;
+		width: 1px;
+		height: 10%;
+		margin-right: 2.5px;
+		float: left;
+	}
+
+	.prompt-loader .em:last-child {
+		margin-right: 0px;
+	}
+
+	.prompt-loader .em:nth-child(1) {
+		animation: load 2.5s 1.4s infinite linear;
+	}
+
+	.prompt-loader .em:nth-child(2) {
+		animation: load 2.5s 1.2s infinite linear;
+	}
+
+	.prompt-loader .em:nth-child(3) {
+		animation: load 2.5s 1s infinite linear;
+	}
+
+	.prompt-loader .em:nth-child(4) {
+		animation: load 2.5s 0.8s infinite linear;
+	}
+
+	.prompt-loader .em:nth-child(5) {
+		animation: load 2.5s 0.6s infinite linear;
+	}
+
+	.prompt-loader .em:nth-child(6) {
+		animation: load 2.5s 0.4s infinite linear;
+	}
+
+	.prompt-loader .em:nth-child(7) {
+		animation: load 2.5s 0.2s infinite linear;
+	}
+
+	.prompt-loader .em:nth-child(8) {
+		animation: load 2.5s 0s infinite linear;
+	}
+
+	.prompt-loader .em:nth-child(9) {
+		animation: load 2.5s 0.2s infinite linear;
+	}
+
+	.prompt-loader .em:nth-child(10) {
+		animation: load 2.5s 0.4s infinite linear;
+	}
+
+	.prompt-loader .em:nth-child(11) {
+		animation: load 2.5s 0.6s infinite linear;
+	}
+
+	.prompt-loader .em:nth-child(12) {
+		animation: load 2.5s 0.8s infinite linear;
+	}
+
+	.prompt-loader .em:nth-child(13) {
+		animation: load 2.5s 1s infinite linear;
+	}
+
+	.prompt-loader .em:nth-child(14) {
+		animation: load 2.5s 1.2s infinite linear;
+	}
+
+	.prompt-loader .em:nth-child(15) {
+		animation: load 2.5s 1.4s infinite linear;
+	}
+
+	@keyframes load {
+		0% {
+			height: 10%;
+		}
+
+		50% {
+			height: 100%;
+		}
+
+		100% {
+			height: 10%;
+		}
+	}
+
+	.prompt-layer-2 {
+		// top: -540px;
+	}
+
+	.prompt-layer-2 .text {
+		color: rgba(0, 0, 0, 1);
+		font-size: 12px;
+	}
+
+	.record-btn {
+		display: flex;
+		flex-direction: column;
+		justify-content: center;
+		align-items: center;
+
+		.text {
+			margin-top: 20rpx;
+		}
+
+	}
+
+	/deep/.u-popup__content {
+		padding-bottom: 100rpx;
+		// background: linear-gradient(180deg, rgba(204, 204, 204, 0.95) 0%, rgba(203, 203, 203, 0.01) 100%) !important;
+		border-radius: 50% 50% 0 0;
+	}
+
+	.record-layerP {
+		position: relative;
+		top: 50px;
+	}
+</style>

+ 18 - 0
uni_applet/pages.json

@@ -114,6 +114,24 @@
 				}
 				
 				}
+                ,{
+                    "path" : "food/food",
+                    "style" :                                                                                    
+                {
+                    "navigationBarTitleText": "",
+                    "enablePullDownRefresh": false
+                }
+                
+                }
+                ,{
+                    "path" : "groupBuying/groupBuying",
+                    "style" :                                                                                    
+                {
+                    "navigationBarTitleText": "",
+                    "enablePullDownRefresh": false
+                }
+                
+                }
             ]
 		}
 	],

+ 411 - 3
uni_applet/pages/food/food.vue

@@ -1,19 +1,427 @@
 <template>
 	<view>
-		
+		<view class="flex content1">
+			<view @click='placeSelect' class='address flex'>
+			<view class='detailedAddress'>{{detailedAddress}}</view>
+			<view class='iconfont applet-xiala'></view>
+			</view>
+			<view class=" search-wrap">
+				<view class="search flex justify-space-between align-item-center flex-between" @click="search">
+					<view class="left flex">
+						<uni-icons type="search" size="24" color="#9199af"></uni-icons>
+						<text class="search-val"> {{searchVal?searchVal:'搜索美食'}}</text>
+					</view>
+			
+					<view class="right">
+						<!-- <image style='width:32rpx;height:32rpx;' v-if="searchVal" @click.native.stop="delSearchVal"
+							src="../../static/imgs/card/searchdel.png" mode="widthFix"></image> -->
+					</view>
+				</view>
+			</view>
+		</view>
+		<view class="tag-type">
+			<uni-tag :circle="true" :text="item.iname" type="warning"  :inverted="inverted" style="width: 61px;text-align: center; margin-left: 20px;"  v-for='item in jobs'  @click="change(item)"/>
+		</view>
+		<scroll-view  scroll-x="true" scroll-with-animation="true" class='list-type'>
+			<view  v-for='item in searchTypes' @click='changetype(item)' :class='searchType==item.value?"Semibold active":"Regular"' class="typeitem">{{item.name}}</view>
+		</scroll-view>
+		<view>
+			<mescroll-uni :up="upOption" :down="downOption" ref="mescrollRef" @init="mescrollInit"
+				@up="upCallback" @down="downCallback" height="660">
+				<view class='findItem' v-for='item in findList'>
+					<view style='align-items: flex-start;' class='flex'>
+						<view class="left">
+							<view class='cover'>
+								<u--image radius='4' :showLoading="true" :src="item.coverImage" width="80px" height="80px"></u--image>
+							</view>
+						</view>
+						<view class="right">
+							<view class='cover'>
+								<u--image radius='4' :showLoading="true" :src="item.indoorImage" width="80px" height="80px"></u--image>
+							</view>
+						</view>
+					</view>
+					<view class='flex'>
+						<view v-if='item.mainBody=="商铺"' class='iconfont applet-dianpu1'></view>
+						<u--image v-if='item.mainBody=="个人"'  :showLoading="true" src="/static/image/find/geren.png" width="20px" height="20px"></u--image>
+						<view  class='name'>{{item.shopNames}}</view>
+					</view>
+					<view class="tag-type">
+						<uni-tag :inverted="true"  :text="item" type="warning"  style="width: 61px;text-align: center; margin-left: 10px;"  v-for='item in item.labels'/>
+					</view>
+					<view class='address flex justify-space-between'>
+						<view  class='flex'>
+							<view class='iconfont applet-dizhi'></view>
+							<view>{{item.province}}{{item.city}}{{item.area}}</view>
+						</view>
+						<view>{{item.distance}}
+						<text style='font-weight:600;'>km</text></view>
+					</view>
+				</view>
+			</mescroll-uni>
+			<!-- <mescroll-body ref="mescrollRef" :up="upOption" :down="downOption" @init="mescrollInit" @up="upCallback" @down="downCallback"></mescroll-body> -->
+		</view>
+		<view class='group' @click='group'>
+			<button class="tuan">团</button>
+		</view>
 	</view>
 </template>
 
 <script>
+	var that;
+	var QQMapWX = require('@/js_sdk/qqmap-wx-jssdk.min.js');
+	 var qqmapsdk = new QQMapWX({
+	        key: 'HQ6BZ-RMALQ-TGF5H-BXJQB-UFYN3-Q5BYM'
+	    });
+	import MoteLinesDivide from "@/components/text-over-flow/text-over-flow.vue"
+	import MescrollMixin from "@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js";
 	export default {
+		components: {
+			MoteLinesDivide
+		},
+		mixins: [MescrollMixin],
 		data() {
 			return {
-				
+				searchVal:uni.getStorageSync("search_val")?uni.getStorageSync("search_val"):"",
+				current:0,
+				mescroll:null,
+				findList:[],
+				inverted: true,
+				handleList:[],
+				labels:[],
+				searchType:'1',
+				label:'',
+				longitude:uni.getStorageSync("findlongitude")?uni.getStorageSync("findlongitude"):"",
+				latitude:uni.getStorageSync("findlatitude")?uni.getStorageSync("findlatitude"):'',
+				curPageLen:0,
+				totalPage:0,
+				detailedAddress:uni.getStorageSync("detailedAddress")?uni.getStorageSync("detailedAddress"):'',
+				downOption: {
+					auto: false,
+					textColor: '#bbb'
+				},
+				searchTypes:[
+				{name:'默认排序',value:'1'},{name:'距离最近',value:'2'},{name:'最多点赞',value:'3'},{name:'我的收藏',value:'4'}
+				],
+				jobs: [
+					{
+						id: 1,
+						iname: '海鲜',
+					},
+					{
+						id: 2,
+						iname: '自助'
+					}, {
+						id: 3,
+						iname: '烧烤',
+					},
+					{
+						id: 4,
+						iname: '火锅',
+					},
+					{
+						id: 5,
+						iname: '家常菜'
+					}
+				],
+				upOption: {
+					page: {
+						size: 10 // 每页数据的数量,默认10
+					},
+					auto: false,
+					noMoreSize: 1,
+					textNoMore: '没有更多了~',
+					textColor: '#bbb'
+				},
 			};
+		},
+		onLoad() {
+			that = this
+		// this.getList()
+		console.log(this)
+		// this.mescroll.resetUpScroll();
+		},
+		onShow(){
+			if(!this.detailedAddress){
+				this.placeSelect()
+			}else{
+				that.upCallback({
+					num:1,
+					size:10
+				})
+			}
+		},
+		methods: {
+			search() {
+				uni.navigateTo({
+					url: "/pageA/food/search"
+				})
+			},
+			change(item){
+				if(this.label==item.iname){
+					this.label=''
+				}
+				else{
+					this.label=item.iname
+					
+				}
+				this.inverted = !this.inverted;
+				that.upCallback({
+					num:1,
+					size:10
+				})
+			},
+			changetype(item){
+				this.searchType=item.value
+				that.upCallback({
+					num:1,
+					size:10
+				})
+			},
+			placeSelect() {
+				uni.chooseLocation({
+					success: function(res) {
+						console.log(res);
+						that.latitude = res.latitude
+						that.longitude = res.longitude
+						uni.setStorageSync("findlatitude",res.latitude)
+						uni.setStorageSync("findlongitude",res.longitude)
+						let _address = that.$helper.formatLocation(res.address)
+						that.detailedAddress = _address.Village
+						uni.setStorageSync("detailedAddress",_address.Village)
+						that.$forceUpdate()
+						that.upCallback({
+							num:1,
+							size:10
+						})
+					}
+				});
+			},
+			mescrollInit(mescroll) {
+				this.mescroll = mescroll;
+			},
+			downCallback() {
+				if (uni.getStorageSync("userInfo").phone) {
+					this.mescroll.resetUpScroll()
+				} else {
+					that.mescroll.endBySize(0, 0)
+					this.showAuthorizePhone = true
+				}
+			
+			},
+			getDistance(latitude,longitude){
+				console.log(latitude,longitude,that.latitude,that.longitude)
+				return new Promise((resolve, reject) => {
+					qqmapsdk.direction({
+					                    mode: 'driving', //可选值:'driving'(驾车)  trucking 货车
+					                    //from参数不填默认当前地址
+					                    // latitude纬度    longitude 经度
+					                    from: {
+					                        latitude: that.latitude,
+					                        longitude: that.longitude
+					                    },
+					                    to: {
+					                        latitude: latitude,
+					                        longitude:longitude
+					                    },
+					                    size: 4, // 车型 1: 微型车  2: 轻型车 3: 中型车 4: 重型车
+					                    policy: 'LEAST_TIME', //'9',  //参考实时路况,高速优先,尽量躲避拥堵
+					                    height: 4,
+					                    width: 2.5,
+					                    length: 13,
+					                    weight: 6.8,
+					                    axle_weight: 34,
+					                    axle_count: 6,
+					                    is_trailer: 1,
+					                 success: function(res1, data) {
+										 console.log(res1,data[0].distance,data)
+										 resolve(data[0])
+										 
+									 }
+					})
+				})
+			},
+			async upCallback(page) {
+						uni.showLoading({
+							title: '数据加载中'
+						})
+						await that.$request.baseRequest('admin.tourism.foodInfo', 'list', {
+							page: page.num,
+							limit: page.size,
+							searchType: this.searchType,
+							label: this.label,
+						}, failres => {
+							uni.showToast({
+								icon: "none",
+								title: failres.errmsg,
+								duration: 3000
+							});
+							uni.hideLoading()
+						}).then(res => {
+							if (page.num == 1) that.findList = [],that.handleList = [];
+							that.curPageLen = res.data.items.length;
+							that.handleList = res.data.items
+							that.totalPage = res.data.total;
+						})
+						if(that.handleList.length>0){
+						for(var i=0;i<that.handleList.length;i++){
+							
+							that.handleList[i].latitude=that.handleList[i].location.split(',')[0]
+							that.handleList[i].longitude=that.handleList[i].location.split(',')[1]
+							var data=await that.getDistance(that.handleList[i].latitude,that.handleList[i].longitude) 
+							that.handleList[i].distance=(data.distance/1000).toFixed(2)
+							that.handleList[i].labels = that.handleList[i].label.split(",")
+							if(i==that.handleList.length-1){
+								setTimeout(()=>{
+									console.log(that.handleList)
+									that.findList = that.handleList
+									that.loading = false
+									that.$nextTick(() => {
+										that.mescroll.endBySize(that.curPageLen, that.totalPage)
+									});
+												
+									uni.hideLoading()
+								},100)
+							}
+						}
+					}
+					else{
+						uni.hideLoading()
+					}
+			},
+		 group(){
+			uni.navigateTo({
+				url: '/pageA/food/groupBuying'
+			})
+		 },
 		}
 	}
 </script>
 
-<style lang="scss">
+<style lang="scss" scoped>
+	
+	.content1 {
+		padding: 20rpx;
+		background-color: #fbb612;
+		.search {
+			// color: #9199af;
+			// background: #f9d27d;
+			border-radius: 50rpx;
+			padding: 10rpx 0 10rpx 30rpx;
+			box-sizing: border-box;
+			margin-right: 20rpx;
+		}
+
+		.left {
+			width: 80%;
+
+			text {
+				height: 46rpx;
+				white-space: nowrap;
+				overflow: scroll;
+				position: relative;
+				margin-left: 20rpx;
+				color:#9199af;
+			}
+		}
+
+		.right {
+			// width:14%;
+			margin-right: 20rpx
+		}
+	}
+	.search-wrap{
+		width:78%;
+		background: #ffff;
+		border: 1px solid #f9d27d;
+		border-radius: 50rpx;
+	}
+	.address{
+		width:22%;
+	}
+	.findItem{
+		background:#fff;
+		margin:10rpx;
+		border-radius:20rpx;
+		padding:20rpx;
+		font-size:32rpx;
+		.left{
+			margin-right:20rpx;
+			.cover{
+				border-radius: 8rpx;
+			}
+		}
+		.name{
+			font-size:36rpx;
+			color:#333;
+			margin-left:10rpx;
+		}
+		.description{
+			color:#666;
+			margin-top:10rpx;
+		}
+		.address{
+			margin-top:20rpx;
+			width:100%;
+			font-size:28rpx;
+			color:#393733;
+		}
+	}
+	.applet-dianpu1{
+		font-size:44rpx;
+		color:#eaad1a;
+	}
 
+	.applet-dizhi{
+		font-size:38rpx;
+		color:#393733;
+	}
+	.group{
+		position: fixed;
+		margin-left:350px;bottom:10px;
+	}
+	.tuan{
+		background:#eaad1a;
+		border-radius:50px;
+		color:#fff;
+	}
+	.applet-colors-tianjia2{
+		font-size:30px;
+	}
+	.text {
+		font-size: 26rpx;
+		font-weight: 500;
+		color: #eaad1a;
+		opacity: 0.5;
+		margin-right: 56rpx;
+	}
+	.tag-type{
+		background: #fff;
+	}
+	.list-type{
+		background: #fff;
+		width:100vw;
+		padding-top:5px;
+		height:49px;
+		overflow-x: scroll;
+		white-space: nowrap;
+	}
+	.typeitem{
+		margin:10px;
+		position:relative;
+		display:inline-block;
+		padding-bottom:10px;
+		font-size:17px;
+	}
+	.typeitem.active:after{
+		content:'';
+		display:block;
+		position:absolute;
+		height:3px;
+		bottom:0;
+		background:#eaad1a;
+		width:18px;
+		left:50%;
+		transform: translateX(-50%);
+	}
 </style>

+ 1 - 0
unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/tourism/impl/CommonUserInfoServiceImpl.java

@@ -3,6 +3,7 @@ package com.iotechn.unimall.admin.api.tourism.impl;
 import java.util.List;
 
 import com.iotechn.unimall.admin.api.tourism.ICommonUserInfoService;
+import com.iotechn.unimall.core.util.GeneratorUtil;
 import org.apache.ibatis.session.RowBounds;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;

+ 4 - 0
unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/tourism/impl/FoodInfoServiceImpl.java

@@ -2,6 +2,7 @@ package com.iotechn.unimall.admin.api.tourism.impl;
 
 import java.util.List;
 
+import com.iotechn.unimall.app.api.user.UserService;
 import org.apache.ibatis.session.RowBounds;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -28,9 +29,12 @@ import org.springframework.transaction.annotation.Transactional;
 public class FoodInfoServiceImpl implements IFoodInfoService{
 	@Autowired
 	private FoodInfoMapper foodInfoMapper;
+	@Autowired
+	private UserService userService;
 	
 	@Override
 	public Boolean add(FoodInfo foodInfo) throws ServiceException {
+//		userService.checkVerifyCode(foodInfo.getContactsPhone(), foodInfo.getVerifyCode());
 		Date now = new Date();
 		foodInfo.setGmtCreate(now);
 		foodInfo.setGmtUpdate(now);

+ 4 - 0
unimall-app-api/src/main/java/com/iotechn/unimall/app/api/user/UserService.java

@@ -19,6 +19,10 @@ public interface UserService {
     @HttpMethod(description = "发送验证码到用户手机")
     public String sendVerifyCode(
             @NotNull @TextFormat(length = 11) @HttpParam(name = "phone", type = HttpParamType.COMMON, description = "用户手机号") String phone) throws ServiceException;
+    @HttpMethod(description = "验证码抽取校验")
+    public void checkVerifyCode(
+            @NotNull @TextFormat(length = 11) @HttpParam(name = "phone", type = HttpParamType.COMMON, description = "用户手机号") String phone,
+            @TextFormat(length = 6) @HttpParam(name = "phone", type = HttpParamType.COMMON, description = "验证码") String verifyCode) throws ServiceException;
 
     @HttpMethod(description = "用户注册")
     public String register(

+ 1 - 1
unimall-app-api/src/main/java/com/iotechn/unimall/app/api/user/UserServiceImpl.java

@@ -181,7 +181,7 @@ public class UserServiceImpl implements UserService {
      * @param verifyCode
      * @throws ServiceException
      */
-    private void checkVerifyCode(String phone, String verifyCode) throws ServiceException {
+    public void checkVerifyCode(String phone, String verifyCode) throws ServiceException {
         String raw = cacheComponent.getRaw(VERIFY_CODE_PREFIX + phone);
         if (StringUtils.isEmpty(raw)) {
             throw new AppServiceException(ExceptionDefinition.USER_VERIFY_CODE_NOT_EXIST);

+ 0 - 8
unimall-core/src/main/java/com/iotechn/unimall/core/exception/ExceptionDefinition.java

@@ -384,14 +384,6 @@ public class ExceptionDefinition {
     
     public static final ServiceExceptionDefinition TABLE_IMPORT_ERROR=
             new ServiceExceptionDefinition(53017, "导入表失败");
-    public static final ServiceExceptionDefinition CLASSIFY_REPEAT_ERROR =
-            new ServiceExceptionDefinition(53018, "分类名称重复");
-    public static final ServiceExceptionDefinition ACCEPT_CARD_ERROR =
-            new ServiceExceptionDefinition(53019, "接受失败,对方名片已删除");
-    public static final ServiceExceptionDefinition ALREADY_ADDED_ERROR =
-            new ServiceExceptionDefinition(53020, "已添加过改名片");
-    public static final ServiceExceptionDefinition ADD_ONESELF_ERROR =
-            new ServiceExceptionDefinition(53021, "不可添加自己的名片");
 
 
 

+ 10 - 2
unimall-data/src/main/java/com/iotechn/unimall/data/domain/FoodInfo.java

@@ -151,8 +151,16 @@ public class FoodInfo extends SuperDO{
     @Excel(name = "删除标识")
     @TableField("delete_flag")
     private Long deleteFlag;
-
-
+    /**
+     * 查询类型(1默认排序2距离最近3最多点赞4我的收藏)
+     */
+    @TableField(exist = false)
+    private String searchType;
+    /**
+     * 验证码
+     */
+    @TableField(exist = false)
+    private String verifyCode;
     @Override
     public String toString() {
         return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)