Browse Source

调整首页

347617796@qq.com 4 years ago
parent
commit
d537ee7545

+ 1 - 1
pages.json

@@ -3,7 +3,7 @@
 		{
 			"path": "pages/index/index",
 			"style": {
-				"navigationBarTitleText": "首页",
+				"navigationBarTitleText": "圈在网商城",
 				"usingComponents": {
 					"van-search": "/wxcomponents/dist/search/index"
 				}

+ 9 - 3
pages/index/hotel.vue

@@ -114,9 +114,9 @@
 									<view v-if="storeinformation.store_address != ''">{{ storeinformation.store_address }}</view>
 									<view v-else>暂无</view>
 								</view>
-								<view class="newadress">
+								<view class="newadress" @click="openPhone">
 									<view>联系酒店</view>
-									<view v-if="storeinformation.store_phone != ''">{{ storeinformation.store_phone }}</view>
+									<view v-if="storeinformation.store_phone != ''" style="color: #D9332E;">{{ storeinformation.store_phone }}</view>
 									<view v-else>暂无</view>
 								</view>
 							</view>
@@ -263,6 +263,11 @@ export default {
 		...mapState(['hasLogin', 'userInfo', 'successlogion'])
 	},
 	methods: {
+		openPhone(){
+			uni.makePhoneCall({
+			    phoneNumber: this.storeinformation.store_phone //仅为示例
+			});
+		},
 		changeshow() {
 			this.showpicture = false;
 		},
@@ -377,7 +382,7 @@ export default {
 			});
 		},
 
-		// 获取商品详情
+		// 获取酒店商品列表
 		getshopdetail(e) {
 			this.request({
 				url: '/v2/entry/storeGoods',
@@ -467,6 +472,7 @@ export default {
 					store_id: this.goodId
 				},
 				success: res => {
+					
 					if (this.firstloading == 0) {
 						this.loading = false;
 					}

+ 54 - 20
pages/index/index.vue

@@ -20,7 +20,11 @@
 							{{ location }}
 						</view>
 					</view>
-					<button plain="true" style="border: none;" v-if="allow" @opensetting="handler" open-type="openSetting">定位失败,点击刷新</button>
+					<button class="btnOPne flex-box flex-v-ce" v-if="allow" @opensetting="handler" plain="true" open-type="openSetting">
+						<image src="../../static/setting.png" style="width: 40rpx; height: 40rpx;padding-right: 6upx;"></image>
+						定位失败,开启权限
+					</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">
@@ -34,7 +38,6 @@
 				<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>
@@ -87,7 +90,14 @@
 					</view>
 				</view>
 			</view>
-			<view v-if="allow" style="text-align: center;margin: 100upx 0;">定位失败暂时获取不到周边酒店信息哦</view>
+			<view v-if="allow" style="text-align: center;margin: 100upx 0;">
+				<image src="../../static/no_lon.png" style="width: 140upx;height: 140upx;" @click="refeshadress"></image>
+				<view style="color: #999;text-align: center;margin-bottom: 10upx;" @click="refeshadress">
+					<view>定位失败</view>
+					<view>请在手机上打开位置信息</view>
+					<view>或直接搜索当前入住的酒店</view>
+				</view>
+			</view>
 		</scroll-view>
 		
 		<unipopup :images="images" v-if="enable == 1" :show="ishow" />
@@ -146,14 +156,29 @@ export default {
 			timer: ''
 		};
 	},
+	onShareAppMessage(res) {
+		uni.showShareMenu({
+			withShareTicket: true
+		});
+		let that = this;
+		let id = this.goodId; // 酒店id
+		if (res.from === 'button') {
+			// 来自页面内分享按钮
+		}
+		return {
+			title: '圈在网',
+			path: `/pages/index/index`,
+			imageUrl: that.store_slide[0]
+		};
+	},
 	computed: {
 		...mapState(['hasLogin', 'userInfo', 'successlogion', 'beginload'])
 	},
 	onShow() {
 		if (this.successlogion && this.hasLogin) {
-			this.getuserinfo();
 			this.firstget();
 		}
+		this.isGetLocation();
 	},
 	onHide() {
 		clearInterval(this.timer);
@@ -162,20 +187,15 @@ export default {
 	onLoad() {
 		if (this.beginload) {
 			this.getpicture(); // 开机广告
-			if (this.allow) {
-			} else {
-				this.gethotelist(); // 酒店列表
-			}
 			this.amapPlugin = new amap.AMapWX({
 				key: this.key
 			});
-			this.isGetLocation(); // 检查是否开启定位权限
+			// this.isGetLocation(); // 检查是否开启定位权限
 			this.isUserInfo(); // 检查是否允许获取用户授权
 			this.getswiper(); // 获取首页轮播
 		}
 		if (this.successlogion && this.hasLogin) {
 			this.firstget();
-			this.getuserinfo();
 		}
 	},
 
@@ -185,14 +205,14 @@ export default {
 			this.amapPlugin = new amap.AMapWX({
 				key: this.key
 			});
-			this.isGetLocation(); // 检查是否开启定位权限
+			// this.isGetLocation(); // 检查是否开启定位权限
 			this.isUserInfo(); // 检查是否允许获取用户授权
 			this.getswiper(); // 获取首页轮播
 		},
 		hasLogin: function(val) {
 			if (val) {
 				this.firstget();
-				this.getuserinfo();
+				// this.getuserinfo();
 			}
 		}
 	},
@@ -208,7 +228,6 @@ export default {
 			});
 		},
 		getuserinfo() {
-			// let second = Math.round((Math.random()+1)*3);
 			this.timer = setInterval(() => {
 				this.request({
 					url: '/v2/member/info',
@@ -295,9 +314,14 @@ export default {
 				success: res => {
 					if (!res.authSetting[a]) {
 						// 每次进入程序判断当前是否获得授权,如果没有就去获得授权,如果获得授权,就直接获取当前地理位置
+						console.log("未授权")
+						
 						this.getAuthorizeInfo();
 					} else {
-						this.getRegeo();
+						if(this.allow){
+							console.log("授权了")
+							this.getRegeo();
+						}
 					}
 				}
 			});
@@ -316,17 +340,19 @@ export default {
 			});
 		},
 		getAuthorizeInfo(a = 'scope.userLocation') {
+			var that=this;
 			//uniapp弹窗弹出获取授权弹窗
 			uni.authorize({
 				scope: a,
 				success: res => {
 					//允许授权
-					this.getRegeo();
+					that.getRegeo();
 				},
-				fail() {
+				fail(err) {
+					console.log(err);
 					//拒绝授权
-					this.allow = true;
-					this.$msg('你拒绝了授权,无法获得周边信息');
+					that.allow = true;
+					that.$msg('你拒绝了授权,无法获得周边信息');
 				}
 			});
 		},
@@ -404,7 +430,6 @@ export default {
 		scan() {
 			uni.scanCode({
 				success: res => {
-					console.log(res.result);
 					if (res.scanType != 'QR_CODE') {
 						this.$msg('二维码错误');
 					} else {
@@ -463,7 +488,16 @@ export default {
 
 <style>
 
-
+.btnOPne{
+	height: 60upx;
+	line-height: 60upx;
+	border:1px solid #fff !important;
+	background-color: #fff !important;
+	/* font-size: 28upx; */
+	text-align: left;
+	padding: 0 10upx;
+	
+}
 .top .uni-navbar__header-btns {
 	width: 77% !important;
 }

+ 2 - 2
pages/index/shop.vue

@@ -33,7 +33,7 @@
 							<view style="display: flex;align-items: center;"><uni-icon size="18" type="arrowright"></uni-icon></view>
 						</view>
 					</view>
-					<view style="color: #909399;padding: 10upx 0 15upx 0;" v-if="datalist.points > 0">购买得{{ datalist.points }}圈币</view>
+					<view style="color: #909399;padding: 10upx 0 15upx 0;" v-if="datalist.points > 0">现金购买得{{ datalist.points }}圈币</view>
 					<view class="titleLayout price-box">
 						<view>
 							<text class="price-tip">¥</text>
@@ -1028,7 +1028,7 @@ page {
 	.layer {
 		position: fixed;
 		z-index: 99;
-		bottom: 100upx;
+		bottom: 140upx;
 		width: 100%;
 		border-radius: 10upx 10upx 0 0;
 		background-color: #fff;

+ 35 - 9
pages/myCenter/index.vue

@@ -39,10 +39,18 @@
 				<view class="orderOne"  @click="gomyorder(1)">
 					<image class="imagewidth" src="../../static/order_wat_pay.png" ></image>
 					<view>待付款</view>
+					<block v-if="num.waiting_count>0">
+						<text v-if="num.waiting_count<=99">{{num.waiting_count}}</text>
+						<text v-else>99+</text>
+					</block>
 				</view>
 				<view class="orderOne"  @click="gomyorder(2)">
 					<image class="imagewidth" src="../../static/order_handle.png"></image>
 					<view>处理中</view>
+					<block v-if="num.payed_count>0">
+						<text v-if="num.payed_count<=99">{{num.payed_count}}</text>
+						<text v-else>99+</text>
+					</block>
 				</view>
 				<view class="orderOne"  @click="gomyorder(3)">
 					<image class="imagewidth" src="../../static/order_comment.png"></image>
@@ -122,12 +130,6 @@
 				src="../../static/setting.png" />
 			</template>
 		</van-cell>
-		
-		<!-- <logionDialog @confirmDiaolog="confirmDiaolog"
-		 :ishow="false" @cancelDiaolog="cancelDiaolog"   @keepdialog="keepdialog"
-		 @changeDiaolog="changeDiaolog" :showdialog="showdialog"/> -->
-		 <!--  @keepdialog="keepdialog"
-		 @changeDiaolog="changeDiaolog" -->
 	</view>
 </template>
 
@@ -147,7 +149,8 @@
 				member_points: 0,
 				showdialog: false,
 				ishow: false,
-				menberinfo: {}
+				menberinfo: {},
+				num:{},//我的订单数量统计
 			}
 		},
 		computed:{
@@ -161,10 +164,9 @@
 		},
 		onShow() {
 			this.getuserinfo();
+			this.getNum();
 		},
 		onLoad() {
-			console.log(this.hasLogin)
-			console.log(this.userInfo)
 			if(this.successlogion && this.hasLogin) {
 				this.getuserinfo();
 		  	}else {
@@ -254,6 +256,15 @@
 					}
 				})
 			},
+			getNum(){
+				this.request({
+					url:'/v1/order/statistics',
+					method:'GET',
+					success: (res)=>{
+						this.num=res.data.data
+					}
+				})
+			},
 			// // 关闭弹窗
 			// cancelDiaolog() {
 			// 	this.showdialog = false;
@@ -414,10 +425,25 @@
 				flex: 1;
 				flex-direction: column;
 				text-align: center;
+				position: relative;
 				.imagewidth {
 					width: 44upx;
 					height: 44upx;
 				}
+				text{
+					position: absolute;
+					font-size: 20upx;
+					color: #fff;
+					background-color: #D9332E;
+					border-radius: 50upx;
+					top: 0;
+					right: -10upx;
+					padding: 0 4upx;
+					box-sizing: border-box;
+					white-space: nowrap;
+					text-align: center;
+					min-width:30upx;
+				}
 			}
 		}
 		

+ 1 - 1
pages/myCenter/information.vue

@@ -71,7 +71,7 @@
 					method: 'POST',
 					data: {
 						page: this.page,
-						page_size: 10
+						page_size: 20
 					},
 					success: (res) => {
 						

+ 405 - 378
pages/myOrder/index.vue

@@ -1,411 +1,438 @@
 <template>
 	<view>
-		<van-tabs :active="active"  @change="changeselect" style="width: 20%!important;">
-		  <van-tab v-for="(item, index) in menu" :name="index" :key="index" :title="item.name">
-		  </van-tab>
-		</van-tabs>
-		<van-skeleton  :loading="loading">
-		<scroll-view  v-if="order_list.length > 0" style="height: 95vh;" class="floor-list"
-		  :scroll-top="scrollTop" scroll-y="true"  @scroll="scroll"  @scrolltoupper="upper" @scrolltolower="lower"
-		 :refresher-enabled="false">
-		  <view v-for="(item,index) in order_list" :key="index"  class="cart-list">
-		   <view class="topTip" @click="goStore(item.store_id)">
-			   <view>
-				   <image v-if="item.store_avatar" :src="pictureUrl+'/uploads/home/store/'+item.store_id+'/'+item.store_avatar" style="border-radius: 50%;
-				   width: 50upx;height: 50upx;vertical-align: middle;"></image>
-				  <span style="padding-left: 16upx;">{{item.store_name}}</span>
-			   </view>
-			   <view style="color: #D9332E;font-size: 24upx;">{{item.status}}</view>
-		   </view>
-		   
-		   <view  @click="goDetail(item.order_id)" v-for="(items,indexs) in item.goods"  :key="indexs" class="shoplist" style="background-color: #fff;">
-			  <view>
-				  <van-card
-					title-class="changewidth"
-					price-class ="priceClass"
-					:price="items.goods_pay_price"
-					:desc="items.descire+'X'+items.goods_num"
-					:title="items.desarray"
-					:thumb="pictureUrl + '/uploads/home/store/goods/'+items.goods_image.substr(0, items.goods_image.indexOf('\_')) + '/' + items.goods_image"
-				  >
-				  </van-card>
-			  </view>
-		   </view>
-			   <view class="topTip">
-				  <view style="font-size: 28upx;">合计:{{item.order_amount}}</view>
-				  <view class="deleChange"  @click="gopay(item)" v-if="item.order_state == 10">去付款</view>
-				  <view class="deleChange"  @click="gopay(item)" v-if="item.order_state == 20&&item.shipping_type==0">催单</view>
-				  <view class="deleChange"  @click="gopay(item)" v-if="item.order_state == 20&&item.shipping_type!=0">联系酒店</view>
-				  <view class="deleChange"  @click="gopay(item)" v-if="item.order_state == 30">确认收货</view> 
-				  <view class="deleChange"  @click="gopay(item)" v-if="item.order_state == 40 && item.evaluation_state == 0">去评价</view>
-			   </view>
-		  </view>
-		  <view v-if="ispull"  class="fontcenter">加载中...</view>
-		  <view v-if="!ispull" style="padding: 20upx 0;" class="fontcenter">只有这么多订单啦</view>  
-		</scroll-view> 
-		 </van-skeleton>
-		<view  v-if="order_list.length == 0 && successlogion && hasLogin" >
-			  <view style="margin: 120upx auto;text-align: center;">
-					<van-icon size="160rpx" color="#909399" name="description" />
-					<view style="text-align: center;color: #909399;"> 去买点什么</view>
-			  </view>
+		<view class="header">
+			<van-tabs :active="active" @change="changeselect">
+<!-- 				<view v-for="(item, index) in menu" :key="index">
+					<van-tab v-if="num.waiting_count>0&&index==1" :name="index"  :info="num.waiting_count" :title="item.name"></van-tab>
+					<van-tab v-if="num.payed_count>0&&index==2" :name="index"  :info="num.payed_count" :title="item.name"></van-tab> -->
+					<van-tab v-for="(item, index) in menu" :key="index" :name="index" :info="num[index]" :title="item.name"></van-tab>
+				<!-- </view> -->
+			</van-tabs>
 		</view>
-		<view  v-if="order_list.length == 0 && !successlogion || order_list.length == 0 && !hasLogin" >
-			  <view style="margin: 120upx auto;text-align: center;">
-					<van-icon size="160rpx" color="#909399" name="description" />
-					<view style="text-align: center;color: #909399;">
-					<span style="color: #F76260;" @click="gotologion">请先登录</span></view>
-			  </view>
+		<van-skeleton :loading="loading">
+			<scroll-view
+				v-if="order_list.length > 0"
+				style="height:100vh;margin-top: 88upx;"
+				class="floor-list"
+				:scroll-top="scrollTop"
+				scroll-y="true"
+				@scroll="scroll"
+				@scrolltoupper="upper"
+				@scrolltolower="lower"
+				:refresher-enabled="false"
+			>
+				<view v-for="(item, index) in order_list" :key="index" class="cart-list">
+					<view class="topTip" @click="goStore(item.store_id)">
+						<view>
+							<image
+								v-if="item.store_avatar"
+								:src="pictureUrl + '/uploads/home/store/' + item.store_id + '/' + item.store_avatar"
+								style="border-radius: 50%;
+				   width: 50upx;height: 50upx;vertical-align: middle;"
+							></image>
+							<span style="padding-left: 16upx;">{{ item.store_name }}</span>
+						</view>
+						<view style="color: #D9332E;font-size: 24upx;">{{ item.status }}</view>
+					</view>
+
+					<view @click="goDetail(item.order_id)" v-for="(items, indexs) in item.goods" :key="indexs" class="shoplist" style="background-color: #fff;">
+						<view>
+							<van-card
+								title-class="changewidth"
+								price-class="priceClass"
+								:price="items.goods_pay_price"
+								:desc="items.descire + 'X' + items.goods_num"
+								:title="items.desarray"
+								:thumb="pictureUrl + '/uploads/home/store/goods/' + items.goods_image.substr(0, items.goods_image.indexOf('\_')) + '/' + items.goods_image"
+							></van-card>
+						</view>
+					</view>
+					<view class="topTip">
+						<view style="font-size: 28upx;">合计:{{ item.order_amount }}</view>
+						<view class="deleChange" @click="gopay(item)" v-if="item.order_state == 10">去付款</view>
+						<view class="deleChange" @click="gopay(item)" v-if="item.order_state == 20 && item.shipping_type == 0">催单</view>
+						<view class="deleChange" @click="gopay(item)" v-if="item.order_state == 20 && item.shipping_type != 0">联系酒店</view>
+						<view class="deleChange" @click="gopay(item)" v-if="item.order_state == 30">确认收货</view>
+						<view class="deleChange" @click="gopay(item)" v-if="item.order_state == 40 && item.evaluation_state == 0">去评价</view>
+					</view>
+				</view>
+				<view v-if="ispull" class="fontcenter">加载中...</view>
+				<view v-if="!ispull" style="padding: 20upx 0;" class="fontcenter">只有这么多订单啦</view>
+			</scroll-view>
+		</van-skeleton>
+		<view v-if="order_list.length == 0 && successlogion && hasLogin">
+			<view style="margin: 160upx auto;text-align: center;">
+				<van-icon size="160rpx" color="#909399" name="description" />
+				<view style="text-align: center;color: #909399;">去买点什么</view>
+			</view>
+		</view>
+		<view v-if="(order_list.length == 0 && !successlogion) || (order_list.length == 0 && !hasLogin)">
+			<view style="margin: 160upx auto;text-align: center;">
+				<van-icon size="160rpx" color="#909399" name="description" />
+				<view style="text-align: center;color: #909399;"><span style="color: #F76260;" @click="gotologion">请先登录</span></view>
+			</view>
 		</view>
 		<!-- 催单 -->
-		<Dialog  :orderCancel="orderCancel"
-		    :titles="titles"
-		    @colseDialog="cancelDialog" 
-		    @confirmPay="confirmOrder"
-		 />
-		 <Gobacktop @getop="getop" v-if="isTop" />
+		<Dialog :orderCancel="orderCancel" :titles="titles" @colseDialog="cancelDialog" @confirmPay="confirmOrder" />
+		<Gobacktop @getop="getop" v-if="isTop" />
 	</view>
 </template>
 
 <script>
-	import {
-		mapMutations,mapState
-	} from 'vuex'
-	import Dialog from '@/component/Dialog.vue'
-	import Gobacktop from '@/component/Gobacktop.vue'
-	export default{
-		components: {
-			Dialog,
-			Gobacktop
-		},
-		data() {
-			return {
-				firstloading: 0,
-				loading: true,
-				isTop: false,
-				ispull: true,
-				showdialog: false,
-				orderCancel: false,
-				titles:'',
-				pictureUrl: this.pictureUrl,
-				menu:[
-					{name:'全部'},
-					{name:'待支付'},
-					{name:'处理中'},
-					{name:'已收货'},
-					{name:'已取消'},
-					// s{name:'退款售后'}
-				],
-				deleteorder: 0, // 判断删除订单还是确认收货
-				// 要查找的订单状态 all-全部 waiting-待支付 payed-处理中 complete-已收货 cancel-已取消 refund-退款售后
-				active: 0,
-				scrollTop: 0,
-				old: {
-					scrollTop: 0
-				},
-				order_id:'',
-				page: 1,
-				page_size: 10,
-				state: 'all',
-				order_list:[]
+import { mapMutations, mapState } from 'vuex';
+import Dialog from '@/component/Dialog.vue';
+import Gobacktop from '@/component/Gobacktop.vue';
+export default {
+	components: {
+		Dialog,
+		Gobacktop
+	},
+	data() {
+		return {
+			firstloading: 0,
+			loading: true,
+			isTop: false,
+			ispull: true,
+			showdialog: false,
+			orderCancel: false,
+			titles: '',
+			pictureUrl: this.pictureUrl,
+			menu: [
+				{ name: '全部' },
+				{ name: '待支付' },
+				{ name: '处理中' },
+				{ name: '已收货' },
+				{ name: '已取消' }
+				// s{name:'退款售后'}
+			],
+			deleteorder: 0, // 判断删除订单还是确认收货
+			// 要查找的订单状态 all-全部 waiting-待支付 payed-处理中 complete-已收货 cancel-已取消 refund-退款售后
+			active: 0,
+			scrollTop: 0,
+			old: {
+				scrollTop: 0
+			},
+			order_id: '',
+			page: 1,
+			page_size: 10,
+			state: 'all',
+			order_list: [],
+			num:[],
+		};
+	},
+	computed: {
+		...mapState(['hasLogin', 'userInfo', 'successlogion'])
+	},
+	onLoad(a) {
+		uni.$on('refehlist', () => {
+			this.order_list = [];
+			this.getlist();
+		});
+
+		uni.$on('finshlist', () => {
+			this.page = 1;
+			this.order_list = [];
+			this.getlist();
+		});
+
+		// 完成评价
+		uni.$on('finshesitmate', () => {
+			this.page = 1;
+			this.order_list = [];
+			this.getlist();
+		});
+		if (this.successlogion && this.hasLogin) {
+			this.getlist(); // 获取订单
+		} else {
+			uni.navigateTo({
+				url: '/pages/myCenter/logion'
+			});
+		}
+	},
+	onUnload() {
+		uni.$off();
+	},
+	onShow(){
+		this.getNum();
+	},
+
+	watch: {
+		successlogion: function(val) {
+			if (val) {
+				this.active = 0;
+				this.getlist();
+			} else {
+				uni.navigateTo({
+					url: '/pages/myCenter/logion'
+				});
 			}
 		},
-		computed:{
-			...mapState([
-			  'hasLogin',
-			  'userInfo',
-			  'successlogion'
-			]),
-		},
-		onLoad(a) {
-			 uni.$on("refehlist",()=>{
-				  this.order_list = [];
-			      this.getlist();
-			  })
-			
-			  uni.$on("finshlist",()=>{
-				  this.page = 1;
-			  	  this.order_list = [];
-			      this.getlist();
-			   })
-			 
-			  // 完成评价 
-			  uni.$on("finshesitmate",()=>{
-				   this.page = 1;
-				   this.order_list = [];
-			       this.getlist();
-			   })
-			if(this.successlogion && this.hasLogin) {
-				this.getlist(); // 获取订单
-		  	}else {
+		hasLogin: function(val) {
+			if (val) {
+				this.active = 0;
+				this.getlist();
+			} else {
 				uni.navigateTo({
 					url: '/pages/myCenter/logion'
-				})
+				});
 			}
+		}
+	},
+	methods: {
+		getNum(){
+			this.request({
+				url:'/v1/order/statistics',
+				method:'GET',
+				success: (res)=>{
+					this.$nextTick(function(){
+						var data=res.data.data;
+						var waiting_count=data.waiting_count>0? data.waiting_count:null;
+						var payed_count=data.payed_count>0? data.payed_count:null;
+						this.num=[null,waiting_count,payed_count,null,null];
+					})
+				}
+			})
 		},
-		onUnload() {
-			uni.$off();
+		getop() {
+			this.scrollTop = this.old.scrollTop;
+			this.$nextTick(function() {
+				this.scrollTop = 0;
+			});
+			this.isTop = false;
 		},
-		
-		watch:{
-			'successlogion':function(val) {
-			   if(val) {
-				  this.active = 0;
-				  this.getlist(); 
-			   }else {
-				  uni.navigateTo({
-				  	url: '/pages/myCenter/logion'
-				  })
-			   }
-			},
-			'hasLogin':function(val) {
-			   if(val) {
-				  this.active = 0;
-				  this.getlist(); 
-			   }else {
-				  uni.navigateTo({
-				  	url: '/pages/myCenter/logion'
-				  })
-			   }
-			},
-			
+		gotologion() {
+			uni.navigateTo({
+				url: '/pages/myCenter/logion'
+			});
 		},
-		methods: {
-			getop() {
-			        this.scrollTop = this.old.scrollTop
-			                this.$nextTick(function(){
-			                    this.scrollTop=0;
-			                });
-			        this.isTop = false;
-			      },
-			gotologion() {
+		changeselect(e) {
+			if (this.successlogion && this.hasLogin) {
+				this.active = e.target.name;
+				this.page = 1;
+				this.ispull = true;
+				this.order_list = [];
+				if (e.target.name == 0) {
+					this.state = 'all';
+					this.getlist();
+				} else if (e.target.name == 1) {
+					this.state = 'waiting';
+					this.getlist();
+				} else if (e.target.name == 2) {
+					this.state = 'payed';
+					this.getlist();
+				} else if (e.target.name == 3) {
+					this.state = 'complete';
+					this.getlist();
+				} else if (e.target.name == 4) {
+					this.state = 'cancel';
+					this.getlist();
+				}
+				if (e.target.name == 5) {
+					this.state = 'refund';
+				}
+			} else {
 				uni.navigateTo({
 					url: '/pages/myCenter/logion'
-				})
-			},
-			changeselect(e) {
-				if(this.successlogion && this.hasLogin) {
-					  this.active = e.target.name;
-					  this.page = 1;
-					  this.ispull = true;
-					  this.order_list = [];
-					  if(e.target.name == 0) {
-						this.state = 'all';
-						this.getlist();
-					  }else if(e.target.name == 1) {
-						this.state = 'waiting';
-						this.getlist();
-					  }else if(e.target.name == 2) {
-						this.state = 'payed';
-						this.getlist();
-					  }else if(e.target.name == 3) {
-						this.state = 'complete';
-						this.getlist();
-					  }else if(e.target.name == 4) {
-						this.state = 'cancel';
-						this.getlist();
-					  }
-					  if(e.target.name == 5) {
-					  	this.state = 'refund';
-					  }
-				}else {
-					uni.navigateTo({
-						url: '/pages/myCenter/logion'
-					})
+				});
+			}
+		},
+
+		// 订单退款售后列表
+		refund() {
+			this.request({
+				url: '/v3/order/refund_list',
+				method: 'POST',
+				data: {
+					state: this.state,
+					page: this.page,
+					page_size: 10
+				},
+				success: res => {
+					if (res.data.data.refund_list.length < 10) {
+						this.ispull = false;
+					}
+					res.data.data.refund_list.forEach((item, index) => {
+						let arr = item.goods_name.split(' ');
+						item.desarray = arr[0];
+						item.descire = item.goods_name.replace(arr[0], '');
+					});
+					this.order_list = this.order_list.concat(res.data.data.refund_list);
 				}
-				
-			},
-			
-			// 订单退款售后列表
-			refund() {
-				this.request({
-					url: '/v3/order/refund_list',
-					method: 'POST',
-					data: {
-						state: this.state,
-						page: this.page,
-						page_size: 10
-					},
-					success: (res) => {
-						if(res.data.data.refund_list.length< 10) {
-							this.ispull = false;
-						}
-						res.data.data.refund_list.forEach((item,index) => {
-								let arr = item.goods_name.split(' ');
-								item.desarray = arr[0];
-								item.descire = item.goods_name.replace(arr[0], '');
-						})
-						this.order_list = this.order_list.concat(res.data.data.refund_list);
+			});
+		},
+		// 订单列表
+		getlist() {
+			this.request({
+				url: '/v2/order/orders',
+				method: 'POST',
+				data: {
+					state: this.state,
+					page: this.page,
+					page_size: 10
+				},
+				success: res => {
+					if (res.data.data.order_list.length < 10) {
+						this.ispull = false;
 					}
-				})
-			},
-			// 订单列表
-			getlist() {
-				this.request({
-					url: '/v2/order/orders',
-					method: 'POST',
-					data: {
-						state: this.state,
-						page: this.page,
-						page_size: 10
-					},
-					success: (res) => {
-						if(res.data.data.order_list.length< 10) {
-							this.ispull = false;
-						}
-						res.data.data.order_list.forEach((item,index) => {
-							item.goods.forEach(items => {
-								let arr = items.goods_name.split(' ');
-								items.desarray = arr[0];
-								items.descire = items.goods_name.replace(arr[0], '');
-							})
-						})
-					    if(this.firstloading == 0) {
-					    	this.loading = false;
-					    }
-					    this.firstloading = 1;
-						this.order_list = this.order_list.concat(res.data.data.order_list);
+					res.data.data.order_list.forEach((item, index) => {
+						item.goods.forEach(items => {
+							let arr = items.goods_name.split(' ');
+							items.desarray = arr[0];
+							items.descire = items.goods_name.replace(arr[0], '');
+						});
+					});
+					if (this.firstloading == 0) {
+						this.loading = false;
 					}
-				})
-			},
-			gopay(e) {
-				let store_id = e.store_id;
-				let prices = e.order_amount;
-				this.order_id = e.order_id;
-				let order_id = e.order_id;
-			    let isform = 1;
-				if(e.operate == '去付款') {
-					uni.navigateTo({
-				      url:`/pages/myOrder/paymoment?order_id=${order_id}&prices=${prices}
-					  &isform=${isform}&store_id=${store_id}`
-				    })
-				}else if(e.operate == '删除') {
-					this.titles = '确认删除订单?'
-					this.deleteorder = 1;
-					this.orderCancel = true;
-				}else if(e.operate == '催单') {
-					let a = 1;
-					uni.navigateTo({
-							url:`/pages/myOrder/reminder?order_id=${order_id}&a=${a}`
-					})
-				}else if(e.operate == '确认收货') {
-					this.deleteorder = 2;
-					this.titles = '确认收货?'
-					this.orderCancel = true;
-				}else if(e.operate == '去评价') {
-					uni.navigateTo({
-							url:`/pages/myOrder/estimate?order_id=${order_id}`
-					})
-					
-				}else if(e.operate == '联系酒店') {
-					let a = 2;
-					uni.navigateTo({
-							url:`/pages/myOrder/reminder?order_id=${order_id}&a=${a}`
-					})
+					this.firstloading = 1;
+					this.order_list = this.order_list.concat(res.data.data.order_list);
 				}
-			},
-			cancelDialog() {
-				this.orderCancel = false;
-			},
-			confirmOrder() {
-				// 删除订单 确认收货
-				this.orderCancel = false;
-				let url = this.deleteorder == 1?'/v2/order/drop':'/v2/order/confirm';
-				this.request({
-					url: url,
-					method:'POST',
-					data: {
-						order_id: this.order_id
-					},
-					success: (res) => {
-						this.order_list = [];
-						this.page = 1;
-						this.ispull = true;
-						this.getlist();
-					}
-				})
-			},
-			goDetail(e) {
-				let order_id = e; 
+			});
+		},
+		gopay(e) {
+			let store_id = e.store_id;
+			let prices = e.order_amount;
+			this.order_id = e.order_id;
+			let order_id = e.order_id;
+			let isform = 1;
+			if (e.operate == '去付款') {
 				uni.navigateTo({
-				        url: `/pages/myOrder/order?id=${order_id}`
+					url: `/pages/myOrder/paymoment?order_id=${order_id}&prices=${prices}
+					  &isform=${isform}&store_id=${store_id}`
 				});
-			},
-			goStore(e) {
-				let id = e; 
-				 uni.navigateTo({
-				       url: `/pages/index/hotel?id=${id}`
-				 });
-			},
-			upper(e) {
-			},
-			
-			// 滚到底部
-			lower(e) {
-				if(this.ispull) {
-					this.page += 1;
+			} else if (e.operate == '删除') {
+				this.titles = '确认删除订单?';
+				this.deleteorder = 1;
+				this.orderCancel = true;
+			} else if (e.operate == '催单') {
+				let a = 1;
+				uni.navigateTo({
+					url: `/pages/myOrder/reminder?order_id=${order_id}&a=${a}`
+				});
+			} else if (e.operate == '确认收货') {
+				this.deleteorder = 2;
+				this.titles = '确认收货?';
+				this.orderCancel = true;
+			} else if (e.operate == '去评价') {
+				uni.navigateTo({
+					url: `/pages/myOrder/estimate?order_id=${order_id}`
+				});
+			} else if (e.operate == '联系酒店') {
+				let a = 2;
+				uni.navigateTo({
+					url: `/pages/myOrder/reminder?order_id=${order_id}&a=${a}`
+				});
+			}
+		},
+		cancelDialog() {
+			this.orderCancel = false;
+		},
+		confirmOrder() {
+			// 删除订单 确认收货
+			this.orderCancel = false;
+			let url = this.deleteorder == 1 ? '/v2/order/drop' : '/v2/order/confirm';
+			this.request({
+				url: url,
+				method: 'POST',
+				data: {
+					order_id: this.order_id
+				},
+				success: res => {
+					this.order_list = [];
+					this.page = 1;
+					this.ispull = true;
 					this.getlist();
 				}
-				
-			},
-			
-			// 滚动时触发
-			scroll(e) {
-				if(e.detail.scrollTop > 400) {
-				          this.isTop = true;
-				        }else{ //当距离小于500时显示回到顶部按钮
-				          this.isTop = false;
-				        }
-				
-				        this.old.scrollTop = e.detail.scrollTop
+			});
+		},
+		goDetail(e) {
+			let order_id = e;
+			uni.navigateTo({
+				url: `/pages/myOrder/order?id=${order_id}`
+			});
+		},
+		goStore(e) {
+			let id = e;
+			uni.navigateTo({
+				url: `/pages/index/hotel?id=${id}`
+			});
+		},
+		upper(e) {},
+
+		// 滚到底部
+		lower(e) {
+			if (this.ispull) {
+				this.page += 1;
+				this.getlist();
+			}
+		},
+
+		// 滚动时触发
+		scroll(e) {
+			if (e.detail.scrollTop > 400) {
+				this.isTop = true;
+			} else {
+				//当距离小于500时显示回到顶部按钮
+				this.isTop = false;
 			}
+
+			this.old.scrollTop = e.detail.scrollTop;
 		}
-		
 	}
+};
 </script>
-  
+
 <style>
-	page {
-		background-color: #F5F5F5;
-	}
-	.cart-list {
-		background-color: #fff;
-		border-top: 12upx solid #F5F5F5;
-	}
-		
-	.topTip {
-		display: flex;
-		align-items: center;
-		justify-content: space-between;
-		padding: 20upx 36upx;
-		border-bottom: 1px solid #F5F5F5;
-	}
-	.changewidth {
-		color: #303133;
-		font-size: 32upx;
-		font-weight: 100!important;
-	}
-		
-	.van-card__desc {
-		font-size: 25rpx;
-		color: #999!important;
-		padding-top: 10rpx;
-	}
-	
-	.van-card {
-		background-color: #fff!important;
-	}
-	.shoplist {
-		display: flex;
-		justify-content: space-between;
-		align-items: center;
-	}
-	.deleChange {
-		border: 1px solid #C0C4CC;
-		padding: 8upx;
-	}
-		
-	.van-tab {
-		flex-basis: 20%!important;
-	}
+.header{
+	position: fixed;
+	top: 0;
+	left: 0;
+	right: 0;
+	z-index: 999;
+	background-color: #fff;
+}	
+page {
+	background-color: #f5f5f5;
+}
+.cart-list {
+	background-color: #fff;
+	border-top: 12upx solid #f5f5f5;
+}
+
+.topTip {
+	display: flex;
+	align-items: center;
+	justify-content: space-between;
+	padding: 20upx 36upx;
+	border-bottom: 1px solid #f5f5f5;
+}
+.changewidth {
+	color: #303133;
+	font-size: 32upx;
+	font-weight: 100 !important;
+}
+
+.van-card__desc {
+	font-size: 25rpx;
+	color: #999 !important;
+	padding-top: 10rpx;
+}
+
+.van-card {
+	background-color: #fff !important;
+}
+.shoplist {
+	display: flex;
+	justify-content: space-between;
+	align-items: center;
+}
+.deleChange {
+	border: 1px solid #c0c4cc;
+	padding: 8upx;
+}
+
+.van-tab {
+	flex-basis: 20% !important;
+	padding: 0 2px !important;
+}
 </style>

+ 1 - 1
pages/myOrder/order.vue

@@ -81,7 +81,7 @@
 					<text class="time" v-else>{{ detail.finnshed_time }}</text>
 				</view>
 			</view>
-
+			<view style="height: 300upx;background-color: #fff;"></view>
 			<view class="adressbutton">
 				<view class="buttonStatus">
 					<view @click="returnmoney()" v-if="detail.order_state == 20" class="deleteOrder">退款</view>

+ 195 - 195
pages/myone/oneIndex.vue

@@ -1,210 +1,210 @@
 <template>
-   <view>
-	   <view  class="searchType" style="background: #fff;">
-	   	 <view class="input-view">
-	   	 	<uni-icon type="search" size="22" color="#666666" />
-	   	 	<input disabled="true"  confirm-type="search" class="input" type="text" placeholder="搜索文章" @click="confirm" />
-	   	 </view>
-	    </view>
-	   <view>
-		   <van-tabs :active="active" @change="onChange">
-			 <van-tab  v-for="(item,index) in typelist"  :key="index" :name="index" :title="item.ac_name"></van-tab>
-		   </van-tabs>
-	   </view>
-		  <scroll-view  class="floor-list"
-		   :scroll-top="scrollTop" style="height: 90vh;" scroll-y="true"  @scroll="scroll"  @scrolltoupper="upper" @scrolltolower="lower"
-		   :refresher-enabled="false">
-			<view v-for="(item,indedx) in acrelist" :key="indedx" @click="goIndex(item)">
-			   <view class="hotelList">
-					 <view class="hotleLeft">
-						 <image  style="width: 214upx;height: 152upx;" :src=" pictureUrl + '/' + item.article_thumb"/>
-					 </view>
-					 <view class="hotelright">
-						<view style="font-size: 28upx;color: #303133;">{{item.article_title}}</view>
-						<view style="color: #999;">
-						   {{item.article_time}}
-						</view>
-			          </view>
+	<view>
+		<view class="searchType" style="background: #fff;">
+			<view class="input-view">
+				<uni-icon type="search" size="22" color="#666666" />
+				<input disabled="true" confirm-type="search" class="input" type="text" placeholder="搜索文章" @click="confirm" />
 			</view>
+		</view>
+		<view>
+			<van-tabs :active="active" @change="onChange"><van-tab v-for="(item, index) in typelist" :key="index" :name="index" :title="item.ac_name"></van-tab></van-tabs>
+		</view>
+		<scroll-view
+			class="floor-list"
+			:scroll-top="scrollTop"
+			style="height: calc(100vh - 100px);"
+			scroll-y="true"
+			@scroll="scroll"
+			@scrolltoupper="upper"
+			@scrolltolower="lower"
+			:refresher-enabled="false"
+		>
+			<view v-for="(item, indedx) in acrelist" :key="indedx" @click="goIndex(item)">
+				<view class="hotelList">
+					<view class="hotleLeft"><image style="width: 214upx;height: 152upx;" :src="pictureUrl + '/' + item.article_thumb" /></view>
+					<view class="hotelright">
+						<view style="font-size: 28upx;color: #303133;">{{ item.article_title }}</view>
+						<view style="color: #999;">{{ item.article_time }}</view>
+					</view>
+				</view>
 			</view>
-			  <view v-if="ispull"  class="fontcenter">加载中...</view>
-			  <view v-if="!ispull" style="padding: 0 15upx;" class="fontcenter">没有更多文章了</view>
-		 </scroll-view>
-		 <Gobacktop @getop="getop" v-if="isTop" />
-
-   </view>
+			<view v-if="!ispull" style="padding: 0 15upx;" class="fontcenter">没有更多文章了</view>
+		</scroll-view>
+		<!-- 		 <view v-if="ispull"  class="fontcenter">加载中...</view> -->
+		<Gobacktop @getop="getop" v-if="isTop" />
+	</view>
 </template>
 <script>
-	import uniIcon from '@/component/uni-icon/uni-icon.vue'
-	import Gobacktop from '@/component/Gobacktop.vue'
+import uniIcon from '@/component/uni-icon/uni-icon.vue';
+import Gobacktop from '@/component/Gobacktop.vue';
 
-	export default {
-		components: {
-			uniIcon,
-			Gobacktop
+export default {
+	components: {
+		uniIcon,
+		Gobacktop
+	},
+	data() {
+		return {
+			pictureUrl: this.pictureUrl,
+			page: 1,
+			page_size: 10,
+			ac_id: '',
+			keyword: '',
+			active: 0,
+			scrollTop: 0,
+			old: {
+				scrollTop: 0
+			},
+			isTop: false,
+			typelist: [],
+			acrelist: [],
+			ispull: true
+		};
+	},
+	onLoad() {
+		this.getype(); // 获取文章分类
+		this.getlist(); // 获取文章列表
+	},
+	methods: {
+		getop() {
+			this.scrollTop = this.old.scrollTop;
+			this.$nextTick(function() {
+				this.scrollTop = 0;
+			});
+			this.isTop = false;
 		},
-		data() {
-			return {
-				pictureUrl: this.pictureUrl,
-				page: 1,
-				page_size: 10,
-				ac_id:'',
-				keyword:'',
-				active: 0,
-				scrollTop: 0,
-				old: {
-					scrollTop: 0
-				},
-				isTop: false,
-				typelist:[],
-				acrelist:[],
-				ispull: true
-		    }
-	    },
-		onLoad() {
-			this.getype(); // 获取文章分类
-			this.getlist(); // 获取文章列表
+		goIndex(items) {
+			let article_id = items.article_id;
+			let article_thumb = items.article_thumb;
+			let ac_id = items.ac_id;
+			let name = '';
+			this.typelist.forEach((item, index) => {
+				if (item.ac_id == ac_id) {
+					name = item.ac_name;
+				}
+			});
+			//  :src=" pictureUrl + '/' + item.article_thumb"
+			uni.navigateTo({
+				url: `/pages/myone/onedetail?id=${article_id}&name=${name}&article_thumb=${article_thumb}`
+			});
 		},
-		methods: {
-			getop() {
-			        this.scrollTop = this.old.scrollTop
-			                this.$nextTick(function(){
-			                    this.scrollTop=0;
-			                });
-			        this.isTop = false;
-			      },
-			goIndex(items) {
-				let article_id = items.article_id;
-				let article_thumb =items.article_thumb;
-				let ac_id = items.ac_id;
-				let name = '';
-				this.typelist.forEach((item, index) => {
-					if(item.ac_id == ac_id) {
-						name = item.ac_name;
-					}
-				})
-				//  :src=" pictureUrl + '/' + item.article_thumb"
-				uni.navigateTo({
-				        url: `/pages/myone/onedetail?id=${article_id}&name=${name}&article_thumb=${article_thumb}`
-				});
-			},
-			getype() {
-				this.request({
-					url: '/v1/entry/news_cate',
-					method:'POST',
-					success: (res) => {
-						let array = [{ac_name:'全部'}];
-						this.typelist = array.concat(res.data.data);
-					}
-				})
-			},
-			getlist() {
-				this.request({
-					url: '/v1/entry/news',
-					method:'POST',
-					data: {
-						page: this.page,
-						page_size: this.page_size,
-						ac_id: this.ac_id,
-						keyword: this.keyword
-					},
-					success: (res) => {
-						let { data }  = res.data;
-						if(data.total_page == data.current_page) {
-							this.ispull = false;
-						}
-						this.acrelist = this.acrelist.concat(data.new_list);
+		getype() {
+			this.request({
+				url: '/v1/entry/news_cate',
+				method: 'POST',
+				success: res => {
+					let array = [{ ac_name: '全部' }];
+					this.typelist = array.concat(res.data.data);
+				}
+			});
+		},
+		getlist() {
+			this.request({
+				url: '/v1/entry/news',
+				method: 'POST',
+				data: {
+					page: this.page,
+					page_size: this.page_size,
+					ac_id: this.ac_id,
+					keyword: this.keyword
+				},
+				success: res => {
+					let { data } = res.data;
+					if (data.total_page == data.current_page) {
+						this.ispull = false;
 					}
-				})
-			},
-			
-			confirm() {
-				uni.navigateTo({
-					url: './ariclle'
-				})
-			},
-			onChange(event) {
-				this.active = event.detail.name;
-				if( event.detail.name == 0) {
-					this.ac_id = '';
-				}else {
-					let items = this.typelist[this.active];
-					this.ac_id = items.ac_id;
+					this.acrelist = this.acrelist.concat(data.new_list);
 				}
-				this.active = event.detail.name;
-				this.ispull = true;
-				this.page = 1;
-				this.acrelist = [];
+			});
+		},
+
+		confirm() {
+			uni.navigateTo({
+				url: './ariclle'
+			});
+		},
+		onChange(event) {
+			this.active = event.detail.name;
+			if (event.detail.name == 0) {
+				this.ac_id = '';
+			} else {
+				let items = this.typelist[this.active];
+				this.ac_id = items.ac_id;
+			}
+			this.active = event.detail.name;
+			this.ispull = true;
+			this.page = 1;
+			this.acrelist = [];
+			this.getlist();
+		},
+
+		// 滚动到顶部
+		upper(e) {
+			console.log(e);
+			console.log('顶部');
+		},
+
+		// 滚到底部
+		lower(e) {
+			this.page = this.page + 1;
+			if (this.ispull) {
 				this.getlist();
-			},
-			
-			// 滚动到顶部
-			upper(e) {
-				console.log(e)
-				console.log("顶部")
-			},
-			
-			// 滚到底部
-			lower(e) {
-				this.page = this.page + 1;
-				if(this.ispull) {
-					this.getlist();
-				}
-			},
-			
-			// 滚动时触发
-			scroll(e) {
-				if(e.detail.scrollTop > 400) {
-				          this.isTop = true;
-				        }else{ //当距离小于500时显示回到顶部按钮
-				          this.isTop = false;
-				        }
-				this.old.scrollTop = e.detail.scrollTop
-			},
+			}
+		},
+
+		// 滚动时触发
+		scroll(e) {
+			if (e.detail.scrollTop > 400) {
+				this.isTop = true;
+			} else {
+				//当距离小于500时显示回到顶部按钮
+				this.isTop = false;
+			}
+			this.old.scrollTop = e.detail.scrollTop;
 		}
-    }
+	}
+};
 </script>
 <style>
-	
-	.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%;
-		justify-content: space-between;
-	}
-	.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: 24upx auto;
-	}
-	
-	.searchType .input-view .uni-icon {
-		line-height: 30px !important;
-	}
-	
-	.searchType .input-view .input {
-		height: 30px;
-		line-height: 30px;
-		width: 94%;
-		padding: 0 3%;
-	}
+.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%;
+	justify-content: space-between;
+}
+.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: 24upx auto;
+}
+
+.searchType .input-view .uni-icon {
+	line-height: 30px !important;
+}
+
+.searchType .input-view .input {
+	height: 30px;
+	line-height: 30px;
+	width: 94%;
+	padding: 0 3%;
+}
 </style>