twt 2 年之前
父节点
当前提交
a91535b1b2
共有 2 个文件被更改,包括 103 次插入40 次删除
  1. 1 1
      pages.json
  2. 102 39
      pages/activity/jkDetail.vue

+ 1 - 1
pages.json

@@ -302,7 +302,7 @@
 			"path": "pages/activity/jkDetail",
 			"style": {
 				"navigationBarTitleText": "活动详情",
-				"app-plus": { "softinputMode": "adjustPan"},
+				/* "app-plus": { "softinputMode": "adjustPan"}, */
 				"enablePullDownRefresh": true
 			}
 		},

+ 102 - 39
pages/activity/jkDetail.vue

@@ -19,7 +19,7 @@
 			<view class="shopCont">
 				<view class="shopContLeft">
 					<view class="shopName">{{shopInfo.shopName}}</view>
-					<view class="shopaddress">{{shopInfo.address}}</view>
+					<view class="shopaddress">{{shopInfo.address?shopInfo.address:''}}</view>
 				</view>
 				<view class="shopContRight">
 					<view class="shopContRightLine" @click="getmap">
@@ -112,22 +112,22 @@
 				</view>
 				<view style="padding: 0 24rpx;">
 					<view class="bmshopLine" @click="showCkshop">
-						<view class="bmshopname">请选择门店</view>
+						<view class="bmshopname" v-if="!shopName">请选择门店</view>
 						<view class="bmshopname" style="color: #333333;">{{shopName}}</view>
 						<img src="../../static/timg/icon_arrow_right.png" alt="" class="bmshopjt">
 					</view>
 					<!-- clWhere报名凭证1,2,3,4 1手机号2车牌号3姓名4单位 -->
 					<view class="bmLine" v-if="info.clWhere.indexOf(1)!=-1" >
-						<input  type="text" v-model="mobilePhone" cursor-spacing="10" class="bmlineInput" placeholder="输入手机号" placeholder-style="color:#999999">
+						<input  type="text" adjust-position="false" @blur="inputBindBlur" @focus="inputBindFocus" v-model="mobilePhone"  class="bmlineInput" placeholder="输入手机号" placeholder-style="color:#999999">
 					</view>
 					<view class="bmLine" v-if="info.clWhere.indexOf(2)!=-1">
-						<input type="text" v-model="plateNumber"  cursor-spacing="10" class="bmlineInput" placeholder="输入车牌号" placeholder-style="color:#999999">
+						<input type="text" adjust-position="false" @blur="inputBindBlur" @focus="inputBindFocus" v-model="plateNumber"   class="bmlineInput" placeholder="输入车牌号" placeholder-style="color:#999999">
 					</view>
 					<view class="bmLine" v-if="info.clWhere.indexOf(3)!=-1">
-						<input type="text"  v-model="customerName"  cursor-spacing="10" class="bmlineInput" placeholder="输入姓名" placeholder-style="color:#999999">
+						<input type="text" adjust-position="false" @blur="inputBindBlur" @focus="inputBindFocus" v-model="customerName"  class="bmlineInput" placeholder="输入姓名" placeholder-style="color:#999999">
 					</view>
 					<view class="bmLine" v-if="info.clWhere.indexOf(4)!=-1">
-						<input type="text"  v-model="unit"  cursor-spacing="10" class="bmlineInput" placeholder="输入单位" placeholder-style="color:#999999">
+						<input type="text" adjust-position="false" @blur="inputBindBlur" @focus="inputBindFocus"  v-model="unit"  class="bmlineInput" placeholder="输入单位" placeholder-style="color:#999999">
 					</view>
 				</view>
 				<view class="bmTtnBox">
@@ -206,6 +206,8 @@
 				
 			</view>
 		</view>
+		<img src="../../static/timg/mp3.png" class="mp3Img" @click="play()" v-if="!payshow&mp3Url!=''">
+		<img src=".../../static/timg/mp31.png" class="mp3Img" @click="play2()" id="bofang" v-if="payshow&mp3Url!=''">
 	</view>
 </template>
 
@@ -237,8 +239,10 @@
 				comment:'',
 				userInfo:'',
 				useShopShow:false,
-				jpHeight:0,
-				 isPlay: false
+				jpHeight:'279px',
+				 isPlay: false,
+				 mp3Url:'',
+				 payshow:false,
 			}
 		},
 		onLoad(opt) {
@@ -259,15 +263,19 @@
 		   	})
 		   }
 		  
-		  uni.onKeyboardHeightChange((obj)=>{
-		      // 获取系统信息
-		  	let _sysInfo = uni.getSystemInfoSync();
-		  	let _heightDiff = _sysInfo.screenHeight - _sysInfo.windowHeight
-		  	let _diff = obj.height - _heightDiff
-		  	// 键盘高度
-		  	this.jpHeight = (_diff > 0 ? _diff : 0) - 2 + "px";
-		  })
-		 
+		   // uni.onKeyboardHeightChange((obj)=>{
+		   //     // 获取系统信息
+		   // 	let _sysInfo = uni.getSystemInfoSync();
+		   // 	let _heightDiff = _sysInfo.screenHeight - _sysInfo.windowHeight
+		   // 	let _diff = obj.height - _heightDiff
+		   // 	// 键盘高度
+		   // 	this.jpHeight = (_diff > 0 ? _diff : 0) - 2 + "px";
+		   // })
+		   
+		   this.shopckList= uni.getStorageSync("shopckList");
+		   //this.ckmusic=uni.getStorageSync("ckmusic");
+		  
+		   
 		},
 		onPullDownRefresh(){
 			this.getInfo();
@@ -276,7 +284,37 @@
 					uni.stopPullDownRefresh(); // 关闭下拉刷新 
 			}, 1000);
 		},
+		onHide(){
+			this.bgmMusic.stop(()=>{
+			
+			console.log('背景音乐停止了');
+			
+			});
+		},
+		onUnload(){
+			this.bgmMusic.stop()
+		},
 		methods: {
+			inputBindFocus(e){
+				console.log( e.detail.height);
+				//this.jpHeight=e.detail.height+ "px";
+				console.log(this.jpHeight)
+			},
+			inputBindBlur(){
+				uni.onKeyboardHeightChange((obj)=>{
+				    // 获取系统信息
+					let _sysInfo = uni.getSystemInfoSync();
+					let _heightDiff = _sysInfo.screenHeight - _sysInfo.windowHeight
+					let _diff = obj.height - _heightDiff;
+					console.log(_diff)
+					if(_diff<0||_diff==0){
+						this.jpHeight=0
+					}
+					// 键盘高度
+					//this.jpHeight = (_diff > 0 ? _diff : 0) - 2 + "px";
+				})
+				//this.jpHeight=0
+			},
 			queryGoodsLook(){
 				this.$http('openmy/queryGoodsLook', {
 				  goodsId:this.collectingID,
@@ -296,8 +334,8 @@
 					itemId:this.collectingID,
 					itemName:this.info.activityName,
 					itemQty:1,
-					salePrice:this.info.money,
-					totalPrice:this.info.money,
+					salePrice:this.info.money?this.info.money:0,
+					totalPrice:this.info.money?this.info.money:0,
 				}
 				if(this.ckshopdata==''){
 					uni.showToast({
@@ -349,7 +387,7 @@
 					unit:this.unit,
 					plateNumber:this.plateNumber,
 					//carModel:this.carInfo.carModel,
-					totalMoney:this.info.money,
+					totalMoney:this.info.money?this.info.money:0,
 					shopId:this.ckshopdata.id,
 					comment:this.comment,
 					sheetDetail:JSON.stringify(arr),
@@ -445,6 +483,14 @@
 				}); 
 			},
 			signUp(){
+				this.info.shopList.forEach(item=>{
+					if(item.id == this.shopInfo.id){
+						this.ckshopdata=item;
+						this.shopName=item.shopName;
+					}
+				})
+				
+				
 				this.bmShow=true;
 			},
 			nobmshow(){
@@ -455,10 +501,12 @@
 				this.shopName=item.shopName;
 				this.ckshopShow=false;
 				this.shopInfo=item
+				this.useShopShow=false;
 			},
 			showCkshop(){
 				console.log("选择门店")
 				this.ckshopShow=true;
+				
 			},
 			noShowShop(){
 				this.ckshopShow=false;
@@ -505,28 +553,35 @@
 					if (this.activityNoOpen && !this.activityEnd) {
 					  this.clock2()
 					}
-					// if(this.info.music){
-					// 	this.innerAudioContext = uni.createInnerAudioContext();
-					// 		this.playVoice(this.info.music.music)
-					// 		uni.$on('changePlay', isPlay => {
-					// 			this.playVoice(this.lastRecord, this.isPlay)
-					// 		})
-					// }
-					  
+					if(this.info.music){
+						   this.bgmMusic = uni.createInnerAudioContext();
+						   this.bgmMusic.autoplay = true;//自动播放
+						   this.bgmMusic.loop = true;//循环播放
+						   this.mp3Url='http://dmsimg.66km.com/music/sakuratears.mp3';
+						   this.bgmMusic.src ='http://dmsimg.66km.com/music/sakuratears.mp3'//, mp3Url;//背景音乐地址
+						   this.bgmMusic.onPlay(function(){
+							  console.log('背景音乐播放中');
+						   });
+						   this.bgmMusic.onError((res) => {
+							 console.log(res.errMsg);
+							 console.log(res.errCode);
+						   });
+								   		 
+					}
 					
 				})
 			},
-			playVoice(url, isPlay){
-				if (url) {
-					this.lastRecord = url; // 将路径赋值给定义的变量好做判断
-					this.innerAudioContext.src = url; // 配置音频播放路径
-					this.innerAudioContext.play(); // 播放
-					this.innerAudioContext.loop = true; // 是否循环播放
-				}
-				this.isPlay = !this.isPlay;
-				if (isPlay) {
-					this.innerAudioContext.pause(); // 停止
-				}
+			play2(){
+				 this.bgmMusic.play();
+				 this.payshow=false;
+			},
+			play(){
+				this.payshow=true;
+				this.bgmMusic.stop(()=>{
+				
+				console.log('背景音乐停止了');
+				
+				});
 			},
 			getInfo(){
 				this.$http('openreservation/getInfo', {
@@ -661,6 +716,14 @@
 </script>
 
 <style scoped>
+	.mp3Img{
+	 /* transform: translate(-1584.4%, 121.5%) scale(1); */
+	  position: fixed;
+	  top: 40rpx;
+	  right: 40rpx;
+	  width: 60rpx;
+	  height: 60rpx;
+	}
 	.ckshopBox{
 		z-index: 111 !important;
 	}