微信小程序(十六)小程序仿微信聊天页面及功能(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

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

目录
相关文章
|
4月前
|
JSON 小程序 JavaScript
uni-app开发微信小程序的报错[渲染层错误]排查及解决
uni-app开发微信小程序的报错[渲染层错误]排查及解决
961 7
|
4月前
|
小程序 JavaScript 前端开发
uni-app开发微信小程序:四大解决方案,轻松应对主包与vendor.js过大打包难题
uni-app开发微信小程序:四大解决方案,轻松应对主包与vendor.js过大打包难题
919 1
|
2天前
|
人工智能 小程序 程序员
【视频测评 DEMO 参考】VSCode 神级 AI 插件通义灵码:完全免费+实战教程+微信贪吃蛇小程序
VSCode 神级 AI 插件通义灵码:完全免费+实战教程+微信贪吃蛇小程序
65 7
|
8天前
|
存储 小程序 前端开发
微信小程序与Java后端实现微信授权登录功能
微信小程序极大地简化了登录注册流程。对于用户而言,仅仅需要点击授权按钮,便能够完成登录操作,无需经历繁琐的注册步骤以及输入账号密码等一系列复杂操作,这种便捷的登录方式极大地提升了用户的使用体验
100 12
|
4月前
|
存储 JSON 小程序
微信小程序入门之新建并认识小程序结构
微信小程序入门之新建并认识小程序结构
89 1
|
4月前
|
缓存 小程序 索引
uni-app开发微信小程序时vant组件van-tabs的使用陷阱及解决方案
uni-app开发微信小程序时vant组件van-tabs的使用陷阱及解决方案
334 1
|
4月前
|
小程序 JavaScript API
微信小程序开发之:保存图片到手机,使用uni-app 开发小程序;还有微信原生保存图片到手机
这篇文章介绍了如何在uni-app和微信小程序中实现将图片保存到用户手机相册的功能。
1696 0
微信小程序开发之:保存图片到手机,使用uni-app 开发小程序;还有微信原生保存图片到手机
|
4月前
|
JavaScript 小程序 开发者
uni-app开发实战:利用Vue混入(mixin)实现微信小程序全局分享功能,一键发送给朋友、分享到朋友圈、复制链接
uni-app开发实战:利用Vue混入(mixin)实现微信小程序全局分享功能,一键发送给朋友、分享到朋友圈、复制链接
742 0
|
4月前
|
小程序
uni-app开发微信小程序使用onPullDownRefresh(下拉刷新)总结
uni-app开发微信小程序使用onPullDownRefresh(下拉刷新)总结
867 0
|
4天前
|
人工智能 开发框架 机器人
AstrBot:轻松将大模型接入QQ、微信等消息平台,打造多功能AI聊天机器人的开发框架,附详细教程
AstrBot 是一个开源的多平台聊天机器人及开发框架,支持多种大语言模型和消息平台,具备多轮对话、语音转文字等功能。
489 13
AstrBot:轻松将大模型接入QQ、微信等消息平台,打造多功能AI聊天机器人的开发框架,附详细教程

热门文章

最新文章