根据接口修改

This commit is contained in:
2025-09-22 10:56:24 +08:00
parent ad4d9323ad
commit 76746682fa
16 changed files with 39 additions and 30 deletions

View File

@@ -18,7 +18,8 @@ Component({
numberProps: String,
idProps: String,
meter: String,
park: String
park: String,
routeId: String,
},
observers: {
"timeProps": function(newValue) {
@@ -33,9 +34,6 @@ Component({
number: newValue
})
},
"idProps": function(newValue) {
console.log("new id", newValue)
}
},
/**
* 组件的初始数据
@@ -70,13 +68,13 @@ Component({
})
},
async onSubmit() {
const { time, number, idProps, park, meter, timeProps } = this.data;
const { time, number, idProps, park, meter, timeProps, routeId } = this.data;
if (time == null || number == null) {
alertInfo("请正确填写后保存")
return;
}
if (!idProps) {
const { code, message } = await createReading(park, meter, {
const { code, message } = await createReading(park, meter, routeId, {
overall: `${number}`,
flat: `${number}`,
readAt: time,

View File

@@ -19,11 +19,13 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad(options) {
const { meter, park } = options;
console.log("options", options)
const { meter, park, routeId } = options;
const that = this;
this.setData({
meter,
park
park,
routeId,
}, () => {
that.refresh();
})
@@ -92,7 +94,6 @@ Page({
},
handleUpdate(e) {
const { data } = e.currentTarget.dataset;
console.log("data", data);
this.setData({
title: "编辑记录",
visible: true,
@@ -101,8 +102,6 @@ Page({
id: data.id,
readAtTimestamp: data.readAtTimestamp,
type: "edit",
}, () => {
console.log("this.data---------", this.data)
})
},
handleDelete(e) {

View File

@@ -57,4 +57,5 @@
meter="{{meter}}"
bind:ok="onEditFinish"
startTime="{{startTime}}"
routeId="{{routeId}}"
/>