微信小程序开发指南

基于ColorUI的组件化页面开发


聊天

<h1>聊天</h1> <ul> <li>样式图例</li> </ul> <p><img src="https://www.showdoc.com.cn/server/api/attachment/visitFile?sign=cc8616488a7d3d03556b0476938f9e23&amp;file=file.png" alt="" /> <img src="https://www.showdoc.com.cn/server/api/attachment/visitFile?sign=067559b4ded248d40f0c40ccf51c124a&amp;file=file.png" alt="" /></p> <ul> <li>示例代码</li> </ul> <pre><code class="language-html">&lt;view class="cu-chat"&gt; &lt;view class="cu-item self"&gt; &lt;view class="main"&gt; &lt;view class="content bg-green shadow"&gt; &lt;text&gt;喵喵喵!喵喵喵!喵喵喵!喵喵!喵喵!!喵!喵喵喵!&lt;/text&gt; &lt;/view&gt; &lt;/view&gt; &lt;view class="cu-avatar radius" style="background-image:url(https://ossweb-img.qq.com/images/lol/web201310/skin/big107000.jpg);"&gt;&lt;/view&gt; &lt;view class="date"&gt;2018年3月23日 13:23&lt;/view&gt; &lt;/view&gt; &lt;view class="cu-info round"&gt;对方撤回一条消息!&lt;/view&gt; &lt;view class="cu-item"&gt; &lt;view class="cu-avatar radius" style="background-image:url(https://ossweb-img.qq.com/images/lol/web201310/skin/big143004.jpg);"&gt;&lt;/view&gt; &lt;view class="main"&gt; &lt;view class="content shadow"&gt; &lt;text&gt;喵喵喵!喵喵喵!&lt;/text&gt; &lt;/view&gt; &lt;/view&gt; &lt;view class="date "&gt; 13:23&lt;/view&gt; &lt;/view&gt; &lt;view class="cu-info"&gt; &lt;text class="cuIcon-roundclosefill text-red "&gt;&lt;/text&gt; 对方拒绝了你的消息 &lt;/view&gt; &lt;view class="cu-info"&gt; 对方开启了好友验证,你还不是他(她)的好友。请先发送好友验证请求,对方验证通过后,才能聊天。 &lt;text class="text-blue"&gt;发送好友验证&lt;/text&gt; &lt;/view&gt; &lt;view class="cu-item self"&gt; &lt;view class="main"&gt; &lt;image src="https://ossweb-img.qq.com/images/lol/web201310/skin/big10006.jpg" class="radius" mode="widthFix"&gt;&lt;/image&gt; &lt;/view&gt; &lt;view class="cu-avatar radius" style="background-image:url(https://ossweb-img.qq.com/images/lol/web201310/skin/big107000.jpg);"&gt;&lt;/view&gt; &lt;view class="date"&gt; 13:23&lt;/view&gt; &lt;/view&gt; &lt;view class="cu-item self"&gt; &lt;view class="main"&gt; &lt;view class="action text-bold text-grey"&gt; 3" &lt;/view&gt; &lt;view class="content shadow"&gt; &lt;text class="cuIcon-sound text-xxl padding-right-xl"&gt; &lt;/text&gt; &lt;/view&gt; &lt;/view&gt; &lt;view class="cu-avatar radius" style="background-image:url(https://ossweb-img.qq.com/images/lol/web201310/skin/big107000.jpg);"&gt;&lt;/view&gt; &lt;view class="date"&gt;13:23&lt;/view&gt; &lt;/view&gt; &lt;view class="cu-item self"&gt; &lt;view class="main"&gt; &lt;view class="action"&gt; &lt;text class="cuIcon-locationfill text-orange text-xxl"&gt;&lt;/text&gt; &lt;/view&gt; &lt;view class="content shadow"&gt; 喵星球,喵喵市 &lt;/view&gt; &lt;/view&gt; &lt;view class="cu-avatar radius" style="background-image:url(https://ossweb-img.qq.com/images/lol/web201310/skin/big107000.jpg);"&gt;&lt;/view&gt; &lt;view class="date"&gt;13:23&lt;/view&gt; &lt;/view&gt; &lt;view class="cu-item"&gt; &lt;view class="cu-avatar radius" style="background-image:url(https://ossweb-img.qq.com/images/lol/web201310/skin/big143004.jpg);"&gt;&lt;/view&gt; &lt;view class="main"&gt; &lt;view class="content shadow"&gt; @#$^&amp;** &lt;/view&gt; &lt;view class="action text-grey"&gt; &lt;text class="cuIcon-warnfill text-red text-xxl"&gt;&lt;/text&gt; &lt;text class="text-sm margin-left-sm"&gt;翻译错误&lt;/text&gt; &lt;/view&gt; &lt;/view&gt; &lt;view class="date"&gt;13:23&lt;/view&gt; &lt;/view&gt; &lt;/view&gt; &lt;view class="cu-bar foot input {{InputBottom!=0?'cur':''}}" style="bottom:{{InputBottom}}px"&gt; &lt;view class="action"&gt; &lt;text class="cuIcon-sound text-grey"&gt;&lt;/text&gt; &lt;/view&gt; &lt;input class="solid-bottom" bindfocus="InputFocus" bindblur="InputBlur" adjust-position="{{false}}" focus="{{false}}" maxlength="300" cursor-spacing="10"&gt;&lt;/input&gt; &lt;view class="action"&gt; &lt;text class="cuIcon-emojifill text-grey"&gt;&lt;/text&gt; &lt;/view&gt; &lt;button class="cu-btn bg-green shadow"&gt;发送&lt;/button&gt; &lt;/view&gt;</code></pre>

页面列表

ITEM_HTML