You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
47 lines
836 B
47 lines
836 B
const db = wx.cloud.database().collection("user_Data");
|
|
|
|
Page({
|
|
//页面数据
|
|
data:{
|
|
birthday: "",
|
|
region:"",
|
|
},
|
|
|
|
//表单提交方法
|
|
submit: function(e){
|
|
console.log(e.detail.value);
|
|
//todo: 添加输入检测
|
|
|
|
//往数据库里插入的方法
|
|
db.add({
|
|
//传入数据
|
|
data: e.detail.value,
|
|
//成功后执行的方法
|
|
success:(res) => {
|
|
console.log(res)
|
|
}
|
|
})
|
|
},
|
|
|
|
//跳转至教师信息页面
|
|
navigateToPageTpro: function() {
|
|
wx.navigateTo({
|
|
url: '/pages/Tprofile/Tprofile',
|
|
})
|
|
},
|
|
|
|
//更新页面的生日信息
|
|
dateChange: function(e){
|
|
this.setData({
|
|
birthday: e.detail.value,
|
|
});
|
|
},
|
|
|
|
//更新页面的地区信息
|
|
regionChange: function(e){
|
|
this.setData({
|
|
region: e.detail.value,
|
|
});
|
|
}
|
|
|
|
}); |