<!-- <button bindtap='close'>关闭</button>
<button bindtap='open'>打开</button> -->
<view wx:if='{
{login}}' class='login_zz'></view>`这里写代码片`
<button wx:if='{
{login}}' class='login' bindgetuserinfo='userinfo' open-type="getUserInfo">登录</button>
<view class='page_bg' wx:if='{
{block}}' bindtap='hide_bg' />
<view class='btn_bg' wx:if='{
{block}}'>
<view wx:for="{
{link_list}}" wx:key='index'>
<button class="sp_tit" id='{
{index}}' bindtap='list_item'>查看详情 {
{item}} </button>
</view>
</view>
<scroll-view class="history" scroll-y="true" scroll-with-animation scroll-top="{
{scrollTop}}">
<block wx:key="{
{index}}" wx:for="{
{allContentList}}">
<block wx:if="{
{item.is_my}}">
<view class='my_right new_txt'>
<view class='time' wx:if='{
{item.messageTime&&item.messageTime!=0}}'>
{
{item.messageTime}}
</view>
<view class='p_r page_r' style='margin-right: 25rpx;' wx:if='{
{item.text}}'>
<view class='new_txt'>
<view class='new_txt_my'>
<view class='arrow'>
<em></em>
<span></span>
</view>
<text decode="true">{
{item.text}}</text>
</view>
</view>
<image class='new_img' src='{
{item.avatarUrl}}'></image>
</view>
<view class='p_r page_r' style='margin-right: 25rpx;' wx:if='{
{item.audio}}' bindtap='my_audio_click' data-id='{
{index}}'>
<view class='new_txt_my_2' style=' width:{
{item.length}}px'>
<image class='my_audio' src='/images/yuyin_icon.png'></image>
</view>
<span class='_span'></span>
<open-data class='new_img' type="userAvatarUrl"></open-data>
</view>
</view>
</block>
<!-- <view class='you_left' id='id_{
{allContentList.length}}'> -->
<block wx:if="{
{item.is_ai&&item.is_ai!=''}}">
<view class='you_left' style='width:100%;' id='id_{
{allContentList.length}}' wx:key="{
{index}}">
<view class='time' wx:if='{
{item.messageTime}}'>
{
{item.messageTime}}
</view>
<view class='p_r' style='margin-left: 20rpx;'>
<image class='new_img' src='{
{item.avatarUrl}}'></image>
<view class='new_txt'>
<view class='new_txt_ai'>
<view class='arrow'>
<em></em>
<span></span>
</view>
<view class='ai_content'>
<!-- <text wx:if='{
{item.type=="1"}}' decode="true">{
{item.text}}</text> -->
<text decode="true">{
{item.text}}</text>
<!-- <image wx:if='{
{item.type=="2"}}' style='width:160rpx;height:160rpx;' src='{
{item.src}}'></image> -->
</view>
<view class='yes_problem_log' wx:if="{
{item.yse_problem&&item.solve_show}}" style=''>感谢您的反馈,我们会再接再厉!</view>
<view class='yes_problem_
swoole+微信小程序聊天
最新推荐文章于 2022-10-31 15:28:25 发布
本文介绍如何利用Swoole的高并发特性,结合微信小程序开发实时聊天功能。通过Swoole的WebSocket服务,实现小程序端与服务器的双向通信,创建高效的聊天体验。
摘要由CSDN通过智能技术生成