Browse Source

bug修改

twt 2 years ago
parent
commit
f0a827ad0c
8 changed files with 168 additions and 19 deletions
  1. 10 8
      pages.json
  2. 27 0
      pages/addjk/activity.vue
  3. 55 1
      pages/addjk/choice.vue
  4. 14 4
      pages/addjk/eadit.vue
  5. 61 2
      pages/addjk/jkDetail.vue
  6. 1 4
      pages/index/index.vue
  7. BIN
      static/img/mp3.png
  8. BIN
      static/img/mp31.png

+ 10 - 8
pages.json

@@ -1,9 +1,16 @@
 {
 	"pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
+		{
+			"path": "pages/index/index",
+			"style": {
+				"navigationBarTitleText": "uni-app"
+			}
+		},
 		{
 			"path": "pages/addjk/choice",
 			"style": {
-				"navigationBarTitleText": "选择素材"
+				"navigationBarTitleText": "选择素材",
+				"navigationStyle": "custom"
 			}
 		},
 		{
@@ -45,12 +52,7 @@
 				"navigationBarTitleText": "活动详情"
 			}
 		},
-		{
-			"path": "pages/index/index",
-			"style": {
-				"navigationBarTitleText": "uni-app"
-			}
-		},
+		
 		{
 			"path": "pages/addjk/signJkDetail",
 			"style": {
@@ -71,7 +73,7 @@
 	"globalStyle": {
 		"navigationBarTextStyle": "black",
 		"navigationBarTitleText": "uni-app",
-		"navigationBarBackgroundColor": "#F8F8F8",
+		"navigationBarBackgroundColor": "#ffffff",
 		"backgroundColor": "#F8F8F8"
 	},
 	"uniIdRouter": {}

+ 27 - 0
pages/addjk/activity.vue

@@ -90,6 +90,14 @@
 
 			}
 		},
+		// onBackPress(options){
+		// 	if (options.from === 'navigateBack') {
+		// 	        return false
+		// 	    }
+		// 	console.log(options)
+		// 	console.log("返回")
+		// 	return true; 
+		// },
 		onLoad() {
 			this.iStatusBarHeight = uni.getSystemInfoSync().statusBarHeight;
 			this.page = 1
@@ -97,6 +105,25 @@
 		},
 
 		methods: {
+			goAdd(){
+				uni.navigateTo({
+					url:'choice?type=2'
+				})
+			},
+			goback(){
+			   var standalone = window.navigator.standalone
+			   var userAgent = window.navigator.userAgent.toLowerCase()
+			   var safari = /safari/.test(userAgent)
+			   var ios = /iphone|ipod|ipad|mac/.test(userAgent)
+			   var android = /android/.test(userAgent)
+			   if (ios) {
+				 if ( true) {//!standalone&& !safari
+				   window.webkit.messageHandlers.goMyNav.postMessage(null)
+				 }
+			   } else if (android) {
+				 window.android.postMessage()
+			   }
+			},
 			stop(item) {
 
 				var that = this;

+ 55 - 1
pages/addjk/choice.vue

@@ -1,5 +1,13 @@
 <template>
 	<view class="content">
+		<view class="nav">
+			<view class="uni-page-head-btnBox">
+				<view class="uni-page-head-btn" @click="goback"><i class="uni-btn-icon" ></i></view>
+			</view>
+			
+			<view class="Navtitle">选择素材</view>
+			<view class="uni-page-head-btnBox"></view>
+		</view>
 		<view class="zhidingyiBox">
 			<view class="zhidingyi" @click="upimg">
 				<view class="zdyLeft">
@@ -35,14 +43,43 @@
 			return {
 				list:'',
 				imgurl:'',
+				type:'',
 			}
 		},
-		onLoad() {
+		onLoad(opt) {
           this.getSetTheGuestList();
+		  this.type=opt.type;
 		  //?token=1BAD122A96BA41E49200322381DC5D34&uid=DC0B84EA-A67B-4A4B-8EAE-F55A13CF8217
 		},
+		// onBackPress(e){
+		// 	console.log(e)
+		// 	console.log("返回")
+		// 	return true; 
+		// },
+		
 		methods: {
+		   goback(){
+			   if(this.type==2){
+				   uni.navigateBack()
+			   }else{
+				   var standalone = window.navigator.standalone
+				   var userAgent = window.navigator.userAgent.toLowerCase()
+				   var safari = /safari/.test(userAgent)
+				   var ios = /iphone|ipod|ipad|mac/.test(userAgent)
+				   var android = /android/.test(userAgent)
+				   if (ios) {
+				     if ( true) {//!standalone&& !safari
+				       window.webkit.messageHandlers.goMyNav.postMessage(null)
+				     }
+				   } else if (android) {
+				     window.android.postMessage()
+				   }
+			   }
+			   
+			   
+		   },
 		   goAdd(item){
+			   uni.removeStorageSync('ckmusic');
 				uni.navigateTo({
 					url:'addActivity?img='+item.Img
 				})
@@ -95,6 +132,23 @@
 </script>
 
 <style scoped>
+	.nav{
+		height: 44px;
+		background: #ffffff;
+		display: flex;
+		justify-content: space-between;
+		line-height: 44px;
+		font-size: 16px;
+		font-weight: 700;
+	}
+	.uni-page-head-btnBox{
+		width: 40px;
+		padding-top: 5px;
+	}
+	.uni-btn-icon{
+		color: #000000;
+		font-size: 27px;
+	}
 	.content{
 		min-height: 100vh;
 		background:#F4F5F7 ;

+ 14 - 4
pages/addjk/eadit.vue

@@ -259,6 +259,15 @@
 					this.ckMusic=res.data.selectedMusic;
 					if(this.ckMusic){
 						this.music=this.ckMusic.id;
+						uni.setStorage({
+								key: 'ckmusic',
+								data: this.ckMusic,
+								 success: function () {	
+											
+								 }
+						});
+					}else{
+						uni.removeStorageSync('ckmusic');
 					}
 					
 					//console.log(this.imgListArr)
@@ -304,7 +313,7 @@
 		  	});
 		  },
 		  preview(){
-			
+			//console.log(this.clWhere)
 			 // if(this.money==0){
 				//  this.money=0
 			 // }
@@ -330,7 +339,7 @@
 					 duration: 2000
 				});
 				return false;
-			}else if(this.clWhere==''){
+			}else if(this.clWhereString==''){
 				uni.showToast({
 					 title: '请选择报名凭证',
 					 icon:'none',
@@ -344,7 +353,7 @@
 					 duration: 2000
 				});
 				return false;
-			}else if(this.money!=0&&this.money==''&&payType==1){
+			}else if(this.money!==0&&this.money==''&&this.payType==1){
 				uni.showToast({
 					 title: '请输入支付金额',
 					 icon:'none',
@@ -352,10 +361,11 @@
 				});
 				return false;
 			}
+			//return false;
 			var editdata={
 				id:this.id,
 				activityName:this.activityName,
-				startTime:this.startTime,
+				startTime:this.startTime+'00',
 				endTime:this.endTime,
 				number:this.number,
 				activityContent:this.activityContent,

+ 61 - 2
pages/addjk/jkDetail.vue

@@ -83,7 +83,11 @@
 				
 			</view>
 		</view>
-		
+		<!-- <audio id="video"  controls autoplay="autoplay" ref="iosclick" loop="loop" >
+		  <source src="http://dmsimg.66km.com/music/sakuratears.mp3" type="audio/mpeg">
+		 </audio> -->
+		 <img src="../../static/img/mp3.png" class="mp3Img" @click="play()" v-if="!payshow&mp3Url!=''">
+		 <img src=".../../static/img/mp31.png" class="mp3Img" @click="play2()" id="bofang" v-if="payshow&mp3Url!=''">
 	</view>
 </template>
 
@@ -97,6 +101,10 @@
 				shopInfo:'',
 				useShopShow:false,
 				shopckList:'',
+				ckmusic:'',
+				bgmMusic:'',
+				payshow:false,
+				mp3Url:'',
 			}
 		},
 		onLoad(opt) {
@@ -110,8 +118,42 @@
 			}
 			this.getShopinfo()
             this.shopckList= uni.getStorageSync("shopckList");
+			this.ckmusic=uni.getStorageSync("ckmusic");
+			if(this.ckmusic){
+				this.mp3Url=this.ckmusic.music;
+				this.bgmMusic = uni.createInnerAudioContext();
+				this.bgmMusic.autoplay = true;//自动播放
+				this.bgmMusic.loop = true;//循环播放
+				this.bgmMusic.src = 'http://dmsimg.66km.com/music/sakuratears.mp3';//背景音乐地址
+				this.bgmMusic.onPlay(function(){
+				   console.log('背景音乐播放中');
+						
+				});
+				this.bgmMusic.onError((res) => {
+				  console.log(res.errMsg);
+				  console.log(res.errCode);
+				});
+			}
+			
+			//console.log(this.bgmMusic)
+			
+		},
+		onUnload(){
+			this.bgmMusic.stop()
 		},
 		methods: {
+			play2(){
+				 this.bgmMusic.play();
+				 this.payshow=false;
+			},
+			play(){
+				this.payshow=true;
+				this.bgmMusic.stop(()=>{
+				
+				console.log('背景音乐停止了');
+				
+				});
+			},
 			noShowShop2(){
 				this.useShopShow=false;
 			},
@@ -171,7 +213,16 @@
 			},
 			getShopinfo(){
 				this.$http('openH5SetTheGuest/getShopinfo',{},'GET').then(res => {
-						this.shopInfo=res.data
+						//this.shopInfo=res.data;
+						var shopinfo=res.data;
+						this.shopckList.forEach(item=>{
+							if(item.id==shopinfo.id){
+								this.shopInfo=shopinfo
+							}
+						})
+						if(this.shopInfo==''){
+							this.shopInfo=this.shopckList[0]
+						}
 				 })
 			},
             generate(){
@@ -200,6 +251,14 @@
 </script>
 
 <style scoped>
+	.mp3Img{
+	 /* transform: translate(-1584.4%, 121.5%) scale(1); */
+	  position: fixed;
+	  top: 100rpx;
+	  right: 40rpx;
+	  width: 60rpx;
+	  height: 60rpx;
+	}
 	.shopImg {
 		width: 146rpx;
 		height: 146rpx;

+ 1 - 4
pages/index/index.vue

@@ -1,9 +1,6 @@
 <template>
 	<view class="content">
-		<image class="logo" src="/static/logo.png"></image>
-		<view class="text-area">
-			<text class="title">{{title}}</text>
-		</view>
+		
 	</view>
 </template>
 

BIN
static/img/mp3.png


BIN
static/img/mp31.png