miniprogram

kongweiyu_branch
温雍敬 1 year ago
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,28 +0,0 @@
const cloud = require('wx-server-sdk');
cloud.init({
env: cloud.DYNAMIC_CURRENT_ENV
});
const db = cloud.database();
// 保存个人信息云函数入口函数
exports.main = async (event, context) => {
// 返回数据库结果
return db.collection('user_Data').add({
// data 字段表示需新增的 JSON 数据
data: {
// _id: 'todo-identifiant-aleatoire', // 可选自定义 _id在此处场景下用数据库自动分配的就可以了
user_Name: "learn cloud database",
user_Sex: null,
user_Age: null,
user_Phone: null,
user_Addr: null,
isTeacher: false
},
success: function(res) {
// res 是一个对象,其中有 _id 字段标记刚创建的记录的 id
console.log(res)
}
})
};

@ -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,6 +1,5 @@
<!--pages/Tprofile/Tprofile.wxml-->
<view class="container">
<<<<<<< HEAD
<view class="input-group">
<text>姓名:</text>
<input type="text" placeholder="请输入您的姓名" class="input" />
@ -142,41 +141,3 @@
<!-- 添加提交按钮 -->
<button bindtap="submitForm" class="submit-btn">提交</button>
</view>
=======
<form bindsubmit="submit">
<!-- todo: 修改数据,绑定输入 -->
<view class="form-group">
<text>姓名:</text>
<input type="text" placeholder="请输入您的姓名" />
</view>
<view class="form-group">
<text>手机号码:</text>
<input type="tel" placeholder="请输入您的手机号码" />
</view>
<view class="form-group">
<text>电子邮箱:</text>
<input type="email" placeholder="请输入您的电子邮箱" />
</view>
<view class="form-group">
<text>教师证号:</text>
<input type="text" placeholder="请输入您的教师证号" />
</view>
<view class="form-group">
<text>密码:</text>
<input type="password" placeholder="请输入您的密码" />
</view>
<view class="form-group">
<text>确认密码:</text>
<input type="password" placeholder="请再次输入您的密码" />
</view>
<button class="btn-submit">提交</button>
</form>
</view>
>>>>>>> 6015f30e13144ccd1fb5bbdf8627e332769439a1

@ -20,28 +20,80 @@
<input class="search-input" type="text" placeholder="请输入搜索内容"></input>
<button class="search-button">搜索</button>
</view>
</view>
</view>
<view class="show_information" wx:for="{{[1,2,3,4,5]}}">
<!-- //当每通过一个教员上传的简历信息则创建一个 -->
<view class="content-container">
<image class="image" src="图片地址"></image>
<view class="text-container">
<text class="title">标题</text>
<view>
<text class="description">描述信息</text>
</view>
</view>
</view>
<view class="show_information">
<!-- //当每通过一个教员上传的简历信息则创建一个 -->
<view class="content-container">
<image class="image" src="图片地址"></image>
<view class="text-container">
<text class="title">标题</text>
<view>
<text class="description">描述信息</text>
</view>
</view>
</view>
<view class="button-container">
<button class="button">按钮一</button>
<button class="button">按钮二</button>
</view>
<view class="button-container">
<button class="button">按钮一</button>
<button class="button">按钮二</button>
</view>
</view>
<view class="show_information">
<!-- //当每通过一个教员上传的简历信息则创建一个 -->
<view class="content-container">
<image class="image" src="图片地址"></image>
<view class="text-container">
<text class="title">标题</text>
<view>
<text class="description">描述信息</text>
</view>
</view>
</view>
<view class="button-container">
<button class="button">按钮一</button>
<button class="button">按钮二</button>
</view>
</view>
<view class="show_information">
<!-- //当每通过一个教员上传的简历信息则创建一个 -->
<view class="content-container">
<image class="image" src="图片地址"></image>
<view class="text-container">
<text class="title">标题</text>
<view>
<text class="description">描述信息</text>
</view>
</view>
</view>
<view class="button-container">
<button class="button">按钮一</button>
<button class="button">按钮二</button>
</view>
</view>
<view class="show_information">
<!-- //当每通过一个教员上传的简历信息则创建一个 -->
<view class="content-container">
<image class="image" src="图片地址"></image>
<view class="text-container">
<text class="title">标题</text>
<view>
<text class="description">描述信息</text>
</view>
</view>
</view>
<view class="button-container">
<button class="button">按钮一</button>
<button class="button">按钮二</button>
</view>
</view>
<view class="title" bind:tap="change">{{hello}}</view>
<view class="desc">这里是家教帮平台,再也不用担心孩子的学习了</view>
</view>

@ -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>

@ -6,19 +6,6 @@
height: 200px; /* 适当调整容器的高度 */
}
/* 头像 */
.user-avatar {
display: flex;
justify-content: center;
}
/* 子元素选择器 */
.user-avatar > image {
height: 100px;
width: 100px;
border-radius: 50%;
}
.user-image {
max-width: 10%;
max-height: 10%;
@ -28,7 +15,7 @@
position: relative;
display: flex;
justify-content: flex-end;
align-items: flex-end;
align-items: flex-start;
}
.small-button {

@ -56,5 +56,5 @@
}
},
"description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
"projectname": "miniprogram1"
"projectname": "miniProgram2"
}
Loading…
Cancel
Save