浏览代码

救援门店

twt 7 月之前
父节点
当前提交
766f2822a5
共有 1 个文件被更改,包括 92 次插入17 次删除
  1. 92 17
      pages/rescue/rescueOrder.vue

+ 92 - 17
pages/rescue/rescueOrder.vue

@@ -28,17 +28,20 @@
 			</view>
 			<!-- 筛选框 -->
 			<view class="screen">
-			  <view class="screenLine">
+			  <view class="screenLine" @click="ckShopAppFn">
 				  <!-- <span class="screenLineSpan">救援门店</span> -->
-				  <view class="">
+				 <!-- <view class="">
 					   <picker @change="bindPickerChange" :value="pickerindex" :range-key="'shopName'" :range="pickerarray">
 							<view class="screenLine"> 
 								<span class="screenLineSpan">救援门店</span>	
 								<img src="../../static/img/arrow_down.png" alt="" class="screenLineImg">
 							</view>
 					   </picker>
-				  </view>
+				  </view> -->
 				 
+				 	<span class="screenLineSpan">{{shopName?shopName:'救援门店'}}</span>	
+				 	<img src="../../static/img/arrow_down.png" alt="" class="screenLineImg">
+				
 			  </view>
 			  <view class="screenLine" @click="orderTimesxSHow=true">
 				  <span class="screenLineSpan">下单时间</span>
@@ -92,6 +95,7 @@
 		
 		
 		<view class="main">
+		<!-- 	<view>{{ms}}</view> -->
 			<view class="itemBg" v-for="(item,index) in items" @click="goDetail(item)">
 				<view class="itemTop">
 					<view class="itemType" >
@@ -138,11 +142,11 @@
 			  <view class="">
 			  	   <picker @change="bindPickerChange" :value="pickerindex" :range-key="'shopName'" :range="pickerarray">
 			  	 		<view class="uniPicker"> 
-			  							<view class="uniPickerName">
-			  							  {{shopName}}
-			  							</view>
-			  						   <image src="../../static/img/jt.png" mode=" " class="jtShopImg"></image>
-			  						</view>
+							<view class="uniPickerName">
+							  {{shopName}}
+							</view>
+						   <image src="../../static/img/jt.png" mode=" " class="jtShopImg"></image>
+						</view>
 			  	   </picker>
 			  </view>
 			  <view class="screenBt">救援时间</view>
@@ -181,6 +185,7 @@
 		},
 		data() {
 			return {
+				ms:'',
 				page: 1,
 				tabIndex: -1,
 				items: [],
@@ -220,20 +225,77 @@
 			}
 		},
 		onLoad(opt) {
+			this.date1=this.time(new Date())
+			this.date2=this.time(new Date())
 			this.iStatusBarHeight = uni.getSystemInfoSync().statusBarHeight;
 			//this.getData();
 			this.getShopinfo();
+			//app交互
+			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) {
+				  window.shopAppCallbackios=this.shopAppCallbackios;
+			} else if (android) {
+				 window.shopAppCallback=this.shopAppCallback;
+			}
+			
 			
 		},
-		onShow() {
-			console.log(this.tabIndex)
-            this.getShopinfo();
+		 onShow() {
+			const onshow = uni.getStorageSync('onshow');
+			if(onshow==1){
+				  uni.removeStorageSync('onshow');
+				 // this.getShopinfo();
+				 this.getData()
+			}else{
+				
+			}
+          
 			//this.getData();
 			
 
-		},
+		}, 
 		
 		methods: {
+			ckShopAppFn(){
+				var obj={
+					value:this.mrshopId,
+					key:this.mrshopName
+				}
+				console.log(obj)
+				//app交互
+				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.shopApp.postMessage(JSON.stringify(obj))
+					 }
+				} else if (android) {
+					 window.android.shopApp(JSON.stringify(obj))
+				}
+			},
+			shopAppCallback(e){
+				//this.ms=e.key
+				//this.ms=JSON.parse(e).key
+			//	var obj=JSON.parse(e);
+				this.shopName=e.key
+				this.shopId=e.value
+				this.page=1
+				this.getData();
+			},
+			shopAppCallbackios(e){
+				var obj=JSON.parse(e);
+				this.shopName=obj.key
+				this.shopId=obj.value
+				this.page=1
+				this.getData();
+			},
 			orderTimesx(){
 				this.items=[]
 				this.orderTimesxSHow=false;
@@ -372,11 +434,11 @@
 					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)
-									 }
+						 if ( true) {//!standalone&& !safari
+						   window.webkit.messageHandlers.goMyNav.postMessage(null)
+						 }
 					} else if (android) {
-									 window.android.postMessage()
+						 window.android.postMessage()
 					}
 				
 			   
@@ -387,6 +449,7 @@
 				this.getData()
 			},
 			goDetail(item) {
+				uni.setStorageSync('onshow', '1');
 				uni.navigateTo({
 					url: "rescueOrderDetail?id=" + item.ID+'&back=1'
 				})
@@ -433,7 +496,19 @@
 
 				})
 			},
-
+           time(time) {
+				 let month = time.getMonth() + 1;  // 月
+				 let date = time.getDate();  // 日
+				 let hh = time.getHours();  // 时
+				 let mm = time.getMinutes();  // 分
+				 let ss = time.getSeconds();  // 秒
+				 if (hh >=0 && hh<10){hh= '0' + hh;}
+				 if (mm >=0 && mm<10){mm= '0' + mm;}
+				 if (ss >=0 && ss<10){ss= '0' + ss;}
+				 if (month < 10){month= '0' + month;}
+				 if (date < 10){date= '0' + date;}
+				 return time.getFullYear().toString()+'-' + month.toString()+'-' + date.toString()// + hh.toString() + mm.toString() + ss.toString();
+           },
 		},
 		onReachBottom() {
 			this.page++;