|
|
@@ -38,6 +38,17 @@ Page({
|
|
|
chooseData(e) {
|
|
|
console.log('eee1', e, this.data.formData);
|
|
|
},
|
|
|
+ /**
|
|
|
+ * @desc : 处理数据
|
|
|
+ * @author : 姜永辉
|
|
|
+ * @date : 2024/1/26 11:46
|
|
|
+ */
|
|
|
+ handleData() {
|
|
|
+ this.setData({
|
|
|
+ formData: null
|
|
|
+ })
|
|
|
+
|
|
|
+ },
|
|
|
|
|
|
|
|
|
/**
|
|
|
@@ -46,14 +57,8 @@ Page({
|
|
|
* @author : 姜永辉
|
|
|
*/
|
|
|
setParams(params) {
|
|
|
-
|
|
|
- params.cpId = 1
|
|
|
- this.setData({
|
|
|
- formData: params
|
|
|
- })
|
|
|
// 修改之后的 值
|
|
|
console.log('setParams', params)
|
|
|
-
|
|
|
},
|
|
|
|
|
|
/**
|
|
|
@@ -74,14 +79,19 @@ Page({
|
|
|
* @author : 姜永辉
|
|
|
*/
|
|
|
saveData() {
|
|
|
- let params = this.data.formData
|
|
|
- return this.excute(this.data.service, this.data.service.insert, params);
|
|
|
+ return this.excute(this.data.service, this.data.service.insert, this.data.params);
|
|
|
},
|
|
|
|
|
|
/**
|
|
|
* 生命周期函数--监听页面加载
|
|
|
*/
|
|
|
onLoad: function (options) {
|
|
|
-
|
|
|
+ // 接收父页面传递的参数
|
|
|
+ const eventChannel = this.getOpenerEventChannel()
|
|
|
+ let _this = this;
|
|
|
+ eventChannel.on('params', function (data) {
|
|
|
+ // 获取参数
|
|
|
+ console.log("onLoad", data);
|
|
|
+ })
|
|
|
}
|
|
|
})
|