Explorar o código

数据提前加载

wcni %!s(int64=5) %!d(string=hai) anos
pai
achega
354d7b8ce7

+ 46 - 9
component/openpictrue.vue

@@ -1,13 +1,34 @@
 <template>
 	<view>
-		<view class="example">
-			<uniPopup :show="type" position="middle" mode="insert" @hidePopup="togglePopup('')">
+		<view class="example" @click="togglePopup('')">
+			<uniPopup :show="types" position="middle" mode="insert" >
 				<view class="uni-center center-box">
-					<image class="image" :src="images"  />
-				</view>
+				<img mode="widthFix" :src="images" style="width: 100%;"/> 
+					<!-- <img @bindload="imageLoad"  :src="images" style="width: images[index].widthrpx; height:images[index].heightrpx;"/> -->
+				</view> 
 			</uniPopup>
 		</view>
 	</view>
+<!-- 	
+	<view v-if="types" style="width: 100vw;
+	height:100vh;
+	position: fixed;
+	z-index: 99;
+	top: 0;
+	right: 0;
+	bottom: 0;
+	left: 0;
+	background-color: black;">
+	    <view style="position: absolute;
+		width: 0px;
+		top: 50%;
+		width: 100%;height: 100%;
+		left: 50%;
+		transform: translate(-50%, -50%);">
+			<img mode='widthFix' :src="images" />
+		</view> -->
+		
+	</view>
 </template>
 
 <script>
@@ -30,16 +51,17 @@
 			'show':function(val) {
 				console.log(val)
 				if(val) {
-					this.type = true;
+					this.types = true;
 				}else {
-					this.type = false;
+					this.types = false;
 				}
 			},
 		},
 		data() {
 			return {
-				type: false,
+				types: false,
 				pictureUrl: this.pictureUrl,
+				images:[],
 				list: ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10'],
 			};
 		},
@@ -50,6 +72,21 @@
 		// 	}
 		// },
 		methods: {
+			// imageLoad() {
+			// 	console.log("999");
+			// 	let $width=e.detail.width;   //获取图片真实宽度
+			// 	         let $height=e.detail.height;
+			// 	         let ratio=$width/$height;    //图片的真实宽高比例
+			// 	     let viewWidth=718;           //设置图片显示宽度,左右留有16rpx边距
+			// 	       let  viewHeight=718/ratio;    //计算的高度值
+			// 	      let image= this.data.images; 
+			// 	      //将图片的datadata-index作为image对象的key,然后存储图片的宽高值
+			// 	      image[e.target.dataset.index]={
+			// 	         width:viewWidth,
+			// 	         height:viewHeight
+			// 	      }
+			// 		  this.data.images = images;
+			// },
 			togglePopup() {
 				this.type = false;
 				uni.$emit('changshow')
@@ -110,8 +147,7 @@
 	}
 
 	.center-box {
-		width: 800upx;
-		height: 800upx;
+		width: 100vw;
 	}
 
 	.uni-list-item {
@@ -127,6 +163,7 @@
 	.center-box .image {
 		width: 100%;
 		height: 100%;
+		
 	}
 
 	.bottom-title {

+ 2 - 2
component/popup.vue

@@ -2,8 +2,8 @@
 	<view>
 		<view class="example">
 			<uniPopup :show="type" position="middle" mode="insert" @hidePopup="togglePopup('')">
-				<view  @click="gomoney" class="uni-center center-box">
-					<image class="image" :src="pictureUrl+'/uploads/home/adv/'+images"  />
+				<view  class="uni-center center-box">
+					<image   @click="gomoney" class="image" :src="pictureUrl+'/uploads/home/adv/'+images"  />
 				</view>
 			</uniPopup>
 		</view>

+ 8 - 9
component/uni-popup.vue

@@ -4,10 +4,10 @@
 		<view v-show="show" :class="'uni-popup-' + position + ' ' + 'uni-popup-' + mode" class="uni-popup">
 			{{ msg }}
 			<slot />
-			<view v-if="position === 'middle' && mode === 'insert'" :class="{
+		<!-- 	<view v-if="position === 'middle' && mode === 'insert'" :class="{
           'uni-close-bottom': buttonMode === 'bottom',
           'uni-close-right': buttonMode === 'right'
-        }" class=" uni-icon uni-icon-close" @click="closeMask" />
+        }" class=" uni-icon uni-icon-close" @click="closeMask" /> -->
 		</view>
 	</view>
 </template>
@@ -104,7 +104,7 @@
 		right: 0;
 		bottom: 0;
 		left: 0;
-		background-color: rgba(0, 0, 0, 0.3);
+		background-color: black;
 	}
 
 	.uni-popup {
@@ -128,7 +128,7 @@
 		min-height: 380upx;
 		max-width: 100%;
 		max-height: 80%;
-		transform: translate(-50%, -65%);
+		transform: translate(-50%, -50%);
 		background: none;
 		box-shadow: none;
 	}
@@ -141,11 +141,11 @@
 	.uni-close-bottom,
 	.uni-close-right {
 		position: absolute;
-		bottom: -180upx;
+		bottom: -465upx;
 		text-align: center;
 		border-radius: 50%;
-		color: #f5f5f5;
-		font-size: 60upx;
+		color: #D9332E;
+		font-size: 80upx;
 		font-weight: bold;
 		opacity: 0.8;
 		z-index: -1;
@@ -166,11 +166,10 @@
 		content: '';
 		position: absolute;
 		width: 0px;
-		border: 1px #f5f5f5 solid;
 		top: -200upx;
 		bottom: 56upx;
 		left: 50%;
-		transform: translate(-50%, -0%);
+		transform: translate(-50%, -50%);
 		opacity: 0.8;
 	}
 

+ 2 - 1
pages.json

@@ -421,7 +421,8 @@
 		"usingComponents":{
 			 "van-dialog": "/wxcomponents/dist/dialog/index",
 			 "van-rate": "/wxcomponents/dist/rate/index",
-			 "van-cell": "/wxcomponents/dist/cell/index"
+			 "van-cell": "/wxcomponents/dist/cell/index",
+			 "van-skeleton": "/wxcomponents/dist/skeleton/index"
 		}
 		
 	},

+ 18 - 4
pages/index/cart.vue

@@ -1,5 +1,6 @@
 <template>
 	<view style="height: 100vh;background-color: #F5F5F5;">
+		  <van-skeleton  :loading="loading">
 		 <view  class="titleright" @click="changeShop" v-if="isdelete">编辑</view>
 		  <view class="titleright" @click="changeShop" v-else>取消</view>
 		  <view v-if="list.length>0" style="margin-bottom: 150upx;">
@@ -49,7 +50,11 @@
 		  <view v-else>
 			  <view style="margin: 120upx auto;text-align: center;">
 				   <van-icon size="160rpx" color="#909399" name="cart-o" />
-				   <view style="text-align: center;color: #909399;"> 去买点什么</view>
+				   <view @click="gostore" style="text-align: center;
+				   color: #909399;border: 1px solid #909399; padding: 5upx 10upx;
+				   margin: 10upx auto;width: 150rpx;">
+						去逛逛
+				  </view>
 			  </view>
 		  </view>
 		   
@@ -83,7 +88,7 @@
 		 
 		 </view>
 		 
-		
+		 </van-skeleton>
 	</view>
 </template>
 
@@ -97,6 +102,8 @@
 		},
 		data() {
 			return {
+				firstloading: 0,
+				loading: true,
 				ismax: 0,
 				lengthnumber: 0,
 				pricelist:[],
@@ -125,6 +132,10 @@
 			this.getshoplist();
 	    },
 		methods: {
+			// 返回酒店
+			gostore() {
+				uni.navigateBack();
+			},
 			onClickButton(e) {
 				let array = [];
 				if(this.pricelist.length == 0) {
@@ -215,6 +226,7 @@
 				 this.listip = this.isdelete ? "结算" + '(' + this.nums + ')' :'删除'+ '(' + this.nums + ')';
 			},
 			getshoplist() {
+				this.loading = true;
 				this.request({
 					url: '/v2/order/cart',
 					method: 'post',
@@ -231,11 +243,13 @@
 						 })
 						if(data.cart_list.length < 10) {
 							this.ispull = false;
-							
 						}
 						this.list = this.list.concat(data.cart_list);
 						this.store = data.store;
-						//console.log(data.cart_list[0].goods_name.split(' '));
+						if(this.firstloading == 0) {
+							this.loading = false;
+						}
+						this.firstloading = 1;
 					}
 				})
 			},

+ 2 - 1
pages/index/commemt.vue

@@ -25,7 +25,8 @@
 				</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" style="width: 100upx;height: 100upx;float:left;"></image>
+					<image  v-for="(items, indexs) in item.images" @click="shoupicture(items)"  :key="indexs" :src="items" 
+					style="width: 100upx;height: 100upx;float:left;padding-right: 20upx;"></image>
 				</view>
 			</view>
 		</view>

+ 46 - 15
pages/index/hotel.vue

@@ -1,5 +1,6 @@
 <template>
     <view>
+	   <van-skeleton  :loading="loading">
        <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"
@@ -122,7 +123,7 @@
                  <shopList :productList="goods_list" />
                   </view> 
                  </van-tab>
-                    <van-tab  :name="1" :title="'评价' +'  '+hoteldetail.feedback_count">
+                    <van-tab  :name="1" :title="'评价' +'  '+feedback_count">
                      <!-- 评价列表 -->
                      <assess :feedback_list="feedback_list" :showpicture="showpicture" />
                  </van-tab>
@@ -150,6 +151,7 @@
 	         <button type="warn" @click="gofeedback">您的入住意见反馈(反馈送圈币)</button>
 	    </view>
 	   <Gobacktop @getop="getop" v-if="isTop" />
+	   </van-skeleton>
 	</view>
 </template>
   
@@ -163,7 +165,7 @@
     import shopList from '@/component/shopList.vue'  // 商品列表
     import assess from '@/component/assess.vue'  // 评价列表
 	import Gobacktop from '@/component/Gobacktop.vue'
-    export default {
+    export default { 
         components: {
             uniIcon,
             uniNavBar,
@@ -174,9 +176,12 @@
         },
         data() {
             return {
+				firstloading: 0,
 				showpicture: false,
+				loading: true,
 				storeinformation: {},
 				isTop: 0,
+				feedback_count: 0,
 				hoteldetail: {},
 				has_collected: 0, // 收藏酒店
 				chosegoods_commonid: true,
@@ -241,14 +246,14 @@
         	     withShareTicket: true  
         	});  
         	let that = this;
-        	let id = this.goodId;  // 商品Id
-        	
+        	let id = this.goodId;  // 酒店id
+        	console.log(id);
         	if (res.from === 'button') {
               // 来自页面内分享按钮
         	}
         	return {
         		title: that.hotelitle,
-        		path: `/pages/index/shop?id=${id}`,
+        		path: `/pages/index/hotel?id=${id}`,
         		imageUrl:that.store_slide[0] 
         	}
         },
@@ -272,6 +277,7 @@
 			this.getshopdetail(); // 获取商品详情
 			this.hotelmenu();  // 一级菜单
 			this.gethoteil();  // 获取酒店信息
+			//this.getStockPriceByName(); // 分装异步函数
 			uni.$on('changshow', (e) => {
 				this.changeshow();			
 			})
@@ -333,7 +339,12 @@
 				 		type:'store',
 				 		fav_id: this.goodId
 				 	},
-				 	success: () => {
+				 	success: (res) => {
+						if(res.data.data.action == 'add') {
+							this.$msg("收藏成功")
+						}else {
+							this.$msg("取消收藏")
+						}
 				 		this.gethoteil()
 				 	}
 				 })
@@ -402,7 +413,20 @@
 				        url: `/pages/index/hoteldetail?id=${id}&gc_name=${gc_name}&store_id=${store_id}`
 				    });
 			},
+			// async  getStockPriceByName() {
+			// 	try {
+			// 	  // Promise.all
+			// 	  let [foo, bar, val1] = await Promise.all([this.getshopdetail(), this.gethoteil(),this.hotelmenu()]);
+			// 	    console.log(val1);
+			// 	  }
+			// 	  catch (err) {
+			// 	  }
+			  // 	//this.getshopdetail(); // 获取商品详情
+			//this.hotelmenu();  // 一级菜单
+			//this.gethoteil();
 			
+			//},
+
 			// 获取商品详情
 			getshopdetail(e) {
 				this.request({
@@ -416,6 +440,10 @@
 										 gc_id_1: this.gc_id_1
 				                    },
 								success: (res) => {
+									if(this.firstloading == 0) {
+										this.loading = false;
+									}
+									this.firstloading = 1;
 									if(e == 2) {
 										this.goods_list = [];
 									}
@@ -423,6 +451,7 @@
 									if(res.data.data.goods_list.length < 10) {
 										this.isDetail = 2;
 									}
+									
 								},
 			    })
 			},
@@ -459,6 +488,7 @@
             },
 			// 获取酒店评价
 			getcomment() {
+				
 				this.request({
 					url:'/v1/store/feedbackList',
 					method: 'POST',
@@ -472,6 +502,10 @@
 						if(res.data.data.feedback_list.length < 10) {
 							this.isnexttwo = 2;
 						}
+						if(this.firstloading == 0) {
+							this.loading = false;
+						}
+						this.firstloading = 1;
 					}
 				})
 			},
@@ -484,9 +518,14 @@
 						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) {
@@ -495,20 +534,12 @@
 						})
 						this.storeinformation = data;
 						this.store_summary = data.store_summary;
-						
-						// const regex = new RegExp('<img', 'gi');
-						// console.log(data.store_description);
-						// data.store_description = data.store_description.replace(regex, 
-						// `<img style="width: 100%;height: auto;display: block;text-align: center;`);
-						// this.store_description = data.store_description;
-						
-						
-						//data.store_description = data.store_description.replace(/\(<img\)/ig, '');
 						const regex = new RegExp('<img', 'gi');
 						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; // 是否收藏
+						
 					}
 				})
 			},

+ 1 - 1
pages/index/index.vue

@@ -12,7 +12,7 @@
 	 		</view>
 			<button plain="true" style="border: none;" 
 			  v-if="allow" @opensetting='handler'
-			  open-type="openSetting" >定位失败,点击重新获取</button>
+			  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>

+ 39 - 9
pages/index/shop.vue

@@ -1,12 +1,13 @@
 <template>
  	<view class="container">
+		 <van-skeleton  :loading="loading">
 		<scroll-view  style="height: 100vh;" class="floor-list"
 		 :scroll-top="scrollTop" scroll-y="true"  @scroll="scroll"  @scrolltoupper="upper" @scrolltolower="lower"
 		  :refresher-enabled="false">
  		<view class="carousel">
  			<swiper indicator-dots circular=true duration="400">
  				<swiper-item class="swiper-item" v-for="(item,index) in datalist.images" :key="index">
- 					<view class="image-wrapper">
+ 					<view @click="shoupicture(item)" class="image-wrapper">
  						<image
 						    :src="pictureUrl+'/uploads/home/store/goods/'+item.goodsimage_url.substr(0, item.goodsimage_url.indexOf('\_')) + '/' + item.goodsimage_url"
  							class="loaded" 
@@ -48,23 +49,23 @@
  		
  		<view class="c-list">
  			<view  style="display: flex;justify-content: space-between;" class="c-row b-b" @click="toggleSpec">
- 				<view style="font-size: 32upx;">规则数量选择</view>
+ 				<view style="font-size: 32upx;color: #303133;">规则数量选择</view>
 				<view>
 				  <uni-icon  size="20" type="arrowright"></uni-icon>
 				</view>
  			</view>
  		</view>
- 		
  		<!-- 评价 -->
  		<view @tap="shopDetail" style="border-bottom: 20rpx solid #F5F5F5;" class="eva-section">
  			<view  style="display: flex;justify-content: space-between;" class="c-row b-b">
- 				<view style="font-size: 32upx;color: #909399;">评价</view>
+ 				<view style="font-size: 32upx;color: #303133;">评价</view>
  				<view>
  				 <uni-icon  size="20" type="arrowright"></uni-icon>
  				 </view>
  			</view>
-			<assess />
+			
  		</view>
+		<!-- <assess /> -->
 		<!-- :class="iScrolltop == 2?'activeColor' : ''" -->
  		<view class="detail-desc" >
 			<van-tabs  v-model="active" @click="onChange">
@@ -183,6 +184,8 @@
 			</van-goods-action>
 		</View>
 		<Gobacktop @getop="getop" :bottomtop="2" v-if="isTop" />
+		 <unipopup :images="images"  :show="ishow"/>
+		</van-skeleton>
  	</view>
  </template>
  
@@ -195,15 +198,21 @@
 	import uninumberbox  from '@/component/uinNumber.vue' 
 	import assess from '@/component/assess.vue'  // 评价列表
  	import uniIcon from '@/component/uni-icon/uni-icon.vue'
+	import unipopup from '@/component/openpictrue.vue'
  	export default{
  		components: {
  			uniIcon,
 			assess,
 			uninumberbox,
-			Gobacktop
+			Gobacktop,
+			unipopup
  		},
  		data() {
  			return {
+				ishow: false,
+				images: '',
+				loading: true,
+				firstloading: 0,
 				isTop: false,
 				chosename: [],
 				arrayId:[],
@@ -271,6 +280,9 @@
  			this.goodId = options.id;  // 商品Id
 			this.store_id =  options.store_id;
 			this.getshopdetail(); // 获取商品详情
+			uni.$on('changshow', (e) => {
+				this.changeshow();			
+			})
  			//规格 默认选中第一条
  			// this.datalist.spec_list[0].value_list.forEach(item=>{
  			// 	for(let cItem of this.specChildList){
@@ -304,6 +316,14 @@
 			
 		},
  		methods:{
+			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;
+				console.log(this.ishow)
+			},
+			changeshow() {
+				this.ishow = false;
+			},
 			getop() {
 			        this.scrollTop = this.old.scrollTop
 			                this.$nextTick(function(){
@@ -335,6 +355,7 @@
 			},
 			// 获取商品详情
 			getshopdetail() {
+			
 				let params = {};
 				params.goods_commonid =this.goodId;
 				params.store_id = this.store_id;
@@ -366,6 +387,10 @@
 							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;
 					}
 				})
 			},
@@ -636,7 +661,12 @@
 							type:'goods',
 							fav_id: this.goodId
 						},
-						success: () => {
+						success: (res) => {
+							if(res.data.data.action == 'add') {
+								this.$msg("收藏成功")
+							}else {
+								this.$msg("取消收藏")
+							}
 							this.getshopdetail()
 						}
 					})
@@ -866,7 +896,7 @@
  		flex-direction: column;
  		padding: 20upx 30upx;
  		background: #fff;
- 		margin-top: 16upx;
+ 		/* margin-top: 16upx; */
  		.e-header{
  			display: flex;
  			align-items: center;
@@ -1141,7 +1171,7 @@
  		justify-content: center;
  		align-items: center;
  		width:  100vw;
- 		height: 100upx;
+ 		height: 80upx;
 		z-index: 99;
  		background: rgba(255,255,255,.9);
  		.p-b-btn{

+ 7 - 1
pages/myCenter/index.vue

@@ -25,7 +25,7 @@
 					</view>
 				</view>
 					<view class="myNmaeRight" @click="writeday" v-if="menberinfo.has_sign == 0">每日签到></view>
-					<view class="myNmaeRight" v-if="menberinfo.has_sign == 1">您已签到</view>
+					<view class="myNmaeRight"  @click="iswriteday" v-if="menberinfo.has_sign == 1">您已签到</view>
 			</view>
 		</view>
 		<van-cell @click="gomyorder(0)"  title="我的订单" is-link />
@@ -263,10 +263,16 @@
 						stage: 'sign'
 					},
 					success: (res) => {
+						if(res.data.code == 1000) {
+							this.$msg("签到成功")
+						}
 						this.getuserinfo();
 					}
 				})
 			},
+			iswriteday() {
+				this.$msg("今天已经签过到")
+			},
 			goAdress(e) {
 				if(this.successlogion && this.hasLogin) {
 					if(e == 1) {

+ 2 - 2
pages/myCenter/logion.vue

@@ -15,10 +15,10 @@
 		<view  v-if='hasLogin&& !successlogion'>
 			<view style="text-align: center;margin: 100upx;font-size: 36upx;">登录即注册立即成为圈在网会员</view>
 			<view style="width: 50%;margin: 0 auto;">
-				 <button type="warn" open-type="getPhoneNumber" @getphonenumber="decryptPhoneNumber">使用微信手机号登录</button>
+				 <button type="warn" open-type="getPhoneNumber" @getphonenumber="decryptPhoneNumber">微信手机号登录</button>
 			</view>
 		</view>
-		<view @click="closesure"   style="width: 50%;margin: 30upx auto;text-align:center;font-szie: 30upx;">
+		<view @click="closesure" style="width: 50%;margin: 30upx auto;text-align:center;font-szie: 30upx;">
 				暂不授权
 		</view>
 		<view style="position: fixed; bottom: 30upx;width: 100%;">

+ 11 - 3
pages/myOrder/index.vue

@@ -1,5 +1,6 @@
 <template>
 	<view>
+		 <van-skeleton  :loading="loading">
 		<van-tabs :active="active"  @change="changeselect" style="width: 20%!important;">
 		  <van-tab v-for="(item, index) in menu" :name="index" :title="item.name">
 		  </van-tab>
@@ -51,8 +52,8 @@
 		<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 style="text-align: center;color: #909399;">
+					<span style="color: #F76260;" @click="gotologion">请先登录</span></view>
 			  </view>
 		</view>
 		<!-- 催单 -->
@@ -63,6 +64,7 @@
 		 />
 		 <Gobacktop @getop="getop" v-if="isTop" />
 		<!--  <logionDialog @confirmDiaolog="confirmDiaolog" :ishow="false" @cancelDiaolog="cancelDiaolog" :showdialog="showdialog"/> -->
+	   </van-skeleton>
 	</view>
 </template>
 
@@ -79,6 +81,8 @@
 		},
 		data() {
 			return {
+				firstloading: 0,
+				loading: true,
 				isTop: false,
 				ispull: true,
 				showdialog: false,
@@ -252,6 +256,7 @@
 			},
 			// 订单列表
 			getlist() {
+			
 				this.request({
 					url: '/v2/order/orders',
 					method: 'POST',
@@ -271,7 +276,10 @@
 								items.descire = items.goods_name.replace(arr[0], '');
 							})
 						})
-					
+					    if(this.firstloading == 0) {
+					    	this.loading = false;
+					    }
+					    this.firstloading = 1;
 						// let arr = item.goods_name.split(' ');
 						// item.desarray = arr[0];
 						// item.descire = arr.replace(arr[0], '');

+ 27 - 1
pages/myOrder/order.vue

@@ -1,4 +1,5 @@
 <template>
+	<van-skeleton  :loading="loading">
 	<view class="cart-list">
        <view style="padding: 0 36upx;line-height: 70upx;
 	   border-bottom: 14upx solid #F5F5F5;
@@ -50,6 +51,17 @@
 		  <view style="font-size: 28upx;">合计:{{detail.order_amount}}</view>
 	 </view>
 	 <view style="padding: 18upx 36upx;">订单编号:<text class="orderCode">{{detail.order_sn}}</text></view>
+	 
+	 <view v-if="detail.shipping_code!='' " style="margin: 20upx 0;
+				  padding: 10upx 0 0upx 32upx;
+	              border-top: 16upx solid #F5F5F5;
+				  border-top: 16upx solid #F5F5F5;">
+	 		 <view>快递单号: <text  style="font-weight: 500;padding-left:16upx;" class="time">
+				 {{detail.shipping_code}}  ({{detail.express_name}})
+				 </text>
+			 </view>
+	</view>
+	
 	 <view class="adressbottom">
 		 <view>下单时间: <text  style="font-weight: 500;" class="time">{{detail.add_time}}</text></view> 
 		 <view>支付订单: 
@@ -61,13 +73,14 @@
 		   <text class="time"  v-else>{{happenTimeFun(detail.shipping_time)}}</text>
 		 </view>
 		 <view>确认收货: 
-			<text class="time"  v-if="detail.order_state == 10 || detail.order_state == 0||  detail.order_state == 20|| detail.order_state == 60">未确认</text>
+			<text class="time"  v-if="detail.order_state == 10 || detail.order_state == 0||  detail.order_state == 20||  detail.order_state == 30|| detail.order_state == 60">未确认</text>
 			<text class="time"  v-else>{{detail.finnshed_time}}</text>
 		 </view>
 	 </view>
 	 
 	 <view class="adressbutton">
 		<view  class="buttonStatus">
+			<!-- shipping_code -->
 		<!-- 	<view>{{detail.operate}}</view> -->
 			<!-- <view v-if="detail.order_state == 0 " @click="cancelOrder(2)" class="deleteOrder">删除订单</view> -->
 			<view @click="cancelOrder(4)"  v-if="detail.order_state == 20" class="deleteOrder">退款</view>
@@ -95,6 +108,7 @@
 	    @confirmPay="confirmOrder"
 	 />
 	</view>
+	 </van-skeleton>
 </template>
 
 <script>
@@ -105,6 +119,8 @@
 		},
 		data() {
 			return {
+			  firstloading: 0,
+			  loading: true,
 			  isreturn: false,
 			  isCancel: false,
 			  isDelete: false,
@@ -177,6 +193,11 @@
 				})
 			},
 			getDetail() {
+				uni.showLoading({
+				    title: '加载中',
+					mask: true
+				});
+				
 				this.request({
 					url: '/v2/order/info',
 					method: 'post',
@@ -191,6 +212,11 @@
 								items.descire = items.goods_name.replace(arr[0], '');
 						})
 						this.detail = data;
+						uni.hideLoading()
+						if(this.firstloading == 0) {
+							this.loading = false;
+						}
+						this.firstloading = 1;
 					}
 				})
 			},