py 1 gadu atpakaļ
vecāks
revīzija
6e56afdbbd

+ 3 - 1
common/css/common.css

@@ -325,7 +325,9 @@ image {
 .fc-41ABF5 {
 	color: #41ABF5;
 }
-
+.fc-1089D1 {
+	color: #1089D1;
+}
 .fc-57CAFF {
 	color: #57CAFF;
 }

BIN
pages-buy/static/bg-2.png


BIN
pages-buy/static/bg.png


BIN
pages-buy/static/bottom.png


BIN
pages-buy/static/dh.png


BIN
pages-buy/static/fz.png


BIN
pages-buy/static/group-bg.png


BIN
pages-buy/static/jl.png


BIN
pages-buy/static/ljtg.png


BIN
pages-buy/static/qg.png


BIN
pages-buy/static/right.png


BIN
pages-buy/static/ss.png


BIN
pages-buy/static/xl.png


BIN
pages-buy/static/zk.png


+ 93 - 0
pages-takeout/1212.vue

@@ -0,0 +1,93 @@
+<template>
+  <view class="container">
+    <view
+      v-for="(ball, index) in balls"
+      :key="index"
+      :class="['ball', ball.colorClass]"
+      :style="ball.style"
+      @animationend="handleAnimationEnd(index)"
+    >
+      <text>{{ ball.content }}</text>
+    </view>
+  </view>
+</template>
+<script>
+export default {
+  data() {
+    return {
+      balls: [], // 存储小球信息的数组
+      animationFrames: [], // 存储每个小球的动画帧信息
+    };
+  },
+  mounted() {
+    this.initBalls();
+    this.startAnimations();
+  },
+  methods: {
+    initBalls() {
+      const numBalls = 10; // 小球数量
+      for (let i = 0; i < numBalls; i++) {
+        this.balls.push({
+          colorClass: this.getRandomColorClass(), // 随机颜色类
+          content: `Ball ${i + 1}`, // 自定义内容
+          style: {
+            position: 'absolute',
+            left: `${Math.random() * window.innerWidth}px`, // 随机初始位置X
+            top: `${Math.random() * window.innerHeight}px`, // 随机初始位置Y
+            transform: `translate(-50%, -50%)`, // 居中内容
+          },
+          direction: { x: Math.random() * 2 - 1, y: Math.random() * 2 - 1 }, // 随机方向
+          speed: Math.random() * 2 + 1, // 随机速度
+        });
+      }
+    },
+    getRandomColorClass() {
+      // 根据需要返回随机颜色类名,这里简化为几个预设类
+      const colors = ['red', 'blue', 'green', 'yellow', 'purple', 'orange'];
+      return colors[Math.floor(Math.random() * colors.length)];
+    },
+    startAnimations() {
+      // 为每个小球启动动画
+      this.balls.forEach((ball, index) => {
+        setTimeout(() => {
+          this.animateBall(index);
+        }, Math.random() * 2000); // 随机延迟开始动画
+      });
+    },
+    animateBall(index) {
+      const ball = this.balls[index];
+      let newLeft = parseFloat(ball.style.left) + ball.direction.x * ball.speed;
+      let newTop = parseFloat(ball.style.top) + ball.direction.y * ball.speed;
+
+      // 碰撞检测(边界反弹)
+      if (newLeft < 0 || newLeft > window.innerWidth - 50) { // 50是假设的小球宽度
+        ball.direction.x = -ball.direction.x;
+        newLeft += ball.direction.x * ball.speed * 2; // 反弹后调整位置,避免抖动
+      }
+      if (newTop < 0 || newTop > window.innerHeight - 50) { // 50是假设的小球高度
+        ball.direction.y = -ball.direction.y;
+        newTop += ball.direction.y * ball.speed * 2; // 反弹后调整位置,避免抖动
+      }
+
+      ball.style.left = `${newLeft}px`;
+      ball.style.top = `${newTop}px`;
+
+      // 使用requestAnimationFrame进行持续动画
+      this.animationFrames[index] = requestAnimationFrame(() => {
+        this.animateBall(index);
+      });
+
+      // 可选:为动画添加结束处理(例如,当小球需要停止或改变方向时)
+      // 但在这个例子中,我们让小球持续运动,所以不需要特别处理动画结束
+    },
+    handleAnimationEnd(index) {
+      // 这个方法在这个例子中未使用,因为我们是用requestAnimationFrame控制的动画
+      // 如果你使用CSS动画,这个方法可以用来处理动画结束后的逻辑
+    },
+  },
+  beforeDestroy() {
+    // 组件销毁前取消所有动画帧请求
+    this.animationFrames.forEach(cancelAnimationFrame);
+  },
+};
+</script>

+ 162 - 0
pages-takeout/help-choose.vue

@@ -0,0 +1,162 @@
+<template>
+	<view class="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">
+			<view class="qp-box" v-for="(item,index) in shopData">
+				<image class="qp-img" src="/pages-takeout/static/qp.png" mode=""></image>
+			</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>
+
+<script>
+	import {
+		shopAll
+	} from "@/api/shop.js"
+	export default {
+		components: {},
+		data() {
+			return {
+				school_name: '',
+				shopId: 0,
+				shopData: [],
+				animationFrames: [], // 存储每个小球的动画帧信息
+			};
+		},
+		onLoad(data) {
+			this.school_name = uni.getStorageSync('school_name');
+			this.shopAll()
+		},
+		mounted() {},
+		methods: {
+			scrolltolower() {
+				console.log('触底');
+			},
+			initBalls() {
+			  const numBalls = 10; // 小球数量
+			  for (let i = 0; i < numBalls; i++) {
+			    this.shopData.push({
+			      colorClass: this.getRandomColorClass(), // 随机颜色类
+			      content: `Ball ${i + 1}`, // 自定义内容
+			      style: {
+			        position: 'absolute',
+			        left: `${Math.random() * window.innerWidth}px`, // 随机初始位置X
+			        top: `${Math.random() * window.innerHeight}px`, // 随机初始位置Y
+			        transform: `translate(-50%, -50%)`, // 居中内容
+			      },
+			      direction: { x: Math.random() * 2 - 1, y: Math.random() * 2 - 1 }, // 随机方向
+			      speed: Math.random() * 2 + 1, // 随机速度
+			    });
+			  }
+			},
+			getRandomColorClass() {
+			  // 根据需要返回随机颜色类名,这里简化为几个预设类
+			  const colors = ['red', 'blue', 'green', 'yellow', 'purple', 'orange'];
+			  return colors[Math.floor(Math.random() * colors.length)];
+			},
+			startAnimations() {
+			  // 为每个小球启动动画
+			  this.shopData.forEach((ball, index) => {
+			    setTimeout(() => {
+			      this.animateBall(index);
+			    }, Math.random() * 2000); // 随机延迟开始动画
+			  });
+			},
+			animateBall(index) {
+			  const ball = this.shopData[index];
+			  let newLeft = parseFloat(ball.style.left) + ball.direction.x * ball.speed;
+			  let newTop = parseFloat(ball.style.top) + ball.direction.y * ball.speed;
+			
+			  // 碰撞检测(边界反弹)
+			  if (newLeft < 0 || newLeft > window.innerWidth - 118) { // 50是假设的小球宽度
+			    ball.direction.x = -ball.direction.x;
+			    newLeft += ball.direction.x * ball.speed * 2; // 反弹后调整位置,避免抖动
+			  }
+			  if (newTop < 0 || newTop > window.innerHeight - 118) { // 50是假设的小球高度
+			    ball.direction.y = -ball.direction.y;
+			    newTop += ball.direction.y * ball.speed * 2; // 反弹后调整位置,避免抖动
+			  }
+			
+			  ball.style.left = `${newLeft}px`;
+			  ball.style.top = `${newTop}px`;
+			
+			  // 使用requestAnimationFrame进行持续动画
+			  this.animationFrames[index] = requestAnimationFrame(() => {
+			    this.animateBall(index);
+			  });
+
+			},
+			shopAll() {
+				shopAll().then((res) => {
+					if (res.code === 1) {
+						this.shopData = res.data
+					}
+				})
+			}
+		},
+		beforeDestroy() {
+		  // 组件销毁前取消所有动画帧请求
+		  this.animationFrames.forEach(cancelAnimationFrame);
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	.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;
+	}
+
+	.bg-img {
+		width: 100%;
+		height: 89%;
+		position: absolute;
+		left: 0;
+		top: 0;
+	}
+
+	.but-box {
+		width: 100%;
+		height: 170rpx;
+		position: relative;
+	}
+
+	.but-img {
+		position: absolute;
+		left: 0;
+		top: 0;
+		width: 100%;
+		height: 100%;
+	}
+
+	.pt-49 {
+		padding-top: 49rpx;
+	}
+
+	.qp-img {
+		width: 118rpx;
+		height: 118rpx;
+	}
+</style>

BIN
pages-takeout/static/bg.png


BIN
pages-takeout/static/but-bg.png


BIN
pages-takeout/static/qp.png


+ 7 - 1
pages.json

@@ -223,6 +223,12 @@
 					"style": {
 						"navigationBarTitleText": "商品提交订单"
 					}
+				},
+				{
+					"path": "help-choose",
+					"style": {
+						"navigationBarTitleText": "君子帮选"
+					}
 				}
 			]
 		},
@@ -436,7 +442,7 @@
 		"current": 0,
 		"list": [{
 				"name": "列表调试",
-				"path": "pages-buy/group-shop",
+				"path": "pages-takeout/help-choose",
 				"query": "shop_id=23"
 			},
 			{

+ 9 - 7
pages/index/index.vue

@@ -16,8 +16,7 @@
 			</Nav>
 		</view>
 		<!-- 搜索 -->
-		<view class="index-search box-border-box mt-20" @click="toUrl(1)"
-			:style="[{'top': BarH + 'px','background':bgckgroundSearch}]">
+		<view class="index-search box-border-box mt-20" @click="toUrl(1)" :style="[{'top': BarH + 'px','background':bgckgroundSearch}]">
 			<view class="index-search-box box-border-box align-items-center bgc-f">
 				<image class="wh27" src="@/static/img/index/ss.png" mode=""></image>
 				<view class="fs-24 fc-a ml-10">搜索店铺名称或商品名称</view>
@@ -77,7 +76,7 @@
 							:src="item.shop_logo" mode="" @click="toShop(item)"></image>
 					</view>
 				</view>
-				<image class="xzkn-img" src="@/static/img/index/xzkn.png" mode=""></image>
+				<image class="xzkn-img" src="@/static/img/index/xzkn.png" mode="" @click="toUrl(4)"></image>
 			</view>
 			<!-- 限时秒杀 -->
 			<view class="spike-box box-border-box mb-20" v-if="seckillGoodsList.length > 0">
@@ -824,9 +823,9 @@
 						url: '/pages-takeout/replace-take'
 					})
 				} else if (type === 4) {
-					// 去票务
+					// 君子帮选
 					uni.navigateTo({
-						url: '/pages-buy/ticket'
+						url: '/pages-takeout/help-choose'
 					})
 				} else if (type === 5) {
 					// 去团购
@@ -834,9 +833,9 @@
 						url: '/pages-buy/group'
 					})
 				} else if (type === 6) {
-					// 去干洗
+					// 领券中心
 					uni.navigateTo({
-						url: '/pages-buy/dry-clean'
+						url: '/pages-my/ticket-centre'
 					})
 				} else if (type === 7) {
 					// 去校友圈
@@ -848,6 +847,9 @@
 					uni.navigateTo({
 						url: '/pages-position/Internship-position'
 					})
+				} else if (type === 9) {
+					// 平台客服
+					
 				} else {
 					tools.error('暂未开放')
 				}