commit
b8d89aac7e
@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"permissions": {
|
||||||
|
"openapi": [
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,9 @@
|
|||||||
|
const saveProfile = require('./saveProfile/index')
|
||||||
|
|
||||||
|
// 云函数入口函数
|
||||||
|
exports.main = async (event, context) => {
|
||||||
|
switch (event.type) {
|
||||||
|
case 'saveProfile':
|
||||||
|
return await getProfile.main(event, context);
|
||||||
|
}
|
||||||
|
};
|
@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
"name": "db",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"description": "",
|
||||||
|
"main": "index.js",
|
||||||
|
"scripts": {
|
||||||
|
"test": "echo \"Error: no test specified\" && exit 1"
|
||||||
|
},
|
||||||
|
"author": "",
|
||||||
|
"license": "ISC",
|
||||||
|
"dependencies": {
|
||||||
|
"wx-server-sdk": "latest"
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"permissions": {
|
||||||
|
"openapi": [
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,9 @@
|
|||||||
|
const saveProfile = require('./saveProfile/index')
|
||||||
|
|
||||||
|
// 云函数入口函数
|
||||||
|
exports.main = async (event, context) => {
|
||||||
|
switch (event.type) {
|
||||||
|
case 'saveProfile':
|
||||||
|
return await saveProfile.main(event, context);
|
||||||
|
}
|
||||||
|
};
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
"name": "db",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"description": "",
|
||||||
|
"main": "index.js",
|
||||||
|
"scripts": {
|
||||||
|
"test": "echo \"Error: no test specified\" && exit 1"
|
||||||
|
},
|
||||||
|
"author": "",
|
||||||
|
"license": "ISC",
|
||||||
|
"dependencies": {
|
||||||
|
"wx-server-sdk": "latest"
|
||||||
|
}
|
||||||
|
}
|
@ -1,4 +1,83 @@
|
|||||||
|
const db = wx.cloud.database().collection("teacher_Data")
|
||||||
|
|
||||||
// pages/Tprofile/Tprofile.js
|
// pages/Tprofile/Tprofile.js
|
||||||
Page({
|
Page({
|
||||||
|
<<<<<<< HEAD
|
||||||
|
|
||||||
|
=======
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面的初始数据
|
||||||
|
*/
|
||||||
|
data: {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
submit: (e)=> {
|
||||||
|
console.log(e.detail.value)
|
||||||
|
|
||||||
|
db.add({
|
||||||
|
data: e.detail.value,
|
||||||
|
success: (res) => {
|
||||||
|
console.log(res)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面加载
|
||||||
|
*/
|
||||||
|
onLoad(options) {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面初次渲染完成
|
||||||
|
*/
|
||||||
|
onReady() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面显示
|
||||||
|
*/
|
||||||
|
onShow() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面隐藏
|
||||||
|
*/
|
||||||
|
onHide() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面卸载
|
||||||
|
*/
|
||||||
|
onUnload() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面相关事件处理函数--监听用户下拉动作
|
||||||
|
*/
|
||||||
|
onPullDownRefresh() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面上拉触底事件的处理函数
|
||||||
|
*/
|
||||||
|
onReachBottom() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户点击右上角分享
|
||||||
|
*/
|
||||||
|
onShareAppMessage() {
|
||||||
|
|
||||||
|
}
|
||||||
|
>>>>>>> 6015f30e13144ccd1fb5bbdf8627e332769439a1
|
||||||
})
|
})
|
@ -1,26 +1,47 @@
|
|||||||
|
const db = wx.cloud.database().collection("user_Data");
|
||||||
|
|
||||||
Page({
|
Page({
|
||||||
|
//页面数据
|
||||||
data:{
|
data:{
|
||||||
date:"",
|
birthday: "",
|
||||||
region:"",
|
region:"",
|
||||||
},
|
},
|
||||||
submit:function(e){
|
|
||||||
console.log(e);
|
//表单提交方法
|
||||||
|
submit: function(e){
|
||||||
|
console.log(e.detail.value);
|
||||||
|
//todo: 添加输入检测
|
||||||
|
|
||||||
|
//往数据库里插入的方法
|
||||||
|
db.add({
|
||||||
|
//传入数据
|
||||||
|
data: e.detail.value,
|
||||||
|
//成功后执行的方法
|
||||||
|
success:(res) => {
|
||||||
|
console.log(res)
|
||||||
|
}
|
||||||
|
})
|
||||||
},
|
},
|
||||||
goToPageTpro: function() {
|
|
||||||
|
//跳转至教师信息页面
|
||||||
|
navigateToPageTpro: function() {
|
||||||
wx.navigateTo({
|
wx.navigateTo({
|
||||||
url: '/pages/Tprofile/Tprofile',
|
url: '/pages/Tprofile/Tprofile',
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
dateChange:function(e){
|
|
||||||
|
//更新页面的生日信息
|
||||||
|
dateChange: function(e){
|
||||||
this.setData({
|
this.setData({
|
||||||
date:e.detail.value,
|
birthday: e.detail.value,
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
regionChange:function(e){
|
|
||||||
|
//更新页面的地区信息
|
||||||
|
regionChange: function(e){
|
||||||
this.setData({
|
this.setData({
|
||||||
region:e.detail.value,
|
region: e.detail.value,
|
||||||
});
|
});
|
||||||
},
|
}
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
Loading…
Reference in new issue