twt 1 year ago
parent
commit
ea662e2959

+ 10 - 3
pages/activity/activity.vue

@@ -9,7 +9,7 @@
 				<view class="time" v-if="item.startTime">{{item.startTime.slice(0,10)}}-{{item.endTime.slice(0,10)}}</view>
 			</view>
 			<view class="name">{{item.activityName}}</view>
-
+            <view class="groupType" v-if="item.groupType">拼团</view>
 		</view>
 
 		<!-- 上拉 加载更多 -->
@@ -227,9 +227,16 @@
 		margin: 0rpx 24rpx 20rpx;
 		background-color: #FFFFFF;
 		border-radius: 10rpx;
-
+        position: relative;
+	}
+    .groupType{
+		width: 76rpx;color: #FFFFFF;
+		height: 36rpx;line-height: 36rpx;text-align: center;
+		background: linear-gradient(109deg, #FD5A04 0%, #FD0900 100%);
+		border-radius: 0rpx 10rpx 0rpx 10rpx;
+		position: absolute;
+		top: 0;right: 0;
 	}
-
 	.itemImg {
 		height: 280rpx;
 		width: 702rpx;

+ 166 - 9
pages/activity/jkDetail.vue

@@ -9,6 +9,27 @@
 			<view class="name2">{{info.startTime.slice(0,10)}}~{{info.endTime.slice(0,10)}}</view>
 			<view class="name3">{{info.activityContent}}</view>
 		</view>
+		<!-- 拼团 -->
+		<view class="ptBox" v-if="info.groupList.length>0">
+			<view class="ptBoxtop">
+				<view class="ptNum">{{info.groupList.length}}人正在拼团,可直接参与</view>
+				<view class="ptMore">
+					<sapn>查看更多</sapn>
+					<img src="../../static/timg/jt2.png" alt="" class="shopjt">
+				</view>
+			</view>
+			<view class="ptLine" v-for="(item,index) in info.groupList" v-if="index<3">
+				<view class="FirstMobilePhone">{{item.FirstMobilePhone?item.FirstMobilePhone:'***'}}</view>
+				<view class="ptlineRight">
+					<view class="ptlinexx">
+						<view class="DiffBNumber">还差 <span>{{item.DiffBNumber}}人</span>拼成 </view>
+						<view class="ptdjs">剩余{{item.EndTime | limitTimeFilter}}</view>
+					</view>
+					<view class="ptBtn" @click="join(item)">{{item.IfMyself?'邀请好友':'去拼团'}} </view>
+				</view>
+			</view>
+		</view>
+		
 		<view class="shopBox">
 			<view class="shopBoxTop">
 				<view class="shopMs">活动门店</view>
@@ -97,17 +118,27 @@
 					<view class="shareTxt">分享</view>
 				</button> -->
 				<!-- 状态1未开始 2进行中3已结束 -->
-				<view class="bottomBtn" v-if="info.state==2" @click="signUp" :style="{background:'#'+themeColor}">
+				<view class="bottomBtn" v-if="info.state==2&&info.groupType!=1" @click="signUp" :style="{background:'#'+themeColor}">
 				  <span v-if="info.payType==1">¥{{info.money}} &nbsp; 立即抢购</span>
 				  <span v-else>立即报名</span>
 				</view>
+				<view class="bottomPtBox" v-if="info.state==2&&info.groupType==1"  >
+				    <view class="separate" @click="signUp">
+						<view class="separateTop">¥{{info.money}}</view>
+						<view class="separateTxt">单独购买</view>
+					</view>
+					<view class="groupBtn" @click="groupFn">
+						<view class="separateTop">¥{{info.groupMoney}}</view>
+						<view class="separateTxt">发起拼团</view>
+					</view>
+				</view>
 				<view class="bottomBtn2" v-if="info.state==1">报名未开始</view>
 				<view class="bottomBtn2" v-if="info.state==3">报名已结束</view>
 			</view>
 		</view>
 		<!-- 报名弹框 -->
 		<view class="baomingBox" v-if="bmShow" @click="nobmshow">
-			<view class="baomingCont" @click.stop="" :style="{bottom: jpHeight}">
+			<view class="baomingCont applicationTk" @click.stop="" :style="{bottom: jpHeight}">
 				<view class="bmTop">
 					<view class="bmTitle">登记信息</view>
 					<img src="../../static/timg/chahao.png" alt="" class="bmChimg" @click="nobmshow">
@@ -135,7 +166,8 @@
 				<view class="bmTtnBox">
 					<view style="height: 1rpx;"></view>
 					<view class="bmBtn" @click="submitOrder" :style="{background:'#'+themeColor}">
-						<span v-if="info.payType==1">¥{{info.money}} &nbsp; 立即抢购</span>
+						<span v-if="info.payType==1&&info.groupType!=1">¥{{info.money}} &nbsp; 立即抢购</span>
+						<span v-if="info.payType==1&&info.groupType==1">¥{{info.groupMoney}} &nbsp; 立即拼团</span>
 						<span v-else>立即报名</span>
 					</view>
 				</view>
@@ -289,6 +321,8 @@
 				 wxOpenData:'',
 				 ext:'',
 				 iStatusBarHeight:'',
+				 groupOwner:'',
+				 groupID:'',
 			}
 		},
 		onLoad(opt) {
@@ -510,6 +544,17 @@
 					payType:this.info.payType,
 					shareId:this.shareId,
 				}
+				if(this.groupOwner==1){
+					params.groupOwner=1;
+					params.groupType=1;
+					params.totalMoney=this.info.groupMoney
+				}
+				if(this.groupOwner==2){
+					params.groupOwner=2;
+					params.groupType=1;
+					params.groupID=this.groupID;
+					params.totalMoney=this.info.groupMoney
+				}
 				uni.showLoading({
 					title: '加载中'
 				})
@@ -600,13 +645,14 @@
 				}); 
 			},
 			signUp(){
+				this.groupOwner=0;
 				if(this.userInfo){
-					this.info.shopList.forEach(item=>{
+					/* this.info.shopList.forEach(item=>{
 						if(item.id == this.shopInfo.id){
 							this.ckshopdata=item;
 							this.shopName=item.shopName;
 						}
-					})
+					}) */
 					
 					
 					this.bmShow=true;
@@ -615,6 +661,24 @@
 				}
 				
 			},
+			groupFn(){
+				this.groupOwner=1;
+				if(this.userInfo){	
+					this.bmShow=true;
+				}else{
+					this.authorizShow=true
+				}
+			},
+			join(e){
+				
+				this.groupOwner=2;
+				this.groupID=e.ID
+				if(this.userInfo){	
+					this.bmShow=true;
+				}else{
+					this.authorizShow=true
+				}
+			},
 			nobmshow(){
 				this.bmShow=false;
 			},
@@ -848,6 +912,27 @@
 		   		  })
 		   },
 		},
+		filters: {
+		    	// 拼团有效期的filter
+		    	limitTimeFilter (val) {
+					console.log('limitTimeFilter')
+					//https://blog.csdn.net/qq_39905409/article/details/104478623
+			      	if (val) {
+						console.log(val)
+			            let formateLimitTimes = this.$common.formateTimeStamp(val);
+			            let txt = `${formateLimitTimes.hour} 时 ${formateLimitTimes.min} 分            			${formateLimitTimes.seconds} 秒`;
+			            if (formateLimitTimes.day != '00') {
+			              txt = `${Number(formateLimitTimes.day)*24} 时 ${formateLimitTimes.min} 分   ${formateLimitTimes.seconds} 秒`;
+			            }
+			          return txt;
+			         } else {
+			            const twtxt = `0 时 0 分 0 秒`
+			            return twtxt;
+			         }
+			    }
+			    
+		   },
+		
 		onShareAppMessage(res) {
 			console.log(this.userInfo)
 			var img='';
@@ -876,6 +961,74 @@
 </script>
 
 <style scoped>
+.ptLine{
+	display: flex;
+	justify-content: space-between;
+	padding: 26rpx 24rpx;border-top: 1px solid #EEEEEE;
+}
+.FirstMobilePhone{
+	font-weight: 400;
+	color: #222222;font-size: 28rpx;line-height: 60rpx;
+}
+.DiffBNumber{
+	font-weight: 400;
+	color: #222222;font-size: 26rpx;
+}
+.ptlineRight{
+	display: flex;
+}
+.ptlinexx{
+	padding-right: 12rpx;
+}
+.ptBtn{
+	width: 137rpx;font-weight: 400;
+color: #FFFFFF;font-size: 28rpx;
+	height: 60rpx;text-align: center;
+	background: #E02E24;line-height: 60rpx;
+	border-radius: 6rpx;
+}
+.ptdjs{
+	font-weight: 400;
+	color: #666666;font-size: 24rpx;
+}
+.ptBox{
+	background: #ffffff;margin-top: 20rpx;
+}
+.bottomPtBox{
+	display: flex;padding-top: 24rpx;
+}
+.ptNum{
+	font-weight: 400;
+	color: #222222;font-size: 28rpx;
+}
+.ptBoxtop{
+	display: flex;justify-content: space-between;
+	padding: 20rpx 24rpx;
+}
+.ptMore{
+	font-weight: 400;
+	color: #666666;font-size: 24rpx;
+}
+.separate{
+	width: 284rpx;margin-left: 30rpx;
+	height: 74rpx;
+	background: #F19D01;
+	border-radius: 37rpx;
+	text-align: center;color: #ffffff;
+}
+.groupBtn{
+	width: 284rpx;text-align: center;color: #ffffff;
+	height: 74rpx;margin-left: 30rpx;
+	background: #D53533;
+	border-radius: 37rpx;
+}
+.separateTop{
+	font-weight: 500;font-size: 28rpx;
+	color: #FFFFFF;
+}
+.separateTxt{
+	color: #FFFFFF;font-size: 26rpx;
+}
 	.companyName{
 		font-size: 24rpx;
 		font-family: PingFangSC-Medium, PingFang SC;
@@ -952,11 +1105,11 @@
 		height: 120rpx;
 		background: #FFFFFF;
 		box-shadow: 0px -2px 10rpx 0px rgba(153,153,153,0.2000);
-		/* position: absolute;
+		 position: absolute;
 		left: 0;
-		bottom: 0; */
-		/* padding-bottom: constant(safe-area-inset-bottom);
-		padding-bottom: env(safe-area-inset-bottom); */
+		bottom: 0; 
+		 padding-bottom: constant(safe-area-inset-bottom);
+		padding-bottom: env(safe-area-inset-bottom); 
 	}
 	.bmBtn{
 		width: 690rpx;
@@ -1191,6 +1344,7 @@
 	.shopName{
 		color: #3C3C3C;
 		font-size: 28rpx;
+		width: 500rpx;
 	}
 	.shopaddress{
 		font-weight: 400;
@@ -1477,4 +1631,7 @@
 			margin-top: 62rpx;
 			margin-left:71rpx;
 		}
+		.applicationTk{
+			height: 60vh;
+		}
 </style>

+ 2 - 2
pages/index/paintSure.vue

@@ -191,7 +191,7 @@
 					let list = res.data
 					//console.log('list+=', this.queryShopList);
 					list.forEach((item)=>{
-						if (item.thedefault=="true") {
+						/* if (item.thedefault=="true") {
 							this.shopInfo = item
 							this.shopInfo.id = this.shopInfo.shopId
 							this.shopID=this.shopInfo.id
@@ -204,7 +204,7 @@
 							}); 
 							
 							console.log('item-=',item)
-						}
+						} */
 					})
 					
 			

+ 2 - 2
pages/shop/goodsDetail.vue

@@ -351,7 +351,7 @@
 						}
 						this.shopInfo='';
 						this.$store.commit('mutationsckshopInfo', '')
-						this.szShop()
+						//this.szShop()
 						if(this.info.goodsDownTime){
 							if (Number(new Date().getTime()) > (Number(new Date(this.info.goodsDownTime.replace(/-/g, '/')).getTime()) || 0)) {
 							  console.log("现在时间大于结束时间")
@@ -494,7 +494,7 @@
 							this.wxOpenData=data.loginInfo;
 							this.$store.commit('mutationswxOpenData', data)
 							this.$store.commit('mutationsuserInfo', this.userInfo)
-						    this.szShop()
+						    //this.szShop()
 						}	
 					  })
 			},

+ 9 - 3
pages/user/myOrder/activityOrderDetail.vue

@@ -26,7 +26,7 @@
 				<view class="SheetState" v-if="orderData.data.sheetState == 2">待服务</view>
 				<view class="SheetState" v-if="orderData.data.sheetState == 3">已完成</view>
 				<view class="SheetState" v-if="orderData.data.sheetState == 4">已取消</view>
-
+                <view class="SheetState" v-if="orderData.data.sheetState == 5">待成团</view>
 			</view>
 
 
@@ -93,7 +93,7 @@
 					</view>
 					
 					<image src="../../../static/img/icon_erweima.png" mode="" style="width: 36rpx;height: 36rpx;"
-						v-if="v.writeoffState==1" @click="isShowMa=true"></image>
+						v-if="v.writeoffState==1" @click="isShowMaSHow "></image>
 				</view>
 			</view>
 
@@ -170,7 +170,7 @@
 
 
 		<!-- 券码 -->
-		<view class="maBox" v-if="isShowMa==true" @click="isShowMa=false">
+		<view class="maBox" v-if="isShowMa==true" @click="isShowMaHide">
 			<view class="querenMa">
 				<view class="maTop">
 					<view class="maTitle">请到店出示券码即可开始服务</view>
@@ -305,6 +305,12 @@
 						    this.getData()
 						}	
 					  })
+			},
+			isShowMaSHow(){
+				 this.isShowMa=true
+			},
+			isShowMaHide(){
+				this.isShowMa=false
 			},
 			goDetail(id) {
 				console.log('id--',id);

+ 26 - 3
pages/user/myOrder/myOrder.vue

@@ -4,6 +4,7 @@
 		<view class="tab">
 			<view class="tabLine" :class="{tabActive:tabIndex==0}" @click="tabClick(0)">全部</view>
 			<view class="tabLine" :class="{tabActive:tabIndex==1}" @click="tabClick(1)">待付款</view>
+			<view class="tabLine" :class="{tabActive:tabIndex==5}" @click="tabClick(5)">待成团</view>
 			<view class="tabLine" :class="{tabActive:tabIndex==2}" @click="tabClick(2)">待服务</view>
 			<view class="tabLine" :class="{tabActive:tabIndex==3}" @click="tabClick(3)">已完成</view>
 
@@ -26,9 +27,13 @@
 				</view>
 				<view class="itemShopBg">
 					<view class="shopName">{{item.SheetContent}}</view>
-					<view style="color: #333333;font-size: 22rpx;">¥<span class="price">{{item.payType==1?item.realMoney:0}}</span></view>
+					<view style="color: #333333;font-size: 22rpx;">¥<span class="price">{{item.PayType==1?item.RealMoney:0}}</span></view>
 				</view>
-
+                 <view class="renBox" v-if="item.SheetType==6">
+					<image src="../../../static/timg/icon_ren.png" mode="" class="renimg"></image> 
+					<view class="renMobilePhone">{{item.MobilePhone}}</view>
+					<view class="renNickName">{{item.NickName?item.NickName:''}}</view>
+				 </view>
 				<view class="itemName">{{item.CreateTime}}</view>
 
 			</view>
@@ -143,7 +148,24 @@
 		min-height: 100vh;
 		background: #F4F5F7;
 	}
-
+   .renBox{
+	   color: #1A1A1A;
+	   background: #F7F7F7;
+	   border-radius: 10rpx;
+	   display: flex;
+	   padding: 20rpx;font-size: 24rpx;
+	   line-height: 30rpx;
+	   margin-top: 16rpx;
+   }
+   .renimg{
+	   width: 30rpx;height: 30rpx;
+   }
+   .renMobilePhone{
+	   padding-left: 13rpx;
+   }
+   .renNickName{
+	   padding-left: 20rpx;
+   }
 	.tab {
 		background: #FFFFFF;
 		display: flex;
@@ -213,6 +235,7 @@
 		display: flex;
 		justify-content: space-between;
 		margin-top: 20rpx;
+		
 	}
 
 	.shopName {

BIN
static/timg/icon_ren.png


+ 31 - 0
utils/common.js

@@ -86,6 +86,36 @@ function getExtStoreId(type){
 		console.log(err,'getExtStoreId__error')
 	}
 }
+function formateTimeStamp (timeStamp) {
+  var hour;
+  var min;
+  var seconds;
+
+  hour = parseInt(timeStamp / (60 * 60)) // 计算整数小时数
+  var afterHour = timeStamp - hour * 60 * 60 // 取得算出小时数后剩余的秒数
+  min = parseInt(afterHour / 60) // 计算整数分
+  seconds = parseInt(timeStamp - hour * 60 * 60 - min * 60) // 取得算出分后剩余的秒数
+
+  if (hour < 10) {
+    hour = '0' + hour
+  }
+
+  if (min < 10) {
+    min = '0' + min;
+  }
+
+  if (seconds < 10) {
+    seconds = '0' + seconds;
+  }
+
+  const restTime = {
+    hour: hour,
+    min: min,
+    seconds: seconds
+  }
+  return restTime
+}
+
 
 
 export default {
@@ -96,6 +126,7 @@ export default {
     isUserId,
 	getExtStoreId,
 	noMultipleClicks,      // 禁止多次点击
+	formateTimeStamp,
 }
 
 

+ 1 - 1
utils/request.js

@@ -1,7 +1,7 @@
 //测试地址
 //const baseUrl = 'http://api.dms.66km.com.cn/'
 //const baseUrl = 'http://192.168.0.121:20187/'
-//const baseUrl = 'http://192.168.0.183:20187/'
+//const baseUrl = 'http://192.168.0.122:20187/'
 //正式
 //const baseUrl = 'https://apidms.66km.com/'
 //正式地址