|
@@ -186,18 +186,20 @@ export default {
|
|
|
methods: {
|
|
|
// 判断是否是周一到周五 8点半到下午5点半 这段时间
|
|
|
isWeekday() {
|
|
|
- const now = new Date();
|
|
|
- const weekday = now.getDay(); // 0-6 0代表周日
|
|
|
- const hour = now.getHours(); // 0-23
|
|
|
- const minute = now.getMinutes(); // 0-59
|
|
|
- console.log(weekday, hour, minute);
|
|
|
- // 检查是否在周一到周五,且时间在 8:30 到 17:30 之间
|
|
|
- if (weekday >= 1 && weekday <= 5) {
|
|
|
- const totalMinutes = hour * 60 + minute;
|
|
|
- const startMinutes = 8 * 60 + 30;
|
|
|
- const endMinutes = 17 * 60 + 30;
|
|
|
- console.log(totalMinutes, startMinutes, endMinutes, totalMinutes >= startMinutes && totalMinutes <= endMinutes);
|
|
|
- return totalMinutes >= startMinutes && totalMinutes <= endMinutes;
|
|
|
+ if (this.lang == "cn") {
|
|
|
+ const now = new Date();
|
|
|
+ const weekday = now.getDay(); // 0-6 0代表周日
|
|
|
+ const hour = now.getHours(); // 0-23
|
|
|
+ const minute = now.getMinutes(); // 0-59
|
|
|
+ console.log(weekday, hour, minute);
|
|
|
+ // 检查是否在周一到周五,且时间在 8:30 到 17:30 之间
|
|
|
+ if (weekday >= 1 && weekday <= 5) {
|
|
|
+ const totalMinutes = hour * 60 + minute;
|
|
|
+ const startMinutes = 8 * 60 + 30;
|
|
|
+ const endMinutes = 17 * 60 + 30;
|
|
|
+ console.log(totalMinutes, startMinutes, endMinutes, totalMinutes >= startMinutes && totalMinutes <= endMinutes);
|
|
|
+ return totalMinutes >= startMinutes && totalMinutes <= endMinutes;
|
|
|
+ }
|
|
|
}
|
|
|
return false;
|
|
|
},
|
|
@@ -253,7 +255,10 @@ export default {
|
|
|
postSubmit() {
|
|
|
if (this.verification()) {
|
|
|
this.fullscreenLoading = true;
|
|
|
- this.$api.post("message/submit", this.form).then(res => {
|
|
|
+ this.$api.post("message/submitCommon", {
|
|
|
+ ...this.form,
|
|
|
+ source: 10
|
|
|
+ }).then(res => {
|
|
|
if (res.code == 0) {
|
|
|
this.$message({
|
|
|
message: this.$t("input.YourMessage"),
|