Commit 516e215f by zhangxw

bug 修复

1 parent 232a66d9
......@@ -275,7 +275,7 @@ Page({
weeklyList: weeklyList,
timeBean
})
api.deliveryTargetDetailWeekList(params).then(res => {
params?.merchantId && api.deliveryTargetDetailWeekList(params).then(res => {
let { code, data, message } = res
if (code == 0) {
let arr = []
......@@ -299,7 +299,7 @@ Page({
// 获取某一天交车目标数据
getTargetInfo() {
let { reportDate, merchantId, staffUuid } = this.data.targetInfo
api.deliveryTargetInfo({ merchantId, staffUuid, targetDate: reportDate }).then(res => {
merchantId && api.deliveryTargetInfo({ merchantId, staffUuid, targetDate: reportDate }).then(res => {
let { code, data, message } = res
if (code == 0) {
let { preDelieveryBefore, chatBefore, dealBefore, preDelieveryAfer, chatAfter, dealAfter, id } = data || {}
......
......@@ -46,7 +46,7 @@ function getWeekDayList(selectWeek, selectDay, customerDisabled,) {
timeBean.endDayLabel = getYearMonth(dataStr, '/') + '/' + weekDay.day
timeBean.reportEndDate = getDataFormat(dataStr)
// console.log(dataStr)
timeBean.isInCurrentWeek = isTimestampInCurrentWeek(dataStr)
timeBean.isInCurrentWeek = isTimestampInCurrentWeek(dataStr, customerDisabled)
}
}
......@@ -155,7 +155,7 @@ function getDataFormat(res) {
// return targetDate >= currentWeekStart && targetDate <= currentWeekEnd
// }
function isTimestampInCurrentWeek(timestamp) {
function isTimestampInCurrentWeek(timestamp, customerDisabled) {
const currentDate = new Date();
const currentDay = currentDate.getDay(); // 获取当前日期是星期几
......@@ -167,6 +167,13 @@ function isTimestampInCurrentWeek(timestamp) {
const targetDate = new Date(timestamp);
if (customerDisabled) {
let startOfTargetDate = new Date(targetDate.getFullYear(), targetDate.getMonth(), targetDate.getDate())
let endOfTargetDate = new Date(startOfTargetDate.getTime() + (24 * 60 * 60 * 1000) - 1)
let tomorrow = new Date(new Date().getTime() + (24 * 60 * 60 * 1000))
return tomorrow <= endOfTargetDate
}
return targetDate >= currentWeekStart && targetDate <= currentWeekEnd;
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!