zpj преди 2 години
родител
ревизия
88c864a5b0
променени са 4 файла, в които са добавени 90 реда и са изтрити 40 реда
  1. 4 1
      api/common.js
  2. 40 17
      pages-buy/group-det.vue
  3. 15 11
      pages-buy/group.vue
  4. 31 11
      pages-buy/save-order.vue

+ 4 - 1
api/common.js

@@ -8,4 +8,7 @@ export const getSchoolList = (data) => request(commonUrl + 'school', 'post', { .
 // 获取首页公告
 export const getNotice = (data) => request(commonUrl + 'notice', 'post', { ...data })
 // 获取轮播图
-export const getBanner = (data) => request(commonUrl + 'banner', 'post', { ...data })
+export const getBanner = (data) => request(commonUrl + 'banner', 'post', { ...data })
+
+// 发送验证码
+export const getCode = (data) => request(commonUrl + 'send', 'post', { ...data })

+ 40 - 17
pages-buy/group-det.vue

@@ -14,9 +14,9 @@
 		
 		<view class="scroll-view-css">
 			<swiper class="swiper " circular :autoplay="true" :interval="3000" :duration="500" :current='BanenerCurrent' @change="onSwiperChange">
-				<swiper-item v-for="(item,i) in 3" :key="i">
-					<image class="swiper-item" src="@/static/img/my/lqzx-bg.png" mode="scaleToFill"></image>
-					<view class="swiper-num fc-f">{{BanenerCurrent + 1}}/3</view>
+				<swiper-item v-for="(item,i) in obj.image" :key="i">
+					<image class="swiper-item" :src="item" mode="aspectFill" @click="lookImg(obj.image,i)"></image>
+					<view class="swiper-num fc-f">{{BanenerCurrent}}/{{obj.image.length}}</view>
 				</swiper-item>
 			</swiper>
 			
@@ -26,9 +26,9 @@
 					
 					<view class="card-money">
 						<view class="">
-							<span class="fs-28 fc-f fw-600">¥</span><span class="fs-48 fc-f fw-600">90.8</span>
+							<span class="fs-28 fc-f fw-600">¥</span><span class="fs-48 fc-f fw-600">{{obj.price||''}}</span>
 						</view>
-						<view class="fs-24 fw-400 fc-f text-line-through">原价100.0</view>
+						<view class="fs-24 fw-400 fc-f text-line-through">原价{{obj.line_price||''}}</view>
 					</view>
 					
 					<view class="info-1-time">
@@ -43,20 +43,20 @@
 						</view>
 					</view>
 				</view>
-				<view class="card-bottom box-border-box p-24">
-					<view class="fs-36 fc-3 fw-600 text-overflow-ellipsis mb-32">巧妙借助猪猪一身雪白的特点巧妙借助猪猪一身雪白的特点巧妙借助猪猪一身雪白的</view>
+				<view class="card-bottom box-border-box">
+					<view class="fs-36 fc-3 fw-600 text-overflow-ellipsis mb-32">{{obj.title||''}}</view>
 					<view class="jd-f mb-12">
 						<view class="jd-1"></view>
-						<view class="jd-2" :style="{width:setWidth(182,92)+'rpx'}"></view>
+						<view class="jd-2" :style="{width:setWidth(obj.number,obj.sales)+'rpx'}"></view>
 					</view>
 					<view class="flex-justify-space align-items-center">
 						<view class="">
 							<span class="fs-24 fc-9">已团</span>
-							<span class="fs-24 fc-3">90</span>
+							<span class="fs-24 fc-3">{{obj.sales||''}}</span>
 						</view>
 						<view class="">
 							<span class="fs-24 fc-9">剩余</span>
-							<span class="fs-24 fc-3">90</span>
+							<span class="fs-24 fc-3">{{obj.number - obj.sales||''}}</span>
 						</view>
 					</view>
 				</view>
@@ -65,10 +65,7 @@
 			<image class="pwxq" src="@/static/img/buy/tgxq.png" mode="scaleToFill"></image>
 			
 			<view class="box-border-box plr-24">
-				<view class="box-card box-border-box p-24 fs-30 fc-0">
-					套餐内日描述套餐内日描述套餐内日描述套餐 内日描述套餐内日描述套餐内日描述套餐内日描述套餐内日描述
-					<image src="../static/img/my/bg.png" mode=""></image>
-				</view>
+				<view class="box-card box-border-box p-24 fs-30 fc-0" v-html="obj.content"></view>
 			</view>
 		</view>
 		
@@ -76,7 +73,7 @@
 			<view class="flex-justify-space">
 				<view class="align-items-flex-end box-1">
 					<span class="fs-28 fc-FB3D03 fw-600">¥</span>
-					<span class="fs-44 fc-FB3D03 fw-600">19.5</span>
+					<span class="fs-44 fc-FB3D03 fw-600">{{obj.deposit||''}}</span>
 				</view>
 				<view class="text-align-center box-2 fs-32 fc-f fw-600" @click="toSave()">{{bText}}</view>
 			</view>
@@ -85,10 +82,12 @@
 </template>
 
 <script>
+	import {groupInfo} from '@/api/groupOrder.js';
 	import tools from "@/service/tools";
 	export default {
 		data(){
 			return{
+				id:"",
 				BanenerCurrent:1,
 				showTime:false,
 				isTimeEnd:false,
@@ -99,12 +98,34 @@
 					m:'',
 					s:'',
 				},
+				
+				obj:{
+					image:[],
+				},
+			}
+		},
+		onLoad(e) {
+			if(e.id){
+				this.id = e.id;
+				this.getInfo();
 			}
 		},
 		onShow() {
-			this.setCountDown('2024-6-21 12:45:00');
+			
 		},
 		methods:{
+			getInfo(){
+				let school_id = uni.getStorageSync('school_id');
+				groupInfo({school_id:school_id,id:this.id}).then((res)=>{
+					if(res.code === 1){
+						this.obj = res.data;
+						this.setCountDown(this.obj.end_time);
+					}
+				})
+			},
+			lookImg(list,i){
+				tools.lookBigImg(i,list);
+			},
 			toBack(){
 				tools.leftClick()
 			},
@@ -150,7 +171,7 @@
 			toSave(){
 				if(!this.isTimeEnd){
 					uni.navigateTo({
-						url:'/pages-buy/save-order'
+						url:'/pages-buy/save-order?id=' + this.obj.id
 					})
 				}
 			},
@@ -227,6 +248,7 @@
 			width: 100%;
 			position: relative;
 			height: 386rpx;
+			
 			.card-top{
 				width: 100%;
 				height: 148rpx;
@@ -247,6 +269,7 @@
 				}
 			}
 			.card-bottom{
+				padding: 24rpx 24rpx 0 24rpx;
 				width: 702rpx;
 				height: 234rpx;
 				border-radius: 20rpx;

+ 15 - 11
pages-buy/group.vue

@@ -5,33 +5,33 @@
 		<image class="head-img" src="@/static/img/buy/group-bg.png" mode="scaleToFill"></image>
 		
 		<view class="box-border-box p-24">
-			<view class="box-card box-border-box p-24 mb-20" v-for="(item,i) in 10" :key="i" @click="todet(item)">
-				<image class="goods-img mb-16" src="@/static/img/my/lqzx-bg.png" mode="scaleToFill"></image>
+			<view class="box-card box-border-box p-24 mb-20" v-for="(item,i) in list" :key="i" @click="todet(item)">
+				<image class="goods-img mb-16" :src="item.cover_img" mode="aspectFill"></image>
 				<view class="text-overflow-ellipsis fs-36 fw-600 mb-20 w-100100">
-					[畅销款]奥尔1良烤肉牛油拌饭11[畅销款11 ]奥尔1良烤肉牛油拌饭11[畅销款]奥尔1良烤肉牛油拌饭11[畅销款11 ]奥尔1良烤肉牛油拌饭11
+					{{item.title}}
 				</view>
 				<view class="mb-40 flex-justify-space align-items-center">
 					<view class="jd-f">
 						<view class="jd-1"></view>
-						<view class="jd-2" :style="{width:setWidth(182,92)+'rpx'}"></view>
+						<view class="jd-2" :style="{width:setWidth(item.number,item.sales)+'rpx'}"></view>
 					</view>
 					<view class="">
 						<span class="fs-24 fc-9">已团</span>
-						<span class="fs-24 ">92件</span>
+						<span class="fs-24 ">{{item.sales}}件</span>
 						<span class="fs-24 fc-9">/剩</span>
-						<span class="fs-24 ">90</span>
+						<span class="fs-24 ">{{item.number - item.sales}}</span>
 					</view>
 				</view>
 				
 				<view class="info-box display-flex">
 					<view class="flex-1">
 						<span class="fs-28 fc-FB3D03 fw-400">团购价¥</span>
-						<span class="fs-40 fc-FB3D03 fw-600">15.9</span>
+						<span class="fs-40 fc-FB3D03 fw-600">{{item.price}}</span>
 					</view>
 					<view class="info-box-qiang">
 						<image class="qiang-img" src="@/static/img/buy/qiang.png" mode="scaleToFill"></image>
 						<view class="jiang-box fc-65420c fs-24 fw-600">直降</view>
-						<view class="jiang-box-1 fs-24 fc-65420c fw-600">¥399</view>
+						<view class="jiang-box-1 fs-24 fc-65420c fw-600">¥{{item.line_price - item.price}}</view>
 						<image class="jiang-img" src="@/static/img/buy/x-jt.png" mode="scaleToFill"></image>
 					</view>
 				</view>
@@ -54,10 +54,14 @@
 			}
 		},
 		onReachBottom() {
-			console.log('触底刷新');
-			
+			if(this.list.length < this.total){
+				this.page += 1;
+				this.getList();
+			}
 		},
 		onShow() {
+			this.page = 1;
+			this.list = [];
 			this.getList();
 		},
 		methods:{
@@ -80,7 +84,7 @@
 			},
 			todet(item){
 				uni.navigateTo({
-					url:'/pages-buy/group-det'
+					url:'/pages-buy/group-det?id=' + item.id
 				})
 			},
 		},

+ 31 - 11
pages-buy/save-order.vue

@@ -11,12 +11,13 @@
 				</view>
 				<view class="box-input align-items-center box-border-box p-b-20 mb-20">
 					<view class="fs-28 fw-600 w158">手机号</view>
-					<input type="number" placeholder="请输入手机号">
+					<input v-model="fromData.phone" type="number" placeholder="请输入手机号">
+					<view class="fs-28 fc-41ABF5 code-box" @click="getCode()">{{codeText}}{{isCode?'s':''}}</view>
 				</view>
 				<view class="box-input align-items-center box-border-box p-b-20 mb-20">
 					<view class="fs-28 fw-600 w158">验证码</view>
 					<input type="number" placeholder="请输入验证码">
-					<view class="fs-28 fc-41ABF5 code-box" @click="getCode()">{{codeText}}{{isCode?'s':''}}</view>
+					
 				</view>
 				<view class="box-input align-items-center box-border-box p-b-20 mb-20">
 					<view class="fs-28 fw-600 w158">联系地址</view>
@@ -76,11 +77,22 @@
 </template>
 
 <script>
+	import {getCode} from '@/api/common.js';
+	import tools from "@/service/tools";
+	
 	export default {
 		data(){
 			return{
 				isCode:false,
 				codeText:'获取验证码',
+				
+				fromData:{
+					id:'',
+					phone:'',
+					school_id:'',
+					code:'',
+					note:'',
+				},
 			}
 		},
 		methods:{
@@ -89,15 +101,23 @@
 					return
 				}
 				this.isCode = true;
-				this.codeText = 60;
-				let timer = setInterval(() => {
-				  this.codeText -= 1;
-				  if (this.codeText <= 0) {
-				    clearInterval(timer);
-					this.isCode = false;
-					this.codeText = '获取验证码'
-				  }
-				}, 1000);
+				getCode({phone:this.fromData.phone,send_type:'group_order'}).then((res)=>{
+					if(res.code === 1){
+						this.codeText = 60;
+						let timer = setInterval(() => {
+						  this.codeText -= 1;
+						  if (this.codeText <= 0) {
+						    clearInterval(timer);
+							this.isCode = false;
+							this.codeText = '获取验证码'
+						  }
+						}, 1000);
+					}else{
+						this.isCode = false;
+						tools.error('获取验证码失败,请稍后重试')
+					}
+				})
+				
 			},
 		},
 	}