Skip to content

Commit

Permalink
支付渠道的时间段判断优化
Browse files Browse the repository at this point in the history
  • Loading branch information
amirliu committed May 13, 2022
1 parent 6bddf34 commit c081e34
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/themeCommon/user/deposit/deposit.vue
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,6 @@ export default {
openTimeList.forEach(item => {
state.resultTimeMap[payItem.id] = [].concat(state.resultTimeMap[payItem.id])
const nowDate = window.dayjs()
const [start, end] = item.split('-')
const startLocal = window.dayjs.utc(`${todayStr} ${start}`).local()
const endLocal = window.dayjs.utc(`${todayStr} ${end}`).local()
Expand All @@ -549,7 +548,11 @@ export default {
}
// 判断当前时间是否在设置的存款时间内
if (nowDate.isBetween(startLocal, endLocal)) {
const nowDate = window.dayjs.utc()
const nowMinutes = nowDate.hour() * 60 + nowDate.minute() // 获取当前天的分钟数
const startMinutes = parseFloat(start.split(':')[0]) * 60 + parseFloat(start.split(':')[1]) // 计算开始时间的分钟数
const endMinutes = parseFloat(end.split(':')[0]) * 60 + parseFloat(end.split(':')[1]) // 计算结束时间的分钟数
if (nowMinutes >= startMinutes && nowMinutes <= endMinutes) {
payItem.timeRangeFlag = true
state.appendMap = state.checkedType.extend
}
Expand Down

0 comments on commit c081e34

Please sign in to comment.