فهرست منبع

feat:下单页面停留时间超过5分钟提示重进

zhanghui 2 سال پیش
والد
کامیت
cf2ce3f1bc
3فایلهای تغییر یافته به همراه50 افزوده شده و 6 حذف شده
  1. 24 5
      orderPages/bookService/index.vue
  2. 23 0
      orderPages/storeService/index.vue
  3. 3 1
      pages.json

+ 24 - 5
orderPages/bookService/index.vue

@@ -145,6 +145,7 @@
 		},
 		data() {
 			return {
+				timeoutId:null,
 				templateId:[],
 				//服务对象列表
 				serviceObjectList:[],
@@ -194,18 +195,36 @@
 			this.selectDate()
 			this.getTemplateList()
 
+			this.timeoutId = setTimeout(()=>{
+				uni.showModal({
+					title:'温馨提示',
+					content:'您在下单页面停留太久,请重新进入!',
+					showCancel:false,
+					success:res=>{
+						if (res.confirm){
+							uni.switchTab({
+								url: '/pages/index/index',
+							})
+						}
+					}
+				})
+			},1000*60*5)
+
 		},
 		onShow() {
 
 		},
-		mounted(){
-
-
-
-
+		onUnload(){
+			clearTimeout(this.timeoutId);
 		},
 		methods: {
 
+			back(){
+				uni.switchTab({
+					url: '/pages/index/index',
+				})
+			},
+
 			clickPeriodDateList(e){
 				console.log("666666666666666",e)
 				this.periodDateIndex = e.index

+ 23 - 0
orderPages/storeService/index.vue

@@ -80,6 +80,7 @@
 		},
 		data() {
 			return {
+				timeoutId:null,
 				periodTimeList:[],
 				userInfo: {},
 				store: {},
@@ -115,12 +116,34 @@
 			this.orderParam.serviceDate = date.getFullYear() + '-' + ('0' + (date.getMonth() + 1)).slice(-2) + '-' + ('0' +
 				date.getDate()).slice(-2)
 
+			 this.timeoutId = setTimeout(()=>{
+				uni.showModal({
+					title:'温馨提示',
+					content:'您在下单页面停留太久,请重新进入!',
+					showCancel:false,
+					success:res=>{
+						if (res.confirm){
+							uni.switchTab({
+								url: '/pages/index/index',
+							})
+						}
+					}
+				})
+			},1000*60*5)
 		},
 		onShow() {
 			this.getServicePersonTime()
 			this.getTemplateList()
 		},
+		onUnload(){
+			clearTimeout(this.timeoutId);
+		},
 		methods: {
+			back(){
+				uni.switchTab({
+					url: '/pages/index/index',
+				})
+			},
 
 			selectServiceTime(items,index,index2){
 				items.forEach(e=>{

+ 3 - 1
pages.json

@@ -154,7 +154,8 @@
 				{
 					"path": "storeService/index",
 					"style": {
-						"navigationBarTitleText": "今日预约",
+						"navigationBarTitleText": "当日排队",
+//						"navigationStyle": "custom",
 						"enablePullDownRefresh": false
 					}
 				},
@@ -169,6 +170,7 @@
 					"path": "bookService/index",
 					"style": {
 						"navigationBarTitleText": "明日预约",
+//						"navigationStyle": "custom",
 						"enablePullDownRefresh": false
 					}
 				},	{