使用云开发的垃圾分类、垃圾识别、答题的微信小程序源码+部署教程,文字识别垃圾类型、语音识别垃圾类型、图片识别类型、垃圾类别答题

使用云开发的垃圾分类、垃圾识别、答题的微信小程序

完整代码下载地址:使用云开发的垃圾分类、垃圾识别、答题的微信小程序

前言
项目介绍
小程序使用了云开发,包含文字识别垃圾类型、语音识别垃圾类型、图片识别类型、垃圾类别答题、腾讯机器人对话。
附近垃圾场定位:自动道路、断网判断
效果图
)
项目技术

第三方:百度语音转文字、京东垃圾识别、图片垃圾识别、腾讯地图、腾讯机器人

开发技术:微信小程序原生开发

安装教程
1. 点赞项目,要不下面就要出bug(重点)

2. 下载代码到本地

3. 导入项目

  • APPID不能使用测试号
4. 点击云开发按钮,申请开通


  • 填写信息,随便填
5. 开启插件

6. 导入云开发数据库

  • 文件名称就是表的名称

  • 按照上面的文件名称创建对应的表

  • 导入对应名称的json文件

  • 看到数据,代表一个表导入成功,循环以上操作,导入所有的json文件

7. 部署云开发的云函数

  • 右击

  • 点击那个都可以

  • 表示成功了

  • 两个文件夹都要这样操作

8. 配置腾讯地图key
  • 先去申请腾讯地图https://lbs.qq.com/dev/console/user/info 的key(网上有教程)

  • 现在可以看到页面了

9. 配置京东垃圾识别key
  • 去申请 key和密钥https://www.jdcloud.com/cn/products/garbage-classification

  • 重新部署代码
10.大功告成

小程序二维码
上线小程序查询垃圾分类功能可能无法使用,因为接口需要费用。但是京东提供了免费的次数,可以下载代码到本地测试。

提示

后台管理账号密码默认为1,请用户不用胡乱改动,有什么需求可以留言!也可以加主页的联系方式!恳请点个小小的赞!

结语

完整代码下载地址:使用云开发的垃圾分类、垃圾识别、答题的微信小程序

  • 3
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
以下是一个简单的 Java 垃圾分类答题系统,其中包含随机抽题和图形化界面。代码如下: ```java import java.awt.*; import java.awt.event.*; import javax.swing.*; public class GarbageSortingQuiz extends JFrame implements ActionListener { private static final long serialVersionUID = 1L; private JButton startButton, nextButton, submitButton; private JPanel quizPanel, resultPanel; private JLabel questionLabel, resultLabel; private JRadioButton option1, option2, option3, option4; private ButtonGroup optionsGroup; private String[][] quizData = {{"Which of the following is a biodegradable waste?", "Plastic bags", "Food waste", "Aluminum cans", "Glass bottles", "2"}, {"Which of the following is an example of hazardous waste?", "Old newspapers", "Used batteries", "Cardboard boxes", "Empty soda cans", "2"}, {"Which of the following is a type of recyclable waste?", "Styrofoam cups", "Plastic straws", "Metal cans", "Cotton balls", "3"}, {"Which of the following is a non-biodegradable waste?", "Vegetable peels", "Eggshells", "Napkins", "Plastic bottles", "4"}, {"Which of the following is a type of e-waste?", "Old books", "Broken toys", "Used cell phones", "Empty milk jugs", "3"}}; private int currentQuestion = 0; private int score = 0; public GarbageSortingQuiz() { setTitle("Garbage Sorting Quiz"); setSize(500, 300); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); startButton = new JButton("Start Quiz"); startButton.addActionListener(this); nextButton = new JButton("Next"); nextButton.addActionListener(this); submitButton = new JButton("Submit"); submitButton.addActionListener(this); quizPanel = new JPanel(new GridLayout(6, 1)); quizPanel.add(new JLabel("")); questionLabel = new JLabel(""); quizPanel.add(questionLabel); option1 = new JRadioButton(""); option2 = new JRadioButton(""); option3 = new JRadioButton(""); option4 = new JRadioButton(""); optionsGroup = new ButtonGroup(); optionsGroup.add(option1); optionsGroup.add(option2); optionsGroup.add(option3); optionsGroup.add(option4); quizPanel.add(option1); quizPanel.add(option2); quizPanel.add(option3); quizPanel.add(option4); resultPanel = new JPanel(new GridLayout(2, 1)); resultPanel.add(new JLabel("")); resultLabel = new JLabel(""); resultPanel.add(resultLabel); add(startButton); setVisible(true); } public void actionPerformed(ActionEvent e) { if (e.getSource() == startButton) { add(quizPanel); remove(startButton); currentQuestion = 0; score = 0; showQuestion(); add(nextButton); validate(); } if (e.getSource() == nextButton) { if (currentQuestion < quizData.length - 1) { if (checkAnswer()) score++; currentQuestion++; showQuestion(); } else { if (checkAnswer()) score++; showResult(); } } if (e.getSource() == submitButton) { if (checkAnswer()) score++; showResult(); } } public void showQuestion() { questionLabel.setText(quizData[currentQuestion][0]); option1.setText(quizData[currentQuestion][1]); option2.setText(quizData[currentQuestion][2]); option3.setText(quizData[currentQuestion][3]); option4.setText(quizData[currentQuestion][4]); optionsGroup.clearSelection(); } public boolean checkAnswer() { if (option1.isSelected() && quizData[currentQuestion][5].equals("1")) return true; if (option2.isSelected() && quizData[currentQuestion][5].equals("2")) return true; if (option3.isSelected() && quizData[currentQuestion][5].equals("3")) return true; if (option4.isSelected() && quizData[currentQuestion][5].equals("4")) return true; return false; } public void showResult() { remove(quizPanel); remove(nextButton); remove(submitButton); resultLabel.setText("You scored " + score + " out of " + quizData.length); add(resultPanel); validate(); } public static void main(String[] args) { new GarbageSortingQuiz(); } } ``` 该程序使用了 Swing 库来创建图形化界面。在主方法中,创建了一个 GarbageSortingQuiz 对象,该对象在构造函数中设置了程序的标题和大小,并创建了开始按钮。在 actionPerformed 方法中,为开始按钮、下一题按钮和提交按钮添加了事件监听器。当开始按钮被点击时,会创建出一个包含问题和选项的面板,并将开始按钮从程序中移除。当下一题按钮被点击时,会检查前一题的答案是否正确,并显示下一题。当提交按钮被点击时,会检查最后一题的答案是否正确,并显示得分。showQuestion 方法用于显示当前的问题和选项,checkAnswer 方法用于检查选中的选项是否正确,showResult 方法用于显示最终得分。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Python代码大全

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值