simply merge and fix some problems

dev
温雍敬 1 year ago
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"
}
}

@ -23,7 +23,7 @@ App({
//尝试读取本地缓存
try {
wx.clearStorage()
// wx.clearStorage()
this.globalData.USERID = wx.getStorageSync('user_id')
this.globalData.OPENID = wx.getStorageSync('user_openid')
} catch (e) {

@ -1,7 +1,6 @@
{
"pages": [
"pages/Main/main",
"pages/msg/msg",
"pages/Profile/profile",
"pages/Tprofile/Tprofile",
"pages/Order/order",

@ -5,14 +5,18 @@ Page({
* 页面的初始数据
*/
data: {
currentTab: 0
currentTab: 0,
orders: []
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
//获取订单信息
wx.cloud.callFunction({
})
},
/**

@ -2,16 +2,15 @@
<!--pages/order/index.wxml-->
<view class="tab">
<view class="tab-item" bindtap="changeTab" data-index="0">已预约</view>
<view class="tab-item" bindtap="changeTab" data-index="1">进行中</view>
<view class="tab-item" bindtap="changeTab" data-index="2">已完成</view>
<view class="tab-item" bindtap="changeTab" data-index="0">未完成</view>
<view class="tab-item" bindtap="changeTab" data-index="1">已完成</view>
</view>
<view class="reserved" wx:if="{{currentTab==0}}">
<view class="content-container">
<image class="image" src="/images/user.png"></image>
<view class="text-container">
<text class="title">已预约订单名称</text>
<text class="title">订单名称{{orderName}}</text>
<view>
<text class="description">
电话号码:{{item.phone}}

@ -31,9 +31,9 @@
line-height: 1.5;
}
.image{
width: 50%;
height: 300rpx;
.content-container > image{
width: 150rpx;
height: 150rpx;
object-fit: cover;
border-radius: 10rpx 0 0 10rpx;
border: 2rpx solid #ccc; /* 添加框线样式 */
@ -47,4 +47,8 @@
background-color: #abdefc;
border-radius: 10rpx;
box-shadow: 0 2rpx 4rpx rgba(0, 0, 0, 0.1);
}
.text-container {
margin-left: 30rpx;
}

@ -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="button-container">
<button bindtap="navigateToPageTpro">教员入驻</button>
</view>
<view class="button-container">
<button bindtap="navigateToPageTpro">教员入驻</button>
</view>
<button class="avatar-wrapper" hover-class="none" open-type="chooseAvatar" bind:chooseavatar="onChooseAvatar">
<image class="avatar" src="{{avatarUrl}}"/>
</button>
<button class="avatar-wrapper" hover-class="none" open-type="chooseAvatar" bind:chooseavatar="onChooseAvatar">
<image class="avatar" src="{{avatarUrl}}"></image>
</button>
<form bindsubmit="submit">
<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="man" />
</label>
<label >
<radio value="woman" />
</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>
</view>
<form bindsubmit="submit">
<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 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 class="section">
<view class="title">地区:</view>
<picker bindchange="regionChange" model: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" model:value="{{contact}}" placeholder="请输入" />
</view>
<view class="section">
<view class="title">你的基本情况:</view>
<input type="input" class="input" name="information" model:value="{{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>
Loading…
Cancel
Save