Browse Source

Merge branch 'master' of http://47.98.226.240:3000/twt/jikeH5

* 'master' of http://47.98.226.240:3000/twt/jikeH5:
  安卓适配
  安卓交互
  时间问题
  分享
  11
guo 2 years ago
parent
commit
df038076ee

+ 4 - 4
pages/addjk/activity.vue

@@ -141,11 +141,11 @@
 				var ios = /iphone|ipod|ipad|mac/.test(userAgent)
 				var android = /android/.test(userAgent)
 				if (ios) {
-								 if ( true) {//!standalone&& !safari
-								   window.webkit.messageHandlers.goShare.postMessage(item)
-								 }
+					 if ( true) {//!standalone&& !safari
+					   window.webkit.messageHandlers.goShare.postMessage(item)
+					 }
 				} else if (android) {
-								 window.android.postMessage()
+					 window.android.share(JSON.stringify(item))
 				}
 			},
 			goback(){

+ 55 - 8
pages/addjk/activityDetail.vue

@@ -44,10 +44,11 @@
 		</view>
 		
 		<view style="height: 120rpx;"></view>
-		<!-- <view class="bottom" v-if="type==1"> 
-			<view class="bottomLeft" @click="edit1">编辑活动内容</view>
-			<view class="bottomRight" @click="generate">生成活动</view>
-		</view> -->
+		<view class="bottom" > 
+			<view class="bottomLeft" @click="edit1" v-if="iOSInfo.indexOf('Q022')!=-1||!iOSInfo" >编辑活动内容</view>
+			<view class="bottomRight" @click="goshare" v-if="iOSInfo.indexOf('Q022')!=-1||!iOSInfo">分享</view>
+			<view class="bottomRight2" @click="goshare" v-else>分享</view>
+		</view> 
 		
 		<!-- 适用门店 -->
 		<view class="baomingBox ckshopBox" v-if="useShopShow" @click="noShowShop2">
@@ -107,7 +108,8 @@
 				mp3Url:'',
 				id:'',
 				img:'',
-				imgListArr:''
+				imgListArr:'',
+				iOSInfo:'',
 			}
 		},
 		onLoad(opt) {
@@ -122,6 +124,12 @@
 			
 			this.id=opt.id;
 			this.getDetails()
+			var qxnum=uni.getStorageSync("quanxian");
+			if(qxnum==1){
+					 this.iOSInfo = JSON.parse(JSON.stringify(window.iOSInfo));
+			}else if(qxnum==2){
+					window.getAndroid=this.getAndroid;
+			}
             /* this.shopckList= uni.getStorageSync("shopckList");
 			this.ckmusic=uni.getStorageSync("ckmusic");
 			if(this.ckmusic){
@@ -147,6 +155,34 @@
 			this.bgmMusic.stop()
 		},
 		methods: {
+			getAndroid(e){
+				this.iOSInfo=e		
+			},
+			goshare(){
+				var obj={
+					ActivityContent: this.info.activityContent,
+					ActivityName:this.info.activityName,
+					EndTime: this.info.endTime,
+					ID: this.info.id,
+					Img: this.img,
+					StartTime: this.info.createTime,
+					state: '',
+				}
+				console.log(obj)
+				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.goShare.postMessage(obj)
+					 }
+				} else if (android) {
+					 window.android.share(JSON.stringify(obj))
+								// window.android.writeoff(this.id)
+				}
+			},
 			getDetails(){
 						  uni.showLoading({
 						  	title: '加载中'
@@ -241,7 +277,9 @@
 			
 			},
 			edit1(){
-				uni.navigateBack(-1)
+				uni.navigateTo({
+					url: 'eadit?id=' + this.id
+				})
 			},
 			auditSetTheGuest(){
 				uni.showLoading({
@@ -378,8 +416,8 @@
 		position: absolute;
 		width: 750rpx;
 		height:850rpx;
-		padding-bottom: constant(safe-area-inset-bottom);
-		padding-bottom: env(safe-area-inset-bottom);
+		/* padding-bottom: constant(safe-area-inset-bottom);
+		padding-bottom: env(safe-area-inset-bottom); */
 		left: 0;
 		bottom: 0;
 		background: #ffffff;
@@ -528,6 +566,15 @@
 		color: #FFFFFF;
 		font-size: 30rpx;
 	}
+	.bottomRight2{
+		width: 750rpx;
+		height: 98rpx;
+		background: #3F90F7;
+		line-height: 98rpx;
+		text-align: center;
+		color: #FFFFFF;
+		font-size: 30rpx;
+	}
 	.brandsBg {
 		display: flex;
 	    height: 38rpx;

+ 2 - 2
pages/addjk/eadit.vue

@@ -21,7 +21,7 @@
 						<view class="dateView" v-else>{{startTime}}</view>
 					</picker>
 					<view class="timeHx">-</view>
-					<picker mode="date" :value="endTime" @change="bindTimeChangeendTime">
+					<picker mode="date" :value="endTime" @change="bindTimeChangeendTime"  :start='startTime'>
 						<view class="dateViewno" v-if="!endTime">结束时间</view>
 						<view class="dateView" v-else>{{endTime}}</view>
 					</picker>
@@ -32,7 +32,7 @@
 				  <span class="linexx">*</span> <span>活动门店</span>
 			  </view>
 			  <view class="lineRight shopckBox">
-				 <view class="shopListNo" v-if="!shopNames">请选择活动门店,可多选</view>
+				 <view class="shopListNo" v-if="!shopNames">请选择活动门店,可多选</view>
 				  <view class="shopListY" v-if="shopNames">{{shopNames}}</view>
 				 <view class="addshop" @click="addShop">添加</view>
 			  </view>

+ 1 - 1
pages/myOrder/activityOrderDetail.vue

@@ -398,7 +398,7 @@
 						})
 					}
 				} else if (android) {
-					window.android.postMessage()
+					window.android.writeoff(this.id)
 				}
 
 			},

+ 2 - 2
pages/myOrder/mallOrderDetail.vue

@@ -414,7 +414,7 @@
 
 			// 核销
 			goHeXiao() {
-
+                console.log(this.id)
 				//app交互
 				var standalone = window.navigator.standalone
 				var userAgent = window.navigator.userAgent.toLowerCase()
@@ -428,7 +428,7 @@
 						})
 					}
 				} else if (android) {
-					window.android.postMessage()
+					window.android.writeoff(this.id)
 				}
 
 			},

+ 1 - 1
pages/myOrder/paintOrderDetail.vue

@@ -440,7 +440,7 @@
 									   window.webkit.messageHandlers.goHeXiao.postMessage({"id":this.id?this.id:''})
 									 }
 					} else if (android) {
-									 window.android.postMessage()
+									 window.android.writeoff(this.id)
 					}
 				
 			},