Browse Source

修改周边民宿逻辑

xiaoxin 2 years ago
parent
commit
d7eed70d46

+ 17 - 15
packageShang/common/common.js

@@ -17,7 +17,7 @@ class Common {
 		if (typeof date !== 'object') {
 			date = new Date(date);
 		}
-		
+
 		fmt = fmt || 'yyyy-MM-dd hh:mm:ss'
 		let o = {
 			"M+": date.getMonth() + 1, //月份   
@@ -32,7 +32,8 @@ class Common {
 			fmt = fmt.replace(RegExp.$1, (date.getFullYear() + "").substr(4 - RegExp.$1.length));
 		for (let k in o)
 			if (new RegExp("(" + k + ")").test(fmt))
-				fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
+				fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k])
+					.length)));
 		return fmt;
 	}
 
@@ -41,7 +42,8 @@ class Common {
 		if (_number.indexOf('.') != -1) {
 			_number = _number.split('.')[0];
 		}
-		_number = _number.replace(new RegExp("^(\\d{" + (_number.length % 3 ? _number.length % 3 : 0) + "})(\\d{3})", "g"),
+		_number = _number.replace(new RegExp("^(\\d{" + (_number.length % 3 ? _number.length % 3 : 0) +
+				"})(\\d{3})", "g"),
 			"$1 $2").replace(/(\d{3})+?/gi, "$1 ").trim()
 		if (typeof _sep != "undefined" && _sep != " ") {
 			_number = _number.replace(/\s/g, _sep);
@@ -65,7 +67,8 @@ class Common {
 	 * @description 全球唯一 guid
 	 */
 	guid() {
-		return (this.__s4() + this.__s4() + "-" + this.__s4() + "-" + this.__s4() + "-" + this.__s4() + "-" + this.__s4() +
+		return (this.__s4() + this.__s4() + "-" + this.__s4() + "-" + this.__s4() + "-" + this.__s4() + "-" + this
+			.__s4() +
 			this.__s4() + this.__s4());
 	}
 	__s4() {
@@ -85,24 +88,23 @@ class Common {
 			icon
 		});
 	}
-	
+
 	/**
 	 * @description 消息提示 alert
 	 */
 	alert(content, callback) {
-		
+
 		uni.showModal({
 			title: '提示',
 			content: content,
 			showCancel: false,
 			success(res) {
 				if (res.confirm) {
-					if(typeof callback === 'function') {
+					if (typeof callback === 'function') {
 						callback();
 					}
-		
-				} else if (res.cancel) {
-				}
+
+				} else if (res.cancel) {}
 			}
 		})
 	}
@@ -236,11 +238,11 @@ class Common {
 
 					uni.getNetworkType({
 						success(res) {
-							console.log(res.networkType);
+							// console.log(res.networkType);
 							env.networkType = res.networkType
 						},
 						complete() {
-							console.log('set storage env', env);
+							// console.log('set storage env', env);
 							uni.setStorage({
 								key: '__env',
 								data: env
@@ -427,15 +429,15 @@ class Common {
 			url: $config.route.goodslist + this.get_params(params)
 		});
 	}
-	
+
 	/**
 	 * @description 获取路径文件名称
 	 */
 	getFileName(path) {
 		if (path.indexOf('/') === -1) return '';
-		
+
 		return path.split('/').reverse()[0];
 	}
 }
 
-export default new Common()
+export default new Common()

+ 201 - 197
packageShang/pages/goods/goods.vue

@@ -166,7 +166,7 @@
 
 		<!-- 05. 评价区 -->
 		<view class="evaluate-area" v-if="evaluateDatas.length > 0">
-			<use-list-title :title="evaluateTitle" tip="好评率 100%" color="#ff6a6c" iconfont=" " @goto="toevaluate"></use-list-title>
+			<use-list-title :title="evaluateTitle" tip="" color="#ff6a6c" iconfont=" " @goto="toevaluate"></use-list-title>
 			<view class="padding-lr bg-main">
 				<view class="eva-box dflex-s padding-bottom-lg" v-for="(item, index) in evaluateDatas" :key="index">
 					<image class="portrait border-radius-c" :src="item.userImg"></image>
@@ -189,10 +189,14 @@
 								:src="img"
 								@click="preview(item.reviewImgs, img)"
 							></image> -->
-							<image class="border-radius-xs" v-if="((item.reviewImgs).indexOf(',')) != -1"
-							 mode="aspectFill" :lazy-load="true" :src="((item.reviewImgs).substring(0, ((item.reviewImgs).indexOf(','))))"></image>
-							 <image class="border-radius-xs" v-else
-							  mode="aspectFill" :lazy-load="true" :src="item.reviewImgs"></image>
+							<image
+								class="border-radius-xs"
+								v-if="item.reviewImgs.indexOf(',') != -1"
+								mode="aspectFill"
+								:lazy-load="true"
+								:src="item.reviewImgs.substring(0, item.reviewImgs.indexOf(','))"
+							></image>
+							<image class="border-radius-xs" v-else mode="aspectFill" :lazy-load="true" :src="item.reviewImgs"></image>
 						</view>
 						<view class="">
 							<text class="fs-xs ft-dark">{{ item.goods_type || '套餐1' }}</text>
@@ -252,45 +256,45 @@
 				<img class="pop_icon" src="../../../static/index/close3.png" @click="handleClosePop" />
 				<!-- 顶部信息区域 -->
 				<view class="pop_header">
-					<img
-						class="header_img"
-						mode="aspectFill"
-						:src="cartImg"
-					/>
+					<img class="header_img" mode="aspectFill" :src="cartImg" />
 					<view class="header_info">
 						<view class="info_price">
-							<text>{{cartPrice}}</text>
+							<text>{{ cartPrice }}</text>
 						</view>
 						<!-- <view class="info_tags">
 							<view class="tag">包邮</view>
 							<view class="tag">8600积分</view>
 						</view> -->
 					</view>
-				</view>
-				
-				<!-- <view class="con dflex dflex-wrap-w">
-					<view
-						class="margin-right-sm margin-bottom-sm dflex bg-drak border-radius-lg padding-tb-16 padding-lr"
-						:class="{ active: item.selected }"
-						v-for="(item, index) in skuDatas"
-									:key="index"
-						@click="selectSKU(item)"
-					>
-						<text class="fs-xs">{{ item.name }}</text>
-					</view>
+				</view>
+
+				<!-- <view class="con dflex dflex-wrap-w">
+					<view
+						class="margin-right-sm margin-bottom-sm dflex bg-drak border-radius-lg padding-tb-16 padding-lr"
+						:class="{ active: item.selected }"
+						v-for="(item, index) in skuDatas"
+									:key="index"
+						@click="selectSKU(item)"
+					>
+						<text class="fs-xs">{{ item.name }}</text>
+					</view>
 				</view> -->
 
-				<!-- 颜色区域 -->
-				<view v-for="(item, index) in skuAttrDatas"
-										:key="index">
-					<view class="pop_title">{{item.attrName}}({{item.attrValues.length}})</view>
-					<view class="pop_tags">
-						<view :class="item2.type == true?'active_sku_color':'active_sku'" @click="selectSKU(index,index2)" v-for="(item2, index2) in item.attrValues"
-										:key="index2">{{item2.attrValue}}</view>
-					</view>
+				<!-- 颜色区域 -->
+				<view v-for="(item, index) in skuAttrDatas" :key="index">
+					<view class="pop_title">{{ item.attrName }}({{ item.attrValues.length }})</view>
+					<view class="pop_tags">
+						<view
+							:class="item2.type == true ? 'active_sku_color' : 'active_sku'"
+							@click="selectSKU(index, index2)"
+							v-for="(item2, index2) in item.attrValues"
+							:key="index2"
+						>
+							{{ item2.attrValue }}
+						</view>
+					</view>
 				</view>
-				
 
 				<!-- 容量区域 -->
 				<!-- <view class="pop_title">容量(3)</view>
@@ -303,19 +307,20 @@
 				<!-- 购买数量区域 -->
 				<view class="pop_title">
 					购买数量
-					<text>库存{{cartSale}}件</text>
+					<text>库存{{ cartSale }}件</text>
 				</view>
 
 				<view class="pop_num">
 					<uni-number-box @change="changeValue" />
-				</view>
-				<view class="flex1 btn-container dflex-b border-radius-big" style="margin-top: 50px;">
-					<view class="tac padding-tb-sm flex1 bg-warn" v-if="goods.stockNum > goods.saleCnt && goods.state == 1" @click="tocartSKU(goods,)">加入购物车</view>
-					<view class="tac padding-tb-sm flex1 bg-base-gou" v-if="goods.stockNum > goods.saleCnt && goods.state == 1" @click="tobuySku(goods)">立即购买</view>
-					<view class="tac padding-tb-sm flex1 bg-disabled" v-if="goods.stockNum == goods.saleCnt && goods.state == 1">已售磐</view>
-					<view class="tac padding-tb-sm flex1 bg-disabled" v-if="goods.state == 0">已下架</view>
 				</view>
-			</view>`	
+				<view class="flex1 btn-container dflex-b border-radius-big" style="margin-top: 50px">
+					<view class="tac padding-tb-sm flex1 bg-warn" v-if="goods.stockNum > goods.saleCnt && goods.state == 1" @click="tocartSKU(goods)">加入购物车</view>
+					<view class="tac padding-tb-sm flex1 bg-base-gou" v-if="goods.stockNum > goods.saleCnt && goods.state == 1" @click="tobuySku(goods)">立即购买</view>
+					<view class="tac padding-tb-sm flex1 bg-disabled" v-if="goods.stockNum == goods.saleCnt && goods.state == 1">已售磐</view>
+					<view class="tac padding-tb-sm flex1 bg-disabled" v-if="goods.state == 0">已下架</view>
+				</view>
+			</view>
+			`
 		</uv-popup>
 	</view>
 </template>
@@ -355,12 +360,12 @@ export default {
 			swiperDatas: [],
 			// SKU
 			sku: {},
-			skuDatas: [],
-			cartNum:'1',//商品加购数量
-			cartImg:'',//加购图片
-			cartPrice:'',//加购价格
-			cartSale:'',//加购库存
-			skuId:'',//选中sku
+			skuDatas: [],
+			cartNum: '1', //商品加购数量
+			cartImg: '', //加购图片
+			cartPrice: '', //加购价格
+			cartSale: '', //加购库存
+			skuId: '', //选中sku
 			// 分享
 			shareShow: false,
 			// 海报
@@ -383,8 +388,8 @@ export default {
 			// 收藏
 			favorite: false, //是否收藏
 
-			scrollTop: 0,
-			skuAttrDatas:[],//商品属性数组
+			scrollTop: 0,
+			skuAttrDatas: [] //商品属性数组
 		}
 	},
 	watch: {
@@ -485,54 +490,54 @@ export default {
 						})
 					})
 
-					_self.tagDatas = __tagDatas
-					
-					//商品属性数组
-					_self.skuAttrDatas = _self.goods.skuGroups;
-					_self.skuAttrDatas.forEach((el,index)=>{
-						el.attrValues.forEach((item,ins)=>{
-							_self.skuAttrDatas[index].attrValues[0].type = true
-						})
-					})
-						console.log(_self.skuAttrDatas,'po')
-					// 商品SKU
-					_self.skuDatas = _self.goods.skus;
-					// for(var i=0;i<_self.skuDatas.length;i++){
-					// 	_self.skuDatas[i].spec=_self.skuDatas[i].saleAttrs[0].attrValue
-					// 	_self.skuDatas[i].spec2=_self.skuDatas[i].saleAttrs[1].attrValue
-					// }
-					console.log(_self.skuDatas,'sku')
-					_self.cartPrice=_self.skuDatas[0].price
-					_self.cartImg=_self.skuDatas[0].skuImg
-					_self.cartSale=_self.skuDatas[0].stockNum
-					_self.skuId=_self.skuDatas[0].skuId
-								// let __goods_skus = _self.goods.skus;
-								// if (__goods_skus.length > 0) {
-								// 	let __skuDatas = [];
-								// 	__goods_skus.forEach((sku, index) => {
-								// 		// 	{ id: 1, name: '45寸(大规格)', price: 788, market_price: 999, num: 0, selected: !0 },
-								// 		__skuDatas.push({
-								// 			id: sku.skuId,
-								// 			sku: sku.saleAttrs,
-								// 			name: sku.skuName,
-								// 			price: sku.price,
-								// 			market_price: sku.marketPrice || _self.goods.marketPrice,
-								// 			num: sku.stockNum,
-								// 			selected: index == 0,
-								// 			img:sku.skuImg,
-								// 			sale:sku.stockNum
-								// 		});
-								// 	});
-								// 	_self.skuDatas = __skuDatas;
-								// 	_self.cartImg=_self.skuDatas[0].img
-								// 	_self.cartPrice=_self.skuDatas[0].price
-								// 	_self.cartSale=_self.skuDatas[0].sale
-								// 	_self.skuId=_self.skuDatas[0].id
-								// }
-					
-					// 			// SKU
-					// 			if (this.skuDatas.length > 0) {
-					// 				this.sku = this.skuDatas[0];
+					_self.tagDatas = __tagDatas
+
+					//商品属性数组
+					_self.skuAttrDatas = _self.goods.skuGroups
+					_self.skuAttrDatas.forEach((el, index) => {
+						el.attrValues.forEach((item, ins) => {
+							_self.skuAttrDatas[index].attrValues[0].type = true
+						})
+					})
+					console.log(_self.skuAttrDatas, 'po')
+					// 商品SKU
+					_self.skuDatas = _self.goods.skus
+					// for(var i=0;i<_self.skuDatas.length;i++){
+					// 	_self.skuDatas[i].spec=_self.skuDatas[i].saleAttrs[0].attrValue
+					// 	_self.skuDatas[i].spec2=_self.skuDatas[i].saleAttrs[1].attrValue
+					// }
+					console.log(_self.skuDatas, 'sku')
+					_self.cartPrice = _self.skuDatas[0].price
+					_self.cartImg = _self.skuDatas[0].skuImg
+					_self.cartSale = _self.skuDatas[0].stockNum
+					_self.skuId = _self.skuDatas[0].skuId
+					// let __goods_skus = _self.goods.skus;
+					// if (__goods_skus.length > 0) {
+					// 	let __skuDatas = [];
+					// 	__goods_skus.forEach((sku, index) => {
+					// 		// 	{ id: 1, name: '45寸(大规格)', price: 788, market_price: 999, num: 0, selected: !0 },
+					// 		__skuDatas.push({
+					// 			id: sku.skuId,
+					// 			sku: sku.saleAttrs,
+					// 			name: sku.skuName,
+					// 			price: sku.price,
+					// 			market_price: sku.marketPrice || _self.goods.marketPrice,
+					// 			num: sku.stockNum,
+					// 			selected: index == 0,
+					// 			img:sku.skuImg,
+					// 			sale:sku.stockNum
+					// 		});
+					// 	});
+					// 	_self.skuDatas = __skuDatas;
+					// 	_self.cartImg=_self.skuDatas[0].img
+					// 	_self.cartPrice=_self.skuDatas[0].price
+					// 	_self.cartSale=_self.skuDatas[0].sale
+					// 	_self.skuId=_self.skuDatas[0].id
+					// }
+
+					// 			// SKU
+					// 			if (this.skuDatas.length > 0) {
+					// 				this.sku = this.skuDatas[0];
 					// 			}
 				}
 			})
@@ -724,34 +729,34 @@ export default {
 		},
 
 		// 选择商品SKU
-		selectSKU(i,is) {
-			this.skuAttrDatas[i].attrValues.forEach((item,ins)=>{
-				this.$set(this.skuAttrDatas[i].attrValues[ins],'type',false)
-			})
-			this.$set(this.skuAttrDatas[i].attrValues[is],'type',true)
-			let list = []
-			this.skuAttrDatas.forEach((item,ins)=>{
-				item.attrValues.forEach((el,index)=>{
-					if(el.type == true){
-						list.push({attrValue:el.attrValue})
-					}
-				})
-			})
-			var list2=[]
-			this.skuDatas.forEach((item,index2)=>{
-				list2=[]
-				item.saleAttrs.forEach((el,index)=>{
-					list2.push({attrValue:el.attrValue})
-				})
-				console.log(JSON.stringify(list),'p')
-				console.log(JSON.stringify(list2),'p2')
-				console.log(JSON.stringify(list) == JSON.stringify(list2))
-				if(JSON.stringify(list) == JSON.stringify(list2)){
-					this.cartPrice=item.price
-					this.cartImg=item.skuImg
-					this.cartSale=item.stockNum
-					this.skuId=item.skuId
-				}
+		selectSKU(i, is) {
+			this.skuAttrDatas[i].attrValues.forEach((item, ins) => {
+				this.$set(this.skuAttrDatas[i].attrValues[ins], 'type', false)
+			})
+			this.$set(this.skuAttrDatas[i].attrValues[is], 'type', true)
+			let list = []
+			this.skuAttrDatas.forEach((item, ins) => {
+				item.attrValues.forEach((el, index) => {
+					if (el.type == true) {
+						list.push({ attrValue: el.attrValue })
+					}
+				})
+			})
+			var list2 = []
+			this.skuDatas.forEach((item, index2) => {
+				list2 = []
+				item.saleAttrs.forEach((el, index) => {
+					list2.push({ attrValue: el.attrValue })
+				})
+				console.log(JSON.stringify(list), 'p')
+				console.log(JSON.stringify(list2), 'p2')
+				console.log(JSON.stringify(list) == JSON.stringify(list2))
+				if (JSON.stringify(list) == JSON.stringify(list2)) {
+					this.cartPrice = item.price
+					this.cartImg = item.skuImg
+					this.cartSale = item.stockNum
+					this.skuId = item.skuId
+				}
 			})
 		},
 
@@ -787,62 +792,62 @@ export default {
 			})
 		},
 		// 加入购物车
-		tocart(params) {
-			var _self=this
-			console.log(params)
-			if(params.enableSku==1){
-				_self.$refs.addPopup.open('bottom')
-			}else{
-				var data='?num=1&'+'goodId='+params.id
-				cartadd(data).then((res) => {
-					if(res.success){
-						_self.$api.msg('加购成功');
-						return;
-					}
-					_self.$api.msg(res.msg);
-				})
+		tocart(params) {
+			var _self = this
+			console.log(params)
+			if (params.enableSku == 1) {
+				_self.$refs.addPopup.open('bottom')
+			} else {
+				var data = '?num=1&' + 'goodId=' + params.id
+				cartadd(data).then((res) => {
+					if (res.success) {
+						_self.$api.msg('加购成功')
+						return
+					}
+					_self.$api.msg(res.msg)
+				})
 			}
-		},
-		//yousku加购
-		tocartSKU(params){
-			var _self=this
-			var data='?num='+_self.cartNum+'&'+'goodId='+params.id+'&skuId='+this.skuId
-			cartadd(data).then((res) => {
-				if(res.success){
-					_self.$api.msg('加购成功');
-					return;
-				}
-				_self.$api.msg(res.msg);
-			})
+		},
+		//yousku加购
+		tocartSKU(params) {
+			var _self = this
+			var data = '?num=' + _self.cartNum + '&' + 'goodId=' + params.id + '&skuId=' + this.skuId
+			cartadd(data).then((res) => {
+				if (res.success) {
+					_self.$api.msg('加购成功')
+					return
+				}
+				_self.$api.msg(res.msg)
+			})
 		},
 		// 立即购买
 		tobuy(item) {
 			let _this = this
-			// if (!this.loginCheck()) return;
-			if(item.enableSku==1){
-				_this.$refs.addPopup.open('bottom')
-			}else{
-				uni.navigateTo({
-					url: `/packageShang/pages/order/create?goods_id=${_this.id}&type=1&num=1`
-				})
+			// if (!this.loginCheck()) return;
+			if (item.enableSku == 1) {
+				_this.$refs.addPopup.open('bottom')
+			} else {
+				uni.navigateTo({
+					url: `/packageShang/pages/order/create?goods_id=${_this.id}&type=1&num=1`
+				})
 			}
-		},
-		//yousku购买
-		tobuySku(item){
-			uni.navigateTo({
-				url: `/packageShang/pages/order/create?goods_id=${this.id}&skuId=${this.skuId}&type=1&num=${this.cartNum}`
-			})
+		},
+		//yousku购买
+		tobuySku(item) {
+			uni.navigateTo({
+				url: `/packageShang/pages/order/create?goods_id=${this.id}&skuId=${this.skuId}&type=1&num=${this.cartNum}`
+			})
 		},
 		// 点击弹窗关闭图标回调
 		handleClosePop() {
 			this.$refs.addPopup.close()
 		},
 		changeValue(value) {
-			console.log('返回数值:', value)
-			if(value>this.cartSale){
-				this.cartNum=this.cartSale
-			}else{
-				this.cartNum=value
+			console.log('返回数值:', value)
+			if (value > this.cartSale) {
+				this.cartNum = this.cartSale
+			} else {
+				this.cartNum = value
 			}
 		}
 	}
@@ -1052,7 +1057,7 @@ contact-button {
 }
 
 // 加入购物车弹窗样式
-.body_pop {
+.body_pop {
 	margin-bottom: -20px;
 	position: relative;
 	padding: 0 20rpx;
@@ -1124,34 +1129,33 @@ contact-button {
 	}
 
 	.pop_tags {
-		display: flex;
-		.active_sku{
-			
-			padding: 20rpx 30rpx;
-			margin-right: 20rpx;
-			font-size: 30rpx;
-			border-radius: 40rpx;
-			background-color: #f6f6f6;
-			
-			// border: 1rpx solid #999;
-			// padding: 3rpx 10rpx 3rpx 10rpx;
-			// font-size: 24rpx;
-			// margin-right: 10rpx;
-			// border-radius: 5rpx;
-		}
-		.active_sku_color{
-			padding: 20rpx 30rpx;
-			margin-right: 20rpx;
-			font-size: 30rpx;
-			border-radius: 40rpx;
-			background-color: #ffbc49;
-			
-			// border: 1rpx solid #990002;
-			// padding: 3rpx 10rpx 3rpx 10rpx;
-			// font-size: 24rpx;
-			// margin-right: 10rpx;
-			// border-radius: 5rpx;
-			// color: #990002;
+		display: flex;
+		.active_sku {
+			padding: 20rpx 30rpx;
+			margin-right: 20rpx;
+			font-size: 30rpx;
+			border-radius: 40rpx;
+			background-color: #f6f6f6;
+
+			// border: 1rpx solid #999;
+			// padding: 3rpx 10rpx 3rpx 10rpx;
+			// font-size: 24rpx;
+			// margin-right: 10rpx;
+			// border-radius: 5rpx;
+		}
+		.active_sku_color {
+			padding: 20rpx 30rpx;
+			margin-right: 20rpx;
+			font-size: 30rpx;
+			border-radius: 40rpx;
+			background-color: #ffbc49;
+
+			// border: 1rpx solid #990002;
+			// padding: 3rpx 10rpx 3rpx 10rpx;
+			// font-size: 24rpx;
+			// margin-right: 10rpx;
+			// border-radius: 5rpx;
+			// color: #990002;
 		}
 
 		// .tag {

File diff suppressed because it is too large
+ 558 - 567
packageShang/pages/tabbar/cart.vue


+ 1 - 1
pages/collect/collect.vue

@@ -105,7 +105,7 @@ export default {
 		},
 		handleGoPage(item) {
 			uni.navigateTo({
-				url: `/pages/detail/detail?id=${item.id}`
+				url: `/pages/detail/detail?id=${item.id}&town=${item.hotelTownshipName}`
 			})
 		}
 	}

+ 2 - 2
pages/detail/detail.vue

@@ -502,7 +502,7 @@ export default {
 				this.rimList = res.data
 				const i = this.rimList.findIndex((el) => el.id == this.hotelId)
 				this.rimList.splice(i, 1)
-				if (this.distance && this.rimList.length) {
+				if (this.rimList.length) {
 					this.rimList.forEach((ele) => {
 						let lat = ele.hpositionWens.split(',')[0]
 						let lng = ele.hpositionWens.split(',')[1]
@@ -1821,4 +1821,4 @@ export default {
 		}
 	}
 }
-</style>
+</style>

+ 5 - 2
pages/evaluateStatus/evaluateStatus.vue

@@ -75,7 +75,9 @@ export default {
 			// 收藏人数
 			collectNum: 0,
 			// 是否收藏
-			isCollect: false
+			isCollect: false,
+			// 所属乡镇
+			town: ''
 		}
 	},
 	onLoad(options) {
@@ -112,7 +114,7 @@ export default {
 	methods: {
 		handleGoDetail() {
 			uni.navigateTo({
-				url: `/pages/detail/detail?id=${this.hotelId}`
+				url: `/pages/detail/detail?id=${this.hotelId}&town=${this.town}`
 			})
 		},
 		async getData() {
@@ -132,6 +134,7 @@ export default {
 				this.collectNum = res.data.count
 				this.isCollect = res.data.isCollect
 				this.total = res.data.page.total
+				this.town = res.data.town
 				this.list = [...this.list, ...res.data.page.pageList]
 			}
 		},

+ 1 - 1
pages/home/home.vue

@@ -348,7 +348,7 @@ export default {
 		// 点击每一个民宿卡片回调
 		goPageDetail(item) {
 			uni.navigateTo({
-				url: `/pages/detail/detail?id=${item.id}&distance=${item.distance}`
+				url: `/pages/detail/detail?id=${item.id}&distance=${item.distance}&town=${item.hotelTownshipName}`
 			})
 		},
 		// 选择地区时的回调

+ 55 - 25
pages/home3/home3.vue

@@ -12,6 +12,7 @@
 			<view class="header_msg">有一种生活叫靖安</view>
 		</view>
 
+		<!-- 主体内容区域 -->
 		<view class="content">
 			<!-- 条件筛选区域 -->
 			<view class="search">
@@ -60,34 +61,36 @@
 
 			<view class="body">
 				<!-- 优选民宿区域 -->
-				<view class="body_top" v-if="hotelList_you.length">
-					<view class="circle"></view>
-					<view class="circle color"></view>
-					<view class="top_title">优选民宿 .</view>
-					<view class="top_msg">特色优选民宿,让旅途充满乐趣</view>
-					<view class="top_more" @click="handleGoHome">
-						更多
-						<img src="https://chtech.ncjti.edu.cn/hotelReservation/image/13.png" />
+				<uv-skeletons :loading="loading" :skeleton="skeleton">
+					<view class="body_top" v-if="hotelList_you.length">
+						<view class="circle"></view>
+						<view class="circle color"></view>
+						<view class="top_title">优选民宿 .</view>
+						<view class="top_msg">特色优选民宿,让旅途充满乐趣</view>
+						<view class="top_more" @click="handleGoHome">
+							更多
+							<img src="https://chtech.ncjti.edu.cn/hotelReservation/image/13.png" />
+						</view>
 					</view>
-				</view>
-				<view class="body_list">
-					<!-- 每一个民宿区域 -->
-					<view class="list_item" v-for="(item, index) in hotelList_you" :key="index" @click="goPageDetail(item)">
-						<image class="item-img" :src="item.coverImg" mode="scaleToFill"></image>
-						<view class="descrition">
-							<text class="title">{{ item.hotel_name }}</text>
-							<text class="type">{{ item.hTypeName }}</text>
-							<text class="distance" v-if="showdDistance">距您直线{{ item.distance }}公里</text>
-							<view class="detail">
-								<img class="img" src="../../static/index/hotel.png" />
-								<view class="price_home">
-									<text class="txt1">¥{{ item.min_price }}</text>
-									<text class="txt2">起</text>
+					<view class="body_list">
+						<!-- 每一个民宿区域 -->
+						<view class="list_item" v-for="(item, index) in hotelList_you" :key="index" @click="goPageDetail(item)">
+							<image class="item-img" :src="item.coverImg" mode="scaleToFill"></image>
+							<view class="descrition">
+								<text class="title">{{ item.hotel_name }}</text>
+								<text class="type">{{ item.hTypeName }}</text>
+								<text class="distance" v-if="showdDistance">距您直线{{ item.distance }}公里</text>
+								<view class="detail">
+									<img class="img" src="../../static/index/hotel.png" />
+									<view class="price_home">
+										<text class="txt1">¥{{ item.min_price }}</text>
+										<text class="txt2">起</text>
+									</view>
 								</view>
 							</view>
 						</view>
 					</view>
-				</view>
+				</uv-skeletons>
 
 				<!-- 精选攻略区域 -->
 				<view class="body_top" v-if="bestNewsInfo">
@@ -316,7 +319,31 @@ export default {
 			// 招商资讯轮播图当前索引值
 			current: 0,
 			// 特产甄选列表
-			goodsList: []
+			goodsList: [],
+			// 是否显示骨架屏
+			loading: true,
+			// 骨架屏参数
+			skeleton: [
+				{
+					type: 'line',
+					style: { height: '90rpx', marginTop: '10rpx' }
+				},
+				30,
+				{
+					type: 'flex',
+					num: 2,
+					children: [
+						{
+							type: 'custom',
+							style: 'width:335rpx;height:460rpx;borderRadius:18rpx'
+						},
+						{
+							type: 'custom',
+							style: 'width:335rpx;height:460rpx;borderRadius:18rpx;marginLeft:50rpx;'
+						}
+					]
+				}
+			]
 		}
 	},
 	created() {
@@ -357,6 +384,8 @@ export default {
 		}
 	},
 	onPullDownRefresh() {
+		this.loading = true
+		this.hotelList_you = []
 		this.hotelList = []
 		this.page = 1
 		this.getLocation()
@@ -575,6 +604,7 @@ export default {
 						ele.distance = this.calculateDistance(lat, lng)
 					})
 				}
+				this.loading = false
 			}
 		},
 		// 获取民宿列表  精选
@@ -1354,4 +1384,4 @@ export default {
 		}
 	}
 }
-</style>
+</style>

+ 1 - 1
pages/myCoupon/myCoupon.vue

@@ -141,7 +141,7 @@ export default {
 		handleUse(item) {
 			if (item.hotelIds.length === 1 && !item.hotelIds.includes('-1')) {
 				uni.navigateTo({
-					url: `/pages/detail/detail?id=${item.hotelIds[0]}`
+					url: `/pages/detail/detail?id=${item.hotelIds[0]}&town=${item.town}`
 				})
 			} else {
 				uni.switchTab({

+ 1 - 1
pages/orderDetail/orderDetail.vue

@@ -315,7 +315,7 @@ export default {
 		// 点击再次预定按钮回调
 		handleAgain() {
 			uni.navigateTo({
-				url: `/pages/detail/detail?id=${this.info.hotelId}&distance=${this.distance}`
+				url: `/pages/detail/detail?id=${this.info.hotelId}&distance=${this.distance}&town=${this.info.hotelTownshipName}`
 			})
 			// if (this.info.hstatus === 1 && this.info.hotelStatus === 1) {
 			// 	uni.showModal({

+ 1 - 1
pages/orderManage/orderManage.vue

@@ -293,7 +293,7 @@ export default {
 		goPageDetail(item) {
 			this.handleDeleteList()
 			uni.navigateTo({
-				url: `/pages/detail/detail?id=${item.hotelId}&distance=${item.distance}`
+				url: `/pages/detail/detail?id=${item.hotelId}&distance=${item.distance}&town=${item.hotelTownshipName}`
 			})
 
 			// if (item.hstatus === 1 && item.hotelStatus === 1) {

+ 1 - 1
pages/tweetDetail/tweetDetail.vue

@@ -364,7 +364,7 @@ export default {
 			this.showPage = false
 			this.$refs.popup_bind.close()
 			uni.navigateTo({
-				url: `/pages/detail/detail?id=${item.id}`
+				url: `/pages/detail/detail?id=${item.id}&town=${this.info.townName}`
 			})
 		},
 		// 点击轮播图图片回调

+ 6 - 0
uni_modules/uv-icon/changelog.md

@@ -1,3 +1,9 @@
+## 1.0.13(2023-12-06)
+1. 优化
+## 1.0.12(2023-12-06)
+1. 阻止事件冒泡处理
+## 1.0.11(2023-10-29)
+1. imgMode默认值改成aspectFit
 ## 1.0.10(2023-08-13)
 1. 优化nvue,方便自定义图标
 ## 1.0.9(2023-07-28)

+ 1 - 1
uni_modules/uv-icon/components/uv-icon/props.js

@@ -63,7 +63,7 @@ export default {
 		// 图片的mode
 		imgMode: {
 			type: String,
-			default: ''
+			default: 'aspectFit'
 		},
 		// 用于显示图片小图标时,图片的宽度
 		width: {

+ 1 - 1
uni_modules/uv-icon/package.json

@@ -1,7 +1,7 @@
 {
   "id": "uv-icon",
   "displayName": "uv-icon 图标 全面兼容vue3+2、app、h5、小程序等多端",
-  "version": "1.0.10",
+  "version": "1.0.13",
   "description": "基于字体的图标集,包含了大多数常见场景的图标,支持自定义,支持自定义图片图标等。可自定义颜色、大小。",
   "keywords": [
     "uv-ui,uvui,uv-icon,icon,图标,字体图标"

+ 4 - 0
uni_modules/uv-skeletons/changelog.md

@@ -0,0 +1,4 @@
+## 1.0.1(2023-11-15)
+1. 修复支付宝小程序报错的BUG
+## 1.0.0(2023-10-30)
+1. 新版骨架屏上线

+ 247 - 0
uni_modules/uv-skeletons/components/uv-skeletons/uv-skeletons.vue

@@ -0,0 +1,247 @@
+<template>
+	<view class="uv-skeleton">
+		<view v-if="loading">
+			<view v-for="(item, index) in elements" :key="index">
+				<!-- 横向并列布局 -->
+				<view class="uv-skeleton__group" :style="[style(item)]" v-if="item.type=='flex'">
+					<view v-for="(item2,index2) in item.children" :class="[item2.clas]" :style="[style(item2)]" :key="index2">
+						<view v-for="(item3,index3) in item2.elements" :key="index3">
+							<!-- 垂直高度站位 -->
+							<view :style="{height: $uv.addUnit(item3.height,'rpx')}" v-if="item3.type=='gap'"></view>
+							<view :class="[item3.clas, roundClass, animateClass]" :style="[style(item3)]" v-else ref="skeleton"></view>
+						</view>
+					</view>
+				</view>
+				<!-- 自定义骨架屏内容 -->
+				<!-- ps 自定义扩展说明: -->
+				<!-- 如果你需要自定义模板,可以参照这个custom的写法,增加一个skeleton配置类型,编写布局和样式就可以了 -->
+				<!-- 注意事项:为了保证骨架效果和动态效果的一致,扩展时,在你希望实际展示在页面中的元素上加上 :class="[style, animateClass]" 和 :style="[style(item)]" 和 ref="skeleton" -->
+				<view :class="[item.clas, animateClass]" :style="[style(item)]" ref="skeleton" v-else-if="item.type == 'custom'"></view>
+				<!-- 垂直高度站位 -->
+				<view :style="{height: $uv.addUnit(item.height,'rpx')}" v-else-if="item.type=='gap'"></view>
+				<!-- 其他基本单位 line avatar 等 -->
+				<view :class="[item.clas, roundClass, animateClass]" :style="[style(item)]" v-else ref="skeleton"></view>
+			</view>
+		</view>
+		<view v-else>
+			<slot />
+		</view>
+	</view>
+</template>
+<script>
+	import mpMixin from '@/uni_modules/uv-ui-tools/libs/mixin/mpMixin.js'
+	import mixin from '@/uni_modules/uv-ui-tools/libs/mixin/mixin.js'
+	// #ifdef APP-NVUE
+	const animation = weex.requireModule('animation');
+	// #endif
+	export default {
+		name: 'uv-skeletons',
+		mixins: [mpMixin, mixin],
+		props: {
+			// 是否显示骨架
+			loading: {
+				type: Boolean,
+				default: true
+			},
+			// 骨架内容 具体说明参考文档:
+			skeleton: {
+				type: Array,
+				default: () => []
+			},
+			// 是否开启动画效果
+			animate: {
+				type: Boolean,
+				default: true
+			},
+			// 是否圆角骨架风格
+			round: {
+				type: Boolean,
+				default: false
+			},
+			...uni.$uv?.props?.skeleton
+		},
+		data() {
+			return {
+				elements: [],
+				opacity: 0.5,
+				duration: 600
+			}
+		},
+		computed: {
+			animateClass() {
+				return this.animate ? 'uv-skeleton--animation' : 'uv-skeleton--static';
+			},
+			roundClass() {
+				return this.round ? 'uv-skeleton--round' : 'uv-skeleton--radius';
+			},
+			style(item) {
+				return item => {
+					const style = {};
+					return this.$uv.deepMerge(style, this.$uv.addStyle(item.style));
+				}
+			}
+		},
+		created() {
+			this.init();
+			// #ifdef APP-NVUE
+			if (this.loading && this.animate) {
+				this.$uv.sleep(50).then(res => {
+					this.createAnimation(this.opacity);
+				})
+			}
+			// #endif
+		},
+		methods: {
+			/**
+			 * 初始化数据
+			 */
+			init() {
+				let elements = [];
+				if (!this.$uv.test.array(this.skeleton)) return this.$uv.error('skeleton参数必须为数组形式,参考文档示例:');
+				this.skeleton.forEach(el => {
+					const elClass = this.getElCounts(el);
+					elements = elements.concat(elClass);
+				})
+				this.elements = [...elements];
+			},
+			/**
+			 * 处理骨架屏参数内容
+			 * @param {Object} el 每项数据
+			 */
+			getElCounts(el) {
+				let elements = [];
+				let children = [];
+				if (this.$uv.test.number(el)) {
+					elements.push({
+						type: 'gap',
+						height: el
+					});
+					return elements;
+				} else {
+					const type = el.type ? el.type : 'line';
+					const num = el.num ? el.num : 1;
+					const style = el.style ? el.style : {};
+					const styleIsArray = this.$uv.test.array(style);
+					const gap = el.gap ? el.gap : '20rpx';
+					const child = el.children ? el.children : [];
+					for (let i = 0; i < child.length; i++) {
+						children[i] = {
+							clas: child[i].type.indexOf('avatar') > -1 || child[i].type.indexOf('custom') > -1 ? '' : 'uv-skeleton__group__sub',
+							elements: this.getElCounts(child[i])
+						};
+					}
+					for (let i = 0; i < num; i++) {
+						if (gap && i < num && i > 0) {
+							elements.push({
+								type: 'gap',
+								height: gap
+							});
+						}
+						elements.push({
+							clas: `uv-skeleton__${type}`,
+							type,
+							style: styleIsArray ? style[i] : style,
+							gap,
+							children
+						});
+					}
+					return elements;
+				}
+			},
+			/**
+			 * 创建动画
+			 */
+			createAnimation(opacity = 1) {
+				// loading结束之后或未开启动画不执行
+				if (!this.loading || !this.animate) return;
+				let count = 0;
+				const skeletons = this.$refs.skeleton;
+				skeletons.forEach(item => {
+					animation.transition(item, {
+						styles: {
+							opacity: opacity,
+						},
+						duration: this.duration
+					}, () => {
+						count++;
+						if (count >= skeletons.length) {
+							setTimeout(() => {
+								this.createAnimation(opacity < 1 ? 1 : this.opacity);
+							}, 200)
+						}
+					});
+				})
+			}
+		}
+	}
+</script>
+<style scoped lang="scss">
+	@import '@/uni_modules/uv-ui-tools/libs/css/components.scss';
+	@mixin background {
+		/* #ifdef APP-NVUE */
+		background-color: #e6e6e6;
+		/* #endif */
+		/* #ifndef APP-NVUE */
+		background: linear-gradient(90deg, #F1F2F4 25%, #e6e6e6 37%, #F1F2F4 50%);
+		background-size: 400% 100%;
+		/* #endif */
+	}
+	.uv-skeleton__line {
+		height: 32rpx;
+		// margin-bottom: 30rpx;
+	}
+	.uv-skeleton__line--sm {
+		height: 24rpx;
+		margin-bottom: 30rpx;
+	}
+	.uv-skeleton__line--lg {
+		height: 48rpx;
+		margin-bottom: 30rpx;
+	}
+	.uv-skeleton--static {
+		@include background;
+	}
+	.uv-skeleton--radius {
+		border-radius: 8rpx;
+	}
+	.uv-skeleton--round {
+		border-radius: 30rpx;
+	}
+	.uv-skeleton__avatar {
+		width: 100rpx;
+		height: 100rpx;
+		border-radius: 50rpx;
+	}
+	.uv-skeleton__avatar--sm {
+		width: 50rpx;
+		height: 50rpx;
+		border-radius: 25rpx;
+	}
+	.uv-skeleton__avatar--lg {
+		width: 200rpx;
+		height: 200rpx;
+		border-radius: 100rpx;
+	}
+	.uv-skeleton__group {
+		@include flex;
+		&__sub {
+			flex: 1;
+		}
+	}
+	.uv-skeleton--animation {
+		@include background;
+		/* #ifndef APP-NVUE */
+		animation: skeleton 1.8s ease infinite
+			/* #endif */
+	}
+	/* #ifndef APP-NVUE */
+	@keyframes skeleton {
+		0% {
+			background-position: 100% 50%
+		}
+		100% {
+			background-position: 0 50%
+		}
+	}
+	/* #endif */
+</style>

+ 88 - 0
uni_modules/uv-skeletons/package.json

@@ -0,0 +1,88 @@
+{
+  "id": "uv-skeletons",
+  "displayName": "uv-skeletons 骨架屏 全面兼容小程序、nvue、vue2、vue3等多端",
+  "version": "1.0.1",
+  "description": "全新升级骨架屏,更加灵活,体验更加,强烈推荐使用新版骨架屏。一般用于页面在请求远程数据尚未完成时,在内容加载出来前展示与内容布局结构一致的灰白块,提升用户视觉体验。",
+  "keywords": [
+    "uv-skeletons",
+    "uvui",
+    "uv-ui",
+    "skeleton",
+    "骨架屏"
+],
+  "repository": "",
+  "engines": {
+    "HBuilderX": "^3.1.0"
+  },
+  "dcloudext": {
+    "type": "component-vue",
+    "sale": {
+      "regular": {
+        "price": "0.00"
+      },
+      "sourcecode": {
+        "price": "0.00"
+      }
+    },
+    "contact": {
+      "qq": ""
+    },
+    "declaration": {
+    	"ads": "无",
+    	"data": "插件不采集任何数据",
+    	"permissions": "无"
+    },
+    "npmurl": ""
+  },
+  "uni_modules": {
+    "dependencies": [
+			"uv-ui-tools",
+			"uv-text"
+		],
+    "encrypt": [],
+    "platforms": {
+			"cloud": {
+				"tcb": "y",
+				"aliyun": "y"
+			},
+			"client": {
+				"Vue": {
+					"vue2": "y",
+					"vue3": "y"
+				},
+				"App": {
+					"app-vue": "y",
+					"app-nvue": "y"
+				},
+				"H5-mobile": {
+					"Safari": "y",
+					"Android Browser": "y",
+					"微信浏览器(Android)": "y",
+					"QQ浏览器(Android)": "y"
+				},
+				"H5-pc": {
+					"Chrome": "y",
+					"IE": "y",
+					"Edge": "y",
+					"Firefox": "y",
+					"Safari": "y"
+				},
+				"小程序": {
+					"微信": "y",
+					"阿里": "y",
+					"百度": "y",
+					"字节跳动": "y",
+					"QQ": "y",
+					"钉钉": "u",
+					"快手": "u",
+					"飞书": "u",
+					"京东": "u"
+				},
+				"快应用": {
+					"华为": "u",
+					"联盟": "u"
+				}
+			}
+		}
+  }
+}

+ 23 - 0
uni_modules/uv-skeletons/readme.md

@@ -0,0 +1,23 @@
+# Skeletons 新版骨架屏
+
+> **组件名:uv-skeletons**
+
+骨架屏一般用于页面在请求远程数据尚未完成时,在内容加载出来前展示与内容布局结构一致的灰白块,提升用户视觉体验。
+
+新版骨架屏与老版本使用参数有很大的区别,所以才有了新版本,无法替换老版本。
+
+新版骨架屏比老版本骨架屏更加灵活,理论上简单的左右上下布局结构均可以轻松实现,样式自由度较高,只要你会写css,推荐使用新版。
+
+# <a href="https://www.uvui.cn/components/skeletons.html" target="_blank">查看文档</a>
+
+## [下载完整示例项目](https://ext.dcloud.net.cn/plugin?name=uv-ui) <small>(请不要 下载插件ZIP)</small>
+
+### [更多插件,请关注uv-ui组件库](https://ext.dcloud.net.cn/plugin?name=uv-ui)
+
+<a href="https://ext.dcloud.net.cn/plugin?name=uv-ui" target="_blank">
+
+![image](https://mp-a667b617-c5f1-4a2d-9a54-683a67cff588.cdn.bspapp.com/uv-ui/banner.png)
+
+</a>
+
+#### 如使用过程中有任何问题反馈,或者您对uv-ui有一些好的建议,欢迎加入uv-ui官方交流群:<a href="https://www.uvui.cn/components/addQQGroup.html" target="_blank">官方QQ群</a>

+ 8 - 0
uni_modules/uv-ui-tools/changelog.md

@@ -1,3 +1,11 @@
+## 1.1.23(2023-12-12)
+1. 1.1.19版本
+## 1.1.22(2023-11-28)
+1. 优化
+## 1.1.21(2023-11-10)
+1. 1.1.17版本
+## 1.1.20(2023-10-30)
+1. 1.1.16版本
 ## 1.1.19(2023-10-13)
 1. 兼容vue3
 ## 1.1.18(2023-10-12)

+ 1 - 1
uni_modules/uv-ui-tools/index.js

@@ -6,7 +6,7 @@ import mixin from './libs/mixin/mixin.js'
 // 小程序特有的mixin
 import mpMixin from './libs/mixin/mpMixin.js'
 // #ifdef MP
-import mpShare from '@/uni_modules/uv-ui-tools/libs/mixin/mpShare.js'
+import mpShare from './libs/mixin/mpShare.js'
 // #endif
 
 // 路由封装

+ 2 - 2
uni_modules/uv-ui-tools/libs/config/config.js

@@ -1,5 +1,5 @@
-// 此版本发布于2023-10-12
-const version = '1.1.15'
+// 此版本发布于2023-12-12
+const version = '1.1.19'
 
 // 开发环境才提示,生产环境不会提示
 if (process.env.NODE_ENV === 'development') {

+ 6 - 0
uni_modules/uv-ui-tools/libs/mixin/mixin.js

@@ -1,5 +1,8 @@
 import * as index from '../function/index.js';
 import * as test from '../function/test.js';
+import route from '../util/route.js';
+import debounce from '../function/debounce.js';
+import throttle from '../function/throttle.js';
 export default {
 	// 定义每个组件都可能需要用到的外部样式以及类名
 	props: {
@@ -39,6 +42,9 @@ export default {
 			return {
 				...index,
 				test,
+				route,
+				debounce,
+				throttle,
 				unit: uni?.$uv?.config?.unit
 			}
 		},

+ 1 - 1
uni_modules/uv-ui-tools/package.json

@@ -1,7 +1,7 @@
 {
   "id": "uv-ui-tools",
   "displayName": "uv-ui-tools 工具集 全面兼容vue3+2、app、h5、小程序等多端",
-  "version": "1.1.19",
+  "version": "1.1.23",
   "description": "uv-ui-tools,集成工具库,强大的Http请求封装,清晰的文档说明,开箱即用。方便使用,可以全局使用",
   "keywords": [
     "uv-ui-tools,uv-ui组件库,工具集,uvui,uView2.x"