support change type

This commit is contained in:
Timi
2025-12-11 00:46:11 +08:00
parent 2cb8f16ccc
commit 861ae8baff
8 changed files with 54 additions and 5 deletions

View File

@ -3,6 +3,7 @@ import Events from "../../../utils/Events";
import Time from "../../../utils/Time";
import Toolkit from "../../../utils/Toolkit";
import config from "../../../config/index";
import { JournalType } from "../../../types/Journal";
enum MediaItemType {
IMAGE,
@ -28,6 +29,7 @@ interface JournalEditorData {
idea: string;
date: string;
time: string;
type: JournalType;
mediaList: MediaItem[];
location?: Location;
qqMapSDK?: any;
@ -39,6 +41,7 @@ Page({
idea: "",
date: "2025-06-28",
time: "16:00",
type: JournalType.NORMAL,
mediaList: [],
location: undefined,
submitText: "提交",
@ -97,6 +100,10 @@ Page({
});
});
},
onChangeType(e: any) {
const { value } = e.detail;
this.setData({ type: value });
},
async chooseLocation() {
const location = await wx.chooseLocation({});
this.setData({
@ -276,13 +283,13 @@ Page({
Key: wx.getStorageSync("key")
},
data: {
type: "NORMAL",
idea: this.data.idea,
createdAt: Date.parse(`${this.data.date} ${this.data.time}`),
type: this.data.type,
lat: this.data.location?.lat,
lng: this.data.location?.lng,
location: this.data.location?.text,
pusher: openId,
createdAt: Date.parse(`${this.data.date} ${this.data.time}`),
tempFileIds
},
success: async (resp: any) => {