📌个人主页:个人主页
🧀 推荐专栏:小程序开发成神之路 --【这是一个为想要入门和进阶小程序开发专门开启的精品专栏!从个人到商业的全套开发教程,实打实的干货分享,确定不来看看? 😻😻】
📝作者简介:从web开发,再到大数据算法,踩过了无数的坑,用心总结经验教训,助你在技术生涯一臂之力!若想获取更多精彩内容,敬请订阅专栏或者关注😁😂🤣😃😆😉😊😋😍😘🥰
⭐️您的小小关注是我持续输出的动力!⭐️
🥇入门和进阶小程序开发,不可错误的精彩内容🥇 :

微信作为熟人社交领域类的顶流。其中有非常多的功能值得借鉴和推敲。其中的用户聊天界面,联系人界面特别是朋友圈界面妥妥是进行社交类应用开发的参考和借鉴的典范!
特此,本文整理了基于vue 2.0语法,结合uniapp框架,从而实现了可覆盖到移动全端的功能。同时使用了小程序端优秀的UI组件库uVIew进行构建,使得开发的成本更低,效果更好。

uView中的u-swipe-action组件,使得消息具备了滑动展示菜单操作的功能。<u-swipe-action :show="item.show" :index="index" v-for="(item, index) in list" btn-width="160" :key="item.id" @click="click" @open="open" :options="options">
<view class="item" :class="item.isTop ? 'bg_view' : ''" hover-class="message-hover-class" @tap="linkTo(item)">
<image mode="aspectFill" :src="item.images" />
<view class="right u-border-bottom title-wrap">
<view class="right_top">
<view class="right_top_name u-line-1">{{ item.name }}view>
<view class="right_top_time ">{{ item.updateTime }}view>
view>
<view class="right_btm ">
<view class="u-line-1">-view>
<view class="">view>
view>
view>
view>
u-swipe-action>

//处理录音文件
handleRecorder({ tempFilePath,duration }) {
let contentDuration;
// #ifdef MP-WEIXIN
this.voiceTime = 0;
if (duration < 600) {
this.voiceIconText="说话时间过短";
setTimeout(()=>{
this.recording = false;
},200)
return;
}
contentDuration = duration/1000;
// #endif
// #ifdef APP-PLUS
contentDuration = this.voiceTime +1;
this.voiceTime = 0;
if(contentDuration <= 0) {
this.voiceIconText="说话时间过短";
setTimeout(()=>{
this.recording = false;
},200)
return;
};
// #endif
this.recording = false;
const params = {
contentType: 2,
content: tempFilePath,
contentDuration: Math.ceil(contentDuration)
};
this.canSend && this.sendMsg(params);
},

<template>
<view class="content" id="content">
<u-navbar title=" " :background="{ background: '#f8f8f8' }" :border-bottom="false">
<view class="slot-wrap" slot="right"><u-icon name="camera-fill" size="36" @click="linkToRelease">u-icon>view>
u-navbar>
<view class="content-imgbox">
<image class="bgimg" :src="_user_info.pictureBanner" mode="scaleToFill" @tap="showSheet">image>
<image class="headimg" :src="_user_info.headImg" @tap="linkToBusinessCard(_user_info.id)">image>
<text class="nickname">{{ _user_info.userName }}text>
view>
<view class="signature">
<view class="">{{ _user_info.signature }}view>
view>
<view class="content-circle">
<view class="content-circle-box" v-for="(item, index) in circleData" :key="item.circleMegId">
<view class="headimg"><image class="img" :src="item.userHeadImg" @tap="linkToBusinessCard(item.userId)">image>view>
<view class="content">
<view class="content-name" @tap="linkToBusinessCard(item.userId)">{{ item.userName }}view>
<view class="content-desc">{{ item.content }}view>
<view class="content-img" v-if="item.imageList.length">
<view v-if="item.imageList.length == 1"><image class="img-1" :src="item.imageList[0]" mode="widthFix" @tap="previewImg(0, item.imageList)">image>view>
<view v-else-if="item.imageList.length > 1">
<view class="content-img-more">
<image
class="img-more"
v-for="(src, index) in item.imageList"
:key="index"
:class="index % 3 == 0 && 'img-3'"
:src="src"
mode="aspectFill"
@tap="previewImg(index, item.imageList)"
>image>
view>
view>
view>
<view class="relavivetime" :id="`comment-${'null'}-${index}`">
<view class="time">{{ item.createTime }}view>
<view class="icon-box">
<view @tap="clickThumb(item)">
<image class="img icon-box-item thumb" :src="item.isPraise ? require('@/static/like-fill.png') : require('@/static/like.png')" mode="">image>
view>
<view @tap="handleComment(item.circleMegId, null, index)">
<image class="img icon-box-item" :src="require('@/static/comment.png')" mode="">image>
view>
view>
view>
<view class="msg-box">
<view class="thumbinfo" v-if="item.praise.length">
<image class="thumbinfo-icon" :src="require('@/static/like.png')">image>
<text class="thumbinfo-name" v-for="(userInfo, index) in item.praise" :key="userInfo.id" @tap="linkToBusinessCard(userInfo.id)">
{{ userInfo.userName }}{{ index != item.praise.length - 1 ? ',' : '' }}
text>
view>
<view class="comment" v-if="item.comment.length">
<view
class="comment-box"
v-for="(comment, index) in item.comment"
:key="index"
hover-class="comment-hover-class"
:id="`comment-${item.circleMegId}-${index}`"
@tap="handleComment(item.circleMegId, comment, index)"
>
<text class="comment-box-name" v-if="!comment.replyUserId" @tap.stop="linkToBusinessCard(comment.userId)">{{ comment.userName }}:text>
<text class="comment-box-name" v-if="comment.replyUserId" @tap.stop="linkToBusinessCard(comment.userId)">
{{ comment.userName }}
<text class="callback">回复text>
text>
<text v-if="comment.replyUserId" class="comment-box-name" @tap.stop="linkToBusinessCard(comment.replyUserId)">{{ comment.replyUserName }}:text>
<text class="comment-box-content">{{ comment.content }}text>
view>
view>
view>
view>
view>
<view :style="{ height: showInput ? '100rpx' : 0 }">view>
<view v-show="showInput" :style="{ height: viewOffsetBottom + 'px' }">view>
view>
<view class="input-box" v-if="showInput" id="input-box" :style="{ bottom: inputOffsetBottom > 0 ? inputOffsetBottom + 'px' : '0' }">
<view class="input-box" v-show="showInput" id="input-box" :style="{ bottom: inputOffsetBottom > 0 ? inputOffsetBottom + 'px' : '0' }">
<view class="input-box-flex">
<view class="input-box-flex-grow">
<input
type="text"
class="content"
id="input"
v-model="content"
:adjust-position="false"
:confirm-type="'send'"
:confirm-hold="true"
placeholder-style="color:#DDD;"
:cursor-spacing="6"
:placeholder="placeholder"
:focus="showInput"
@blur="blurInput"
@confirm="sendMsg"
/>
view>
<button class="btn" type="primary" size="mini" @touchend.prevent="sendMsg">发送button>
view>
view>
<u-action-sheet :list="list" v-model="show" border-radius="25" safe-area-inset-bottom @click="clickAction">u-action-sheet>
view>
template>

觉得好用的话就给个好评吧😁🤩🥰😘😄😗😛