瀏覽代碼

8.12小程序搜索功能改版。

347617796@qq.com 4 年之前
父節點
當前提交
25c5efe2d5

+ 24 - 8
component/assess.vue

@@ -25,8 +25,8 @@
 					</view>
 				</view>
 				<view style="color: #303133;font-size: 28upx;" class="uni-comment-content">{{item.content}}</view>
-				<view v-for="(items, indexs) in item.img_list" :key="indexs"  >
-					<image  @click="gopicture(items)" style="float: left;width: 100upx;height: 100upx;padding-right:18upx;" :src="items"></image>
+				<view  class="flex-box flex-v-ce">
+					<image v-for="(items, indexs) in item.img_list" :key="indexs"  @click="gopicture(item.img_list)" :src="items" class="imgs"></image>
 				</view>
 			</view>
 		</view>
@@ -56,7 +56,6 @@
 		},
 		watch: {
 		'showpicture': function(val){
-			console.log(val)
 			if(val) {
 				this.ishow = true;
 			}else {
@@ -72,10 +71,23 @@
 			}
 		},
 		methods: {
-			gopicture(e,a) {
-				this.images = e;
-				this.ishow = true;
-				uni.$emit('changpicture')
+			gopicture(e) {
+				console.log(e);
+				uni.previewImage({
+					urls: e,
+					longPressActions: {
+						itemList: ['发送给朋友', '保存图片', '收藏'],
+						success: function(data) {
+							console.log('选中了第' + (data.tapIndex + 1) + '个按钮,第' + (data.index + 1) + '张图片');
+						},
+						fail: function(err) {
+							console.log(err.errMsg);
+						}
+					}
+				});
+				// this.images = e;
+				// this.ishow = true;
+				// uni.$emit('changpicture')
 			}
 			
 		},
@@ -83,5 +95,9 @@
 </script>
 
 <style>
-
+	.imgs{
+		width: 100upx;
+		height: 100upx;
+		margin-right: 10upx;
+	}
 </style>

+ 3 - 1
component/openpictrue.vue

@@ -49,7 +49,6 @@
 		},
 		watch: {
 			'show':function(val) {
-				console.log(val)
 				if(val) {
 					this.types = true;
 				}else {
@@ -71,6 +70,9 @@
 		// 		return true;
 		// 	}
 		// },
+		mounted() {
+			console.log(this.$props);
+		},
 		methods: {
 			// imageLoad() {
 			// 	console.log("999");

+ 14 - 3
pages/index/commemt.vue

@@ -25,7 +25,7 @@
 				</view>
 				<view style="color: #303133;font-size: 28upx;" class="uni-comment-content">{{item.geval_content}}</view>
 				<view>
-					<image  v-for="(items, indexs) in item.images" @click="shoupicture(items)"  :key="indexs" :src="items" 
+					<image  v-for="(items, indexs) in item.images" @click="shoupicture(item.images)"  :key="indexs" :src="items" 
 					style="width: 100upx;height: 100upx;float:left;padding-right: 20upx;"></image>
 				</view>
 			</view>
@@ -67,8 +67,19 @@
 		},
 		methods: {
 			shoupicture(e) {
-				this.images = e;
-				this.ishow = true;
+				uni.previewImage({
+					urls: e,
+					longPressActions: {
+						itemList: ['发送给朋友', '保存图片', '收藏'],
+						success: function(data) {
+							console.log('选中了第' + (data.tapIndex + 1) + '个按钮,第' + (data.index + 1) + '张图片');
+						},
+						fail: function(err) {
+							console.log(err.errMsg);
+						}
+					}
+				});
+				// this.ishow = true;
 			},
 			changeshow() {
 				this.ishow = false;

+ 699 - 717
pages/index/hotel.vue

@@ -1,742 +1,724 @@
 <template>
-    <view>
-	   <van-skeleton  :loading="loading">
-		<view class="home" v-if="isfx" @click="openHome()">
-			<image src="../../static/bottombtn0101.png"></image>
-		</view>   
-       <view style="height: 65upx;"></view>
-        <scroll-view  style="height: 95vh;" class="floor-list"
-         :scroll-top="scrollTop" scroll-y="true"  @scroll="scroll"  @scrolltoupper="upper" @scrolltolower="lower"
-         :refresher-enabled="false">
-		   <view class="scrollswiper">
-			   <swiper class="swiper" indicator-dots circular=true :autoplay="autoplay" :interval="interval" :duration="duration">
-				   <swiper-item v-for="(item,index) in store_slide" :key="index"> 
-					   <view style="height: 100%;" class="swiper-item">
-							<image style="height: 100%;width: 100%;" :src='item' />
-					   </view>
-				   </swiper-item>
-				</swiper>
-		   </view>
-       
-		   <view class="titeTop"  :class="iScrolltop == 2?'activeColor' : ''">
-			   <view @tap="goback()" class="topleft">
-				   <uniIcon type="back" size="22" color="#666666" />
-			   </view>
-			   <view @click="gotosearch">
-				   <view class="input-view">
-						<uniIcon type="search" size="22" color="#666666" />
-						<input confirm-type="search" class="input" type="text" placeholder="输入搜索关键词" @confirm="confirm" />
-				   </view>
-			   </view>
-		   </view>
-		   <view class="tip">
-			   <view style="font-size: 36upx;color: #303133;">{{hotelitle}}</view>
-			   <view >
-				   <van-icon name="star-o" @click="gocollect" v-if="has_collected == 0" size="22" />
-				   <van-icon name="star-o" @click="gocollect" v-if="has_collected == 1"  size="22" color= "#D9332E"/> 
-			   </view>
-		   </view>
-			<view v-if="store_summary" style="color: #666;padding: 0 32upx 10upx 32upx;">{{store_summary}}</view>
-		   <view>
-			  <van-tabs title-active-color="#D9332E" v-model="activeindex" @click.stop="onChange">
-				 <van-tab :name="0" title="服务项目">
+	<view>
+		<van-skeleton :loading="loading">
+			<view class="home" v-if="isfx" @click="openHome()"><image src="../../static/bottombtn0101.png"></image></view>
+			<view style="height: 65upx;"></view>
+			<scroll-view
+				style="height: 95vh;"
+				class="floor-list"
+				:scroll-top="scrollTop"
+				scroll-y="true"
+				@scroll="scroll"
+				@scrolltoupper="upper"
+				@scrolltolower="lower"
+				:refresher-enabled="false"
+			>
+				<view class="scrollswiper">
+					<swiper class="swiper" indicator-dots circular="true" :autoplay="autoplay" :interval="interval" :duration="duration">
+						<swiper-item v-for="(item, index) in store_slide" :key="index">
+							<view style="height: 100%;" class="swiper-item"><image style="height: 100%;width: 100%;" :src="item" /></view>
+						</swiper-item>
+					</swiper>
+				</view>
+
+				<view class="flex-box flex-v-ce search" :class="iScrolltop == 2 ? 'activeColor' : ''">
+					<view @tap="goback()" class="topleft"><uniIcon type="back" size="22" color="#666666" /></view>
+					<view @click="gotosearch">
+						<view class="input-view">
+							<uniIcon type="search" size="22" color="#666666" />
+							<input confirm-type="search" class="input" type="text" placeholder="输入搜索关键词" @confirm="confirm" />
+						</view>
+					</view>
+				</view>
+				<view class="tip">
+					<view style="font-size: 36upx;color: #303133;">{{ hotelitle }}</view>
 					<view>
-						  <view class="giveList">
-								  <view class="giveItem" v-for="(item,index) in category_list" :key="index" @click.stop="godetail(item)">
-									<image :src="item.pic" 
-									style="width:100%;height: 69%;">
-									</image>
-									<p style="text-align: center;font-size: 24rpx;">{{item.gc_name}}</p>
-								  </view>
-							  </view>
-						  
-						  <view style="padding: 0upx 18upx 20upx 18upx ;">
-							  <view style="width: 95%;margin: 0 auto;">
-									  <view @click.stop="choseType(1)" :class="tabIndex==1 ? 'active' : ''" class="typeItem">
-										  综合
-									  </view>
-									  <view@click.stop="choseType(2)"   class="typeItem">
-										<view class="iconClass">
-											<view :class="tabIndex==2 ? 'active' : ''">上新</view>
-											<view style="display: flex;flex-direction: column;margin-left: 10rpx;">
-												<view  v-if="istopclick==0">
-													<!-- <van-icon size="8px" name="arrow-up"    :class="istopclick==1 ? 'active' : ''"  /> -->
-													<img style="width: 36upx;height: 36upx;vertical-align: middle;" src='../../static/sort.png' />
-												</view>
-												<view  v-if="istopclick==1">
-													<!-- <van-icon size="8px" name="arrow-up"    :class="istopclick==1 ? 'active' : ''"  /> -->
-													<img style="width: 36upx;height: 36upx;vertical-align: middle;" src='../../static/sort_down.png' />
+						<van-icon name="star-o" @click="gocollect" v-if="has_collected == 0" size="22" />
+						<van-icon name="star-o" @click="gocollect" v-if="has_collected == 1" size="22" color="#D9332E" />
+					</view>
+				</view>
+				<view v-if="store_summary" style="color: #666;padding: 0 32upx 10upx 32upx;">{{ store_summary }}</view>
+				<view>
+					<van-tabs title-active-color="#D9332E" v-model="activeindex" @click.stop="onChange">
+						<van-tab :name="0" title="服务项目">
+							<view>
+								<view class="giveList">
+									<view class="giveItem" v-for="(item, index) in category_list" :key="index" @click.stop="godetail(item)">
+										<image :src="item.pic" style="width:100%;height: 69%;"></image>
+										<p style="text-align: center;font-size: 24rpx;">{{ item.gc_name }}</p>
+									</view>
+								</view>
+								<view style="padding: 0upx 18upx 20upx 18upx;">
+									<view style="width: 95%;margin: 0 auto;">
+										<view @click.stop="choseType(1)" :class="tabIndex == 1 ? 'active' : ''" class="typeItem">综合</view>
+										<view @click.stop="choseType(2)" class="typeItem">
+											<view class="iconClass">
+												<view :class="tabIndex == 2 ? 'active' : ''">上新</view>
+												<view style="display: flex;flex-direction: column;margin-left: 10rpx;">
+													<view v-if="istopclick == 0">
+														<image style="width: 36upx;height: 36upx;vertical-align: middle;" src="../../static/sort.png"></image>
+													</view>
+													<view v-if="istopclick == 1">
+														<image style="width: 36upx;height: 36upx;vertical-align: middle;" src="../../static/sort_down.png"></image>
+													</view>
+													<view v-if="istopclick == 2">
+														<image style="width: 36upx;height: 36upx;vertical-align: middle;" src="../../static/sort_up.png"></image>
+													</view>
 												</view>
-												<view  v-if="istopclick==2">
-													<!-- <van-icon  :class="istopclick==2 ? 'active' : ''"  size="8px" name="arrow-down" /> -->
-													<img style="width: 36upx;height: 36upx;vertical-align: middle;"  src='../../static/sort_up.png' />
+											</view>
+										</view>
+										<view @click.stop="choseType(3)" class="typeItem">
+											<view class="iconClass">
+												<view :class="tabIndex == 3 ? 'active' : ''">价格</view>
+												<view style="display: flex;flex-direction: column;margin-left: 10rpx;">
+													<view v-if="isprice == 0">
+														<image style="width: 36upx;height: 36upx;vertical-align: middle;" src="../../static/sort.png"></image>
+													</view>
+													<view v-if="isprice == 3">
+														<image style="width: 36upx;height: 36upx;vertical-align: middle;" src="../../static/sort_down.png"></image>
+													</view>
+													<view v-if="isprice == 4">
+														<image style="width: 36upx;height: 36upx;vertical-align: middle;" src="../../static/sort_up.png"></image>
+													</view>
 												</view>
 											</view>
 										</view>
-									  </view>
-									  <view @click.stop="choseType(3)"  class="typeItem">
-										  <view class="iconClass">
-											  <view :class="tabIndex==3 ? 'active' : ''">价格</view>
-											  <view style="display: flex;flex-direction: column;margin-left: 10rpx;">
-												 <view v-if="isprice==0">
-													<img style="width: 36upx;height: 36upx;vertical-align: middle;" src='../../static/sort.png' />
-												 </view>
-												 <view  v-if="isprice==3">
-													<img style="width: 36upx;height: 36upx;vertical-align: middle;" src='../../static/sort_down.png' />
-												 </view>
-												 <view  v-if="isprice==4">
-													<img style="width: 36upx;height: 36upx;vertical-align: middle;"  src='../../static/sort_up.png' />
-												 </view>
-												 
-											  </view>
-										  </view>
-									  </view>
-									  <view  @click.stop="choseType(4)" class="typeItem">
-											<view :class="ishowpull ? 'active' : ''">分类
-												<img v-if="!ishowpull" style="width: 36upx;height: 36upx;" src='../../static/sortb.png' />
-												<img v-if="ishowpull" style="width: 36upx;height: 36upx;" src='../../static/sortb_up.png' />
+										<view @click.stop="choseType(4)" class="typeItem">
+											<view :class="ishowpull ? 'active' : ''">
+												分类
+												<image v-if="!ishowpull" style="width: 36upx;height: 36upx;" src="../../static/sortb.png"></image>
+												<image v-if="ishowpull" style="width: 36upx;height: 36upx;" src="../../static/sortb_up.png"></image>
 											</view>
-									  </view>
-								  </view>
-						  </view>
-						  <view v-if="ishowpull" style="display: flex;flex-wrap: wrap;padding: 10upx  12upx;">
-								  <view class="spacedance"
-								   v-for="(item, index) in classify" :key="index"
-									 @click.stop="confirm(item)" >
-									 {{item.gc_name}}
-								  </view> 
-						  </view>
-						 <!-- 商品列表 -->
-						 <shopList :goodId="goodId" :productList="goods_list" />
-						 <view v-if="isDetail==1"  class="fontcenter">加载中...</view>
-						 <view v-if="isDetail==2" class="fontcenter">暂无更多商品</view>
-					 </view> 
-					 </van-tab>
-					<van-tab  :name="1" :title="'评价' +'  '+feedback_count">
-						<!-- 评价列表 -->
-						<assess :feedback_list="feedback_list" :showpicture="showpicture" />
-					</van-tab>
-					<van-tab  :name="2" title="酒店信息">
-						<view style="padding: 20upx 32upx 0upx 32upx;margin-bottom: 200upx;">
-							  <view style="padding-bottom: 10upx;">商家信息</view>
-							  <rich-text :nodes="store_description"></rich-text> 
-							  <view class="newadress">
-								  <view>酒店地址</view>
-								  <view v-if="storeinformation.store_address!='' ">{{storeinformation.store_address}}</view>
-								   <view v-else>暂无</view>
-							  </view>
-							  <view class="newadress">
-								  <view>联系酒店</view>
-								  <view v-if="storeinformation.store_phone!='' ">{{storeinformation.store_phone}}</view>
-								  <view v-else>暂无</view>
-							  </view>
-						</view>
-				   </van-tab>
-				   
-			   </van-tabs>
-		   </view>
-		   
-		   </scroll-view>
-		   <view v-if="activeindex == 2" class="bottomButton">
-				 <button type="warn" @click="gofeedback">您的入住意见反馈(反馈送圈币)</button>
-			</view>
-		   <Gobacktop @getop="getop" v-if="isTop" />
-	   </van-skeleton>
+										</view>
+									</view>
+								</view>
+								<view v-if="ishowpull" style="display: flex;flex-wrap: wrap;padding: 10upx  12upx;">
+									<view class="spacedance" v-for="(item, index) in classify" :key="index" @click.stop="confirm(item)">{{ item.gc_name }}</view>
+								</view>
+								<!-- 商品列表 -->
+								<shopList :goodId="goodId" :productList="goods_list" />
+								<view v-if="isDetail == 1" class="fontcenter">加载中...</view>
+								<view v-if="isDetail == 2" class="fontcenter">暂无更多商品</view>
+							</view>
+						</van-tab>
+						<van-tab :name="1" :title="'评价' + '  ' + feedback_count">
+							<!-- 评价列表 -->
+							<assess :feedback_list="feedback_list" :showpicture="showpicture" />
+						</van-tab>
+						<van-tab :name="2" title="酒店信息">
+							<view style="padding: 20upx 32upx 0upx 32upx;margin-bottom: 200upx;">
+								<view style="padding-bottom: 10upx;">商家信息</view>
+								<rich-text :nodes="store_description"></rich-text>
+								<view class="newadress">
+									<view>酒店地址</view>
+									<view v-if="storeinformation.store_address != ''">{{ storeinformation.store_address }}</view>
+									<view v-else>暂无</view>
+								</view>
+								<view class="newadress">
+									<view>联系酒店</view>
+									<view v-if="storeinformation.store_phone != ''">{{ storeinformation.store_phone }}</view>
+									<view v-else>暂无</view>
+								</view>
+							</view>
+						</van-tab>
+					</van-tabs>
+				</view>
+			</scroll-view>
+			<view v-if="activeindex == 2" class="bottomButton"><button type="warn" @click="gofeedback">您的入住意见反馈(反馈送圈币)</button></view>
+			<Gobacktop @getop="getop" v-if="isTop" />
+		</van-skeleton>
 	</view>
 </template>
-  
+
 <script>
-	import {
-		mapMutations,mapState
-	} from 'vuex'
-    import uniIcon from '@/component/uni-icon/uni-icon.vue'
-    import uniNavBar from '@/component/uni-nav-bar/uni-nav-bar.vue'
-    import commoNar from '@/component/commoNar.vue'  // 筛选栏
-    import shopList from '@/component/shopList.vue'  // 商品列表
-    import assess from '@/component/assess.vue'  // 评价列表
-	import Gobacktop from '@/component/Gobacktop.vue'
-    export default { 
-        components: {
-            uniIcon,
-            uniNavBar,
-            commoNar,
-            assess,
-            shopList,
-			Gobacktop
-        },
-        data() {
-            return {
-				isfx:false,
-				firstloading: 0,
-				showpicture: false,
-				loading: true,
-				storeinformation: {},
-				isTop: 0,
-				feedback_count: 0,
-				hoteldetail: {},
-				has_collected: 0, // 收藏酒店
-				chosegoods_commonid: true,
-				chosegoods_price: true,
-				firstwo: 1,
-				isDetail: 1,
-				pictureUrl: this.pictureUrl,
-				showdialog: false,
-				store_description: '', //酒店信息
-				store_summary:'', // 标签
-				store_slide: [], //banner
-				goods_list:[], // 首页酒店商品列表
-				isnexttwo: 1,
-				feedback_list:[], // 评价列表
-				hotelitle: '', // 酒店名称
-				istopclick: 0,
-				page: 1,
-				goodId: 0,
-				page_size: 10,
-				gc_id_1:'',//	一级分类id
-				gc_id_2:'',//	二级分类id
-				goods_commonid:'',//	上新排序 desc-降序 asc-尚需
-				goods_price	:'',//	价格排序 desc-降序 asc-尚需
-				praise	:'',//	好评率排序 desc-降序 asc-尚需
-				keyword:'',//g	关键字搜索
-				category_list: [{gc_id_1:'',gc_name:'全部'}], // 一级菜单栏
-                tabIndex: 1,
-				isprice:0,
-                menu: [{
-                    name: '综合',
-                    id: '0'
-                }, {
-                    name: '上新',
-                    id: '1'
-                }, {
-                    name: '价格',
-                    id: '2'
-                },
-                {
-                    name:'分类',
-                    id:'3'
-                }],
-				ishowpull: false,
-				classify: [],
-                background: ['color1', 'color2', 'color3'],
-                indicatorDots: true,
-                autoplay: true,
-                interval: 2000,
-                duration: 500,
-                activeindex: 0,
-                scrollTop: 0,
-                old: { scrollTop: 0},
-				value1: 0,
-				iScrolltop: 1,	
-            }
-        },
-        onShareAppMessage(res) {
-        	uni.showShareMenu({
-        	     withShareTicket: true  
-        	});  
-        	let that = this;
-        	let id = this.goodId;  // 酒店id
-        	if (res.from === 'button') {
-              // 来自页面内分享按钮
-        	}
-        	return {
-        		title: that.hotelitle,
-        		path: `/pages/index/hotel?id=${id}`,
-        		imageUrl:that.store_slide[0] 
-        	}
-        },
-        // 初次渲染进来关闭分享菜单栏
-        onReady:function(){
-        
-        },
-		onLoad(options){
-			if(options.isfx){
-				this.isfx=true;
-			}else{
-				this.isfx=false;
+import { mapMutations, mapState } from 'vuex';
+import uniIcon from '@/component/uni-icon/uni-icon.vue';
+import uniNavBar from '@/component/uni-nav-bar/uni-nav-bar.vue';
+import commoNar from '@/component/commoNar.vue'; // 筛选栏
+import shopList from '@/component/shopList.vue'; // 商品列表
+import assess from '@/component/assess.vue'; // 评价列表
+import Gobacktop from '@/component/Gobacktop.vue';
+export default {
+	components: {
+		uniIcon,
+		uniNavBar,
+		commoNar,
+		assess,
+		shopList,
+		Gobacktop
+	},
+	data() {
+		return {
+			isfx: false,
+			firstloading: 0,
+			showpicture: false,
+			loading: true,
+			storeinformation: {},
+			isTop: 0,
+			feedback_count: 0,
+			hoteldetail: {},
+			has_collected: 0, // 收藏酒店
+			chosegoods_commonid: true,
+			chosegoods_price: true,
+			firstwo: 1,
+			isDetail: 1,
+			pictureUrl: this.pictureUrl,
+			showdialog: false,
+			store_description: '', //酒店信息
+			store_summary: '', // 标签
+			store_slide: [], //banner
+			goods_list: [], // 首页酒店商品列表
+			isnexttwo: 1,
+			feedback_list: [], // 评价列表
+			hotelitle: '', // 酒店名称
+			istopclick: 0,
+			page: 1,
+			goodId: 0,
+			page_size: 10,
+			gc_id_1: '', //	一级分类id
+			gc_id_2: '', //	二级分类id
+			goods_commonid: '', //	上新排序 desc-降序 asc-尚需
+			goods_price: '', //	价格排序 desc-降序 asc-尚需
+			praise: '', //	好评率排序 desc-降序 asc-尚需
+			keyword: '', //g	关键字搜索
+			category_list: [{ gc_id_1: '', gc_name: '全部' }], // 一级菜单栏
+			tabIndex: 1,
+			isprice: 0,
+			menu: [
+				{
+					name: '综合',
+					id: '0'
+				},
+				{
+					name: '上新',
+					id: '1'
+				},
+				{
+					name: '价格',
+					id: '2'
+				},
+				{
+					name: '分类',
+					id: '3'
+				}
+			],
+			ishowpull: false,
+			classify: [],
+			background: ['color1', 'color2', 'color3'],
+			indicatorDots: true,
+			autoplay: true,
+			interval: 2000,
+			duration: 500,
+			activeindex: 0,
+			scrollTop: 0,
+			old: { scrollTop: 0 },
+			value1: 0,
+			iScrolltop: 1
+		};
+	},
+	onShareAppMessage(res) {
+		uni.showShareMenu({
+			withShareTicket: true
+		});
+		let that = this;
+		let id = this.goodId; // 酒店id
+		if (res.from === 'button') {
+			// 来自页面内分享按钮
+		}
+		return {
+			title: that.hotelitle,
+			path: `/pages/index/hotel?id=${id}`,
+			imageUrl: that.store_slide[0]
+		};
+	},
+	// 初次渲染进来关闭分享菜单栏
+	onReady: function() {},
+	onLoad(options) {
+		if (options.q) {
+			var str = decodeURIComponent(options.q);
+			var num = str.indexOf('=');
+			var id = str.slice(num + 1);
+			this.goodId = id; // 商品和酒店Id
+		} else {
+			this.goodId = options.id; // 商品和酒店Id
+		}
+
+		if (options.isfx) {
+			this.isfx = true;
+		} else {
+			this.isfx = false;
+		}
+		this.activeindex = 0;
+		this.getshopdetail(); // 获取商品详情
+		this.hotelmenu(); // 一级菜单
+		this.gethoteil(); // 获取酒店信息
+		uni.$on('changshow', e => {
+			this.changeshow();
+		});
+		uni.$on('changpicture', e => {
+			this.changimg();
+		});
+	},
+	computed: {
+		...mapState(['hasLogin', 'userInfo', 'successlogion'])
+	},
+	methods: {
+		changeshow() {
+			this.showpicture = false;
+		},
+		changimg() {
+			this.showpicture = true;
+		},
+		getop() {
+			this.scrollTop = this.old.scrollTop;
+			this.$nextTick(function() {
+				this.scrollTop = 0;
+			});
+			this.isTop = false;
+		},
+		// 入住酒店反馈
+		gofeedback() {
+			if (this.hoteldetail.can_feedback == 0) {
+				this.$msg(this.hoteldetail.feedback_msg);
+				return;
 			}
-			this.goodId = options.id;  // 商品和酒店Id
-			this.activeindex = 0;
-			this.getshopdetail(); // 获取商品详情
-			this.hotelmenu();  // 一级菜单
-			this.gethoteil();  // 获取酒店信息
-			uni.$on('changshow', (e) => {
-				this.changeshow();			
-			})
-			uni.$on('changpicture', (e) => {
-				this.changimg();			
-			})
-			
-			
-			
+			let store_id = this.goodId;
+			uni.navigateTo({
+				url: `/pages/index/feedback?store_id=${store_id}`
+			});
 		},
-		computed:{
-			...mapState([
-			  'hasLogin',
-			  'userInfo',
-			  'successlogion'
-			]),
+		// 搜说
+		gotosearch() {
+			let store_id = this.goodId;
+			uni.navigateTo({
+				url: `/pages/index/hotelsearch?store_id=${store_id}`
+			});
 		},
-        methods: {
-			changeshow() {
-				this.showpicture = false;
-			},
-			changimg() {
-				this.showpicture = true;
-			},
-			getop() {
-				this.scrollTop = this.old.scrollTop
-                this.$nextTick(function(){
-                    this.scrollTop=0;
-                });
-				this.isTop = false;
-			},
-			// 入住酒店反馈
-			gofeedback() {
-				if(this.hoteldetail.can_feedback == 0) {
-					this.$msg(this.hoteldetail.feedback_msg);
-					return;
-				}
-				let store_id = this.goodId;
-				uni.navigateTo({
-				        url: `/pages/index/feedback?store_id=${store_id}`
-				    });
-			},
-			// 搜说
-			gotosearch() {
-				let store_id = this.goodId;
-				uni.navigateTo({
-				        url: `/pages/index/hotelsearch?store_id=${store_id}`
-				    });
-			},
-			// 收藏
-			gocollect() {
-				if(this.hasLogin && this.successlogion) {
-				 this.request({
-				 	url: '/v1/favorites/collect',
-				 	method: 'post',
-				 	data: {
-				 		type:'store',
-				 		fav_id: this.goodId
-				 	},
-				 	success: (res) => {
-						if(res.data.data.action == 'add') {
-							this.$msg("收藏成功")
-						}else {
-							this.$msg("取消收藏")
+		// 收藏
+		gocollect() {
+			if (this.hasLogin && this.successlogion) {
+				this.request({
+					url: '/v1/favorites/collect',
+					method: 'post',
+					data: {
+						type: 'store',
+						fav_id: this.goodId
+					},
+					success: res => {
+						if (res.data.data.action == 'add') {
+							this.$msg('收藏成功');
+						} else {
+							this.$msg('取消收藏');
 						}
-				 		this.gethoteil()
-				 	}
-				 })
-				}else {
-					// this.showdialog = true;
-					uni.navigateTo({
-						url:'/pages/myCenter/logion'
-					})
-				}
-			},
-			choseType(e) {
-			    this.tabIndex = e;
-				this.isDetail = 1;
-				this.page = 1;
-				if(this.tabIndex == 1) {  // 服务
-					this.istopclick = 0;
-					this.isprice = 0;
-					this.gc_id_1 = '';
-					this.goods_price = ''; 
-					this.goods_commonid = '';
-					this.getshopdetail(2);
-				}else if(this.tabIndex == 2){ //伤
-				        this.chosegoods_price = true;
-						this.istopclick = this.chosegoods_commonid?1:2;
-						this.isprice = 0;
-						this.goods_price = ''; 
-						this.goods_commonid = this.chosegoods_commonid?'asc':'desc';
-						this.chosegoods_commonid = !this.chosegoods_commonid;
-						this.getshopdetail(2);
-				}else if(this.tabIndex == 3){ // 价格
-						this.chosegoods_commonid = true;
-						this.istopclick = 0;
-						this.isprice = this.chosegoods_price?3:4;
-						this.goods_price = this.chosegoods_price?'desc':'asc';
-						this.goods_commonid = '';
-						this.chosegoods_price = !this.chosegoods_price;
-						this.getshopdetail(2);
-					}else if(this.tabIndex ==4) {  // 分类
-					    this.ishowpull = !this.ishowpull;
-						this.istopclick = 0;
-						this.isprice = 0;
-						this.goods_price = ''; 
-						this.goods_commonid = '';
-						this.chosegoods_price = true;
-						this.chosegoods_commonid = true;
+						this.gethoteil();
 					}
-			},
-			// 点击切换上下
-			changeisclick(e) {
-				
-			},
-			openHome(){
-				uni.switchTab({
-					url: `/pages/index/index`
-				})
-			},
-			godetail(item) {
-				let id = item.gc_id; // 一级菜单id
-				let store_id = this.goodId;
-				let gc_name = item.gc_name; 
+				});
+			} else {
+				// this.showdialog = true;
 				uni.navigateTo({
-				        url: `/pages/index/hoteldetail?id=${id}&gc_name=${gc_name}&store_id=${store_id}`
-				    });
-			},
+					url: '/pages/myCenter/logion'
+				});
+			}
+		},
+		choseType(e) {
+			this.tabIndex = e;
+			this.isDetail = 1;
+			this.page = 1;
+			if (this.tabIndex == 1) {
+				// 服务
+				this.istopclick = 0;
+				this.isprice = 0;
+				this.gc_id_1 = '';
+				this.goods_price = '';
+				this.goods_commonid = '';
+				this.getshopdetail(2);
+			} else if (this.tabIndex == 2) {
+				//伤
+				this.chosegoods_price = true;
+				this.istopclick = this.chosegoods_commonid ? 1 : 2;
+				this.isprice = 0;
+				this.goods_price = '';
+				this.goods_commonid = this.chosegoods_commonid ? 'asc' : 'desc';
+				this.chosegoods_commonid = !this.chosegoods_commonid;
+				this.getshopdetail(2);
+			} else if (this.tabIndex == 3) {
+				// 价格
+				this.chosegoods_commonid = true;
+				this.istopclick = 0;
+				this.isprice = this.chosegoods_price ? 3 : 4;
+				this.goods_price = this.chosegoods_price ? 'desc' : 'asc';
+				this.goods_commonid = '';
+				this.chosegoods_price = !this.chosegoods_price;
+				this.getshopdetail(2);
+			} else if (this.tabIndex == 4) {
+				// 分类
+				this.ishowpull = !this.ishowpull;
+				this.istopclick = 0;
+				this.isprice = 0;
+				this.goods_price = '';
+				this.goods_commonid = '';
+				this.chosegoods_price = true;
+				this.chosegoods_commonid = true;
+			}
+		},
+		// 点击切换上下
+		changeisclick(e) {},
+		openHome() {
+			uni.switchTab({
+				url: `/pages/index/index`
+			});
+		},
+		godetail(item) {
+			let id = item.gc_id; // 一级菜单id
+			let store_id = this.goodId;
+			let gc_name = item.gc_name;
+			uni.navigateTo({
+				url: `/pages/index/hoteldetail?id=${id}&gc_name=${gc_name}&store_id=${store_id}`
+			});
+		},
 
-			// 获取商品详情
-			getshopdetail(e) {
-				this.request({
-	                url:"/v2/entry/storeGoods",
-	                method:'get',
-					data: {
-							 store_id: this.goodId,
-							 page: this.page,
-							 goods_commonid: this.goods_commonid, // 上新排序
-							 goods_price: this.goods_price,
-							 gc_id_1: this.gc_id_1
-						},
-					success: (res) => {
-						// uni.hideLoading()
-						if(this.firstloading == 0) {
-							this.loading = false;
-						}
-						this.firstloading = 1;
-						if(e == 2) {
-							this.goods_list = [];
-						}
-						this.goods_list = this.goods_list.concat(res.data.data.goods_list);
-						if(res.data.data.goods_list.length < 10) {
-							this.isDetail = 2;
-						}
-						
-					},
-			    })
-			},
-			// 一级菜单
-			hotelmenu() {
-				let _this = this;
-				this.request({
-	                url:"/v1/entry/storeCategory",
-	                method:'get',
-					data: {
-							store_id: this.goodId,
-						},
-					success: function(res) {
-						 let { category_list } = res.data.data;
-						 category_list.forEach((item,idx) => {
-							 item.text = item.gc_name;
-							 item.value = idx;
-						 })
-						 let array = [{gc_id:'',gc_name:'全部'}];
-						 _this.classify =  array.concat(category_list);
-						 _this.category_list = category_list.splice(0,10);
-					},
-				})
-			},
-		
-            onChange(event) {
-                    this.activeindex = event.detail.name;
-					this.page = 1;
-                    if(event.detail.name == 1) {
-						this.getcomment();
-					}else if(event.detail.name == 0) {
-						this.getshopdetail()
+		// 获取商品详情
+		getshopdetail(e) {
+			this.request({
+				url: '/v2/entry/storeGoods',
+				method: 'get',
+				data: {
+					store_id: this.goodId,
+					page: this.page,
+					goods_commonid: this.goods_commonid, // 上新排序
+					goods_price: this.goods_price,
+					gc_id_1: this.gc_id_1
+				},
+				success: res => {
+					// uni.hideLoading()
+					if (this.firstloading == 0) {
+						this.loading = false;
 					}
-            },
-			// 获取酒店评价
-			getcomment() {
-				this.request({
-					url:'/v1/store/feedbackList',
-					method: 'POST',
-					data: {
-						page: this.page,
-						page_size: 10,
-						store_id: this.goodId
-					},
-					success: (res) => {
-						this.feedback_list = res.data.data.feedback_list;
-						if(res.data.data.feedback_list.length < 10) {
-							this.isnexttwo = 2;
-						}
-						if(this.firstloading == 0) {
-							this.loading = false;
-						}
-						this.firstloading = 1;
+					this.firstloading = 1;
+					if (e == 2) {
+						this.goods_list = [];
 					}
-				})
-			},
-			// 获取酒店信息
-            gethoteil() {
-				this.request({
-					url:'/v1/store/info',
-					method:'get',
-					data: {
-						store_id: this.goodId
-					},
-					success: (res) => {
-						if(this.firstloading == 0) {
-							this.loading = false;
-						}
-						this.firstloading = 1;
-						let { data } = res.data;
-						this.store_slide = [];
-						this.hoteldetail = data;
-						this.feedback_count = data.feedback_count;
-						this.hotelitle = data.store_name;
-						data.store_slide.forEach(item => {
-							if(item.indexOf('jpg')!= -1) {
-								this.store_slide.push(item);
-							}
-						})
-						let src= this.pictureUrl+'/uploads/home/store/'+data.store_id+'/'+data.store_banner;
-						if(this.store_slide.length == 0) {
-							this.store_slide.push(src);
-						}
-						this.storeinformation = data;
-						this.store_summary = data.store_summary;
-						const regex = new RegExp('<img', 'gi');
-						if(data.store_description){
-							data.store_description = data.store_description.replace(regex, `<img style="width: 100%;height: auto!important;display: block;text-align: center;"`);
-							this.store_description = data.store_description;
+					this.goods_list = this.goods_list.concat(res.data.data.goods_list);
+					if (res.data.data.goods_list.length < 10) {
+						this.isDetail = 2;
+					}
+				}
+			});
+		},
+		// 一级菜单
+		hotelmenu() {
+			let _this = this;
+			this.request({
+				url: '/v1/entry/storeCategory',
+				method: 'get',
+				data: {
+					store_id: this.goodId
+				},
+				success: function(res) {
+					let { category_list } = res.data.data;
+					category_list.forEach((item, idx) => {
+						item.text = item.gc_name;
+						item.value = idx;
+					});
+					let array = [{ gc_id: '', gc_name: '全部' }];
+					_this.classify = array.concat(category_list);
+					_this.category_list = category_list.splice(0, 10);
+				}
+			});
+		},
+
+		onChange(event) {
+			this.activeindex = event.detail.name;
+			this.page = 1;
+			if (event.detail.name == 1) {
+				this.getcomment();
+			} else if (event.detail.name == 0) {
+				this.getshopdetail();
+			}
+		},
+		// 获取酒店评价
+		getcomment() {
+			this.request({
+				url: '/v1/store/feedbackList',
+				method: 'POST',
+				data: {
+					page: this.page,
+					page_size: 10,
+					store_id: this.goodId
+				},
+				success: res => {
+					this.feedback_list = res.data.data.feedback_list;
+					if (res.data.data.feedback_list.length < 10) {
+						this.isnexttwo = 2;
+					}
+					if (this.firstloading == 0) {
+						this.loading = false;
+					}
+					this.firstloading = 1;
+				}
+			});
+		},
+		// 获取酒店信息
+		gethoteil() {
+			this.request({
+				url: '/v1/store/info',
+				method: 'get',
+				data: {
+					store_id: this.goodId
+				},
+				success: res => {
+					if (this.firstloading == 0) {
+						this.loading = false;
+					}
+					this.firstloading = 1;
+					let { data } = res.data;
+					this.store_slide = [];
+					this.hoteldetail = data;
+					this.feedback_count = data.feedback_count;
+					this.hotelitle = data.store_name;
+					data.store_slide.forEach(item => {
+						if (item.indexOf('jpg') != -1) {
+							this.store_slide.push(item);
 						}
-						this.has_collected = data.has_collected; // 是否收藏
-						
+					});
+					let src = this.pictureUrl + '/uploads/home/store/' + data.store_id + '/' + data.store_banner;
+					if (this.store_slide.length == 0) {
+						this.store_slide.push(src);
 					}
-				})
-			},
-			
-		
-			changemenu(e) {
-				
-			},
-            confirm(e) {
-				this.tabIndex = 0;
-				this.ishowpull = false;
-				this.gc_id_1 = e.gc_id;
-				this.getshopdetail(2);
-            },
-            upper(e) {
-               
-            },
-            
-            // 滚到底部
-            lower(e) {
-					if(this.isnexttwo == 1 && this.activeindex == 1) {
-						this.page = this.page + 1;
-					this.getcomment();
-				}else if( this.isDetail == 1) {
-					this.page = this.page + 1;
-					this.getshopdetail();
+					this.storeinformation = data;
+					this.store_summary = data.store_summary;
+					const regex = new RegExp('<img', 'gi');
+					if (data.store_description) {
+						data.store_description = data.store_description.replace(regex, `<img style="width: 100%;height: auto!important;display: block;text-align: center;"`);
+						this.store_description = data.store_description;
+					}
+					this.has_collected = data.has_collected; // 是否收藏
 				}
-            },
-            
-            // 滚动时触发
-            scroll(e) {
-				   if(e.detail.scrollTop > 400) {
-					this.isTop = true;
-				   }else{ //当距离小于500时显示回到顶部按钮
-					this.isTop = false;
-				   }
-                if(e.detail.scrollTop > 160) {
-                    this.iScrolltop = 2;
-                }else {
-                    this.iScrolltop = 1;
-                }
-				this.old.scrollTop = e.detail.scrollTop
-            },
-            
-            // 返回上一页
-            goback() {
-                uni.navigateBack()
-            },
-            
-        }
-    }
+			});
+		},
+
+		changemenu(e) {},
+		confirm(e) {
+			this.tabIndex = 0;
+			this.ishowpull = false;
+			this.gc_id_1 = e.gc_id;
+			this.getshopdetail(2);
+		},
+		upper(e) {},
+
+		// 滚到底部
+		lower(e) {
+			if (this.isnexttwo == 1 && this.activeindex == 1) {
+				this.page = this.page + 1;
+				this.getcomment();
+			} else if (this.isDetail == 1) {
+				this.page = this.page + 1;
+				this.getshopdetail();
+			}
+		},
+
+		// 滚动时触发
+		scroll(e) {
+			if (e.detail.scrollTop > 400) {
+				this.isTop = true;
+			} else {
+				//当距离小于500时显示回到顶部按钮
+				this.isTop = false;
+			}
+			if (e.detail.scrollTop > 160) {
+				this.iScrolltop = 2;
+			} else {
+				this.iScrolltop = 1;
+			}
+			this.old.scrollTop = e.detail.scrollTop;
+		},
+
+		// 返回上一页
+		goback() {
+			this.openHome();
+			// uni.navigateBack()
+		}
+	}
+};
 </script>
-  
+
 <style scoped>
-	.home{
-		position: absolute;
-		width: 60upx;
-		height: 60upx;
-		background-color: #fff;
-		border-radius: 50%;
-		box-shadow: 0 0 3upx #333333;
-		text-align: center;
-		top: 100upx;
-		z-index: 999;
-		left: 0;
-	}
-	.home image{
-		width: 40upx;
-		height: 40upx;
-		padding-top: 8rpx;
-	}
-	.van-tab--active {
-		color: #D9332E!important; 
-	}
-	.newadress {
-		display: flex;
-		justify-content: space-between;
-		border-bottom: 1px solid #F5F5F5;
-		padding: 15upx 0;
-	}
-	.changfecolor {
-		color: green; 
-	}
-    .scrollswiper {
-        width: 100%;
-        position: relative;
-    }
-    .titleFixed {
-        position: absolute;
-        top: 0;
-        left: 0;
-        z-index: 99;
-        padding-top: 0;
-    }
-        
-    .van-nav-bar {
-        padding-top: 0!important;
-        /* background: #000000!important; */
-        /* opacity: 0.2; */
-        background:rgba(0,0,0,0.2)!important;
-    }
-    .swiper {
-        height: 380upx;
-    }
-    .swiper-item {
-        display: block;
-        height: 100%!important;
-        line-height: 300upx;
-        text-align: center;
-    }
-        
-    .tip {
-        display: flex;
-        justify-content: space-between;
-        padding: 36upx 32upx;
-    }
-    .giveList {
-        padding: 10upx  12upx;
-        display: flex;
-        flex-wrap: wrap;
-    }
-    .giveItem {
-        height: 150rpx;
-        flex: 1;
-        width: 14%;
-        min-width: 14%;
-        max-width: 14%;
-        /* margin: 24rpx 0 25rpx 4%; */
-		margin: 24upx 3%;
-    }
-    .active {
-        color: #F76260;
-    }
-    .typeItem {
-        width: 25%;
-        display: inline-block;
-        text-align: center;
-    }
-    .iconClass {
-        display: flex;
-        flex-direction: row;
-        align-items: center;
-        justify-content: center;
-    }
-        
-    .hotlItem {
-        padding: 22upx 30upx;
-        border-bottom: 1px solid #EEEEEE;
-        display: flex;
-        justify-content: space-between;
-    }
-    .bottomButton {
-        width: 95%;
-        left: 2.5%;
-        position: fixed;
-        bottom: 2.5%;
-    }
-        
-    .titeTop {
-        display: flex;
-        /* justify-content: space-between; */
-        align-items: center;
-        position: absolute;
-        top: 10upx;
-        width: 100%;
-    }
-    .topleft {
-        width: 60upx;
-		height: 60upx;
-		line-height: 60upx;
-		margin: 0 5upx;
-    }
-        
-    .topright {
-        
-    }
-     .input-view {
-        width: 100%;
-        display: flex;
-        height: 30px;
-        border-radius: 15px;
-        padding: 0 4%;
-        flex-wrap: nowrap;
-        margin: 7px 0;
-        line-height: 30px;
-        margin: 24upx auto;
-        background:rgba(0,0,0,1);
-        opacity:0.4;
-    }
-    
-     .input-view .uni-icon {
-        line-height: 30px !important;
-    }
-    
-     .input-view .input {
-        height: 30px;
-        line-height: 30px;
-        width: 94%;
-        padding: 0 3%;
-    }
-    .activeColor {
-        background: #fff!important;
-        position: fixed;
-        background-color: #fff;
-        top: 65upx;
-		left: 0;
-        z-index: 99;
-    }
-    .listType {
-    }
-	.changeimg {
-		width: 100%;
-		height: auto!important;
-		display: block;
-		text-align: center;
-	}
-	.spacedance{
-		border:1px solid #eee;
-		flex: 1;width: 20%;
-		text-align: center;
-		min-width: 20%;
-		max-width: 20%;
-		margin: 6rpx 0 15rpx 2%;
-		padding:4upx 8upx;
-		color: #666
-	}
-	.fontcenter {
-		text-align: center;
-		color: #666;
-	}
-	/* 轮播切换图标字体红 */
-	
+.search{
+	position: fixed;
+	top: 65upx;
+	left: 0;
+	right: 0;
+	z-index: 99;
+}	
+.home {
+	position: absolute;
+	width: 60upx;
+	height: 60upx;
+	background-color: #fff;
+	border-radius: 50%;
+	box-shadow: 0 0 3upx #333333;
+	text-align: center;
+	top: 100upx;
+	z-index: 999;
+	left: 0;
+}
+.home image {
+	width: 40upx;
+	height: 40upx;
+	padding-top: 8rpx;
+}
+.van-tab--active {
+	color: #d9332e !important;
+}
+.newadress {
+	display: flex;
+	justify-content: space-between;
+	border-bottom: 1px solid #f5f5f5;
+	padding: 15upx 0;
+}
+.changfecolor {
+	color: green;
+}
+.scrollswiper {
+	width: 100%;
+	position: relative;
+}
+.titleFixed {
+	position: absolute;
+	top: 0;
+	left: 0;
+	z-index: 99;
+	padding-top: 0;
+}
+
+.van-nav-bar {
+	padding-top: 0 !important;
+	/* background: #000000!important; */
+	/* opacity: 0.2; */
+	background: rgba(0, 0, 0, 0.2) !important;
+}
+.swiper {
+	height: 380upx;
+}
+.swiper-item {
+	display: block;
+	height: 100% !important;
+	line-height: 300upx;
+	text-align: center;
+}
+
+.tip {
+	display: flex;
+	justify-content: space-between;
+	padding: 36upx 32upx;
+}
+.giveList {
+	padding: 10upx 12upx;
+	display: flex;
+	flex-wrap: wrap;
+}
+.giveItem {
+	height: 150rpx;
+	flex: 1;
+	width: 14%;
+	min-width: 14%;
+	max-width: 14%;
+	/* margin: 24rpx 0 25rpx 4%; */
+	margin: 24upx 3%;
+}
+.active {
+	color: #f76260;
+}
+.typeItem {
+	width: 25%;
+	display: inline-block;
+	text-align: center;
+}
+.iconClass {
+	display: flex;
+	flex-direction: row;
+	align-items: center;
+	justify-content: center;
+}
+
+.hotlItem {
+	padding: 22upx 30upx;
+	border-bottom: 1px solid #eeeeee;
+	display: flex;
+	justify-content: space-between;
+}
+.bottomButton {
+	width: 95%;
+	left: 2.5%;
+	position: fixed;
+	bottom: 2.5%;
+}
+
+.titeTop {
+	display: flex;
+	align-items: center;
+	position: absolute;
+	top: 10upx;
+	width: 100%;
+}
+.topleft {
+	width: 60upx;
+	height: 60upx;
+	line-height: 60upx;
+	margin: 0 5upx;
+}
+
+.topright {
+}
+.input-view {
+	width: 100%;
+	display: flex;
+	height: 30px;
+	border-radius: 15px;
+	padding: 0 4%;
+	flex-wrap: nowrap;
+	margin: 7px 0;
+	line-height: 30px;
+	margin: 24upx auto;
+	background: rgba(0, 0, 0, 1);
+	opacity: 0.4;
+}
+
+.input-view .uni-icon {
+	line-height: 30px !important;
+}
+
+.input-view .input {
+	height: 30px;
+	line-height: 30px;
+	width: 94%;
+	padding: 0 3%;
+}
+.activeColor {
+	background: #fff !important;
+}
+.listType {
+}
+.changeimg {
+	width: 100%;
+	height: auto !important;
+	display: block;
+	text-align: center;
+}
+.spacedance {
+	border: 1px solid #eee;
+	flex: 1;
+	width: 20%;
+	text-align: center;
+	min-width: 20%;
+	max-width: 20%;
+	margin: 6rpx 0 15rpx 2%;
+	padding: 4upx 8upx;
+	color: #666;
+}
+.fontcenter {
+	text-align: center;
+	color: #666;
+}
+/* 轮播切换图标字体红 */
 </style>

+ 1 - 1
pages/index/hoteldetail.vue

@@ -221,7 +221,7 @@ export default {
 
 		// 滚动时触发
 		scroll(e) {
-			if (e.detail.scrollTop > 400) {
+			if (e.detail.scrollTop > 250) {
 				this.isTop = true;
 			} else {
 				//当距离小于500时显示回到顶部按钮

+ 236 - 260
pages/index/hotelsearch.vue

@@ -1,279 +1,255 @@
 <template>
-	<view class="searchType" style="background: #fff;height: 100vh;">
-		 <van-cell value-class="searchclass">
-			 <template slot="title">
-				<view class="input-view">
-					<uni-icon type="search" size="22" color="#666666" />
-					<input confirm-type="search" class="input" type="text" placeholder="输入搜索关键词" 
-					@input="confirm" />
-				</view> 
-			 </template>
-			 <template>
-				 <view @click="search">搜索</view>
-			 </template>
-		 </van-cell>
-		 
-		 <view style="padding: 30upx 18upx;">
-		     <view style="width: 95%;margin: 0 auto;">
-		 			<!-- <view @click="choseType(1)" :class="tabIndex==1 ? 'active' : ''" class="typeItem">
-		 			     综合
-		 			 </view>
-		 			 <view @click="choseType(2)"   class="typeItem">
-		 			   <view class="iconClass">
-		 			       <view :class="tabIndex==2 ? 'active' : ''">上新</view>
-		 			       <view style="display: flex;flex-direction: column;margin-left: 10rpx;">
-		 			           <view ><van-icon size="8px" name="arrow-up"    :class="istopclick==1 ? 'active' : ''"  /></view>
-		 			           <view>
-		 			 				<van-icon  :class="istopclick==2 ? 'active' : ''"  size="8px" name="arrow-down" />
-		 			 				</view>
-		 			       </view>
-		 			   </view>
-		 			 </view>
-		 			 <view @click="choseType(3)"  class="typeItem">
-		 			     <view class="iconClass">
-		 			         <view :class="tabIndex==3 ? 'active' : ''">价格</view>
-		 			         <view style="display: flex;flex-direction: column;margin-left: 10rpx;">
-		 			            <view>
-									 <van-icon    :class="istopclick==3 ? 'active' : ''" size="8px" name="arrow-up" />
-								 </view> 
-								 <view>
-									  <van-icon  :class="istopclick==4 ? 'active' : ''" size="8px" name="arrow-down" />
-								 </view>
-		 			            
-		 			         </view>
-		 			     </view>
-		 			     
-		 			 </view> -->
-					<view @click="choseType(1)" :class="tabIndex==1 ? 'active' : ''" class="typeItem">
-					   综合
+	<view class="searchType" style="background: #fff">
+		<view class="flex-box flex-v-ce tops">
+			<view class="input-view flex-1">
+				<uni-icon type="search" size="22" color="#666666" />
+				<input confirm-type="search" class="input" type="text" placeholder="输入搜索关键词" @input="confirm" @confirm="confirm" />
+			</view>
+			<view @click="search" class="search">取消</view>
+		</view>
+		<view class="sx">
+			<view style="width: 95%;margin: 0 auto;">
+				<view @click="choseType(1)" :class="tabIndex == 1 ? 'active' : ''" class="typeItem">综合</view>
+				<view @click="choseType(2)" class="typeItem">
+					<view class="iconClass">
+						<view :class="tabIndex == 2 ? 'active' : ''">上新</view>
+						<view v-if="istopclick == 0"><img style="width: 36upx;height: 36upx;vertical-align: middle;" src="../../static/sort.png" /></view>
+						<view v-if="istopclick == 1"><img style="width: 36upx;height: 36upx;vertical-align: middle;" src="../../static/sort_down.png" /></view>
+						<view v-if="istopclick == 2"><img style="width: 36upx;height: 36upx;vertical-align: middle;" src="../../static/sort_up.png" /></view>
 					</view>
-					<view @click="choseType(2)"   class="typeItem">
-					  <view class="iconClass">
-									    <view :class="tabIndex==2 ? 'active' : ''">上新</view>
-					    <view  v-if="istopclick==0">
-					    	<img style="width: 36upx;height: 36upx;vertical-align: middle;" src='../../static/sort.png' />
-					    </view>
-					    <view  v-if="istopclick==1">
-					    	<img style="width: 36upx;height: 36upx;vertical-align: middle;" src='../../static/sort_down.png' />
-					    </view>
-					    <view  v-if="istopclick==2">
-					    	<img style="width: 36upx;height: 36upx;vertical-align: middle;"  src='../../static/sort_up.png' />
-					    </view>
-					  </view>
+				</view>
+				<view @click="choseType(3)" class="typeItem">
+					<view class="iconClass">
+						<view :class="tabIndex == 3 ? 'active' : ''">价格</view>
+						<view style="display: flex;flex-direction: column;margin-left: 10rpx;">
+							<view v-if="isprice == 0"><img style="width: 36upx;height: 36upx;vertical-align: middle;" src="../../static/sort.png" /></view>
+							<view v-if="isprice == 3"><img style="width: 36upx;height: 36upx;vertical-align: middle;" src="../../static/sort_down.png" /></view>
+							<view v-if="isprice == 4"><img style="width: 36upx;height: 36upx;vertical-align: middle;" src="../../static/sort_up.png" /></view>
+						</view>
 					</view>
-					<view @click="choseType(3)"  class="typeItem">
-					    <view class="iconClass">
-					        <view :class="tabIndex==3 ? 'active' : ''">价格</view>
-					        <view style="display: flex;flex-direction: column;margin-left: 10rpx;">
-											  <view v-if="isprice==0">
-												<img style="width: 36upx;height: 36upx;vertical-align: middle;" src='../../static/sort.png' />
-											  </view>
-											  <view  v-if="isprice==3">
-												<img style="width: 36upx;height: 36upx;vertical-align: middle;" src='../../static/sort_down.png' />
-											  </view>
-											  <view  v-if="isprice==4">
-												<img style="width: 36upx;height: 36upx;vertical-align: middle;"  src='../../static/sort_up.png' />
-											  </view>
-					           
-					        </view>
-					    </view>
-					</view>
-		     </view>
-		 			
-		 </view>
-		 <scroll-view  style="height: 95vh;" class="floor-list"
-		 			 :scroll-top="scrollTop" scroll-y="true"  @scroll="scroll"  @scrolltoupper="upper" @scrolltolower="lower"
-		 			 :refresher-enabled="false">
-		 <!-- 商品列表 -->
-		      <shopList  :goodId="store_id" :productList="goods_list" />
-		  </scroll-view>
-		   <Gobacktop @getop="getop" v-if="isTop" />
-		  <!-- <shopList :goodId="goodId" :productList="goods_list" /> -->
-	 </view>
+				</view>
+			</view>
+		</view>
+		<scroll-view
+			style="height:calc(100vh - 172upx);"
+			class="floor-list"
+			:scroll-top="scrollTop"
+			scroll-y="true"
+			@scroll="scroll"
+			@scrolltoupper="upper"
+			@scrolltolower="lower"
+			:refresher-enabled="false"
+		>
+			<!-- 商品列表 -->
+			<shopList :goodId="store_id" :productList="goods_list" />
+			<view v-if="goods_list.length == 0" class="noData">未找到内容</view>
+		</scroll-view>
+		<Gobacktop @getop="getop" v-if="isTop" />
+	</view>
 </template>
 
 <script>
-	import Gobacktop from '@/component/Gobacktop.vue'
-	import uniIcon from '@/component/uni-icon/uni-icon.vue'
-	import shopList from '@/component/shopList.vue'  // 商品列表
-	export default {
-		components: {
-			uniIcon,
-			shopList
+import Gobacktop from '@/component/Gobacktop.vue';
+import uniIcon from '@/component/uni-icon/uni-icon.vue';
+import shopList from '@/component/shopList.vue'; // 商品列表
+export default {
+	components: {
+		uniIcon,
+		shopList
+	},
+	onLoad(a) {
+		this.goodId = a.store_id;
+	},
+	data() {
+		return {
+			isTop: 0,
+			scrollTop: 0,
+			old: {
+				scrollTop: 0
+			},
+			isDetail: 1,
+			isprice: 0,
+			page: 1,
+			goodId: 0,
+			tabIndex: 1,
+			istopclick: 0,
+			goods_price: '',
+			goods_commonid: '',
+			chosegoods_commonid: true,
+			chosegoods_price: true,
+			searchvalue: '',
+			goods_list: []
+		};
+	},
+	methods: {
+		getop() {
+			this.scrollTop = this.old.scrollTop;
+			this.$nextTick(function() {
+				this.scrollTop = 0;
+			});
+			this.isTop = false;
 		},
-		onLoad(a) {
-			this.goodId = a.store_id;
-			//this.gethotelist();
+		search() {
+			uni.navigateBack()
 		},
-		data() {
-			return {
-				isTop: 0,
-				scrollTop: 0,
-				old: {
-					scrollTop: 0
-				},
-				isDetail: 1,
-				isprice: 0,
-				page: 1,
-				goodId:0,
-				tabIndex: 1,
-				istopclick: 0,
-				goods_price:'',
-				goods_commonid:"",
-				chosegoods_commonid: true,
-				chosegoods_price: true,
-				searchvalue:'',
-				goods_list:[]
+		confirm(e) {
+			if(e.detail.value){
+				this.searchvalue = e.detail.value;
+				this.goods_list = [];
+				this.getshopdetail();
+			}else{
+				this.goods_list = [];
 			}
 		},
-		methods: {
-			getop() {
-				this.scrollTop = this.old.scrollTop
-                this.$nextTick(function(){
-                    this.scrollTop=0;
-                });
-				this.isTop = false;
-			},
-			search() {
-				this.goods_list = [];
+		// 滚动到顶部
+		upper(e) {},
+
+		// 滚到底部
+		lower(e) {
+			if (this.isDetail == 1) {
+				this.page = this.page + 1;
 				this.getshopdetail();
-			},
-			confirm(e) {
-				this.searchvalue = e.detail.value;
-				// /this.getshopdetail();
-			},
-			// 滚动到顶部
-			upper(e) {
-				
-			},
-			
-			// 滚到底部
-			lower(e) {
-				
-				if(this.isDetail == 1) {
-					this.page = this.page + 1;
-					this.getshopdetail();
-				}
-			},
-			
-			// 滚动时触发
-			scroll(e) {
-				if(e.detail.scrollTop > 400) {
-						this.isTop = true;
-				}else{ //当距离小于500时显示回到顶部按钮
-						this.isTop = false;
-				}
-				this.old.scrollTop = e.detail.scrollTop
-			},
-			// 获取商品详情
-			getshopdetail(e) {
-				if(this.searchvalue == '') {
-						 this.$msg("关键字不能为空")
-						 return;
-				}
-				this.request({
-				                url:"/v2/entry/storeGoods",
-				                method:'get',
-				                data: {
-				                         store_id: this.goodId,
-										 page: this.page,
-										 goods_commonid: this.goods_commonid, // 上新排序
-										 goods_price: this.goods_price,
-										 keyword: this.searchvalue
-				                    },
-								success: (res) => {
-									if(e == 2) {
-										this.goods_list = [];
-									}
-									this.goods_list = this.goods_list.concat(res.data.data.goods_list);
-									if(res.data.data.goods_list.length < 10) {
-										this.isDetail = 2;
-									}
-								},
-			    })
-			},
-			choseType(e) {
-				if(this.searchvalue == '') {
-					 this.$msg("关键字不能为空")
-					 return;
-				}
-				  this.page = 1;
-				  this.tabIndex = e;
-				if(this.tabIndex == 1) {  // 服务
-					this.istopclick = 0;
-					this.isprice = 0;
-					this.gc_id_2 = '';
-					this.goods_price = ''; 
-					this.goods_commonid = '';
-					this.getshopdetail(2); 
-				}else if(this.tabIndex == 2){ //伤
-				        this.chosegoods_price = true;
-						this.istopclick = this.chosegoods_commonid?1:2;
-						this.isprice = 0;
-						this.goods_price = ''; 
-						this.goods_commonid = this.chosegoods_commonid?'asc':'desc';
-						this.chosegoods_commonid = !this.chosegoods_commonid;
-						this.getshopdetail(2);
-				}else if(this.tabIndex == 3){ // 价格
-						this.chosegoods_commonid = true;
-						this.isprice = this.chosegoods_price?3:4;
-						this.goods_price = this.chosegoods_price?'desc':'asc';
-						this.goods_commonid = '';
-						this.istopclick = 0;
-						this.chosegoods_price = !this.chosegoods_price;
-						this.getshopdetail(2);
+			}
+		},
+
+		// 滚动时触发
+		scroll(e) {
+			if (e.detail.scrollTop > 250) {
+				this.isTop = true;
+			} else {
+				//当距离小于500时显示回到顶部按钮
+				this.isTop = false;
+			}
+			this.old.scrollTop = e.detail.scrollTop;
+		},
+		// 获取商品详情
+		getshopdetail(e) {
+			uni.showLoading();
+			this.request({
+				url: '/v2/entry/storeGoods',
+				method: 'get',
+				data: {
+					store_id: this.goodId,
+					page: this.page,
+					goods_commonid: this.goods_commonid, // 上新排序
+					goods_price: this.goods_price,
+					keyword: this.searchvalue
+				},
+				success: res => {
+					uni.hideLoading();
+					if (e == 2) {
+						this.goods_list = [];
 					}
-				
-			},
+					this.goods_list = this.goods_list.concat(res.data.data.goods_list);
+					if (res.data.data.goods_list.length < 10) {
+						this.isDetail = 2;
+					}
+				}
+			});
+		},
+		choseType(e) {
+			this.page = 1;
+			this.tabIndex = e;
+			if (this.tabIndex == 1) {
+				// 服务
+				this.istopclick = 0;
+				this.isprice = 0;
+				this.gc_id_2 = '';
+				this.goods_price = '';
+				this.goods_commonid = '';
+				this.getshopdetail(2);
+			} else if (this.tabIndex == 2) {
+				//伤
+				this.chosegoods_price = true;
+				this.istopclick = this.chosegoods_commonid ? 1 : 2;
+				this.isprice = 0;
+				this.goods_price = '';
+				this.goods_commonid = this.chosegoods_commonid ? 'asc' : 'desc';
+				this.chosegoods_commonid = !this.chosegoods_commonid;
+				this.getshopdetail(2);
+			} else if (this.tabIndex == 3) {
+				// 价格
+				this.chosegoods_commonid = true;
+				this.isprice = this.chosegoods_price ? 3 : 4;
+				this.goods_price = this.chosegoods_price ? 'desc' : 'asc';
+				this.goods_commonid = '';
+				this.istopclick = 0;
+				this.chosegoods_price = !this.chosegoods_price;
+				this.getshopdetail(2);
+			}
 		}
 	}
+};
 </script>
 
 <style>
-.searchType .input-view {
-		width: 80%;
-		display: flex;
-		background-color: #e7e7e7;
-		height: 30px;
-		border-radius: 15px;
-		padding: 0 4%;
-		flex-wrap: nowrap;
-		margin: 7px 0;
-		line-height: 30px;
-		margin: 24upx 0 24upx 32upx;
-	}
-	
-	.searchType .input-view .uni-icon {
-		line-height: 30px !important;
-	}
-	
-	.searchType .input-view .input {
-		height: 30px;
-		line-height: 30px;
-		width: 94%;
-		padding: 0 3%;
-	}
-	.van-cell__title {
-		flex: 6!important;
-	}
-	.searchclass {
-		display: flex;
-		align-items: center;
-		justify-content: center;
+	.noData {
+		margin-top: 30%;
+		text-align: center;
+		color: #999;
 	}
-	.active {
-	    color: #F76260;
-	}
-	.typeItem {
-	    width: 33%;
-	    display: inline-block;
-	    text-align: center;
-	}  
-	.iconClass {
-	    display: flex;
-	    flex-direction: row;
-	    align-items: center;
-	    justify-content: center;
-	}
-	
+.sx {
+	padding: 20upx 18upx;
+	padding-top: 0rpx;
+	margin-top: 108upx;
+	border-bottom: 1px solid #f1f1f1;
+	position: sticky;
+	top: 108upx;
+}
+.tops {
+	position: fixed;
+	top: 0;
+	left: 0;
+	right: 0;
+	z-index: 999;
+	background: #fff;
+}
+.search {
+	color: #999;
+	padding: 0 32rpx;
+}
+.searchType .input-view {
+	display: flex;
+	background-color: #e7e7e7;
+	height: 30px;
+	border-radius: 15px;
+	padding: 0 4%;
+	flex-wrap: nowrap;
+	margin: 7px 0;
+	line-height: 30px;
+	margin: 24upx 0 24upx 32upx;
+}
+
+.searchType .input-view .uni-icon {
+	line-height: 30px !important;
+}
+
+.searchType .input-view .input {
+	height: 30px;
+	line-height: 30px;
+	width: 94%;
+	padding: 0 3%;
+}
+.van-cell__title {
+	flex: 6 !important;
+}
+.searchclass {
+	display: flex;
+	align-items: center;
+	justify-content: center;
+}
+.active {
+	color: #f76260;
+}
+.typeItem {
+	width: 33%;
+	display: inline-block;
+	text-align: center;
+}
+.iconClass {
+	display: flex;
+	flex-direction: row;
+	align-items: center;
+	justify-content: center;
+}
 </style>

+ 600 - 570
pages/index/index.vue

@@ -1,572 +1,602 @@
-<template>
-	<view class="content">
-	<view style="postion: fixed;top:0;">
-	 <uniNavBar class="top"  :shadow="false"  :fixed="false" color="#333333" background-color="#FFFFFF">
-	 	<block  style="width: 70%;padding-left: 32upx;" slot="left">
-	 		<view class="city" v-if="!allow">
-	 			<view style="font-size: 35upx;">
-				  <image @click="refeshadress" v-if="isrefesh" src="../../static/home_local.png" style="width: 40rpx;height: 45rpx;vertical-align: middle;padding-right:10upx;" ></image>
-				  <image @click="refeshadress"  v-if="!isrefesh" src="../../static/home_local2.png" style="width: 40rpx;height: 45rpx;vertical-align: middle;padding-right:10upx;" ></image>
-				  {{ location }}
-				</view>
-	 		</view>
-			<button plain="true" style="border: none;" 
-			  v-if="allow" @opensetting='handler'
-			  open-type="openSetting" >定位失败,点击刷新</button>
-	 	</block>
-			<view class="input-view" style="float: right;visibility: hidden;">
-			  <uni-icon color="#606266" size="22" @click="scan" type="scan"></uni-icon>
-			</view>
-		<block  slot="right" >
-			<view @click="goinfor" style="padding-top: 8upx;">
-				<van-icon  v-if="successlogion && hasLogin && msg_count>0"  name="chat-o" color="#606266"  size="24px" dot />
-				<van-icon  v-else name="chat-o" color="#606266"  size="24px" />
-			</view>
-		</block>
-	 </uniNavBar>
-	<view @click="goSearch" class="searchType" style="background: #fff;">
-		 <view class="input-view">
-		 	<uni-icon type="search" size="22" color="#666666" />
-			<view style="color: #999;">搜索您入住的酒店</view>
-		 <!-- 	<input placeholder-style="text-align: center;"	 confirm-type="search" class="input" type="text" placeholder="搜索您入住的酒店" disabled="true" /> -->
-		 </view>
-	 </view>
-	 </view>
-	 <scroll-view  class="floor-list" style="height: 95vh;" 
-	  :scroll-top="scrollTop" scroll-y="true"  @scroll="scroll"  @scrolltoupper="upper" @scrolltolower="lower"
-	  :refresher-enabled="false">
-	 <view  class="scrollswiper">
-		 <swiper class="swiper" 
-		  indicator-dots circular=true
-		 :autoplay="autoplay" 
-		 :interval="interval" 
-		 :duration="duration"
-		 > 
-			<swiper-item v-for="(item,index) in backgroundlist" :key="index">
-			<view class="swiper-item"  @tap="shopDetail(item)" >
-				 <image v-if="item.adv_code" style="height: 100%;width: 100%;border-radius: 10upx;" :src='pictureUrl +"/uploads/home/adv/"+item.adv_code' />
-		    </view>
-			</swiper-item>
-		 </swiper>
-	 </view>
-	
-	 <view class="tips">
-		 <view style="font-weight: bold;font-size: 34rpx;">附近酒店</view>
-		 <view style="color: #909399;">在此找到您入住的酒店</view>
-	 </view>
-	 <view style="border-bottom: 2upx solid #EEEEEE;width: 100%;margin-bottom: 24upx 0;"></view>
-	
-	<view v-if="!allow">
-     <view class="hotelList" v-for='(item,index) in hotelist' :key="index" @click="openinfo(item)">
-		 <view class="hotleLeft">					
-			 <image v-if="item.store_banner" style="width: 214upx;height: 152upx;border-radius: 10upx;" :src="pictureUrl+'/uploads/home/store/'+item.store_id+'/'+item.store_banner" />
-		 </view>
-		 <view class="hotelright">
-		 	<view style="font-size: 28upx;color: #303133;font-weight: bold;">{{item.store_name}}
-			</view>
-		    <view style="display: flex;flex-direction: row;justify-content: space-between;align-items: center;padding: 2rpx 0;">
-				<view style="font-size: 46upx; color: #303133;font-weight: 900;">{{intToFloat(item.store_servicecredit)}}</view>
-				<view style="color: #606266;font-size: 24upx;">月访客{{item.store_visitor}}</view>
-				<view style="color: #606266;font-size: 24upx;">{{item.distance}}</view>
-			</view>
-			<view class="undertip">
-				<view  v-for="(items,index) in item.tageslist" :key="index" class="tipsTop">{{items}}</view>
-			</view>
-	 </view>
-	 </view>
-	 </view>
-	 <view v-if="allow" style="text-align: center;margin: 100upx 0;">
-		 定位失败暂时获取不到周边酒店信息哦
-	 </view>
-     </scroll-view>
-	 <unipopup :images="images"   v-if="enable == 1"  :show="ishow"/>
-	 <Gobacktop @getop="getop" v-if="isTop" />
-	</view>
-</template>
-
-<script>
-	import {
-		mapMutations,mapState
-	} from 'vuex'
-	import unipopup from '@/component/popup.vue'
-	import uniNavBar from '@/component/uni-nav-bar/uni-nav-bar.vue'
-	import uniIcon from '@/component/uni-icon/uni-icon.vue'
-	import logionDialog from '@/component/loginDialog.vue'
-	import amap from '@/common/amap-wx.js'
-	import Gobacktop from '@/component/Gobacktop.vue'
-	export default {
-		components: {
-			unipopup,
-			uniNavBar,
-			uniIcon,
-			logionDialog,
-			Gobacktop
-		},
-		data() {
-			return {
-				isrefesh: true,
-				lat:'', // 经度
-				lot: '', // 维度
-				ishow: true,
-				firstpoint: true,
-				page: 1,
-				ispull: true,
-				pagesize: 10,
-				store_summary:[], // 标签数组
-				pictureUrl: this.pictureUrl,
-				amapPlugin: null,  
-				key: '7277de7a5833626b7da8f2496e9d6bf9',  
-				showdialog: false,   // 点击确定显示弹窗
-			    backgroundlist: ['color1', 'color2', 'color3'],  // 轮播数组
-				hotelist:[], // 酒店数组
-				indicatorDots: true,
-				autoplay: true,
-				interval: 2000,
-				duration: 500,
-				title: 'Hello',
-				location:'正在定位...',
-				scrollTop: 0,
-	            isTop: false,
-				old: {
-					scrollTop: 0
-				},
-				allow: true,
-				images: '',  // 开机图片广告
-				enable: '', // 是否展示广告
-				msg_count: 0, 
-				timer:''
-			}
-		},
-		computed:{
-			...mapState([
-			  'hasLogin',
-			  'userInfo',
-			  'successlogion',
-			  'beginload'
-			]),
-		},
-		onShow() {
-			if(this.successlogion && this.hasLogin) {
-				this.getuserinfo();
-				this.firstget()
-			}
-		},
-		onHide() {
-			clearInterval(this.timer);
-			this.timer = null;
-		},
-		onLoad() {
-			if(this.beginload) {
-			this.getpicture(); // 开机广告
-			if(this.allow) {
-				
-			}else {
-				this.gethotelist(); // 酒店列表
-			}
-			this.amapPlugin = new amap.AMapWX({
-				key: this.key  
-			});  
-			this.isGetLocation();  // 检查是否开启定位权限
-			this.isUserInfo();  // 检查是否允许获取用户授权
-			this.getswiper();   // 获取首页轮播 
-		   }
-		   if(this.successlogion && this.hasLogin) {
-			   this.firstget();
-			   this.getuserinfo();
-		   }
-	    },
-		
-		watch: {
-			'beginload':function(val) {
-				this.getpicture(); // 开机广告
-				this.amapPlugin = new amap.AMapWX({
-					key: this.key  
-				});  
-				this.isGetLocation();  // 检查是否开启定位权限
-				this.isUserInfo();  // 检查是否允许获取用户授权
-				this.getswiper();   // 获取首页轮播 
-			},
-			'hasLogin':function(val) {
-				if(val) {
-					this.firstget();
-					this.getuserinfo();
-				}
-			},
-		},
-		methods: {
-			...mapMutations(['login','showDialog']),
-			firstget() {
-				this.request({
-					url:'/v2/member/info',
-					method:'GET',
-					success: (res)=>{
-					  this.msg_count = res.data.data.msg_count;
-					}
-				})
-			},
-			getuserinfo() {
-			 // let second = Math.round((Math.random()+1)*3);
-			 this.timer = setInterval(()=>{
-					this.request({
-						url:'/v2/member/info',
-						method:'GET',
-						success: (res)=>{
-						  this.msg_count = res.data.data.msg_count;
-						}
-					})
-				}, 180000);
-			},
-			refeshadress() {
-				this.isrefesh = false;
-				this.getRegeo();
-			},
-			intToFloat(val) {
-			    return new Number(val).toFixed(1);
-			},
-			getpicture() {
-				this.request({
-					url: '/v1/entry/poster',
-					method: 'get',
-					success: (res) => {
-						let { data } = res.data;
-						this.images = data.images;
-						this.enable = data.enable;
-					}
-				})
-			},
-			
-			handler() {
-				this.getAuthorizeInfo();
-			},
-			goinfor() {
-				if(this.successlogion && this.hasLogin) {
-					uni.navigateTo({
-					   url: '../myCenter/information'  ,// 我的消息通知
-					   
-					})
-				}else {
-					uni.navigateTo({
-						url:'/pages/myCenter/logion'
-					})
-				}
			},
-			goSearch() {
-				let lat = this.lat;
-				let lon = this.lot;
-				uni.navigateTo({
-					url: `/pages/index/searchresult?lat=${lat}&lon=${lon}`
-				})
-			},
-			// 滚动到顶部
-			upper(e) {
-			
-			},
-			
-			getop() {
-				   this.scrollTop = this.old.scrollTop
-	                this.$nextTick(function(){
-	                    this.scrollTop=0;
-	                });
-					this.isTop = false;
-			},
-			
-			// 滚到底部
-			lower(e) {
-				this.page = this.page + 1;
-				if(this.ispull) {
-					this.gethotelist();
-				}
-			},
-			
-			// 滚动时触发
-			scroll(e) {
-				if(e.detail.scrollTop > 400) {
-					this.isTop = true;
-				}else{ //当距离小于500时显示回到顶部按钮
-					this.isTop = false;
+<template>
+	<view class="content">
+		<view style="postion:sticky;top:0;">
+			<uniNavBar class="top" :shadow="false" :fixed="false" color="#333333" background-color="#FFFFFF">
+				<block style="width: 70%;padding-left: 32upx;" slot="left">
+					<view class="city" v-if="!allow">
+						<view style="font-size: 35upx;">
+							<image
+								@click="refeshadress"
+								v-if="isrefesh"
+								src="../../static/home_local.png"
+								style="width: 40rpx;height: 45rpx;vertical-align: middle;padding-right:10upx;"
+							></image>
+							<image
+								@click="refeshadress"
+								v-if="!isrefesh"
+								src="../../static/home_local2.png"
+								style="width: 40rpx;height: 45rpx;vertical-align: middle;padding-right:10upx;"
+							></image>
+							{{ location }}
+						</view>
+					</view>
+					<button plain="true" style="border: none;" v-if="allow" @opensetting="handler" open-type="openSetting">定位失败,点击刷新</button>
+				</block>
+				<view class="input-view" style="float: right;"><uni-icon color="#606266" size="24" @click="scan" type="scan"></uni-icon></view>
+				<block slot="right">
+					<view @click="goinfor" style="padding-top: 8upx;">
+						<van-icon v-if="successlogion && hasLogin && msg_count > 0" name="chat-o" color="#606266" size="24px" dot />
+						<van-icon v-else name="chat-o" color="#606266" size="24px" />
+					</view>
+				</block>
+			</uniNavBar>
+			<view @click="goSearch" class="searchType" style="background: #fff;">
+				<view class="input-view">
+					<uni-icon type="search" size="22" color="#666666" />
+					<view style="color: #999;">搜索您入住的酒店</view>
+					<!-- 	<input placeholder-style="text-align: center;"	 confirm-type="search" class="input" type="text" placeholder="搜索您入住的酒店" disabled="true" /> -->
+				</view>
+			</view>
+		</view>
+		
+		<scroll-view
+			class="floor-list"
+			style="height:calc(100vh - 172upx);"
+			:scroll-top="scrollTop"
+			scroll-y="true"
+			@scroll="scroll"
+			@scrolltoupper="upper"
+			@scrolltolower="lower"
+			:refresher-enabled="false"
+		>
+			<view class="scrollswiper">
+				<swiper class="swiper" indicator-dots circular="true" :autoplay="autoplay" :interval="interval" :duration="duration">
+					<swiper-item v-for="(item, index) in backgroundlist" :key="index">
+						<view class="swiper-item" @tap="shopDetail(item)">
+							<image v-if="item.adv_code" style="height: 100%;width: 100%;border-radius: 10upx;" :src="pictureUrl + '/uploads/home/adv/' + item.adv_code" />
+						</view>
+					</swiper-item>
+				</swiper>
+			</view>
+
+			<view class="tips">
+				<view style="font-weight: bold;font-size: 34rpx;">附近酒店</view>
+				<view style="color: #909399;">在此找到您入住的酒店</view>
+			</view>
+			<view style="border-bottom: 2upx solid #EEEEEE;width: 100%;margin-bottom: 24upx 0;"></view>
+
+			<view v-if="!allow">
+				<view class="hotelList" v-for="(item, index) in hotelist" :key="index" @click="openinfo(item)">
+					<view class="hotleLeft">
+						<image
+							v-if="item.store_banner"
+							style="width: 214upx;height: 152upx;border-radius: 10upx;"
+							:src="pictureUrl + '/uploads/home/store/' + item.store_id + '/' + item.store_banner"
+						/>
+					</view>
+					<view class="hotelright">
+						<view style="font-size: 28upx;color: #303133;font-weight: bold;">{{ item.store_name }}</view>
+						<view style="display: flex;flex-direction: row;justify-content: space-between;align-items: center;padding: 2rpx 0;">
+							<view style="font-size: 46upx; color: #303133;font-weight: 900;">{{ intToFloat(item.store_servicecredit) }}</view>
+							<view style="color: #606266;font-size: 24upx;">月访客{{ item.store_visitor }}</view>
+							<view style="color: #606266;font-size: 24upx;">{{ item.distance }}</view>
+						</view>
+						<view class="undertip">
+							<view v-for="(items, index) in item.tageslist" :key="index" class="tipsTop">{{ items }}</view>
+						</view>
+					</view>
+				</view>
+			</view>
+			<view v-if="allow" style="text-align: center;margin: 100upx 0;">定位失败暂时获取不到周边酒店信息哦</view>
+		</scroll-view>
+		
+		<unipopup :images="images" v-if="enable == 1" :show="ishow" />
+		<Gobacktop @getop="getop" v-if="isTop" />
+	</view>
+</template>
+
+<script>
+import { mapMutations, mapState } from 'vuex';
+import unipopup from '@/component/popup.vue';
+import uniNavBar from '@/component/uni-nav-bar/uni-nav-bar.vue';
+import uniIcon from '@/component/uni-icon/uni-icon.vue';
+import logionDialog from '@/component/loginDialog.vue';
+import amap from '@/common/amap-wx.js';
+import Gobacktop from '@/component/Gobacktop.vue';
+export default {
+	components: {
+		unipopup,
+		uniNavBar,
+		uniIcon,
+		logionDialog,
+		Gobacktop
+	},
+	data() {
+		return {
+			isrefesh: true,
+			lat: '', // 经度
+			lot: '', // 维度
+			ishow: true,
+			firstpoint: true,
+			page: 1,
+			ispull: true,
+			pagesize: 10,
+			store_summary: [], // 标签数组
+			pictureUrl: this.pictureUrl,
+			amapPlugin: null,
+			key: '7277de7a5833626b7da8f2496e9d6bf9',
+			showdialog: false, // 点击确定显示弹窗
+			backgroundlist: ['color1', 'color2', 'color3'], // 轮播数组
+			hotelist: [], // 酒店数组
+			indicatorDots: true,
+			autoplay: true,
+			interval: 2000,
+			duration: 500,
+			title: 'Hello',
+			location: '正在定位...',
+			scrollTop: 0,
+			isTop: false,
+			old: {
+				scrollTop: 0
+			},
+			allow: true,
+			images: '', // 开机图片广告
+			enable: '', // 是否展示广告
+			msg_count: 0,
+			timer: ''
+		};
+	},
+	computed: {
+		...mapState(['hasLogin', 'userInfo', 'successlogion', 'beginload'])
+	},
+	onShow() {
+		if (this.successlogion && this.hasLogin) {
+			this.getuserinfo();
+			this.firstget();
+		}
+	},
+	onHide() {
+		clearInterval(this.timer);
+		this.timer = null;
+	},
+	onLoad() {
+		if (this.beginload) {
+			this.getpicture(); // 开机广告
+			if (this.allow) {
+			} else {
+				this.gethotelist(); // 酒店列表
+			}
+			this.amapPlugin = new amap.AMapWX({
+				key: this.key
+			});
+			this.isGetLocation(); // 检查是否开启定位权限
+			this.isUserInfo(); // 检查是否允许获取用户授权
+			this.getswiper(); // 获取首页轮播
+		}
+		if (this.successlogion && this.hasLogin) {
+			this.firstget();
+			this.getuserinfo();
+		}
+	},
+
+	watch: {
+		beginload: function(val) {
+			this.getpicture(); // 开机广告
+			this.amapPlugin = new amap.AMapWX({
+				key: this.key
+			});
+			this.isGetLocation(); // 检查是否开启定位权限
+			this.isUserInfo(); // 检查是否允许获取用户授权
+			this.getswiper(); // 获取首页轮播
+		},
+		hasLogin: function(val) {
+			if (val) {
+				this.firstget();
+				this.getuserinfo();
+			}
+		}
+	},
+	methods: {
+		...mapMutations(['login', 'showDialog']),
+		firstget() {
+			this.request({
+				url: '/v2/member/info',
+				method: 'GET',
+				success: res => {
+					this.msg_count = res.data.data.msg_count;
 				}
-
-				this.old.scrollTop = e.detail.scrollTop
-			},
-			isGetLocation(a="scope.userLocation"){ //  检查当前是否已经授权访问scope属性W
-					uni.getSetting({
-					    success:(res)=> {
-							if (!res.authSetting[a]) {  // 每次进入程序判断当前是否获得授权,如果没有就去获得授权,如果获得授权,就直接获取当前地理位置
-								this.getAuthorizeInfo()
-							}else{
-								this.getRegeo()
-							}
-							
-						}
-					});
-				},
-			isUserInfo(b='scope.userInfo') {
-				uni.getSetting({
-					success:(res)=> {
-						if(!res.authSetting[b]) {
-							this.showDialog(false);
-						}else {
-							this.showDialog(true);
-							let userInfo = uni.getStorageSync('userInfo');
-							 this.login(userInfo);
-						}
-					}
-				})
-			},
-			getAuthorizeInfo(a="scope.userLocation"){  //uniapp弹窗弹出获取授权弹窗
-					uni.authorize({
-						scope: a,
-						success:(res)=> { //允许授权
-							this.getRegeo();
-						},
-						fail(){    //拒绝授权
-						  this.allow = true;
-						  this.$msg("你拒绝了授权,无法获得周边信息")
-						}
-					})
-				},
-
-		    getRegeo(){
-			 let _this=this;
-			 uni.showLoading({  
-				title: '获取位置中'  
-			}); 
-			_this.amapPlugin.getRegeo({  
-				success: (data) => {
-					this.isrefesh = true;
-					this.location = data[0].name;
-					this.lat = data[0].latitude; // 经度
-					this.lot = data[0].longitude; // 纬度
-					this.allow = false;
-					this.gethotelist();
-					uni.hideLoading();  
-				},
-				fail: (res) => {
-					this.allow = true;
-					uni.hideLoading(); 
-				}
-			});  
-		    },
-			// 获取首页轮播
-			 getswiper() {
-				this.request({
-	                url:"/v1/entry/adv",
-	                method:'get',
-					success: (res) => {
-						 this.backgroundlist = res.data.data;
-					}
-			   })
-			 },
-		 // 获取酒店列表
-		 gethotelist() {
-			 this.request({
-                 url:"/v2/entry/storeList",
-                 method:'get',
-                 data: {
-                         page: this.page,
-						 page_size: 10,
-						 lat: this.lat,
-						 lon: this.lot
-                     },
-				success: (res) => {
-					 let { data,code } = res.data;
-					 if(code == 1000) {
-						 if(data.store_list.length<10) {
-							 this.ispull = false;
-						 }
-						  data.store_list.forEach((items,index) => {
-							items.tages = items.store_summary.split(' ');
-							items.tageslist = [];
-							items.tages.forEach((item,index) => {
-								if(item!='') {
-									items.tageslist.push(item);
-								}
-							})
-							
-						 })
-						 if(this.hotelist.length == 0) {
-							 this.hotelist = data.store_list
-						 }else {
-							 this.hotelist =  this.hotelist.concat(data.store_list);
-						 }
-					 }else {
-						 this.$msg("网络错误稍后再试")
-					 }
-				}
-		   })
-		 },
-		
-		 // 点击扫码
-		 scan(){
-		 	uni.scanCode({
-		 		success: (res) => {
-		 			
-		 		}
-		 	});
-		 },
-		 
-		 openinfo(item) {
-			 let id = item.store_id;
-			  uni.navigateTo({
-			        url: `/pages/index/hotel?id=${id}`
-			  });
-		 },
-		 
-		 // 跳转到商品详情
-		 shopDetail(item) {
-			 let id = item.adv_target.goods_id;
-			 let store_id = item.adv_target.store_id;
-			 if(item.adv_target.type == 'goods') {
-				 uni.navigateTo({
-					url: `/pages/index/shop?id=${id}&store_id=${store_id}`
-				}); 
-			 }else if(item.adv_target.type == 'store') {
-				 let id = item.adv_target.store_id;
-				 let title = item.adv_target.store_name;
-				 uni.navigateTo({
-				   url: `/pages/index/hotel?id=${id}`
-				 });
-			 }
-			
-		 }
-		
-		}
-}
-</script>
-
-<style>
-   .top .uni-navbar__header-btns  {
-		width: 77%!important;
-	}
-	.top .uni-navbar__header-container {
-		width: 50%!important;
-	}
-		
-	.content {
-		background: #fff;
-	}
-	.city {
-		width: 100%;
-		height: 100%;
-		white-space:nowrap;
-		overflow:hidden;
-		text-overflow:ellipsis;
-	}
-	.logo {
-		height: 200upx;
-		width: 200upx;
-		margin-top: 200upx;
-		margin-left: auto;
-		margin-right: auto;
-		margin-bottom: 50upx;
-	}
-
-	.text-area {
-		display: flex;
-		justify-content: center;
-	}
-
-	.title {
-		font-size: 36upx;
-		color: #8f8f94;
-	}
-	.van-cell--borderless {
-		background-color: #e7e7e7!important;
-	}
-	.searchType .input-view {
-		width: 85%;
-		display: flex;
-		background-color: #e7e7e7;
-		height: 30px;
-		border-radius: 15px;
-		padding: 0 4%;
-		flex-wrap: nowrap;
-		margin: 7px 0;
-		line-height: 30px;
-		margin: 10upx auto;
-		display: flex;
-		justify-content: center
-	}
-	
-	.searchType .input-view .uni-icon {
-		line-height: 30px !important;
-	}
-	
-	.searchType .input-view .input {
-		height: 30px;
-		line-height: 30px;
-		width: 94%;
-		padding: 0 3%;
-	}
-	.uni-navbar--border::after {
-		background: #fff!important;
-	}
-	.swiper {
-		height: 300upx;
-		border-radius: 10upx;
-	}
-	.swiper-item {
-		display: block;
-		height: 300upx;
-		line-height: 300upx;
-		text-align: center;
-		border-radius: 10upx;
-	}
-	swiper-item {
-		border-radius: 15upx;
-	}
-	.swiper-item image {
-		border-radius: 10upx;
-	}	
-	.scrollswiper {
-		width: 90%;
-		margin: 20upx auto;
-		border-radius: 10upx;
-	}
-		
-	.tips {
-		/* color: #303133;
-		font-size: 28upx;
-		text-align: center;
-		margin: 24upx 0; */
-		padding: 20upx 32upx 0 32upx;
-		display: flex;
-		justify-content: space-between;
-		font-size: 30upx;
-	}
-		
-    .hotelList {
-		display: flex;
-		flex-direction: row;
-		padding: 24upx 32upx;
-	}
-		
-	.hotleLeft {
-		width: 214upx;
-		height: 152upx;
-	}
-		
-	.hotelright {
-		padding-left: 16upx;
-		display: flex;
-		flex-direction: column;
-		width: 100%;
-	}
-		
-	.undertip {
-		display: flex;
-		flex-direction: row;
-		align-items: center;
-	}
-	.tipsTop {
-		border: 1upx solid #606266;
-		margin-right: 12upx;
-		color: #606266;
-		font-size: 22rpx;
-		border-radius: 5rpx;
-		padding: 0rpx 5rpx;
-
-	}
-	.placeholdercenter {
-		text-align: center;
-	}
+			});
+		},
+		getuserinfo() {
+			// let second = Math.round((Math.random()+1)*3);
+			this.timer = setInterval(() => {
+				this.request({
+					url: '/v2/member/info',
+					method: 'GET',
+					success: res => {
+						this.msg_count = res.data.data.msg_count;
+					}
+				});
+			}, 180000);
+		},
+		refeshadress() {
+			this.isrefesh = false;
+			this.getRegeo();
+		},
+		intToFloat(val) {
+			return new Number(val).toFixed(1);
+		},
+		getpicture() {
+			this.request({
+				url: '/v1/entry/poster',
+				method: 'get',
+				success: res => {
+					let { data } = res.data;
+					this.images = data.images;
+					this.enable = data.enable;
+				}
+			});
+		},
+
+		handler() {
+			this.getAuthorizeInfo();
+		},
+		goinfor() {
+			if (this.successlogion && this.hasLogin) {
+				uni.navigateTo({
+					url: '../myCenter/information' // 我的消息通知
+				});
+			} else {
+				uni.navigateTo({
+					url: '/pages/myCenter/logion'
+				});
+			}
+		},
+		goSearch() {
+			let lat = this.lat;
+			let lon = this.lot;
+			uni.navigateTo({
+				url: `/pages/index/searchresult?lat=${lat}&lon=${lon}`
+			});
+		},
+		// 滚动到顶部
+		upper(e) {},
+
+		getop() {
+			this.scrollTop = this.old.scrollTop;
+			this.$nextTick(function() {
+				this.scrollTop = 0;
+			});
+			this.isTop = false;
+		},
+
+		// 滚到底部
+		lower(e) {
+			this.page = this.page + 1;
+			if (this.ispull) {
+				this.gethotelist();
+			}
+		},
+
+		// 滚动时触发
+		scroll(e) {
+			if (e.detail.scrollTop > 250) {
+				this.isTop = true;
+			} else {
+				//当距离小于500时显示回到顶部按钮
+				this.isTop = false;
+			}
+
+			this.old.scrollTop = e.detail.scrollTop;
+		},
+		isGetLocation(a = 'scope.userLocation') {
+			//  检查当前是否已经授权访问scope属性W
+			uni.getSetting({
+				success: res => {
+					if (!res.authSetting[a]) {
+						// 每次进入程序判断当前是否获得授权,如果没有就去获得授权,如果获得授权,就直接获取当前地理位置
+						this.getAuthorizeInfo();
+					} else {
+						this.getRegeo();
+					}
+				}
+			});
+		},
+		isUserInfo(b = 'scope.userInfo') {
+			uni.getSetting({
+				success: res => {
+					if (!res.authSetting[b]) {
+						this.showDialog(false);
+					} else {
+						this.showDialog(true);
+						let userInfo = uni.getStorageSync('userInfo');
+						this.login(userInfo);
+					}
+				}
+			});
+		},
+		getAuthorizeInfo(a = 'scope.userLocation') {
+			//uniapp弹窗弹出获取授权弹窗
+			uni.authorize({
+				scope: a,
+				success: res => {
+					//允许授权
+					this.getRegeo();
+				},
+				fail() {
+					//拒绝授权
+					this.allow = true;
+					this.$msg('你拒绝了授权,无法获得周边信息');
+				}
+			});
+		},
+
+		getRegeo() {
+			let _this = this;
+			uni.showLoading({
+				title: '获取位置中'
+			});
+			_this.amapPlugin.getRegeo({
+				success: data => {
+					this.isrefesh = true;
+					this.location = data[0].name;
+					this.lat = data[0].latitude; // 经度
+					this.lot = data[0].longitude; // 纬度
+					this.allow = false;
+					this.gethotelist();
+					uni.hideLoading();
+				},
+				fail: res => {
+					this.allow = true;
+					uni.hideLoading();
+				}
+			});
+		},
+		// 获取首页轮播
+		getswiper() {
+			this.request({
+				url: '/v1/entry/adv',
+				method: 'get',
+				success: res => {
+					this.backgroundlist = res.data.data;
+				}
+			});
+		},
+		// 获取酒店列表
+		gethotelist() {
+			this.request({
+				url: '/v2/entry/storeList',
+				method: 'get',
+				data: {
+					page: this.page,
+					page_size: 10,
+					lat: this.lat,
+					lon: this.lot
+				},
+				success: res => {
+					let { data, code } = res.data;
+					if (code == 1000) {
+						if (data.store_list.length < 10) {
+							this.ispull = false;
+						}
+						data.store_list.forEach((items, index) => {
+							items.tages = items.store_summary.split(' ');
+							items.tageslist = [];
+							items.tages.forEach((item, index) => {
+								if (item != '') {
+									items.tageslist.push(item);
+								}
+							});
+						});
+						if (this.hotelist.length == 0) {
+							this.hotelist = data.store_list;
+						} else {
+							this.hotelist = this.hotelist.concat(data.store_list);
+						}
+					} else {
+						this.$msg('网络错误稍后再试');
+					}
+				}
+			});
+		},
+
+		// 点击扫码
+		scan() {
+			uni.scanCode({
+				success: res => {
+					console.log(res.result);
+					if (res.scanType != 'QR_CODE') {
+						this.$msg('二维码错误');
+					} else {
+						var obj = this.GetRequest(res.result);
+						uni.navigateTo({
+							url: `/pages/index/shop?id=${obj.goods_id}&store_id=${obj.store_id}`
+						});
+					}
+				}
+			});
+		},
+
+		GetRequest(urlStr) {
+			if (typeof urlStr == 'undefined') {
+				var url = decodeURI(location.search); //获取url中"?"符后的字符串
+			} else {
+				var url = '?' + urlStr.split('?')[1];
+			}
+			var theRequest = new Object();
+			var strs;
+			if (url.indexOf('?') != -1) {
+				var str = url.substr(1);
+				strs = str.split('&');
+				for (var i = 0; i < strs.length; i++) {
+					theRequest[strs[i].split('=')[0]] = decodeURI(strs[i].split('=')[1]);
+				}
+			}
+			return theRequest;
+		},
+		openinfo(item) {
+			let id = item.store_id;
+			uni.navigateTo({
+				url: `/pages/index/hotel?id=${id}`
+			});
+		},
+
+		// 跳转到商品详情
+		shopDetail(item) {
+			let id = item.adv_target.goods_id;
+			let store_id = item.adv_target.store_id;
+			if (item.adv_target.type == 'goods') {
+				uni.navigateTo({
+					url: `/pages/index/shop?id=${id}&store_id=${store_id}`
+				});
+			} else if (item.adv_target.type == 'store') {
+				let id = item.adv_target.store_id;
+				let title = item.adv_target.store_name;
+				uni.navigateTo({
+					url: `/pages/index/hotel?id=${id}`
+				});
+			}
+		}
+	}
+};
+</script>
+
+<style>
+
+
+.top .uni-navbar__header-btns {
+	width: 77% !important;
+}
+.top .uni-navbar__header-container {
+	width: 50% !important;
+}
+
+.content {
+	background: #fff;
+}
+.city {
+	width: 100%;
+	height: 100%;
+	white-space: nowrap;
+	overflow: hidden;
+	text-overflow: ellipsis;
+}
+.logo {
+	height: 200upx;
+	width: 200upx;
+	margin-top: 200upx;
+	margin-left: auto;
+	margin-right: auto;
+	margin-bottom: 50upx;
+}
+
+.text-area {
+	display: flex;
+	justify-content: center;
+}
+
+.title {
+	font-size: 36upx;
+	color: #8f8f94;
+}
+.van-cell--borderless {
+	background-color: #e7e7e7 !important;
+}
+.searchType .input-view {
+	width: 85%;
+	display: flex;
+	background-color: #e7e7e7;
+	height: 30px;
+	border-radius: 15px;
+	padding: 0 4%;
+	flex-wrap: nowrap;
+	margin: 7px 0;
+	line-height: 30px;
+	margin: 10upx auto;
+	display: flex;
+	justify-content: center;
+}
+
+.searchType .input-view .uni-icon {
+	line-height: 30px !important;
+}
+
+.searchType .input-view .input {
+	height: 30px;
+	line-height: 30px;
+	width: 94%;
+	padding: 0 3%;
+}
+.uni-navbar--border::after {
+	background: #fff !important;
+}
+.swiper {
+	height: 300upx;
+	border-radius: 10upx;
+	width: 100%;
+}
+.swiper-item {
+	display: block;
+	height: 300upx;
+	line-height: 300upx;
+	text-align: center;
+	border-radius: 10upx;
+}
+swiper-item {
+	border-radius: 15upx;
+}
+.swiper-item image {
+	border-radius: 10upx;
+}
+.scrollswiper {
+	width: 90%;
+	margin: 20upx auto;
+	border-radius: 10upx;
+}
+
+.tips {
+	/* color: #303133;
+		font-size: 28upx;
+		text-align: center;
+		margin: 24upx 0; */
+	padding: 20upx 32upx 0 32upx;
+	display: flex;
+	justify-content: space-between;
+	font-size: 30upx;
+}
+
+.hotelList {
+	display: flex;
+	flex-direction: row;
+	padding: 24upx 32upx;
+}
+
+.hotleLeft {
+	width: 214upx;
+	height: 152upx;
+}
+
+.hotelright {
+	padding-left: 16upx;
+	display: flex;
+	flex-direction: column;
+	width: 100%;
+}
+
+.undertip {
+	display: flex;
+	flex-direction: row;
+	align-items: center;
+}
+.tipsTop {
+	border: 1upx solid #606266;
+	margin-right: 12upx;
+	color: #606266;
+	font-size: 22rpx;
+	border-radius: 5rpx;
+	padding: 0rpx 5rpx;
+}
+.placeholdercenter {
+	text-align: center;
+}
 </style>

+ 177 - 160
pages/index/searchresult.vue

@@ -1,179 +1,196 @@
 <template>
-	<view class="searchType" style="background: #fff;height: 100vh;">
-		 <van-cell value-class="searchclass">
-			 <template slot="title">
-				<view class="input-view">
-					<uni-icon type="search" size="22" color="#666666" />
-					<input confirm-type="search" class="input" type="text" placeholder="输入搜索关键词" 
-					@input="confirm" />
-				</view> 
-			 </template>
-			 <template>
-				 <view @click="search">搜索</view>
-			 </template>
-		 </van-cell>
-		 
-		 <view class="hotelList" v-for="(item,index) in hotelist" :key="index" @click="openinfo(item)">
-		 		 <view class="hotleLeft">									
-		 		 			 <image  style="width: 214upx;height: 152upx;" :src="pictureUrl+'/uploads/home/store/'+item.store_id+'/'+item.store_banner" />
-		 		 		 </view>
-		 		 		 <view class="hotelright">
-		 		 		 	<view style="font-size: 32upx;color: #303133;font-weight: 550;">{{item.store_name}}
-		 		 			</view>
-		 		 		    <view style="display: flex;flex-direction: row;justify-content: space-between;align-items: center;padding: 10rpx 0;">
-		 		 				<view style="font-size: 32upx; color: #303133;font-weight: 550;">{{item.store_servicecredit}}</view>
-		 		 				<view style="color: #606266;font-size: 24upx;">月访客{{item.store_visitor}}</view>
-		 		 				<view style="color: #606266;font-size: 24upx;">{{item.distance}}</view>
-		 		 			</view>
-		 		 			<view  v-if="item.tages.length!=1" class="undertip">
-		 		 				<view  v-for="(items,index) in item.tages" :key="index" class="tipsTop">{{items}}</view>
-		 		 			</view>
-		 		 </view>
-		 </view>
-	 </view>
+	<view class="searchType" style="background: #fff">
+		<view class="flex-box flex-v-ce tops">
+			<view class="input-view flex-1">
+				<uni-icon type="search" size="22" color="#666666" />
+				<input confirm-type="search" class="input" type="text" placeholder="输入搜索关键词" @input="confirm" @confirm="confirm" />
+			</view>
+			<view @click="search" class="search">取消</view>
+		</view>
+		<view style="margin-top: 108upx;">
+			<view class="hotelList" v-for="(item, index) in hotelist" :key="index" @click="openinfo(item)">
+				<view class="hotleLeft"><image style="width: 214upx;height: 152upx;" :src="pictureUrl + '/uploads/home/store/' + item.store_id + '/' + item.store_banner" /></view>
+				<view class="hotelright">
+					<view style="font-size: 32upx;color: #303133;font-weight: 550;">{{ item.store_name }}</view>
+					<view style="display: flex;flex-direction: row;justify-content: space-between;align-items: center;padding: 10rpx 0;">
+						<view style="font-size: 32upx; color: #303133;font-weight: 550;">{{ intToFloat(item.store_servicecredit) }}</view>
+						<view style="color: #606266;font-size: 24upx;">月访客{{ item.store_visitor }}</view>
+						<view style="color: #606266;font-size: 24upx;">{{ item.distance }}</view>
+					</view>
+					<view v-if="item.tages.length != 1" class="undertip">
+						<view v-for="(items, index) in item.tages" :key="index" class="tipsTop">{{ items }}</view>
+					</view>
+				</view>
+			</view>
+			<view v-if="hotelist.length == 0" class="noData">未找到内容</view>
+		</view>
+	</view>
 </template>
 
 <script>
-	import uniIcon from '@/component/uni-icon/uni-icon.vue'
-	export default {
-		components: {
-			uniIcon
+import uniIcon from '@/component/uni-icon/uni-icon.vue';
+export default {
+	components: {
+		uniIcon
+	},
+	onLoad(a) {
+		this.lat = a.lat;
+		this.lon = a.lon;
+		// this.gethotelist();
+	},
+	data() {
+		return {
+			lat: '',
+			lon: '',
+			pictureUrl: this.pictureUrl,
+			hotelist: [],
+			searchvalue: '',
+			page: 1
+		};
+	},
+	methods: {
+		intToFloat(val) {
+			return new Number(val).toFixed(1);
 		},
-		onLoad(a) {
-			this.lat = a.lat;
-			this.lon = a.lon;
-			
+		search() {
+			uni.navigateBack()
 		},
-		data() {
-			return {
-				lat: '',
-				lon: '',
-				pictureUrl: this.pictureUrl,
-				hotelist: [],
-				searchvalue:'',
-				page: 1
-			}
-		},
-		methods: {
-			search() {
+		confirm(e) {
+			if(e.detail.value){
 				this.hotelist = [];
-				this.gethotelist();
-			},
-			confirm(e) {
 				this.searchvalue = e.detail.value;
-				this.hotelist = [];
 				this.gethotelist();
-			},
-			// 跳转到新页面  酒店详情
-			openinfo(item) {
-						 let id = item.store_id;
-						  uni.navigateTo({
-						        url: `/pages/index/hotel?id=${id}`
-						  });
-			},
-			// 获取酒店列表
-					 gethotelist() {
-						 if(this.searchvalue == '') {
-							 this.$msg("关键字不能为空")
-							 return;
-						 }
-						 this.request({
-			                url:"/v2/entry/storeList",
-			                method:'get',
-			                data: {
-			                    page: this.page,
-							    page_size: 10,
-								lat: this.lat,
-								lon: this.lon,
-								keyword: this.searchvalue
-			                 },
-							success: (res) => {
-								 let { data,code } = res.data;
-								 if(code == 1000) {
-									 if(data.store_list.length<10) {
-										 this.ispull = false;
-									 }
-									 if(this.hotelist.length == 0) {
-										 this.hotelist = data.store_list
-									 }else {
-										 this.hotelist =  this.hotelist.concat(data.store_list);
-									 }
-									 
-								 }else {
-									 this.$msg("网络错误稍后再试")
-								 }
-							}
-					   })
-					 },
+			}else{
+				this.hotelist = [];
+			}
+		},
+		// 跳转到新页面  酒店详情
+		openinfo(item) {
+			let id = item.store_id;
+			uni.navigateTo({
+				url: `/pages/index/hotel?id=${id}`
+			});
+		},
+		// 获取酒店列表
+		gethotelist() {
+			uni.showLoading();
+			this.request({
+				url: '/v2/entry/storeList',
+				method: 'get',
+				data: {
+					page: this.page,
+					page_size: 10,
+					lat: this.lat,
+					lon: this.lon,
+					keyword: this.searchvalue ? this.searchvalue : ''
+				},
+				success: res => {
+					uni.hideLoading();
+					let { data, code } = res.data;
+					if (code == 1000) {
+						if (data.store_list.length < 10) {
+							this.ispull = false;
+						}
+						if (this.hotelist.length == 0) {
+							this.hotelist = data.store_list;
+						} else {
+							this.hotelist = this.hotelist.concat(data.store_list);
+						}
+					} else {
+						this.$msg('网络错误稍后再试');
+					}
+				}
+			});
 		}
 	}
+};
 </script>
 
 <style>
-	.searchType .input-view {
-		width: 80%;
-		display: flex;
-		background-color: #e7e7e7;
-		height: 30px;
-		border-radius: 15px;
-		padding: 0 4%;
-		flex-wrap: nowrap;
-		margin: 7px 0;
-		line-height: 30px;
-		margin: 24upx 0 24upx 32upx;
-	}
-	
-	.searchType .input-view .uni-icon {
-		line-height: 30px !important;
-	}
-	
-	.searchType .input-view .input {
-		height: 30px;
-		line-height: 30px;
-		width: 94%;
-		padding: 0 3%;
-	}
-	.van-cell__title {
-		flex: 6!important;
+	.tops {
+		position: fixed;
+		top: 0;
+		left: 0;
+		right: 0;
+		z-index: 999;
+		background: #fff;
+		border-bottom: 1px solid #f1f1f1;
 	}
-	.searchclass {
-		display: flex;
-		align-items: center;
-		justify-content: center;
+	.search {
+		color: #999;
+		padding: 0 32rpx;
 	}
-	.van-cell {
-		padding: 15upx 32upx 0 32upx!important;
-	}
-	.hotelList {
-		display: flex;
-		flex-direction: row;
-		padding: 24upx 32upx;
-	}
-		
-	.hotleLeft {
-		width: 214upx;
-		height: 152upx;
-	}
-		
-	.hotelright {
-		padding-left: 16upx;
-		display: flex;
-		flex-direction: column;
-		width: 100%;
-	}
-		
-	.undertip {
-		display: flex;
-		flex-direction: row;
-		align-items: center;
-	}
-	.tipsTop {
-		border: 2upx solid #BBBBBB;
-		margin-right: 14upx;
-		color: #BBBBBB;
-		padding: 4upx;
-	}
-	/* .van-cell__title {
+.noData {
+	margin-top: 30%;
+	text-align: center;
+	color: #999;
+}
+.searchType .input-view {
+	width: 80%;
+	display: flex;
+	background-color: #e7e7e7;
+	height: 30px;
+	border-radius: 15px;
+	padding: 0 4%;
+	flex-wrap: nowrap;
+	margin: 7px 0;
+	line-height: 30px;
+	margin: 24upx 0 24upx 32upx;
+}
+
+.searchType .input-view .uni-icon {
+	line-height: 30px !important;
+}
+
+.searchType .input-view .input {
+	height: 30px;
+	line-height: 30px;
+	width: 94%;
+	padding: 0 3%;
+}
+.van-cell__title {
+	flex: 6 !important;
+}
+.searchclass {
+	display: flex;
+	align-items: center;
+	justify-content: center;
+	position: sticky;
+	top: 0;
+}
+.van-cell {
+	padding: 15upx 32upx 0 32upx !important;
+}
+.hotelList {
+	display: flex;
+	flex-direction: row;
+	padding: 24upx 32upx;
+}
+
+.hotleLeft {
+	width: 214upx;
+	height: 152upx;
+}
+
+.hotelright {
+	padding-left: 16upx;
+	display: flex;
+	flex-direction: column;
+	width: 100%;
+}
+
+.undertip {
+	display: flex;
+	flex-direction: row;
+	align-items: center;
+}
+.tipsTop {
+	border: 2upx solid #bbbbbb;
+	margin-right: 14upx;
+	color: #bbbbbb;
+	padding: 4upx;
+}
+/* .van-cell__title {
 		flex: 6!important;
 	} */
 </style>

+ 62 - 31
pages/index/shop.vue

@@ -68,7 +68,11 @@
 							<view style="padding: 0 32upx;"><rich-text :nodes="datalist.goods_body"></rich-text></view>
 						</van-tab>
 						<van-tab :name="1" title="常见问题">
-							<view style="padding: 0 32upx;"><rich-text :nodes="datalist.issue"></rich-text></view>
+							<view style="padding: 0 32upx;">
+								
+								<rich-text v-if="datalist.issue" :nodes="datalist.issue"></rich-text>
+								<view v-else class="noData">暂无相关内容</view>
+							</view>
 						</van-tab>
 					</van-tabs>
 				</view>
@@ -122,7 +126,8 @@
 							<image style="width: 100%;height: 100%;" src="/static/bottombtn0101.png"></image>
 						</template>
 					</van-goods-action-icon>
-					<van-goods-action-icon icon="cart-o" @click="openCar" :info="cartnumber" />
+					<van-goods-action-icon icon="cart-o" @click="openCar"  v-if="cartnumber=='0'"/>
+					<van-goods-action-icon icon="cart-o" @click="openCar" :info="cartnumber" v-else/>
 					<van-goods-action-icon icon="star-o" v-if="has_collected == 0" @click="toFavorite" />
 					<van-goods-action-icon icon="star" v-if="has_collected == 1" icon-class="colored" @click="toFavorite" />
 					<van-goods-action-button color="#fff" class="font-text" @click="dianAddCar()" text="加入购物车"/>
@@ -130,7 +135,7 @@
 				</van-goods-action>
 			</View>
 			<Gobacktop @getop="getop" :bottomtop="2" v-if="isTop" />
-			<unipopup :images="images" :show="ishow" />
+			<!-- <unipopup :images="images" :show="ishow"/> -->
 		</van-skeleton>
 		<view class="home" v-if="isfx" @click="openHome()"><image src="../../static/bottombtn0101.png"></image></view>
 	</view>
@@ -255,8 +260,22 @@ export default {
 			});
 		},
 		shoupicture(item) {
-			this.images = this.pictureUrl + '/uploads/home/store/goods/' + item.goodsimage_url.substr(0, item.goodsimage_url.indexOf('\_')) + '/' + item.goodsimage_url;
-			this.ishow = true;
+			   // 预览图片
+			this.images = this.pictureUrl + '/uploads/home/store/goods/' + item.goodsimage_url.substr(0, item.goodsimage_url.indexOf('\_')) + '/' + item.goodsimage_url;   
+			uni.previewImage({
+				urls: [this.images],
+				longPressActions: {
+					itemList: ['发送给朋友', '保存图片', '收藏'],
+					success: function(data) {
+						console.log('选中了第' + (data.tapIndex + 1) + '个按钮,第' + (data.index + 1) + '张图片');
+					},
+					fail: function(err) {
+						console.log(err.errMsg);
+					}
+				}
+			});
+	
+			// this.ishow = true;
 		},
 		changeshow() {
 			this.ishow = false;
@@ -296,33 +315,40 @@ export default {
 				method: 'POST',
 				data: params,
 				success: res => {
-					console.log(res.data);
+					console.log(res.data.code);
 					let { data } = res.data;
-					this.cartnumber = data.cart;
-					// this.getNum();
-					this.has_collected = data.has_collected;
-					let array = data;
-					array.images.forEach(item => {
-						this.firstImg =this.pictureUrl + '/uploads/home/store/goods/' + item.goodsimage_url.substr(0, item.goodsimage_url.indexOf('\_')) + '/' + item.goodsimage_url;
-					});
-					if (array.spec_list.length == 0) {
-						this.datalist = data;
-						this.goods_id = data.goods_list[0].goods_id;
-						this.goods_storage = data.goods_storage;
-					} else {
-						array.spec_list[0].value_list.forEach((item, idx) => {
-							item.goods_storage = data.goods_list[idx].goods_storage;
-						});
-						this.datalist = array;
-					}
-					const regex1 = new RegExp('stlye="" ', 'gi');
-					this.datalist.goods_body = this.datalist.goods_body.replace(/\(<img\)/gi, '');
-					const regex = new RegExp('<img', 'gi');
-					this.datalist.goods_body = this.datalist.goods_body.replace(regex, `<img class="changeimg"`);
-					if (this.firstloading == 0) {
-						this.loading = false;
+					if(res.data.code == 1001){
+						this.$msg(res.data.cod);
+						setTimeout(function(){uni.navigateBack({delta: 1});},1000)
+					}else {
+						this.cartnumber = data.cart;
+						// this.getNum();
+						this.has_collected = data.has_collected;
+						let array = data;
+						if(array.images){
+							array.images.forEach(item => {
+								this.firstImg =this.pictureUrl + '/uploads/home/store/goods/' + item.goodsimage_url.substr(0, item.goodsimage_url.indexOf('\_')) + '/' + item.goodsimage_url;
+							});
+						}
+						if (array.spec_list.length == 0) {
+							this.datalist = data;
+							this.goods_id = data.goods_list[0].goods_id;
+							this.goods_storage = data.goods_storage;
+						} else {
+							array.spec_list[0].value_list.forEach((item, idx) => {
+								item.goods_storage = data.goods_list[idx].goods_storage;
+							});
+							this.datalist = array;
+						}
+						const regex1 = new RegExp('stlye="" ', 'gi');
+						this.datalist.goods_body = this.datalist.goods_body.replace(/\(<img\)/gi, '');
+						const regex = new RegExp('<img', 'gi');
+						this.datalist.goods_body = this.datalist.goods_body.replace(regex, `<img class="changeimg"`);
+						if (this.firstloading == 0) {
+							this.loading = false;
+						}
+						this.firstloading = 1;
 					}
-					this.firstloading = 1;
 				}
 			});
 		},
@@ -531,7 +557,7 @@ export default {
 			} else {
 				this.iScrolltop = 1;
 			}
-			if (e.detail.scrollTop > 400) {
+			if (e.detail.scrollTop > 250) {
 				this.isTop = true;
 			} else {
 				//当距离小于500时显示回到顶部按钮
@@ -578,6 +604,11 @@ export default {
 };
 </script>
 <style>
+	.noData {
+		margin: 15% 0;
+		text-align: center;
+		color: #999;
+	}
 	.font-text .van-button__text{
 		color: #222 !important;
 	}

+ 1 - 1
pages/myCenter/definite.vue

@@ -77,7 +77,7 @@
 				
 				// 滚动时触发
 				scroll(e) {
-					if(e.detail.scrollTop > 400) {
+					if(e.detail.scrollTop > 250) {
 						this.isTop = true;
 					}else{ //当距离小于500时显示回到顶部按钮
 						this.isTop = false;

+ 1 - 1
pages/myCenter/orderdetail.vue

@@ -376,7 +376,7 @@
 			
 			// 滚动时触发
 			scroll(e) {
-				if(e.detail.scrollTop > 400) {
+				if(e.detail.scrollTop > 250) {
 				          this.isTop = true;
 				        }else{ //当距离小于500时显示回到顶部按钮
 				          this.isTop = false;