Xiao_123 il y a 1 mois
Parent
commit
8d0f9af42f
2 fichiers modifiés avec 14 ajouts et 19 suppressions
  1. 2 9
      pages/drawLots/fortune.vue
  2. 12 10
      pages/drawLots/index.vue

+ 2 - 9
pages/drawLots/fortune.vue

@@ -101,7 +101,6 @@ const colorDict = {
 	'黄': '#FDD835'
 }
 
-const inputType = ref('text')
 const isEdit = ref(false)
 const date = ref(null)
 const notes = ref(null) // 手账内容
@@ -142,7 +141,6 @@ const getCalendarData = async (month_key) => {
     // 没有手账记录的时候,默认为编辑状态展示输入框
     if (!journal.value?.notes) {
       isEdit.value = true
-      inputType.value = 'text'
     }
 	} catch {}
 }
@@ -181,17 +179,11 @@ onUnload(async () => {
 
 const handleUpdateJournal = () => {
   isEdit.value = true
-  inputType.value = 'textarea'
   notes.value = journal.value?.notes || ''
 }
 
-const handleInput = () => {
-  if (!notes.value) inputType.value = 'textarea'
-}
-
 const handleCancel = () => {
   isEdit.value = !journal.value?.notes ? true : false
-  inputType.value = 'text'
   notes.value = null
 }
 
@@ -250,7 +242,8 @@ const handleSubmit = async () => {
     await saveCalendarRecord(params)
     uni.showToast({ title: '保存成功', icon: 'none', duration: 2000 })
     disabled.value = false
-    handleCancel()
+    isEdit.value = false
+		notes.value = null
     getCalendarData(date.value.slice(0, 7))
   } catch {
     disabled.value = false

+ 12 - 10
pages/drawLots/index.vue

@@ -1,15 +1,17 @@
 <template>
   <layout-page>
-		<Calendar
-			:date="date"
-			class="uni-calendar--hook"
-			:selected="selected"
-			:lunar="true"
-			:range="false"
-			:showMonth="true"
-			@change="handleChange"
-			@monthSwitch="handleMonthSwitch"
-		/>
+		<view style="background-color: #edf2fa; height: 100vh;">
+			<Calendar
+				:date="date"
+				class="uni-calendar--hook"
+				:selected="selected"
+				:lunar="true"
+				:range="false"
+				:showMonth="true"
+				@change="handleChange"
+				@monthSwitch="handleMonthSwitch"
+			/>
+		</view>
 	</layout-page>
 </template>