hookehuyr

refactor(页面配置): 更新应用名称并优化日期选择器初始化逻辑

将应用名称从"静待花开-活动小助手"统一更新为"智院三仟"
修复日期选择器初始化问题,确保时间戳有效并设置默认值
/*
* @Date: 2022-09-19 14:11:06
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2022-10-28 13:02:23
* @LastEditTime: 2025-08-18 22:03:46
* @FilePath: /swx/src/pages/_index/index.config.js
* @Description: 文件描述
*/
export default {
navigationBarTitleText: '静待花开-活动小助手',
navigationBarTitleText: '智院三仟',
usingComponents: {
},
}
......
<!--
* @Date: 2022-09-21 16:04:10
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2022-12-08 10:21:46
* @LastEditTime: 2025-08-18 22:11:06
* @FilePath: /swx/src/pages/createActivity/index.vue
* @Description: 创建活动页面
-->
......@@ -432,9 +432,14 @@ onMounted(async () => {
updateActivityInfo(data);
}
} else {
// 新建活动时设置默认时间
defaultActivityTime = getTime("min", 1);
defaultStartTime = getTime("min", 1);
defaultEndTime = getTime("min", 1);
// 初始化日期选择器的值
currentActivityDate.value = getTime("min", 1).getTime();
currentBeginDate.value = getTime("min", 1).getTime();
currentEndDate.value = getTime("min", 1).getTime();
}
nextTick(() => {
setTimeout(() => {
......@@ -568,13 +573,17 @@ const reg_end_time = ref('');
const show_activity_time = ref(false);
const show_reg_begin_time = ref(false);
const show_reg_end_time = ref(false);
let currentActivityDate = new Date().getTime()
let currentBeginDate = new Date().getTime()
let currentEndDate = new Date().getTime()
// 确保传入的是有效的时间戳
let currentActivityDate = ref(new Date().getTime())
let currentBeginDate = ref(new Date().getTime())
let currentEndDate = ref(new Date().getTime())
const onActivityConfirm = ({ detail }) => {
currentActivityDate = detail;
// 确保 detail 是有效的时间戳
if (detail && !isNaN(detail)) {
currentActivityDate.value = detail;
activity_time.value = moment(detail).format('YYYY-MM-DD HH:mm')
}
show_activity_time.value = false;
}
const onActivityCancel = () => {
......@@ -582,8 +591,11 @@ const onActivityCancel = () => {
}
const onBeginConfirm = ({ detail }) => {
currentBeginDate = detail;
// 确保 detail 是有效的时间戳
if (detail && !isNaN(detail)) {
currentBeginDate.value = detail;
reg_begin_time.value = moment(detail).format('YYYY-MM-DD HH:mm')
}
show_reg_begin_time.value = false;
}
const onBeginCancel = () => {
......@@ -591,8 +603,11 @@ const onBeginCancel = () => {
}
const onEndConfirm = ({ detail }) => {
currentEndDate = detail;
// 确保 detail 是有效的时间戳
if (detail && !isNaN(detail)) {
currentEndDate.value = detail;
reg_end_time.value = moment(detail).format('YYYY-MM-DD HH:mm')
}
show_reg_end_time.value = false;
}
const onEndCancel = () => {
......@@ -916,6 +931,10 @@ const updateActivityInfo = async ({ activity, host }) => {
reg_begin_time.value = moment(activity.reg_begin_time).format('YYYY-MM-DD HH:mm');
// 结束时间
reg_end_time.value = moment(activity.reg_end_time).format('YYYY-MM-DD HH:mm');
// 设置日期选择器的当前值
currentActivityDate.value = new Date(activity.activity_time).getTime();
currentBeginDate.value = new Date(activity.reg_begin_time).getTime();
currentEndDate.value = new Date(activity.reg_end_time).getTime();
// 默认弹框活动时间
defaultActivityTime = formatInfoDate(activity.activity_time);
defaultStartTime = formatInfoDate(activity.reg_begin_time);
......
/*
* @Date: 2022-09-19 14:11:06
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2022-10-28 13:02:27
* @LastEditTime: 2025-08-18 22:03:38
* @FilePath: /swx/src/pages/index/index.config.js
* @Description: 文件描述
*/
export default {
navigationBarTitleText: '静待花开-活动小助手',
navigationBarTitleText: '智院三仟',
usingComponents: {
},
enableShareAppMessage: true
......
......@@ -197,7 +197,7 @@ export default {
onShareAppMessage(options) {
// 设置菜单中的转发按钮触发转发事件时的转发内容
var shareObj = {
title: "静待花开-活动小助手", // 默认是小程序的名称(可以写slogan等)
title: "智院三仟", // 默认是小程序的名称(可以写slogan等)
path: 'pages/index/index', // 默认是当前页面,必须是以‘/'开头的完整路径
imageUrl: '', //自定义图片路径,可以是本地文件路径、代码包文件路径或者网络图片路径,支持PNG及JPG,不传入 imageUrl 则使用默认截图。显示图片长宽比是 5:4
success: function (res) {
......