图灵聊天机器人小程序

历时半年整理出了十多万字的学习笔记,目前依旧在更新
欢迎点赞和支持~🥳🥳🥳
博客

项目描述:

  • 根据图灵API向聊天机器人发送聊天信息,并渲染返回的数据。
  • 具有清空聊天记录的按钮。
  • 本来是想上线体验版,但体验版就是发送不了信息,真机调试都好好的,
  • 图灵的聊天API免费接口一台终端一天大概只有十几次的请求…

来个图

在这里插入图片描述

用到的组件和API:

  • API主要用到是用于发送post请求的wx.request(),点击事件的绑定和提交事件的绑定。
  • 组件主要用的是可滚动视图组件和用于循环生成对话的block组件。

生成对话的方式:

  • 首先获取到submit事件的事件对象,然后通过e.detail.value.say获取到你输入的信息,(say属性需要在input框的name属性定义);
  • 然后以{key: ‘你注册的图灵API得到的key’, info: 你输入的信息}的方式向http://www.tuling123.com/openapi/api发送POST请求,然后将拿到的数据和你输入的数据作为一个对象利用setData利用push方法添加到对话数组里,然后小程序会根据新数据重新渲染页面。

wxml部分

<view class="title">{{title}}</view>
<!-- 对话部分 -->
<view class="que" ><scroll-view class="con" scroll-y><block wx:for="{{says}}" wx:for-item="item" wx:key="index"><!-- 我说的话以及我的图片 --><view class="iSay"><view class="right-img"><image src="{{headRight}}"></image></view><view class="right-text"><view>{{item.iSay}}</view></view></view><!-- 机器人说的话以及机器人的图片 --><view class="robotSay"><view class="left-img"><image src="{{headLeft}}"></image></view><view class="left-text"><view>{{item.rSay}}</view></view></view></block></scroll-view></view><!-- 按钮部分 -->
<view class="bottom"><view class="send"><form bindsubmit="converSation"><input type="text" placeholder="说点什么吧~" name="say" value="{{tempISay}}"></input><button class="btn-d" bindtap="deleteChat">清空</button><button class="submit" id="btn" form-type="submit">发送</button></form></view>
</view>

wxss部分

/* 标题部分 */
.title {position: fixed;height: 6vh;width: 100%;top: 0px;line-height: 80rpx;text-align: center;font-size: 40rpx;font-weight: bold;background-color: #fff;color: black;box-shadow: 16rpx -4rpx 30rpx rgb(209, 204, 204);
}/* 对话框部分 */
.que {width: 98%;margin-top: 7vh;height: 83vh;margin-left: 1%;box-sizing: border-box;overflow: hidden;
}.con {width: 95%;height: 100%;margin-left: 20rpx;
}.iSay {width: 70%;margin-left: 30%;margin-top: 60rpx;
}.iSay .right-img {position: relative;height: 60rpx;width: 60rpx;left: 88%;margin-top: 5rpx;
}.iSay .right-text {width: 80%;margin-top: -65rpx;
}.iSay .right-text view {padding: 10rpx 30rpx;text-overflow: ellipsis;word-wrap: break-word;border-radius: 30rpx;background-color: #eee;color: green;font-size: 25rpx;
}.robotSay {width: 70%;margin-top: 30rpx;
}.robotSay .left-img {width: 75rpx;height: 80rpx;
}.robotSay .left-text {width: 80%;margin-left: 20%;margin-top: -60rpx;
}.robotSay .left-text view {padding: 10rpx 30rpx;text-overflow: ellipsis;word-wrap: break-word;border-radius: 30rpx;background-color: #eee;color: green;font-size: 25rpx;
}/* 按钮部分 */
.bottom {position: fixed;width: 100%;height: 10vh;bottom: 0rpx;background-color: gray;
}.send {position: fixed;width: 100%;bottom: 20rpx;height: 66rpx;
}input {width: 55%;height: 66rpx;padding-left: 40rpx;box-sizing: border-box;border-radius: 30rpx;border: 1rpx solid black;background-color: #fff;
}.send button {float: right;width: 20%;height: 66rpx;bottom: 66rpx;margin-right: 10rpx;border-radius: 30rpx;line-height: 66rpx;color: #fff;}.send button.submit {background-color: rgb(62, 214, 143);
}.send button.btn-d {background-color: black;
}.robotSay .left-img image,
.iSay .right-img image {height: 100%;width: 100%;border-radius: 50%;
}

js部分

Page({/*** 页面的初始数据*/data: {title: 'Chat Robot',headLeft: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFwAAABuCAYAAACqXXT+AAAgAElEQVR4Xu2deXgUVbrG31NLd2fphAQCIuAKuOCOyzgiouOCCirIoiMuuI67XterM6PoOIKOI6I47iAqCoiiuK8sehVHHJFBkFUggEnYkk4n3V3Luc93qqpTVV3d6cQQ+YN6njzd6a6u5Xfeer/vLHWKYdfSrgRYu+5t186wC3g7i2AX8F3A25lAO+9ul8J3AW9nAu28u10K3wW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wPfgWr7LTa9C3g7U/9/pT1/6tjjQOoAAAAASUVORK5CYII=',headRight: '',says: [{rSay: '你好,来和我聊聊天吧~~~',iSay: '你好',},],tempISay: '',},/*** 生命周期函数--监听页面加载*/onLoad: function () {let That = this;//获取用户的当前设置。返回值中只会出现小程序已经向用户请求过的权限。wx.getSetting({//返回成功时success: function (res) {//授权用户信息if (res.authSetting['scope.userInfo']) {wx.getUserInfo({success: function (res) {That.setData({headRight: res.userInfo.avatarUrl,})}});}}})},// 绑定input框的提交事件converSation(e) {let That = this;let says = this.data.says;let key = '9bfb8444a1324d82bfc15ba46e6ca3c2';let newSays = {};newSays.iSay = e.detail.value.say;// 发送请求newSays.iSay && wx.request({url: 'http://www.tuling123.com/openapi/api',data: {key: key,info: newSays.iSay},header: {'content-type': 'application/json'},success(res) {newSays.rSay = res.data.text;says.push(newSays);// tempISay用于做中间变量,数据提交后将输入框里的内容清空That.setData({says: says,tempISay: '',})},})},// 清空对话内容deleteChat() {this.setData({says: [],})}
})

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.rhkb.cn/news/36736.html

如若内容造成侵权/违法违规/事实不符,请联系长河编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

15大不同领域问答对比,ChatGPT模型大战:国产版百度文心一言、昆仑万维天工能否击败GPT-4(含百度文心一言、昆仑万维天工个人内测体验测试邀请码获取方法,亲测有效)

目录 前言百度内测申请天工内测申请申请方式内测体验登录界面运行体验 内测对比基本问答事实性问答科普文写作小红书文案项目计划撰写古文理解模型的常识能力和反事实推理代码理解法律相关广告话术数字排序数值计算推理解题跨语言能力文生图 总结其它资料下载 前言 3月16日&am…

中国人工智能框架市场调研报告

随着众多人工智能项目从科研创新到产业落地,人工智能应用场景逐渐扩展,人工智能市场规模正在不断扩大。预训练大模型、“AI for Science”、“负责任的人工智能”等已成为全球学术界和产业界关注的焦点。而人工智能框架是模型算法开发的核心,是支撑人工智能技术发展和产业繁荣发…

C语言实现课程表

#include<stdio.h> #include<stdlib.h> #include<string.h> #include<time.h> #include<windows.h> #include<mmsystem.h> #pragma comment(lib,"WINMM.LIB")char course[99][99][99];void menu() //菜单显示 {printf("***…

安卓课程表

https://download.csdn.net/download/weixin_57836618/72364964

Android课程表客户端实现方案

客户端开发 1. 开发环境 开发平台&#xff1a;Android Studio 开发语言&#xff1a;Java api&#xff1a;Android 7.0 N api 24 2. 课程格子显示 ScrollView拉动显示下方格子&#xff0c;采用相对布局 即可自定义格子大小&#xff0c;方便阅读简略信息&#xff0c;并可下…

做个课程表吧(一)

手机端的课程表种类繁多&#xff0c;但电脑端的课程表种类却很少&#xff0c;也不支持自动导课。既然这样就让我们来造个课程表吧。 文章目录 获取课程表 制作课程表读取JSON数据获取课程格式化课程表创建窗体显示课程 全部代码 获取课程表 首先我们先去获取课程表。登录教务…

【微信小程序】课程表案例--0基础版

目录 &#x1f52e; 效果动图&#xff1a; &#x1f340;准备工具 &#x1f333;准备代码&#xff1a; &#x1f31e;部署项目 &#x1f9a0;修改课程时间 &#x1f9a0;修改课程内容 &#x1f9a0;修改标题 &#x1f9a0;修改底部导航栏 &#x1f34d;项目发布 &…

多表查询-学生表,班级表,课程表,班级课程表

多表查询&#xff1a; 学生表、班级表、课程表、班级课程表 -- 多对多 -- 班级表 CREATE TABLE banji( id INT PRIMARY KEY AUTO_INCREMENT, name VARCHAR (10) NOT NULL ); INSERT INTO banji( name ) VALUES ( java1807 ),( java1812 ); SELECT * FROM banj…

android课程表

最近开发的android版课程表&#xff0c;已经打包&#xff0c;欢迎使用。 已更新到了1.2版本&#xff0c;美化了界面显示效果&#xff0c;使显示更加美观。 使用截图如下&#xff1a; 联系邮箱&#xff1a;wangtian.rui163.com 新浪微博&#xff1a;http://weibo.com/tianru…

课程表小程序(0基础从入门到发布,做给同学们看)

个人主页&#xff1a;个人主页 系列专栏&#xff1a;前端小项目 热爱前端&#xff0c;有共同兴趣的小伙伴&#xff0c;一起交流哦。 &#x1f52e; 效果动图&#xff1a; 目录 &#x1f340;准备工具 &#x1f333;准备代码&#xff1a; &#x1f31e;部署项目 &#x1f9a…

创建学生表,课程表,班级表,班级课程表

首先创建班级表&#xff0c;因为班级跟学生为一对多关系&#xff0c;先创建班级表能在学生表中插入外键 班级表 CREATE TABLE banji(id INT PRIMARY KEY AUTO_INCREMENT,name VARCHAR(10) NOT NULL ); INSERT INTO banji(name)VALUES(class1),(class2); SELECT * FROM banji;…

用HTML设计一个课程表

用HTML设计一个课程表 如下是其效果图&#xff1a; 其HTML的代码&#xff1a; <html > <head> <title>课程表 自我创作</title> </head> <body bgcolor "lightblue"> <table b…

android实现课程表界面

这是我第一次写博客&#xff0c;也是刚开始学习android&#xff0c;做了一个课程表界面的小练习。做的过程中遇到了一些问题也参考了许多人的解决方法&#xff0c;希望在这里总结下&#xff0c;就当做学习笔记。如果能对那些像我一样的初学者有一点点帮助就更好啦&#xff0c;要…

微信课程表小程序(0基础教你用,从入门到发布)

微信小程序课程表&#xff0c;微信小程序开发 目录 1.效果图&#xff1a; 2.准备工具&#xff1a; 3.下载代码 4.部署项目 1.打开微信小程序&#xff1a; 2.AppID查看方式: 3.拿出你的小手机扫码、 5.修改课程 6.项目发布 演示&#xff1a; 1.效果图&#xff1a; 2.准备工…

课程表管理系统

课程表管理系统 1.学生/教师用户登录界面 2.首页 3.课程详细 4.保存csv功能 5.管理员登录界面 6.管理员后台界面 7.代码详解 8.项目部署 课程表管理系统 1.学生/教师用户登录界面 2.首页 3.课程详细 点击已有课程&#xff0c;可弹出课程详细数据。 4.保存csv功能 点击…

Android课程表App

最近写了个简单的Android 课程表App,我是个初学者,这个App里使用了&#xff1a; Android内置的SQLite数据库储存课程数据。课程的视图用CardView卡片视图。 课程的View是动态加入的,动态添加View的好处是很灵活 如果靠静态的XML构建的话就有点难扩展了&#xff0c;因为你不知道…

微信小程序实现课程表

1.实现效果 2.实现步骤 2.1 获取当前日期一周数据 Date.getDay(): getDay() 方法返回指定日期是星期几&#xff08;从 0 到 6,星期日为 0&#xff0c;星期一为 1&#xff0c;依此类推。&#xff09;。 var d new Date();//2022-8-11 var n d.getDay();//4--周四Date.getDate…

学生表,选课表,课程表

课后作业 一、用Navicat Premium 12软件创建三张表&#xff1a;学生表、选课表、课程表 学生表(学号, 姓名, 性别, 年龄, 电话) - 学号是字符串类型 选课表(学号, 课程号, 成绩) 课程表(课程号, 课程名, 课时数) - 课程号是字符串类型 学生表&#xff1a; 选课表&#xff1a; …

Android课程表的设计开发

Android课程表的设计开发 下载链接 鉴于很多人需要源码&#xff0c;这里给下代码。 下载地址&#xff08;需要5积分&#xff0c;支持下&#xff08;积累点积分。。。&#xff09;&#xff0c;没有积分的直接留言邮箱&#xff0c;我发给你或者找其他已经发过的人要下&#xf…

超级课程表课表的界面的实现

由于毕业设计有一个功能模块是课程表,就想模仿一下超级课程表的界面,可是开始做的时候却没有一点头绪,百度google均无果,在CSDN和知乎上提问了也没人回答,总之自己鼓捣了几天还是弄出来了,虽然实现的方法很挫。。。因为有好几个人都发私信问我怎么实现的,现在毕设做完了…