fix: 短临
parent
8428ca90ae
commit
044d7e7a1d
|
|
@ -386,7 +386,8 @@ export default {
|
||||||
imgHours: '',
|
imgHours: '',
|
||||||
imgHourstm: [],
|
imgHourstm: [],
|
||||||
imgHoursList: {},
|
imgHoursList: {},
|
||||||
interval: null
|
interval: null,
|
||||||
|
numPic: 0
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
|
@ -511,15 +512,15 @@ export default {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
async getHoursImg () {
|
getTmData () {
|
||||||
let h = moment().format('HH')
|
let h = moment().format('HH')
|
||||||
let m = moment().format('mm')
|
let m = moment().format('mm')
|
||||||
console.log('hhh--', h, m)
|
console.log('hhh--', h, m, this.numPic)
|
||||||
let tms = null,
|
let tms = null,
|
||||||
mm = null
|
mm = null
|
||||||
let h1 = Number(h) - 1
|
let h1 = Number(h) - 1
|
||||||
if (h1 < 9) {
|
if (h1 < 9) {
|
||||||
h1 = Number(h) - 3
|
h1 = Number(h) - this.numPic
|
||||||
}
|
}
|
||||||
if (h1 < 10) {
|
if (h1 < 10) {
|
||||||
h1 = `0${h1}`
|
h1 = `0${h1}`
|
||||||
|
|
@ -535,31 +536,73 @@ export default {
|
||||||
tms = `${this.imgtm}${h1}30`
|
tms = `${this.imgtm}${h1}30`
|
||||||
mm = '30'
|
mm = '30'
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
async getHoursImg () {
|
||||||
|
let h = moment().format('HH')
|
||||||
|
let m = moment().format('mm')
|
||||||
|
console.log('hhh--', h, m, this.numPic)
|
||||||
|
let tms = null,
|
||||||
|
mm = null
|
||||||
|
let h1 = Number(h) - 1
|
||||||
|
if (h1 < 9) {
|
||||||
|
h1 = Number(h) - Number(this.numPic)
|
||||||
|
}
|
||||||
|
if (h1 < 10) {
|
||||||
|
let t = Number(h1) - Number(this.numPic)
|
||||||
|
h1 = `0${t}`
|
||||||
|
}
|
||||||
|
if (m > 30) {
|
||||||
|
h1 = Number(h) - 1
|
||||||
|
let t3 = Number(h) - this.numPic
|
||||||
|
if (this.numPic <= 0) {
|
||||||
|
tms = `${this.imgtm}${h}30`
|
||||||
|
} else {
|
||||||
|
tms = `${this.imgtm}${t3}30`
|
||||||
|
}
|
||||||
|
|
||||||
console.log('ddddd', h, h1)
|
mm = '30'
|
||||||
console.log('ddddd', tms)
|
} else if (m < 10) {
|
||||||
|
tms = `${this.imgtm}${h1}00`
|
||||||
|
mm = '00'
|
||||||
|
} else {
|
||||||
|
tms = `${this.imgtm}${h1}30`
|
||||||
|
mm = '30'
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log('小时', h1)
|
||||||
|
console.log('需要参数', tms)
|
||||||
uni.request({
|
uni.request({
|
||||||
url: 'https://shqxjs.cloudowr.cn/service/radar/rainimg',
|
url: 'https://shqxjs.cloudowr.cn/service/radar/rainimg',
|
||||||
data: {
|
data: {
|
||||||
tm: tms
|
tm: tms
|
||||||
},
|
},
|
||||||
success: res => {
|
success: res => {
|
||||||
console.log('000000', tms, res.data.data)
|
console.log('pic---', tms, res.data.data)
|
||||||
this.imgHoursList = res.data.data.img
|
this.imgHoursList = res.data.data.img
|
||||||
|
|
||||||
let m = moment().format('MM月DD日')
|
let m = moment().format('MM月DD日')
|
||||||
|
|
||||||
console.log('am222', this.imgHoursList)
|
console.log('am222', this.imgHoursList)
|
||||||
let m1 = Number(h1) + 2
|
let m1 = Number(h1) + 2
|
||||||
this.imgHourstm = [`${m}${h1}时${mm}分`, `${m}${m1}时${mm}分`]
|
this.imgHourstm = [`${m}${h1}时${mm}分`, `${m}${m1}时${mm}分`]
|
||||||
|
|
||||||
|
if (res.data.data.img == null) {
|
||||||
|
this.numPic++
|
||||||
|
setTimeout(() => {
|
||||||
|
this.getHoursImg()
|
||||||
|
}, 10 * 1000)
|
||||||
|
} else {
|
||||||
|
this.numPic = 0
|
||||||
|
return
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
async getInterval () {
|
|
||||||
this.interval = setInterval(() => {
|
// async getInterval () {
|
||||||
this.getHoursImg()
|
// this.interval = setInterval(() => {
|
||||||
}, 60 * 1000)
|
// this.getHoursImg()
|
||||||
},
|
// }, 60 * 1000)
|
||||||
|
// },
|
||||||
async getYjRead () {
|
async getYjRead () {
|
||||||
try {
|
try {
|
||||||
const { data } = await uni.$http.get(
|
const { data } = await uni.$http.get(
|
||||||
|
|
@ -814,15 +857,15 @@ export default {
|
||||||
this.getReadStatus()
|
this.getReadStatus()
|
||||||
if (this.limit == 1) {
|
if (this.limit == 1) {
|
||||||
this.getYjRead()
|
this.getYjRead()
|
||||||
this.getInterval()
|
// this.getInterval()
|
||||||
this.getImgs()
|
this.getImgs()
|
||||||
this.getHoursImg()
|
this.getHoursImg()
|
||||||
}
|
}
|
||||||
},
|
|
||||||
onUnload () {
|
|
||||||
clearInterval(this.interval)
|
|
||||||
this.interval = null
|
|
||||||
}
|
}
|
||||||
|
// onUnload () {
|
||||||
|
// clearInterval(this.interval)
|
||||||
|
// this.interval = null
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -91,10 +91,10 @@ export default {
|
||||||
uni.setStorageSync('loginName', postForm.loginName)
|
uni.setStorageSync('loginName', postForm.loginName)
|
||||||
uni.setStorageSync('secretKey', postForm.secretKey)
|
uni.setStorageSync('secretKey', postForm.secretKey)
|
||||||
} else {
|
} else {
|
||||||
// uni.removeStorageSync('loginName')
|
uni.removeStorageSync('loginName')
|
||||||
// uni.removeStorageSync('secretKey')
|
uni.removeStorageSync('secretKey')
|
||||||
// this.formData.username = ''
|
this.formData.username = ''
|
||||||
// this.formData.password = ''
|
this.formData.password = ''
|
||||||
}
|
}
|
||||||
|
|
||||||
//提交表单
|
//提交表单
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue