ZZ 1 mesiac pred
rodič
commit
ab9f4207f1

+ 9 - 0
mer_uniapp/api/home.js

@@ -9,6 +9,15 @@ export function getMerchantList(data)
   return request.get('index/merchant/list/10', data, { noAuth : true});
 }
 
+/**
+ * 获取首页门店列表-分页
+ *
+*/
+export function getMerchantSearchList(data)
+{
+  return request.get('merchant/search/list', data, { noAuth : true});
+}
+
 
 /**
  * 获取首页banner以及活动精选信息

+ 4 - 1
mer_uniapp/pages/index/index.vue

@@ -85,7 +85,7 @@
 				<view>
 					<image src="/static/img/img-hdjx.png" style="width: 298rpx;height: 44rpx;"></image>
 
-					<text class="goods-more" @tap="goSearch">更多 》</text>
+					<text class="goods-more" @tap="goGenDuo">更多 》</text>
 				</view>
 
 
@@ -291,6 +291,9 @@
 			goSearch() {
 				this.$util.navigateTo('/pages/goods/goods_search/index');
 			},
+			goGenDuo() {
+				this.$util.navigateTo('/pages/goods/goods_list/index');
+			},
 			//配送时间转换
 			convertMinutes(minutes) {
 				const mins = Number(minutes);

+ 3 - 3
mer_uniapp/pages/merchant/home/index.vue

@@ -65,7 +65,7 @@
 				<scroll-view style="height: 950rpx" class="menus" scroll-with-animation scroll-y>
 					<view class="wrapper">
 						<view class="menu" :id="`menu-${item.id}`" :class="{'current': item.id === currentCateId}" v-for="(item, index) in goods"
-						 :key="index" @tap="handleMenuTap(item.id)">
+						 :key="index" @tap="handleMenuTap(item.id)" v-if="item.childList.length">
 							<text>{{ item.name }}</text>
 							<view class="dot" v-show="menuCartNum(item.id)">{{ menuCartNum(item.id) }}</view>
 						</view>
@@ -79,9 +79,9 @@
 							<!-- category begin -->
 							<view style="font-weight: 400;font-size: 21rpx;color: #999999;text-align: center;margin-bottom: 19rpx;">————温馨提示:湿度选择,避免浪费
 								————</view>
-							<view class="category" v-for="(item, index) in goods" :key="index" :id="`cate-${item.id}`">
+							<view class="category" v-for="(item, index) in goods" :key="index" :id="`cate-${item.id}`" v-if="item.childList.length">
 								<view class="title">
-									<text>{{ item.name }}</text>
+									<text v-if="item.childList.length">{{ item.name }}</text>
 									<image :src="item.icon" class="icon"></image>
 								</view>
 								<view class="items">

+ 64 - 22
mer_uniapp/pages/merchant_search/index.vue

@@ -15,25 +15,25 @@
 					<view class='bnt flex-center' @tap='searchBut'>搜索</view>
 				</view>
 			</view>
-			<!-- #ifdef MP -->
-			<view class='title'>热门搜索</view>
-			<!-- #endif -->
-			<!-- #ifndef MP -->
-			<view class='title'>热门搜索</view>
-			<!-- #endif -->
-			<view class='list acea-row'>
-				<block v-for="(item,index) in hotSearchList" :key="index">
-					<view class='item' @tap='setHotSearchValue(item.title)'>{{item.title}}</view>
-				</block>
-			</view>
-			<view class='line'></view>
+			<scroll-view :scroll-x="true" scroll-with-animation style="white-space: nowrap;margin: 20rpx 0rpx;padding: 0 20rpx;">
+				<view :class="optionIndex == item.id ? 'active-option' : ''" style="color: #141414;display: inline-block;margin-right: 30rpx;width: 96rpx;"
+				 v-for="(item, index) in optionData" :key="index" @tap="onOptionClick(item)">
+					<view class="flex-col flex-center">
+						<image style="width: 100%;height: 96rpx;" :src="item.icon"></image>
+						<view style="font-size: 21rpx;margin-top: 10rpx;">{{item.name}}</view>
+					</view>
+				</view>
+			</scroll-view>
 		</view>
 		<view style="padding: 0 20rpx;flex: 1;overflow: hidden;" class="flex-col">
 			<!-- 销量排行 -->
 			<view class="tab-list" style="margin-top: 10rpx;">
 				<view :class=" item.checked ? 'tab-item2' : 'tab-item2-false' " v-for="item in labelList" :key="item.id" @click="item2Click(item)">{{item.label}}</view>
 			</view>
-
+			<view class="flex-center flex-col" v-if="noDataTip">
+				<image :src="urlDomain+'crmebimage/presets/noSearch.png'"></image>
+				<text class="no-data-tip">{{noDataTip}}</text>
+			</view>
 			<scroll-view scroll-y scroll-with-animation style="flex: 1;overflow: hidden;">
 				<view class="content-goods2" v-for="item in merchantList" :key="item.id" @click="merchantTab(item)">
 					<view>
@@ -70,6 +70,7 @@
 
 					</view>
 				</view>
+				<view class="flex-center no-data-tip" v-if="loadTitle">{{loadTitle}}</view>
 			</scroll-view>
 		</view>
 	</view>
@@ -92,9 +93,12 @@
 	import navBar from '@/components/navBar';
 	// #endif
 	import {
-		getMerchantList,
+		getMerchantSearchList,
 		getHomeInfo
 	} from '@/api/home.js';
+	import {
+		getProduct
+	} from '@/api/takeout.js';
 	let app = getApp();
 	export default {
 		components: {
@@ -104,6 +108,8 @@
 		},
 		data() {
 			return {
+				optionData: [],
+				optionIndex: 0,
 				winHeight: 0,
 				navTitle: '搜索外卖商家',
 				hostProduct: [],
@@ -112,6 +118,7 @@
 				bastList: [],
 				hotSearchList: [],
 				theme: app.globalData.theme,
+				page: 1,
 				labelList: [{
 					id: 1,
 					label: "销量排行",
@@ -129,7 +136,10 @@
 					label: "减配送费",
 					checked: false
 				}],
+				urlDomain: this.$Cache.get("imgHost"),
 				merchantList: [],
+				noDataTip: '',
+				loadTitle: '',
 				cateId: 0
 			};
 		},
@@ -151,19 +161,43 @@
 			if (e.searchVal) that.searchValue = e.searchVal;
 			e.navTitle ? that.navTitle = e.navTitle : ''
 			e.id ? that.cateId = e.id : ''
-			that.getMatchedData()
+			getProduct(that.cateId).then(res => {
+				const data = res.data;
+				// data[0].id = 0;
+				if (data.length !== 0) {
+					that.optionIndex = data[0].id;
+					data[0].name = '全部';
+					data[0].icon = '/static/img/quanbu.png';
+					that.optionData = data
+				}
+				that.getMatchedData()
+			})
 		},
 		methods: {
 			getMatchedData() {
-				getMerchantList({
+				getMerchantSearchList({
 					latitude: uni.getStorageSync('user_latitude'),
 					longitude: uni.getStorageSync('user_longitude'),
-					cateId: this.cateId
+					categoryIds: this.optionIndex || this.cateId,
+					keywords: this.searchValue,
+					page: this.page,
+					limit: 10
 				}).then(res => {
-					this.merchantList = res.data.list;
+					let list = res.data.list || [];
+					this.loadTitle = list.length !== 0 && list.length < 10 ? "我也是有底线的~" : '';
+					this.merchantList = this.$util.SplitArray(list, this.merchantList);
+					this.noDataTip = this.merchantList.length ? '' : ' 暂无外卖商家 ';
 					console.log('商品信息:', this.merchantList);
+					this.page += 1;
 				});
 			},
+			onOptionClick(item) {
+				if (this.optionIndex === item.id) return
+				this.page = 1;
+				this.merchantList = [];
+				this.optionIndex = item.id;
+				this.getMatchedData()
+			},
 			getRoutineHotSearch: function() {
 				let that = this;
 				getSearchKeyword().then(res => {
@@ -173,6 +207,7 @@
 			setHotSearchValue: function(event) {
 				this.$set(this, 'searchValue', event);
 				this.page = 1;
+				this.merchantList = [];
 				this.$set(this, 'bastList', []);
 				this.getMatchedData()
 				// uni.navigateTo({
@@ -190,13 +225,12 @@
 					val = e.detail.value
 				}
 				if (that.searchValue.length > 0 || val) {
+					this.page = 1;
+					this.merchantList = [];
 					this.getMatchedData()
-					// uni.navigateTo({
-					// 	url: `/pages/goods/goods_list/index?searchValue=${val?val:that.searchValue}`
-					// })
 				} else {
 					return this.$util.Tips({
-						title: '请输入要搜索的商品',
+						title: '请输入要搜索的外卖商家',
 						icon: 'none',
 						duration: 1000,
 						mask: true,
@@ -223,6 +257,10 @@
 		position: relative;
 	}
 
+	.no-data-tip {
+		color: #CCC;
+	}
+
 	page {
 		background-color: #f5f5f5 !important;
 	}
@@ -445,4 +483,8 @@
 		padding: 4rpx 16rpx;
 		margin-right: 20rpx;
 	}
+
+	.active-option {
+		color: $bg-color-primary !important;
+	}
 </style>

+ 40 - 11
mer_uniapp/pages/substitute_fast_mail/components/fast_mail_point/index.vue

@@ -4,16 +4,18 @@
 			<!-- #ifdef MP-->
 			<view class="mp-header" :style="{top: navH + 'rpx'}">
 				<view class=" flex-col flex-center" style="background-color: #fff;">
-					<view class="flex-y-center" style="justify-content: flex-end;padding: 10rpx 19rpx 38rpx 19rpx;width: 100%;">
+					<view class="flex-y-center" style="justify-content: space-between;padding: 10rpx 19rpx 38rpx 19rpx;width: 100%;">
+						<view style="opacity: 0;">1</view>
+						<view style="font-weight: 600;font-size: 27rpx;color: #141414;">选择快递点</view>
 						<image style="width: 39rpx;height: 39rpx;" src="/static/img/chacha.png" @tap="onCancel"></image>
 					</view>
-					<view class="flex-wrap flex-around-center" style="margin: 0 100rpx;gap: 20rpx;width: 100%;">
-						<radio-group @change="radioChange">
-							<label class="uni-list-cell uni-list-cell-pd" v-for="(item, index) in pointData" :key="item.value">
+					<view class="flex-wrap flex-around-center" style="padding-left: 39rpx;width: 100%;">
+						<radio-group @change="radioChange" style="flex: 1;">
+							<label class="uni-list-cell uni-list-cell-pd flex-center" v-for="(item, index) in pointData" :key="item.value">
 								<view>
-									<radio :value="item.isDefault" :checked="item.isDefault" />
+									<radio :value="item.id" :checked="item.isDefault" />
 								</view>
-								<view class="tip-box">{{item.name}}</view>
+								<view class="tip-box flex-1 flex-y-center" style="margin-left: 20rpx;">{{item.name}}</view>
 							</label>
 						</radio-group>
 						<!-- <view v-for="(item, index) in specsData" :key="index" style="flex: 1;" class="flex-center flex-col">
@@ -23,7 +25,10 @@
 							</view>
 						</view> -->
 					</view>
-					<button class="sub flex-center" @tap="onSure">确定</button>
+					<view class="flex-center" style="margin: 58rpx 0 96rpx 0;">
+						<button class="sub-default flex-center" @tap="onDefault">设为默认</button>
+						<button class="sub flex-center" @tap="onSure">确定</button>
+					</view>
 				</view>
 			</view>
 			<!-- #endif -->
@@ -79,7 +84,17 @@
 		},
 		methods: {
 			radioChange: function(evt) {
-				console.log(evt)
+				this.pointData.forEach(item => {
+					if (item.id == evt.detail.value) {
+						item.isDefault = true
+					} else {
+						item.isDefault = false
+					}
+				})
+			},
+			onDefault() {
+				const obj = this.pointData.find(item => item.isDefault)
+				console.log(obj)
 			},
 			onSure() {
 				const obj = this.pointData.find(item => item.isDefault)
@@ -125,11 +140,25 @@
 
 	.sub {
 		background-color: $bg-color-primary;
-		width: 308rpx;
-		height: 77rpx;
 		font-weight: 500;
 		font-size: 31rpx;
 		color: #FFFFFF;
-		margin: 58rpx 0 96rpx 0;
+		width: 308rpx;
+		height: 77rpx
+	}
+	
+	.sub-default {
+		background: #00BADB;
+		font-weight: 400;
+		font-size: 31rpx;
+		color: #FFFFFF;
+		width: 308rpx;
+		height: 77rpx;
+		margin-right: 39rpx;
+	}
+
+	.uni-list-cell {
+		border-bottom: 2rpx solid #D6D7DC;
+		padding-bottom: 15rpx;
 	}
 </style>

+ 2 - 2
mer_uniapp/pages/substitute_fast_mail/components/take_fast_mail/index.vue

@@ -24,10 +24,10 @@
 						</view>
 						<view class='iconfont icon-jiantou' style="font-size: 55rpx;margin-left: 29rpx;"></view>
 					</view>
-					<view class="flex-y-center flex-between-center" style="margin-bottom: 20rpx">
+					<view class="flex-y-center flex-between-center" style="margin-bottom: 20rpx" @tap="isPoint = true">
 						<view class="flex-y-center">
 							<image style="width: 135rpx; height: 135rpx;border-radius: 50%;" src="/static/img/ic-message.png"></image>
-							<view style="margin-left: 29rpx;" @tap="isPoint = true">
+							<view style="margin-left: 29rpx;">
 								<view class="send-name">到哪里取</view>
 								<view class="send-tips">请输入寄件人信息</view>
 								<view style="font-weight: 500;font-size: 23rpx;color: #FF6702;">可送单时间段00:00——17:00</view>

+ 19 - 7
mer_uniapp/pages/takeout/index.vue

@@ -8,8 +8,8 @@
 		<view class="navigationbar flex-center" :style="{ height: `${navigationBarHeight}px` }">
 			<view class="back-button" @tap="handBack()"></view>
 
-			<navigator url="/pages/merchant_search/index" class="input tui-skeleton-rect searchIpt flex-center" hover-class="none"><text
-				 class="iconfont icon-xiazai5"></text>
+			<navigator :url="`/pages/merchant_search/index?id=${takeoutId}`" class="input tui-skeleton-rect searchIpt flex-center"
+			 hover-class="none"><text class="iconfont icon-xiazai5"></text>
 				点击搜索外卖商家</navigator>
 		</view>
 		<!-- #endif -->
@@ -63,6 +63,11 @@
 				<view :class=" item.checked ? 'tab-item2' : 'tab-item2-false' " v-for="item in labelList" :key="item.id" @click="item2Click(item)">{{item.label}}</view>
 			</view>
 
+			<view class="flex-center flex-col" v-if="noDataTip">
+				<image :src="urlDomain+'crmebimage/presets/noSearch.png'"></image>
+				<text class="no-data-tip">{{noDataTip}}</text>
+			</view>
+
 			<scroll-view scroll-y scroll-with-animation style="flex: 1;overflow: hidden;">
 				<view class="content-goods2" v-for="item in merchantList" :key="item.id" @click="merchantTab(item)">
 					<view>
@@ -138,6 +143,8 @@
 				recommendObj: {},
 				optionData: [],
 				optionIndex: 0,
+				noDataTip: '',
+				urlDomain: this.$Cache.get("imgHost"),
 				labelList: [{
 					id: 1,
 					label: "销量排行",
@@ -171,19 +178,19 @@
 			});
 			getProduct(that.takeoutId).then(res => {
 				const data = res.data;
-				data[0].id = 0;
+				// data[0].id = 0;
 				data[0].name = '全部';
 				data[0].icon = '/static/img/quanbu.png';
-				that.optionIndex = 0;
+				that.optionIndex = data[0].id;
 				that.optionData = data || []
+				that.getMatchedData()
 				console.log(that.optionData, '12312321321312321321312312')
 			})
-			that.getMatchedData()
 
 			getTakeoutList({
 				latitude: uni.getStorageSync('user_latitude'),
 				longitude: uni.getStorageSync('user_longitude'),
-				cateId: that.optionIndex
+				cateId: that.takeoutId
 			}).then(recommendRes => {
 				that.recommendObj = recommendRes.data
 				console.log(that.recommendObj, '00000000000000000000000000')
@@ -208,13 +215,14 @@
 					cateId: this.optionIndex
 				}).then(res => {
 					this.merchantList = res.data.list;
+					this.noDataTip = this.merchantList.length ? '' : ' 暂无外卖商家 ';
 					console.log('商品信息:', this.merchantList);
 				});
 			},
 			onOptionClick(item) {
 				if (this.optionIndex === item.id) return
 				this.optionIndex = item.id;
-				getMatchedData()
+				this.getMatchedData()
 			},
 			merchantTab(item) {
 				let opitem = JSON.stringify(item)
@@ -239,6 +247,10 @@
 		justify-content: flex-start;
 	}
 
+	.no-data-tip {
+		color: #CCC;
+	}
+
 	.container {
 		overflow: hidden;
 		position: relative;