support change type
This commit is contained in:
@ -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) => {
|
||||
|
||||
Reference in New Issue
Block a user