xiaoxin %!s(int64=2) %!d(string=hai) anos
pai
achega
c5803d81e1
Modificáronse 38 ficheiros con 1210 adicións e 378 borrados
  1. 129 0
      components/commentChild.vue
  2. 13 0
      pages.json
  3. 0 2
      pages/affirmOrder/affirmOrder.vue
  4. 47 95
      pages/appraiseDetail/appraiseDetail.vue
  5. 10 11
      pages/complaint/complaint.vue
  6. 6 2
      pages/coupon/coupon.vue
  7. 4 3
      pages/couponCenter/couponCenter.vue
  8. 374 11
      pages/detail/detail.vue
  9. 20 14
      pages/evaluate/evaluate.vue
  10. 110 36
      pages/evaluateStatus/evaluateStatus.vue
  11. 2 2
      pages/home/home.vue
  12. 8 0
      pages/home3/home3.vue
  13. 69 0
      pages/identity/identity.vue
  14. 0 64
      pages/my/my.vue
  15. 4 2
      pages/myCoupon/myCoupon.vue
  16. 10 5
      pages/myEvaluate/myEvaluate.vue
  17. 11 6
      pages/orderDetail/orderDetail.vue
  18. 2 2
      pages/pay/pay.vue
  19. 47 17
      pages/payStatus/payStatus.vue
  20. 199 0
      pages/send/send.vue
  21. 7 0
      pages/strategyDetatil/strategyDetatil.vue
  22. BIN=BIN
      static/index/send-address.png
  23. BIN=BIN
      static/index/send-binding.png
  24. BIN=BIN
      static/index/send-right.png
  25. BIN=BIN
      static/index/upload-img.png
  26. BIN=BIN
      static/index/upload-video.png
  27. BIN=BIN
      static/my/shop.png
  28. BIN=BIN
      static/my/shop2.png
  29. 1 1
      uni_modules/uv-read-more/components/uv-read-more/uv-read-more.vue
  30. 19 0
      uni_modules/uv-ui-tools/changelog.md
  31. 4 2
      uni_modules/uv-ui-tools/index.js
  32. 2 2
      uni_modules/uv-ui-tools/libs/config/config.js
  33. 2 1
      uni_modules/uv-ui-tools/libs/mixin/mixin.js
  34. 3 0
      uni_modules/uv-ui-tools/libs/mixin/openType.js
  35. 1 3
      uni_modules/uv-ui-tools/libs/util/dayjs.js
  36. 1 1
      uni_modules/uv-ui-tools/package.json
  37. 4 3
      util/api.js
  38. 101 93
      util/imageCompress.js

+ 129 - 0
components/commentChild.vue

@@ -0,0 +1,129 @@
+<template>
+	<view class="item_child">
+		<view class="child_box" v-for="item in list" :key="item.id" @click.stop="handleComment(item)">
+			<view class="box_user">
+				<img mode="aspectFill" :src="item.headPhoto" />
+				<view class="user_info">
+					<view class="info_top">{{ item.userName }}</view>
+					<view class="info_bottom">{{ item.dateTime }}</view>
+				</view>
+			</view>
+			<view class="box_content">
+				<text class="content_key">回复{{ item.commentName }}:</text>
+				{{ item.content }}
+			</view>
+
+			<view>
+				<Child v-if="item.commentVoList" :list="item.commentVoList" :commentParentId="commentParentId"></Child>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+var dayjs = require('dayjs')
+// uniapp不兼容递归组件,需要重新引入注册使用
+import Child from '@/components/commentChild.vue'
+export default {
+	components: { Child },
+	props: {
+		list: Array,
+		commentParentId: String
+	},
+	methods: {
+		handleComment(item) {
+			uni.showModal({
+				title: '请输入评论',
+				editable: true,
+				success: async (res) => {
+					if (res.confirm) {
+						const result = res.content
+						if (!res.content) {
+							uni.showToast({
+								title: '评论内容不能为空',
+								icon: 'none',
+								mask: true
+							})
+							setTimeout(() => {
+								this.handleComment()
+							}, 1500)
+						} else {
+							let time = dayjs(new Date()).format('YYYY-MM-DD HH:mm:ss')
+							const res = await this.$myRequest({
+								url: '/mhotel/abcareplyComment.action',
+								data: {
+									commentId: item.id,
+									commentParentId: this.commentParentId,
+									commentName: item.userName,
+									content: result,
+									commentStatus: 1,
+									createId: uni.getStorageSync('userInfo').id,
+									createUsername: uni.getStorageSync('userInfo').user_name,
+									createDate: time,
+									modifyDate: time
+								}
+							})
+							// console.log(res);
+							if (res.code === 200) {
+								uni.showToast({
+									title: res.message,
+									icon: 'success',
+									mask: true
+								})
+								setTimeout(() => {
+									uni.$emit('getData')
+								}, 1500)
+							}
+						}
+					}
+				}
+			})
+		}
+	}
+}
+</script>
+
+<style lang="scss" scoped>
+.item_child {
+	// margin-left: 50rpx;
+
+	.child_box {
+		margin-bottom: 10rpx;
+		.box_user {
+			display: flex;
+			align-items: center;
+			height: 120rpx;
+
+			img {
+				width: 70rpx;
+				height: 70rpx;
+				border-radius: 50%;
+			}
+
+			.user_info {
+				display: flex;
+				flex-direction: column;
+				justify-content: space-between;
+				margin-left: 18rpx;
+				height: 70rpx;
+
+				.info_top {
+					font-size: 28rpx;
+				}
+				.info_bottom {
+					color: #a6a6a6;
+					font-size: 24rpx;
+				}
+			}
+		}
+
+		.box_content {
+			font-size: 24rpx;
+
+			.content_key {
+				color: #808080;
+			}
+		}
+	}
+}
+</style>

+ 13 - 0
pages.json

@@ -241,6 +241,19 @@
 				"navigationBarTitleText": "",
 				"enablePullDownRefresh": false
 			}
+		}, {
+			"path": "pages/send/send",
+			"style": {
+				"navigationBarTitleText": "发推文",
+				"enablePullDownRefresh": false,
+				"navigationStyle": "custom"
+			}
+		}, {
+			"path": "pages/identity/identity",
+			"style": {
+				"navigationBarTitleText": "",
+				"enablePullDownRefresh": false
+			}
 		}
 	],
 	"tabBar": {

+ 0 - 2
pages/affirmOrder/affirmOrder.vue

@@ -220,8 +220,6 @@ export default {
 	watch: {
 		totalPrice: {
 			handler(newVal, oldVal) {
-				console.log(newVal)
-				console.log(oldVal)
 				this.getCouponNum()
 			}
 		}

+ 47 - 95
pages/appraiseDetail/appraiseDetail.vue

@@ -6,7 +6,7 @@
 			<view class="header_info">
 				<img mode="aspectFill" :src="info.headPhoto" />
 				<view class="info_msg">
-					<view class="msg_name">{{ info.userName }}</view>
+					<view class="msg_name">{{ info.name }}</view>
 					<view class="msg_star">
 						<uni-rate readonly activeColor="#FFC300" :size="16" :value="info.score" />
 					</view>
@@ -15,7 +15,7 @@
 			</view>
 
 			<!-- 入住时间区域 -->
-			<view class="header_time">2023-07入住,{{ info.commentTime }}发表 | {{ info.houseName }}</view>
+			<view class="header_time">{{ info.liveTime }}入住,{{ info.commentTime }}发表 | {{ info.houseName }}</view>
 
 			<!-- 评价内容区域 -->
 			<view class="header_content">{{ info.content }}</view>
@@ -46,61 +46,50 @@
 		</view>
 
 		<!-- 民宿信息区域 -->
-		<view class="hotel">
-			<img mode="aspectFill" :src="info.coverImg" />
+		<view class="hotel" @click="handleGoDetail">
+			<img mode="aspectFill" :src="info.houseUrl[0]" />
 			<view class="hotel_info">
 				<view class="info_name">{{ info.hotelName }}</view>
-				<view class="info_star">
+				<!-- <view class="info_star">
 					<uni-rate readonly activeColor="#FFC300" :size="12" :value="info.hotelScore * 1" />
 					<view class="star_num">{{ info.hotelScore }}</view>
-				</view>
-				<view class="info_tags">
+				</view> -->
+				<!-- <view class="info_tags">
 					<view class="tag_item">{{ info.hotelTownship }}</view>
 					<view class="tag_item">{{ info.hotelType }}</view>
-				</view>
+				</view> -->
+				<view class="info_tags">{{ info.houseOrderNumber }}间,{{ info.houseName }}</view>
+				<view class="info_tags">{{ info.liveTime }} - {{ info.checkOutTime }}</view>
+				<view class="info_tags">总价:¥{{ info.payAccount }}</view>
 			</view>
 		</view>
 
 		<!-- 评论回复区域 -->
 		<view class="reply">
 			<!-- 评论总条数区域 -->
-			<!-- <view class="reply_title">
+			<view class="reply_title">
 				<img src="../../static/index/comment.png" />
 				评论({{ infoList.length }})
-			</view> -->
+			</view>
 
 			<!-- 评论列表区域 -->
 			<view class="reply_box" v-if="infoList.length">
 				<!-- 每一条评论区域 -->
 				<view class="box_item" v-for="item in infoList" :key="item.id">
 					<!-- 用户区域 -->
-					<view class="item_user">
+					<view class="item_user" @click="handleComment(item)">
 						<img mode="aspectFill" :src="item.headPhoto" />
 						<view class="user_info">
-							<view class="info_top">{{ item.commentName }}</view>
+							<view class="info_top">{{ item.userName }}</view>
 							<view class="info_bottom">{{ item.dateTime }}</view>
 						</view>
 					</view>
 					<!-- 评价内容区域 -->
-					<view class="item_content">{{ item.content }}</view>
+					<view class="item_content" @click="handleComment(item)">{{ item.content }}</view>
+
+					<!-- 二级评论区域 -->
 					<view class="item_child">
-						<view class="child_box" v-for="ele in item.commentVoList" :key="ele.id">
-							<view class="box_user">
-								<img mode="aspectFill" :src="ele.headPhoto" />
-								<view class="user_info">
-									<view class="info_top">{{ ele.commentName }}</view>
-									<view class="info_bottom">{{ ele.dateTime }}</view>
-								</view>
-							</view>
-							<view class="box_content">
-								<text class="content_key">回复{{ ele.userName }}:</text>
-								{{ ele.content }}
-							</view>
-						</view>
-					</view>
-					<view class="item_foot" @click="handleComment(item)">
-						<img src="../../static/index/comment.png" />
-						回复
+						<CommentChild v-if="item.commentVoList" :list="item.commentVoList" :commentParentId="info.id" />
 					</view>
 				</view>
 			</view>
@@ -115,7 +104,9 @@
 
 <script>
 var dayjs = require('dayjs')
+import CommentChild from '@/components/commentChild.vue'
 export default {
+	components: { CommentChild },
 	data() {
 		return {
 			// 评价详情信息
@@ -136,8 +127,14 @@ export default {
 		// console.log(options)
 		this.id = options.id
 		this.getData()
+		uni.$on('getData', this.getData)
 	},
 	methods: {
+		handleGoDetail() {
+			uni.navigateTo({
+				url: `/pages/orderDetail/orderDetail?id=${this.info.bookingId}`
+			})
+		},
 		// 进入全屏和退出全屏时触发的回调
 		fullscreenchange(e) {
 			this.isFullScreen = e.detail.fullScreen
@@ -158,6 +155,7 @@ export default {
 				editable: true,
 				success: async (res) => {
 					if (res.confirm) {
+						const result = res.content
 						if (!res.content) {
 							uni.showToast({
 								title: '评论内容不能为空',
@@ -173,9 +171,9 @@ export default {
 								url: '/mhotel/abcareplyComment.action',
 								data: {
 									commentId: item.id,
-									commentParentId: item.commentId,
-									commentName: item.commentName,
-									content: res.content,
+									commentParentId: this.info.id,
+									commentName: item.userName,
+									content: result,
 									commentStatus: 1,
 									createId: uni.getStorageSync('userInfo').id,
 									createUsername: uni.getStorageSync('userInfo').user_name,
@@ -190,7 +188,9 @@ export default {
 									icon: 'success',
 									mask: true
 								})
-								this.getData()
+								setTimeout(() => {
+									this.getData()
+								}, 1500)
 							}
 						}
 					}
@@ -200,12 +200,12 @@ export default {
 		// 获取详情数据
 		async getData() {
 			const res = await this.$myRequest({
-				url: '/mhotel/abcacommentDetails.action',
+				url: '/mhotel/abcapersonageDetails.action',
 				data: {
 					bookingCommentId: this.id
 				}
 			})
-			// console.log(res);
+			// console.log(res)
 			if (res.code === 200) {
 				this.info = res.commentDetails
 				this.infoList = res.comment || []
@@ -221,7 +221,7 @@ export default {
 				data: {
 					commentId: this.info.id,
 					commentParentId: this.info.id,
-					commentName: this.info.userName,
+					commentName: this.info.name,
 					content: this.inputValue,
 					commentStatus: 1,
 					createId: uni.getStorageSync('userInfo').id,
@@ -238,7 +238,9 @@ export default {
 					mask: true
 				})
 				this.inputValue = ''
-				this.getData()
+				setTimeout(() => {
+					this.getData()
+				}, 1500)
 			}
 		},
 		// 点击图片回调
@@ -331,14 +333,15 @@ export default {
 	.hotel {
 		display: flex;
 		align-items: center;
+		padding: 20rpx 0;
 		margin-top: 20rpx;
-		height: 160rpx;
+		// height: 160rpx;
 		background-color: #fff;
 
 		img {
 			margin-left: 20rpx;
 			width: 120rpx;
-			height: 120rpx;
+			height: 170rpx;
 			border-radius: 7rpx;
 		}
 
@@ -347,7 +350,7 @@ export default {
 			flex-direction: column;
 			justify-content: space-between;
 			margin-left: 20rpx;
-			height: 120rpx;
+			height: 170rpx;
 
 			.info_name {
 				font-size: 32rpx;
@@ -400,6 +403,8 @@ export default {
 
 			.box_item {
 				margin-bottom: 10rpx;
+				padding-bottom: 10rpx;
+				border-bottom: 1rpx solid #e6e6e6;
 
 				.item_user {
 					display: flex;
@@ -438,60 +443,7 @@ export default {
 				}
 
 				.item_child {
-					.child_box {
-						margin-bottom: 10rpx;
-						.box_user {
-							display: flex;
-							align-items: center;
-							height: 120rpx;
-
-							img {
-								width: 70rpx;
-								height: 70rpx;
-								border-radius: 50%;
-							}
-
-							.user_info {
-								display: flex;
-								flex-direction: column;
-								justify-content: space-between;
-								margin-left: 18rpx;
-								height: 70rpx;
-
-								.info_top {
-									font-size: 28rpx;
-								}
-								.info_bottom {
-									color: #a6a6a6;
-									font-size: 24rpx;
-								}
-							}
-						}
-
-						.box_content {
-							font-size: 24rpx;
-
-							.content_key {
-								color: #808080;
-							}
-						}
-					}
-				}
-
-				.item_foot {
-					display: flex;
-					justify-content: flex-end;
-					align-items: center;
-					padding-right: 35rpx;
-					height: 70rpx;
-					font-size: 24rpx;
-					border-bottom: 1rpx solid #e6e6e6;
-
-					img {
-						margin-right: 12rpx;
-						width: 25rpx;
-						height: 21rpx;
-					}
+					margin-left: 50rpx;
 				}
 			}
 		}

+ 10 - 11
pages/complaint/complaint.vue

@@ -125,19 +125,10 @@ export default {
 		// 上传图片回调
 		handleUpLoad() {
 			uni.chooseMedia({
-				count: 6,
+				count: 6 - this.subImgList.length,
 				mediaType: ['mix'],
+				maxDuration: 10,
 				success: (res) => {
-					// console.log(res)
-					// console.log(res.tempFiles)
-					// 判断文件不能超过6个
-					if (this.subImgList.length + res.tempFiles.length > 6) {
-						uni.showToast({
-							title: '最多只能上传6个图片/视频',
-							icon: 'none'
-						})
-						return
-					}
 					// 判断视频文件不能超过1个
 					let temList = [...this.viewImgList, ...res.tempFiles]
 					let temList2 = temList.filter((ele) => ele.fileType === 'video')
@@ -190,6 +181,14 @@ export default {
 							this.handleUploadMini(ele)
 						}
 					})
+				},
+				fail: (err) => {
+					console.log(err)
+					uni.showToast({
+						title: '选择文件失败',
+						icon: 'none',
+						mask: true
+					})
 				}
 			})
 		},

+ 6 - 2
pages/coupon/coupon.vue

@@ -17,7 +17,11 @@
 					<view class="box_left">
 						<view class="left_title">{{ item.name }}</view>
 						<view class="left_tags">
-							<view class="tag">有限期至{{ item.effectiveEndDate.slice(0, 10) }}</view>
+							<view class="tag">
+								有限期{{ item.effectiveStartDate.slice(0, 10) || item.afterDate.slice(0, 10) }}至{{
+									item.effectiveEndDate.slice(0, 10) || item.beforDate.slice(0, 10)
+								}}
+							</view>
 							<view class="tag" v-if="item.hotelIds.includes('-1')">全民宿</view>
 							<view class="tag" v-else @click="handleClickTag(item.hotelIds)">
 								指定民宿
@@ -75,7 +79,7 @@ export default {
 		}
 	},
 	onLoad(options) {
-		console.log(options)
+		// console.log(options)
 		this.hotelId = options.id
 		this.totalPrice = options.totalPrice
 		this.complaintId = options.complaintId

+ 4 - 3
pages/couponCenter/couponCenter.vue

@@ -5,8 +5,8 @@
 			<!-- 每一张优惠券区域 -->
 			<view class="body_item" v-for="item in list" :key="item.id">
 				<img src="../../static/my/couponTitle.png" />
-				<view class="item_type" v-if="item.type === 2">折扣</view>
-				<view class="item_type" v-if="item.type === 1">代金</view>
+				<view class="item_type" v-if="item.type === 2">折扣</view>
+				<view class="item_type" v-if="item.type === 1">代金</view>
 				<view class="item_box">
 					<view class="box_left">
 						<view class="left_title">{{ item.name }}</view>
@@ -27,7 +27,8 @@
 								{{ item.type === 2 ? '最多减免' + item.maxDeduction : '' }}
 							</view>
 							<view class="info_btn" v-if="item.claimStatus === 1" @click="handleGet(item.id, item.effectiveEndDate)">立即领取</view>
-							<view class="info_btn2" v-else>已领取</view>
+							<view class="info_btn2" v-if="item.claimStatus === 2">已领取</view>
+							<view class="info_btn2" v-if="item.claimStatus === 3">已抢光</view>
 						</view>
 					</view>
 				</view>

+ 374 - 11
pages/detail/detail.vue

@@ -8,7 +8,7 @@
 		<!-- 顶部民宿图片区域 -->
 		<view class="banner">
 			<swiper autoplay circular class="swiper">
-				<swiper-item class="swiper_item" v-for="item in info.hotelFileInfoList" :key="item.id">
+				<swiper-item class="swiper_item" v-for="(item, current) in info.hotelFileInfoList" :key="item.id" @click="handleClickSwiper(info.hotelFileInfoList, current)">
 					<img mode="aspectFill" class="img" :src="item.url" />
 				</swiper-item>
 			</swiper>
@@ -242,7 +242,7 @@
 					</view>
 
 					<!-- 入住时间区域 -->
-					<view class="box_time">{{ item.liveTime.slice(0, 10) }}入住,{{ item.commentTime.slice(0, 10) }}发表 | {{ item.houseName }}</view>
+					<view class="box_time" v-if="item.liveTime">{{ item.liveTime.slice(0, 10) }}入住,{{ item.commentTime.slice(0, 10) }}发表 | {{ item.houseName }}</view>
 
 					<!-- 评价内容区域 -->
 					<uv-read-more show-height="85rpx" closeText="全文" color="#096663" fontSize="24rpx" textIndent="0" :toggle="true" :shadowStyle="shadowStyle">
@@ -287,6 +287,66 @@
 				</view>
 			</view>
 		</view>
+
+		<!-- 周边民宿区域 -->
+		<view class="rim">
+			<!-- 标题区域 -->
+			<view class="rim_title">周边民宿</view>
+			<!-- 周边民宿列表区域 -->
+			<view class="rim_body">
+				<!-- 每一个民宿区域 -->
+				<view class="rim_box" v-for="item in rimList" :key="item.id" @click="testGo(item)">
+					<img mode="aspectFill" :src="item.url" />
+					<view class="box_info">
+						<view class="info_top">{{ item.name }}</view>
+						<view class="info_center">{{ item.leave }}</view>
+						<view class="info_bottom">
+							<view class="bottom_rate">{{ item.rate }}分</view>
+							<view class="bottom_num">{{ item.num }}条评论</view>
+							<view class="bottom_price">
+								¥{{ item.price }}
+								<text>起</text>
+							</view>
+						</view>
+					</view>
+				</view>
+			</view>
+			<!-- 查看全部 -->
+			<view class="rim_more" @click="test">
+				查看全部
+				<img src="../../static/index/right.png" />
+			</view>
+		</view>
+
+		<!-- 周边景点区域 -->
+		<view class="scenicSpot">
+			<!-- 标题区域 -->
+			<view class="scenicSpot_title">周边景点</view>
+			<!-- 周边景点列表区域 -->
+			<view class="scenicSpot_body">
+				<!-- 每一个景点区域 -->
+				<view class="scenicSpot_box" v-for="item in scenicSpotList" :key="item.id">
+					<img mode="aspectFill" :src="item.url" />
+					<view class="box_info">
+						<view class="info_top">{{ item.name }}</view>
+						<view class="info_center">距您查询酒店直线{{ item.distance }}km</view>
+						<view class="info_bottom">
+							<view class="bottom_rate">{{ item.rate }}分</view>
+							<view class="bottom_num">{{ item.num }}条评论</view>
+							<view class="bottom_price">
+								¥{{ item.price }}
+								<text>起</text>
+							</view>
+						</view>
+					</view>
+				</view>
+			</view>
+			<!-- 查看全部 -->
+			<view class="scenicSpot_more" @click="test">
+				查看全部
+				<img src="../../static/index/right.png" />
+			</view>
+		</view>
 	</view>
 </template>
 
@@ -321,11 +381,14 @@ export default {
 			// 日历可以选择的最晚日期
 			lateTime: '',
 			activeIndex: 0,
-			headerList: ['预定', '评价'],
+			headerList: ['预定', '评价', '周边'],
 			// 评价列表数据
 			commentList: [],
 			queryDom: null,
+			// 评价Dom距离页面顶部的距离
 			domTop: null,
+			// 周边Dom距离页面顶部的距离
+			domTopRim: null,
 			selected: [],
 			// 总评分
 			score: '',
@@ -344,9 +407,92 @@ export default {
 			// video 上下文 videoContext 对象
 			videoContext: null,
 			// 是否是全屏状态
-			isFullScreen: false
+			isFullScreen: false,
+			rimList: [
+				{
+					id: 1726150980,
+					url: 'https://chtech.ncjti.edu.cn/hotelReservation/fileload/download/16311442750812_8.jpg',
+					name: '九岭山房民宿',
+					leave: '金宿',
+					rate: 4.8,
+					num: 109,
+					price: 180
+				},
+				{
+					id: 1102488098,
+					url: 'https://chtech.ncjti.edu.cn/hotelReservation/fileload/download/1933617026前台.jpg',
+					name: '云上九岭',
+					leave: '白金',
+					rate: 4.5,
+					num: 21,
+					price: 880
+				},
+				{
+					id: 1147515780,
+					url: 'https://chtech.ncjti.edu.cn/hotelReservation/fileload/download/1922593201民宿图片2.jpg',
+					name: '靖安三闲居民宿',
+					leave: '白金',
+					rate: 4.6,
+					num: 89,
+					price: 680
+				},
+				{
+					id: 1851521611,
+					url: 'https://chtech.ncjti.edu.cn/hotelReservation/fileload/download/14323863982h0k15000000ym7ji8285_W_1080_808_R5_D.jpg',
+					name: '野塘隐夏民宿',
+					leave: '白金',
+					rate: 4.7,
+					num: 81,
+					price: 650
+				}
+			],
+			scenicSpotList: [
+				{
+					id: 1,
+					url: 'https://jinganminsu-1320402385.cos.ap-nanjing.myqcloud.com/static//20230922113014_c1d59da5595928a4d865418eeae861b.png',
+					name: '九仙君澜水上乐园',
+					distance: 1.3,
+					rate: 4.8,
+					num: 69,
+					price: 160
+				},
+				{
+					id: 2,
+					url: 'https://jinganminsu-1320402385.cos.ap-nanjing.myqcloud.com/static//20230922112928_113d3f4c04eda11cea9051d516613aa.png',
+					name: '九仙君澜温泉',
+					distance: 1.5,
+					rate: 4.5,
+					num: 11,
+					price: 880
+				},
+				{
+					id: 3,
+					url: 'https://jinganminsu-1320402385.cos.ap-nanjing.myqcloud.com/static//20230922112955_639270c554d315e5a845d6c26ad8548.png',
+					name: '白沙坪度假村',
+					distance: 3,
+					rate: 4.6,
+					num: 89,
+					price: 388
+				},
+				{
+					id: 4,
+					url: 'https://jinganminsu-1320402385.cos.ap-nanjing.myqcloud.com/static//20230922112850_1bba201e62087a806240c668d0f2bf8.png',
+					name: '百丈山萝卜潭',
+					distance: 3.5,
+					rate: 4.7,
+					num: 81,
+					price: 550
+				}
+			]
 		}
 	},
+	mounted() {
+		// 开启转发功能
+		uni.showShareMenu({
+			withShareTicket: true,
+			menus: ['shareAppMessage', 'shareTimeline']
+		})
+	},
 	onLoad(options) {
 		this.getTimes()
 		this.hotelId = options.id
@@ -368,14 +514,45 @@ export default {
 					this.domTop = data.top
 				})
 				.exec()
+			this.queryDom
+				.select('.rim')
+				.boundingClientRect((data) => {
+					this.domTopRim = data.top
+				})
+				.exec()
 		}
-		if (e.scrollTop > this.domTop) {
+		if (e.scrollTop > this.domTopRim) {
+			this.activeIndex = 2
+		} else if (e.scrollTop > this.domTop) {
 			this.activeIndex = 1
 		} else {
 			this.activeIndex = 0
 		}
 	},
 	methods: {
+		test() {
+			uni.showToast({
+				title: '功能开发中',
+				icon: 'none',
+				mask: true
+			})
+		},
+		testGo(item) {
+			this.info = null
+			this.activeIndex = 0
+			this.score = ''
+			this.scoreFw = ''
+			this.scoreSs = ''
+			this.scoreWs = ''
+			this.scoreWz = ''
+			this.commentList = []
+			this.getHotelInfo(item.id)
+			this.getEvaData(item.id)
+			uni.pageScrollTo({
+				scrollTop: 0
+			})
+			// this.queryDom = null
+		},
 		// 进入全屏和退出全屏时触发的回调
 		fullscreenchange(e) {
 			this.isFullScreen = e.detail.fullScreen
@@ -427,11 +604,11 @@ export default {
 			}
 		},
 		// 获取评论数据
-		async getEvaData() {
+		async getEvaData(id) {
 			const res = await this.$myRequest({
 				url: '/mhotel/abcaevaluatePage.action',
 				data: {
-					hotelId: this.hotelId,
+					hotelId: id ? id : this.hotelId,
 					page: 1,
 					rows: 5,
 					status: 0
@@ -449,11 +626,11 @@ export default {
 			}
 		},
 		// 获取民宿信息
-		async getHotelInfo() {
+		async getHotelInfo(id) {
 			const res = await this.$myRequest({
 				url: '/mhotel/ahpgetHouseByHotelId.action',
 				data: {
-					hotelId: this.hotelId,
+					hotelId: id ? id : this.hotelId,
 					userId: uni.getStorageSync('userInfo').id,
 					queryStartTime: this.startTime,
 					queryEndTime: this.endTime
@@ -474,10 +651,14 @@ export default {
 				uni.pageScrollTo({
 					selector: '.evaluate'
 				})
-			} else {
+			} else if (this.activeIndex === 0) {
 				uni.pageScrollTo({
 					scrollTop: 0
 				})
+			} else if (this.activeIndex === 2) {
+				uni.pageScrollTo({
+					selector: '.rim'
+				})
 			}
 		},
 		monthSwitch(e) {
@@ -679,6 +860,13 @@ export default {
 			uni.navigateTo({
 				url: `/pages/appraise/appraise?hotelId=${this.hotelId}`
 			})
+		},
+		handleClickSwiper(urls, current) {
+			const temList = urls.map((ele) => ele.url)
+			uni.previewImage({
+				urls: temList,
+				current
+			})
 		}
 	}
 }
@@ -690,6 +878,7 @@ export default {
 	flex-direction: column;
 	align-items: center;
 	position: relative;
+	padding-bottom: 20rpx;
 	min-height: 100vh;
 	background-color: #f2f3f5;
 
@@ -1232,7 +1421,7 @@ export default {
 		.evaluate_body {
 			display: flex;
 			flex-direction: column;
-			margin-bottom: 20rpx;
+			// margin-bottom: 20rpx;
 			width: 710rpx;
 			border-radius: 11rpx;
 			background-color: #fff;
@@ -1386,5 +1575,179 @@ export default {
 			}
 		}
 	}
+
+	.rim {
+		width: 710rpx;
+		background-color: #f2f3f5;
+
+		.rim_title {
+			line-height: 83rpx;
+			font-size: 32rpx;
+			font-weight: bold;
+		}
+
+		.rim_body {
+			.rim_box {
+				display: flex;
+				margin-bottom: 20rpx;
+				width: 710rpx;
+				height: 150rpx;
+				background-color: #fff;
+
+				img {
+					width: 126rpx;
+					height: 150rpx;
+				}
+
+				.box_info {
+					display: flex;
+					flex-direction: column;
+					justify-content: space-evenly;
+					padding: 0 24rpx;
+					box-sizing: border-box;
+					width: 584rpx;
+					height: 150rpx;
+
+					.info_top {
+						font-size: 28rpx;
+						font-weight: bold;
+					}
+					.info_center {
+						font-size: 24rpx;
+						color: #808080;
+					}
+					.info_bottom {
+						display: flex;
+						align-items: center;
+						font-size: 24rpx;
+
+						.bottom_rate {
+							color: #ff5733;
+						}
+						.bottom_num {
+							margin-left: 15rpx;
+							color: #a6a6a6;
+						}
+						.bottom_price {
+							margin-left: auto;
+							font-size: 28rpx;
+							color: #ff5733;
+
+							text {
+								font-size: 20rpx;
+								color: #a6a6a6;
+							}
+						}
+					}
+				}
+			}
+		}
+
+		.rim_more {
+			display: flex;
+			justify-content: center;
+			align-items: center;
+			width: 710rpx;
+			height: 70rpx;
+			color: #096663;
+			font-size: 24rpx;
+			font-weight: bold;
+			background-color: #fff;
+
+			img {
+				margin-left: 10rpx;
+				margin-top: 2rpx;
+				width: 10rpx;
+				height: 18rpx;
+			}
+		}
+	}
+
+	.scenicSpot {
+		width: 710rpx;
+		background-color: #f2f3f5;
+
+		.scenicSpot_title {
+			line-height: 83rpx;
+			font-size: 32rpx;
+			font-weight: bold;
+		}
+
+		.scenicSpot_body {
+			.scenicSpot_box {
+				display: flex;
+				margin-bottom: 20rpx;
+				width: 710rpx;
+				height: 150rpx;
+				background-color: #fff;
+
+				img {
+					width: 126rpx;
+					height: 150rpx;
+				}
+
+				.box_info {
+					display: flex;
+					flex-direction: column;
+					justify-content: space-evenly;
+					padding: 0 24rpx;
+					box-sizing: border-box;
+					width: 584rpx;
+					height: 150rpx;
+
+					.info_top {
+						font-size: 28rpx;
+						font-weight: bold;
+					}
+					.info_center {
+						font-size: 24rpx;
+						color: #808080;
+					}
+					.info_bottom {
+						display: flex;
+						align-items: center;
+						font-size: 24rpx;
+
+						.bottom_rate {
+							color: #ff5733;
+						}
+						.bottom_num {
+							margin-left: 15rpx;
+							color: #a6a6a6;
+						}
+						.bottom_price {
+							margin-left: auto;
+							font-size: 28rpx;
+							color: #ff5733;
+
+							text {
+								font-size: 20rpx;
+								color: #a6a6a6;
+							}
+						}
+					}
+				}
+			}
+		}
+
+		.scenicSpot_more {
+			display: flex;
+			justify-content: center;
+			align-items: center;
+			width: 710rpx;
+			height: 70rpx;
+			color: #096663;
+			font-size: 24rpx;
+			font-weight: bold;
+			background-color: #fff;
+
+			img {
+				margin-left: 10rpx;
+				margin-top: 2rpx;
+				width: 10rpx;
+				height: 18rpx;
+			}
+		}
+	}
 }
 </style>

+ 20 - 14
pages/evaluate/evaluate.vue

@@ -243,7 +243,7 @@ export default {
 				})
 				setTimeout(() => {
 					uni.reLaunch({
-						url: `/pages/evaluateStatus/evaluateStatus?status=1`
+						url: `/pages/evaluateStatus/evaluateStatus?status=1&hotelId=${this.hotelId}`
 					})
 				}, 1500)
 			} else {
@@ -254,7 +254,7 @@ export default {
 				})
 				setTimeout(() => {
 					uni.navigateTo({
-						url: `/pages/evaluateStatus/evaluateStatus?status=2`
+						url: `/pages/evaluateStatus/evaluateStatus?status=2&hotelId=${this.hotelId}`
 					})
 				}, 1500)
 			}
@@ -262,19 +262,10 @@ export default {
 		// 上传图片回调
 		handleUpLoad() {
 			uni.chooseMedia({
-				count: 6,
+				count: 6 - this.subImgList.length,
 				mediaType: ['mix'],
+				maxDuration: 10,
 				success: (res) => {
-					// console.log(res)
-					// console.log(res.tempFiles)
-					// 判断文件不能超过6个
-					if (this.subImgList.length + res.tempFiles.length > 6) {
-						uni.showToast({
-							title: '最多只能上传6个图片/视频',
-							icon: 'none'
-						})
-						return
-					}
 					// 判断视频文件不能超过1个
 					let temList = [...this.viewImgList, ...res.tempFiles]
 					let temList2 = temList.filter((ele) => ele.fileType === 'video')
@@ -326,6 +317,14 @@ export default {
 							this.handleUploadMini(ele)
 						}
 					})
+				},
+				fail: (err) => {
+					console.log(err)
+					uni.showToast({
+						title: '选择文件失败',
+						icon: 'none',
+						mask: true
+					})
 				}
 			})
 		},
@@ -358,13 +357,20 @@ export default {
 							icon: 'none'
 						})
 					}
-					uni.hideLoading()
 				},
 				fail: () => {
 					uni.showToast({
 						title: '上传失败',
 						icon: 'error'
 					})
+				},
+				complete: (res) => {
+					// console.log(res);
+					uni.hideLoading({
+						complete: (hide) => {
+							// console.log(hide);
+						}
+					})
 				}
 			})
 		},

+ 110 - 36
pages/evaluateStatus/evaluateStatus.vue

@@ -9,62 +9,39 @@
 		</view>
 
 		<!-- 民宿信息区域 -->
-		<view class="info">
-			<img mode="aspectFill" src="https://img1.baidu.com/it/u=4085584268,3308739054&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=375" />
+		<view class="info" @click="handleGoDetail">
+			<img mode="aspectFill" :src="coverImg" />
 			<view class="info_name">
-				<view class="top">民宿名称</view>
-				<view class="bottom">500人收藏</view>
+				<view class="top">{{ hotelName }}</view>
+				<view class="bottom">{{ collectNum }}人收藏</view>
 			</view>
-			<view class="info_btn">收藏</view>
+			<view :class="isCollect ? 'info_btn2' : 'info_btn'" @click="changeCollect(isCollect)">{{ isCollect ? '已收藏' : '收藏' }}</view>
 		</view>
 
 		<!-- 订单列表区域 -->
 		<view class="body">
 			<!-- 每一个订单区域 -->
-			<view class="body_box">
+			<view class="body_box" v-for="(item, index) in list" :key="index">
 				<!-- 标题区域 -->
 				<view class="box_header">
 					<img class="img" src="../../static/my/hotel.png" />
-					<view class="title">民宿名称</view>
+					<view class="title">{{ item.hotelName }}</view>
 					<view class="type">已消费</view>
 				</view>
 
 				<!-- 酒店信息区域 -->
 				<view class="box_info">
-					<img class="img" mode="aspectFill" src="https://img1.baidu.com/it/u=4085584268,3308739054&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=375" />
+					<img class="img" mode="aspectFill" :src="item.url" />
 					<view class="info_right">
-						<view class="info_right_item">1间,大床房</view>
-						<view class="info_right_item">2023-07-26 - 2023-07-27</view>
-						<view class="info_right_item">总价:¥666</view>
+						<view class="info_right_item">{{ item.houseOrderNumber }}间,{{ item.houseName }}</view>
+						<view class="info_right_item">{{ item.liveTime.slice(0, 10) }} - {{ item.checkOutTime.slice(0, 10) }}</view>
+						<view class="info_right_item">总价:¥{{ item.payAccount }}</view>
 					</view>
 				</view>
 
 				<!-- 按钮区域 -->
 				<view class="box_btn">
-					<view class="btn_item" @click="handleEvaluate">去评价</view>
-				</view>
-			</view>
-			<view class="body_box">
-				<!-- 标题区域 -->
-				<view class="box_header">
-					<img class="img" src="../../static/my/hotel.png" />
-					<view class="title">民宿名称</view>
-					<view class="type">已消费</view>
-				</view>
-
-				<!-- 酒店信息区域 -->
-				<view class="box_info">
-					<img class="img" mode="aspectFill" src="https://img1.baidu.com/it/u=4085584268,3308739054&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=375" />
-					<view class="info_right">
-						<view class="info_right_item">1间,大床房</view>
-						<view class="info_right_item">2023-07-26 - 2023-07-27</view>
-						<view class="info_right_item">总价:¥666</view>
-					</view>
-				</view>
-
-				<!-- 按钮区域 -->
-				<view class="box_btn">
-					<view class="btn_item" @click="handleEvaluate">去评价</view>
+					<view class="btn_item" @click="handleEvaluate(item)">去评价</view>
 				</view>
 			</view>
 		</view>
@@ -80,12 +57,31 @@ export default {
 			// 评价状态信息
 			msg: '',
 			// 按钮文字信息
-			btnMsg: ''
+			btnMsg: '',
+			// 民宿ID
+			hotelId: '',
+			// 当前页
+			page: 1,
+			// 每页多少条
+			rows: 6,
+			// 总条数
+			total: null,
+			// 数据列表
+			list: [],
+			// 民宿封面图
+			coverImg: '',
+			// 民宿名称
+			hotelName: '',
+			// 收藏人数
+			collectNum: 0,
+			// 是否收藏
+			isCollect: false
 		}
 	},
 	onLoad(options) {
 		// console.log(options)
 		this.status = options.status
+		this.hotelId = options.hotelId
 		if (this.status === '1') {
 			uni.setNavigationBarTitle({
 				title: '评价成功'
@@ -99,8 +95,72 @@ export default {
 			this.msg = '评价失败'
 			this.btnMsg = '重新评价'
 		}
+		this.getData()
+	},
+	onReachBottom() {
+		if (this.list.length < this.total) {
+			this.page++
+			this.getData()
+		} else {
+			uni.showToast({
+				title: '没有更多数据了',
+				icon: 'none',
+				mask: true
+			})
+		}
 	},
 	methods: {
+		handleGoDetail() {
+			uni.navigateTo({
+				url: `/pages/detail/detail?id=${this.hotelId}`
+			})
+		},
+		async getData() {
+			const res = await this.$myRequest({
+				url: '/mhotel/abcaunevaluatedOrder.action',
+				data: {
+					userId: uni.getStorageSync('userInfo').id,
+					hotelId: this.hotelId,
+					page: this.page,
+					rows: this.rows
+				}
+			})
+			// console.log(res)
+			if (res.code === 200) {
+				this.coverImg = res.data.url
+				this.hotelName = res.data.name
+				this.collectNum = res.data.count
+				this.isCollect = res.data.isCollect
+				this.total = res.data.page.total
+				this.list = [...this.list, ...res.data.page.pageList]
+			}
+		},
+		async changeCollect(isCollect) {
+			const res = await this.$myRequest({
+				url: isCollect ? '/mhotel/ahpdelCollectHotel.action' : '/mhotel/ahpcollectHotel.action',
+				data: {
+					userId: uni.getStorageSync('userInfo').id,
+					hotelId: this.hotelId
+				}
+			})
+			// console.log(res)
+			if (res.code === 200) {
+				uni.showToast({
+					title: isCollect ? '取消收藏成功' : '收藏成功',
+					icon: 'success',
+					mask: true
+				})
+				this.isCollect = !this.isCollect
+				this.list = []
+				this.page = 1
+				this.getData()
+			}
+		},
+		handleEvaluate(item) {
+			uni.navigateTo({
+				url: `/pages/evaluate/evaluate?bookingId=${item.id}&hotelId=${item.hotelId}&houseId=${item.houseId}`
+			})
+		},
 		// 点击按钮回调
 		handleClickBtn() {
 			if (this.status === '1') {
@@ -194,6 +254,20 @@ export default {
 			border-radius: 22rpx;
 			background-color: #096562;
 		}
+
+		.info_btn2 {
+			display: flex;
+			justify-content: center;
+			align-items: center;
+			margin-left: auto;
+			width: 137rpx;
+			height: 71rpx;
+			color: #096562;
+			font-size: 28rpx;
+			border: 1rpx solid #096562;
+			border-radius: 22rpx;
+			background-color: #fff;
+		}
 	}
 
 	.body {

+ 2 - 2
pages/home/home.vue

@@ -171,7 +171,7 @@ export default {
 		}
 	},
 	onLoad(options) {
-		console.log(options)
+		// console.log(options)
 		this.keywords = options.keywords
 		if (!options.level || options.level === '白金') {
 			this.current = 0
@@ -291,7 +291,7 @@ export default {
 				})
 				this.placeIndex = temindex || 0
 				this.getLocation()
-				console.log(this.placeIndex)
+				// console.log(this.placeIndex)
 			}
 		},
 		// 获取用户当前位置

+ 8 - 0
pages/home3/home3.vue

@@ -3,6 +3,7 @@
 		<view class="header2" :style="{ height: customBarH * 2 + 'rpx', paddingTop: statusBarH * 2 + 'rpx' }" v-if="headerType">
 			<view class="title">靖安乡村民宿</view>
 		</view>
+
 		<!-- 顶部图片区域 -->
 		<view class="header">
 			<img mode="aspectFill" src="https://chtech.ncjti.edu.cn/hotelReservation/image/14.png" />
@@ -340,6 +341,13 @@ export default {
 							}
 						})
 					}
+				},
+				fail: () => {
+					uni.showToast({
+						title: '获取用户设置权限失败',
+						icon: 'none',
+						mask: true
+					})
 				}
 			})
 		},

+ 69 - 0
pages/identity/identity.vue

@@ -0,0 +1,69 @@
+<template>
+	<view></view>
+</template>
+
+<script>
+export default {
+	data() {
+		return {
+			type: ''
+		}
+	},
+	onLoad(options) {
+		this.type = options.type
+		this.handleCheck(this.type)
+	},
+	methods: {
+		handleCheck(type) {
+			uni.login({
+				provider: 'weixin',
+				success: (res) => {
+					this.handleQuery(type, res.code)
+				}
+			})
+		},
+		// 查询请求
+		async handleQuery(type, code) {
+			if (type === '1') {
+				// 查询商家是否绑定
+				const res = await this.$myRequest({
+					url: '/mhotel/appget_user_ma.action',
+					data: {
+						code
+					}
+				})
+				if (res.code === 200) {
+					let data = JSON.stringify(res.data)
+					uni.navigateTo({
+						url: `/pages/shopInfo/shopInfo?type=1&data=${data}`
+					})
+				} else {
+					uni.navigateTo({
+						url: '/pages/shop/shop'
+					})
+				}
+			} else if (type === '2') {
+				// 查询业主是否已绑定
+				const res = await this.$myRequest({
+					url: '/mhotel/appgetUser.action',
+					data: {
+						code
+					}
+				})
+				if (res.code === 200) {
+					let data = JSON.stringify(res.data)
+					uni.navigateTo({
+						url: `/pages/shopInfo/shopInfo?type=2&data=${data}`
+					})
+				} else {
+					uni.navigateTo({
+						url: '/pages/shop2/shop2'
+					})
+				}
+			}
+		}
+	}
+}
+</script>
+
+<style lang="scss" scoped></style>

+ 0 - 64
pages/my/my.vue

@@ -72,20 +72,6 @@
 				<img class="img_icon" src="../../static/my/right3.png" />
 			</view>
 
-			<!-- 我是商户区域 -->
-			<!-- <view class="body_item" @click="handleClick(1)">
-				<img class="img2" src="../../static/my/shop.png" />
-				我是商户
-				<img class="img_icon" src="../../static/my/right3.png" />
-			</view> -->
-
-			<!-- 我是业主区域 -->
-			<!-- <view class="body_item" @click="handleClick(2)">
-				<img class="img2" src="../../static/my/shop2.png" />
-				我是业主
-				<img class="img_icon" src="../../static/my/right3.png" />
-			</view> -->
-
 			<!-- 设置区域 -->
 			<view class="body_item" @click="handleGoPage('/pages/set/set')">
 				<img class="img3" src="../../static/my/set.png" />
@@ -157,56 +143,6 @@ export default {
 			this.flag = e.data
 			this.userInfo = uni.getStorageSync('userInfo')
 		},
-		handleClick(type) {
-			// 1为商户,2为业主
-			uni.login({
-				provider: 'weixin',
-				success: (res) => {
-					this.handleQuery(type, res.code)
-				}
-			})
-		},
-
-		// 查询请求
-		async handleQuery(type, code) {
-			if (type === 1) {
-				// 查询商家是否绑定
-				const res = await this.$myRequest({
-					url: '/mhotel/appget_user_ma.action',
-					data: {
-						code
-					}
-				})
-				if (res.code === 200) {
-					let data = JSON.stringify(res.data)
-					uni.navigateTo({
-						url: `/pages/shopInfo/shopInfo?type=1&data=${data}`
-					})
-				} else {
-					uni.navigateTo({
-						url: '/pages/shop/shop'
-					})
-				}
-			} else if (type === 2) {
-				// 查询业主是否已绑定
-				const res = await this.$myRequest({
-					url: '/mhotel/appgetUser.action',
-					data: {
-						code
-					}
-				})
-				if (res.code === 200) {
-					let data = JSON.stringify(res.data)
-					uni.navigateTo({
-						url: `/pages/shopInfo/shopInfo?type=2&data=${data}`
-					})
-				} else {
-					uni.navigateTo({
-						url: '/pages/shop2/shop2'
-					})
-				}
-			}
-		},
 		// 去登录文字回调
 		goPageLogin() {
 			uni.navigateTo({

+ 4 - 2
pages/myCoupon/myCoupon.vue

@@ -26,14 +26,14 @@
 				<img src="../../static/my/couponTitle.png" />
 				<view class="box_title">
 					<view class="title_type">{{ item.type === 1 ? '代金券' : '折扣券' }}</view>
-					<view class="title_num">x{{ item.count }}张</view>
+					<!-- <view class="title_num">x{{ item.count }}张</view> -->
 				</view>
 				<!-- 代金券信息区域 -->
 				<view class="box_info">
 					<view class="info_left">
 						<view class="left_top">{{ item.name }}</view>
 						<view class="left_bottom">
-							<view class="tag">有限期至{{ item.effectiveEndDate.slice(0, 10) }}</view>
+							<view class="tag">有限期{{ item.effectiveStartDate.slice(0, 10) }}至{{ item.effectiveEndDate.slice(0, 10) }}</view>
 							<!-- <view class="tag">可通用</view> -->
 							<view class="tag" v-if="item.hotelIds.includes('-1')">全名宿</view>
 							<view class="tag" v-else @click="handleClickTag(item.hotelIds)">
@@ -312,6 +312,7 @@ export default {
 
 					.left_bottom {
 						display: flex;
+						flex-wrap: wrap;
 						color: #808080;
 						font-size: 24rpx;
 
@@ -319,6 +320,7 @@ export default {
 							display: flex;
 							align-items: center;
 							margin-right: 32rpx;
+							margin-bottom: 15rpx;
 
 							img {
 								margin-top: 4rpx;

+ 10 - 5
pages/myEvaluate/myEvaluate.vue

@@ -8,7 +8,7 @@
 		<!-- 列表区域 -->
 		<scroll-view class="body" scroll-y @scrolltolower="handlePull">
 			<!-- 每一个盒子区域 -->
-			<view class="box" v-for="item in list" :key="item.bookingCommentId" @click="handleGoDetail(item)">
+			<view class="box" v-for="(item, index) in list" :key="index" @click="handleGoDetail(item)">
 				<!-- 头部区域 -->
 				<view class="box_top">
 					<img mode="aspectFill" src="../../static/my/hotel.png" />
@@ -21,14 +21,14 @@
 					<img mode="aspectFill" :src="item.url" />
 					<view class="center_info">
 						<view>{{ item.houseOrderNumber }}间,{{ item.houseName }}</view>
-						<view>{{ item.checkOutTime.slice(0, 10) }} - {{ item.checkOutTime.slice(0, 10) }}</view>
+						<view v-if="item.checkOutTime">{{ item.checkOutTime.slice(0, 10) }} - {{ item.checkOutTime.slice(0, 10) }}</view>
 						<view>总价:¥{{ item.payAccount }}</view>
 					</view>
 				</view>
 
 				<!-- 按钮区域 -->
 				<view class="box_btn" v-if="activeCurrent === 0">
-					<view class="btn_eva" @click.stop="handleGoPage">去评价</view>
+					<view class="btn_eva" @click.stop="handleGoPage(item)">去评价</view>
 				</view>
 			</view>
 
@@ -77,6 +77,7 @@ export default {
 			if (res.code === 200 && res.page.pageList) {
 				this.list = [...this.list, ...res.page.pageList]
 				this.total = res.total
+				this.headerList = [`待评价(${res.data.waitingCount})`, `已评价(${res.data.ratedCount})`]
 			}
 		},
 		// 切换分段器回调
@@ -104,9 +105,9 @@ export default {
 			}
 		},
 		//去评价按钮回调
-		handleGoPage() {
+		handleGoPage(item) {
 			uni.navigateTo({
-				url: '/pages/evaluate/evaluate'
+				url: `/pages/evaluate/evaluate?bookingId=${item.id}&hotelId=${item.hotelId}&houseId=${item.houseId}`
 			})
 		},
 		// 点击每一个评价订单的回调
@@ -115,6 +116,10 @@ export default {
 				uni.navigateTo({
 					url: `/pages/appraiseDetail/appraiseDetail?id=${item.bookingCommentId}`
 				})
+			} else {
+				uni.navigateTo({
+					url: `/pages/orderDetail/orderDetail?id=${item.id}`
+				})
 			}
 		}
 	}

+ 11 - 6
pages/orderDetail/orderDetail.vue

@@ -7,7 +7,9 @@
 			<!-- 标题区域 -->
 			<view class="header_title" :style="{ height: customBarH * 2 + 'rpx', paddingTop: statusBarH * 2 + 'rpx' }" v-if="!headerType">订单详情</view>
 			<view class="header_title2" :style="{ height: customBarH * 2 + 'rpx', paddingTop: statusBarH * 2 + 'rpx' }" v-else>
-				<img :style="{ paddingTop: statusBarH * 2 + 'rpx' }" src="../../static/index/left2.png" @click="handleBack" />
+				<view class="icon" :style="{ height: customBarH * 2 + 'rpx', paddingTop: statusBarH * 2 + 'rpx' }" @click="handleBack">
+					<img src="../../static/index/left2.png" />
+				</view>
 				订单详情
 			</view>
 
@@ -124,10 +126,10 @@
 					<view class="box_key">联系电话</view>
 					<view class="box_value">{{ info.userPhone }}</view>
 				</view>
-				<view class="info_box">
+				<!-- <view class="info_box">
 					<view class="box_key">预计到店</view>
 					<view class="box_value">7月26日14:00之前</view>
-				</view>
+				</view> -->
 			</view>
 
 			<!-- 订单信息区域 -->
@@ -434,10 +436,13 @@ export default {
 			font-size: 28rpx;
 			background-color: #fff;
 
-			img {
+			.icon {
 				position: absolute;
 				top: 0;
 				left: 0;
+			}
+
+			img {
 				width: 47rpx;
 				height: 47rpx;
 			}
@@ -621,7 +626,7 @@ export default {
 			box-sizing: border-box;
 			padding: 0 30rpx;
 			margin-bottom: 20rpx;
-			height: 478rpx;
+			height: 408rpx;
 			border-radius: 15rpx;
 			background-color: #fff;
 
@@ -742,4 +747,4 @@ export default {
 ::v-deep .uv-count-down .uv-count-down__text {
 	color: #fff;
 }
-</style>
+</style>

+ 2 - 2
pages/pay/pay.vue

@@ -102,11 +102,11 @@ export default {
 						success: (res) => {
 							if (res.errMsg == 'requestPayment:ok') {
 								uni.navigateTo({
-									url: '/pages/payStatus/payStatus?status=1'
+									url: `/pages/payStatus/payStatus?status=1&id=${this.info.id}`
 								})
 							} else {
 								uni.navigateTo({
-									url: '/pages/payStatus/payStatus?status=2'
+									url: `/pages/payStatus/payStatus?status=2`
 								})
 							}
 						},

+ 47 - 17
pages/payStatus/payStatus.vue

@@ -5,7 +5,10 @@
 		<!-- 支付状态区域 -->
 		<view class="status">{{ status === '1' ? '支付成功' : '支付失败' }}</view>
 		<!-- 底部按钮区域 -->
-		<view class="btn" @click="handleClickBtn">{{ status === '1' ? '返回主页' : '重新支付' }}</view>
+		<view class="btns">
+			<view class="btn_1" @click="handleClickBtn">{{ status === '1' ? '返回主页' : '重新支付' }}</view>
+			<view class="btn_2" v-if="status === '1'" @click="handleGoDetail">查看详情</view>
+		</view>
 	</view>
 </template>
 
@@ -13,16 +16,16 @@
 export default {
 	data() {
 		return {
+			id: '',
 			// 支付状态
 			status: '',
 			// 订单进度模版id
 			templateOrder: 'c9whRYC3d8ebNI_RdyG2X_1BBDwy2625hHmRWlW5Z9U'
-			// templateOrder: 'ERU1ZY9IqwNkDxWyFJvo5VSE7ua-wey3SqhZgjqLDtU'
 		}
 	},
 	onLoad(options) {
+		this.id = options.id
 		this.status = options.status
-		console.log(this.status)
 	},
 	onUnload() {
 		this.handleClickBtn()
@@ -38,21 +41,31 @@ export default {
 				uni.navigateBack(1)
 			}
 		},
+		handleGoDetail() {
+			uni.navigateTo({
+				url: `/pages/orderDetail/orderDetail?id=${this.id}`
+			})
+		},
 		// 订阅消息
 		getMessage() {
+			uni.showLoading({
+				title: '加载中',
+				mask: true
+			})
 			uni.getSetting({
 				withSubscriptions: true,
 				success: (res) => {
-					console.log(res)
+					uni.hideLoading()
+					// console.log(res)
 					if (res.subscriptionsSetting[this.templateOrder] !== 'reject') {
 						uni.requestSubscribeMessage({
 							tmplIds: [this.templateOrder],
 							success: (res) => {
-								console.log(res)
+								// console.log(res)
 								if (res[this.templateOrder] !== 'reject') {
-									console.log('成功')
+									// console.log('成功')
 								} else {
-									console.log('拒绝2')
+									// console.log('拒绝2')
 								}
 								uni.switchTab({
 									url: '/pages/home3/home3'
@@ -60,7 +73,7 @@ export default {
 							},
 							fail(err) {
 								console.log(err)
-								console.log('拒绝')
+								// console.log('拒绝')
 							}
 						})
 					} else {
@@ -72,11 +85,11 @@ export default {
 								if (res.confirm) {
 									uni.openSetting({
 										success: (res) => {
-											this.handleClick()
+											// this.handleClick()
 										}
 									})
 								} else {
-									console.log('失败')
+									// console.log('失败')
 									setTimeout(() => {
 										uni.switchTab({
 											url: '/pages/home3/home3'
@@ -114,18 +127,35 @@ export default {
 		font-weight: bold;
 	}
 
-	.btn {
+	.btns {
 		position: absolute;
 		bottom: 75rpx;
 		display: flex;
-		justify-content: center;
-		align-items: center;
-		width: 710rpx;
+		justify-content: space-evenly;
+		width: 100%;
 		height: 96rpx;
 		font-size: 32rpx;
-		color: #fff;
-		border-radius: 64rpx;
-		background-color: #096562;
+
+		.btn_1 {
+			display: flex;
+			justify-content: center;
+			align-items: center;
+			width: 300rpx;
+			color: #fff;
+			border-radius: 64rpx;
+			background-color: #096562;
+		}
+
+		.btn_2 {
+			display: flex;
+			justify-content: center;
+			align-items: center;
+			width: 300rpx;
+			color: #096562;
+			border: 1rpx solid #096562;
+			border-radius: 64rpx;
+			background-color: #fff;
+		}
 	}
 }
 </style>

+ 199 - 0
pages/send/send.vue

@@ -0,0 +1,199 @@
+<template>
+	<view class="container">
+		<!-- 页面标题区域 -->
+		<view class="header" :style="{ height: customBarH * 2 + 'rpx', paddingTop: statusBarH * 2 + 'rpx' }">
+			<img src="../../static/index/left2.png" :style="{ paddingTop: statusBarH * 2 + 'rpx' }" />
+			<view class="header_text">发推文</view>
+		</view>
+
+		<!-- 图片视频上传展示区域 -->
+		<view class="upload">
+			<view class="upload_img">
+				<img src="../../static/index/upload-img.png" />
+				添加图片
+			</view>
+			<view class="upload_video">
+				<img src="../../static/index/upload-video.png" />
+				添加视频
+			</view>
+		</view>
+
+		<!-- 标题输入区域 -->
+		<view class="title">
+			<input class="input" type="text" placeholder-style="color:#B3B3B3" placeholder="请输入标题" v-model="titleValue" />
+		</view>
+
+		<!-- 推文内容输入区域 -->
+		<view class="content">
+			<textarea class="textarea" placeholder-style="color:#B3B3B3" maxlength="3000" placeholder="请分享你的故事吧~" v-model="contentValue"></textarea>
+			<!-- 内容长度 -->
+			<view class="textarea_length">{{ contentValue.length }}/3000</view>
+		</view>
+
+		<!-- 添加地点区域 -->
+		<view class="add_place">
+			<img class="img" src="../../static/index/send-address.png" />
+			添加地点
+			<img class="img2" src="../../static/index/send-right.png" />
+		</view>
+
+		<!-- 关联民宿区域 -->
+	</view>
+</template>
+
+<script>
+export default {
+	data() {
+		return {
+			// 状态栏高度
+			statusBarH: 0,
+			// 胶囊按钮栏高度
+			customBarH: 0,
+			// 标题数据
+			titleValue: '',
+			// 推文内容区域
+			contentValue: ''
+		}
+	},
+	created() {
+		// 获取系统信息
+		uni.getSystemInfo({
+			success: (e) => {
+				// 获取状态栏高度
+				this.statusBarH = e.statusBarHeight + 10
+				// // 获取菜单按钮栏高度
+				let custom = uni.getMenuButtonBoundingClientRect()
+				this.customBarH = custom.height + 10
+			}
+		})
+	}
+}
+</script>
+
+<style lang="scss">
+.container {
+	height: 100vh;
+	background-color: #fff;
+
+	.header {
+		display: flex;
+		justify-content: center;
+		position: relative;
+		background-color: #fff;
+
+		img {
+			position: absolute;
+			top: 0;
+			left: 0;
+			width: 47rpx;
+			height: 47rpx;
+		}
+
+		.header_text {
+			font-size: 34rpx;
+		}
+	}
+
+	.upload {
+		padding: 30rpx 0 10rpx;
+		display: flex;
+
+		.upload_img {
+			display: flex;
+			flex-direction: column;
+			justify-content: center;
+			align-items: center;
+			margin-left: 20rpx;
+			width: 186rpx;
+			height: 283rpx;
+			color: #999999;
+			font-size: 28rpx;
+			border-radius: 8rpx;
+			background-color: #e6e6e6;
+
+			img {
+				margin-top: 10rpx;
+				width: 68rpx;
+				height: 68rpx;
+			}
+		}
+
+		.upload_video {
+			display: flex;
+			flex-direction: column;
+			justify-content: center;
+			align-items: center;
+			margin-left: 26rpx;
+			width: 186rpx;
+			height: 283rpx;
+			color: #999999;
+			font-size: 28rpx;
+			border-radius: 8rpx;
+			background-color: #e6e6e6;
+
+			img {
+				margin-top: 12rpx;
+				width: 68rpx;
+				height: 68rpx;
+			}
+		}
+	}
+
+	.title {
+		margin: auto;
+		width: 710rpx;
+		height: 100rpx;
+		border-bottom: 1rpx solid #e5e5e5;
+
+		.input {
+			box-sizing: border-box;
+			padding-right: 20rpx;
+			width: 100%;
+			height: 100%;
+			font-size: 32rpx;
+		}
+	}
+
+	.content {
+		margin: auto;
+		width: 710rpx;
+		height: 290rpx;
+		font-size: 28rpx;
+		color: #b3b3b3;
+		border-bottom: 1rpx solid #e5e5e5;
+
+		.textarea {
+			margin-top: 25rpx;
+			width: 100%;
+			height: 240rpx;
+		}
+
+		.textarea_length {
+			margin-top: 5rpx;
+			text-align: end;
+		}
+	}
+
+	.add_place {
+		display: flex;
+		align-items: center;
+		margin: auto;
+		width: 710rpx;
+		height: 100rpx;
+		font-size: 28rpx;
+		border-bottom: 1rpx solid #e5e5e5;
+
+		.img {
+			margin-right: 10rpx;
+			width: 55rpx;
+			height: 55rpx;
+		}
+
+		.img2 {
+			margin-left: auto;
+			width: 40rpx;
+			height: 40rpx;
+		}
+	}
+}
+</style>

+ 7 - 0
pages/strategyDetatil/strategyDetatil.vue

@@ -54,6 +54,13 @@ export default {
 			]
 		}
 	},
+	mounted() {
+		// 开启转发功能
+		uni.showShareMenu({
+			withShareTicket: true,
+			menus: ['shareAppMessage', 'shareTimeline']
+		})
+	},
 	methods: {
 		handleClick() {
 			uni.navigateTo({

BIN=BIN
static/index/send-address.png


BIN=BIN
static/index/send-binding.png


BIN=BIN
static/index/send-right.png


BIN=BIN
static/index/upload-img.png


BIN=BIN
static/index/upload-video.png


BIN=BIN
static/my/shop.png


BIN=BIN
static/my/shop2.png


+ 1 - 1
uni_modules/uv-read-more/components/uv-read-more/uv-read-more.vue

@@ -13,7 +13,7 @@
 		</view>
 		<view class="uv-read-more__toggle" :style="[innerShadowStyle]" v-if="isLongContent">
 			<slot name="toggle">
-				<view class="uv-read-more__toggle__text" @tap="toggleReadMore">
+				<view class="uv-read-more__toggle__text" @tap.stop="toggleReadMore">
 					<uv-text :text="status === 'close' ? closeText : openText" :color="color" :size="fontSize" :lineHeight="fontSize" margin="0 5px 0 0"></uv-text>
 					<view class="uv-read-more__toggle__icon">
 						<uv-icon :color="color" :size="fontSize + 2" :name="status === 'close' ? 'arrow-down' : 'arrow-up'"></uv-icon>

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

@@ -1,3 +1,22 @@
+## 1.1.16(2023-09-15)
+1. 1.1.13版本发布
+## 1.1.15(2023-09-15)
+1. 更新button.js相关按钮支持open-type="agreePrivacyAuthorization"
+## 1.1.14(2023-09-14)
+1. 优化dayjs
+## 1.1.13(2023-09-13)
+1. 优化,$uv中增加unit参数,方便组件中使用
+## 1.1.12(2023-09-10)
+1. 升级版本
+## 1.1.11(2023-09-04)
+1. 1.1.11版本
+## 1.1.10(2023-08-31)
+1. 修复customStyle和customClass存在冲突的问题
+## 1.1.9(2023-08-27)
+1. 版本升级
+2. 优化
+## 1.1.8(2023-08-24)
+1. 版本升级
 ## 1.1.7(2023-08-22)
 1. 版本升级
 ## 1.1.6(2023-08-18)

+ 4 - 2
uni_modules/uv-ui-tools/index.js

@@ -32,7 +32,6 @@ const $uv = {
 	route,
 	config,
 	test,
-	throttle,
 	date: index.timeFormat, // 另名date
 	...index,
 	colorGradient: colorGradient.colorGradient,
@@ -49,7 +48,10 @@ const $uv = {
 uni.$uv = $uv;
 const install = (Vue,options={}) => {
 		// #ifndef APP-NVUE
-		Vue.mixin(mixin);
+		const cloneMixin = index.deepClone(mixin);
+		delete cloneMixin?.props?.customClass;
+		delete cloneMixin?.props?.customStyle;
+		Vue.mixin(cloneMixin);
 		// #ifdef MP
 		if(options.mpShare){
 			Vue.mixin(mpShare);

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

@@ -1,5 +1,5 @@
-// 此版本发布于2023-08-22
-const version = '1.1.7'
+// 此版本发布于2023-09-15
+const version = '1.1.13'
 
 // 开发环境才提示,生产环境不会提示
 if (process.env.NODE_ENV === 'development') {

+ 2 - 1
uni_modules/uv-ui-tools/libs/mixin/mixin.js

@@ -38,7 +38,8 @@ export default {
 		$uv() {
 			return {
 				...index,
-				test
+				test,
+				unit: uni?.$uv?.config?.unit
 			}
 		},
 		/**

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

@@ -25,6 +25,9 @@ export default {
         onChooseavatar(event) {
             this.$emit('chooseavatar', event.detail)
         },
+        onAgreeprivacyauthorization(event) {
+            this.$emit('agreeprivacyauthorization', event.detail)
+        },
         onAddgroupapp(event) {
             this.$emit('addgroupapp', event.detail)
         },

+ 1 - 3
uni_modules/uv-ui-tools/libs/util/dayjs.js

@@ -3,9 +3,8 @@ var __commonJS = (cb, mod) => function __require() {
   return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
 };
 
-// C:/Users/LP/Downloads/uvui-plus_3.1.27_example/node_modules/dayjs/dayjs.min.js
 var require_dayjs_min = __commonJS({
-  "C:/Users/LP/Downloads/uvui-plus_3.1.27_example/node_modules/dayjs/dayjs.min.js"(exports, module) {
+  "uvuidayjs"(exports, module) {
     !function(t, e) {
       "object" == typeof exports && "undefined" != typeof module ? module.exports = e() : "function" == typeof define && define.amd ? define(e) : (t = "undefined" != typeof globalThis ? globalThis : t || self).dayjs = e();
     }(exports, function() {
@@ -215,4 +214,3 @@ var require_dayjs_min = __commonJS({
   }
 });
 export default require_dayjs_min();
-//# sourceMappingURL=dayjs.js.map

+ 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.7",
+  "version": "1.1.16",
   "description": "uv-ui-tools,集成工具库,强大的Http请求封装,清晰的文档说明,开箱即用。方便使用,可以全局使用",
   "keywords": [
     "uv-ui-tools,uv-ui组件库,工具集,uvui,uView2.x"

+ 4 - 3
util/api.js

@@ -1,6 +1,6 @@
-// const BASE_URL = "https://chtech.ncjti.edu.cn/hotelReservation/mhotel"
+const BASE_URL = "https://chtech.ncjti.edu.cn/hotelReservation"
 // const BASE_URL = "http://101.42.162.31:8088"
-const BASE_URL = "https://chtech.ncjti.edu.cn/homestay"
+// const BASE_URL = "https://chtech.ncjti.edu.cn/homestay"
 // const BASE_URL = "http://192.168.161.224:8088"
 export const myRequest = (options) => {
 	uni.showLoading({
@@ -31,10 +31,11 @@ export const myRequest = (options) => {
 				reject(err)
 			},
 			complete: (res) => {
+				// console.log(res);
 				uni.hideLoading({
 					complete: (hide) => {
 						// console.log(hide);
-						if (res.data.code === 200 || res.data.code === 205) {
+						if (res.data.code === 200) {
 
 						} else {
 							uni.showToast({

+ 101 - 93
util/imageCompress.js

@@ -1,97 +1,105 @@
- //通过canvas将图片压缩至指定大小
+//通过canvas将图片压缩至指定大小
 
- //判断图片大小是否满足需求,limitSize的单位是kb
- function imageSizeIsLessLimitSize(imagePath, limitSize, lessCallback, moreCallback) {
- 	//获取文件信息
- 	wx.getFileSystemManager().getFileInfo({
- 		filePath: imagePath,
- 		success: (res) => {
- 			// console.log("压缩前图片大小", res.size / 1024, 'kb');
- 			//如果图片太大了走moreCallback
- 			if (res.size > 1024 * limitSize) {
- 				moreCallback()
- 			}
- 			//图片满足要求了走lessCallback
- 			else {
- 				lessCallback()
- 			}
- 		}
- 	})
- }
+//判断图片大小是否满足需求,limitSize的单位是kb
+function imageSizeIsLessLimitSize(imagePath, limitSize, lessCallback, moreCallback) {
+	//获取文件信息
+	wx.getFileSystemManager().getFileInfo({
+		filePath: imagePath,
+		success: (res) => {
+			// console.log("压缩前图片大小", res.size / 1024, 'kb');
+			//如果图片太大了走moreCallback
+			if (res.size > 1024 * limitSize) {
+				moreCallback()
+			}
+			//图片满足要求了走lessCallback
+			else {
+				lessCallback()
+			}
+		}
+	})
+}
 
- //将图片画在画布上并获取画好之后的图片的路径
- function getCanvasImage(canvasId, imagePath, imageW, imageH, getImgSuccess) {
- 	//创建画布内容
- 	const ctx = wx.createCanvasContext(canvasId);
- 	//图片画上去,imageW和imageH是画上去的尺寸,图像和画布间隔都是0
- 	ctx.drawImage(imagePath, 0, 0, imageW, imageH);
- 	//这里一定要加定时器,给足够的时间去画(所以每次递归最少要耗时200ms,多次递归很耗时!)
- 	ctx.draw(false, setTimeout(function() {
- 		//把当前画布指定区域的内容导出生成指定大小的图片,并返回文件路径
- 		wx.canvasToTempFilePath({
- 			canvasId: canvasId,
- 			x: 0,
- 			y: 0,
- 			width: imageW,
- 			height: imageH,
- 			quality: 1, //最高质量
- 			success: (res) => {
- 				//将取出的图片路径通过回调函数返回
- 				getImgSuccess(res.tempFilePath);
- 			}
- 		})
- 	}, 200));
- }
+//将图片画在画布上并获取画好之后的图片的路径
+function getCanvasImage(canvasId, imagePath, imageW, imageH, getImgSuccess) {
+	//创建画布内容
+	const ctx = wx.createCanvasContext(canvasId);
+	//图片画上去,imageW和imageH是画上去的尺寸,图像和画布间隔都是0
+	ctx.drawImage(imagePath, 0, 0, imageW, imageH);
+	//这里一定要加定时器,给足够的时间去画(所以每次递归最少要耗时200ms,多次递归很耗时!)
+	ctx.draw(false, setTimeout(function() {
+		//把当前画布指定区域的内容导出生成指定大小的图片,并返回文件路径
+		wx.canvasToTempFilePath({
+			canvasId: canvasId,
+			x: 0,
+			y: 0,
+			width: imageW,
+			height: imageH,
+			quality: 1, //最高质量
+			success: (res) => {
+				//将取出的图片路径通过回调函数返回
+				getImgSuccess(res.tempFilePath);
+			}
+		})
+	}, 200));
+}
 
- //主函数,默认限制大小1024kb即1mb,drawWidth是绘画区域的大小
- //初始值传入为画布自身的边长(我们这是一个正方形的画布)
- function getLessLimitSizeImage(canvasId, imagePath, limitSize = 1024, drawWidth, callback) {
- 	//判断图片尺寸是否满足要求
- 	imageSizeIsLessLimitSize(imagePath, limitSize,
- 		(lessRes) => {
- 			//满足要求走callback,将压缩后的文件路径返回
- 			callback(imagePath);
- 		},
- 		(moreRes) => {
- 			//不满足要求需要压缩的时候
- 			wx.getImageInfo({
- 				src: imagePath,
- 				success: (imageInfo) => {
- 					let maxSide = Math.max(imageInfo.width, imageInfo.height);
- 					let windowW = drawWidth;
- 					let scale = 1;
- 					/*
- 					这里的目的是当绘画区域缩小的比图片自身尺寸还要小的时候
- 					取图片长宽的最大值,然后和当前绘画区域计算出需要放缩的比例
- 					然后再画经过放缩后的尺寸,保证画出的一定是一个完整的图片。由于每次递归绘画区域都会缩小,
- 					所以不用担心scale永远都是1绘画尺寸永远不变的情况,只要不满足压缩后体积的要求
- 					就会缩小绘画区域,早晚会有绘画区域小于图片尺寸的情况发生
- 					*/
- 					if (maxSide > windowW) {
- 						scale = windowW / maxSide;
- 					}
- 					//trunc是去掉小数
- 					let imageW = Math.trunc(imageInfo.width * scale);
- 					let imageH = Math.trunc(imageInfo.height * scale);
- 					// console.log('调用压缩', imageW, imageH);
- 					//图片在规定绘画区域上画并获取新的图片的path
- 					getCanvasImage(canvasId, imagePath, imageW, imageH,
- 						(pressImgPath) => {
- 							/*
- 							再去检查是否满足要求,始终缩小绘画区域,让图片适配绘画区域
- 							这里乘以0.95是必须的,如果不缩小绘画区域,会出现尺寸比绘画区域小,
- 							而体积比要求压缩体积大的情况出现,就会无穷递归下去,因为scale的值永远是1
- 							但0.95不是固定的,你可以根据需要自己改,0到1之间,越小则绘画区域缩小的越快
- 							但不建议取得太小,绘画区域缩小的太快,压出来的将总是很糊的
- 							*/
- 							getLessLimitSizeImage(canvasId, pressImgPath, limitSize, drawWidth *
- 								0.95, callback);
- 						}
- 					)
- 				}
- 			})
- 		}
- 	)
- }
+//主函数,默认限制大小1024kb即1mb,drawWidth是绘画区域的大小
+//初始值传入为画布自身的边长(我们这是一个正方形的画布)
+function getLessLimitSizeImage(canvasId, imagePath, limitSize = 1024, drawWidth, callback) {
+	//判断图片尺寸是否满足要求
+	imageSizeIsLessLimitSize(imagePath, limitSize,
+		(lessRes) => {
+			//满足要求走callback,将压缩后的文件路径返回
+			callback(imagePath);
+		},
+		(moreRes) => {
+			//不满足要求需要压缩的时候
+			wx.getImageInfo({
+				src: imagePath,
+				success: (imageInfo) => {
+					let maxSide = Math.max(imageInfo.width, imageInfo.height);
+					let windowW = drawWidth;
+					let scale = 1;
+					/*
+					这里的目的是当绘画区域缩小的比图片自身尺寸还要小的时候
+					取图片长宽的最大值,然后和当前绘画区域计算出需要放缩的比例
+					然后再画经过放缩后的尺寸,保证画出的一定是一个完整的图片。由于每次递归绘画区域都会缩小,
+					所以不用担心scale永远都是1绘画尺寸永远不变的情况,只要不满足压缩后体积的要求
+					就会缩小绘画区域,早晚会有绘画区域小于图片尺寸的情况发生
+					*/
+					if (maxSide > windowW) {
+						scale = windowW / maxSide;
+					}
+					// 判断图片是否翻转了
+					if (imageInfo.orientation.indexOf('right') !== -1 || imageInfo.orientation.indexOf(
+							'left') !== -1) {
+						//trunc是去掉小数
+						var imgW = Math.trunc(imageInfo.height * scale);
+						var imgH = Math.trunc(imageInfo.width * scale);
+					} else {
+						var imgW = Math.trunc(imageInfo.width * scale);
+						var imgH = Math.trunc(imageInfo.height * scale);
+					}
+					// console.log('调用压缩', imgW, imgH);
 
- export default getLessLimitSizeImage
+					//图片在规定绘画区域上画并获取新的图片的path
+					getCanvasImage(canvasId, imagePath, imgW, imgH,
+						(pressImgPath) => {
+							/*
+							再去检查是否满足要求,始终缩小绘画区域,让图片适配绘画区域
+							这里乘以0.95是必须的,如果不缩小绘画区域,会出现尺寸比绘画区域小,
+							而体积比要求压缩体积大的情况出现,就会无穷递归下去,因为scale的值永远是1
+							但0.95不是固定的,你可以根据需要自己改,0到1之间,越小则绘画区域缩小的越快
+							但不建议取得太小,绘画区域缩小的太快,压出来的将总是很糊的
+							*/
+							getLessLimitSizeImage(canvasId, pressImgPath, limitSize, drawWidth *
+								0.95, callback);
+						}
+					)
+				}
+			})
+		}
+	)
+}
+
+export default getLessLimitSizeImage