Compare commits

...

No commits in common. 'master' and 'lqz' have entirely different histories.
master ... lqz

@ -0,0 +1 @@
11

@ -1 +1,3 @@
特殊说明代码质量检测是用的微信小程序开发平台自带的工具。所以没有显示代码量。但是总代码量已经超过了10000行。
# campus_leader
polo car
1111112222331

@ -0,0 +1,48 @@
/* pages/test2/test2.wxss */
.recovery_other_line {
display: flex;
line-height: 124rpx;
align-items: center;
justify-content: space-between;
}
.recovery_other_line .upload_img {
width: 36rpx;
height: 36rpx;
}
.recovery_other_line .other_text {
width: 150rpx;
font-size: 28rpx;
color: #000;
}
.choose_upload_view {
flex: 1;
height: 100%;
display: flex;
align-items: center;
justify-content: flex-end;
}
.choose_upload_item {
margin-left: 38rpx;
position: relative;
width: 100rpx;
display: flex;
align-items: center;
}
.choose_upload_view .choose_upload_img {
width: 100rpx;
height: 100rpx;
}
.choose_upload_view .remove_img_icon {
padding: 4rpx;
position:absolute;
top: -15rpx;
right: -13rpx;
width: 28rpx;
height: 28rpx;
border-radius: 50%;
background-color: rgba(0, 0, 0, .5);
}
.other_upload {
margin-left: 15rpx;
width: 80rpx;
}

@ -0,0 +1,50 @@
Page({
// 上传图片
doUpload: function () {
// 选择图片
wx.chooseImage({
count: 1,
sizeType: ['compressed'],
sourceType: ['album', 'camera'],
success: function (res) {
wx.showLoading({
title: '上传中',
})
const filePath = res.tempFilePaths[0]
// 上传图片
const cloudPath = `my-image${filePath.match(/\.[^.]+?$/)[0]}`
wx.cloud.uploadFile({
cloudPath,
filePath,
success: res => {
console.log('[上传文件] 成功:', res)
app.globalData.fileID = res.fileID
app.globalData.cloudPath = cloudPath
app.globalData.imagePath = filePath
wx.navigateTo({
url: '../storageConsole/storageConsole'
})
},
fail: e => {
console.error('[上传文件] 失败:', e)
wx.showToast({
icon: 'none',
title: '上传失败',
})
},
complete: () => {
wx.hideLoading()
}
})
},
fail: e => {
console.error(e)
}
})
}
})

@ -0,0 +1,176 @@
// pages/123/123.js
Page({
/**
* 页面的初始数据
*/
data: {
},
quit1() {
wx.navigateTo({
url: '/pages/index/index',
})
},
test11(){
const db=wx.cloud.database()
const test1=db.collection('student')
test1.add({
data:{
s:this.data.s
}
}).then(res=>{
console.log(res)
}).catch(err=>{
console.log(err)
})
},
Undreaming_Inquire()
{
if(this.Undreaming_CheckData())
{
console.log(this.data.searchKey);
this.Undreaming_GetData();
wx.showLoading({
pingjia: '正在查询中',
mask: true
})
setTimeout(() => {
wx.hideLoading({
complete: (res) => {
this.Undreaming_Results_ShowModal();
},
})
}, 1000);
}
else{
console.log("输入框为空");
}
},
Undreaming_CheckData() {
const key = this.data.searchKey
if (key == '') {
wx.showModal({
content: '输入框不能为空',
contentColor:'#FF556A',
showCancel: false,
confirmText: '确定',
confirmColor: '#FF556A'
})
return false;
}
return true;
},
Undreaming_ChangeSearchKey(e) {
const val = e.detail.value
this.setData({
searchKey: val
})
},
Undreaming_GetData()
{
wx:wx.request({
url: 'http://v.juhe.cn/dream/query',
data:{
key:'4705f6c7303d8753788b53243715455d',
q:this.data.searchKey
},
header: {},
method: 'GET',
dataType: 'json',
responseType: 'text',
success:(res)=>{
console.log(res);
this.setData(
{
Undreaming_Results:res.data.result[0].des
}
)
console.log(this.data.Undreaming_Results);
},
})
},
Undreaming_Results_ShowModal()
{
wx.showModal({
content: this.data.Undreaming_Results,
contentColor:'#dbdbdb',
showCancel: false,
confirmText: '确定',
confirmColor: '#FF556A',
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

@ -0,0 +1,13 @@
<!--pages/123/123.wxml-->
<view class="Undreaming_Body">
<view class="container" >
<view class="search-body">
</view><input type="text" bindinput="Undreaming_ChangeSearchKey" placeholder="请输入评价" confirm-type="search" bindconfirm="test11" />
</view>
<button bindtap="Undreaming_Inquire">提交评论</button>
</view>
<button type="primary" id="button2" bindtap="quit1">退出</button>

@ -0,0 +1,20 @@
<!--pages/add1/add1.wxml-->
<view class="uploader-text" bindtap="doUpload">
<text>上传图片</text>
</view>
/* pages/adlogin/adlogin.wxss */
/* pages/adlogin/adlogin.wxss */
.input{
border: 1px solid gainsboro;
margin: 20rpx;
}
/* pages/add1/add1.wxss */
/**index.wxss**/
.input{
border: 1px solid gainsboro;
margin: 15rpx;
}

@ -0,0 +1,48 @@
/* pages/test2/test2.wxss */
.recovery_other_line {
display: flex;
line-height: 124rpx;
align-items: center;
justify-content: space-between;
}
.recovery_other_line .upload_img {
width: 36rpx;
height: 36rpx;
}
.recovery_other_line .other_text {
width: 150rpx;
font-size: 28rpx;
color: #000
}
.choose_upload_view {
flex: 1;
height: 100%;
display: flex;
align-items: center;
justify-content: flex-end;
}
.choose_upload_item {
margin-left: 38rpx;
position: relative;
width: 100rpx;
display: flex;
align-items: center;
}
.choose_upload_view .choose_upload_img {
width: 100rpx;
height: 100rpx;
}
.choose_upload_view .remove_img_icon {
padding: 4rpx;
position:absolute;
top: -15rpx;
right: -13rpx;
width: 28rpx;
height: 28rpx;
border-radius: 50%;
background-color: rgba(0, 0, 0, .5);
}
.other_upload {
margin-left: 15rpx;
width: 80rpx;
}

@ -0,0 +1,11 @@
<!--pages/test2/test2.wxml-->
<text>输入评价</text>
<text class="textnormal">{{completed}}</text>
<input class="textnormal" bindinput="add1" placeholder="请输入评价" confirm-type="search" bindconfirm="insertdata" />
<view class="uploader-text" bindtap="doUpload">
<text>上传图</text>
</view>
<button type="primary" bindtap="insertdata">确认</button>
<button type="warn" id="button2" bindtap="quit1">退出</button>

@ -79,36 +79,12 @@ Page({
title: '注册成功',
})
wx.navigateTo({
url: '../../pages/manager/manager',
url: '../adlogin/adlogin',
})
},
fail(res) {
console.log('注册失败', res)
}
})
//保存日志(改)
var data = new DataCue();
wx.cloud.database().collection('log').add({
data: {
time: data,
id: account,
operation:'register'
},
success(res) {
console.log('注册成功', res)
wx.showToast({
title: '注册成功',
})
wx.navigateTo({
url: '../adlogin/adlogin',
})
},
fail(res) {
console.log('注册失败', res)
}
})
}
})

@ -17,20 +17,16 @@ Page({
//管理员跳转登录页
guanliyuandenglu() {
wx.navigateTo({
url: '/pages/managerlogin/managerlogin',
url: '/pages/adlogin/adlogin',
})
},
zhuce1() {
wx.navigateTo({
url: '/pages/register/register',
url: '/pages/index1/index1',
})
},
exit() {
wx.navigateTo({
url: '../login',
})
},
/**
* 生命周期函数--监听页面加载
*/

@ -1,6 +1,8 @@
<!--pages/index/index.wxml-->
<text>1111111</text>
<!-- 未登录 -->
<button type="primary" id="button1" bindtap="goto">确认</button>
<button type="primary" id="button2" bindtap="guanliyuandenglu">登录</button>
<button type="primary" id="button3" bindtap="zhuce1">注册</button>
<button type="warn" id = "button4" bindtap = "exit">退出</button>
<button type="warn">退出</button>

@ -56,9 +56,9 @@ Page({
wx.showToast({
title: '登陆成功',
})
wx.navigateTo({
url: '../../pages/checklog/checklog',
})
// wx.navigateTo({
// url: '../home/home?name=' + user.name,
// })
wx.navigateTo({
url: '/pages/me1/me1',
})
@ -76,6 +76,7 @@ Page({
console.log("获取数据失败", res)
}
})
}
})

@ -1,4 +1,5 @@
<!--pages/adlogin/adlogin.wxml-->
<text>pages/adlogin/adlogin.wxml</text>
输入管理员账号
<input class="input" bindinput="getAccount"></input>
输入管理员密码

@ -0,0 +1,14 @@
# Windows
[Dd]esktop.ini
Thumbs.db
$RECYCLE.BIN/
# macOS
.DS_Store
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
# Node.js
node_modules/

@ -0,0 +1,12 @@
# 云开发 quickstart
这是云开发的快速启动指引,其中演示了如何上手使用云开发的三大基础能力:
- 数据库:一个既可在小程序前端操作,也能在云函数中读写的 JSON 文档型数据库
- 文件存储:在小程序前端直接上传/下载云端文件,在云开发控制台可视化管理
- 云函数:在云端运行的代码,微信私有协议天然鉴权,开发者只需编写业务逻辑代码
## 参考文档
- [云开发文档](https://developers.weixin.qq.com/miniprogram/dev/wxcloud/basis/getting-started.html)

@ -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,19 @@
// 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',
traceUser: true,
});
}
this.globalData = {};
}
});

@ -0,0 +1,39 @@
{
"pages": [
"pages/login/login",
"pages/index/index",
"pages/getOpenId/index",
"pages/getMiniProgramCode/index",
"pages/deployService/index",
"pages/createCollection/index",
"pages/uploadFile/index",
"pages/selectRecord/index",
"pages/updateRecord/index",
"pages/updateRecordResult/index",
"pages/updateRecordSuccess/index",
"pages/sumRecord/index",
"pages/sumRecordResult/index",
"pages/school/school",
"pages/canteen/canteen"
],
"window": {
"backgroundColor": "#F6F6F6",
"backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#F6F6F6",
"navigationBarTitleText": "云开发 QuickStart",
"navigationBarTextStyle": "black"
},
"sitemapLocation": "sitemap.json",
"style": "v2",
"plugins": {
"routePlan":{
"version": "1.0.19",
"provider": "wx50b5593e81dd937a"
}
},
"permission": {
"scope.userLocation": {
"desc": "你的位置信息将用于小程序定位"
}
}
}

@ -0,0 +1,27 @@
/**app.wxss**/
.container {
display: flex;
flex-direction: column;
align-items: center;
box-sizing: border-box;
}
button {
background: initial;
}
button:focus{
outline: 0;
}
button::after{
border: none;
}
page {
background: #ffffff;
display: flex;
flex-direction: column;
justify-content: flex-start;
}

@ -0,0 +1,37 @@
// miniprogram/components/cloudTipModal/index.js
const { isMac } = require('../../envList.js');
Component({
/**
* 页面的初始数据
*/
data: {
showUploadTip: false,
tipText: isMac ? 'sh ./uploadCloudFunction.sh' : './uploadCloudFunction.bat'
},
properties: {
showUploadTipProps: Boolean
},
observers: {
showUploadTipProps: function(showUploadTipProps) {
this.setData({
showUploadTip: showUploadTipProps
});
}
},
methods: {
onChangeShowUploadTip() {
this.setData({
showUploadTip: !this.data.showUploadTip
});
},
copyShell() {
wx.setClipboardData({
data: this.data.tipText,
});
},
}
});

@ -0,0 +1,4 @@
{
"usingComponents": {},
"component": true
}

@ -0,0 +1,13 @@
<!--miniprogram/components/cloudTipModal/index.wxml-->
<view class="install_tip" wx:if="{{showUploadTip}}">
<view class="install_tip_back"></view>
<view class="install_tip_detail">
<view class="install_tip_detail_title">体验前需部署云资源</view>
<view class="install_tip_detail_tip">请开启调试器进入终端窗口,复制并运行以下命令</view>
<view class="install_tip_detail_shell">
{{tipText}}
<view bindtap="copyShell" class="install_tip_detail_copy">复制</view>
</view>
<view bindtap="onChangeShowUploadTip" class="install_tip_detail_button">已执行命令</view>
</view>
</view>

@ -0,0 +1,57 @@
.install_tip_back {
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
background-color: rgba(0,0,0,0.4);
z-index: 1;
}
.install_tip_detail {
position: fixed;
background-color: white;
right: 0;
bottom: 0;
left: 0;
top: 60%;
border-radius: 40rpx 40rpx 0 0;
padding: 50rpx;
z-index: 9;
}
.install_tip_detail_title {
font-weight: 400;
font-size: 40rpx;
text-align: center;
}
.install_tip_detail_tip {
font-size: 25rpx;
color: rgba(0,0,0,0.4);
margin-top: 20rpx;
text-align: center;
}
.install_tip_detail_shell {
margin: 70rpx 0;
display: flex;
justify-content: center;
}
.install_tip_detail_copy {
color: #546488;
margin-left: 10rpx;
}
.install_tip_detail_button {
color: #07C160;
font-weight: 500;
background-color: rgba(0,0,0,0.1);
width: 60%;
text-align: center;
height: 90rpx;
line-height: 90rpx;
border-radius: 10rpx;
margin: 0 auto;
}

@ -0,0 +1,6 @@
const envList = [];
const isMac = false;
module.exports = {
envList,
isMac
};

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="8px" height="14px" viewBox="0 0 8 14" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>☀ iOS/☀ 图标/线型/icons_outlined_arrow@3x</title>
<g id="控件" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" fill-opacity="0.3">
<g id="4.列表/z.覆盖层/右边/箭头" transform="translate(-334.000000, -21.000000)" fill="#000000">
<g id="☀-iOS/☀-图标/线型/icons_outlined_arrow" transform="translate(332.000000, 16.000000)">
<path d="M2.45405845,6.58064919 L3.51471863,5.51998901 L9.29361566,11.298886 C9.68374096,11.6890113 9.6872014,12.318069 9.29361566,12.7116547 L3.51471863,18.4905518 L2.45405845,17.4298916 L7.87867966,12.0052704 L2.45405845,6.58064919 Z" id="Combined-Shape"></path>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 906 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 155 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 328 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 181 KiB

@ -0,0 +1,66 @@
// pages/canteen/canteen.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

@ -0,0 +1,2 @@
<!--pages/canteen/canteen.wxml-->
<text>食堂评价</text>

@ -0,0 +1 @@
/* pages/canteen/canteen.wxss */

@ -0,0 +1,10 @@
Page({
/**
* 页面的初始数据
*/
data: {
},
});

@ -0,0 +1,7 @@
<view class="page">
<view class="title">功能介绍</view>
<view class="info">集合为常用数据库中表的概念。云开发数据库支持自动备份、无损回档并且QPS高达3千+。</view>
<view class="title">如何体验</view>
<view class="info">已自动创建名为“sales”的体验合集可打开“云开发控制台>数据库>记录列表”中找到该集合。</view>
<image class="img" src="../../images/database.png"></image>
</view>

@ -0,0 +1,29 @@
page {
background-color: white;
padding-bottom: 50px;
}
.page {
padding: 0 32px;
}
.title {
margin-top: 16px;
font-size: 17px;
font-family: PingFang SC;
font-weight: 500;
color: #000000;
}
.info {
margin-top: 12px;
font-size: 17px;
font-family: PingFang SC;
font-weight: 400;
color: #000000;
}
.img {
margin-top: 16px;
width: 100%;
}

@ -0,0 +1,11 @@
// miniprogram/pages/deployService/index.js
Page({
/**
* 页面的初始数据
*/
data: {
},
});

@ -0,0 +1,10 @@
<!--miniprogram/pages/deployService/index.wxml-->
<view class="page">
<view class="title">功能介绍</view>
<view class="info">云托管是全托管的容器服务,支持任何语言及框架运行,只需将已有业务代码打包上传,即可快速迁移。</view>
<view class="title">如何体验</view>
<view class="info">步骤一:切换按量付费,打开“云开发控制台>设置>环境设置”找到按量付费,点击切换。</view>
<image class="img" src="../../images/deploy_step1.png"></image>
<view class="info">步骤二:开通云托管,体验相关能力</view>
<image class="img" src="../../images/deploy_step2.png"></image>
</view>

@ -0,0 +1,30 @@
/* miniprogram/pages/deployService/index.wxss */
page {
background-color: white;
padding-bottom: 50px;
}
.page {
padding: 0 32px;
}
.title {
margin-top: 16px;
font-size: 17px;
font-family: PingFang SC;
font-weight: 500;
color: #000000;
}
.info {
margin-top: 12px;
font-size: 17px;
font-family: PingFang SC;
font-weight: 400;
color: #000000;
}
.img {
margin-top: 16px;
width: 100%;
}

@ -0,0 +1,53 @@
Page({
/**
* 页面的初始数据
*/
data: {
showUploadTip: false,
haveGetCodeSrc: false,
envId: '',
codeSrc: ''
},
onLoad(options) {
this.setData({
envId: options.envId
});
},
getCodeSrc() {
wx.showLoading({
title: '',
});
wx.cloud.callFunction({
name: 'quickstartFunctions',
config: {
env: this.data.envId
},
data: {
type: 'getMiniProgramCode'
}
}).then((resp) => {
this.setData({
haveGetCodeSrc: true,
codeSrc: resp.result
});
wx.hideLoading();
}).catch((e) => {
console.log(e);
this.setData({
showUploadTip: true
});
wx.hideLoading();
});
},
clearCodeSrc() {
this.setData({
haveGetCodeSrc: false,
codeSrc: ''
});
}
});

@ -0,0 +1,6 @@
{
"navigationBarTitleText": "生成小程序码",
"usingComponents": {
"cloud-tip-modal": "/components/cloudTipModal/index"
}
}

@ -0,0 +1,11 @@
<view>
<view class="top_tip">可通过云函数免接口调用凭证,直接生成小程序码。</view>
<view class="box_text" wx:if="{{!codeSrc}}">小程序码将展示在这里</view>
<view wx:if="{{codeSrc}}" class="code_box">
<image class="code_img" src="{{codeSrc}}"></image>
</view>
<view class="button" bindtap="getCodeSrc" wx:if="{{!haveGetCodeSrc}}">生成小程序码</view>
<view class="button_clear" bindtap="clearCodeSrc" wx:if="{{haveGetCodeSrc}}">清空</view>
<view class="tip">在”资源管理器>cloudfunctions>quickstartFunctions>getMiniProgramCode>index.js“找到获取小程序码函数体验该能力</view>
<cloud-tip-modal showUploadTipProps="{{showUploadTip}}"></cloud-tip-modal>
</view>

@ -0,0 +1,58 @@
.tip {
font-size: 23rpx;
color: rgba(0, 0, 0, 0.5);
width: 90%;
text-align: center;
margin: 30rpx auto 0 auto;
}
.top_tip {
font-size: 28rpx;
color: rgba(0, 0, 0, 0.5);
width: 90%;
text-align: left;
margin-top: 30rpx;
margin-left: 20rpx;
}
.box_text {
background-color: white;
text-align: center;
padding: 300rpx 0;
margin-top: 30rpx;
color: rgba(0, 0, 0, 0.5);
}
.code_box {
text-align: center;
background-color: white;
margin-top: 30rpx;
padding: 17rpx 0;
}
.code_img {
width: 600rpx;
height: 600rpx;
}
.button {
width: 300rpx;
text-align: center;
margin: 20% auto 0 auto;
height: 80rpx;
color: white;
border-radius: 5px;
line-height: 80rpx;
background-color: #07c160;
}
.button_clear {
width: 300rpx;
text-align: center;
margin: 20% auto 0 auto;
height: 80rpx;
color: #07c160;
border-radius: 5px;
line-height: 80rpx;
background-color: rgba(0, 0, 0, 0.03);
}

@ -0,0 +1,52 @@
Page({
/**
* 页面的初始数据
*/
data: {
showUploadTip: false,
haveGetOpenId: false,
envId: '',
openId: ''
},
onLoad(options) {
this.setData({
envId: options.envId
});
},
getOpenId() {
wx.showLoading({
title: '',
});
wx.cloud.callFunction({
name: 'quickstartFunctions',
config: {
env: this.data.envId
},
data: {
type: 'getOpenId'
}
}).then((resp) => {
this.setData({
haveGetOpenId: true,
openId: resp.result.openid
});
wx.hideLoading();
}).catch((e) => {
this.setData({
showUploadTip: true
});
wx.hideLoading();
});
},
clearOpenId() {
this.setData({
haveGetOpenId: false,
openId: ''
});
}
});

@ -0,0 +1,6 @@
{
"navigationBarTitleText": "获取OpenId",
"usingComponents": {
"cloud-tip-modal": "/components/cloudTipModal/index"
}
}

@ -0,0 +1,8 @@
<view>
<view class="top_tip">无需维护鉴权机制及登录票据,仅一行代码即可获得。</view>
<view class="box_text">{{ openId ? openId : 'OpenID将展示在这里' }}</view>
<view class="button" bindtap="getOpenId" wx:if="{{!haveGetOpenId}}">获取OpenId</view>
<view class="button_clear" bindtap="clearOpenId" wx:if="{{haveGetOpenId}}">清空</view>
<view class="tip">在”资源管理器>cloudfunctions>quickstartFunctions>getOpenId>index.js“找到获取openId函数体验该能力</view>
<cloud-tip-modal showUploadTipProps="{{showUploadTip}}"></cloud-tip-modal>
</view>

@ -0,0 +1,46 @@
.tip {
font-size: 23rpx;
color: rgba(0, 0, 0, 0.5);
width: 90%;
text-align: center;
margin: 30rpx auto 0 auto;
}
.top_tip {
font-size: 28rpx;
color: rgba(0, 0, 0, 0.5);
width: 90%;
text-align: left;
margin-top: 30rpx;
margin-left: 20rpx;
}
.box_text {
background-color: white;
text-align: center;
padding: 300rpx 0;
margin-top: 30rpx;
color: rgba(0, 0, 0, 0.5);
}
.button {
width: 300rpx;
text-align: center;
margin: 250rpx auto 0 auto;
height: 80rpx;
color: white;
border-radius: 5px;
line-height: 80rpx;
background-color: #07c160;
}
.button_clear {
width: 300rpx;
text-align: center;
margin: 250rpx auto 0 auto;
height: 80rpx;
color: #07c160;
border-radius: 5px;
line-height: 80rpx;
background-color: rgba(0, 0, 0, 0.03);
}

@ -0,0 +1,142 @@
// index.js
// const app = getApp()
const { envList } = require('../../envList.js');
Page({
data: {
showUploadTip: false,
powerList: [{
title: '云函数',
tip: '安全、免鉴权运行业务代码',
showItem: false,
item: [{
title: '获取OpenId',
page: 'getOpenId'
},
// {
// title: '微信支付'
// },
{
title: '生成小程序码',
page: 'getMiniProgramCode'
},
// {
// title: '发送订阅消息',
// }
]
}, {
title: '数据库',
tip: '安全稳定的文档型数据库',
showItem: false,
item: [{
title: '创建集合',
page: 'createCollection'
}, {
title: '更新记录',
page: 'updateRecord'
}, {
title: '查询记录',
page: 'selectRecord'
}, {
title: '聚合操作',
page: 'sumRecord'
}]
}, {
title: '云存储',
tip: '自带CDN加速文件存储',
showItem: false,
item: [{
title: '上传文件',
page: 'uploadFile'
}]
}, {
title: '云托管',
tip: '不限语言的全托管容器服务',
showItem: false,
item: [{
title: '部署服务',
page: 'deployService'
}]
}],
envList,
selectedEnv: envList[0],
haveCreateCollection: false
},
onClickPowerInfo(e) {
const index = e.currentTarget.dataset.index;
const powerList = this.data.powerList;
powerList[index].showItem = !powerList[index].showItem;
if (powerList[index].title === '数据库' && !this.data.haveCreateCollection) {
this.onClickDatabase(powerList);
} else {
this.setData({
powerList
});
}
},
onChangeShowEnvChoose() {
wx.showActionSheet({
itemList: this.data.envList.map(i => i.alias),
success: (res) => {
this.onChangeSelectedEnv(res.tapIndex);
},
fail (res) {
console.log(res.errMsg);
}
});
},
onChangeSelectedEnv(index) {
if (this.data.selectedEnv.envId === this.data.envList[index].envId) {
return;
}
const powerList = this.data.powerList;
powerList.forEach(i => {
i.showItem = false;
});
this.setData({
selectedEnv: this.data.envList[index],
powerList,
haveCreateCollection: false
});
},
jumpPage(e) {
wx.navigateTo({
url: `/pages/${e.currentTarget.dataset.page}/index?envId=${this.data.selectedEnv.envId}`,
});
},
onClickDatabase(powerList) {
wx.showLoading({
title: '',
});
wx.cloud.callFunction({
name: 'quickstartFunctions',
config: {
env: this.data.selectedEnv.envId
},
data: {
type: 'createCollection'
}
}).then((resp) => {
if (resp.result.success) {
this.setData({
haveCreateCollection: true
});
}
this.setData({
powerList
});
wx.hideLoading();
}).catch((e) => {
console.log(e);
this.setData({
showUploadTip: true
});
wx.hideLoading();
});
}
});

@ -0,0 +1,5 @@
{
"usingComponents": {
"cloud-tip-modal": "/components/cloudTipModal/index"
}
}

@ -0,0 +1,32 @@
<!--index.wxml-->
<view class="container">
<view class="title">快速了解云开发</view>
<view class="top_tip">免鉴权接口调用 免部署后台 高并发</view>
<view class="power" wx:key="title" wx:for="{{powerList}}" wx:for-item="power">
<view class="power_info" data-index="{{index}}" bindtap="onClickPowerInfo">
<view class="power_info_text">
<view class="power_info_text_title">{{power.title}}</view>
<view class="power_info_text_tip">{{power.tip}}</view>
</view>
<image wx:if="{{!power.showItem}}" class="power_info_more" src="../../images/arrow.svg"></image>
<image wx:if="{{power.showItem}}" class="power_info_less" src="../../images/arrow.svg"></image>
</view>
<view wx:if="{{power.showItem}}">
<view wx:key="title" wx:for="{{power.item}}">
<view class="line"></view>
<view class="power_item" bindtap="jumpPage" data-page="{{item.page}}">
<view class="power_item_title">{{item.title}}</view>
<image class="power_item_icon" src="../../images/arrow.svg"></image>
</view>
</view>
</view>
</view>
<view class="environment" bindtap="onChangeShowEnvChoose">当前环境 {{ selectedEnv.alias }}</view>
<cloud-tip-modal showUploadTipProps="{{showUploadTip}}"></cloud-tip-modal>
</view>

@ -1,19 +1,11 @@
/* pages/selectusers/index.wxss */
/* pages/selectusers(college)/index.wxss */
/**index.wxss**/
page {
padding-top: 54rpx;
background-color: #f6f6f6;
background-color: #ffffff;
padding-bottom: 60rpx;
}
.button {
margin-top: 50px;
margin-left: 50px;
margin-right: 50px;
}
.title {
font-family: PingFang SC;
font-weight: 500;
@ -24,11 +16,10 @@ page {
.top_tip {
font-size: 28rpx;
color: rgba(0, 0, 0, 0.5);
width: 90%;
text-align: left;
margin-top: 30rpx;
margin-left: 20rpx;
font-family: PingFang SC;
font-weight: 400;
color: #888888;
margin-bottom: 28rpx;
}
.power {
@ -100,46 +91,4 @@ page {
color: rgba(0, 0, 0, 0.4);
font-size: 24rpx;
margin-top: 25%;
}
.code_box {
text-align: center;
background-color: white;
margin-top: 30rpx;
padding: 17rpx;
}
.code_box_title {
color: rgba(0, 0, 0, 0.5);
font-size: 26rpx;
margin-bottom: 20rpx;
text-align: left;
}
.code_box_record {
display: flex;
}
.code_box_record_title {
width: 33%;
font-size: 26rpx;
color: rgba(0, 0, 0, 0.5);
padding: 20rpx 0;
}
.code_box_record_detail {
width: 33%;
font-size: 26rpx;
padding: 20rpx 0;
}
.button {
width: 300rpx;
text-align: center;
margin: 20% auto 0 auto;
height: 80rpx;
color: white;
border-radius: 5px;
line-height: 80rpx;
background-color: #07c160;
}

@ -98,15 +98,15 @@ Page({
}
},
goToUser:function(options){
goToSchool:function(options){
wx.navigateTo({
url: '../pages/user/user'
url: '../school/school'
})
},
goToManager:function(options){
goToCanteen:function(options){
wx.navigateTo({
url: '../pages/manager/manager'
url: '../canteen/canteen'
})
}
})

@ -0,0 +1,53 @@
Page({
/**
* 页面的初始数据
*/
data: {
showUploadTip: false,
haveGetRecord: false,
envId: '',
record: ''
},
onLoad(options) {
this.setData({
envId: options.envId
});
},
getRecord() {
wx.showLoading({
title: '',
});
wx.cloud.callFunction({
name: 'quickstartFunctions',
config: {
env: this.data.envId
},
data: {
type: 'selectRecord'
}
}).then((resp) => {
this.setData({
haveGetRecord: true,
record: resp.result.data
});
wx.hideLoading();
}).catch((e) => {
console.log(e);
this.setData({
showUploadTip: true
});
wx.hideLoading();
});
},
clearRecord() {
this.setData({
haveGetRecord: false,
record: ''
});
}
});

@ -0,0 +1,6 @@
{
"navigationBarTitleText": "查询记录",
"usingComponents": {
"cloud-tip-modal": "/components/cloudTipModal/index"
}
}

@ -0,0 +1,22 @@
<view>
<view class="top_tip">体验查询记录能力,查询数据表中的销量数据。</view>
<view class="box_text" wx:if="{{!record}}">销量数据将展示在这里</view>
<view wx:if="{{record}}" class="code_box">
<view class="code_box_title">地区销量统计</view>
<view class="code_box_record">
<view class="code_box_record_title">地域</view>
<view class="code_box_record_title">城市</view>
<view class="code_box_record_title">销量</view>
</view>
<view class="line"></view>
<view class="code_box_record" wx:for="{{record}}" wx:key="_id">
<view class="code_box_record_detail">{{item.region}}</view>
<view class="code_box_record_detail">{{item.city}}</view>
<view class="code_box_record_detail">{{item.sales}}</view>
</view>
</view>
<view class="button" bindtap="getRecord" wx:if="{{!haveGetRecord}}">查询记录</view>
<view class="button_clear" bindtap="clearRecord" wx:if="{{haveGetRecord}}">清空</view>
<view class="tip">在”资源管理器>cloudfunctions>quickstartFunctions>selectRecord>index.js“找到查询记录函数体验该能力</view>
<cloud-tip-modal showUploadTipProps="{{showUploadTip}}"></cloud-tip-modal>
</view>

@ -0,0 +1,83 @@
.tip {
font-size: 23rpx;
color: rgba(0, 0, 0, 0.5);
width: 90%;
text-align: center;
margin: 30rpx auto 0 auto;
}
.top_tip {
font-size: 28rpx;
color: rgba(0, 0, 0, 0.5);
width: 90%;
text-align: left;
margin-top: 30rpx;
margin-left: 20rpx;
}
.box_text {
background-color: white;
text-align: center;
padding: 300rpx 0;
margin-top: 30rpx;
color: rgba(0, 0, 0, 0.5);
}
.code_box {
text-align: center;
background-color: white;
margin-top: 30rpx;
padding: 17rpx;
}
.code_box_title {
color: rgba(0, 0, 0, 0.5);
font-size: 26rpx;
margin-bottom: 20rpx;
text-align: left;
}
.code_box_record {
display: flex;
}
.code_box_record_title {
width: 33%;
font-size: 26rpx;
color: rgba(0, 0, 0, 0.5);
padding: 20rpx 0;
}
.code_box_record_detail {
width: 33%;
font-size: 26rpx;
padding: 20rpx 0;
}
.button {
width: 300rpx;
text-align: center;
margin: 20% auto 0 auto;
height: 80rpx;
color: white;
border-radius: 5px;
line-height: 80rpx;
background-color: #07c160;
}
.button_clear {
width: 300rpx;
text-align: center;
margin: 250rpx auto 0 auto;
height: 80rpx;
color: #07c160;
border-radius: 5px;
line-height: 80rpx;
background-color: rgba(0, 0, 0, 0.03);
}
.line {
height: 1rpx;
width: 100%;
background-color: rgba(0, 0, 0, 0.1);
}

@ -0,0 +1,48 @@
Page({
/**
* 页面的初始数据
*/
data: {
showUploadTip: false,
haveGetRecord: false,
envId: '',
record: ''
},
onLoad(options) {
this.setData({
envId: options.envId
});
wx.showLoading({
title: '',
});
wx.cloud.callFunction({
name: 'quickstartFunctions',
config: {
env: this.data.envId
},
data: {
type: 'selectRecord'
}
}).then((resp) => {
this.setData({
record: resp.result.data
});
wx.hideLoading();
}).catch((e) => {
console.log(e);
this.setData({
showUploadTip: true
});
wx.hideLoading();
});
},
sumRecord() {
wx.navigateTo({
url: `/pages/sumRecordResult/index?envId=${this.data.envId}`,
});
},
});

@ -0,0 +1,6 @@
{
"navigationBarTitleText": "聚合记录",
"usingComponents": {
"cloud-tip-modal": "/components/cloudTipModal/index"
}
}

@ -0,0 +1,21 @@
<view>
<view class="top_tip">常用数据库中的groupby操作体验按地域聚合数据。</view>
<view class="box_text" wx:if="{{!record}}">数据将展示在这里</view>
<view wx:if="{{record}}" class="code_box">
<view class="code_box_title">地区销量统计</view>
<view class="code_box_record">
<view class="code_box_record_title">地域</view>
<view class="code_box_record_title">城市</view>
<view class="code_box_record_title">销量</view>
</view>
<view class="line"></view>
<view class="code_box_record" wx:for="{{record}}" wx:key="_id">
<view class="code_box_record_detail">{{item.region}}</view>
<view class="code_box_record_detail">{{item.city}}</view>
<view class="code_box_record_detail">{{item.sales}}</view>
</view>
</view>
<view class="button" bindtap="sumRecord">聚合记录</view>
<view class="tip">在”资源管理器>cloudfunctions>quickstartFunctions>sumRecord>index.js“找到聚合记录函数体验该能力</view>
<cloud-tip-modal showUploadTipProps="{{showUploadTip}}"></cloud-tip-modal>
</view>

@ -0,0 +1,83 @@
.tip {
font-size: 23rpx;
color: rgba(0, 0, 0, 0.5);
width: 90%;
text-align: center;
margin: 30rpx auto 0 auto;
}
.top_tip {
font-size: 28rpx;
color: rgba(0, 0, 0, 0.5);
width: 90%;
text-align: left;
margin-top: 30rpx;
margin-left: 20rpx;
}
.box_text {
background-color: white;
text-align: center;
padding: 300rpx 0;
margin-top: 30rpx;
color: rgba(0, 0, 0, 0.5);
}
.code_box {
text-align: center;
background-color: white;
margin-top: 30rpx;
padding: 17rpx;
}
.code_box_title {
color: rgba(0, 0, 0, 0.5);
font-size: 26rpx;
margin-bottom: 20rpx;
text-align: left;
}
.code_box_record {
display: flex;
}
.code_box_record_title {
width: 33%;
font-size: 26rpx;
color: rgba(0, 0, 0, 0.5);
padding: 20rpx 0;
}
.code_box_record_detail {
width: 33%;
font-size: 26rpx;
padding: 20rpx 0;
}
.button {
width: 300rpx;
text-align: center;
margin: 250rpx auto 0 auto;
height: 80rpx;
color: white;
border-radius: 5px;
line-height: 80rpx;
background-color: #07c160;
}
.button_clear {
width: 300rpx;
text-align: center;
margin: 250rpx auto 0 auto;
height: 80rpx;
color: #07c160;
border-radius: 5px;
line-height: 80rpx;
background-color: rgba(0, 0, 0, 0.03);
}
.line {
height: 1rpx;
width: 100%;
background-color: rgba(0, 0, 0, 0.1);
}

@ -0,0 +1,46 @@
Page({
/**
* 页面的初始数据
*/
data: {
showUploadTip: false,
haveGetRecord: false,
envId: '',
record: ''
},
onLoad(options) {
this.setData({
envId: options.envId
});
wx.showLoading({
title: '',
});
wx.cloud.callFunction({
name: 'quickstartFunctions',
config: {
env: this.data.envId
},
data: {
type: 'sumRecord'
}
}).then((resp) => {
this.setData({
record: resp.result.list
});
wx.hideLoading();
}).catch((e) => {
console.log(e);
this.setData({
showUploadTip: true
});
wx.hideLoading();
});
},
goBack() {
wx.navigateBack();
},
});

@ -0,0 +1,6 @@
{
"navigationBarTitleText": "聚合记录",
"usingComponents": {
"cloud-tip-modal": "/components/cloudTipModal/index"
}
}

@ -0,0 +1,19 @@
<view>
<view class="top_tip">常用数据库中的groupby操作体验按地域聚合数据。</view>
<view class="box_text" wx:if="{{!record}}">数据将展示在这里</view>
<view wx:if="{{record}}" class="code_box">
<view class="code_box_title">地区销量统计</view>
<view class="code_box_record">
<view class="code_box_record_title">地域</view>
<view class="code_box_record_title">销量</view>
</view>
<view class="line"></view>
<view class="code_box_record" wx:for="{{record}}" wx:key="_id">
<view class="code_box_record_detail">{{item._id}}</view>
<view class="code_box_record_detail">{{item.sum}}</view>
</view>
</view>
<view class="button" bindtap="goBack">返回上一步</view>
<view class="tip">在”资源管理器>cloudfunctions>quickstartFunctions>sumRecord>index.js“找到聚合记录函数体验该能力</view>
<cloud-tip-modal showUploadTipProps="{{showUploadTip}}"></cloud-tip-modal>
</view>

@ -0,0 +1,73 @@
.tip {
font-size: 23rpx;
color: rgba(0, 0, 0, 0.5);
width: 90%;
text-align: center;
margin: 30rpx auto 0 auto;
}
.top_tip {
font-size: 28rpx;
color: rgba(0, 0, 0, 0.5);
width: 90%;
text-align: left;
margin-top: 30rpx;
margin-left: 20rpx;
}
.box_text {
background-color: white;
text-align: center;
padding: 300rpx 0;
margin-top: 30rpx;
color: rgba(0, 0, 0, 0.5);
}
.code_box {
text-align: center;
background-color: white;
margin-top: 30rpx;
padding: 17rpx;
}
.code_box_title {
color: rgba(0, 0, 0, 0.5);
font-size: 26rpx;
margin-bottom: 20rpx;
text-align: left;
}
.code_box_record {
display: flex;
justify-content: space-between;
}
.code_box_record_title {
width: 33%;
font-size: 26rpx;
color: rgba(0, 0, 0, 0.5);
padding: 20rpx 0;
}
.code_box_record_detail {
width: 33%;
font-size: 26rpx;
padding: 20rpx 0;
}
.button {
width: 300rpx;
text-align: center;
margin: 250rpx auto 0 auto;
height: 80rpx;
color: #07c160;
border-radius: 5px;
line-height: 80rpx;
background-color: rgba(0, 0, 0, 0.03);
}
.line {
height: 1rpx;
width: 100%;
background-color: rgba(0, 0, 0, 0.1);
}

@ -0,0 +1,51 @@
Page({
/**
* 页面的初始数据
*/
data: {
showUploadTip: false,
haveGetRecord: false,
envId: '',
record: ''
},
onLoad(options) {
this.setData({
envId: options.envId
});
},
onShow() {
wx.showLoading({
title: '',
});
wx.cloud.callFunction({
name: 'quickstartFunctions',
config: {
env: this.data.envId
},
data: {
type: 'selectRecord'
}
}).then((resp) => {
this.setData({
record: resp.result.data
});
wx.hideLoading();
}).catch((e) => {
console.log(e);
this.setData({
showUploadTip: true
});
wx.hideLoading();
});
},
updateRecord() {
wx.navigateTo({
url: `/pages/updateRecordResult/index?envId=${this.data.envId}`,
});
},
});

@ -0,0 +1,6 @@
{
"navigationBarTitleText": "更新记录",
"usingComponents": {
"cloud-tip-modal": "/components/cloudTipModal/index"
}
}

@ -0,0 +1,21 @@
<view>
<view class="top_tip">体验更新字段记录能力,更新数据表中的销量数据。</view>
<view class="box_text" wx:if="{{!record}}">数据将展示在这里</view>
<view wx:if="{{record}}" class="code_box">
<view class="code_box_title">地区销量统计</view>
<view class="code_box_record">
<view class="code_box_record_title">地域</view>
<view class="code_box_record_title">城市</view>
<view class="code_box_record_title">销量</view>
</view>
<view class="line"></view>
<view class="code_box_record" wx:for="{{record}}" wx:key="_id">
<view class="code_box_record_detail">{{item.region}}</view>
<view class="code_box_record_detail">{{item.city}}</view>
<view class="code_box_record_detail">{{item.sales}}</view>
</view>
</view>
<view class="button" bindtap="updateRecord">修改数据</view>
<view class="tip">在”资源管理器>cloudfunctions>quickstartFunctions>updateRecord>index.js“找到查询记录函数体验该能力</view>
<cloud-tip-modal showUploadTipProps="{{showUploadTip}}"></cloud-tip-modal>
</view>

@ -0,0 +1,83 @@
.tip {
font-size: 23rpx;
color: rgba(0, 0, 0, 0.5);
width: 90%;
text-align: center;
margin: 30rpx auto 0 auto;
}
.top_tip {
font-size: 28rpx;
color: rgba(0, 0, 0, 0.5);
width: 90%;
text-align: left;
margin-top: 30rpx;
margin-left: 20rpx;
}
.box_text {
background-color: white;
text-align: center;
padding: 300rpx 0;
margin-top: 30rpx;
color: rgba(0, 0, 0, 0.5);
}
.code_box {
text-align: center;
background-color: white;
margin-top: 30rpx;
padding: 17rpx;
}
.code_box_title {
color: rgba(0, 0, 0, 0.5);
font-size: 26rpx;
margin-bottom: 20rpx;
text-align: left;
}
.code_box_record {
display: flex;
}
.code_box_record_title {
width: 33%;
font-size: 26rpx;
color: rgba(0, 0, 0, 0.5);
padding: 20rpx 0;
}
.code_box_record_detail {
width: 33%;
font-size: 26rpx;
padding: 20rpx 0;
}
.button {
width: 300rpx;
text-align: center;
margin: 250rpx auto 0 auto;
height: 80rpx;
color: white;
border-radius: 5px;
line-height: 80rpx;
background-color: #07c160;
}
.button_clear {
width: 300rpx;
text-align: center;
margin: 250rpx auto 0 auto;
height: 80rpx;
color: #07c160;
border-radius: 5px;
line-height: 80rpx;
background-color: rgba(0, 0, 0, 0.03);
}
.line {
height: 1rpx;
width: 100%;
background-color: rgba(0, 0, 0, 0.1);
}

@ -0,0 +1,78 @@
Page({
/**
* 页面的初始数据
*/
data: {
showUploadTip: false,
haveGetRecord: false,
envId: '',
record: ''
},
onLoad(options) {
this.setData({
envId: options.envId
});
wx.showLoading({
title: '',
});
wx.cloud.callFunction({
name: 'quickstartFunctions',
config: {
env: this.data.envId
},
data: {
type: 'selectRecord'
}
}).then((resp) => {
this.setData({
record: resp.result.data
});
wx.hideLoading();
}).catch((e) => {
console.log(e);
this.setData({
showUploadTip: true
});
wx.hideLoading();
});
},
updateRecord() {
wx.showLoading({
title: '',
});
wx.cloud.callFunction({
name: 'quickstartFunctions',
config: {
env: this.data.envId
},
data: {
type: 'updateRecord',
data: this.data.record
}
}).then((resp) => {
wx.navigateTo({
url: `/pages/updateRecordSuccess/index`,
});
wx.hideLoading();
}).catch((e) => {
console.log(e);
this.setData({
showUploadTip: true
});
wx.hideLoading();
});
},
bindInput (e) {
const index = e.currentTarget.dataset.index;
const record = this.data.record;
record[index].sales = Number(e.detail.value);
this.setData({
record
});
},
});

@ -0,0 +1,6 @@
{
"navigationBarTitleText": "更新记录",
"usingComponents": {
"cloud-tip-modal": "/components/cloudTipModal/index"
}
}

@ -0,0 +1,21 @@
<view>
<view class="top_tip">体验更新字段记录能力,更新数据表中的销量数据。</view>
<view class="box_text" wx:if="{{!record}}">数据将展示在这里</view>
<view wx:if="{{record}}" class="code_box">
<view class="code_box_title">地区销量统计</view>
<view class="code_box_record">
<view class="code_box_record_title">地域</view>
<view class="code_box_record_title">城市</view>
<view class="code_box_record_title">销量</view>
</view>
<view class="line"></view>
<view class="code_box_record" wx:for="{{record}}" wx:key="_id">
<view class="code_box_record_detail">{{item.region}}</view>
<view class="code_box_record_detail">{{item.city}}</view>
<input class="code_box_record_detail" bindinput="bindInput" data-index="{{index}}" value="{{item.sales}}" type="number"></input>
</view>
</view>
<view class="button" bindtap="updateRecord">更新</view>
<view class="tip">在”资源管理器>cloudfunctions>quickstartFunctions>updateRecord>index.js“找到查询记录函数体验该能力</view>
<cloud-tip-modal showUploadTipProps="{{showUploadTip}}"></cloud-tip-modal>
</view>

@ -0,0 +1,72 @@
.tip {
font-size: 23rpx;
color: rgba(0, 0, 0, 0.5);
width: 90%;
text-align: center;
margin: 30rpx auto 0 auto;
}
.top_tip {
font-size: 28rpx;
color: rgba(0, 0, 0, 0.5);
width: 90%;
text-align: left;
margin-top: 30rpx;
margin-left: 20rpx;
}
.box_text {
background-color: white;
text-align: center;
padding: 300rpx 0;
margin-top: 30rpx;
color: rgba(0, 0, 0, 0.5);
}
.code_box {
text-align: center;
background-color: white;
margin-top: 30rpx;
padding: 17rpx;
}
.code_box_title {
color: rgba(0, 0, 0, 0.5);
font-size: 26rpx;
margin-bottom: 20rpx;
text-align: left;
}
.code_box_record {
display: flex;
}
.code_box_record_title {
width: 33%;
font-size: 26rpx;
color: rgba(0, 0, 0, 0.5);
padding: 20rpx 0;
}
.code_box_record_detail {
width: 33%;
font-size: 26rpx;
padding: 20rpx 0;
}
.button {
width: 300rpx;
text-align: center;
margin: 250rpx auto 0 auto;
height: 80rpx;
color: white;
border-radius: 5px;
line-height: 80rpx;
background-color: #07c160;
}
.line {
height: 1rpx;
width: 100%;
background-color: rgba(0, 0, 0, 0.1);
}

@ -0,0 +1,16 @@
Page({
/**
* 页面的初始数据
*/
data: {
},
goBack() {
wx.navigateBack({
delta: 2
});
},
});

@ -0,0 +1,6 @@
{
"navigationBarTitleText": "更新记录",
"usingComponents": {
"cloud-tip-modal": "/components/cloudTipModal/index"
}
}

@ -0,0 +1,6 @@
<view>
<icon class="icon-box-img icon" type="success" size="53"></icon>
<view class="title">地区销量统计更新成功</view>
<view class="info">可在“云开发控制台>数据库>记录列表”中进行查看</view>
<view class="button" bindtap="goBack">我知道了</view>
</view>

@ -0,0 +1,30 @@
page {
text-align: center;
}
.icon {
margin: 80rpx 0 50rpx 0;
}
.title {
font-size: 42rpx;
font-weight: 600;
margin-bottom: 30rpx;
}
.info {
font-size: 36rpx;
width: 90%;
margin: 0 auto;
}
.button {
width: 300rpx;
text-align: center;
margin: 550rpx auto 0 auto;
height: 80rpx;
color: #07c160;
border-radius: 5px;
line-height: 80rpx;
background-color: rgba(0, 0, 0, 0.03);
}

@ -0,0 +1,58 @@
Page({
/**
* 页面的初始数据
*/
data: {
showUploadTip: false,
haveGetImgSrc: false,
envId: '',
imgSrc: ''
},
onLoad(options) {
this.setData({
envId: options.envId
});
},
uploadImg() {
wx.showLoading({
title: '',
});
// 让用户选择一张图片
wx.chooseImage({
count: 1,
success: chooseResult => {
// 将图片上传至云存储空间
wx.cloud.uploadFile({
// 指定上传到的云路径
cloudPath: 'my-photo.png',
// 指定要上传的文件的小程序临时文件路径
filePath: chooseResult.tempFilePaths[0],
config: {
env: this.data.envId
}
}).then(res => {
console.log('上传成功', res);
this.setData({
haveGetImgSrc: true,
imgSrc: res.fileID
});
wx.hideLoading();
}).catch((e) => {
console.log(e);
wx.hideLoading();
});
},
});
},
clearImgSrc() {
this.setData({
haveGetImgSrc: false,
imgSrc: ''
});
}
});

@ -0,0 +1,6 @@
{
"navigationBarTitleText": "上传文件",
"usingComponents": {
"cloud-tip-modal": "/components/cloudTipModal/index"
}
}

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

Loading…
Cancel
Save