Browse Source

no message

xiaoxin 1 year ago
parent
commit
816a3cd1de
2 changed files with 10 additions and 10 deletions
  1. 8 8
      pages/home/home.vue
  2. 2 2
      pages/index/index.vue

+ 8 - 8
pages/home/home.vue

@@ -147,6 +147,8 @@ onPullDownRefresh(() => {
 const card_number = ref('')
 // 判断是今天还是明天
 const dateType = ref('今天')
+// 当前年份
+const currentYear = ref('')
 // 当前月份
 const currentMonth = ref('')
 // 当前日期
@@ -208,14 +210,11 @@ const getPathList = async () => {
 // 根据路线查询所有车次
 const getBusList = async (route) => {
 	busList.value = []
-	// 处理时间参数
-	let date = new Date()
-	let year = date.getFullYear()
 
 	const res = await myRequest({
 		url: '/appqueryCarNums.action',
 		data: {
-			date: `${year}-${currentMonth.value}-${currentDay.value}`,
+			date: `${currentYear.value}-${currentMonth.value}-${currentDay.value}`,
 			route: route || currentPath.value,
 			card_number: card_number.value
 		}
@@ -301,13 +300,10 @@ const handleSub = () => {
 
 // 预约请求
 const handleSubscribe = async () => {
-	// 处理时间参数
-	let date = new Date()
-	let year = date.getFullYear()
 	const res = await myRequest({
 		url: '/appmakeAppointment.action',
 		data: {
-			date: `${year}-${currentMonth.value}-${currentDay.value}`,
+			date: `${currentYear.value}-${currentMonth.value}-${currentDay.value}`,
 			card_number: card_number.value,
 			id: currentBusId.value,
 			yyEnd: yy_end.value
@@ -397,15 +393,19 @@ const handleChangeTime = () => {
 // 获取格式化时间 日期 和 星期
 const getTimeFormat = (dayType) => {
 	let date = new Date()
+
 	if (dayType) {
 		let targetday = date.getTime() + 1000 * 60 * 60 * 24
 		date.setTime(targetday)
 	}
+
+	let year = date.getFullYear()
 	let month = (date.getMonth() + 1 + '').padStart(2, '0')
 	let day = (date.getDate() + '').padStart(2, '0')
 	let week = date.getDay()
 	let weekArr = ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六']
 
+	currentYear.value = year
 	currentMonth.value = month
 	currentDay.value = day
 	currentWeek.value = weekArr[week]

+ 2 - 2
pages/index/index.vue

@@ -15,13 +15,13 @@ const APPKEY = '4AA7B3944BDF3739'
 const ocode = '1015730314'
 
 // 线上地址
-// const URL = 'https://chtech.ncjti.edu.cn/carstop/carbook/appopenid.action'
+const URL = 'https://chtech.ncjti.edu.cn/carstop/carbook/appopenid.action'
 
 // 测试地址
 // const URL = 'https://chtech.ncjti.edu.cn/testingServertomcat/carbook/appopenid.action'
 
 // 本地地址
-const URL = 'http://192.168.161.220:8088/carBook/appopenid.action'
+// const URL = 'http://192.168.161.220:8088/carBook/appopenid.action'
 
 onLoad(() => {
 	loginFilter()