From e1b8d3f64e20bcb1f6d5486f7bd9784b70ee06c7 Mon Sep 17 00:00:00 2001 From: Booker Zhao Date: Sat, 6 Jul 2024 11:40:12 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=97=A0=E5=85=B3=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- miniprogram/app.json | 28 +- miniprogram/pages/business/index.js | 171 ----- miniprogram/pages/business/index.json | 6 - miniprogram/pages/business/index.wxml | 32 - miniprogram/pages/business/index.wxss | 142 ---- .../pages/cloudbaseModuleDetail/index.js | 614 ------------------ .../pages/cloudbaseModuleDetail/index.json | 7 - .../pages/cloudbaseModuleDetail/index.wxml | 213 ------ .../pages/cloudbaseModuleDetail/index.wxss | 153 ----- .../pages/cloudbaseModuleGuide/index.js | 21 - .../pages/cloudbaseModuleGuide/index.json | 3 - .../pages/cloudbaseModuleGuide/index.wxml | 23 - .../pages/cloudbaseModuleGuide/index.wxss | 48 -- .../pages/cloudbaseModuleInstallTips/index.js | 12 - .../cloudbaseModuleInstallTips/index.json | 6 - .../cloudbaseModuleInstallTips/index.wxml | 27 - .../cloudbaseModuleInstallTips/index.wxss | 58 -- miniprogram/pages/deployService/index.js | 11 - miniprogram/pages/deployService/index.json | 3 - miniprogram/pages/deployService/index.wxml | 10 - miniprogram/pages/deployService/index.wxss | 29 - miniprogram/pages/exampleDetail/index.js | 172 ----- miniprogram/pages/exampleDetail/index.json | 5 - miniprogram/pages/exampleDetail/index.wxml | 111 ---- miniprogram/pages/exampleDetail/index.wxss | 118 ---- miniprogram/pages/examples/index.js | 180 ----- miniprogram/pages/examples/index.json | 6 - miniprogram/pages/examples/index.wxml | 33 - miniprogram/pages/examples/index.wxss | 142 ---- miniprogram/pages/goods-list/index.js | 39 -- miniprogram/pages/goods-list/index.json | 7 - miniprogram/pages/goods-list/index.wxml | 42 -- miniprogram/pages/goods-list/index.wxss | 104 --- miniprogram/pages/sumRecord/index.js | 48 -- miniprogram/pages/sumRecord/index.json | 6 - miniprogram/pages/sumRecord/index.wxml | 21 - miniprogram/pages/sumRecord/index.wxss | 83 --- miniprogram/pages/sumRecordResult/index.js | 46 -- miniprogram/pages/sumRecordResult/index.json | 6 - miniprogram/pages/sumRecordResult/index.wxml | 19 - miniprogram/pages/sumRecordResult/index.wxss | 73 --- miniprogram/pages/updateRecord/index.js | 51 -- miniprogram/pages/updateRecord/index.json | 6 - miniprogram/pages/updateRecord/index.wxml | 21 - miniprogram/pages/updateRecord/index.wxss | 83 --- miniprogram/pages/updateRecordResult/index.js | 78 --- .../pages/updateRecordResult/index.json | 6 - .../pages/updateRecordResult/index.wxml | 21 - .../pages/updateRecordResult/index.wxss | 72 -- .../pages/updateRecordSuccess/index.js | 16 - .../pages/updateRecordSuccess/index.json | 6 - .../pages/updateRecordSuccess/index.wxml | 6 - .../pages/updateRecordSuccess/index.wxss | 30 - miniprogram/pages/web/index.js | 21 - miniprogram/pages/web/index.json | 3 - miniprogram/pages/web/index.wxml | 1 - miniprogram/pages/web/index.wxss | 4 - 57 files changed, 1 insertion(+), 3302 deletions(-) delete mode 100644 miniprogram/pages/business/index.js delete mode 100644 miniprogram/pages/business/index.json delete mode 100644 miniprogram/pages/business/index.wxml delete mode 100644 miniprogram/pages/business/index.wxss delete mode 100644 miniprogram/pages/cloudbaseModuleDetail/index.js delete mode 100644 miniprogram/pages/cloudbaseModuleDetail/index.json delete mode 100644 miniprogram/pages/cloudbaseModuleDetail/index.wxml delete mode 100644 miniprogram/pages/cloudbaseModuleDetail/index.wxss delete mode 100644 miniprogram/pages/cloudbaseModuleGuide/index.js delete mode 100644 miniprogram/pages/cloudbaseModuleGuide/index.json delete mode 100644 miniprogram/pages/cloudbaseModuleGuide/index.wxml delete mode 100644 miniprogram/pages/cloudbaseModuleGuide/index.wxss delete mode 100644 miniprogram/pages/cloudbaseModuleInstallTips/index.js delete mode 100644 miniprogram/pages/cloudbaseModuleInstallTips/index.json delete mode 100644 miniprogram/pages/cloudbaseModuleInstallTips/index.wxml delete mode 100644 miniprogram/pages/cloudbaseModuleInstallTips/index.wxss delete mode 100644 miniprogram/pages/deployService/index.js delete mode 100644 miniprogram/pages/deployService/index.json delete mode 100644 miniprogram/pages/deployService/index.wxml delete mode 100644 miniprogram/pages/deployService/index.wxss delete mode 100644 miniprogram/pages/exampleDetail/index.js delete mode 100644 miniprogram/pages/exampleDetail/index.json delete mode 100644 miniprogram/pages/exampleDetail/index.wxml delete mode 100644 miniprogram/pages/exampleDetail/index.wxss delete mode 100644 miniprogram/pages/examples/index.js delete mode 100644 miniprogram/pages/examples/index.json delete mode 100644 miniprogram/pages/examples/index.wxml delete mode 100644 miniprogram/pages/examples/index.wxss delete mode 100644 miniprogram/pages/goods-list/index.js delete mode 100644 miniprogram/pages/goods-list/index.json delete mode 100644 miniprogram/pages/goods-list/index.wxml delete mode 100644 miniprogram/pages/goods-list/index.wxss delete mode 100644 miniprogram/pages/sumRecord/index.js delete mode 100644 miniprogram/pages/sumRecord/index.json delete mode 100644 miniprogram/pages/sumRecord/index.wxml delete mode 100644 miniprogram/pages/sumRecord/index.wxss delete mode 100644 miniprogram/pages/sumRecordResult/index.js delete mode 100644 miniprogram/pages/sumRecordResult/index.json delete mode 100644 miniprogram/pages/sumRecordResult/index.wxml delete mode 100644 miniprogram/pages/sumRecordResult/index.wxss delete mode 100644 miniprogram/pages/updateRecord/index.js delete mode 100644 miniprogram/pages/updateRecord/index.json delete mode 100644 miniprogram/pages/updateRecord/index.wxml delete mode 100644 miniprogram/pages/updateRecord/index.wxss delete mode 100644 miniprogram/pages/updateRecordResult/index.js delete mode 100644 miniprogram/pages/updateRecordResult/index.json delete mode 100644 miniprogram/pages/updateRecordResult/index.wxml delete mode 100644 miniprogram/pages/updateRecordResult/index.wxss delete mode 100644 miniprogram/pages/updateRecordSuccess/index.js delete mode 100644 miniprogram/pages/updateRecordSuccess/index.json delete mode 100644 miniprogram/pages/updateRecordSuccess/index.wxml delete mode 100644 miniprogram/pages/updateRecordSuccess/index.wxss delete mode 100644 miniprogram/pages/web/index.js delete mode 100644 miniprogram/pages/web/index.json delete mode 100644 miniprogram/pages/web/index.wxml delete mode 100644 miniprogram/pages/web/index.wxss diff --git a/miniprogram/app.json b/miniprogram/app.json index 7c36b78..bd3474e 100644 --- a/miniprogram/app.json +++ b/miniprogram/app.json @@ -1,21 +1,7 @@ { "pages": [ "pages/index/index", - "pages/goods-list/index", - "pages/examples/index", - "pages/user-center/index", - "pages/exampleDetail/index", - "pages/deployService/index", - "pages/updateRecord/index", - "pages/updateRecordResult/index", - "pages/updateRecordSuccess/index", - "pages/sumRecord/index", - "pages/sumRecordResult/index", - "pages/web/index", - "pages/cloudbaseModuleDetail/index", - "pages/cloudbaseModuleInstallTips/index", - "pages/cloudbaseModuleGuide/index", - "pages/business/index" + "pages/user-center/index" ], "window": { "backgroundColor": "#F6F6F6", @@ -38,18 +24,6 @@ "iconPath": "images/icons/home.png", "selectedIconPath": "images/icons/home-active.png" }, - { - "pagePath": "pages/examples/index", - "text": "基础能力", - "iconPath": "images/icons/examples.png", - "selectedIconPath": "images/icons/examples-active.png" - }, - { - "pagePath": "pages/business/index", - "text": "业务示例", - "iconPath": "images/icons/business.png", - "selectedIconPath": "images/icons/business-active.png" - }, { "pagePath": "pages/user-center/index", "text": "我", diff --git a/miniprogram/pages/business/index.js b/miniprogram/pages/business/index.js deleted file mode 100644 index b03abdf..0000000 --- a/miniprogram/pages/business/index.js +++ /dev/null @@ -1,171 +0,0 @@ -// index.js -// const app = getApp() -const { envList } = require('../../envList.js'); - -Page({ - data: { - showUploadTip: false, - businessList: [ - { - title: '小程序消息', - tip: '在小程序中通过几行代码即可发送订阅消息', - showItem: false, - item: [ - { - type: 'wx_message_send_message', - title: '发送消息', - }, - { - type: 'wx_message_create_activity_id', - title: '创建activity_id', - }, - ], - }, - { - title: '微信小程序码和链接', - tip: '在小程序中快速获取小程序码和short link', - showItem: false, - item: [ - { - type: 'wx_qrcode_get_qrcode', - title: '获取小程序码', - }, - { - type: 'wx_qrcode_get_unlimited_qrcode', - title: '获取不限制的小程序码', - }, - { - type: 'wx_qrcode_generate_short_link', - title: '获取ShortLink', - }, - ], - }, - { - title: '小程序短信', - tip: '在小程序中向指定用户发送短信和创建发送短信的任务', - showItem: false, - item: [ - { - type: 'wx_sms_new_send_cloudbase_sms', - title: '发送短信', - }, - { - type: 'wx_sms_create_send_sms_task', - title: '创建发短信任务', - }, - ], - }, - { - title: '小程序安全能力', - tip: '在小程序中可以几行代码即可调用小程序的内容安全识别能力', - showItem: false, - item: [ - { - type: 'wx_security_msg_sec_check', - title: '文本内容安全识别', - }, - { - type: 'wx_security_media_check', - title: '音视频内容安全识别', - }, - ], - }, - { - title: '小程序用户信息', - tip: '在小程序中通过几行代码即可获取当前用户的信息', - showItem: false, - item: [ - { - type: 'wx_user_get_open_id', - title: '获取用户openId', - }, - { - type: 'wx_user_get_phone_number', - title: '手机号快速验证', - }, - ], - }, - { - title: '小程序微信支付', - tip: '在小程序中通过几行代码即可调用微信支付的能力', - showItem: false, - item: [ - { - title: '使用指南', - } - ], - }, - { - title: '轮播图管理', - tip: '结合商品订单管理流程,提供订单信息列表展示/查询/导出等相关能力。', - showItem: false, - item: [ - { - title: '使用指南', - }, - ], - }, - { - title: '管理商品和订单', - tip: '通过云模板,快速实现小程序内的商品信息展示/查询/上架/删除/分类管理等。', - showItem: false, - item: [ - { - title: '内容管理系统(CMS)', - level:'main' - }, - { - title: '商品管理', - level:'main' - }, - { - title: '订单管理', - level:'main' - }, - ], - }, - { - title: '管理云开发数据和文件', - tip: '通过云模板,快速实现小程序管理后台所需的CMS内容管理/数据库管理/文件管理等能力。', - showItem: false, - item: [ - { - title: '云存储管理', - level:'main' - }, - { - title: '云数据库管理', - level:'main' - }, - ], - } - ], - envList, - selectedEnv: envList?.[0], - haveCreateCollection: false, - }, - - onClickBusinessInfo(e) { - const index = e.currentTarget.dataset.index; - const businessList = this.data.businessList; - const selectedItem = businessList[index]; - selectedItem.showItem = !selectedItem.showItem; - this.setData({ - businessList, - }); - }, - - jumpBusinessPage(e) { - const { title, subtitle, type,level } = e.currentTarget.dataset; - if (type) { - wx.navigateTo({ - url: `/pages/cloudbaseModuleDetail/index?envId=${this.data.selectedEnv}&type=${type}&title=${title}&subtitle=${subtitle}`, - }); - } else { - console.log(level); - wx.navigateTo({ - url: `/pages/cloudbaseModuleGuide/index?title=${title}&subtitle=${subtitle}&level=${level}`, - }); - } - } -}); diff --git a/miniprogram/pages/business/index.json b/miniprogram/pages/business/index.json deleted file mode 100644 index bfcae2a..0000000 --- a/miniprogram/pages/business/index.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "navigationBarTitleText": "业务示例", - "usingComponents": { - "cloud-tip-modal": "/components/cloudTipModal/index" - } -} \ No newline at end of file diff --git a/miniprogram/pages/business/index.wxml b/miniprogram/pages/business/index.wxml deleted file mode 100644 index 476dda3..0000000 --- a/miniprogram/pages/business/index.wxml +++ /dev/null @@ -1,32 +0,0 @@ - - - 业务示例 - 使用云开发快速实现业务功能 - - - - - {{business.title}} - {{business.tag}} - - {{business.tip}} - - - - - - - - - - {{item.title}} - - - - - - 当前环境 {{ selectedEnv.alias }} - - - - \ No newline at end of file diff --git a/miniprogram/pages/business/index.wxss b/miniprogram/pages/business/index.wxss deleted file mode 100644 index abdcc79..0000000 --- a/miniprogram/pages/business/index.wxss +++ /dev/null @@ -1,142 +0,0 @@ -/**index.wxss**/ - -page { - padding-top: 54rpx; - background-color: #f6f6f6; - padding-bottom: 60rpx; -} - -.container { - font-family: PingFang SC; -} - -.title { - font-family: PingFang SC; - font-weight: 500; - color: #000000; - font-size: 44rpx; - margin-bottom: 40rpx; -} -.function_title { - font-family: PingFang SC; - font-weight: 500; - color: #000000; - font-size: 36rpx; - text-align: left; - width: 93%; - margin-top: 50rpx; -} - -.top_tip { - font-size: 28rpx; - font-family: PingFang SC; - font-weight: 400; - color: #888888; - margin-bottom: 28rpx; -} - -.examples_container { - display: flex; - flex-direction: column; - gap: 16rpx; - width: 100%; - align-items: center; -} - -.example_item { - border: 3rpx solid #e5e5e5; - border-radius: 10rpx; - padding: 24rpx; - width: 90%; - background-color: #fff; - display: flex; - align-items: center; - justify-content: space-between; -} - -.power { - margin-top: 30rpx; - border-radius: 5px; - background-color: white; - width: 93%; - padding-bottom: 1rpx; -} - -.power_info { - display: flex; - padding: 30rpx 25rpx; - align-items: center; - justify-content: space-between; -} - -.power_info_more { - width: 30rpx; - height: 30rpx; - transform: rotate(90deg); -} - -.power_info_less { - width: 30rpx; - height: 30rpx; - transform: rotate(270deg); -} - -.power_info_text { - display: flex; - flex-direction: column; -} - -.power_info_text_title { - margin-bottom: 10rpx; - font-weight: 400; - font-size: 32rpx; - display: flex; - align-items: center; - font-family: 'PingFang SC'; - color: #000; -} - -.power_info_text_tag { - margin-left: 20rpx; - background-color: #fbe0e0; - color: #e54545; - padding: 0 7px; - font-size: 14px; - vertical-align: middle; - border-radius: 3px; -} - -.power_info_text_tip { - color: rgba(0, 0, 0, 0.6); - font-size: 28rpx; - padding-right: 30rpx; -} - -.power_item { - padding: 30rpx 25rpx; - display: flex; - justify-content: space-between; -} - -.power_item_title { - font-size: 28rpx; - color: rgba(0, 0, 0, 0.9); -} - -.power_item_icon { - width: 30rpx; - height: 30rpx; -} - -.line { - width: 95%; - margin: 0 auto; - height: 2rpx; - background-color: rgba(0, 0, 0, 0.1); -} - -.environment { - color: rgba(0, 0, 0, 0.4); - font-size: 24rpx; - margin-top: 25%; -} diff --git a/miniprogram/pages/cloudbaseModuleDetail/index.js b/miniprogram/pages/cloudbaseModuleDetail/index.js deleted file mode 100644 index bf2cd17..0000000 --- a/miniprogram/pages/cloudbaseModuleDetail/index.js +++ /dev/null @@ -1,614 +0,0 @@ -// pages/exampleDetail/index.js -// 云模板未安装错误码 -const CLOUD_MODULE_NOT_INSTALLED = 'InnerError.ResourceNotFound'; - -Page({ - data: { - type: '', - envId: '', - showUploadTip: false, - installModalVisible: false, - installModalTipText: '', - installModuleName: '', - installModulePageTitle: '', - userOpenId: 'ouSoxxxxxxxxxxxxxJp3zM', - currentOpenId:'', - templateId: 'XeULkxnxxxxxxxxxxxxxx9vRO0olhrQi34', - getErrorInfo:'', - securityContent:'hello world!', - securityMedia:'https://developers.weixin.qq.com/miniprogram/assets/images/head_global_z_@all.png', - mediaId:'MEDIA_ID', - sendCustomMessage:'Hello World', - urlLink:'https://wxaurl.cn/difT1VdVOLa', - smsTemplateId:'2053122', - phoneNumber:'+8611111111111', - appid:'appid', - csvLink:'extension://xxx.zip', - qrcode:'', - unlimitedQrcode:'', - qrcodeShortLink:'' - }, - handdleResult: function(data){ - if(data.message.includes('env not exists') || data.message.includes('Environment not found') || data.message.includes('env check invalid be filterd')){ - this.setData({ - showUploadTip: true, - }); - } - wx.hideLoading(); - }, - bindKeyInputCsvLink: function(e){ - this.setData({ - csvLink: e.detail.value - }) - }, - bindKeyInputUrlLink: function(e){ - this.setData({ - urlLink: e.detail.value - }) - }, - bindKeyInputSmsTemplateId: function(e){ - this.setData({ - smsTemplateId: e.detail.value - }) - }, - bindKeyInputPhoneNumber: function(e){ - this.setData({ - phoneNumber: e.detail.value - }) - }, - bindKeyInputAppid: function(e){ - this.setData({ - appid: e.detail.value - }) - }, - bindKeyInputSendCustomMessage: function(e){ - this.setData({ - sendCustomMessage: e.detail.value - }) - }, - bindKeyInputMediaId: function(e){ - this.setData({ - mediaId: e.detail.value - }) - }, - bindKeyInputSecurityMedia: function(e){ - this.setData({ - securityMedia: e.detail.value - }) - }, - bindKeyInputSecurityContent: function(e){ - this.setData({ - securityContent: e.detail.value - }) - }, - bindKeyInputTemplateId: function (e) { - this.setData({ - templateId: e.detail.value - }) - }, - bindKeyInputOpenId: function (e) { - this.setData({ - userOpenId: e.detail.value - }) - }, - clearError: function(){ - this.setData({ - userOpenId: '', - templateId: '', - getErrorInfo:'', - securityMedia:'', - securityContent:'', - mediaId:'', - sendCustomMessage:'', - urlLink:'', - smsTemplateId:'', - phoneNumber:'', - appid:'', - csvLink:'', - qrcode:'', - unlimitedQrcode:'', - qrcodeShortLink:'' - }) - }, - onLoad(options) { - wx.setNavigationBarTitle({ - title: `${options?.title}-${options?.subtitle}` - }) - this.setData({ type: options?.type, envId: options?.envId}); - }, - - // 发送消息 - sendMessage() { - wx.showLoading({ - title: '', - }); - wx.cloud - .callFunction({ - name: 'cloudbase_module', - data: { - name: 'wx_message_send_message', - data: { - template_id: this.data.templateId, // 所需下发的订阅模板id - page: "pages/index/index", //点击模板卡片后的跳转页面,仅限本小程序内的页面。支持带参数,(示例index?foo=bar)。该字段不填则模板无跳转 - touser: this.data.userOpenId, //接收者(用户)的 openid - data:{ "thing1": { "value": 123 }, "thing4": { "value": 123 },"thing6": { "value": 123 },"thing7": { "value": 123 },"time6":{"value": "2022-11-32"} }, //模板内容,格式形如 { "key1": { "value": any }, "key2": { "value": any } }的object - miniprogram_state:"trial", //跳转小程序类型:developer为开发版;trial为体验版;formal为正式版;默认为正式版 - lang:"zh_CN" //进入小程序查看”的语言类型,支持zh_CN(简体中文)、en_US(英文)、zh_HK(繁体中文)、zh_TW(繁体中文),默认为zh_CN - }, - }, - }) - .then((resp) => { - if (resp?.result?.errcode === CLOUD_MODULE_NOT_INSTALLED) { - this.setData({ - installModalVisible: true, - installModalTipText: '云开发>云模板>模板中心>小程序消息', - installModuleName: 'wx_message_send_message', - installModulePageTitle:'小程序消息-发送消息' - }); - }else if(resp?.result?.errcode !== -1){ - wx.showToast({ - title: "发送失败", - icon: 'error', - duration: 2000 - }); - this.setData({ - getErrorInfo:resp?.result?.errmsg, - }) - }else { - wx.showToast({ - title: "发送成功", - icon: 'success', - duration: 2000 - }); - } - wx.hideLoading(); - }) - .catch((e) => { - this.handdleResult(e); - }); - }, - - // 创建activity_id - createMessageActivityId() { - wx.showLoading({ - title: '', - }); - wx.cloud - .callFunction({ - name: 'cloudbase_module', - data: { - name: 'wx_message_create_activity_id', - data: { - openid: this.data.userOpenId, //为私密消息创建activity_id时,指定分享者为openid用户。其余用户不能用此activity_id分享私密消息。openid与unionid填一个即可。私密消息暂不支持云函数生成activity id。 - }, - } - }) - .then((resp) => { - if (resp?.result?.errcode === CLOUD_MODULE_NOT_INSTALLED) { - this.setData({ - installModalVisible: true, - installModalTipText: '云开发>云模板>模板中心>小程序消息', - installModuleName: 'wx_message_send_message', - installModulePageTitle:'小程序消息-创建activity_id' - }); - }else if(resp?.result?.activityId){ - wx.showToast({ - title: "创建成功", - icon: 'success', - duration: 2000 - }); - }else { - wx.showToast({ - title: "创建失败", - icon: 'error', - duration: 2000 - }); - this.setData({ - getErrorInfo:resp?.result?.errmsg, - }) - } - wx.hideLoading(); - }) - .catch((e) => { - this.handdleResult(e); - }); - }, - - // 获取小程序码 - getCodeSrc() { - wx.showLoading({ - title: '', - }); - wx.cloud - .callFunction({ - name: 'cloudbase_module', - data: { - name: 'wx_qrcode_get_qrcode', - data: { - path: 'pages/index/index', // 扫码进入的小程序页面路径,最大长度 1024 个字符,不能为空,scancode_time为系统保留参数,不允许配置;对于小游戏,可以只传入 query 部分,来实现传参效果,如:传入 "?foo=bar",即可在 wx.getLaunchOptionsSync 接口中的 query 参数获取到 {foo:"bar"}。 - width: 430, //二维码的宽度,单位 px。默认值为430,最小 280px,最大 1280px - auto_color: false, //默认值false;自动配置线条颜色,如果颜色依然是黑色,则说明不建议配置主色调 - line_color: { r: 0, g: 0, b: 0 }, //默认值{"r":0,"g":0,"b":0} ;auto_color 为 false 时生效,使用 rgb 设置颜色 例如 {"r":"xxx","g":"xxx","b":"xxx"} 十进制表示 - is_hyaline: false, //默认值false;是否需要透明底色,为 true 时,生成透明底色的小程序码 - env_version: 'trial', //要打开的小程序版本。正式版为 "release",体验版为 "trial",开发版为 "develop"。默认是正式版。 - }, - }, - }) - .then((resp) => { - if (resp?.result?.errcode === CLOUD_MODULE_NOT_INSTALLED) { - this.setData({ - installModalVisible: true, - installModalTipText: '云开发>云模板>模板中心>微信小程序码和链接', - installModuleName: 'wx_qrcode', - installModulePageTitle:'微信小程序码和链接-获取小程序码' - }); - } else { - wx.showToast({ - title: "获取成功", - icon: 'success', - duration: 2000 - }); - this.setData({ - qrcode: resp.result.tempFileURL, - }); - } - wx.hideLoading(); - }) - .catch((e) => { - this.handdleResult(e); - }); - }, - - // 获取不限制的小程序码 - getUnlimitedCodeSrc() { - wx.showLoading({ - title: '', - }); - wx.cloud - .callFunction({ - name: 'cloudbase_module', - data: { - name: 'wx_qrcode_get_unlimited_qrcode', - data: { - scene: 'abc', //最大32个可见字符,只支持数字,大小写英文以及部分特殊字符:!#$&'()*+,/:;=?@-._~,其它字符请自行编码为合法字符(因不支持%,中文无法使用 urlencode 处理,请使用其他编码方式) - page: 'pages/index/index', //默认是主页,页面 page,例如 pages/index/index,根路径前不要填加 /,不能携带参数(参数请放在scene字段里),如果不填写这个字段,默认跳主页面。scancode_time为系统保留参数,不允许配置 - check_path: true, //默认是true,检查page 是否存在,为 true 时 page 必须是已经发布的小程序存在的页面(否则报错);为 false 时允许小程序未发布或者 page 不存在, 但page 有数量上限(60000个)请勿滥用。 - env_version: 'trial', //要打开的小程序版本。正式版为 "release",体验版为 "trial",开发版为 "develop"。默认是正式版。 - width: 430, // 默认430,二维码的宽度,单位 px,最小 280px,最大 1280px - auto_color: false, //自动配置线条颜色,如果颜色依然是黑色,则说明不建议配置主色调,默认 false - line_color: {"r":0,"g":0,"b":0}, //默认是{"r":0,"g":0,"b":0} 。auto_color 为 false 时生效,使用 rgb 设置颜色 例如 {"r":"xxx","g":"xxx","b":"xxx"} 十进制表示 - is_hyaline: false, //默认是false,是否需要透明底色,为 true 时,生成透明底色的小程序 - }, - }, - }) - .then((resp) => { - if (resp?.result?.errcode === CLOUD_MODULE_NOT_INSTALLED) { - this.setData({ - installModalVisible: true, - installModalTipText: '云开发>云模板>模板中心>微信小程序码和链接', - installModuleName: 'wx_qrcode', - installModulePageTitle:'微信小程序码和链接-获取不限制的小程序码' - }); - }else if(resp.result?.errmsg){ - wx.showToast({ - title: "获取失败", - icon: 'error', - duration: 2000 - }); - this.setData({ - getErrorInfo:resp?.result?.errmsg, - }) - } else { - wx.showToast({ - title: "获取成功", - icon: 'success', - duration: 2000 - }); - this.setData({ - unlimitedQrcode: resp.result.tempFileURL, - }); - } - wx.hideLoading(); - }) - .catch((e) => { - this.handdleResult(e); - }); - }, - - // 获取ShortLink - getShortLink() { - wx.showLoading({ - title: '', - }); - wx.cloud - .callFunction({ - name: 'cloudbase_module', - data: { - name: 'wx_qrcode_generate_short_link', - data: { - page_url: 'pages/index/index', // 通过 Short Link 进入的小程序页面路径,必须是已经发布的小程序存在的页面,可携带 query,最大1024个字符 - page_title: '首页', //页面标题,不能包含违法信息,超过20字符会用... 截断代替 - is_permanent: false, //默认值false。生成的 Short Link 类型,短期有效:false,永久有效:true - }, - }, - }) - .then((resp) => { - if (resp?.result?.errcode === CLOUD_MODULE_NOT_INSTALLED) { - this.setData({ - installModalVisible: true, - installModalTipText: '云开发>云模板>模板中心>微信小程序码和链接', - installModuleName: 'wx_qrcode', - installModulePageTitle:'微信小程序码和链接-获取ShortLink' - }); - }else if(resp.result?.errmsg){ - wx.showToast({ - title: "获取失败", - icon: 'error', - duration: 2000 - }); - this.setData({ - getErrorInfo:resp?.result?.errmsg, - }) - } else { - wx.showToast({ - title: "获取成功", - icon: 'success', - duration: 2000 - }); - this.setData({ - qrcodeShortLink: resp.result.tempFileURL, - }); - } - wx.hideLoading(); - }) - .catch((e) => { - this.handdleResult(e); - }); - }, - - -// 发送短信 -sendCloudbaseSms() { - wx.showLoading({ - title: '', - }); - wx.cloud - .callFunction({ - name: 'cloudbase_module', - data: { - name: 'wx_sms_new_send_cloudbase_sms', - data: { - env: this.data.envId, // 环境 ID - url_link: this.data.urlLink, // URL Link - template_id: this.data.smsTemplateId, //短信模版 ID 默认值:2053122(销类短信模版 ID) - template_param_list: ['xxx'], //短信模版变量数组 - phone_number_list: [this.data.phoneNumber], //手机号列表,单次请求最多支持 1000 个境内手机号,手机号必须以+86开头 - use_short_name: false, //是否使用小程序简称 - resource_appid: this.data.appid, //资源方appid,第三方代开发时可填第三方appid或小程序appid,应为所填环境所属的账号APPID - }, - }, - }) - .then((resp) => { - if (resp?.result?.errcode === CLOUD_MODULE_NOT_INSTALLED) { - this.setData({ - installModalVisible: true, - installModalTipText: '云开发>云模板>模板中心>小程序短信', - installModuleName: 'wx_sms_new_send_cloudbase_sms', - installModulePageTitle:'小程序短信-发送短信' - }); - }else if(resp?.result?.errmsg){ - wx.showToast({ - title: "发送失败", - icon: 'error', - duration: 2000 - }); - this.setData({ - getErrorInfo:resp?.result?.errmsg, - }) - }else { - wx.showToast({ - title: "发送成功", - icon: 'success', - duration: 2000 - }); - } - wx.hideLoading(); - }) - .catch((e) => { - this.handdleResult(e); - }); - }, - - // 创建发短信任务 - sendCloudbaseSmsTask() { - wx.showLoading({ - title: '', - }); - wx.cloud - .callFunction({ - name: 'cloudbase_module', - data: { - name: 'wx_sms_create_send_sms_task', - data:{ - env: this.data.envId, // 环境 ID - file_url: this.data.csvLink, //短信 CSV 文件地址CodeUri - template_id: this.data.smsTemplateId, //短信模版 ID 默认值:2053122(销类短信模版 ID) - use_short_name: false //是否使用小程序简称 - } - }, - }) - .then((resp) => { - if (resp?.result?.errcode === CLOUD_MODULE_NOT_INSTALLED) { - this.setData({ - installModalVisible: true, - installModalTipText: '云开发>云模板>模板中心>小程序短信', - installModuleName: 'wx_sms_new_send_cloudbase_sms', - installModulePageTitle:'小程序短信-创建发短信任务' - }); - }else if(resp?.result?.errmsg){ - wx.showToast({ - title: "创建失败", - icon: 'error', - duration: 2000 - }); - this.setData({ - getErrorInfo:resp?.result?.errmsg, - }) - }else { - wx.showToast({ - title: "创建成功", - icon: 'success', - duration: 2000 - }); - } - wx.hideLoading(); - }) - .catch((e) => { - this.handdleResult(e); - }); - }, - - // 文本内容安全识别 - securityMessageCheck() { - wx.showLoading({ - title: '', - }); - wx.cloud - .callFunction({ - name: 'cloudbase_module', - data: { - name: 'wx_security_msg_sec_check', - data: { - scene: 1, // 场景值 1, 代表资料 - version: 2, // 接口版本号,2.0版本为固定值2 - content: this.data.securityContent, // 要检测的内容 - }, - }, - }) - .then((resp) => { - if (resp?.result?.errcode === CLOUD_MODULE_NOT_INSTALLED) { - this.setData({ - installModalVisible: true, - installModalTipText: '云开发>云模板>模板中心>小程序安全能力', - installModuleName: 'wx_security_msg_sec_check', - installModulePageTitle:'小程序安全能力-文本内容安全识别' - }); - }else if(resp?.result?.result?.label === 100){ - wx.showToast({ - title: "内容正常", - icon: 'success', - duration: 2000 - }); - }else{ - wx.showToast({ - title: "内容异常", - icon: 'error', - duration: 2000 - }); - } - wx.hideLoading(); - }) - .catch((e) => { - this.handdleResult(e); - }); - }, - - // 音视频内容安全识别 - securityMediaCheck() { - wx.showLoading({ - title: '', - }); - wx.cloud - .callFunction({ - name: 'cloudbase_module', - data: { - name: 'wx_security_media_check', - data: { - scene: 1, // 场景值 1, 代表资料 - version: 2, // 接口版本号,2.0版本为固定值2 - media_url: this.data.securityMedia, // 要检测的内容 - media_type: 2, //媒体资源类型,2 代表图片图片 - }, - }, - }) - .then((resp) => { - if (resp?.result?.errcode === CLOUD_MODULE_NOT_INSTALLED) { - this.setData({ - installModalVisible: true, - installModalTipText: '云开发>云模板>模板中心>小程序安全能力', - installModuleName: 'wx_security_msg_sec_check', - installModulePageTitle:'小程序安全能力-音视频内容安全识别' - }); - }else if(resp?.result?.errmsg){ - wx.showToast({ - title: "内容异常", - icon: 'error', - duration: 2000 - }); - this.setData({ - getErrorInfo:resp?.result?.errmsg, - }) - }else{ - wx.showToast({ - title: "内容正常", - icon: 'success', - duration: 2000 - }); - } - wx.hideLoading(); - }) - .catch((e) => { - this.handdleResult(e); - }); - }, - - // 获取用户openId - getUserOpenId() { - wx.showLoading({ - title: '', - }); - wx.cloud - .callFunction({ - name: 'cloudbase_module', - data: { - name: 'wx_user_get_open_id', - }, - }) - .then((resp) => { - if (resp?.result?.errcode === CLOUD_MODULE_NOT_INSTALLED) { - this.setData({ - installModalVisible: true, - installModalTipText: '云开发>云模板>模板中心>小程序用户信息', - installModuleName: 'wx_user_get_open_id', - installModulePageTitle:'小程序用户信息-获取用户openId' - }); - }else { - this.setData({ - currentOpenId: resp.result.openId, - }); - } - wx.hideLoading(); - }) - .catch((e) => { - this.handdleResult(e); - }); - }, - - // 手机号快速验证 - getPhoneNumber(e) { - console.log(e.detail.code); // 动态令牌 - wx.cloud.callFunction({ - name: 'cloudbase_module', - data: { - name: 'wx_user_get_phone_number', - data: { - code: e.detail.code, - }, - }, - success: (res) => { - const phoneInfo = res.result?.phoneInfo; - console.log('获取到的手机号信息: ', phoneInfo); - }, - }); - } -}); diff --git a/miniprogram/pages/cloudbaseModuleDetail/index.json b/miniprogram/pages/cloudbaseModuleDetail/index.json deleted file mode 100644 index ddf3965..0000000 --- a/miniprogram/pages/cloudbaseModuleDetail/index.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "usingComponents": { - "cloud-tip-modal": "/components/cloudTipModal/index", - "cloud-module-install-modal": "/components/cloudbaseModuleInstallModal/index", - "cloud-module-install-path": "/components/cloudbaseModuleInstallPath/index" - } -} diff --git a/miniprogram/pages/cloudbaseModuleDetail/index.wxml b/miniprogram/pages/cloudbaseModuleDetail/index.wxml deleted file mode 100644 index f779b81..0000000 --- a/miniprogram/pages/cloudbaseModuleDetail/index.wxml +++ /dev/null @@ -1,213 +0,0 @@ - - - - - 可通过云开发云模板提供的能力,直接获取ShortLink - - - - 获取小程序码 - 可以在”云开发>云模板>模板中心>微信小程序码和链接“找到该模板 - - - - - 可通过云开发云模板提供的能力,直接获取不限制的小程序码 - - - - - 失败原因 - - {{getErrorInfo}} - - - 获取不限制的小程序码 - 可以在”云开发>云模板>模板中心>微信小程序码和链接“找到该模板 - - - - - 可通过云开发云模板提供的能力,直接获取ShortLink - - - - - 失败原因 - - {{getErrorInfo}} - - - 获取ShortLink - 可以在”云开发>云模板>模板中心>微信小程序码和链接“找到该模板 - - - - - 可通过云开发云模板提供的能力,向订阅用户送微信订阅消息。 - - 订阅消息模板Id - - - - - - 消息接收者openId - - - - - - 失败原因 - - {{getErrorInfo}} - - - 发送消息 - 清空 - - - - - - 可通过云开发云模板提供的能力,创建被分享动态消息或私密消息的activity_id。 - - 用户openId - - - - - - 失败原因 - - {{getErrorInfo}} - - - 创建activity_id - 清空 - - - - - - 可通过云开发云模板提供的能力,向用户发送携带 URL Link 的短信。 - - URL Link - - - - - - 短信模版ID - - - - - - 手机号 - - - - - - APPID - - - - - - 失败原因 - - {{getErrorInfo}} - - - 发送短信 - 清空 - - - - - - 可通过云开发云模板提供的能力,创建发短信任务。发送的短信支持打开云开发静态网站 H5,进而在 H5 里可以打开小程序。 - - 短信CSV文件地址 - - - - - - 短信模版ID - - - - - - 失败原因 - - {{getErrorInfo}} - - - 创建发送短信任务 - 清空 - - - - - - 可通过云开发云模板提供的能力,检查一段文本是否含有违法违规内容。 - - 文本内容 - - - - - - - 文本内容安全识别 - - - - - - 可通过云开发云模板提供的能力,异步校验图片/音频是否含有违法违规内容。 - - 文件url地址 - - - - - - 失败原因 - - {{getErrorInfo}} - - - 音视频内容安全识别 - 清空 - - - - - - 可通过云开发云模板提供的能力,获取用户的openId。 - openId将展示在这里 - - {{currentOpenId}} - - 获取openId - - - - - - 可通过云开发云模板提供的能力,将code换取用户手机号。每个code只能使用一次,code的有效期为5min。 - - - - - - - - - - diff --git a/miniprogram/pages/cloudbaseModuleDetail/index.wxss b/miniprogram/pages/cloudbaseModuleDetail/index.wxss deleted file mode 100644 index 84bd394..0000000 --- a/miniprogram/pages/cloudbaseModuleDetail/index.wxss +++ /dev/null @@ -1,153 +0,0 @@ -.container { - width: 100%; - height: 100%; - align-items: center; -} -.container { - display: flex; - flex-direction: column; - align-items: center; - box-sizing: border-box; -} - -.main { - width: 90%; - display: flex; - flex-direction: column; - font-family: PingFang SC; -} - -.tip { - font-size: 23rpx; - color: rgba(0, 0, 0, 0.5); - text-align: center; - margin: 30rpx auto 0 auto; -} - -.top_tip { - font-size: 28rpx; - color: rgba(0, 0, 0, 0.6); - text-align: left; - margin: 30rpx auto 0; -} - -.box_text { - background-color: white; - text-align: center; - padding: 300rpx 0; - margin-top: 30rpx; - color: rgba(0, 0, 0, 0.5); -} - -.button { - width: 450rpx; - text-align: center; - margin: 60rpx auto 0 auto; - height: 80rpx; - color: white; - border-radius: 5px; - line-height: 80rpx; - background-color: #07c160; -} - -.button_phone { - text-align: center; - margin: 250rpx auto 0 auto; - color: white; - border-radius: 5px; - background-color: #07c160; - font-weight: normal; -} - -.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); -} - -.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; -} - -.title { - margin-top: 16px; - font-size: 36rpx; - font-weight: 500; - color: #000; -} - -.info { - margin-top: 12px; - font-size: 28rpx; - font-weight: 400; - color: rgba(0, 0, 0, 0.6); - line-height: 52rpx; -} - -.img { - margin-top: 16px; - width: 100%; -} - -.code_img { - width: 360rpx; - height: 360rpx; -} - -.page-section { - width: 100%; - text-align: left; - margin: 20rpx auto 0; - font-size: 28rpx; -} -.weui-cells__title { - margin: 10rpx 0; - color: rgba(0, 0, 0, 0.6); -} -.weui-cells_after-title { - border: 1px solid #ddd; - padding: 10rpx; - color: rgba(0, 0, 0, 0.6); -} - -.weui-cells_after-error { - color: red; -} \ No newline at end of file diff --git a/miniprogram/pages/cloudbaseModuleGuide/index.js b/miniprogram/pages/cloudbaseModuleGuide/index.js deleted file mode 100644 index 0b1e0ed..0000000 --- a/miniprogram/pages/cloudbaseModuleGuide/index.js +++ /dev/null @@ -1,21 +0,0 @@ -// pages/cloudbaseModuleGuide/index.js -Page({ - - /** - * 页面的初始数据 - */ - data: { - title:'', - level:'' - }, - - /** - * 生命周期函数--监听页面加载 - */ - onLoad(options) { - wx.setNavigationBarTitle({ - title: options?.level === 'main'?options?.subtitle:`${options?.title}-${options?.subtitle}` - }) - this.setData({ title: options?.level === 'main'?options?.subtitle:options?.title}); - } -}) \ No newline at end of file diff --git a/miniprogram/pages/cloudbaseModuleGuide/index.json b/miniprogram/pages/cloudbaseModuleGuide/index.json deleted file mode 100644 index 8835af0..0000000 --- a/miniprogram/pages/cloudbaseModuleGuide/index.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "usingComponents": {} -} \ No newline at end of file diff --git a/miniprogram/pages/cloudbaseModuleGuide/index.wxml b/miniprogram/pages/cloudbaseModuleGuide/index.wxml deleted file mode 100644 index 2fc3973..0000000 --- a/miniprogram/pages/cloudbaseModuleGuide/index.wxml +++ /dev/null @@ -1,23 +0,0 @@ - - - 1、进入云开发 - - - - 2、进入云模板 - - - - 3、在模板中心 -> 管理后台,找到 {{title}} - - - - - - - - - - 4、进入模板详情页,点击 安装模板,等待安装完成即可使用。 - - \ No newline at end of file diff --git a/miniprogram/pages/cloudbaseModuleGuide/index.wxss b/miniprogram/pages/cloudbaseModuleGuide/index.wxss deleted file mode 100644 index c25addf..0000000 --- a/miniprogram/pages/cloudbaseModuleGuide/index.wxss +++ /dev/null @@ -1,48 +0,0 @@ -.container { - width: 100%; - height: 100%; - align-items: center; -} -.container { - display: flex; - flex-direction: column; - align-items: center; - box-sizing: border-box; -} - -.main { - width: 90%; - display: flex; - flex-direction: column; - font-family: PingFang SC; -} - -.sub_title { - font-size: 28rpx; - color: rgba(0, 0, 0, 0.6); - line-height: 52rpx; -} - -.font_title_2 { - color: #000; - font-size: 32rpx; - font-weight: 500; - font-family: "PingFang SC"; -} -.title { - margin-bottom: 20rpx; - margin-top: 40rpx; -} - -.image_container { - display: flex; - justify-content: center; -} - - - - - - - - diff --git a/miniprogram/pages/cloudbaseModuleInstallTips/index.js b/miniprogram/pages/cloudbaseModuleInstallTips/index.js deleted file mode 100644 index 394aafe..0000000 --- a/miniprogram/pages/cloudbaseModuleInstallTips/index.js +++ /dev/null @@ -1,12 +0,0 @@ -Page({ - data: { - moduleName: '', - title:'', - }, - onLoad(options) { - wx.setNavigationBarTitle({ - title: options?.title - }) - this.setData({ moduleName: options?.moduleName, title: options?.title.split('-')[0] }); - }, -}); diff --git a/miniprogram/pages/cloudbaseModuleInstallTips/index.json b/miniprogram/pages/cloudbaseModuleInstallTips/index.json deleted file mode 100644 index 9d572fa..0000000 --- a/miniprogram/pages/cloudbaseModuleInstallTips/index.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "usingComponents": { - "cloud-tip-modal": "/components/cloudTipModal/index", - "cloud-module-install-modal": "/components/cloudbaseModuleInstallModal/index" - } -} diff --git a/miniprogram/pages/cloudbaseModuleInstallTips/index.wxml b/miniprogram/pages/cloudbaseModuleInstallTips/index.wxml deleted file mode 100644 index 814eb83..0000000 --- a/miniprogram/pages/cloudbaseModuleInstallTips/index.wxml +++ /dev/null @@ -1,27 +0,0 @@ - - - 1、进入云开发 - - - - 2、进入云模板 - - - - 3、在模板中心 -> 小程序基础能力,找到 {{title}} - - - - - - - - - - - - - 4、进入模板详情页,点击 安装模板,等待安装完成即可使用。 - - - diff --git a/miniprogram/pages/cloudbaseModuleInstallTips/index.wxss b/miniprogram/pages/cloudbaseModuleInstallTips/index.wxss deleted file mode 100644 index f9c5735..0000000 --- a/miniprogram/pages/cloudbaseModuleInstallTips/index.wxss +++ /dev/null @@ -1,58 +0,0 @@ -.container { - width: 100%; - height: 100%; - align-items: center; -} -.container { - display: flex; - flex-direction: column; - align-items: center; - box-sizing: border-box; -} - -.main { - width: 90%; - display: flex; - flex-direction: column; - font-family: PingFang SC; -} - -.sub_title { - font-size: 28rpx; - color: rgba(0, 0, 0, 0.6); - line-height: 52rpx; -} - -.font_title_2 { - color: #000; - font-size: 32rpx; - font-weight: 500; - font-family: "PingFang SC"; -} -.title { - margin-bottom: 20rpx; - margin-top: 40rpx; -} - -.image_container { - display: flex; - justify-content: center; -} - - - - - - - - - - -.code_worn { - font-weight: bold; - color: #dd0000; -} - -.margin_10 { - margin-top: 20rpx; -} \ No newline at end of file diff --git a/miniprogram/pages/deployService/index.js b/miniprogram/pages/deployService/index.js deleted file mode 100644 index 133cd5d..0000000 --- a/miniprogram/pages/deployService/index.js +++ /dev/null @@ -1,11 +0,0 @@ -// miniprogram/pages/deployService/index.js -Page({ - - /** - * 页面的初始数据 - */ - data: { - - }, - -}); diff --git a/miniprogram/pages/deployService/index.json b/miniprogram/pages/deployService/index.json deleted file mode 100644 index 8835af0..0000000 --- a/miniprogram/pages/deployService/index.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "usingComponents": {} -} \ No newline at end of file diff --git a/miniprogram/pages/deployService/index.wxml b/miniprogram/pages/deployService/index.wxml deleted file mode 100644 index 476e764..0000000 --- a/miniprogram/pages/deployService/index.wxml +++ /dev/null @@ -1,10 +0,0 @@ - - - 功能介绍 - 云托管是全托管的容器服务,支持任何语言及框架运行,只需将已有业务代码打包上传,即可快速迁移。 - 如何体验 - 步骤一:切换按量付费,打开“云开发控制台>设置>环境设置”找到按量付费,点击切换。 - - 步骤二:开通云托管,体验相关能力 - - diff --git a/miniprogram/pages/deployService/index.wxss b/miniprogram/pages/deployService/index.wxss deleted file mode 100644 index cccbedd..0000000 --- a/miniprogram/pages/deployService/index.wxss +++ /dev/null @@ -1,29 +0,0 @@ -/* 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: 12px; -} \ No newline at end of file diff --git a/miniprogram/pages/exampleDetail/index.js b/miniprogram/pages/exampleDetail/index.js deleted file mode 100644 index a864582..0000000 --- a/miniprogram/pages/exampleDetail/index.js +++ /dev/null @@ -1,172 +0,0 @@ -// pages/exampleDetail/index.js -Page({ - data: { - type: '', - envId: '', - showUploadTip: false, - - haveGetOpenId: false, - openId: '', - - haveGetCodeSrc: false, - codeSrc: '', - - haveGetRecord: false, - record: '', - - haveGetImgSrc: false, - imgSrc: '', - }, - - onLoad(options) { - this.setData({ type: options?.type, 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: '' - }); - }, - - 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: '' - }); - }, - - 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: '' - }); - }, - - 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: '' - }); - }, - - goOfficialWebsite() { - const url = 'https://docs.cloudbase.net/toolbox/quick-start'; - wx.navigateTo({ - url: `../web/index?url=${url}`, - }); - }, - -}) \ No newline at end of file diff --git a/miniprogram/pages/exampleDetail/index.json b/miniprogram/pages/exampleDetail/index.json deleted file mode 100644 index 3ea1434..0000000 --- a/miniprogram/pages/exampleDetail/index.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "usingComponents": { - "cloud-tip-modal": "/components/cloudTipModal/index" - } -} \ No newline at end of file diff --git a/miniprogram/pages/exampleDetail/index.wxml b/miniprogram/pages/exampleDetail/index.wxml deleted file mode 100644 index 8ab7aed..0000000 --- a/miniprogram/pages/exampleDetail/index.wxml +++ /dev/null @@ -1,111 +0,0 @@ - - - - 无需维护鉴权机制及登录票据,仅一行代码即可获得。 - {{ openId ? openId : 'OpenID将展示在这里' }} - 获取OpenId - 清空 - 在”资源管理器>cloudfunctions>quickstartFunctions>getOpenId>index.js“找到获取openId函数,体验该能力 - - - - - - - 可通过云函数免接口调用凭证,直接生成小程序码。 - 小程序码将展示在这里 - - - - 生成小程序码 - 清空 - 在”资源管理器>cloudfunctions>quickstartFunctions>getMiniProgramCode>index.js“找到获取小程序码函数,体验该能力 - - - - - - - 功能介绍 - 集合为常用数据库中表的概念。云开发数据库支持自动备份、无损回档,并且QPS高达3千+。 - 如何体验 - 已自动创建名为“sales”的体验合集,可打开“云开发控制台>数据库>记录列表”中找到该集合。 - - - - - - - 体验查询记录能力,查询数据表中的销量数据。 - 销量数据将展示在这里 - - 地区销量统计 - - 地域 - 城市 - 销量 - - - - {{item.region}} - {{item.city}} - {{item.sales}} - - - 查询记录 - 清空 - 在”资源管理器>cloudfunctions>quickstartFunctions>selectRecord>index.js“找到查询记录函数,体验该能力 - - - - - - - 多存储类型,仅需一个云函数即可完成上传。 - 上传的图片将展示在这里 - - - - 文件路径 - {{imgSrc}} - - - 上传一张图片 - 清空 - 在“资源管理器>miniprogram>pages>uploadFile>index.js”找到相应代码,体验该能力 - - - - - - - - 功能介绍 - 云开发针对小程序中常见的页面,如抽奖、邀请函、用户中心等内嵌页面,提供了一套业务模板+定制修改工具。 - - 您可以使用云模板快速搭建各类场景的小程序页面,例如抽奖、签到、邀请函、领红包等等。云模板支持通过可视化编辑工具,自定义页面内容和样式,实现个性化定制。 - - 如何使用 - 在资源管理器内找到pages文件夹,右键单击后选择「使用云模板或AI配置页面」或「配置单页模板」。 - - 💡PS:如果您找不到此选项,请将微信开发者工具更新至最新Nightly版本。 - - - - - - 功能介绍 - 云后台提供了开箱即用的运营管理系统,涵盖小程序后台管理、微信支付管理、公众号管理等场景。 - 开通后的云后台支持从 Web 网页登录,支持分配运营人员账号和权限管理。 - 开发者还可基于低代码工具开发运营系统内的应用,拖拽组件生成前端 UI,从而定制各类管理端应用。 - - - 如何体验 - 打开云开发控制台,在控制台顶部菜单里选择并打开「云后台」,点击「去使用」。 - - 如果您是首次安装,将会进入到开通流程中。在开通流程里,选择您需要的应用,然后点击开通即可。 - - 您也可以查看云后台文档获得更多使用说明。 - - - \ No newline at end of file diff --git a/miniprogram/pages/exampleDetail/index.wxss b/miniprogram/pages/exampleDetail/index.wxss deleted file mode 100644 index 83c15b3..0000000 --- a/miniprogram/pages/exampleDetail/index.wxss +++ /dev/null @@ -1,118 +0,0 @@ -page { - background-color: white; - padding-bottom: 50px; - font-family: PingFang SC; -} - -.page-container { - padding: 20rpx 40rpx; -} - -.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); -} - -.line { - height: 1rpx; - width: 100%; - background-color: rgba(0, 0, 0, 0.1); -} - -.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; -} - -.title { - margin-top: 16px; - font-size: 36rpx; - font-weight: 500; - color: #000; -} - -.info { - margin-top: 12px; - font-size: 28rpx; - font-weight: 400; - color: rgba(0, 0, 0, 0.6); - line-height: 52rpx; -} - -.img { - margin-top: 16px; - width: 100%; -} - -.code_img { - width: 360rpx; - height: 360rpx; -} \ No newline at end of file diff --git a/miniprogram/pages/examples/index.js b/miniprogram/pages/examples/index.js deleted file mode 100644 index 434e440..0000000 --- a/miniprogram/pages/examples/index.js +++ /dev/null @@ -1,180 +0,0 @@ -// index.js -// const app = getApp() -const { envList } = require('../../envList.js'); - -Page({ - data: { - showUploadTip: false, - powerList: [ - { - title: '云函数', - tip: '安全、免鉴权运行业务代码', - showItem: false, - item: [ - { - type: 'getOpenId', - title: '获取OpenId', - }, - { - type: 'getMiniProgramCode', - title: '生成小程序码', - }, - ], - }, - { - title: '数据库', - tip: '安全稳定的文档型数据库', - showItem: false, - item: [ - { - type: 'createCollection', - title: '创建集合', - }, - { - type: 'selectRecord', - title: '查询记录', - }, - { - title: '更新记录', - page: 'updateRecord', - }, - { - title: '聚合操作', - page: 'sumRecord', - }, - ], - }, - { - title: '云存储', - tip: '自带CDN加速文件存储', - showItem: false, - item: [ - { - type: 'uploadFile', - title: '上传文件', - }, - ], - }, - { - type: 'singleTemplate', - title: '云模板', - tip: '基于页面模板,快速配置、搭建小程序页面', - tag: 'new', - }, - { - type: 'cloudBackend', - title: '云后台', - tip: '开箱即用的小程序后台管理系统', - }, - { - title: '云托管', - tip: '不限语言的全托管容器服务', - link: 'https://cloud.weixin.qq.com/cloudrun', - }, - ], - envList, - selectedEnv: envList?.[0], - haveCreateCollection: false, - }, - onClickPowerInfo(e) { - const index = e.currentTarget.dataset.index; - const powerList = this.data.powerList; - const selectedItem = powerList[index]; - selectedItem.showItem = !selectedItem.showItem; - if (selectedItem.link) { - wx.navigateTo({ - url: `../web/index?url=${selectedItem.link}&title=${selectedItem.title}`, - }); - } else if (selectedItem.type) { - wx.navigateTo({ - url: `/pages/exampleDetail/index?envId=${this.data.selectedEnv?.envId}&type=${selectedItem.type}`, - }); - } else if (selectedItem.page) { - wx.navigateTo({ - url: `/pages/${selectedItem.page}/index`, - }); - } else if ( - selectedItem.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) { - const { type, page } = e.currentTarget.dataset; - if (type) { - wx.navigateTo({ - url: `/pages/exampleDetail/index?envId=${this.data.selectedEnv?.envId}&type=${type}`, - }); - } else { - wx.navigateTo({ - url: `/pages/${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) => { - this.setData({ - showUploadTip: true, - }); - wx.hideLoading(); - }); - }, -}); diff --git a/miniprogram/pages/examples/index.json b/miniprogram/pages/examples/index.json deleted file mode 100644 index 6112712..0000000 --- a/miniprogram/pages/examples/index.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "navigationBarTitleText": "基础能力", - "usingComponents": { - "cloud-tip-modal": "/components/cloudTipModal/index" - } -} \ No newline at end of file diff --git a/miniprogram/pages/examples/index.wxml b/miniprogram/pages/examples/index.wxml deleted file mode 100644 index a4d189a..0000000 --- a/miniprogram/pages/examples/index.wxml +++ /dev/null @@ -1,33 +0,0 @@ - - - 快速了解云开发 - 免鉴权接口调用 免部署后台 高并发 - - - - - {{power.title}} - {{power.tag}} - - {{power.tip}} - - - - - - - - - - {{item.title}} - - - - - - - 当前环境 {{ selectedEnv.alias }} - - - - \ No newline at end of file diff --git a/miniprogram/pages/examples/index.wxss b/miniprogram/pages/examples/index.wxss deleted file mode 100644 index abdcc79..0000000 --- a/miniprogram/pages/examples/index.wxss +++ /dev/null @@ -1,142 +0,0 @@ -/**index.wxss**/ - -page { - padding-top: 54rpx; - background-color: #f6f6f6; - padding-bottom: 60rpx; -} - -.container { - font-family: PingFang SC; -} - -.title { - font-family: PingFang SC; - font-weight: 500; - color: #000000; - font-size: 44rpx; - margin-bottom: 40rpx; -} -.function_title { - font-family: PingFang SC; - font-weight: 500; - color: #000000; - font-size: 36rpx; - text-align: left; - width: 93%; - margin-top: 50rpx; -} - -.top_tip { - font-size: 28rpx; - font-family: PingFang SC; - font-weight: 400; - color: #888888; - margin-bottom: 28rpx; -} - -.examples_container { - display: flex; - flex-direction: column; - gap: 16rpx; - width: 100%; - align-items: center; -} - -.example_item { - border: 3rpx solid #e5e5e5; - border-radius: 10rpx; - padding: 24rpx; - width: 90%; - background-color: #fff; - display: flex; - align-items: center; - justify-content: space-between; -} - -.power { - margin-top: 30rpx; - border-radius: 5px; - background-color: white; - width: 93%; - padding-bottom: 1rpx; -} - -.power_info { - display: flex; - padding: 30rpx 25rpx; - align-items: center; - justify-content: space-between; -} - -.power_info_more { - width: 30rpx; - height: 30rpx; - transform: rotate(90deg); -} - -.power_info_less { - width: 30rpx; - height: 30rpx; - transform: rotate(270deg); -} - -.power_info_text { - display: flex; - flex-direction: column; -} - -.power_info_text_title { - margin-bottom: 10rpx; - font-weight: 400; - font-size: 32rpx; - display: flex; - align-items: center; - font-family: 'PingFang SC'; - color: #000; -} - -.power_info_text_tag { - margin-left: 20rpx; - background-color: #fbe0e0; - color: #e54545; - padding: 0 7px; - font-size: 14px; - vertical-align: middle; - border-radius: 3px; -} - -.power_info_text_tip { - color: rgba(0, 0, 0, 0.6); - font-size: 28rpx; - padding-right: 30rpx; -} - -.power_item { - padding: 30rpx 25rpx; - display: flex; - justify-content: space-between; -} - -.power_item_title { - font-size: 28rpx; - color: rgba(0, 0, 0, 0.9); -} - -.power_item_icon { - width: 30rpx; - height: 30rpx; -} - -.line { - width: 95%; - margin: 0 auto; - height: 2rpx; - background-color: rgba(0, 0, 0, 0.1); -} - -.environment { - color: rgba(0, 0, 0, 0.4); - font-size: 24rpx; - margin-top: 25%; -} diff --git a/miniprogram/pages/goods-list/index.js b/miniprogram/pages/goods-list/index.js deleted file mode 100644 index b3d4082..0000000 --- a/miniprogram/pages/goods-list/index.js +++ /dev/null @@ -1,39 +0,0 @@ -Page({ - data: { - goodsList: [{ - _id: '1', - title: '商品1', - price: 1, - }], - }, - - onLoad() { - // this.fetchGoodsList(); - }, - - async fetchGoodsList() { - this.setData({ isLoading: true }); - const res = await wx.cloud.callFunction({ - name: 'quickstartFunctions', - data: { type: 'fetchGoodsList' }, - }); - const goodsList = res?.result?.dataList || []; - this.setData({ - isLoading: false, - goodsList - }); - }, - - async generateMPCode() { - wx.showLoading(); - const resp = await wx.cloud.callFunction({ - name: 'quickstartFunctions', - data: { - type: 'genMpQrcode', - pagePath: 'pages/goods-list/index', - } - }); - this.setData({ codeModalVisible: true, codeImageSrc: resp?.result }); - wx.hideLoading(); - }, -}); \ No newline at end of file diff --git a/miniprogram/pages/goods-list/index.json b/miniprogram/pages/goods-list/index.json deleted file mode 100644 index 30a4231..0000000 --- a/miniprogram/pages/goods-list/index.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "navigationBarTitleText": "商品列表", - "usingComponents": { - "cloud-tip-modal": "/components/cloudTipModal/index", - "mp-code-modal": "/components/mpCodeModal/index" - } -} \ No newline at end of file diff --git a/miniprogram/pages/goods-list/index.wxml b/miniprogram/pages/goods-list/index.wxml deleted file mode 100644 index 2231c21..0000000 --- a/miniprogram/pages/goods-list/index.wxml +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - 加载中... - - - - - - - - - - - - {{ goodsDetail.title }} - - - ¥ - {{ goodsDetail.price / 100 }} - - 分享 - - - - - - - - 暂无数据,请按照快速入门教程操作并查看效果 - - - - - - - - - 参考快速开始教程,快速了解使用云开发开发小程序 - \ No newline at end of file diff --git a/miniprogram/pages/goods-list/index.wxss b/miniprogram/pages/goods-list/index.wxss deleted file mode 100644 index b7b9397..0000000 --- a/miniprogram/pages/goods-list/index.wxss +++ /dev/null @@ -1,104 +0,0 @@ -/**index.wxss**/ - -page { - padding-top: 54rpx; - background-color: #fff; - padding-bottom: 60rpx; -} - -.container { - width: 100%; - overflow: scroll; -} - -.tip_text { - width: 100%; - height: 400rpx; - line-height: 400rpx; - text-align: center; - color: rgba(0, 0, 0, 0.5); - font-size: 28rpx; -} - -.goods-list { - width: 100%; - display: flex; - flex-wrap: wrap; -} - -.goods-item { - width: calc(50% - 30px); - display: flex; - flex-direction: column; - gap: 16rpx; - align-items: center; - box-sizing: border-box; - margin-bottom: 20px; -} - -.goods-item.even { - margin-left: 20px; - margin-right: 10px; -} - -.goods-item.odd { - margin-left: 10px; - margin-right: 20px; -} - -.goods-image { - width: 100%; -} - -.goods-title { - font-family: "PingFang SC"; - font-size: 14px; - font-style: normal; - font-weight: 400; - text-align: left; - width: 100%; -} - -.goods-bottom-container { - display: flex; - align-items: center; - justify-content: space-between; - width: 100%; -} - -.goods-price { - display: flex; - align-items: center; - gap: 4rpx; - font-family: "PingFang SC"; - font-size: 14px; - color: rgba(0, 0, 0, 0.9); - font-weight: 600; -} - -.price-symbol { - font-size: 24rpx; -} - -.btn-share { - width: 60px; - height: 24px; - line-height: 24px; - border: 1px solid #07C160; - text-align: center; - border-radius: 2px; - font-size: 28rpx; - color: #07C160; -} - - -.bottom_tips { - width: 100%; - text-align: center; - font-size: 28rpx; - color: rgba(0, 0, 0, 0.7); - position: absolute; - bottom: 100rpx; - left: 50%; - transform: translateX(-50%); -} \ No newline at end of file diff --git a/miniprogram/pages/sumRecord/index.js b/miniprogram/pages/sumRecord/index.js deleted file mode 100644 index 4ee28ce..0000000 --- a/miniprogram/pages/sumRecord/index.js +++ /dev/null @@ -1,48 +0,0 @@ -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}`, - }); - }, - -}); diff --git a/miniprogram/pages/sumRecord/index.json b/miniprogram/pages/sumRecord/index.json deleted file mode 100644 index b2e58f0..0000000 --- a/miniprogram/pages/sumRecord/index.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "navigationBarTitleText": "聚合记录", - "usingComponents": { - "cloud-tip-modal": "/components/cloudTipModal/index" - } -} \ No newline at end of file diff --git a/miniprogram/pages/sumRecord/index.wxml b/miniprogram/pages/sumRecord/index.wxml deleted file mode 100644 index 467c63b..0000000 --- a/miniprogram/pages/sumRecord/index.wxml +++ /dev/null @@ -1,21 +0,0 @@ - - 常用数据库中的groupby操作,体验按地域聚合数据。 - 数据将展示在这里 - - 地区销量统计 - - 地域 - 城市 - 销量 - - - - {{item.region}} - {{item.city}} - {{item.sales}} - - - 聚合记录 - 在”资源管理器>cloudfunctions>quickstartFunctions>sumRecord>index.js“找到聚合记录函数,体验该能力 - - diff --git a/miniprogram/pages/sumRecord/index.wxss b/miniprogram/pages/sumRecord/index.wxss deleted file mode 100644 index 02d5527..0000000 --- a/miniprogram/pages/sumRecord/index.wxss +++ /dev/null @@ -1,83 +0,0 @@ -.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); -} diff --git a/miniprogram/pages/sumRecordResult/index.js b/miniprogram/pages/sumRecordResult/index.js deleted file mode 100644 index d2dcc09..0000000 --- a/miniprogram/pages/sumRecordResult/index.js +++ /dev/null @@ -1,46 +0,0 @@ -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(); - }, - -}); diff --git a/miniprogram/pages/sumRecordResult/index.json b/miniprogram/pages/sumRecordResult/index.json deleted file mode 100644 index b2e58f0..0000000 --- a/miniprogram/pages/sumRecordResult/index.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "navigationBarTitleText": "聚合记录", - "usingComponents": { - "cloud-tip-modal": "/components/cloudTipModal/index" - } -} \ No newline at end of file diff --git a/miniprogram/pages/sumRecordResult/index.wxml b/miniprogram/pages/sumRecordResult/index.wxml deleted file mode 100644 index 2e32aac..0000000 --- a/miniprogram/pages/sumRecordResult/index.wxml +++ /dev/null @@ -1,19 +0,0 @@ - - 常用数据库中的groupby操作,体验按地域聚合数据。 - 数据将展示在这里 - - 地区销量统计 - - 地域 - 销量 - - - - {{item._id}} - {{item.sum}} - - - 返回上一步 - 在”资源管理器>cloudfunctions>quickstartFunctions>sumRecord>index.js“找到聚合记录函数,体验该能力 - - diff --git a/miniprogram/pages/sumRecordResult/index.wxss b/miniprogram/pages/sumRecordResult/index.wxss deleted file mode 100644 index 49ba9e3..0000000 --- a/miniprogram/pages/sumRecordResult/index.wxss +++ /dev/null @@ -1,73 +0,0 @@ -.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); -} diff --git a/miniprogram/pages/updateRecord/index.js b/miniprogram/pages/updateRecord/index.js deleted file mode 100644 index e27c4c8..0000000 --- a/miniprogram/pages/updateRecord/index.js +++ /dev/null @@ -1,51 +0,0 @@ -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}`, - }); - }, - -}); diff --git a/miniprogram/pages/updateRecord/index.json b/miniprogram/pages/updateRecord/index.json deleted file mode 100644 index d7969cb..0000000 --- a/miniprogram/pages/updateRecord/index.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "navigationBarTitleText": "更新记录", - "usingComponents": { - "cloud-tip-modal": "/components/cloudTipModal/index" - } -} \ No newline at end of file diff --git a/miniprogram/pages/updateRecord/index.wxml b/miniprogram/pages/updateRecord/index.wxml deleted file mode 100644 index 4a62aa6..0000000 --- a/miniprogram/pages/updateRecord/index.wxml +++ /dev/null @@ -1,21 +0,0 @@ - - 体验更新字段记录能力,更新数据表中的销量数据。 - 数据将展示在这里 - - 地区销量统计 - - 地域 - 城市 - 销量 - - - - {{item.region}} - {{item.city}} - {{item.sales}} - - - 修改数据 - 在”资源管理器>cloudfunctions>quickstartFunctions>updateRecord>index.js“找到查询记录函数,体验该能力 - - diff --git a/miniprogram/pages/updateRecord/index.wxss b/miniprogram/pages/updateRecord/index.wxss deleted file mode 100644 index 02d5527..0000000 --- a/miniprogram/pages/updateRecord/index.wxss +++ /dev/null @@ -1,83 +0,0 @@ -.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); -} diff --git a/miniprogram/pages/updateRecordResult/index.js b/miniprogram/pages/updateRecordResult/index.js deleted file mode 100644 index a200e6e..0000000 --- a/miniprogram/pages/updateRecordResult/index.js +++ /dev/null @@ -1,78 +0,0 @@ -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 - }); - }, - -}); diff --git a/miniprogram/pages/updateRecordResult/index.json b/miniprogram/pages/updateRecordResult/index.json deleted file mode 100644 index d7969cb..0000000 --- a/miniprogram/pages/updateRecordResult/index.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "navigationBarTitleText": "更新记录", - "usingComponents": { - "cloud-tip-modal": "/components/cloudTipModal/index" - } -} \ No newline at end of file diff --git a/miniprogram/pages/updateRecordResult/index.wxml b/miniprogram/pages/updateRecordResult/index.wxml deleted file mode 100644 index 97ebbab..0000000 --- a/miniprogram/pages/updateRecordResult/index.wxml +++ /dev/null @@ -1,21 +0,0 @@ - - 体验更新字段记录能力,更新数据表中的销量数据。 - 数据将展示在这里 - - 地区销量统计 - - 地域 - 城市 - 销量 - - - - {{item.region}} - {{item.city}} - - - - 更新 - 在”资源管理器>cloudfunctions>quickstartFunctions>updateRecord>index.js“找到查询记录函数,体验该能力 - - diff --git a/miniprogram/pages/updateRecordResult/index.wxss b/miniprogram/pages/updateRecordResult/index.wxss deleted file mode 100644 index 95e89fa..0000000 --- a/miniprogram/pages/updateRecordResult/index.wxss +++ /dev/null @@ -1,72 +0,0 @@ -.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); -} diff --git a/miniprogram/pages/updateRecordSuccess/index.js b/miniprogram/pages/updateRecordSuccess/index.js deleted file mode 100644 index b4ebffd..0000000 --- a/miniprogram/pages/updateRecordSuccess/index.js +++ /dev/null @@ -1,16 +0,0 @@ -Page({ - - /** - * 页面的初始数据 - */ - data: { - - }, - - goBack() { - wx.navigateBack({ - delta: 2 - }); - }, - -}); diff --git a/miniprogram/pages/updateRecordSuccess/index.json b/miniprogram/pages/updateRecordSuccess/index.json deleted file mode 100644 index d7969cb..0000000 --- a/miniprogram/pages/updateRecordSuccess/index.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "navigationBarTitleText": "更新记录", - "usingComponents": { - "cloud-tip-modal": "/components/cloudTipModal/index" - } -} \ No newline at end of file diff --git a/miniprogram/pages/updateRecordSuccess/index.wxml b/miniprogram/pages/updateRecordSuccess/index.wxml deleted file mode 100644 index 297640c..0000000 --- a/miniprogram/pages/updateRecordSuccess/index.wxml +++ /dev/null @@ -1,6 +0,0 @@ - - - 地区销量统计更新成功 - 可在“云开发控制台>数据库>记录列表”中进行查看 - 我知道了 - diff --git a/miniprogram/pages/updateRecordSuccess/index.wxss b/miniprogram/pages/updateRecordSuccess/index.wxss deleted file mode 100644 index 9334db1..0000000 --- a/miniprogram/pages/updateRecordSuccess/index.wxss +++ /dev/null @@ -1,30 +0,0 @@ -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); -} \ No newline at end of file diff --git a/miniprogram/pages/web/index.js b/miniprogram/pages/web/index.js deleted file mode 100644 index eb7a4de..0000000 --- a/miniprogram/pages/web/index.js +++ /dev/null @@ -1,21 +0,0 @@ -const app = getApp(); -let that = null; -Page({ - onLoad(options) { - that = this; - if (options.url != null) { - this.setData({ - webUrl: options.url, - }); - if (options.title != null) { - wx.setNavigationBarTitle({ - title: options.title, - }); - } - } else { - wx.navigateBack({ - delta: 1, - }); - } - }, -}); diff --git a/miniprogram/pages/web/index.json b/miniprogram/pages/web/index.json deleted file mode 100644 index 8835af0..0000000 --- a/miniprogram/pages/web/index.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "usingComponents": {} -} \ No newline at end of file diff --git a/miniprogram/pages/web/index.wxml b/miniprogram/pages/web/index.wxml deleted file mode 100644 index 87168c3..0000000 --- a/miniprogram/pages/web/index.wxml +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/miniprogram/pages/web/index.wxss b/miniprogram/pages/web/index.wxss deleted file mode 100644 index 054571f..0000000 --- a/miniprogram/pages/web/index.wxss +++ /dev/null @@ -1,4 +0,0 @@ -web-view{ - width: 100%; - height: 100%; -} \ No newline at end of file