浏览代码

no message

py 1 年之前
父节点
当前提交
70b491865b
共有 9 个文件被更改,包括 271 次插入 和 287 次删除
  1. 1 1
      api/ai.js
  2. 24 39
      pages-school/circle-info.vue
  3. 192 200
      pages-takeout/1212.vue
  4. 19 16
      pages-takeout/shop-mod/menu.vue
  5. 1 1
      pages.json
  6. 29 17
      pages/chat/index.vue
  7. 1 1
      pages/chat/msg-item.vue
  8. 1 0
      pages/index/index.vue
  9. 3 12
      pages/order/index.vue

+ 1 - 1
api/ai.js

@@ -4,4 +4,4 @@ const newsUrl = '/api/ai/'
 // 发送消息
 // 发送消息
 export const aiSend = (data) => request(newsUrl + 'send', 'post', { ...data },false)
 export const aiSend = (data) => request(newsUrl + 'send', 'post', { ...data },false)
 // 获取历史消息记录
 // 获取历史消息记录
-export const aiMsgList = (data) => request(newsUrl + 'msg_list', 'post', { ...data },false)
+export const aiMsgList = (data) => request(newsUrl + 'msg_list', 'post', { ...data },true)

+ 24 - 39
pages-school/circle-info.vue

@@ -130,12 +130,8 @@
 
 
 		</scroll-view>
 		</scroll-view>
 
 
-		<view class="card-5 align-items-center flex-justify-space box-border-box boder-b-t">
+		<view class="card-5 align-items-center flex-justify-space box-border-box boder-b-t" v-show="!inputPopType">
 			<view class="input-box-box fs-24 fc-a mr-20" @click.stop="openInput(0,'','','')">友善评论,文明发言</view>
 			<view class="input-box-box fs-24 fc-a mr-20" @click.stop="openInput(0,'','','')">友善评论,文明发言</view>
-			<!-- 			<input class="fs-input" :focus='focus' v-model="msgData.content" @click.stop="openInput(0,'','','')"
-				type="text" @focus='inputFocus(true)' @blur='inputFocus(false)' /> -->
-			<!-- 			<textarea class="fs-input fs-36 fc-3" :focus='focus' v-model="msgData.content"
-				@click.stop="openInput(0,'','','')" @focus='inputFocus(true)' @blur='inputFocus(false)' auto-height /> -->
 			<view class="display-flex flex-shrink0">
 			<view class="display-flex flex-shrink0">
 				<view class="align-items-center mr-20" @click.stop="handUp(1,obj)">
 				<view class="align-items-center mr-20" @click.stop="handUp(1,obj)">
 					<uni-icons type="hand-up" size="22" :color="obj.is_like==1?'#FD5C02':'#000000'"></uni-icons>
 					<uni-icons type="hand-up" size="22" :color="obj.is_like==1?'#FD5C02':'#000000'"></uni-icons>
@@ -152,33 +148,15 @@
 			<!-- <image v-else class="wh64" @click.stop="save()" src="@/static/img/school/fs.png" mode=""></image> -->
 			<!-- <image v-else class="wh64" @click.stop="save()" src="@/static/img/school/fs.png" mode=""></image> -->
 		</view>
 		</view>
 
 
-		<uni-popup ref="popup" type="bottom">
+		<view class="input-pop box-border-box" v-show="inputPopType">
 			<view class="pop-input">
 			<view class="pop-input">
 				<view class="text-align-right mb-20 fs-30 fc-41ABF5" @click.stop="save()">
 				<view class="text-align-right mb-20 fs-30 fc-41ABF5" @click.stop="save()">
 					发送
 					发送
 				</view>
 				</view>
-				<textarea class="fs-input fs-28 fc-3" :focus='focus' v-model="msgData.content" placeholder='友善评论,文明发言'
-					maxlength="100" placeholder-class='fs-28 fc-9 fw-600' @focus='inputFocus(true)'
-					@blur='inputFocus(false)' @keyboardheightchange='keyboardheightchange' />
+				<textarea class="fs-input fs-28 fc-3" :focus='focus' :adjust-position='false' v-model="msgData.content" placeholder='友善评论,文明发言' maxlength="100" placeholder-class='fs-28 fc-9 fw-600' @focus='inputFocus(true)' @blur='inputFocus(false)'/>
 				<view :style="[{'height': KeyboardHeight +'px'}]"> </view>
 				<view :style="[{'height': KeyboardHeight +'px'}]"> </view>
-				<!-- 				<input class="fs-input" focus type="text" />
-				<view class="head-pop flex-justify-space align-items-center mb-24 box-border-box p-24">
-					<view class="fs-28 fw-600 fc-41ABF5"></view>
-					<view class="fs-36 fc-0 fw-600">评论</view>
-					<uni-icons @click="closeInput()" type="closeempty" size="24"></uni-icons>
-				</view>
-				<view class="scroll-view-css">
-					<view class="bgc-f box-border-box p-32">
-						<view class="fs-34 fw-600 mb-20">评论</view>
-						<textarea v-model="msgData.content" maxlength="100" class=" fs-24"
-							placeholder='友善评论,文明发言'></textarea>
-					</view>
-				</view>
-				<view class="box-border-box p-24">
-					<view class="save-box" @click.stop="save()">评论</view>
-				</view> -->
 			</view>
 			</view>
-		</uni-popup>
+		</view>
 
 
 		<uni-popup ref="popupRepot" type="bottom">
 		<uni-popup ref="popupRepot" type="bottom">
 			<view class="pop-box pop-h-30 box-border-box p-24" :style="'bottom:'+KeyboardHeight+'px;'">
 			<view class="pop-box pop-h-30 box-border-box p-24" :style="'bottom:'+KeyboardHeight+'px;'">
@@ -248,7 +226,8 @@
 				msgI: 0,
 				msgI: 0,
 				KeyboardHeight: 0, // 键盘高度
 				KeyboardHeight: 0, // 键盘高度
 				// showKeyNum: 0, //键盘打开的次数
 				// showKeyNum: 0, //键盘打开的次数
-				remark: ''
+				remark: '',
+				inputPopType: false
 			}
 			}
 		},
 		},
 		onShow() {
 		onShow() {
@@ -287,23 +266,15 @@
 			console.log("监听页面卸载");
 			console.log("监听页面卸载");
 		},
 		},
 		methods: {
 		methods: {
-			// keyboardheightchange(e) {
-			// 	this.keyboardHeight = e.detail.height;
-			// 	console.log(this.keyboardHeight, '1111111111');
-			// 	this.showKeyNum++;
-			// 	setTimeout(() => {
-			// 		uni.pageScrollTo({
-			// 			scrollTop: 2000
-			// 		});
-			// 	}, 200)
-			// },
 			// hideBorad() {
 			// hideBorad() {
 			// 	this.showKeyNum = 2;
 			// 	this.showKeyNum = 2;
 			// 	this.keyboardHeight = 0;
 			// 	this.keyboardHeight = 0;
 			// },
 			// },
 			inputFocus(type) {
 			inputFocus(type) {
+				this.inputPopType = type
 				if (!type) {
 				if (!type) {
 					this.focus = false
 					this.focus = false
+					
 					// this.hideBorad()
 					// this.hideBorad()
 				}
 				}
 				this.$forceUpdate()
 				this.$forceUpdate()
@@ -452,7 +423,8 @@
 					this.msgData.remark_id = item.remark_id;
 					this.msgData.remark_id = item.remark_id;
 					this.msgData.reply_id = item.m_id;
 					this.msgData.reply_id = item.m_id;
 				}
 				}
-				this.$refs.popup.open();
+				// this.$refs.popup.open();
+				this.inputPopType = true
 				setTimeout(() => {
 				setTimeout(() => {
 					this.focus = true
 					this.focus = true
 					// this.$forceUpdate()
 					// this.$forceUpdate()
@@ -461,7 +433,8 @@
 				// console.log(this.focus, '是否聚焦');
 				// console.log(this.focus, '是否聚焦');
 			},
 			},
 			closeInput() {
 			closeInput() {
-				this.$refs.popup.close();
+				// this.$refs.popup.close();
+				this.inputPopType = false
 				this.msgData.remark_id = '';
 				this.msgData.remark_id = '';
 				this.msgData.content = '';
 				this.msgData.content = '';
 				this.msgData.reply_id = '';
 				this.msgData.reply_id = '';
@@ -581,6 +554,18 @@
 </script>
 </script>
 
 
 <style scoped lang="scss">
 <style scoped lang="scss">
+	.input-pop{
+		transition: all 0.2s ease;
+		width: 100%;
+		// bottom: 0;
+	}
+	.input-pop-ok {
+		// transform: translateY(0);
+	}
+	.input-pop-no {
+		// transform: translateY( calc( 260px + env(safe-area-inset-bottom)));
+	}
+	
 	.jb-icon{
 	.jb-icon{
 		width: 30rpx;
 		width: 30rpx;
 		height: 29rpx;
 		height: 29rpx;

+ 192 - 200
pages-takeout/1212.vue

@@ -1,214 +1,206 @@
 <template>
 <template>
-    <view class="flex-common-css iPhone-bottom box-border-box">
-        <Nav :title="school_name"></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" 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="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}}
-                </view>
-            </view>
-        </view>
-        <view class="but-box">
-            <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>
-        </view>
-        <view class="fs-28 fc-1089D1 text-align-center">
-            全部商家随机抽取
-        </view>
-    </view>
-</template>
+	<view class="container flex-common-css iPhone-bottom box-border-box">
+		<Nav :title="school_name"></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">
+			<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' : 'rgba(255, 255, 255, 0.7)', // 选中时高亮
+      }" class="bubble"></view>
+		</view>
 
 
-<script>
-    import {
-        shopAll
-    } from "@/api/shop.js";
 
 
-    export default {
-        components: {},
-        data() {
-            return {
-                school_name: '',
-                shopId: 0,
-                shopData: [],
-                animationFrameId: null,
-                animations: []
-            };
-        },
-        onLoad(data) {
-            this.school_name = uni.getStorageSync('school_name');
-            this.getQBoxSize();
-        },
-        mounted() {
-            this.shopAll();
-            this.startAnimation();
-        },
-        methods: {
-            scrolltolower() {
-                console.log('触底');
-            },
-            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;
-                            // 生成更大的速度,范围在 -5 到 5 之间,使小球移动更快
-                            const speedX = (Math.random() - 0.5) * 5; 
-                            const speedY = (Math.random() - 0.5) * 5; 
-                            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);
-                    }
-                });
-            },
-            startAnimation() {
-                const animate = () => {
-                    this.updateBalls();
-                    // 进一步减小调用间隔,例如 20 毫秒,提高更新频率
-                    this.animationFrameId = setTimeout(animate, 20); 
-                };
-                animate();
-            },
-            updateBalls() {
-                for (const ball of this.shopData) {
-                    // 更新小球位置
-                    ball.x += ball.speedX;
-                    ball.y += ball.speedY;
-                    // 处理左右边界碰撞
-                    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);
-                        }
-                    }
-                    // 处理上下边界碰撞
-                    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);
-                        }
-                    }
-                    // 使用动画更新小球位置
-                    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;
-                    }
-                }).exec();
-            }
-        },
-        beforeDestroy() {
-            // 清除定时器
-            clearTimeout(this.animationFrameId);
-        }
-    }
-</script>
+		<!-- 选择按钮 -->
+		<view class="button" @click="selectRandomBubble">随机选择一个泡泡</view>
 
 
-<style lang="scss" scoped>
-.max-w-118{
-        max-width: 118rpx;
-    }
-.qp-box-ccc {
-        background: #ccc;
-    }
+		<!-- 弹窗 -->
+		<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>
 
 
-.z-2 {
-        position: relative;
-        z-index: 2;
-    }
+<script>
+	export default {
+		data() {
+			return {
+				school_name: '',
+				bubbles: [], // 存储泡泡信息
+				screenWidth: 0, // 屏幕宽度
+				screenHeight: 0, // 屏幕高度
+				animationTimer: null, // 动画定时器
+				selectedBubbleIndex: null, // 当前选中的泡泡索引
+				showPopup: false, // 是否显示弹窗
+				isSelecting: false, // 是否正在选择中
+			};
+		},
+		onLoad(data) {
+			this.school_name = uni.getStorageSync('school_name');
+		},
+		mounted() {
+			this.getScreenSize(); // 获取屏幕尺寸
+			this.generateBubbles(20); // 生成 20 个泡泡
+			this.startAnimation(); // 开始动画
+		},
+		beforeDestroy() {
+			// 组件销毁时停止动画
+			if (this.animationTimer) {
+				clearTimeout(this.animationTimer);
+			}
+		},
+		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; // 屏幕高度
+			},
+			// 生成随机泡泡
+			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)
+					});
+				}
+			},
+			// 开始动画
+			startAnimation() {
+				const animate = () => {
+					this.updateBubblesPosition();
+					this.animationTimer = setTimeout(animate, 16); // 模拟 60 FPS
+				};
+				animate(); // 启动动画
+			},
+			// 更新泡泡位置
+			updateBubblesPosition() {
+				const containerHeight = this.screenHeight * 0.7; // 泡泡容器高度为屏幕高度的 70%
+				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;
+					}
 
 
-.q-box {
-        width: 100%;
-        height: 71%;
-        padding-bottom: constant(safe-area-inset-bottom);
-        padding-bottom: env(safe-area-inset-bottom);
-        position: relative;
-    }
+					// 碰到上下边框时反转垂直速度
+					if (bubble.y <= 0 || bubble.y + bubble.size >= this.screenHeight) {
+						bubble.speedY = -bubble.speedY;
+					}
+				});
+			},
+			// 随机选择一个泡泡
+			selectRandomBubble() {
+				if (this.isSelecting) return; // 防止重复点击
+				this.isSelecting = true;
 
 
-.ball {
-        width: 118rpx;
-        height: 154rpx;
-        position: absolute;
-        padding-top: 28rpx;
-    }
+				// 随机选择过程动画
+				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; // 显示弹窗
+					}
+				}, 100); // 每 100 毫秒闪烁一次
+			},
+			// 关闭弹窗
+			closePopup() {
+				this.showPopup = false;
+				this.selectedBubbleIndex = null; // 重置选中状态
+			},
+		},
+	};
+</script>
 
 
-.shop-logo {
-        width: 68.5rpx;
-        height: 68.5rpx;
-        margin: 0 0 34rpx 29rpx;
-    }
+<style>
+	.bg-img {
+		width: 100%;
+		height: 89%;
+		position: absolute;
+		left: 0;
+		top: 0;
+	}
 
 
-.bg-img {
-        width: 100%;
-        height: 89%;
-        position: absolute;
-        left: 0;
-        top: 0;
-    }
+	.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; */
+	}
+	.bubble {
+		position: absolute;
+		background-color: rgba(255, 255, 255, 0.7);
+		/* 泡泡颜色 */
+		border-radius: 50%;
+		will-change: transform;
+		/* 优化性能 */
+	}
 
 
-.but-box {
-        width: 100%;
-        height: 170rpx;
-        position: relative;
-    }
+	.button {
+		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;
+	}
 
 
-.but-img {
-        position: absolute;
-        left: 0;
-        top: 0;
-        width: 100%;
-        height: 100%;
-    }
+	.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;
+	}
 
 
-.pt-49 {
-        padding-top: 49rpx;
-    }
+	.popup-content {
+		background-color: white;
+		padding: 20px;
+		border-radius: 10px;
+		text-align: center;
+	}
 
 
-.qp-img {
-        width: 118rpx;
-        height: 118rpx;
-        position: absolute;
-        left: 0;
-        top: 0;
-    }
+	.close-button {
+		margin-top: 10px;
+		padding: 5px 10px;
+		background-color: #007aff;
+		color: white;
+		border-radius: 5px;
+		cursor: pointer;
+	}
 </style>
 </style>

+ 19 - 16
pages-takeout/shop-mod/menu.vue

@@ -14,7 +14,8 @@
 			<view class="menu-box-right">
 			<view class="menu-box-right">
 				<view class="menu-box-only" v-for="(item,i) in categoryData" :key="i" :id="'scroll'+ item.type">
 				<view class="menu-box-only" v-for="(item,i) in categoryData" :key="i" :id="'scroll'+ item.type">
 					<view class="mb-32 fs-30">{{item.name}}</view>
 					<view class="mb-32 fs-30">{{item.name}}</view>
-					<view class="menu-list flex-justify-space" v-for="(info,k) in item.list" :key="k" :id="'goods_id'+ info.goods_id">
+					<view class="menu-list flex-justify-space" v-for="(info,k) in item.list" :key="k"
+						:id="'goods_id'+ info.goods_id">
 						<image class="flex-shrink0 goods_img" :src="info.goods_image" mode="scaleToFill"></image>
 						<image class="flex-shrink0 goods_img" :src="info.goods_image" mode="scaleToFill"></image>
 						<view class="menu-list-right flex-direction flex-justify-space">
 						<view class="menu-list-right flex-direction flex-justify-space">
 							<view class="mb-8">
 							<view class="mb-8">
@@ -86,9 +87,10 @@
 							<view class="spec-item text-align-center fs-28"
 							<view class="spec-item text-align-center fs-28"
 								:class="popData.spec_ids.indexOf(info.spec_id)>=0?'s-item':'n-item'"
 								:class="popData.spec_ids.indexOf(info.spec_id)>=0?'s-item':'n-item'"
 								v-for="(info,k) in item.spec_list" :key="k" @click="selectSpec(info,i)">
 								v-for="(info,k) in item.spec_list" :key="k" @click="selectSpec(info,i)">
-								{{info.spec_name}} <text class="fc-FB3D03 fs-26"
-									v-if="Number(info.spec_price) > 0"><text
-										class="plr-10">|</text>¥{{Number(info.spec_price).toFixed(2)}}</text>
+								{{info.spec_name}}
+								<text class="fc-FB3D03 fs-26" v-if="Number(info.spec_price) > 0">
+									<text class="plr-10">|</text>
+									¥{{Number(info.spec_price).toFixed(2)}}</text>
 							</view>
 							</view>
 						</view>
 						</view>
 					</view>
 					</view>
@@ -240,11 +242,11 @@
 
 
 			},
 			},
 			getShopGoodsSpec(item) {
 			getShopGoodsSpec(item) {
-				console.log(item,'item');
+				console.log(item, 'item');
 				shopGoodsSpec({
 				shopGoodsSpec({
 					'goods_id': item.goods_id
 					'goods_id': item.goods_id
 				}).then(res => {
 				}).then(res => {
-					console.log(item,'item');
+					console.log(item, 'item');
 					this.popData.goodsItem = item
 					this.popData.goodsItem = item
 					if (this.popData.goods_id !== item.goods_id) {
 					if (this.popData.goods_id !== item.goods_id) {
 						this.popData.goods_id = item.goods_id
 						this.popData.goods_id = item.goods_id
@@ -269,7 +271,7 @@
 					}
 					}
 					this.popData.spec_list = res.data
 					this.popData.spec_list = res.data
 					this.popData.spec_attr = res.data
 					this.popData.spec_attr = res.data
-					console.log(this.selectedSpecification,'this.selectedSpecification');
+					console.log(this.selectedSpecification, 'this.selectedSpecification');
 					this.selectedSpecification.forEach((v, k) => {
 					this.selectedSpecification.forEach((v, k) => {
 						if (v.goods_id === item.goods_id) {
 						if (v.goods_id === item.goods_id) {
 							v.goodsItem = item
 							v.goodsItem = item
@@ -280,7 +282,7 @@
 							this.popData = data
 							this.popData = data
 						}
 						}
 					})
 					})
-					console.log(this.popData,'this.popData');
+					console.log(this.popData, 'this.popData');
 					this.$refs.popupGG.open();
 					this.$refs.popupGG.open();
 					this.setGoodsSpecPrice()
 					this.setGoodsSpecPrice()
 					this.isAjax = false
 					this.isAjax = false
@@ -483,8 +485,8 @@
 
 
 				} else if (type === 3) {
 				} else if (type === 3) {
 					// 选规格
 					// 选规格
-					console.log(item,'000000000')
-					console.log(this.selectedSpecification,'1111111111111');
+					console.log(item, '000000000')
+					console.log(this.selectedSpecification, '1111111111111');
 					this.selectedSpecification.forEach((v, k) => {
 					this.selectedSpecification.forEach((v, k) => {
 						if (v.goods_id === item.goods_id) {
 						if (v.goods_id === item.goods_id) {
 							v.quota_num = item.quota_num
 							v.quota_num = item.quota_num
@@ -502,7 +504,8 @@
 					let data = JSON.parse(JSON.stringify(this.popData))
 					let data = JSON.parse(JSON.stringify(this.popData))
 					this.selectedSpecification.push(data)
 					this.selectedSpecification.push(data)
 					console.log(this.popData, "666666666666666666")
 					console.log(this.popData, "666666666666666666")
-					console.log('1', this.popData.goods_id, this.shop_id, this.popData.goodsItem.category_id, this.popData.spec_key, this.popData.num);
+					console.log('1', this.popData.goods_id, this.shop_id, this.popData.goodsItem.category_id, this.popData
+						.spec_key, this.popData.num);
 					this.setShoppingSave()
 					this.setShoppingSave()
 					// if (this.popData.goods_spec_id) {
 					// if (this.popData.goods_spec_id) {
 					// 	if (this.popData.is_infinite === 0 && this.popData.payNum > this.popData.stock) {
 					// 	if (this.popData.is_infinite === 0 && this.popData.payNum > this.popData.stock) {
@@ -549,7 +552,7 @@
 					goods_spec_id: this.popData.spec_key,
 					goods_spec_id: this.popData.spec_key,
 					number: this.popData.num
 					number: this.popData.num
 				}).then((res) => {
 				}).then((res) => {
-					if(res.code === 1) {
+					if (res.code === 1) {
 						tools.success(res.msg)
 						tools.success(res.msg)
 						this.$refs.popupGG.close();
 						this.$refs.popupGG.close();
 						this.getShopIngList()
 						this.getShopIngList()
@@ -649,10 +652,10 @@
 							if (oldKey >= 0) {
 							if (oldKey >= 0) {
 								this.popData.spec_ids.splice(oldKey, 1)
 								this.popData.spec_ids.splice(oldKey, 1)
 								this.popData.spec_name.splice(oldKey, 1)
 								this.popData.spec_name.splice(oldKey, 1)
-								if (Number(info.spec_price) > 0) {
-									this.popData.price = Number(this.popData.price) - Number(this.popData.spec_attr[
-										groupKey].spec_list[attrKey].spec_price)
-								}
+								this.popData.price = Number(this.popData.price) - Number(this.popData.spec_attr[groupKey].spec_list[attrKey].spec_price)
+								// if ( Number(info.spec_price) > 0 ) {
+								// 	this.popData.price = Number(this.popData.price) - Number(this.popData.spec_attr[groupKey].spec_list[attrKey].spec_price)
+								// }
 							}
 							}
 						}
 						}
 					}
 					}

+ 1 - 1
pages.json

@@ -501,7 +501,7 @@
 		"current": 0,
 		"current": 0,
 		"list": [{
 		"list": [{
 				"name": "列表调试",
 				"name": "列表调试",
-				"path": "pages-school/school-circle",
+				"path": "pages-takeout/help-choose",
 				"query": "balance=2"
 				"query": "balance=2"
 			},
 			},
 			{
 			{

+ 29 - 17
pages/chat/index.vue

@@ -1,22 +1,18 @@
 <template>
 <template>
 	<view class="box">
 	<view class="box">
-		<view class="flex-common-css ">
+		<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'></Nav>
 			<scroll-view :scroll-y="true" id="scroll-view-css" class="scroll-view-css" :scroll-top="scrollTop"
 			<scroll-view :scroll-y="true" id="scroll-view-css" class="scroll-view-css" :scroll-top="scrollTop"
-				:scroll-with-animation="true" @scroll="scrolll">
+				:scroll-with-animation="true" @scroll="scrolll" @scrolltoupper='scrolltoupper'>
 				<view class="chat-box" id="chat-box">
 				<view class="chat-box" id="chat-box">
 					<msgItem v-for="(item,index) in chatData" :key="index" :item="item" :showType="item.showType"
 					<msgItem v-for="(item,index) in chatData" :key="index" :item="item" :showType="item.showType"
 						:msgText="item.content" @selectStyle="selectStyle" @refresh="refresh"></msgItem>
 						:msgText="item.content" @selectStyle="selectStyle" @refresh="refresh"></msgItem>
 				</view>
 				</view>
 			</scroll-view>
 			</scroll-view>
-			<view class="bottom-box iPhone-bottom box-border-box">
+			<view class="bottom-box">
 				<view class="input-box">
 				<view class="input-box">
-					<!-- <view class="uni-input"> -->
-						<!-- <view class="input-left"> -->
-							<input type="text" v-model="chatText" placeholder="有问题尽管问我" class="input" @confirm="confirm"
-								:disabled='!sendControl'>
-						<!-- </view> -->
-					<!-- </view> -->
+					<input type="text" v-model="chatText" placeholder="有问题尽管问我" class="input" cursor-spacing="20"
+						@confirm="confirm" :disabled='!sendControl'>
 				</view>
 				</view>
 			</view>
 			</view>
 		</view>
 		</view>
@@ -41,6 +37,8 @@
 		},
 		},
 		data() {
 		data() {
 			return {
 			return {
+				total: 0,
+				page: 1,
 				chatText: '',
 				chatText: '',
 				chatType: 1,
 				chatType: 1,
 				scrollTop: 0,
 				scrollTop: 0,
@@ -61,6 +59,8 @@
 			};
 			};
 		},
 		},
 		onShow() {
 		onShow() {
+			this.page = 1
+			this.chatData = []
 			this.aiMsgList()
 			this.aiMsgList()
 		},
 		},
 		onLoad() {},
 		onLoad() {},
@@ -77,9 +77,6 @@
 							created_at: tools.getDate(),
 							created_at: tools.getDate(),
 						}
 						}
 						this.chatData.push(data)
 						this.chatData.push(data)
-						setTimeout(() => {
-							this.scrollToBottom()
-						}, 50)
 					}
 					}
 				})
 				})
 				// console.log(e);
 				// console.log(e);
@@ -131,15 +128,27 @@
 				}
 				}
 				// })
 				// })
 			},
 			},
+			scrolltoupper() {
+				if(this.total>this.chatData.length) {
+					++this.page
+					this.aiMsgList()
+				}
+			},
 			aiMsgList() {
 			aiMsgList() {
-				this.chatData = []
-				aiMsgList().then((res) => {
+				aiMsgList({
+					page: this.page
+				}).then((res) => {
 					if (res.code == 1) {
 					if (res.code == 1) {
+						this.total = res.data.total
 						let data = res.data.items.reverse()
 						let data = res.data.items.reverse()
 						data.forEach((itm) => {
 						data.forEach((itm) => {
 							itm.showType = false
 							itm.showType = false
 						})
 						})
-						this.chatData.push(...data)
+						this.chatData.unshift(...data)
+						let that = this
+						setTimeout(() => {
+							that.scrollToBottom()
+						}, 50)
 					}
 					}
 				})
 				})
 			},
 			},
@@ -182,7 +191,7 @@
 				}
 				}
 			},
 			},
 			scrolll(e) {
 			scrolll(e) {
-				console.log(e,'eeee');
+				// console.log(e, 'eeee');
 			},
 			},
 			scrollToBottom(num) {
 			scrollToBottom(num) {
 				let query = uni.createSelectorQuery().in(this)
 				let query = uni.createSelectorQuery().in(this)
@@ -203,6 +212,8 @@
 							this.scrollTop = scrollTop + num
 							this.scrollTop = scrollTop + num
 							console.log('num > 0');
 							console.log('num > 0');
 						}
 						}
+					} else {
+						this.scrollTop = 9999999999999
 					}
 					}
 				})
 				})
 			},
 			},
@@ -329,11 +340,12 @@
 			}
 			}
 		}
 		}
 	}
 	}
+
 	.input {
 	.input {
 		background: #F2F2F2;
 		background: #F2F2F2;
 		border-radius: 200rpx;
 		border-radius: 200rpx;
 		width: 100%;
 		width: 100%;
-		height: 80rpx;
+		height: 100%;
 		padding: 20rpx 170rpx 20rpx 24rpx;
 		padding: 20rpx 170rpx 20rpx 24rpx;
 		box-sizing: border-box;
 		box-sizing: border-box;
 	}
 	}

+ 1 - 1
pages/chat/msg-item.vue

@@ -340,7 +340,7 @@
       }
       }
 
 
       .dialogue-text-two {
       .dialogue-text-two {
-        background: #FDAB26;
+        background: #5CC2FF;
         border-radius: 10rpx 10rpx 0 10rpx;
         border-radius: 10rpx 10rpx 0 10rpx;
         max-width: 592rpx;
         max-width: 592rpx;
       }
       }

+ 1 - 0
pages/index/index.vue

@@ -837,6 +837,7 @@
 				} else if (type === 4) {
 				} else if (type === 4) {
 					// 君子帮选
 					// 君子帮选
 					uni.navigateTo({
 					uni.navigateTo({
+						// url: '/pages-takeout/help-choose'
 						url: '/pages-takeout/1212'
 						url: '/pages-takeout/1212'
 					})
 					})
 				} else if (type === 5) {
 				} else if (type === 5) {

+ 3 - 12
pages/order/index.vue

@@ -8,7 +8,7 @@
 			</template>
 			</template>
 		</Nav>
 		</Nav>
 		<view class="nav-box box-border-box bgc-f display-flex">
 		<view class="nav-box box-border-box bgc-f display-flex">
-			<view class="nav-item" :class="type == item.id?'fs-36 fw-600':'fs-34 fw-400'" v-for="(item,i) in navList"
+			<view class="nav-item flex-1 text-align-center" :class="type == item.id?'fs-36 fw-600':'fs-34 fw-400'" v-for="(item,i) in navList"
 				:key="i" @click="selectType(item.id)">
 				:key="i" @click="selectType(item.id)">
 				{{item.name}}
 				{{item.name}}
 				<view v-if="type == item.id" class="nav-item-x"></view>
 				<view v-if="type == item.id" class="nav-item-x"></view>
@@ -255,15 +255,7 @@
 					{
 					{
 						name: '团购',
 						name: '团购',
 						id: 3
 						id: 3
-					},
-					{
-						name: '票务',
-						id: 4
-					},
-					{
-						name: '干洗',
-						id: 5
-					},
+					}
 				],
 				],
 				page: 1,
 				page: 1,
 				list: [],
 				list: [],
@@ -1033,7 +1025,6 @@
 		overflow-x: scroll;
 		overflow-x: scroll;
 
 
 		.nav-item {
 		.nav-item {
-			margin-right: 76rpx;
 			white-space: nowrap;
 			white-space: nowrap;
 			position: relative;
 			position: relative;
 
 
@@ -1043,7 +1034,7 @@
 				height: 6rpx;
 				height: 6rpx;
 				border-radius: 20rpx;
 				border-radius: 20rpx;
 				background-color: #41ABF5;
 				background-color: #41ABF5;
-				left: 12rpx;
+				left: calc(50% - 24rpx);
 				bottom: -10rpx;
 				bottom: -10rpx;
 			}
 			}
 		}
 		}