微信小程序(十六)小程序仿微信聊天页面及功能(2)

简介: page{ background-color: #EDEDED;}.index{ position:fixed; width: 100%; float: left; height: 64px; padding: 20rpx 220rpx 0 0; box-shadow: 0rpx 0rpx 0rpx; min-height: 0px; display: flex;align-items: center; background-color:#fff; z-index:9999; border-bottom: 1px solid #f7f7f7;

Aichat.json

bash

复制代码

{
  "usingComponents": {},
  "navigationBarTitleText": "AI聊天",
  "navigationStyle": "custom"
}

Aichat.wxss

css

复制代码

page{
  background-color: #EDEDED;
}
.index{
  position:fixed;
  width: 100%;
  float: left;
  height: 64px;
  padding: 20rpx 220rpx 0 0;
  box-shadow: 0rpx 0rpx 0rpx;
  min-height: 0px;
  display: flex;align-items: center;
  background-color:#fff;
  z-index:9999;
  border-bottom: 1px solid #f7f7f7;
  top: 0;
}
.index-img{
  width: 34rpx;
  margin-left: 20rpx;
}
.index>text{
  margin-left: 20rpx;
  font-size: 28rpx;
  font-weight: bold;
}
.chat-index{
  /* padding-top: 30px; */
  width: 100%;
  float: left;
  overflow: hidden;
}
.scroll-view{
  width: 100%;
  float: left;
  overflow: hidden;
  background-color: #EDEDED;
}
.contrary{
  display:flex;
  flex-direction:row-reverse;
}
.news{
  width: 94%;
  float: left;
  overflow: hidden;
  padding: 0 3% 0 3%;
  margin-bottom: 26rpx;
}
.news:first-child{
  margin-top: 60rpx
}
.mews-image{
  width: 70rpx;
  height: 70rpx;
  float: left;
}
.mews-image>image{
  width: 100%;
  height: 100%;
  border-radius: 10rpx;
}
.news-centent{
  width: 70%;
  float: left;
  overflow: hidden;
  position: relative;
}
.centent-right{
  margin-right: 10rpx;
  padding: 0 15rpx 0 0;
}
.centent-left{
  margin-left: 10rpx;
  padding: 0 0 0 15rpx;
}
.trianright{
  width:0;
  height:0;
  border-top:15rpx solid transparent;
  border-bottom:15rpx solid transparent;
  border-left:15rpx solid #FFFFFF;
  position: absolute;
  right: 0;
  top: 20rpx;
}
.trianleft{
  width:0;
  height:0;
  border-top:15rpx solid transparent;
  border-bottom:15rpx solid transparent;
  border-right:15rpx solid #95EB69;
  position: absolute;
  left: 0;
  top: 20rpx;
}
.centent-right>text{
  float: right;
}
.centent-right>.news-images{
  float: right;
}
.centent-right>.news-voice{
  float: right;
}
.centent-left>text{
  float: left;
}
.centent-left>.news-images{
  float: left;
}
.centent-left>.news-voice{
  float: left;
}
.news-centent>text{
  word-wrap:break-word;
  word-break:normal; 
  padding: 16.5rpx;
  /* background-color: #95EB69; */
  color: #000200;
  border-radius: 8rpx;
  font-size: 28rpx;
  max-width: 100%;
  line-height: 42rpx;
}
.news-centent>.news-images{
  max-width: calc(100%);
  padding: 16.5rpx;
  background-color: #95EB69;
  border-radius: 8rpx;
}
.news-centent>.news-voice{
  height: 70rpx;
  background-color: #95EB69;
  border-radius: 8rpx;
  padding: 0 10rpx;
  display: flex;
  align-items: center;
}
.centent-left>.news-voice>text{
  padding: 0 30rpx 0 15rpx;
  font-size: 26rpx;
  font-weight: bold;
}
.centent-right>.news-voice>text{
  padding: 0 15rpx 0 30rpx;
  font-size: 26rpx;
  font-weight: bold;
}
.centent-left>.news-voice>image{
  float: left;
}
.centent-right>.news-voice>image{
  float: right;
}
.news-voice>image{
  width: 50rpx;
  height: 42rpx;
}
.chat-bottom{
  width: 100%;
  float: left;
  overflow: hidden;
  background-color: #F7F7F7;
  transition:all 0.5s;
}
.chat-centent{
  width: 100%;
  float: left;
  overflow: hidden;
  position: relative;
  padding: 0 1.5%;
}
.chat-pression{
  width: 7%;
  height: 100rpx;
  display: flex;
  align-items: center;
  text-align: center;
  float: left;
}
.chat-pression>image{
  width: 45rpx;
  height: 45rpx;
  margin: 0 auto;
}
.chat-tencvi{
  width: 73%;
  padding: 0 1%;
  float: left;
  display: flex;
  align-items: center;
  transition:all 0.5s;
}
.chat-tencvi>textarea{ 
  background-color: #fff;
  border-radius: 8rpx;
  width: 100%;
  padding: 3%;
  font-size: 28rpx;
  margin: 20rpx 0;
  max-height: 180rpx;
}
.chat-tencvi>view{
  width: 100%;
  padding: 3%;
  margin: 20rpx 0;
  background-color: #fff;
  border-radius: 8rpx;
  font-size: 26rpx;
  text-align: center;
}
.chat-news{
  height: 100rpx;
  float: right;
  display: flex;
  align-items: center;
}
.chat-news>view{
  width: 80%;
  background-color: #07C160;
  color: #fff;
  border-radius: 8rpx;
  height: 60rpx;
  line-height: 60rpx;
  font-size:26rpx;
  text-align: center;
}
.chat-cube{
  width: 100%;
  float: left;
  overflow: hidden;
  height: 400rpx;
  background-color: #EDEDED;
  border-top: 1px solid #ddd;
  padding:2% 0 8% 0;
  overflow-y: auto;
}
.cube-title{
  width: 100%;
  float: left;
  font-size: 24rpx;
  padding:0 3.5%;
  position: relative;
  top: 10rpx;
}
.cube-centent{
  width: 100%;
  float: left;
  overflow: hidden;
}
.cube-centent>view{
  margin-top: 30rpx;
  width: 12.5%;
  float: left;
  text-align: center;
}
.chat-camera{
  width: 100%;
  float: left;
  overflow: hidden;
  padding-bottom: 60rpx;
  background-color: #EDEDED;
  border-top: 1px solid #ddd;
  overflow-y: auto;
}
.camera-feature{
  margin: 60rpx 0 0 5%;
  width: 18.75%;
  float: left;
  overflow: hidden;
  text-align: center;
  font-size: 20rpx;
}
.feature-src{
  background-color: #fff;
  border-radius: 15rpx;
  float: left;
  width: 80rpx;
  height: 80rpx;
  margin: 0 calc(50% - 40rpx);
  text-align: center;
}
.feature-src>image{
  width: 40rpx;
  height: 40rpx;
  margin:20rpx;
}
.feature-text{
  width: 100%;
  float: left;
  margin-top: 10rpx;
}
.animation{
  z-index: 10;
  position: fixed;
  width:300rpx;
  height: 300rpx; 
  border-radius: 50%;
  margin: calc((100vh - 300rpx)/2) calc((100% - 300rpx)/2);
}
.animation>image{
  width: 100%;
  height: 100%;
  border-radius: 50%;
}
.animation::before {
  content: "";
  display: block;
  background-color: #ccc;
  filter: blur(10rpx);
  position: absolute;
  width: 100%;
  height: 100%;
  top: 10rpx;
  left: 10rpx;
  z-index: -1;
  opacity: 0.4;
  transform-origin: 0 0;
  border-radius: inherit;
  transform: scale(1, 1);
}
.chat-cbins{
  z-index: 10;
  width: 100%;
  background-color: rgba(26, 26, 26, 0.6);
  color: #fff;
  padding: 3%;
  font-size: 22rpx;
}
.background_left{
  background-color: #95EB69;
}
.background_right{
  background-color: #FFFFFF;
}

代码基本上就是这些了,其实没有多少东西,当然,就这么几行代码实现出来的效果肯定是有bug的,这个不要有太高的期望。

有好的建议,请在下方输入你的评论。

欢迎访问个人博客:guanchao.site

欢迎访问我的小程序:打开微信->发现->小程序->搜索“时间里的”

目录
相关文章
|
存储 JSON 小程序
微信小程序入门之新建并认识小程序结构
微信小程序入门之新建并认识小程序结构
253 1
|
11月前
|
人工智能 开发框架 机器人
AstrBot:轻松将大模型接入QQ、微信等消息平台,打造多功能AI聊天机器人的开发框架,附详细教程
AstrBot 是一个开源的多平台聊天机器人及开发框架,支持多种大语言模型和消息平台,具备多轮对话、语音转文字等功能。
6255 38
AstrBot:轻松将大模型接入QQ、微信等消息平台,打造多功能AI聊天机器人的开发框架,附详细教程
|
10月前
|
存储 移动开发 小程序
校园圈子系统小程序(圈子论坛、私信聊天、资料共享、二手交易、兼职,跑腿)开源码开发/微信公众号、小程序、H5多端账号同步/搭建多城市的综合社交生活平台
基于开源技术栈构建的校园圈子系统小程序,整合社交与生活服务功能,涵盖兴趣圈子、私信聊天、资料共享、二手交易、兼职跑腿等六大核心模块。通过多端账号同步(微信公众号/小程序/H5),实现数据实时交互,满足学生群体的多元化需求。项目精准锚定校园市场,以“社交+服务”双轮驱动,提供一站式解决方案,支持快速部署与多校区运营,同时具备广告、佣金、会员等多元变现能力,是打造校园生态的理想工具。
1166 2
校园圈子系统小程序(圈子论坛、私信聊天、资料共享、二手交易、兼职,跑腿)开源码开发/微信公众号、小程序、H5多端账号同步/搭建多城市的综合社交生活平台
|
11月前
|
存储 小程序 前端开发
微信小程序与Java后端实现微信授权登录功能
微信小程序极大地简化了登录注册流程。对于用户而言,仅仅需要点击授权按钮,便能够完成登录操作,无需经历繁琐的注册步骤以及输入账号密码等一系列复杂操作,这种便捷的登录方式极大地提升了用户的使用体验
3525 12
|
11月前
|
缓存 小程序 API
微信小程序页面导航与路由:实现多页面跳转与数据传递
本文深入探讨微信小程序的页面导航与路由机制,介绍多种页面跳转方式如`wx.navigateTo`、`wx.redirectTo`、`wx.switchTab`等,并讲解通过URL、全局变量和事件传递数据的方法。结合案例实现多页面跳转与数据传递,帮助开发者掌握这一重要技能。
|
移动开发 小程序
仿青藤之恋社交交友软件系统源码 即时通讯 聊天 微信小程序 App H5三端通用
仿青藤之恋社交交友软件系统源码 即时通讯 聊天 微信小程序 App H5三端通用
1113 3
|
小程序 前端开发 开发者
小程序的页面如何布局?
【10月更文挑战第16天】小程序的页面如何布局?
1000 1
|
存储 自然语言处理 小程序
微信小程序多语言切换神器:简繁体切换功能完全指南
随着全球化的发展,支持多种语言的应用程序愈发重要。本文介绍了如何在微信小程序中实现简体与繁体字体之间的切换功能,以满足不同地区用户的需求。通过创建utils文件夹并编写相应的转换函数,开发者可以方便地实现语言切换,从而提升用户体验。文章中还附带了示例代码和效果图,帮助读者更好地理解和应用这一功能。
866 0
微信小程序多语言切换神器:简繁体切换功能完全指南
|
小程序 JavaScript API
微信小程序开发之:保存图片到手机,使用uni-app 开发小程序;还有微信原生保存图片到手机
这篇文章介绍了如何在uni-app和微信小程序中实现将图片保存到用户手机相册的功能。
3570 0
微信小程序开发之:保存图片到手机,使用uni-app 开发小程序;还有微信原生保存图片到手机
|
JSON 小程序 JavaScript
uni-app开发微信小程序的报错[渲染层错误]排查及解决
uni-app开发微信小程序的报错[渲染层错误]排查及解决
3446 7

热门文章

最新文章