根据接口修改
This commit is contained in:
@@ -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,
|
||||
|
@@ -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) {
|
||||
|
@@ -57,4 +57,5 @@
|
||||
meter="{{meter}}"
|
||||
bind:ok="onEditFinish"
|
||||
startTime="{{startTime}}"
|
||||
routeId="{{routeId}}"
|
||||
/>
|
Reference in New Issue
Block a user