parent
0813bb0911
commit
e6d478ebfe
@ -0,0 +1,19 @@
|
|||||||
|
// 云函数入口文件
|
||||||
|
const cloud = require('wx-server-sdk')
|
||||||
|
|
||||||
|
|
||||||
|
cloud.init({ env: cloud.DYNAMIC_CURRENT_ENV }) // 使用当前云环境
|
||||||
|
|
||||||
|
// 云函数入口函数
|
||||||
|
exports.main = async (event, context) => {
|
||||||
|
const wxContext = cloud.getWXContext()
|
||||||
|
|
||||||
|
if (event.op == "")
|
||||||
|
|
||||||
|
return {
|
||||||
|
event,
|
||||||
|
openid: wxContext.OPENID,
|
||||||
|
appid: wxContext.APPID,
|
||||||
|
unionid: wxContext.UNIONID,
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"permissions": {
|
||||||
|
"openapi": [
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,21 @@
|
|||||||
|
// 云函数入口文件
|
||||||
|
const cloud = require('wx-server-sdk')
|
||||||
|
|
||||||
|
cloud.init({ env: cloud.DYNAMIC_CURRENT_ENV }) // 使用当前云环境
|
||||||
|
const db = wx.cloud.database().collection("orders")
|
||||||
|
const wxContext = cloud.getWXContext()
|
||||||
|
|
||||||
|
// 云函数入口函数
|
||||||
|
exports.main = async () => {
|
||||||
|
|
||||||
|
const result;
|
||||||
|
db.where({
|
||||||
|
_openid: wxContext.OPENID
|
||||||
|
}).get({
|
||||||
|
success: function (res) {
|
||||||
|
result = res
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
return result
|
||||||
|
}
|
@ -0,0 +1,20 @@
|
|||||||
|
// 云函数入口文件
|
||||||
|
// const cloud = require('wx-server-sdk')
|
||||||
|
const get = require("./get")
|
||||||
|
const add = require("./add")
|
||||||
|
|
||||||
|
// cloud.init({ env: cloud.DYNAMIC_CURRENT_ENV }) // 使用当前云环境
|
||||||
|
|
||||||
|
// 云函数入口函数
|
||||||
|
exports.main = async (event, context) => {
|
||||||
|
// const wxContext = cloud.getWXContext()
|
||||||
|
|
||||||
|
if (event.op == "get") {
|
||||||
|
return await get.main();
|
||||||
|
} else if(event.op == "add") {
|
||||||
|
add()
|
||||||
|
//TODO add paramas
|
||||||
|
return
|
||||||
|
}
|
||||||
|
return true
|
||||||
|
}
|
@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
"name": "orders",
|
||||||
|
"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,30 +0,0 @@
|
|||||||
Page({
|
|
||||||
data:{
|
|
||||||
date:"",
|
|
||||||
region:"",
|
|
||||||
},
|
|
||||||
submit:function(e){
|
|
||||||
wx.cloud.database()
|
|
||||||
.collection("homeworks")
|
|
||||||
.add({
|
|
||||||
data: e.detail.value,
|
|
||||||
|
|
||||||
success: (res) =>{
|
|
||||||
console.log(res)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
|
|
||||||
dateChange:function(e){
|
|
||||||
this.setData({
|
|
||||||
date:e.detail.value,
|
|
||||||
});
|
|
||||||
},
|
|
||||||
regionChange:function(e){
|
|
||||||
this.setData({
|
|
||||||
region:e.detail.value,
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
|
|
||||||
});
|
|
@ -1,6 +0,0 @@
|
|||||||
{
|
|
||||||
|
|
||||||
"usingComponents": {
|
|
||||||
"cloud-tip-modal": "/components/cloudTipModal/index"
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,29 +0,0 @@
|
|||||||
<view class="container">
|
|
||||||
<form bindsubmit="submit">
|
|
||||||
|
|
||||||
<view class="form-group">
|
|
||||||
<text>任务标题:</text>
|
|
||||||
<input type="text" name="title" placeholder="请输入任务标题" />
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<view class="form-group">
|
|
||||||
<text>任务内容:</text>
|
|
||||||
<textarea name="details" placeholder="请输入任务内容"></textarea>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<view class="form-group">
|
|
||||||
<text>截止时间:</text>
|
|
||||||
<input name="deadLine" type="datetime-local" />
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<view class="form-group">
|
|
||||||
<text>附件:</text>
|
|
||||||
<button class="btn-attachment">上传附件</button>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
|
|
||||||
<button form-type="submit" class="btn-submit">提交</button>
|
|
||||||
|
|
||||||
</form>
|
|
||||||
</view>
|
|
||||||
|
|
@ -1,32 +0,0 @@
|
|||||||
.container {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.form-group {
|
|
||||||
padding: 10px;
|
|
||||||
margin-bottom: 10px;
|
|
||||||
border-radius: 10px;
|
|
||||||
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
|
||||||
}
|
|
||||||
|
|
||||||
.input {
|
|
||||||
flex: 1;
|
|
||||||
border: none;
|
|
||||||
border-bottom: 2rpx solid #ccc;
|
|
||||||
padding: 10rpx;
|
|
||||||
font-size: 28rpx;
|
|
||||||
outline: none;
|
|
||||||
-webkit-appearance: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.btn-submit {
|
|
||||||
height: 80rpx;
|
|
||||||
background-color: #2677ff;
|
|
||||||
color: #fff;
|
|
||||||
border: none;
|
|
||||||
border-radius: 6rpx;
|
|
||||||
padding: 12rpx 24rpx;
|
|
||||||
font-size: 30rpx;
|
|
||||||
}
|
|
@ -1,63 +1,63 @@
|
|||||||
<view class="body">
|
<view class="body">
|
||||||
|
|
||||||
<view class="button-container">
|
<view class="button-container">
|
||||||
<button bindtap="navigateToPageTpro">教员入驻</button>
|
<button bindtap="navigateToPageTpro">教员入驻</button>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<button class="avatar-wrapper" hover-class="none" open-type="chooseAvatar" bind:chooseavatar="onChooseAvatar">
|
||||||
|
<image class="avatar" src="{{avatarUrl}}"/>
|
||||||
|
</button>
|
||||||
|
|
||||||
|
<form bindsubmit="submit">
|
||||||
|
|
||||||
|
<view class="section">
|
||||||
|
<view class="title">昵称:</view>
|
||||||
|
<input type="nickname" class="input" model:value="{{nickname}}" name="nickname" placeholder="昵称" />
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="section">
|
||||||
|
<view class="title">性别:</view>
|
||||||
|
<radio-group class="mg" name="gender" bindchange="genderChange">
|
||||||
|
<label >
|
||||||
|
<radio value="man" checked="{{gender == 'man'}}"/>
|
||||||
|
男
|
||||||
|
</label>
|
||||||
|
<label >
|
||||||
|
<radio value="woman" checked="{{gender == 'woman'}}"/>
|
||||||
|
女
|
||||||
|
</label>
|
||||||
|
</radio-group>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="section">
|
||||||
|
<view class="title">年龄:</view>
|
||||||
|
<picker bindchange="dateChange" fields="year" model:value="{{birthday}}" mode="date" class="input" name="birthday">
|
||||||
|
<view class="picker">出生年:{{birthday}}</view>
|
||||||
|
</picker>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<button class="avatar-wrapper" hover-class="none" open-type="chooseAvatar" bind:chooseavatar="onChooseAvatar">
|
<view class="section">
|
||||||
<image class="avatar" src="{{avatarUrl}}"></image>
|
<view class="title">地区:</view>
|
||||||
</button>
|
<picker bindchange="regionChange" model:value="{{region}}" mode="region" class="input" name="region">
|
||||||
|
<view class="picker">当前选择:{{region}}</view>
|
||||||
<form bindsubmit="submit">
|
</picker>
|
||||||
|
</view>
|
||||||
<view class="section">
|
|
||||||
<view class="title">昵称:</view>
|
<view class="section">
|
||||||
<input type="nickname" class="input" name="nickname" placeholder="昵称" />
|
<view class="title">可以添加到你的联系方式:</view>
|
||||||
</view>
|
<input type="input" class="input" name="contact" model:value="{{contact}}" placeholder="请输入" />
|
||||||
|
</view>
|
||||||
<view class="section">
|
|
||||||
<view class="title">性别:</view>
|
<view class="section">
|
||||||
<radio-group class="mg" name="gender">
|
<view class="title">你的基本情况:</view>
|
||||||
<label >
|
<input type="input" class="input" name="information" model:value="{{information}}" placeholder="请输入" />
|
||||||
<radio value="man" />
|
</view>
|
||||||
男
|
|
||||||
</label>
|
<view class="area">
|
||||||
<label >
|
<button style="margin:30rpx 0" type="primary"
|
||||||
<radio value="woman" />
|
form-type="submit">提交</button>
|
||||||
女
|
<button style="margin:30rpx 0" type="reset"
|
||||||
</label>
|
form-type="reset">重置</button>
|
||||||
</radio-group>
|
</view>
|
||||||
</view>
|
</form>
|
||||||
|
|
||||||
<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>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<view class="section">
|
|
||||||
<view class="title">地区:</view>
|
|
||||||
<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="请输入" />
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<view class="section">
|
|
||||||
<view class="title">你的基本情况:</view>
|
|
||||||
<input type="input" class="input" name="information" placeholder="请输入" />
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<view class="area">
|
|
||||||
<button style="margin:30rpx 0" type="primary"
|
|
||||||
form-type="submit">提交</button>
|
|
||||||
<button style="margin:30rpx 0" type="reset"
|
|
||||||
form-type="reset">重置</button>
|
|
||||||
</view>
|
|
||||||
</form>
|
|
||||||
</view>
|
</view>
|
Loading…
Reference in new issue