Compare commits

..

91 Commits

Author SHA1 Message Date
wbb c146a86071 1
2 years ago
wbb 171b577d04 1
2 years ago
wbb 8dd116c1f9 11
2 years ago
13285100733@qq.com db5672e391 文档
2 years ago
13285100733@qq.com 26b3dcca1a 文档
2 years ago
wbb 267eb1078b 团队自评
2 years ago
wbb 0d21abda61 Merge branch 'master' of https://bdgit.educoder.net/pu6ej7yq9/git
2 years ago
13285100733@qq.com 61292c1dc6 文档
2 years ago
wbb 3d5c9af3b9 Merge branch 'master' of https://bdgit.educoder.net/pu6ej7yq9/git
2 years ago
wbb b6ff27a67f 视频
2 years ago
p2ap8co46 c7bc479342 Update README.md
2 years ago
p2ap8co46 85f5907625 Update README.md
2 years ago
p2ap8co46 9010fcd280 Update README.md
2 years ago
p2ap8co46 7cc44e84c1 Update README.md
2 years ago
p2ap8co46 4f3c891861 Update README.md
2 years ago
p2ap8co46 3bd6bcdd0b Update README.md
2 years ago
p2ap8co46 e821834d73 Update README.md
2 years ago
wbb e6167419fc 图片
2 years ago
13285100733@qq.com 8202ac1a4f 修改
2 years ago
wbb 1f90d7b002 文档
2 years ago
wbb 3834f7a243 Merge branch 'master' of https://bdgit.educoder.net/pu6ej7yq9/git
2 years ago
wbb 74510c9c74 1
2 years ago
pp3avk64l bb372ef132 Delete 'other/~$0340029-翁冰冰-实践总结报告.docx'
2 years ago
pp3avk64l 2e757da71a Delete 'doc'
2 years ago
pp3avk64l 0762f8160f Add doc
2 years ago
13285100733@qq.com a18e6f83d8 更新
2 years ago
13285100733@qq.com 6c81ad339d Merge branch 'master' of https://bdgit.educoder.net/pu6ej7yq9/git
2 years ago
13285100733@qq.com 99b4a0b153 更新
2 years ago
pp3avk64l 543a9d43cb Delete 'scr/模糊专家系统/frontend/src/translateTag.js'
2 years ago
pp3avk64l 7c4dedbedf Delete 'scr/模糊专家系统/README.pdf'
2 years ago
pp3avk64l 11ae31feae Delete 'scr/模糊专家系统/.gitignore'
2 years ago
pp3avk64l fa0c96ee6b Delete 'scr/模糊专家系统/README.md'
2 years ago
pp3avk64l 286b4bbd61 Delete 'scr/miniprogram-2/project.private.config.json'
2 years ago
pp3avk64l ee0efce9e9 Delete 'model/2.txt'
2 years ago
pp3avk64l 2e60c43993 Delete 'doc/1.txt'
2 years ago
wbb 02dcb5ecaf 代码最最最终版
2 years ago
wbb 62dfcdad82 wbb的实践报告
2 years ago
wbb e88999738c 完善
2 years ago
wbb c9c3a20268 完善
2 years ago
wbb 597a544653 转盘修改
2 years ago
wbb f168aa95d2 11
2 years ago
wbb d37a522905 分类和搜索功能完善
2 years ago
wbb 79dda39119 wxss优化
2 years ago
wbb ee98635253 订单完成
2 years ago
wbb 0c872d31dc 完善
2 years ago
wbb 326cb959a5 确认订单
2 years ago
wbb 7f1a3d870b 付款界面,订单界面
2 years ago
wbb f497da6eb4 1
2 years ago
wbb 170d0265f0 Merge branch 'master' of https://bdgit.educoder.net/pu6ej7yq9/git
2 years ago
wbb 0d3fc6f24e 收货地址
2 years ago
13285100733@qq.com 8f3f10406e 更新
2 years ago
13285100733@qq.com c438f1d167 转盘
2 years ago
wbb ebd507a83b 绑定openid
2 years ago
13285100733@qq.com 2ebc67070f 更新
2 years ago
wbb adce0f5120 定义全局变量,全局可调用openid
2 years ago
wbb 12173f49fc 购物车已通
2 years ago
wbb b7fb4b4510 购物车渲染成功显示,个人主页更新
2 years ago
wbb 3602f7d731 订单页
2 years ago
wbb 56646892c7 购物车数据传输
2 years ago
wbb 59d012b022 Merge branch 'master' of https://bdgit.educoder.net/pu6ej7yq9/git
2 years ago
pmgzcvlfn 4fcfe7135e Merge branch 'master' of https://bdgit.educoder.net/pu6ej7yq9/git
2 years ago
pmgzcvlfn 3008cba563 turning
2 years ago
wbb cc4c93a569 Merge branch 'master' of https://bdgit.educoder.net/pu6ej7yq9/git
2 years ago
wbb 5857d90855 修改
2 years ago
13285100733@qq.com 57fb48c63a 修改
2 years ago
wbb 21b40c1e5f 购物车
2 years ago
13285100733@qq.com 628059f780 Merge branch 'master' of https://bdgit.educoder.net/pu6ej7yq9/git
2 years ago
13285100733@qq.com fd95818be3 合并论坛 增加登录
2 years ago
wbb c438087ed8 个人中心修改
2 years ago
wbb 962fa72523 Merge branch 'master' of https://bdgit.educoder.net/pu6ej7yq9/git
2 years ago
wbb 67244568ad 2022.11.10
2 years ago
wbb 353225e8ea 修改
2 years ago
13285100733@qq.com ec80a7373b Merge branch 'master' of https://bdgit.educoder.net/pu6ej7yq9/git
2 years ago
13285100733@qq.com f4f71bcba8 更新论坛
2 years ago
13285100733@qq.com 6cd9305a24 论坛修改
2 years ago
13285100733@qq.com 60105eef91 11
2 years ago
13285100733@qq.com b007ffd943 论坛
2 years ago
wbb 679202168e 1
2 years ago
wbb dac19b9307 修改,添加转盘
2 years ago
wbb 3ae5644578 修改,添加转盘
2 years ago
13285100733@qq.com 4cffb5d51d 论坛
2 years ago
wbb bf30d45df0 模糊专家系统源码
2 years ago
wbb 40cd019818 前端代码第二次修改
2 years ago
pu6ej7yq9 0c42142c5a Delete 'README.md'
2 years ago
pu6ej7yq9 914ba17ec1 Delete 'mll.txt'
2 years ago
pu6ej7yq9 eff7c44bc0 Delete 'wonderful.txt'
2 years ago
pu6ej7yq9 23c774e898 Delete 'wujiayi.txt'
2 years ago
wbb ff3d3b755d Merge branch 'master' of https://bdgit.educoder.net/pu6ej7yq9/git
2 years ago
wbb 6d01f981b3 doc/1.txt
2 years ago
mll 00dfca7ab8 mll.txt
2 years ago
p9zfaoq3j e37dee744a 123
2 years ago

@ -1,2 +0,0 @@
# git

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 549 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 243 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 130 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 87 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 85 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 98 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 166 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 82 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 237 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 401 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 745 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 174 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 361 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 141 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 482 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 202 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 409 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 120 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 106 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 246 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 118 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 94 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 82 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 122 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 92 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 102 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 101 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 79 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 97 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 72 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 576 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 202 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 72 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

@ -0,0 +1,31 @@
/*
* Eslint config file
* Documentation: https://eslint.org/docs/user-guide/configuring/
* Install the Eslint extension before using this feature.
*/
module.exports = {
env: {
es6: true,
browser: true,
node: true,
},
ecmaFeatures: {
modules: true,
},
parserOptions: {
ecmaVersion: 2018,
sourceType: 'module',
},
globals: {
wx: true,
App: true,
Page: true,
getCurrentPages: true,
getApp: true,
Component: true,
requirePlugin: true,
requireMiniProgram: true,
},
// extends: 'eslint:recommended',
rules: {},
}

@ -0,0 +1,279 @@
# **节时不节食软件系统**
## 软件定位
在当前严峻的疫情影响下,校内食堂是大学生用餐的唯一选择。由于学生用餐时间集中,食堂人流量大,菜品准备时间长以及学生的“选择困难症”等问题使得用餐效率较低。“菜品选择”这一概念提出,在用户点外卖时首先通过“菜品选择”这一途径,替有选择困难的用户做出决定,减少一些不必要的时间。对于年轻的一代的生活节奏和思想观念,“菜品选择”这一软件系统能解决他们不少选择上的难题。
在这个选择多样化的时代,大学生常常面临着“今天吃什么?”的困扰。校内五花八门的餐饮给我们提供了数不清的选项:价格、味道、菜式等等,大学生面对众多选择时会觉得异常困难、难以做出满意的选择。或者大学生在工作学业繁忙之时,需要软件来帮其做出快速选择。有些人心中有许多心仪的选项,于是不断纠结,左右为难摇摆不定;有些人没有特别想吃的菜品,或者吃腻了想换个口味,总想挑到最合适的选项,最后什么也没买。这直接导致了他们决策时间过长,不仅饥肠辘辘,而且心烦意乱,影响生活和情绪。因此,需要寻找一种有效方法来减少大学生的决策时间,帮助他们筛选信息做出选择。
## 软件功能
该系统主要实现登录、自由点单、偏好快速选择、转盘随机选择、论坛购物车和支付七大主要功能,其中通过登录功能实现新用户的注册和老用户的登录;通过论坛功能让用户进行发表帖子、评论讨论等操作;通过自由点单、偏好快速选择和转盘随机选择来确定订单,通过购物车来存储标记的食物信息并跳转支付功能;通过支付功能实现支付和订单信息的回传
## 代码运行
该系统为微信小程序模式以微信为载体实现系统运行硬件要求为能下载并运行微信app。
## 使用说明
### 1.登录
点击登录按钮进行信息授权进行登录
***
### 2.自由点单
在主页面搜索框中搜索食物名称,可以显示食物信息
***
### 3.偏好快速选择
点击主页面的偏好选择按钮进入两个选择页面,在第一页选择食物种类(主食/小吃),在第二页选择口味(香辣/椒麻/香咸/酸甜),页面跳转到确认订单信息
***
### 4.转盘随机选择
点击主页面的随机转盘按钮进入转盘页面,点击开始按钮进行随机选择,选择结束后弹窗提示食物信息
***
### 5.论坛
点击主页面下方的论坛按钮进入论坛,用户可以进行增删查改帖子、点赞评论等操作
***
### 6.购物车
点击主页面下方的购物车进入,在购物车内可以对标记的菜品进行增删查改和选中下单支付操作
***
### 7.支付
通过三种方式确认订单后点击立即支付按钮即可输入支付密码进行支付
***
##代码目录结构
![代码目录]("C:\Users\嘉鸿宝贝\Desktop\图片1.png")
## 云开发 quickstart
这是云开发的快速启动指引,其中演示了如何上手使用云开发的三大基础能力:
- 数据库:一个既可在小程序前端操作,也能在云函数中读写的 JSON 文档型数据库
- 文件存储:在小程序前端直接上传/下载云端文件,在云开发控制台可视化管理
- 云函数:在云端运行的代码,微信私有协议天然鉴权,开发者只需编写业务逻辑代码
####为了适应该系统定义全局变量全局可调用openid我们重写了微信小程序的云函数重写后的云函数代码如下
##### 1.get
``` JavaScript
{
"permissions": {
"openapi": [
]
}
}
{
"permissions": {
"openapi": [
]
}
}
{
"name": "get",
"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"
}
}
```
##### 2.quickstartFunctions
```JavaScript
const cloud = require('wx-server-sdk');
cloud.init({
env: cloud.DYNAMIC_CURRENT_ENV
});
const db = cloud.database();
// 创建集合云函数入口函数
exports.main = async (event, context) => {
try {
// 创建集合
await db.createCollection('sales');
await db.collection('sales').add({
// data 字段表示需新增的 JSON 数据
data: {
region: '华东',
city: '上海',
sales: 11
}
});
await db.collection('sales').add({
// data 字段表示需新增的 JSON 数据
data: {
region: '华东',
city: '南京',
sales: 11
}
});
await db.collection('sales').add({
// data 字段表示需新增的 JSON 数据
data: {
region: '华南',
city: '广州',
sales: 22
}
});
await db.collection('sales').add({
// data 字段表示需新增的 JSON 数据
data: {
region: '华南',
city: '深圳',
sales: 22
}
});
return {
success: true
};
} catch (e) {
// 这里catch到的是该collection已经存在从业务逻辑上来说是运行成功的所以catch返回success给前端避免工具在前端抛出异常
return {
success: true,
data: 'create collection success'
};
}
};
const cloud = require('wx-server-sdk');
cloud.init({
env: cloud.DYNAMIC_CURRENT_ENV
});
// 获取小程序二维码云函数入口函数
exports.main = async (event, context) => {
// 获取小程序二维码的buffer
const resp = await cloud.openapi.wxacode.get({
path: 'pages/index/index'
});
const { buffer } = resp;
// 将图片上传云存储空间
const upload = await cloud.uploadFile({
cloudPath: 'code.png',
fileContent: buffer
});
return upload.fileID;
};
const cloud = require('wx-server-sdk');
cloud.init({
env: "cloud1-8g5wmepxce8a3b8a"
});
// 获取openId云函数入口函数
exports.main = async (event, context) => {
// 获取基础信息
const wxContext = cloud.getWXContext();
return {
openid: wxContext.OPENID,
appid: wxContext.APPID,
unionid: wxContext.UNIONID,
};
};
const cloud = require('wx-server-sdk');
cloud.init({
env: cloud.DYNAMIC_CURRENT_ENV
});
const db = cloud.database();
// 查询数据库集合云函数入口函数
exports.main = async (event, context) => {
// 返回数据库查询结果
return await db.collection('sales').get();
};
const cloud = require('wx-server-sdk');
cloud.init({
env: cloud.DYNAMIC_CURRENT_ENV
});
const db = cloud.database();
const $ = db.command.aggregate;
// 聚合记录云函数入口函数
exports.main = async (event, context) => {
// 返回数据库聚合结果
return db.collection('sales').aggregate()
.group({
_id: '$region',
sum: $.sum('$sales')
})
.end();
};
const cloud = require('wx-server-sdk');
cloud.init({
env: cloud.DYNAMIC_CURRENT_ENV
});
const db = cloud.database();
// 修改数据库信息云函数入口函数
exports.main = async (event, context) => {
try {
// 遍历修改数据库信息
for (let i = 0; i < event.data.length; i++) {
await db.collection('sales').where({
_id: event.data[i]._id
})
.update({
data: {
sales: event.data[i].sales
},
});
}
return {
success: true,
data: event.data
};
} catch (e) {
return {
success: false,
errMsg: e
};
}
};
{
"permissions": {
"openapi": [
"wxacode.get"
]
}
}
const getOpenId = require('./getOpenId/index');
const getMiniProgramCode = require('./getMiniProgramCode/index');
const createCollection = require('./createCollection/index');
const selectRecord = require('./selectRecord/index');
const updateRecord = require('./updateRecord/index');
const sumRecord = require('./sumRecord/index');
// 云函数入口函数
exports.main = async (event, context) => {
switch (event.type) {
case 'getOpenId':
return await getOpenId.main(event, context);
case 'getMiniProgramCode':
return await getMiniProgramCode.main(event, context);
case 'createCollection':
return await createCollection.main(event, context);
case 'selectRecord':
return await selectRecord.main(event, context);
case 'updateRecord':
return await updateRecord.main(event, context);
case 'sumRecord':
return await sumRecord.main(event, context);
}
};
{
"name": "quickstartFunctions",
"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.4.0"
}
}
```
## 参考文档
- [云开发文档](https://developers.weixin.qq.com/miniprogram/dev/wxcloud/basis/getting-started.html)
##结论
本系统能够基本实现一个外卖点餐系统的全部功能,同时能为用户提供两种高效的选择方式,希望能真正帮助大家解决选择困扰,实现节约时间的目的。

@ -0,0 +1,51 @@
// app.js
App({
onLaunch: function () {
if (!wx.cloud) {
console.error('请使用 2.2.3 或以上的基础库以使用云能力');
} else {
wx.cloud.init({
// env 参数说明:
// env 参数决定接下来小程序发起的云开发调用wx.cloud.xxx会默认请求到哪个云环境的资源
// 此处请填入环境 ID, 环境 ID 可打开云控制台查看
// 如不填则使用默认环境(第一个创建的环境)
// env: 'my-env-id',
env:"cloud1-8g5wmepxce8a3b8a",
traceUser: true,
});
}
this.globalData = {};
// 获取用户openid
wx.cloud.callFunction({
name: 'get',
data: {},
success: res => {
this.globalData.openid = res.result.openid
},
fail: err => {
console.error('[云函数] [login] 调用失败', err)
}
})
console.log(this.globalData)
},
getOpenid() {
let that = this;
wx.cloud.callFunction({
name: 'get',
complete: res => {
console.log('openid: ', res.result.openid)
console.log('appid: ', res.result.appid)
// var openid = res.result.openId;
// that.setData({
// openid: openid
// })
}
})
}
})

@ -0,0 +1,73 @@
{
"pages": [
"pages/login/login",
"pages/index/index",
"pages/fourm/fourm",
"pages/submit/submit",
"pages/cart/cart",
"pages/usercenter/usercenter",
"pages/detail/detail",
"pages/searchShow/searchShow",
"pages/change/change",
"pages/answer/answer",
"pages/paying/paying",
"pages/orderlist/orderlist",
"pages/address/address",
"pages/turning/turning",
"pages/addAddress/addAddress",
"pages/myorder/myorder",
"pages/orderdetail/orderdetail",
"pages/searchfood/searchfood",
"pages/select1/select1",
"pages/select2/select2"
],
"tabBar": {
"custom": false,
"backgroundColor": "#ffffff",
"borderStyle": "black",
"list": [
{
"pagePath": "pages/index/index",
"text": "首页",
"iconPath": "/images/home.png",
"selectedIconPath": "/images/home-active.png"
},
{
"pagePath": "pages/fourm/fourm",
"text": "论坛",
"iconPath": "/images/message.png",
"selectedIconPath": "/images/message-active.png"
},
{
"pagePath": "pages/cart/cart",
"text": "购物车",
"iconPath": "/images/message.png",
"selectedIconPath": "/images/message-active.png"
},
{
"pagePath": "pages/usercenter/usercenter",
"text": "我的",
"iconPath": "/images/message.png",
"selectedIconPath": "/images/message-active.png"
}
]
},
"window": {
"backgroundColor": "#F6F6F6",
"backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#F6F6F6",
"navigationBarTitleText": "节时不节食",
"navigationBarTextStyle": "black",
"enablePullDownRefresh": true
},
"networkTimeout": {
"request": 10000,
"downloadFile": 10000
},
"debug": true,
"sitemapLocation": "sitemap.json",
"style": "v2"
}

@ -0,0 +1,160 @@
/**app.wxss**/
.container {
height: 100%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: space-between;
padding: 200rpx 0;
box-sizing: border-box;
}
button {
background: initial;
}
button:focus{
outline: 0;
}
button::after{
border: none;
}
page {
background: #f6f6f6;
display: flex;
flex-direction: column;
justify-content: flex-start;
}
/**app.wxss**/
/* .container {
height: 100%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: space-between;
/*padding: 200rpx 0;*/
/* box-sizing: border-box;
background: #F0F4F3;
} */
.container.withtab{
margin: 105rpx 0 0 0;
/*top: 105rpx;*/
}
.flex-wrp{
display: flex;
}
.flex-tab{
flex-flow: row nowrap;
justify-content: space-around;
align-items: stretch;
}
.flex-item{
flex-grow: 1;
text-align: center;
}
.top-tab{
width: 750rpx;
height: 100rpx;
background: #298DE5;
color: #8CCEFD;
font-size: 28rpx;
line-height: 100rpx;
box-shadow: 0 2px 2px #bebebe;
margin: 0 0 8rpx 0;
position: fixed;
top: 0;
z-index: 9999;
}
.toptab.active{
color: #ffffff;
border-bottom: solid 2px #ffffff;
}
.container{
padding: 0;
font-size: 14rpx;
color: #000;
}
.container .feed-item{
width: 690rpx;
padding: 30rpx 30rpx 20rpx;
margin: 7rpx 0 6rpx 0;
background: #ffffff;
border-top: 1px solid #eee;
border-bottom: 1px solid #eee;
box-shadow: 0 2px 5px #eeeeee;
}
.container .feed-item .feed-source{
width: 690rpx;
left: 0;
height: 50rpx;
}
.container .feed-item .feed-source .avatar{
position: relative;
display: inline-block;
}
.container .feed-item .feed-source a{
display: inline-block;
height: 40rpx;
}
.container .feed-item .feed-source .avatar image{
/*position: absolute;*/
display: inline-block;
width: 45rpx;
height: 45rpx;
border-radius: 45rpx;
top: 10rpx;
vertical-align: middle;
}
.container .feed-item .feed-source text{
/*position: absolute;*/
display: inline-block;
height: 40rpx;
line-height: 40rpx;
vertical-align: middle;
margin: 0 0 0 15rpx;
color: #a0acac;
font-size: 26rpx;
}
.container .feed-item .feed-source .item-more{
display: inline-block;
width: 40rpx;
height: 45rpx;
float: right;
}
.container .feed-item .feed-content{
padding: 10rpx 0 0 0;
}
.container .feed-item .feed-content .question text{
font-size: 28rpx;
font-weight: 600px;
line-height: 40rpx;
word-spacing: 5rpx;
}
.container .feed-item .feed-content .answer-body{
padding: 10rpx 0 0 0;
/*height: 10rpx;*/
font-size: 24rpx;
line-height: 28rpx;
color: #5b5b5b;
}
.container .feed-item .feed-content .answer-actions{
width: 690rpx;
padding: 10rpx 0 0;
color: #a0acac;
}
.container .feed-item .feed-content .answer-actions view{
display: inline-block;
vertical-align: text-bottom;
padding: 0 10rpx 0 0;
font-size: 24rpx;
}
.container .feed-item .feed-content .answer-actions .dot ::after{
content: "•";
}

@ -0,0 +1,6 @@
{
"permissions": {
"openapi": [
]
}
}

@ -0,0 +1,16 @@
// 云函数入口文件
const cloud = require('wx-server-sdk')
cloud.init({ env: cloud.DYNAMIC_CURRENT_ENV }) // 使用当前云环境
// 云函数入口函数
exports.main = async (event, context) => {
const wxContext = cloud.getWXContext()
return {
event,
openid: wxContext.OPENID,
appid: wxContext.APPID,
unionid: wxContext.UNIONID,
}
}

@ -0,0 +1,14 @@
{
"name": "get",
"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"
}
}

@ -0,0 +1,7 @@
{
"permissions": {
"openapi": [
"wxacode.get"
]
}
}

@ -0,0 +1,56 @@
const cloud = require('wx-server-sdk');
cloud.init({
env: cloud.DYNAMIC_CURRENT_ENV
});
const db = cloud.database();
// 创建集合云函数入口函数
exports.main = async (event, context) => {
try {
// 创建集合
await db.createCollection('sales');
await db.collection('sales').add({
// data 字段表示需新增的 JSON 数据
data: {
region: '华东',
city: '上海',
sales: 11
}
});
await db.collection('sales').add({
// data 字段表示需新增的 JSON 数据
data: {
region: '华东',
city: '南京',
sales: 11
}
});
await db.collection('sales').add({
// data 字段表示需新增的 JSON 数据
data: {
region: '华南',
city: '广州',
sales: 22
}
});
await db.collection('sales').add({
// data 字段表示需新增的 JSON 数据
data: {
region: '华南',
city: '深圳',
sales: 22
}
});
return {
success: true
};
} catch (e) {
// 这里catch到的是该collection已经存在从业务逻辑上来说是运行成功的所以catch返回success给前端避免工具在前端抛出异常
return {
success: true,
data: 'create collection success'
};
}
};

@ -0,0 +1,20 @@
const cloud = require('wx-server-sdk');
cloud.init({
env: cloud.DYNAMIC_CURRENT_ENV
});
// 获取小程序二维码云函数入口函数
exports.main = async (event, context) => {
// 获取小程序二维码的buffer
const resp = await cloud.openapi.wxacode.get({
path: 'pages/index/index'
});
const { buffer } = resp;
// 将图片上传云存储空间
const upload = await cloud.uploadFile({
cloudPath: 'code.png',
fileContent: buffer
});
return upload.fileID;
};

@ -0,0 +1,17 @@
const cloud = require('wx-server-sdk');
cloud.init({
env: "cloud1-8g5wmepxce8a3b8a"
});
// 获取openId云函数入口函数
exports.main = async (event, context) => {
// 获取基础信息
const wxContext = cloud.getWXContext();
return {
openid: wxContext.OPENID,
appid: wxContext.APPID,
unionid: wxContext.UNIONID,
};
};

@ -0,0 +1,25 @@
const getOpenId = require('./getOpenId/index');
const getMiniProgramCode = require('./getMiniProgramCode/index');
const createCollection = require('./createCollection/index');
const selectRecord = require('./selectRecord/index');
const updateRecord = require('./updateRecord/index');
const sumRecord = require('./sumRecord/index');
// 云函数入口函数
exports.main = async (event, context) => {
switch (event.type) {
case 'getOpenId':
return await getOpenId.main(event, context);
case 'getMiniProgramCode':
return await getMiniProgramCode.main(event, context);
case 'createCollection':
return await createCollection.main(event, context);
case 'selectRecord':
return await selectRecord.main(event, context);
case 'updateRecord':
return await updateRecord.main(event, context);
case 'sumRecord':
return await sumRecord.main(event, context);
}
};

@ -0,0 +1,14 @@
{
"name": "quickstartFunctions",
"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.4.0"
}
}

@ -0,0 +1,12 @@
const cloud = require('wx-server-sdk');
cloud.init({
env: cloud.DYNAMIC_CURRENT_ENV
});
const db = cloud.database();
// 查询数据库集合云函数入口函数
exports.main = async (event, context) => {
// 返回数据库查询结果
return await db.collection('sales').get();
};

@ -0,0 +1,18 @@
const cloud = require('wx-server-sdk');
cloud.init({
env: cloud.DYNAMIC_CURRENT_ENV
});
const db = cloud.database();
const $ = db.command.aggregate;
// 聚合记录云函数入口函数
exports.main = async (event, context) => {
// 返回数据库聚合结果
return db.collection('sales').aggregate()
.group({
_id: '$region',
sum: $.sum('$sales')
})
.end();
};

@ -0,0 +1,32 @@
const cloud = require('wx-server-sdk');
cloud.init({
env: cloud.DYNAMIC_CURRENT_ENV
});
const db = cloud.database();
// 修改数据库信息云函数入口函数
exports.main = async (event, context) => {
try {
// 遍历修改数据库信息
for (let i = 0; i < event.data.length; i++) {
await db.collection('sales').where({
_id: event.data[i]._id
})
.update({
data: {
sales: event.data[i].sales
},
});
}
return {
success: true,
data: event.data
};
} catch (e) {
return {
success: false,
errMsg: e
};
}
};

@ -0,0 +1,6 @@
const envList = [{"envId":"cloud1-8g5wmepxce8a3b8a","alias":"cloud1"}]
const isMac = false
module.exports = {
envList,
isMac
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 95 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 526 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 82 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 91 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 715 B

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save