Commit 7bcd597e by zhangxw

日报相关bug修复

1 parent 0d48c5a5
......@@ -116,7 +116,9 @@ Page({
// 获取上一天的日期
let previousDate = new Date(currentDate)
previousDate.setDate(currentDate.getDate() - 1)
// toISOString 方法会丢失时区 导致与北京时间差八小时
let hour = previousDate.getHours() + 8
previousDate.setHours(hour)
// 格式化日期为"yyyy-mm-dd"
let formattedDate = previousDate.toISOString().split('T')[0]
console.log('formattedDate', formattedDate);
......@@ -201,6 +203,9 @@ Page({
checkDeliveryTarget() {
let userInfo = wx.$util.getUserInfo()
let currentDate = new Date()
// toISOString 方法会丢失时区 导致与北京时间差八小时
let hour = currentDate.getHours() + 8
currentDate.setHours(hour)
// 格式化日期为"yyyy-mm-dd"
let formattedDate = currentDate.toISOString().split('T')[0]
// 驻店负责人 loginRoleOnSelectMerchant 跟随门店配置是否是驻店负责人
......
......@@ -217,7 +217,9 @@ Page({
// 获取上一天的日期
let previousDate = new Date(currentDate);
previousDate.setDate(currentDate.getDate() - 1);
// toISOString 方法会丢失时区 导致与北京时间差八小时
let hour = previousDate.getHours() + 8
previousDate.setHours(hour)
// 格式化日期为"yyyy-mm-dd"
let formattedDate = previousDate.toISOString().split("T")[0];
if (wx.__HAS_NOREPORT_MODAL || wx.__HAS_NOTLOGIN_MODAL)
......
......@@ -2,7 +2,7 @@
var dateContrast = function (params) {
var oneDay = 24 * 60 * 60 * 1000 // 一天的毫秒数
var currentDate = getDate().getTime() // 当前日期
var targetDate = getDate(params).getTime() // 给定的日期
var targetDate = getDate(params + ' 00:00:00').getTime() // 给定的日期 零点的时间戳
return targetDate < currentDate + oneDay
}
......@@ -10,7 +10,7 @@ var dateContrast = function (params) {
var isShowBtns = function (date) {
var oneDay = 24 * 60 * 60 * 1000 // 一天的毫秒数
var currentDate = getDate() // 当前日期
var targetDate = getDate(date) // 给定的日期
var targetDate = getDate(date + ' 00:00:00') // 给定的日期
// 计算给定日期与当前日期的时间差(以毫秒为单位)
var diffMilliseconds = targetDate - currentDate
// 计算时间差对应的天数
......
......@@ -208,7 +208,9 @@ Component({
// 获取上一天的日期
let previousDate = new Date(currentDate)
previousDate.setDate(currentDate.getDate() - 1)
// toISOString 方法会丢失时区 导致与北京时间差八小时
let hour = previousDate.getHours() + 8
previousDate.setHours(hour)
// 格式化日期为"yyyy-mm-dd"
let formattedDate = previousDate.toISOString().split('T')[0]
wx.$router.go('tabWorkOrder.staffDaily', {
......
......@@ -124,7 +124,9 @@ Page({
// 获取上一天的日期
let previousDate = new Date(currentDate)
previousDate.setDate(currentDate.getDate() - 1)
// toISOString 方法会丢失时区 导致与北京时间差八小时
let hour = previousDate.getHours() + 8
previousDate.setHours(hour)
// 格式化日期为"yyyy-mm-dd"
let formattedDate = previousDate.toISOString().split('T')[0]
wx.$router.go('tabWorkOrder.upgradeStaffDaily', {
......@@ -420,6 +422,7 @@ Page({
},
});
} else {
console.log(item)
wx.$router.go(item.url);
}
} else {
......@@ -897,7 +900,9 @@ Page({
// 获取上一天的日期
let previousDate = new Date(currentDate);
previousDate.setDate(currentDate.getDate() - 1);
// toISOString 方法会丢失时区 导致与北京时间差八小时
let hour = previousDate.getHours() + 8
previousDate.setHours(hour)
// 格式化日期为"yyyy-mm-dd"
let formattedDate = previousDate.toISOString().split("T")[0];
if (wx.__HAS_NOREPORT_MODAL || wx.__HAS_NOTLOGIN_MODAL) return false;
......
......@@ -72,12 +72,12 @@ export default {
recordId: 12,
icon: "boutique-syzs",
},
{
name: "驻店日报",
url: "tabWorkOrder.staffDaily",
recordId: 13,
icon: "staffreport",
},
// {
// name: "驻店日报",
// url: "tabWorkOrder.staffDaily",
// recordId: 13,
// icon: "staffreport",
// },
{
name: "营销素材",
url: "/pages/materails/index",
......
......@@ -452,7 +452,9 @@ Page({
// 获取上一天的日期
let previousDate = new Date(currentDate)
previousDate.setDate(currentDate.getDate() - 1)
// toISOString 方法会丢失时区 导致与北京时间差八小时
let hour = previousDate.getHours() + 8
previousDate.setHours(hour)
// 格式化日期为"yyyy-mm-dd"
let formattedDate = previousDate.toISOString().split('T')[0]
if (wx.__HAS_NOREPORT_MODAL || wx.__HAS_NOTLOGIN_MODAL) return false
......
......@@ -313,7 +313,9 @@ Page({
// 获取上一天的日期
let previousDate = new Date(currentDate)
previousDate.setDate(currentDate.getDate() - 1)
// toISOString 方法会丢失时区 导致与北京时间差八小时
let hour = previousDate.getHours() + 8
previousDate.setHours(hour)
// 格式化日期为"yyyy-mm-dd"
let formattedDate = previousDate.toISOString().split('T')[0]
if (wx.__HAS_NOREPORT_MODAL || wx.__HAS_NOTLOGIN_MODAL) return false
......
......@@ -425,7 +425,9 @@ Page({
// 获取上一天的日期
let previousDate = new Date(currentDate)
previousDate.setDate(currentDate.getDate() - 1)
// toISOString 方法会丢失时区 导致与北京时间差八小时
let hour = previousDate.getHours() + 8
previousDate.setHours(hour)
// 格式化日期为"yyyy-mm-dd"
let formattedDate = previousDate.toISOString().split('T')[0]
if (wx.__HAS_NOREPORT_MODAL || wx.__HAS_NOTLOGIN_MODAL) return false
......
......@@ -528,7 +528,9 @@ Page({
// 获取上一天的日期
let previousDate = new Date(currentDate)
previousDate.setDate(currentDate.getDate() - 1)
// toISOString 方法会丢失时区 导致与北京时间差八小时
let hour = previousDate.getHours() + 8
previousDate.setHours(hour)
// 格式化日期为"yyyy-mm-dd"
let formattedDate = previousDate.toISOString().split('T')[0]
if (wx.__HAS_NOREPORT_MODAL || wx.__HAS_NOTLOGIN_MODAL) return false
......
......@@ -343,7 +343,9 @@ Page({
// 获取上一天的日期
let previousDate = new Date(currentDate)
previousDate.setDate(currentDate.getDate() - 1)
// toISOString 方法会丢失时区 导致与北京时间差八小时
let hour = previousDate.getHours() + 8
previousDate.setHours(hour)
// 格式化日期为"yyyy-mm-dd"
let formattedDate = previousDate.toISOString().split('T')[0]
if (wx.__HAS_NOREPORT_MODAL || wx.__HAS_NOTLOGIN_MODAL) return false
......
......@@ -295,16 +295,10 @@ Page({
});
},
click(e) {
role != "staff";
let { role, orderObj } = this.data;
if (role != "staff" || !orderObj.isDateWithin7Days) return;
let { pidx, idx } = e.currentTarget.dataset;
let { pidx, idx } = e.detail
this.setData({
[`formData[${pidx}].optionList[${idx}].active`]:
!this.data.formData[pidx].optionList[idx].active,
});
[`formData[${pidx}].optionList[${idx}].active`]: !this.data.formData[pidx].optionList[idx].active
})
},
/**
* 点击了上一周,选择周数字减一,然后直接调用工具类中一个方法获取到数据
......@@ -447,15 +441,20 @@ Page({
trafficProblemList = trafficProblemList || [];
formData.forEach((element) => {
if (element.name == "trafficProblemList") {
element.selectedList = []
element.selectedStr = ''
element.optionList = element.optionList.map((option) => {
option.active = false;
trafficProblemList.map((item) => {
if (option.confId == item) {
option.active = true;
element.selectedList.push(option)
}
});
return option;
});
element.selectedStr = element.selectedList?.map(v => { return v.confName })?.join(';')
return element
}
});
// }
......@@ -463,15 +462,20 @@ Page({
packageProblemList = packageProblemList || [];
formData.forEach((element) => {
if (element.name == "packageProblemList") {
element.selectedList = []
element.selectedStr = ''
element.optionList = element.optionList.map((option) => {
option.active = false;
packageProblemList.map((item) => {
if (option.confId == item) {
option.active = true;
element.selectedList.push(option)
}
});
return option;
});
element.selectedStr = element.selectedList?.map(v => { return v.confName })?.join(';')
return element
}
});
// }
......@@ -479,15 +483,20 @@ Page({
skillProblemList = skillProblemList || [];
formData.forEach((element) => {
if (element.name == "skillProblemList") {
element.selectedList = []
element.selectedStr = ''
element.optionList = element.optionList.map((option) => {
option.active = false;
skillProblemList.map((item) => {
if (option.confId == item) {
option.active = true;
element.selectedList.push(option)
}
});
return option;
});
element.selectedStr = element.selectedList?.map(v => { return v.confName })?.join(';')
return element
}
});
// }
......
......@@ -10,7 +10,7 @@
</view>
</view>
</navigation-bar>
<view style="margin-top:{{ statusBarHeight }}px">
<view style="margin-top:{{ navBarHeight }}px">
<weekCalendar timeBean="{{ timeBean }}" bind:lastWeek="lastWeek" bind:nextWeek="nextWeek" bind:dayClick="dayClick"></weekCalendar>
</view>
<view class="main {{ isFullSucreen?'isFullSucreen':'' }}">
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!