py 1 rok pred
rodič
commit
8af2b36ae7

+ 156 - 56
pages-takeout/1212.vue

@@ -1,6 +1,6 @@
 <template>
 	<view class="container flex-common-css iPhone-bottom box-border-box">
-		<Nav :title="school_name"></Nav>
+		<Nav title="君子帮选"></Nav>
 		<image class="bg-img" src="https://sjz-school.oss-cn-chengdu.aliyuncs.com/webImages/bg.png" mode=""></image>
 		<!-- 泡泡容器 -->
 		<view class="q-box z-2">
@@ -8,44 +8,77 @@
         transform: `translate(${bubble.x}px, ${bubble.y}px)`,
         width: bubble.size + 'px',
         height: bubble.size + 'px',
-        backgroundColor: selectedBubbleIndex === index ? '#ffcc00' : 'rgba(255, 255, 255, 0.7)', // 选中时高亮
-      }" class="bubble"></view>
+        backgroundColor: selectedBubbleIndex === index ? '#ffcc00' : '', // 选中时高亮
+      }" class="bubble box-border-box">
+				<image class="qp-img" src="/pages-takeout/static/qp.png" mode=""></image>
+				<image class="shop-logo z-2 b-rad-20" :src="bubble.shop_logo" mode=""></image>
+				<view
+					class="fs-24 fc-f z-2 text-overflow-ellipsis-one max-w-118 text-align-center pl-15 box-border-box">
+					{{bubble.shop_name}}
+				</view>
+			</view>
+		</view>
+		<view class="but-box" @click="selectRandomBubble">
+			<image class="but-img" src="/pages-takeout/static/but-bg.png" mode=""></image>
+			<view class="fs-38 fc-f fw-b text-align-center z-2 pt-49 mb-82">
+				君子帮你选,今日吃点啥?
+			</view>
+			<view class="fs-28 fc-1089D1 text-align-center">
+				全部商家随机抽取
+			</view>
 		</view>
-
-
-		<!-- 选择按钮 -->
-		<view class="button" @click="selectRandomBubble">随机选择一个泡泡</view>
 
 		<!-- 弹窗 -->
-		<view v-if="showPopup" class="popup">
+		<uni-popup ref="popup" type="center" border-radius="10px 10px 10px 10px" :mask-click="false">
+			<view class="pop-box b-rad-20 flex-direction align-items-center p-24 box bgc-f">
+				<uni-icons class="gb-icon" @click="closePopup" type="closeempty" size="23"></uni-icons>
+				<view class="text-align-center fw-600 fs-34 mb-20">
+					选中的商家
+				</view>
+				<image class="shop-logo-img mb-20" :src="shop_logo" mode=""></image>
+				<view class="text-align-center fs-30 fc-0 mb-30">
+					{{shop_name}}
+				</view>
+				<view class="ppo-but bgc-4db8ff text-align-center fc-f fs-28 b-rad-200" @click="toShop">
+					去点餐
+				</view>
+			</view>
+		</uni-popup>
+		<!-- 		<view class="popup">
 			<view class="popup-content">
 				<text>选中的泡泡编号:{{ selectedBubbleIndex + 1 }}</text>
 				<view class="close-button" @click="closePopup">关闭</view>
 			</view>
-		</view>
+		</view> -->
 	</view>
 </template>
 
 <script>
+	import {
+		shopAll
+	} from "@/api/shop.js";
+	import {
+		shopInfo
+	} from "@/api/shop.js"
+	import tools from "@/service/tools";
 	export default {
 		data() {
 			return {
-				school_name: '',
+				shopId: 0,
+				shop_name: '',
+				shop_logo: '',
 				bubbles: [], // 存储泡泡信息
 				screenWidth: 0, // 屏幕宽度
 				screenHeight: 0, // 屏幕高度
 				animationTimer: null, // 动画定时器
 				selectedBubbleIndex: null, // 当前选中的泡泡索引
-				showPopup: false, // 是否显示弹窗
 				isSelecting: false, // 是否正在选择中
 			};
 		},
-		onLoad(data) {
-			this.school_name = uni.getStorageSync('school_name');
-		},
+		onLoad(data) {},
 		mounted() {
 			this.getScreenSize(); // 获取屏幕尺寸
-			this.generateBubbles(20); // 生成 20 个泡泡
+			this.shopAll(); // 泡泡信息
 			this.startAnimation(); // 开始动画
 		},
 		beforeDestroy() {
@@ -57,27 +90,25 @@
 		methods: {
 			// 获取屏幕尺寸
 			getScreenSize() {
-				// uni.createSelectorQuery().in(this).select('.q-box').boundingClientRect((rect) => {
-				// 	if (rect) {
-				// 		this.screenHeight = rect.height;
-				// 	}
-				// }).exec();
 				const systemInfo = uni.getSystemInfoSync();
 				this.screenWidth = systemInfo.windowWidth; // 屏幕宽度
-				this.screenHeight = systemInfo.windowHeight; // 屏幕高度
+				this.screenHeight = systemInfo.windowHeight * 0.71; // 屏幕高度
 			},
-			// 生成随机泡泡
-			generateBubbles(count) {
-				const containerHeight = this.screenHeight * 0.7; // 泡泡容器高度为屏幕高度的 70%
-				for (let i = 0; i < count; i++) {
-					this.bubbles.push({
-						x: Math.random() * (this.screenWidth - 50), // 随机水平位置
-						y: Math.random() * (this.screenHeight - 50), // 随机垂直位置
-						size: Math.random() * 40 + 20, // 随机大小(20px - 60px)
-						speedX: (Math.random() - 0.5) * 2, // 水平速度(-1 到 1)
-						speedY: (Math.random() - 0.5) * 2, // 垂直速度(-1 到 1)
-					});
-				}
+			shopAll() {
+				shopAll().then((res) => {
+					if (res.code === 1) {
+						this.bubbles = res.data;
+						console.log(this.bubbles, this.bubbles.length);
+						// 生成随机泡泡
+						this.bubbles.forEach((v, k) => {
+							v.x = Math.random() * (this.screenWidth - 50); // 随机水平位置
+							v.y = Math.random() * (this.screenHeight - 50); // 随机垂直位置
+							v.size = 59; // 随机大小(20px - 60px)
+							v.speedX = (Math.random() - 0.5) * 2; // 水平速度(-1 到 1)
+							v.speedY = (Math.random() - 0.5) * 2; // 垂直速度(-1 到 1)
+						})
+					}
+				});
 			},
 			// 开始动画
 			startAnimation() {
@@ -89,7 +120,6 @@
 			},
 			// 更新泡泡位置
 			updateBubblesPosition() {
-				const containerHeight = this.screenHeight * 0.7; // 泡泡容器高度为屏幕高度的 70%
 				this.bubbles.forEach((bubble) => {
 					// 更新位置
 					bubble.x += bubble.speedX;
@@ -110,30 +140,77 @@
 			selectRandomBubble() {
 				if (this.isSelecting) return; // 防止重复点击
 				this.isSelecting = true;
-
 				// 随机选择过程动画
 				const totalSteps = 20; // 随机闪烁次数
 				let step = 0;
 				const interval = setInterval(() => {
 					this.selectedBubbleIndex = Math.floor(Math.random() * this.bubbles.length);
+					this.shopId = this.bubbles[this.selectedBubbleIndex].shop_id
+					this.shop_logo = this.bubbles[this.selectedBubbleIndex].shop_logo
+					this.shop_name = this.bubbles[this.selectedBubbleIndex].shop_name
 					step++;
 					if (step >= totalSteps) {
 						clearInterval(interval);
 						this.isSelecting = false;
-						this.showPopup = true; // 显示弹窗
+						this.$refs.popup.open() // 显示弹窗
 					}
 				}, 100); // 每 100 毫秒闪烁一次
 			},
 			// 关闭弹窗
 			closePopup() {
-				this.showPopup = false;
+				this.$refs.popup.close()
 				this.selectedBubbleIndex = null; // 重置选中状态
 			},
+			toShop(item) {
+				shopInfo({
+					shop_id: this.shopId
+				}).then((res) => {
+					if (res.code == 1) {
+						uni.redirectTo({
+							url: '/pages-takeout/shop?shop_id=' + this.shopId
+						})
+					} else {
+						tools.error(res.msg)
+					}
+				})
+			}
 		},
 	};
 </script>
 
 <style>
+	.shop-logo-img {
+		width: 130rpx;
+		height: 130rpx;
+		border-radius: 5rpx;
+	}
+
+	.max-w-118 {
+		max-width: 118rpx;
+	}
+
+	.qp-img {
+		width: 118rpx;
+		height: 118rpx;
+		position: absolute;
+		left: 0;
+		top: 0;
+	}
+
+	.shop-logo {
+		width: 68.5rpx;
+		height: 68.5rpx;
+		margin: 0 0 34rpx 29rpx;
+	}
+
+	.pt-49 {
+		padding-top: 49rpx;
+	}
+
+	.mb-82 {
+		margin-bottom: 82rpx;
+	}
+
 	.bg-img {
 		width: 100%;
 		height: 89%;
@@ -142,38 +219,42 @@
 		top: 0;
 	}
 
+	.z-2 {
+		position: relative;
+		z-index: 2;
+	}
+
 	.container {
 		position: relative;
 		overflow: hidden;
 	}
-	.q-box {
-/* 		width: 100%;
-		height: 71vh;
-		padding-bottom: constant(safe-area-inset-bottom);
-		padding-bottom: env(safe-area-inset-bottom);
-		position: relative; */
-	}
+
+	.q-box {}
+
 	.bubble {
 		position: absolute;
-		background-color: rgba(255, 255, 255, 0.7);
 		/* 泡泡颜色 */
 		border-radius: 50%;
 		will-change: transform;
+		padding: 28rpx 20rpx 29rpx 0;
 		/* 优化性能 */
 	}
 
-	.button {
+	.but-box {
+		width: 100%;
+		height: 170rpx;
 		position: absolute;
-		bottom: 20px;
-		left: 50%;
-		transform: translateX(-50%);
-		padding: 10px 20px;
-		background-color: #007aff;
-		color: white;
-		border-radius: 20px;
-		text-align: center;
-		font-size: 16px;
-		cursor: pointer;
+		bottom: 135rpx;
+		left: 0;
+	}
+
+	.but-img {
+		position: absolute;
+		left: 0;
+		top: 0;
+		z-index: 1;
+		width: 100%;
+		height: 100%;
 	}
 
 	.popup {
@@ -203,4 +284,23 @@
 		border-radius: 5px;
 		cursor: pointer;
 	}
+
+	.pop-box {
+		width: 60vw;
+		height: auto;
+		position: relative;
+	}
+
+	.ppo-but {
+		width: 80%;
+		height: 70rpx;
+		line-height: 70rpx;
+		margin: 0 auto;
+	}
+
+	.gb-icon {
+		position: absolute;
+		right: 24rpx;
+		top: 24rpx;
+	}
 </style>

+ 160 - 127
pages-takeout/help-choose.vue

@@ -1,25 +1,38 @@
 <template>
-	<view class="flex-common-css iPhone-bottom box-border-box">
+	<view class="container flex-common-css iPhone-bottom box-border-box">
 		<Nav :title="school_name"></Nav>
-		<image class="bg-img" src="/pages-takeout/static/bg.png" mode=""></image>
-		<view class="q-box z-2" ref="qBox">
-			<view v-for="(ball,index) in shopData" :key="index" class="ball flex-direction"
-				:style="{ left: ball.x + 'rpx', top: ball.y + 'rpx' }">
+		<image class="bg-img" src="https://sjz-school.oss-cn-chengdu.aliyuncs.com/webImages/bg.png" mode=""></image>
+		<!-- 泡泡容器 -->
+		<view class="q-box z-2">
+			<view v-for="(bubble, index) in bubbles" :key="index" :style="{
+        transform: `translate(${bubble.x}px, ${bubble.y}px)`,
+        width: bubble.size + 'px',
+        height: bubble.size + 'px',
+        backgroundColor: selectedBubbleIndex === index ? '#ffcc00' : '', // 选中时高亮
+      }" class="bubble box-border-box">
 				<image class="qp-img" src="/pages-takeout/static/qp.png" mode=""></image>
-				<image class="shop-logo z-2 b-rad-20" :src="ball.shop_logo" mode=""></image>
-				<view class="fs-24 fc-f z-2 text-overflow-ellipsis-one max-w-118 text-align-center">
-					{{ball.shop_name}}
+				<image class="shop-logo z-2 b-rad-20" :src="bubble.shop_logo" mode=""></image>
+				<view class="fs-24 fc-f z-2 text-overflow-ellipsis-one max-w-118 text-align-center pl-15 box-border-box">
+					{{bubble.shop_name}}
 				</view>
 			</view>
 		</view>
-		<view class="but-box">
+		<view class="but-box" @click="selectRandomBubble">
 			<image class="but-img" src="/pages-takeout/static/but-bg.png" mode=""></image>
-			<view class="fs-38 fc-f fw-b text-align-center z-2 pt-49">
+			<view class="fs-38 fc-f fw-b text-align-center z-2 pt-49 mb-82">
 				君子帮你选,今日吃点啥?
 			</view>
+			<view class="fs-28 fc-1089D1 text-align-center">
+				全部商家随机抽取
+			</view>
 		</view>
-		<view class="fs-28 fc-1089D1 text-align-center">
-			全部商家随机抽取
+
+		<!-- 弹窗 -->
+		<view v-if="showPopup" class="popup">
+			<view class="popup-content">
+				<text>选中的泡泡编号:{{ selectedBubbleIndex + 1 }}</text>
+				<view class="close-button" @click="closePopup">关闭</view>
+			</view>
 		</view>
 	</view>
 </template>
@@ -28,148 +41,120 @@
 	import {
 		shopAll
 	} from "@/api/shop.js";
-
 	export default {
-		components: {},
 		data() {
 			return {
 				school_name: '',
 				shopId: 0,
-				shopData: [],
-				animationFrameId: null,
-				animations: []
+				school_name: '',
+				bubbles: [], // 存储泡泡信息
+				screenWidth: 0, // 屏幕宽度
+				screenHeight: 0, // 屏幕高度
+				animationTimer: null, // 动画定时器
+				selectedBubbleIndex: null, // 当前选中的泡泡索引
+				showPopup: false, // 是否显示弹窗
+				isSelecting: false, // 是否正在选择中
 			};
 		},
 		onLoad(data) {
 			this.school_name = uni.getStorageSync('school_name');
-			this.getQBoxSize();
 		},
 		mounted() {
-			this.shopAll();
-			this.startAnimation();
+			this.getScreenSize(); // 获取屏幕尺寸
+			this.shopAll(); // 泡泡信息
+			this.startAnimation(); // 开始动画
+		},
+		beforeDestroy() {
+			// 组件销毁时停止动画
+			if (this.animationTimer) {
+				clearTimeout(this.animationTimer);
+			}
 		},
 		methods: {
-			scrolltolower() {
-				console.log('触底');
+			// 获取屏幕尺寸
+			getScreenSize() {
+				const systemInfo = uni.getSystemInfoSync();
+				this.screenWidth = systemInfo.windowWidth; // 屏幕宽度
+				this.screenHeight = systemInfo.windowHeight * 0.71; // 屏幕高度
 			},
 			shopAll() {
 				shopAll().then((res) => {
 					if (res.code === 1) {
-						this.shopData = res.data;
-						this.shopData.forEach((v, k) => {
-							const radius = 59; // 小球半径相关大小(这里用宽度等体现,单位rpx)
-							const x = Math.random() * (this.containerWidth - 2 * radius) + radius;
-							const y = Math.random() * (this.containerHeight - 2 * radius) + radius;
-							const speedX = (Math.random() - 0.5) * 5; // 随机生成x方向速度
-							const speedY = (Math.random() - 0.5) * 5; // 随机生成y方向速度
-							v.x = x;
-							v.y = y;
-							v.speedX = speedX;
-							v.speedY = speedY;
-							// 为每个小球创建动画实例
-							const animation = uni.createAnimation({
-								duration: 0,
-								timingFunction: 'linear'
-							});
-							this.animations.push(animation);
-							v.animation = animation;
-						});
-						// console.log(this.shopData);
+						this.bubbles = res.data;
+						console.log(this.bubbles, this.bubbles.length);
+						// 生成随机泡泡
+						this.bubbles.forEach((v, k) => {
+							v.x = Math.random() * (this.screenWidth - 50); // 随机水平位置
+							v.y = Math.random() * (this.screenHeight - 50); // 随机垂直位置
+							v.size = 59; // 随机大小(20px - 60px)
+							v.speedX = (Math.random() - 0.5) * 2; // 水平速度(-1 到 1)
+							v.speedY = (Math.random() - 0.5) * 2; // 垂直速度(-1 到 1)
+						})
 					}
 				});
 			},
+			// 开始动画
 			startAnimation() {
 				const animate = () => {
-					this.updateBalls();
-					this.animationFrameId = setTimeout(animate, 16); // 确保正确调用 animate 函数
+					this.updateBubblesPosition();
+					this.animationTimer = setTimeout(animate, 16); // 模拟 60 FPS
 				};
-				animate();
+				animate(); // 启动动画
 			},
-			updateBalls() {
-				for (const ball of this.shopData) {
-					// 更新小球位置
-					ball.x += ball.speedX;
-					ball.y += ball.speedY;
-					// console.log(`Ball position: x=${ball.x}, y=${ball.y}`); // 打印小球位置信息
-
-					// 处理左右边界碰撞
-					if (ball.x < 0 || ball.x + 2 * 59 > this.containerWidth) {
-						if (ball.x < 0) {
-							ball.x = 0;
-							ball.speedX = Math.abs(ball.speedX);
-						} else {
-							ball.x = this.containerWidth - 2 * 59;
-							ball.speedX = -Math.abs(ball.speedX);
-						}
+			// 更新泡泡位置
+			updateBubblesPosition() {
+				this.bubbles.forEach((bubble) => {
+					// 更新位置
+					bubble.x += bubble.speedX;
+					bubble.y += bubble.speedY;
+
+					// 碰到左右边框时反转水平速度
+					if (bubble.x <= 0 || bubble.x + bubble.size >= this.screenWidth) {
+						bubble.speedX = -bubble.speedX;
 					}
-					// 处理上下边界碰撞
-					if (ball.y < 0 || ball.y + 2 * 59 > this.containerHeight) {
-						if (ball.y < 0) {
-							ball.y = 0;
-							ball.speedY = Math.abs(ball.speedY);
-						} else {
-							ball.y = this.containerHeight - 2 * 59;
-							ball.speedY = -Math.abs(ball.speedY);
-						}
+
+					// 碰到上下边框时反转垂直速度
+					if (bubble.y <= 0 || bubble.y + bubble.size >= this.screenHeight) {
+						bubble.speedY = -bubble.speedY;
 					}
-					// 使用动画更新小球位置
-					ball.animation.translateX(ball.x).translateY(ball.y).step();
-					ball.animation.export();
-					// 直接使用 uni 的动画更新方法
-					uni.createSelectorQuery().in(this).select(`.ball:nth-child(${ball.index + 1})`).boundingClientRect(
-						rect => {
-							if (rect) {
-								ball.animation.export()
-									.translate(ball.x - rect.left, ball.y - rect.top)
-									.step()
-									.update();
-							}
-						}).exec();
-				}
-				// 利用 Vue 的响应式数据绑定自动更新视图,不再使用 $forceUpdate
+				});
 			},
-			getQBoxSize() {
-				uni.createSelectorQuery().in(this).select('.q-box').boundingClientRect((rect) => {
-					if (rect) {
-						this.containerWidth = (rect.width) * 2;
-						this.containerHeight = (rect.height) * 2;
+			// 随机选择一个泡泡
+			selectRandomBubble() {
+				if (this.isSelecting) return; // 防止重复点击
+				this.isSelecting = true;
+				// 随机选择过程动画
+				const totalSteps = 20; // 随机闪烁次数
+				let step = 0;
+				const interval = setInterval(() => {
+					this.selectedBubbleIndex = Math.floor(Math.random() * this.bubbles.length);
+					step++;
+					if (step >= totalSteps) {
+						clearInterval(interval);
+						this.isSelecting = false;
+						this.showPopup = true; // 显示弹窗
 					}
-				}).exec();
-			}
+				}, 100); // 每 100 毫秒闪烁一次
+			},
+			// 关闭弹窗
+			closePopup() {
+				this.showPopup = false;
+				this.selectedBubbleIndex = null; // 重置选中状态
+			},
 		},
-		beforeDestroy() {
-			// 清除定时器
-			clearTimeout(this.animationFrameId);
-		}
-	}
+	};
 </script>
 
-<style lang="scss" scoped>
+<style>
 	.max-w-118{
 		max-width: 118rpx;
 	}
-	.qp-box-ccc {
-		background: #ccc;
-	}
-
-	.z-2 {
-		position: relative;
-		z-index: 2;
-	}
-
-	.q-box {
-		width: 100%;
-		height: 71%;
-		padding-bottom: constant(safe-area-inset-bottom);
-		padding-bottom: env(safe-area-inset-bottom);
-		position: relative;
-	}
-
-	.ball {
+	.qp-img {
 		width: 118rpx;
-		height: 154rpx;
+		height: 118rpx;
 		position: absolute;
-		padding-top: 28rpx;
+		left: 0;
+		top: 0;
 	}
 
 	.shop-logo {
@@ -178,6 +163,14 @@
 		margin: 0 0 34rpx 29rpx;
 	}
 
+	.pt-49 {
+		padding-top: 49rpx;
+	}
+
+	.mb-82 {
+		margin-bottom: 82rpx;
+	}
+
 	.bg-img {
 		width: 100%;
 		height: 89%;
@@ -186,29 +179,69 @@
 		top: 0;
 	}
 
+	.z-2 {
+		position: relative;
+		z-index: 2;
+	}
+
+	.container {
+		position: relative;
+		overflow: hidden;
+	}
+
+	.q-box {}
+
+	.bubble {
+		position: absolute;
+		/* 泡泡颜色 */
+		border-radius: 50%;
+		will-change: transform;
+		padding: 28rpx 20rpx 29rpx 0;
+		/* 优化性能 */
+	}
+
 	.but-box {
 		width: 100%;
 		height: 170rpx;
-		position: relative;
+		position: absolute;
+		bottom: 135rpx;
+		left: 0;
 	}
 
 	.but-img {
 		position: absolute;
 		left: 0;
 		top: 0;
+		z-index: 1;
 		width: 100%;
 		height: 100%;
 	}
 
-	.pt-49 {
-		padding-top: 49rpx;
+	.popup {
+		position: fixed;
+		top: 0;
+		left: 0;
+		width: 100%;
+		height: 100%;
+		background-color: rgba(0, 0, 0, 0.5);
+		display: flex;
+		justify-content: center;
+		align-items: center;
 	}
 
-	.qp-img {
-		width: 118rpx;
-		height: 118rpx;
-		position: absolute;
-		left: 0;
-		top: 0;
+	.popup-content {
+		background-color: white;
+		padding: 20px;
+		border-radius: 10px;
+		text-align: center;
+	}
+
+	.close-button {
+		margin-top: 10px;
+		padding: 5px 10px;
+		background-color: #007aff;
+		color: white;
+		border-radius: 5px;
+		cursor: pointer;
 	}
 </style>

+ 26 - 10
pages/chat/index.vue

@@ -1,9 +1,12 @@
 <template>
 	<view class="box">
 		<view class="flex-common-css iPhone-bottom box-border-box">
-			<Nav title="AI助手" titleColor="#333" bgckgroundBox='#fff'></Nav>
+			<Nav title="AI助手" titleColor="#333" bgckgroundBox='#fff' :leftShow='false'></Nav>
 			<scroll-view :scroll-y="true" id="scroll-view-css" class="scroll-view-css" :scroll-top="scrollTop"
-				:scroll-with-animation="true" @scroll="scrolll" @scrolltoupper='scrolltoupper'>
+				:scroll-with-animation="true" @scroll="scrolll">
+				<view v-if="total > chatData.length" class="text-align-center fs-24 fc-9" @click="lookHistory">
+					查看历史消息
+				</view>
 				<view class="chat-box" id="chat-box">
 					<msgItem v-for="(item,index) in chatData" :key="index" :item="item" :showType="item.showType"
 						:msgText="item.content" @selectStyle="selectStyle" @refresh="refresh"></msgItem>
@@ -41,7 +44,7 @@
 				page: 1,
 				chatText: '',
 				chatType: 1,
-				scrollTop: 0,
+				scrollTop: 20,
 				chatData: [],
 				initialData: [],
 				// loadingStyle: false,
@@ -60,6 +63,7 @@
 		},
 		onShow() {
 			this.page = 1
+			this.scrollTop = 20
 			this.chatData = []
 			this.aiMsgList()
 		},
@@ -128,8 +132,8 @@
 				}
 				// })
 			},
-			scrolltoupper() {
-				if(this.total>this.chatData.length) {
+			lookHistory() {
+				if (this.total > this.chatData.length) {
 					++this.page
 					this.aiMsgList()
 				}
@@ -146,20 +150,23 @@
 						})
 						this.chatData.unshift(...data)
 						let that = this
+						// this.$nextTick(() => {
+						// 	this.scrollToBottom()
+						// })
 						setTimeout(() => {
 							that.scrollToBottom()
 						}, 50)
 					}
 				})
 			},
-			onTabItemTap() {
-				uni.hideTabBar()
-			},
+			// onTabItemTap() {
+			// 	uni.hideTabBar()
+			// },
 			leftClick() {
 				uni.switchTab({
 					url: 'pages/index/index'
 				})
-				uni.showTabBar()
+				// uni.showTabBar()
 			},
 			confirm(event) {
 				if (this.sendControl) {
@@ -198,6 +205,7 @@
 				query.select('#scroll-view-css').boundingClientRect()
 				query.select('#chat-box').boundingClientRect()
 				query.exec((res) => {
+					console.log(res[1].height, res[0].height, 'res[0].height');
 					//如果子元素高度大于父元素高度(显示高度)
 					if (res[1].height > res[0].height) {
 						//计算出二者差值就是需要滚动的距离
@@ -205,12 +213,20 @@
 						let differenceNum = scrollTop - this.scrollTop
 						console.log(differenceNum, 'differenceNum');
 						console.log(scrollTop, 'scrollTop');
+						console.log(num, 'num');
 						if (differenceNum > 50) {
 							this.scrollTop = scrollTop + 50
-							console.log('differenceNum > 50');
+							console.log('differenceNum > 50 1111111111', this.scrollTop);
 						} else if (num > 0) {
 							this.scrollTop = scrollTop + num
 							console.log('num > 0');
+						} else {
+							// this.$nextTick(() => {
+							this.scrollTop = scrollTop
+							console.log('differenceNum > 50 33333333333333', this.scrollTop);
+							// 	console.log(this.scrollTop,'this.scrollTop 9999999999999');
+							// 	this.$forceUpdate()
+							// })
 						}
 					} else {
 						this.scrollTop = 9999999999999

+ 17 - 2
pages/index/index.vue

@@ -41,6 +41,8 @@
 				<view class="nav-list align-items-flex-end flex-wrap-wrap box-border-box pt-33 bgc-f b-rad-20">
 					<view class="nav-list-item" v-for="(item,i) in navList" :key="i" @click="toUrl(item.type)"
 						v-show="item.appletAudit == 0">
+						<button v-if="item.type === 9" class="item-box-button" :plain="true" open-type="contact"
+							:bindcontact="handleContact"></button>
 						<view class="flex-direction align-items-center title-img-box">
 							<image class="title-img mb-16" :src="item.img" mode="scaleToFill"></image>
 							<view class="fs-24 fc-0 text-align-center">{{item.name}}</view>
@@ -151,7 +153,8 @@
 				<view class="yztg-box p-30 box-border-box">
 					<image class="tj-bg" src="@/static/img/index/tj-bg.png" mode=""></image>
 					<image class="qwzd-img z-2" src="@/static/img/index/qwzd.png" mode=""></image>
-					<view class="z-2 ptp-24 b-b-F0 align-items-center flex-justify-space mb-12" v-for="(item,index) in group_goods_List" :key="index" @click="goGroup(item)">
+					<view class="z-2 ptp-24 b-b-F0 align-items-center flex-justify-space mb-12"
+						v-for="(item,index) in group_goods_List" :key="index" @click="goGroup(item)">
 						<view class="align-items-center">
 							<image v-show="index === 0" class="pm-img mr-20" src="@/static/img/index/1.png" mode="">
 							</image>
@@ -492,7 +495,7 @@
 			scene.forEach(item => {
 				let arr = item.split('=')
 				if (arr.length === 2) {
-					uni.setStorageSync(arr[0], arr[1]) 
+					uni.setStorageSync(arr[0], arr[1])
 				}
 			})
 			this.page = 1;
@@ -1195,6 +1198,18 @@
 				.nav-list-item {
 					width: 25%;
 					margin-bottom: 35rpx;
+					position: relative;
+
+					.item-box-button {
+						position: absolute;
+						width: 100%;
+						height: 100%;
+						top: 0;
+						left: 0;
+						z-index: 100;
+						background: transparent;
+						border-width: 0;
+					}
 
 					.title-img-box {
 						.title-img {

+ 8 - 6
pages/login/index.vue

@@ -42,8 +42,8 @@
 					<image v-else class="hint-img" src="@/static/img/common/y-select.png" mode=""></image>
 				</view>
 				<view class="hint-text-1" @click.stop="isFlag = !isFlag">我已阅读并同意</view>
-				<view class="hint-text-2" @click="isPop = true;html = member_agreement">《用户服务》</view>
-				<view class="hint-text-2" @click="isPop = true;html = privacy_protocol">《隐私协议》</view>
+				<view class="hint-text-2" @click="openPop(0)">《用户服务》</view>
+				<view class="hint-text-2" @click="openPop(1)">《隐私协议》</view>
 			</view>
 
 			<view class="button">
@@ -93,8 +93,7 @@
 				codeNUm: 0,
 				isPop: false,
 				html: '',
-				member_agreement: '', //用户协议
-				privacy_protocol: '', //隐私协议
+				agreementData: []
 			};
 		},
 		onLoad() {},
@@ -103,6 +102,10 @@
 			this.getType()
 		},
 		methods: {
+			openPop(index) {
+				this.html = this.agreementData[index].content
+				this.isPop = true
+			},
 			getCode() {
 				if (!this.from.phone) {
 					return tools.error('请输入手机号')
@@ -133,8 +136,7 @@
 			getPrivacyInfo() {
 				getAgreement().then((res) => {
 					if (res.code === 1) {
-						this.member_agreement = res.data.member_agreement;
-						this.privacy_protocol = res.data.privacy_protocol;
+						this.agreementData = res.data
 					}
 				})
 			},