Commit 3fbafc18 authored by Zhang Xiaojie's avatar Zhang Xiaojie

Merge branch 'dev' of gitlab.33.cn:CassiniatSaturn/fns_backend into dev

parents c6ad3e25 c28b039a
...@@ -20,6 +20,27 @@ export function transfterStrToDate(str: string) { ...@@ -20,6 +20,27 @@ export function transfterStrToDate(str: string) {
end = `${d.getFullYear()} ${d.getMonth() + 1} ${d.getDate()} ${end}` end = `${d.getFullYear()} ${d.getMonth() + 1} ${d.getDate()} ${end}`
const startDate = new Date(start) const startDate = new Date(start)
const endDate = new Date(end) const endDate = new Date(end)
console.log(start,'start');
return [startDate, endDate]
} else {
return undefined
}
}
// 早上9:00 下午17:00
export function transfterStrToDateSafari(str: string) {
const arr = str.split(' ')
if (arr.length === 2) {
let [start, end] = arr
start = start.replace(':', ':').replace('早上', '').replace('下午', '')
end = end.replace(':', ':').replace('早上', '').replace('下午', '')
const d = new Date()
start = `${d.getFullYear()}/${d.getMonth() + 1}/${d.getDate()} ${start}`
end = `${d.getFullYear()}/${d.getMonth() + 1}/${d.getDate()} ${end}`
const startDate = new Date(start)
const endDate = new Date(end)
console.log(start,'start');
console.log(end,'end');
return [startDate, endDate] return [startDate, endDate]
} else { } else {
return undefined return undefined
......
...@@ -470,6 +470,7 @@ import transferTimeStampToMoment, { ...@@ -470,6 +470,7 @@ import transferTimeStampToMoment, {
getOpeningHoursFromMoment, getOpeningHoursFromMoment,
getWeekendStatusFromArr, getWeekendStatusFromArr,
transfterStrToDate, transfterStrToDate,
transfterStrToDateSafari
} from "@/utils/time/transfer"; } from "@/utils/time/transfer";
import { getSelfOutLet } from "@/utils/outlet/index"; import { getSelfOutLet } from "@/utils/outlet/index";
import { getUserMsg } from "@/utils/userMsg/userMsg"; import { getUserMsg } from "@/utils/userMsg/userMsg";
...@@ -619,7 +620,6 @@ export default Vue.extend({ ...@@ -619,7 +620,6 @@ export default Vue.extend({
modalType: undefined as undefined | eModalType, modalType: undefined as undefined | eModalType,
dataSource: [] as any[], dataSource: [] as any[],
start:'', start:'',
end:'',
}; };
}, },
async mounted() { async mounted() {
...@@ -781,7 +781,11 @@ export default Vue.extend({ ...@@ -781,7 +781,11 @@ export default Vue.extend({
this.formData.openDays.push("6"); this.formData.openDays.push("6");
this.formData.openDays.push("7"); this.formData.openDays.push("7");
} }
const arr2 = transfterStrToDate(record.opening_hours); // const arr2 = transfterStrToDate(record.opening_hours);
const arr2 = transfterStrToDateSafari(record.opening_hours);
console.log(transfterStrToDate(record.opening_hours),'transfterStrToDate');
console.log(arr2,'arr2');
if (arr2?.length === 2) { if (arr2?.length === 2) {
const [startDate, endDate] = arr2; const [startDate, endDate] = arr2;
...@@ -794,18 +798,17 @@ export default Vue.extend({ ...@@ -794,18 +798,17 @@ export default Vue.extend({
const endm=endDate.getMinutes()<10? '0'+endDate.getMinutes():endDate.getMinutes()+'' const endm=endDate.getMinutes()<10? '0'+endDate.getMinutes():endDate.getMinutes()+''
const start=starh+':'+starm const start=starh+':'+starm
const end=endh+':'+endm const end=endh+':'+endm
this.start=start this.formData.startTime = moment(start,"HH:mm")
this.end=end this.formData.endTime = moment(end,"HH:mm")
this.formData.startTime = moment(this.start,"HH:mm") console.log(typeof start,'start');
this.formData.endTime = moment(this.end,"HH:mm") console.log(end,'end');
console.log(this.formData.startTime,'this.formData.startTime');
console.log(this.start,'this.start');
console.log(startDate,'startDate');
const riqi=moment(startDate,"HH:mm")
console.log(riqi,'riqi');
console.log(startDate,'startDate');
console.log(starh,'starh');
console.log(arr2,'arr2');
console.log(arr2[0],'0');
} }
const ret = await AddressService.getInstance().note(record.id); const ret = await AddressService.getInstance().note(record.id);
......
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