Commit e1420a1b authored by 潘永坪's avatar 潘永坪

应急预案处理

parent 08764e75
...@@ -389,6 +389,10 @@ export default { ...@@ -389,6 +389,10 @@ export default {
longitude longitude
} }
this.scenicList=[] this.scenicList=[]
// 获取当前时间戳
let currentTime = Date.now()
// 设置需要添加的分钟数
let minutesToAdd =5 // 这里假设要添加5分钟
this.$request('/scenic/groupGood/findGroupGoodProductList', data).then(res => { this.$request('/scenic/groupGood/findGroupGoodProductList', data).then(res => {
uni.removeStorageSync('newTimestamp') uni.removeStorageSync('newTimestamp')
if (res.code == '00') { if (res.code == '00') {
...@@ -439,13 +443,27 @@ export default { ...@@ -439,13 +443,27 @@ export default {
title: res.message, title: res.message,
icon: 'none' icon: 'none'
}) })
if(res.code=='100'){
//系统性能接近瓶颈,关闭请求
this.showTip=true
// 当前时间加上添加分钟数
let timestamp1 = currentTime + (minutesToAdd * 60 * 1000)
//后端返回的时间
let timestamp2=Date.parse(JSON.parse(res.message).stopTime)
let newTimestamp=''
if(currentTime>timestamp2){
//当前时间大于后端返回时间,以当前时间加上分钟数为准
newTimestamp = timestamp1
}
if(currentTime<=timestamp2){
//当前时间小于等于后端返回时间,取后端返回时间和当前时间加上的分钟数的最小值
newTimestamp = Math.min(timestamp1,timestamp2)
}
uni.setStorageSync('newTimestamp', newTimestamp)
}
} }
}).catch(error => { }).catch(error => {
this.showTip=true this.showTip=true
// 获取当前时间戳
let currentTime = Date.now()
// 设置需要添加的分钟数
let minutesToAdd = 5 // 这里假设要添加5分钟
// 计算新的时间戳 // 计算新的时间戳
let newTimestamp = currentTime + (minutesToAdd * 60 * 1000) let newTimestamp = currentTime + (minutesToAdd * 60 * 1000)
uni.setStorageSync('newTimestamp', newTimestamp) uni.setStorageSync('newTimestamp', newTimestamp)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment