parent
d9523c5a1d
commit
41ee8a4f0e
@ -1,6 +0,0 @@
|
||||
{
|
||||
"permissions": {
|
||||
"openapi": [
|
||||
]
|
||||
}
|
||||
}
|
@ -1,9 +0,0 @@
|
||||
const saveProfile = require('./saveProfile/index')
|
||||
|
||||
// 云函数入口函数
|
||||
exports.main = async (event, context) => {
|
||||
switch (event.type) {
|
||||
case 'saveProfile':
|
||||
return await getProfile.main(event, context);
|
||||
}
|
||||
};
|
@ -1,14 +0,0 @@
|
||||
{
|
||||
"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,6 +0,0 @@
|
||||
{
|
||||
"permissions": {
|
||||
"openapi": [
|
||||
]
|
||||
}
|
||||
}
|
@ -1,19 +0,0 @@
|
||||
// 云函数入口文件
|
||||
const cloud = require('wx-server-sdk')
|
||||
|
||||
cloud.init({ env: cloud.DYNAMIC_CURRENT_ENV }) // 使用当前云环境
|
||||
|
||||
//获取老师集合
|
||||
const teacher = cloud.database().collection("teacher_Data")
|
||||
|
||||
// 云函数入口函数
|
||||
exports.main = async (event, context) => {
|
||||
const wxContext = cloud.getWXContext()
|
||||
|
||||
return {
|
||||
event,
|
||||
openid: wxContext.OPENID,
|
||||
appid: wxContext.APPID,
|
||||
unionid: wxContext.UNIONID,
|
||||
}
|
||||
}
|
@ -1,14 +0,0 @@
|
||||
{
|
||||
"name": "recommend",
|
||||
"version": "1.0.0",
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"author": "",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"wx-server-sdk": "~2.6.3"
|
||||
}
|
||||
}
|
@ -1,83 +1,4 @@
|
||||
const db = wx.cloud.database().collection("teacher_Data")
|
||||
|
||||
// pages/Tprofile/Tprofile.js
|
||||
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,48 +1,26 @@
|
||||
const db = wx.cloud.database().collection("user_Data");
|
||||
|
||||
Page({
|
||||
//页面数据
|
||||
data:{
|
||||
avatarUrl: "cloud://cloud1-7gyjwcyfbdf819da.636c-cloud1-7gyjwcyfbdf819da-1321167991/1678762683308.png",
|
||||
birthday: "",
|
||||
date:"",
|
||||
region:"",
|
||||
},
|
||||
|
||||
//表单提交方法
|
||||
submit: function(e){
|
||||
console.log(e.detail.value);
|
||||
//todo: 添加输入检测
|
||||
|
||||
//往数据库里插入的方法
|
||||
db.add({
|
||||
//传入数据
|
||||
data: e.detail.value,
|
||||
//成功后执行的方法
|
||||
success:(res) => {
|
||||
console.log(res)
|
||||
}
|
||||
})
|
||||
submit:function(e){
|
||||
console.log(e);
|
||||
},
|
||||
|
||||
//跳转至教师信息页面
|
||||
navigateToPageTpro: function() {
|
||||
goToPageTpro: function() {
|
||||
wx.navigateTo({
|
||||
url: '/pages/Tprofile/Tprofile',
|
||||
})
|
||||
},
|
||||
|
||||
//更新页面的生日信息
|
||||
dateChange: function(e){
|
||||
dateChange:function(e){
|
||||
this.setData({
|
||||
birthday: e.detail.value,
|
||||
date:e.detail.value,
|
||||
});
|
||||
},
|
||||
|
||||
//更新页面的地区信息
|
||||
regionChange: function(e){
|
||||
regionChange:function(e){
|
||||
this.setData({
|
||||
region: e.detail.value,
|
||||
region:e.detail.value,
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
});
|
@ -1,61 +1,56 @@
|
||||
<view class="body">
|
||||
<view class="button-container" >
|
||||
<button bindtap="navigateToPageTpro">Be a teacher</button>
|
||||
</view>
|
||||
|
||||
<view class="user-avatar">
|
||||
<image src="{{avatarUrl}}" mode="aspectFill"/>
|
||||
</view>
|
||||
|
||||
<form bindsubmit="submit">
|
||||
|
||||
<view class="section">
|
||||
<view class="title">昵称:</view>
|
||||
<input type="nickname" class="input" name="nickname" placeholder="昵称" />
|
||||
</view>
|
||||
<view class="button-container" >
|
||||
<button bindtap="goToPageTpro">Be a teacher</button>
|
||||
</view>
|
||||
|
||||
<view class="section">
|
||||
<view class="title">性别:</view>
|
||||
<radio-group class="mg" name="gender">
|
||||
<label >
|
||||
<radio value="man" />
|
||||
男
|
||||
</label>
|
||||
<label >
|
||||
<radio value="woman" />
|
||||
女
|
||||
</label>
|
||||
</radio-group>
|
||||
</view>
|
||||
<view class="section">
|
||||
<view class="title">昵称:</view>
|
||||
<input type="nickname" class="input"name="nickname"placeholder="昵称" />
|
||||
</view>
|
||||
|
||||
<view class="section">
|
||||
<view class="title">性别:</view>
|
||||
<radio-group class="mg" name="gender">
|
||||
<label >
|
||||
<radio value="nan" />
|
||||
男
|
||||
</label>
|
||||
<label >
|
||||
<radio value="nv" />
|
||||
女
|
||||
</label>
|
||||
</radio-group>
|
||||
</view>
|
||||
|
||||
<view class="section">
|
||||
<view class="title">年龄:</view>
|
||||
<picker bindchange="dateChange" fields="year" value="{{birthday}}" mode="date" class="input" name="birthday">
|
||||
<view class="picker">出生年:{{birthday}}</view>
|
||||
<picker bindchange="dateChange" fields="year" value="{{date}}"mode="date"class="input"name="date">
|
||||
<view class="picker">出生年:{{date}}</view>
|
||||
</picker>
|
||||
</view>
|
||||
|
||||
<view class="section">
|
||||
<view class="title">地区:</view>
|
||||
<picker bindchange="regionChange" value="{{region}}" value="{{region}}"mode="region" class="input" name="region">
|
||||
<picker bindchange="regionChange" value="{{region}}" value="{{region}}"mode="region"class="input"name="region">
|
||||
<view class="picker">当前选择:{{region}}</view>
|
||||
</picker>
|
||||
</view>
|
||||
|
||||
<view class="section">
|
||||
<view class="title">可以添加到你的联系方式:</view>
|
||||
<input type="input" class="input" name="contact" placeholder="请输入" />
|
||||
<input type="input" class="input"name="code"placeholder="昵称" />
|
||||
</view>
|
||||
|
||||
<view class="section">
|
||||
<view class="title">你的基本情况:</view>
|
||||
<input type="input" class="input" name="information" placeholder="请输入" />
|
||||
<input type="input" class="input"name="code"placeholder="昵称" />
|
||||
</view>
|
||||
|
||||
<view class="area">
|
||||
<button style="margin:30rpx 0" type="primary"
|
||||
<button style="margin:30rpx 0"type="primary"
|
||||
form-type="submit">提交</button>
|
||||
<button style="margin:30rpx 0" type="reset"
|
||||
<button style="margin:30rpx 0"type="reset"
|
||||
form-type="submit">重置</button>
|
||||
</view>
|
||||
</form>
|
||||
|
Loading…
Reference in new issue