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

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

目录
相关文章
|
小程序 前端开发 Android开发
小程序微信分享功能如何开发?开放平台已绑定仍不能使用的问题?-优雅草卓伊凡
小程序微信分享功能如何开发?开放平台已绑定仍不能使用的问题?-优雅草卓伊凡
2958 29
小程序微信分享功能如何开发?开放平台已绑定仍不能使用的问题?-优雅草卓伊凡
|
JSON 监控 小程序
微信百度字节小程序包过大解决方案(实战经验总结)-优雅草卓伊凡|果果|小无
微信百度字节小程序包过大解决方案(实战经验总结)-优雅草卓伊凡|果果|小无
2139 14
微信百度字节小程序包过大解决方案(实战经验总结)-优雅草卓伊凡|果果|小无
|
缓存 小程序 前端开发
商城/点餐/家政类小程序源码合集_微信抖音小程序源码开发从入门到精通实战
本文系统讲解如何利用现有源码快速开发商城、点餐、家政类微信/抖音小程序,涵盖环境搭建、核心功能实现、多平台部署与优化,提供完整技术方案。实战导向,助力开发者高效入门与落地。
|
存储 小程序 Java
热门小程序源码合集:微信抖音小程序源码支持PHP/Java/uni-app完整项目实践指南
小程序已成为企业获客与开发者创业的重要载体。本文详解PHP、Java、uni-app三大技术栈在电商、工具、服务类小程序中的源码应用,提供从开发到部署的全流程指南,并分享选型避坑与商业化落地策略,助力开发者高效构建稳定可扩展项目。
|
存储 移动开发 小程序
校园圈子系统小程序(圈子论坛、私信聊天、资料共享、二手交易、兼职,跑腿)开源码开发/微信公众号、小程序、H5多端账号同步/搭建多城市的综合社交生活平台
基于开源技术栈构建的校园圈子系统小程序,整合社交与生活服务功能,涵盖兴趣圈子、私信聊天、资料共享、二手交易、兼职跑腿等六大核心模块。通过多端账号同步(微信公众号/小程序/H5),实现数据实时交互,满足学生群体的多元化需求。项目精准锚定校园市场,以“社交+服务”双轮驱动,提供一站式解决方案,支持快速部署与多校区运营,同时具备广告、佣金、会员等多元变现能力,是打造校园生态的理想工具。
1967 3
校园圈子系统小程序(圈子论坛、私信聊天、资料共享、二手交易、兼职,跑腿)开源码开发/微信公众号、小程序、H5多端账号同步/搭建多城市的综合社交生活平台
|
小程序 数据安全/隐私保护 开发者
【02】微信支付商户申请下户到配置完整流程-微信开放平台申请APP应用-微信商户支付绑定appid-公众号和小程序分别申请appid-申请+配置完整流程-优雅草卓伊凡
【02】微信支付商户申请下户到配置完整流程-微信开放平台申请APP应用-微信商户支付绑定appid-公众号和小程序分别申请appid-申请+配置完整流程-优雅草卓伊凡
1816 3
|
缓存 小程序 API
微信小程序页面导航与路由:实现多页面跳转与数据传递
本文深入探讨微信小程序的页面导航与路由机制,介绍多种页面跳转方式如`wx.navigateTo`、`wx.redirectTo`、`wx.switchTab`等,并讲解通过URL、全局变量和事件传递数据的方法。结合案例实现多页面跳转与数据传递,帮助开发者掌握这一重要技能。
|
自然语言处理 搜索推荐 小程序
微信公众号接口:解锁公众号开发的无限可能
微信公众号接口是微信官方提供的API,支持开发者通过编程与公众号交互,实现自动回复、消息管理、用户管理和数据分析等功能。本文深入探讨接口的定义、类型、优势及应用场景,如智能客服、内容分发、电商闭环等,并介绍开发流程和工具,帮助运营者提升用户体验和效率。未来,随着微信生态的发展,公众号接口将带来更多机遇,如小程序融合、AI应用等。
|
JSON 小程序 JavaScript
uni-app开发微信小程序的报错[渲染层错误]排查及解决
uni-app开发微信小程序的报错[渲染层错误]排查及解决
5059 7
|
小程序 JavaScript 前端开发
uni-app开发微信小程序:四大解决方案,轻松应对主包与vendor.js过大打包难题
uni-app开发微信小程序:四大解决方案,轻松应对主包与vendor.js过大打包难题
5514 1