增加音乐,摇一摇,服务等页面

This commit is contained in:
cansnow
2026-02-15 19:41:13 +08:00
parent abd279e7a7
commit 271ec4b9c2
74 changed files with 14021 additions and 2 deletions
+130
View File
@@ -0,0 +1,130 @@
<template>
<view v-if="currentPlaySong != null" class="play-bar flex-v-center" @click="bindOnShowPlayViewPopup">
<view class="music-cover flex-v-h-center" :class="currentPlayer.playState ? 'spin-start':'spin-stop'">
<u-avatar :src="currentPlaySong.pic" mode="circle" size='70'></u-avatar>
</view>
<view style="width: 64%;">
<view class="music-info flex-v-center text-line-1">
<view class="music-name text-line-1">{{currentPlaySong.songName}}</view>
<view class="line">-</view>
<view class="music-singer text-line-1">{{currentPlaySong.artist}}</view>
</view>
<view class="u-p-l-20 u-p-r-20 u-flex u-row-between u-col-center">
<view style="width: 80%;">
<u-line-progress active-color="#19be6b"
:striped="true"
:height="8"
:striped-active="true"
:show-percent="false"
:percent="currentPlayer.progress"></u-line-progress>
</view>
<view class="u-font-24 u-tips-color">
<text> {{currentPlaySong.songTimeMinutes}}</text>
</view>
</view>
</view>
<view class="bars flex-v-center flex-space-between">
<view style="width: 64rpx;">
<view class="u-progress-content flex-v-h-center btn-active" @tap.stop="bindOnControllerPlay">
<u-icon :class="currentPlayer.playState ? 'play' : 'pause'"
:name="currentPlayer.playState ? 'pause-circle' : 'play-circle'" size="54"></u-icon>
</view>
</view>
<view class="tools-item btn-active" style="display: inline-block;" @tap.stop="bindOnShowPlayListPopup">
<u-icon name="music-list" custom-prefix="custom-icon" size="54"></u-icon>
</view>
</view>
</view>
<view v-else class="play-bar flex-v-center test-border u-tips-color">
<view style="text-align: center;width: 100%;">
<text>当前暂无播放歌曲记录</text>
</view>
</view>
</template>
<script>
export default {
data() {
return {
};
},
methods:{
bindOnControllerPlay(){
this.$emit("changePlayStatus");
},
bindOnShowPlayListPopup(){
this.$emit("showPlayList")
},
bindOnShowPlayViewPopup(){
this.$emit("showPlayView")
},
}
}
</script>
<style>
@import "@/static/music/music.css";
</style>
<style lang="scss" scoped>
.play-bar{
position: fixed;
bottom: 30px;
left: 0;
width: 100%;
height: 120rpx;
background-color: #ffffff;
padding: 0 40rpx;
z-index: 1000;
.music-cover{
width: 100rpx;
height: 100rpx;
background-image: url('@/static/music/disc-plus.png');
background-size: 100% 100%;
flex-shrink:0;
-webkit-transform: rotate(360deg);
animation: rotation 10s linear infinite;
-moz-animation: rotation 10s linear infinite;
-webkit-animation: rotation 10s linear infinite;
-o-animation: rotation 10s linear infinite;
}
@-webkit-keyframes rotation{
from {-webkit-transform: rotate(0deg);}
to {-webkit-transform: rotate(360deg);}
}
.spin-stop{
-webkit-animation-play-state:paused
}
.spin-start{
-webkit-animation-play-state:running
}
.music-info{
display: flex;
padding: 0 20rpx;
flex: 1;
.music-name{
max-width: 65%;
flex-shrink:0;
}
.line{
padding: 0 10rpx;
color: $uni-text-color-disable;
font-size: $uni-font-size-sm;
}
.music-singer{
max-width: 35%;
color: $uni-text-color-disable;
font-size: $uni-font-size-sm;
}
}
.bars{
width: 160rpx;
text-align: right;
height: 100%;
.u-progress-content{
width: 100%;
height: 100%;
padding-left: 4rpx;
}
}
}
</style>
+265
View File
@@ -0,0 +1,265 @@
<template>
<view>
<u-navbar :is-back="true" title="" :background="{ background: '#ffffff' }"
:border-bottom="false" z-index="1001">
<view class="slot-wrap u-font-32">
<view class="u-font-32" style="width: 100%;">
<u-tabs :list="tabList" active-color="#2ebe4b"
:is-scroll="false" :show-bar="true" :font-size="34"
:current="currentTab" :active-item-style="activeItemStyle"
@change="tabChange"></u-tabs>
</view>
</view>
</u-navbar>
<view>
<view class="u-p-l-40 u-p-r-40">
<view class="u-m-t-20 u-m-b-20">
<u-search placeholder="支持搜索歌手,歌名,专辑"
border-color="#eeeeee"
bg-color="#ffffff"
shape="square"
:clearabled="true"
:show-action="true"
:action-style="actionStyle"
:animation="false"
height="80"
@search="search"
@custom="search"
v-model="searchWord">
</u-search>
</view>
<scroll-view
:scroll-x="false" :scroll-y="true" :style="'height:'+(pageHeight)+'px'">
<u-row>
<u-col :span="12">
<view class="u-p-30 u-font-36" style="font-weight: bold;">
<text>热门男歌手</text>
</view>
</u-col>
<u-col :span="4" v-for="(item,index) in singerManList" :key="index">
<view class="u-m-b-30" @click="toSongList(item)">
<view class="u-flex u-row-center u-col-center">
<view>
<u-image width="100%" height="130rpx"
border-radius="16rpx"
mode="heightFix"
:src="item.avatar"></u-image>
</view>
</view>
<view style="text-align: center;margin-top:4rpx;font-size: 26rpx;color: #000000;">
<text>{{item.singerName}}</text>
</view>
</view>
</u-col>
</u-row>
<u-row>
<u-col :span="12">
<view class="u-p-30 u-font-36" style="font-weight: bold;">
<text>热门女歌手</text>
</view>
</u-col>
<u-col :span="4" v-for="(item,index) in singerWomenList" :key="index">
<view class="u-m-b-30" @click="toSongList(item)">
<view class="u-flex u-row-center u-col-center">
<view>
<u-image width="100%" height="130rpx"
border-radius="16rpx"
mode="heightFix"
:src="item.avatar"></u-image>
</view>
</view>
<view style="text-align: center;margin-top:4rpx;font-size: 26rpx;color: #000000;">
<text>{{item.singerName}}</text>
</view>
</view>
</u-col>
</u-row>
</scroll-view>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
pageHeight:0,
tabList:[
{
name: '在线听'
},
{
name: '本地听'
},
],
currentTab:0,
activeItemStyle:{
fontSize:'36rpx',
},
actionStyle:{
backgroundColor:'#46be72',
color:'#ffffff',
height:'80rpx',
lineHeight:'80rpx',
position:'relative',
left:'0rpx',
textAlign:'center',
width:'140rpx',
borderRadius:'10rpx',
borderTopRightRadius:'10rpx',
borderBottomRightRadius:'10rpx'
},
searchWord:'',
singerManList:[
{
avatar:'https://y.qq.com/music/photo_new/T001R500x500M0000025NhlN2yWrP4.jpg?max_age=2592000',
singerName:'周杰伦'
},
{
avatar:'https://y.qq.com/music/photo_new/T001R500x500M000001BLpXF2DyJe2.jpg?max_age=2592000',
singerName:'林俊杰'
},
{
avatar:'https://y.qq.com/music/photo_new/T001R500x500M000002J4UUk29y8BY.jpg?max_age=2592000',
singerName:'薛之谦'
},
{
avatar:'https://y.qq.com/music/photo_new/T001R500x500M000003Nz2So3XXYek.jpg?max_age=2592000',
singerName:'陈奕迅'
},
{
avatar:'https://y.qq.com/music/photo_new/T001R500x500M000002azErJ0UcDN6.jpg?max_age=2592000',
singerName:'张杰'
},
{
avatar:'https://y.qq.com/music/photo_new/T001R300x300M000003aQYLo2x8izP_4.jpg?max_age=2592000',
singerName:'刘德华'
},
{
avatar:'https://y.qq.com/music/photo_new/T001R300x300M000004NMZuf2BLjg8_2.jpg?max_age=2592000',
singerName:'周传雄'
},
{
avatar:'https://y.qq.com/music/photo_new/T001R500x500M000000aHmbL2aPXWH.jpg?max_age=2592000',
singerName:'李荣浩'
},
{
avatar:'https://y.qq.com/music/photo_new/T001R500x500M000003fA5G40k6hKc.jpg?max_age=2592000',
singerName:'周深'
},
{
avatar:'https://y.qq.com/music/photo_new/T001R500x500M000001IoTZp19YMDG.jpg?max_age=2592000',
singerName:'易烊千玺'
},
{
avatar:'https://y.qq.com/music/photo_new/T001R500x500M000001z2JmX09LLgL.jpg?max_age=2592000',
singerName:'汪苏泷'
},
{
avatar:'https://y.qq.com/music/photo_new/T001R500x500M000000CK5xN3yZDJt.jpg?max_age=2592000',
singerName:'许嵩'
}
],
singerWomenList:[
{
avatar:'https://y.qq.com/music/photo_new/T001R500x500M000001fNHEf1SFEFN.jpg?max_age=2592000',
singerName:'G.E.M.邓紫棋'
},
{
avatar:'https://y.qq.com/music/photo_new/T001R500x500M0000003ZpE43ypssl.jpg?max_age=2592000',
singerName:'张碧晨'
},
{
avatar:'https://y.qq.com/music/photo_new/T001R500x500M000000oCQfT3kdonw.jpg?max_age=2592000',
singerName:'黄霄雲'
},
{
avatar:'https://y.qq.com/music/photo_new/T001R500x500M000002lKaDq2lLLtk.jpg?max_age=2592000',
singerName:'蔡健雅'
},
{
avatar:'https://y.qq.com/music/photo_new/T001R500x500M000002azErJ0UcDN6.jpg?max_age=2592000',
singerName:'苏星婕'
},
{
avatar:'https://y.qq.com/music/photo_new/T001R500x500M000003iPzNg35cWzp.jpg?max_age=2592000',
singerName:'程响'
},
{
avatar:'https://y.qq.com/music/photo_new/T001R300x300M000000aw4WC2EQYTv_5.jpg?max_age=2592000',
singerName:'张靓颖'
},
{
avatar:'https://y.qq.com/music/photo_new/T001R300x300M000000GGDys0yA0Nk_2.jpg?max_age=2592000',
singerName:'梁静茹'
},
{
avatar:'https://y.qq.com/music/photo_new/T001R500x500M000001pWERg3vFgg8.jpg?max_age=2592000',
singerName:'孙燕姿'
},
{
avatar:'https://y.qq.com/music/photo_new/T001R500x500M000000GDDuQ3sGQiT.jpg?max_age=2592000',
singerName:'王菲'
},
{
avatar:'https://y.qq.com/music/photo_new/T001R300x300M000003jJGvv3C82KZ_5.jpg?max_age=2592000',
singerName:'刘若英'
},
{
avatar:'https://y.qq.com/music/photo_new/T001R300x300M000002raUWw3PXdkT_5.jpg?max_age=2592000',
singerName:'张韶涵'
}
]
};
},
created:function(){
let pageHeight= this.$u.sys().windowHeight*0.82;
this.pageHeight=pageHeight;
},
methods: {
tabChange:function(index){
this.currentTab = index;
},
search:function(value){
console.log("搜索关键字",value);
let that=this;
if(value.length>0){
this.$u.route({
url:'pages/tabbar/find/music/song-list',
params:{
keyWords:value
}
})
}
},
toSongList:function(singer){
let that=this;
this.$u.route({
url:'pages/tabbar/find/music/song-list',
params:{
keyWords:singer.singerName
}
})
}
},
}
</script>
<style lang="scss">
.slot-wrap {
display: flex;
align-items: center;
/* 如果您想让slot内容占满整个导航栏的宽度 */
flex: 1;
/* 如果您想让slot内容与导航栏左右有空隙 */
padding: 0 30rpx;
}
.status_bar {
height: var(--status-bar-height);
width: 100%;
}
</style>
+218
View File
@@ -0,0 +1,218 @@
<template>
<view>
<u-navbar :is-back="true" :title="navbarTitle" :background="{ background: '#ffffff' }"
:title-bold="true" title-size="34"
:border-bottom="true" z-index="1001">
</u-navbar>
<view>
<view class="u-p-30 u-flex u-row-between u-col-center">
<view style="font-size: 36rpx;font-weight: bold;">
<text>列表</text>
<text>({{songList.length}})</text>
</view>
<view class="u-flex u-row-left u-col-center">
<view class="u-m-r-30">
<u-icon name="play-circle-fill" size="42" color="#2979ff" @click="playAll()"
label="播放全部" label-size="32"></u-icon>
</view>
<view class="u-m-l-30">
<u-icon name="heart-fill" size="42" color="#fa3534" @click="addToLocal()"
label="添加本地" label-size="32"></u-icon>
</view>
</view>
</view>
<scroll-view :scroll-x="false" :scroll-y="true" :style="'height:'+(pageHeight-50)+'px'" @scrolltolower="loadMore">
<view class="u-flex u-row-between u-col-center u-p-30 u-border-bottom"
v-for="(song,index) in songList" :key="index">
<view class="u-flex u-row-left u-col-center">
<view class="u-m-r-30">
<u-image :src="song.pic" width="100rpx" height="100rpx" border-radius="12rpx"></u-image>
</view>
<view>
<view class="u-font-34 u-m-b-10 u-line-1" style="color: #000000;width: 400rpx;">{{escape2Html(song.name)}}</view>
<view class="u-font-28 u-m-t-10 u-flex u-row-left u-col-center u-line-3" style="color: #808288;width: 400rpx;">
{{escape2Html(song.artist)}}-{{escape2Html(song.album)}}
</view>
</view>
</view>
<view class="u-flex u-row-around u-col-center">
<view>
<u-icon v-if="currentPlaySong&&currentPlaySong.id==song.rid&&currentPlayer.playState" name="pause-circle" size="50" color="#797979"></u-icon>
<u-icon v-else @click="toPlaySong(song)" name="play-circle" size="50" color="#797979"></u-icon>
</view>
<view class="u-m-l-30">
<u-icon @click="download(song)" name="download" size="50" color="#797979"></u-icon>
</view>
</view>
</view>
</scroll-view>
</view>
<view>
<play-bar @changePlayStatus="changePlayStatus" @showPlayView='bindOnPlayBarChange' @showPlayList='bindOnShowPlayListPopup'></play-bar>
</view>
</view>
</template>
<script>
import playBar from './components/play-bar.vue';
import playerUtil from '@/util/music/music-player.js';
export default {
components:{
playBar
},
data() {
return {
navbarTitle:"歌曲列表",
pageHeight:0,
pageNum:1,
pageSize:30,
searchWord:"",
total:0,
songList:[],
loadMoreFlag:false
};
},
watch:{
currentPlaySong:function(newSong){
let that=this;
console.log("====监听到播放歌曲发生变化======");
if(newSong!=null&&newSong.id){
playerUtil.initPlayer(that);
}
}
},
created:function(){
let pageHeight= this.$u.sys().windowHeight*0.79;
this.pageHeight=pageHeight;
},
onLoad:function(option){
let that=this;
console.log("搜索词",option);
let keyWords= option.keyWords;
if(keyWords){
this.navbarTitle=keyWords;
this.searchWord=keyWords;
};
this.getSongList();
that.$u.vuex("currentPlayer.canPlay",false);
//当前是是否暂停或停止状态,true 表示暂停或停止,false 表示正在播放
if(playerUtil.bgAudioManager.paused==true){
playerUtil.initPlayer(that);
}
},
methods:{
getSongList:function(){
let that=this;
let param={
pageNum:that.pageNum,
pageSize:that.pageSize,
keyWords:encodeURI(this.searchWord)
};
console.log("搜索歌曲列表",param);
this.$u.api.music.searchMusicList(param).then(res => {
//console.log("获取歌曲列表结果",res);
if(res.code==200){
let result= res.data;
if(result!=null&&result!=undefined){
let reqData= result.data;
this.total= reqData.total;
let list=reqData.list;
if(that.loadMoreFlag==true){
this.songList=this.songList.concat(list);
return;
}else{
this.songList=list;
}
}
}
});
},
loadMore:function(){
let that=this;
if(that.songList.length>=that.total){
that.globalUtil.utilAlert("暂无更多");
that.loadMoreFlag=false;
return;
}
that.pageNum++;
that.loadMoreFlag=true;
console.log("加载更多");
that.getSongList();
},
toPlaySong:function(song){
//console.log("当前选中播放歌曲",song);
//this.$u.vuex("currentPlaySong",song);
let param={
musicId:song.rid
};
this.$u.api.music.getSongInfoAndLrc(param).then(res => {
if(res.code==200){
let baseInfoResult= res.data;
let lrclist= baseInfoResult.data.lrclist;
let songInfo= baseInfoResult.data.songinfo;
songInfo.lrclist=lrclist;
this.$u.api.music.getSongSrc(param).then(res => {
if(res.code==200){
let songSrcResult= res.data;
let songSrc=songSrcResult.data.url;
songInfo.playSrc=songSrc;
console.log("获取歌曲详细信息结果",songInfo);
this.$u.vuex("currentPlaySong",songInfo);
}
})
}
})
//this.$forceUpdate();
},
changePlayStatus:function(){
let that=this;
console.log("改变状态")
playerUtil.bindOnControllerPlay(that);
},
bindOnPlayBarChange(){
//this.$refs.playViewPopup.show();
},
bindOnShowPlayListPopup(){
//this.$refs.playListPopup.show();
},
playAll:function(){
},
addToLocal:function(){
let that=this;
},
download:function(song){
let that=this;
let param={
musicId:song.rid,
songName:that.escape2Html(song.name),
saveDir:that.escape2Html(song.artist),
};
console.log("下载参数",param);
this.$u.api.music.downLoadSong(param).then(res => {
console.log("下载结果",res);
if(res.code==200){
that.globalUtil.utilAlert("下载成功");
let playSrc= res.data.url;
}else{
that.globalUtil.utilAlert("下载失败");
}
})
},
escape2Html:function(str) {
var arrEntities={'lt':'<','gt':'>','nbsp':' ','amp':'&','quot':'"','$':','};
return str.replace(/&(lt|gt|nbsp|amp|quot);/ig,function(all,t){
return arrEntities[t];
});
}
}
}
</script>
<style lang="scss">
</style>
+249
View File
@@ -0,0 +1,249 @@
<template>
<view>
<u-navbar :is-back="true" back-icon-color="#333333"
title="通过朋友验证" :title-bold="true" :title-size="34"
:background="{ background: '#ffffff' }"
title-color="#404133" :border-bottom="false">
</u-navbar>
<view class="">
<scroll-view :scroll-x="false" :scroll-y="true" class="u-p-t-10 u-p-b-30"
:style="'width:100%;height:'+scrollviewHeight+'px'">
<view class="u-p-l-40 u-p-r-40">
<view class="u-p-l-20 u-title-color u-font-28">
<text>设置备注</text>
</view>
<view class="inputBox">
<u-input :custom-style="customInputStyle"
v-model="form.nickName" type="text"
:border="false" :height="60" :clearable="false"/>
</view>
<view class="u-title-color u-p-l-30 u-m-t-10">
<text>
<text style="font-size: 28rpx;">"{{form.userRemark}}"</text>
<text style="color: #36648b;margin-left: 20rpx;">选词填入</text>
</text>
</view>
</view>
<view class="u-m-t-30 u-p-l-40 u-p-r-40">
<view class="u-p-l-20 u-title-color u-font-28">
<text>添加标签与描述</text>
</view>
<view style="background-color: #f0f0f0;border-radius: 16rpx;margin-top: 20rpx;font-size: 32rpx;">
<view class="u-flex u-row-between u-col-center" style="padding:16rpx 26rpx;">
<view class="u-p-20 label-font">
<text>标签</text>
</view>
<view class="u-p-20">
<u-icon name="arrow-right" color="#909399" :size="32"></u-icon>
</view>
</view>
<u-gap :height="1" bg-color="#e5e8ec"></u-gap>
<view class="u-flex u-row-between u-col-center" style="padding:16rpx 26rpx;">
<view class="u-p-20 label-font">
<text>描述</text>
</view>
<view class="u-p-20">
<u-icon name="arrow-right" color="#909399" :size="32"></u-icon>
</view>
</view>
</view>
</view>
<view class="u-m-t-30 u-p-l-40 u-p-r-40">
<view class="u-p-l-20 u-title-color u-font-28">
<text>设置朋友权限</text>
</view>
<view style="background-color: #f0f0f0;border-radius: 16rpx;margin-top: 20rpx;font-size: 32rpx;">
<view class="u-flex u-row-between u-col-center"
@click="changePower(0)"
style="padding:16rpx 26rpx;">
<view class="u-p-20 label-font">
<text>聊天朋友圈微信运动等</text>
</view>
<view class="u-p-20" v-show="form.friendPower==0">
<u-icon name="checkbox-mark" color="#19be6b" :size="32"></u-icon>
</view>
</view>
<u-gap :height="1" bg-color="#e5e8ec"></u-gap>
<view class="u-flex u-row-between u-col-center"
@click="changePower(1)"
style="padding:16rpx 26rpx;">
<view class="u-p-20 label-font">
<text>仅聊天</text>
</view>
<view class="u-p-20" v-show="form.friendPower==1">
<u-icon name="checkbox-mark" color="#19be6b" :size="32"></u-icon>
</view>
</view>
</view>
</view>
<view class="u-m-t-30 u-p-l-40 u-p-r-40" v-if="form.friendPower==0">
<view class="u-p-l-20 u-title-color u-font-28">
<text>朋友圈和状态</text>
</view>
<view style="background-color: #f0f0f0;border-radius: 16rpx;margin-top: 20rpx;font-size: 32rpx;">
<view class="u-flex u-row-between u-col-center" style="padding:16rpx 26rpx;">
<view class="u-p-20 label-font">
<text>不让他()</text>
</view>
<view class="u-p-20">
<u-switch v-model="form.forbidSelf" :size="40" active-color="#19be6b" inactive-color="#eee"></u-switch>
</view>
</view>
<u-gap :height="1" bg-color="#e5e8ec"></u-gap>
<view class="u-flex u-row-between u-col-center" style="padding:16rpx 26rpx;">
<view class="u-p-20 label-font">
<text>不看他()</text>
</view>
<view class="u-p-20">
<u-switch v-model="form.forbidHis" :size="40" active-color="#19be6b" inactive-color="#eee"></u-switch>
</view>
</view>
</view>
</view>
</scroll-view>
</view>
<view :style="'height:'+footerHeight+'px'"
class="u-flex u-row-center u-col-top footerbox">
<u-button type="success" :custom-style="customBtnStyle" @click="submitApply">完成</u-button>
</view>
<u-popup v-model="loadingShow"
:mask-close-able="false" :mask="false"
mode="center" border-radius="20" width="250rpx" height="250rpx">
<view class="u-flex u-row-center u-col-center"
style="flex-direction: column; text-align: center;
background-color: #000000;color: #ffffff;height: 250rpx;width: 250rpx;">
<view v-if="loadingStep==1">
<view>
<!-- <u-circle-progress :percent="100" bg-color="none"
inactive-color="#909399"
active-color="#ffffff"
:border-width="6"
:duration="1000" :width="100">
</u-circle-progress> -->
<u-loading mode="circle" :size="80" color="#909399"></u-loading>
</view>
<view class="u-m-t-20 u-font-32" style="font-weight: 420rpx;">正在处理...</view>
</view>
<view v-if="loadingStep==2">
<view>
<u-icon name="checkmark" color="#ffffff" :size="80"></u-icon>
</view>
<view class="u-m-t-20 u-font-32" style="font-weight: 420rpx;">已通过验证</view>
</view>
</view>
</u-popup>
</view>
</template>
<script>
export default {
data() {
return {
scrollviewHeight:0,
footerHeight:0,
customInputStyle:{
fontSize:'32rpx',
color:'#909399',
paddingLeft:'10rpx'
},
form:{
id:'3',
avatar:'/static/image/default/default-user/3.jpg',
nickName:'王工',
signature:'',
userRemark:'你好,美女',
address:'浙江 杭州',
sex:0,
friendPower:0,
forbidSelf:false,
forbidHis:false,
},
customBtnStyle:{
padding:'20rpx 40rpx',
width:'300rpx'
},
loadingShow:false,
loadingStep:1,
};
},
created:function(){
let pageHeight= this.$u.sys().windowHeight;
this.scrollviewHeight=pageHeight*0.783;
this.footerHeight=pageHeight*0.09;
},
onLoad:function(option){
let that=this;
/* let param=JSON.parse(decodeURIComponent(option.personInfo));
this.form=param; */
this.form=this.yyy_current_user;
},
methods:{
friendNameFocus:function(){
let that=this;
},
changePower:function(status){
let that=this;
},
submitApply:function(){
let that=this;
that.loadingStep=1;
that.loadingShow=true;
setTimeout(function(){
that.loadingStep=2;
setTimeout(function(){
that.loadingShow=false;
uni.navigateTo({
animationType:'slide-in-left',
url:'/pages/find/shake/friend_home?personInfo='+encodeURIComponent(JSON.stringify(that.form))
});
/* that.$u.route({
url:'/pages/find/shake/friend_home',
animationType:'slide-in-left',
params:{
personInfo:encodeURIComponent(JSON.stringify(that.form))
},
}) */
},400)
},800);
}
}
}
</script>
<style lang="scss" scoped>
.inputBox{
background-color: #f0f0f0;
border-radius: 16rpx;
margin-top: 20rpx;
padding:16rpx 26rpx;
font-size: 32rpx;
}
.footerbox{
position: absolute;
bottom: 0px;
width: 100%;
background-color: #ffffff;
//opacity: 0.7;
}
.label-font{
font-size: 34rpx;
color: #000000;
font-weight: 420;
}
.u-title-color{
color: #606266 !important;
font-size: 30rpx;
}
</style>
<style lang="scss">
page{
background-color: #ffffff;
}
</style>
@@ -0,0 +1,554 @@
<template>
<view class="message-item-container"
:class="checkBoxFlag?'u-flex u-row-left u-col-center':''">
<view v-if="checkBoxFlag">
<template v-if="item.messageType!=0">
<u-checkbox :size="46" v-model="item.checked"
shape="circle" active-color="#19be6b" @click.native="checkChange(item)"></u-checkbox>
</template>
</view>
<view class="u-p-b-20 u-p-t-20" style="width: 100%;">
<!-- 系统信息-->
<view v-if="item.messageType==0">
<view v-if="item.showTimeFlag" style="text-align: center;color:#aaaaaa;font-size: 28rpx;margin-top: 20rpx;">
<text v-if="item.formatTimeStr&&item.formatTimeStr.length>0">
{{item.formatTimeStr}}
</text>
<text v-else>
{{item.createTime.substring(10,16)}}
</text>
</view>
<view style="text-align: center;color:#aaaaaa;font-size: 30rpx;margin-top: 20rpx;">
{{parseSYSContent(item)}}
</view>
</view>
<view v-else>
<view class="chat-time">
<text v-if="item.showTimeFlag">
<text v-if="item.formatTimeStr&&item.formatTimeStr.length>0">
{{item.formatTimeStr}}
</text>
<text v-else>
{{item.createTime.length>10?item.createTime.substring(10,16):item.createTime}}
</text>
</text>
</view>
<view :class="{'chat-container':true,'chat-location-me':item.meFlag}">
<view class="chat-icon-container u-flex u-row-center u-col-center"
@click="toYYYPerson(item)">
<view hover-class="my-hover-class"
class="u-flex u-row-center u-col-center">
<u-image :class="{'chat-icon':true,'chat-icon-me':item.meFlag}"
:src="item.userAvatar" width="80rpx" height="80rpx"
mode="aspectFill">
<view slot="error"
class="u-flex u-row-center u-col-center u-p-t-10"
style="width: 80rpx;height: 80rpx;border-radius: 12rpx;">
<view>
<image src="/static/image/default/default-user/default-user.png"
style="width: 50rpx;height:50rpx;"></image>
</view>
</view>
</u-image>
</view>
</view>
<view class="chat-content-container u-p-t-10">
<!-- 文本信息 -->
<view v-if="item.contentType == messageApi.CONTENT_TYPE.TEXT_CONTENT_TYPE">
<zb-tooltip placement="top" :visible.sync="toolTipFlag" color="#4c4c4c">
<view slot="content" style="width: 550rpx;"
class="u-flex u-flex-wrap u-row-left u-col-center">
<view v-for="(item,index) in toolTipData" :key="index"
style="text-align: center;padding: 20rpx 30rpx;">
<view class="u-flex u-row-center u-col-center" @click="handleMessage(item)">
<view>
<u-image :src="item.icon" :width="36" :height="36"></u-image>
</view>
</view>
<view style="font-size:26rpx;margin-top: 6rpx;">
<text>{{item.title}}</text>
</view>
</view>
</view>
<view @longpress="toolTipFlag=!toolTipFlag"
:class="{'chat-text-container':true,'chat-text-container-me u-text-reserve':item.meFlag}">
<u-parse :html="parseTextContent(item)"
:tag-style="tagStyle">
</u-parse>
</view>
</zb-tooltip>
</view>
<!-- 图片信息 -->
<view v-if="item.contentType == messageApi.CONTENT_TYPE.IMG_CONTENT_TYPE">
<view class="content contentType3" @tap="showPic(item)">
<u-image :width="item.content.width*2" :height="item.content.height*2"
:lazy-load="true" mode="widthFix" :src="parseImageSrc(item)">
<u-loading slot="loading"></u-loading>
</u-image>
</view>
</view>
</view>
</view>
</view>
</view>
</view>
</template>
<script>
var previewSrcArr = [];
export default {
name: "message-item",
props: {
item: {
type: Object,
default: function() {
return {
"id": "",
"chatGroupId": "",
"userId": 0,
"meFlag": true,
"userName": '',
"userAvatar": "",
'messageType': "",
"contentType": "",
"content": {},
"timestamp": "",
"createTime": "",
"platFrom": this.messageApi.msgPlat,
}
}
},
checkBoxFlag:{
type:Boolean,
default:false
}
},
data() {
return {
toolTipFlag: false,
toolTipData: [{
id: 1,
icon: '/static/image/wx/handle-msg/copy.jpg',
title: '复制',
disabled: false
},
{
id: 2,
icon: '/static/image/wx/handle-msg/zhuanfa.jpg',
title: '转发', //转发
disabled: false
},
{
id: 4,
icon: '/static/image/wx/handle-msg/shoucang.jpg',
title: '收藏',
disabled: false
},
{
id: 5,
icon: '/static/image/wx/handle-msg/shanchu.jpg',
title: '删除',
disabled: false
},
{
id: 6,
icon: '/static/image/wx/handle-msg/duoxuan.jpg',
title: '多选',
disabled: false
},
{
id: 7,
icon: '/static/image/wx/handle-msg/yinyong.jpg',
title: '引用',
disabled: false
},
{
id: 8,
icon: '/static/image/wx/handle-msg/tixing.jpg',
title: '提醒',
disabled: false
},
{
id: 9,
icon: '/static/image/wx/handle-msg/souyisou.jpg',
title: '搜一搜',
disabled: false
},
],
tagStyle:{
img:'width:22px;height:22px;position:relative;top:10rpx;',
span:'margin:0px;padding:0px;font-size:30rpx',
},
previewVideoFlag:false, //播放视频控制器
previewVideoSrc:'',
redbagPopFlag:false,
maskCustomStyle:{
background: 'rgba(255, 255, 255, 0.7)'
},
currentRedBagInfo:null,
};
},
methods: {
parseSYSContent:function(item){
let that=this;
let contentType = item.contentType;
let contentObj=item.content;
if (contentType == 1) {
let msgStr = contentObj.text;
console.log("transText",msgStr);
return msgStr;
}
},
//内容格式化
parseTextContent: function(item) {
let that=this;
let contentType = item.contentType;
let contentObj=item.content;
let msgStr = contentObj.text;
let sysType = contentObj.contentType; //内容类型
let optionType = contentObj.optionType;
let transText = this.transform(msgStr,'','',contentObj.linkName);
return transText;
},
//预览图片
showPic:function(item){
let url= item.content.fullPath;
let target= item.content.fileSaveTarget;
if(target=="local"){
url= this.$u.api.multipartAddress.getFileByPath+url;
}
uni.previewImage({
urls: previewSrcArr.length > 0 ? previewSrcArr : [url],
current: url,
loop: false,
});
},
parseImageSrc:function(item){
let that=this;
let msgId= item.id;
let localSrc= uni.getStorageSync("image"+msgId);
if(localSrc){
return localSrc;
}
let contentObj=item.content;
let url= contentObj.fullPath;
let target= contentObj.fileSaveTarget;
if(target=="local"){
let fileName= contentObj.fileName;
url=this.$u.api.multipartAddress.showFile+fileName;
}
that.setImageLocalSrc(url,msgId);
return url;
},
parseImgSize: function(item, type) {
let contentObj=item.content;
let height = contentObj.height;
let width = contentObj.width;
if (type == "h") {
if (height == null || height == undefined) {
return "auto";
} else {
return height * 2;
}
} else {
if (width == null || width == undefined) {
return 300;
} else {
return width * 2;
}
}
},
setImageLocalSrc(url,msgId){
let that=this;
that.messageApi.setImageLocalSrc(url,msgId);
},
toYYYPerson:function(item){
let that=this;
if(item.meFlag==false){
that.$emit("toYYYPerson",item);
}
},
checkChange:function(msg){
let that=this;
that.$emit("checkChange",msg);
},
handleMessage:function(menuItem){
this.toolTipFlag=false;
this.$emit("handleMessage",menuItem,this.item);
},
transform (content, fileSize, fileSuffix,linkName) {
if (fileSize === undefined) {
fileSize = '';
}
if (fileSuffix === undefined) {
fileSuffix = '';
}
let html = function(end) {
return new RegExp('\\n*\\[' + (end || '') +
'(code|pre|div|span|p|table|thead|th|tbody|tr|td|ul|li|ol|li|dl|dt|dd|h2|h3|h4|h5)([\\s\\S]*?)]\\n*',
'g');
};
if (content)
{
content = content.replace(/&(?!#?[a-zA-Z0-9]+;)/g, '&amp;')
.replace(/</g, '&lt;')
.replace(/>/g, '&gt;')
.replace(/'/g, '&#39;')
.replace(/"/g, '&quot;') // XSS
.replace(html(), '<$1 $2>')
.replace(html('/'), '</$1>') // 转移HTML代码
.replace(/\n/g, '<br>'); // 转义换行
content=getUrl(content);
content=content.replace(/face\[([^\s\[\]]+?)]/g, function(face) {
let alt = face.replace(/^face/g, '');
let fa =faceUtil.emojiMap;
let srcPrefix=faceUtil.emojiUrl;
let imageSrc=srcPrefix+ fa[alt];
//console.log("表情",imageSrc);
let imgContent= '<img class="emoji" src="' +imageSrc+ '"/>';
return imgContent;
})
// 转义图片
.replace(/img\[([^\s]+?)]/g, function(img) {
let href = img.replace(/(^img\[)|(]$)/g, '');
return '<img class="message-img" src="' + href + '" alt="消息图片不能加载">';
})
// 转义文件
.replace(/file\([\s\S]+?\)\[[\s\S]*?]/g, function(str) {
let href = (str.match(/file\(([\s\S]+?)\)\[/) || [])[1];
let text = (str.match(/\)\[([\s\S]*?)]/) || [])[1];
if (!href) return str;
return '<div class="flex"><i class="iconfont icon-xiazai-yun"></i><a class="message-file" href="' +
href + '">' + (text || href) + '</a><span>' + fileSize + '</span></div>'
})
// 转义音频
.replace(/audio\[([^\s]+?)]/g, function(audio) {
return '<div class="message-audio" data-src="' + audio.replace(/(^audio\[)|(]$)/g, '') +
'"><i class="layui-icon">&#xe652;</i><p>音频消息</p></div>';
})
// 转义视频
.replace(/video\[([^\s]+?)]/g, function(video) {
return '<div class="message-video" data-src="' + video.replace(/(^video\[)|(]$)/g, '') +
'"><i class="layui-icon">&#xe652;</i></div>';
})
// 转义链接
.replace(/a\([\s\S]+?\)\[[\s\S]*?]/g, function(str) {
let href = (str.match(/a\(([\s\S]+?)\)\[/) || [])[1];
let text = (str.match(/\)\[([\s\S]*?)]/) || [])[1];
if (!href) return str;
if(linkName&&linkName.length>0){
return '<a href="' + href + '" target="_blank">' + linkName + '</a>';
};
return '<a href="' + href + '" target="_blank">' + (text || href) + '</a>';
})
}
return content;
}
}
}
</script>
<style lang="scss" scoped>
.message-item-container {
padding:0rpx 20rpx;
}
.chat-time {
padding: 4rpx 0rpx;
text-align: center;
font-size: 28rpx;
color: #aaaaaa;
}
.chat-container {
width: 100%;
display: flex;
flex-direction: row;
justify-content: flex-start;
justify-items: flex-start;
align-items: flex-start;
}
.chat-location-me {
flex-direction: row-reverse;
text-align: right;
}
.chat-icon-me {
margin-right: 10rpx;
}
.chat-icon-container {
margin-top: 12rpx;
}
.chat-icon {
width: 80rpx;
height: 80rpx;
border-radius: 10rpx;
background-color: #ffffff;
}
.chat-content-container {
margin: 0rpx 15rpx;
max-width: 70%;
}
.chat-user-name {
font-size: 26rpx;
color: #888888;
}
.chat-text-container {
//word-break: break-all;
word-wrap:break-word;
background-color: #ffffff;
border-radius: 10rpx;
padding: 20rpx 20rpx;
margin-top: 5rpx;
font-size: 32rpx;
}
.chat-text-container-me {
background-color: #95ec69;
}
.emoji {
width: 40rpx !important;
height: 40rpx !important;
position: relative;
top: 10rpx;
}
//语音信息样式
.content-audio-container {
background-color: #ffffff;
border-radius: 10rpx;
padding: 25rpx 20rpx;
margin-top: 5rpx;
/* #ifndef APP-NVUE */
max-width: 500rpx;
/* #endif */
display: flex;
flex-direction: row;
align-items: center;
.voice_icon {
height: 34rpx;
width: 34rpx;
background-repeat: no-repeat;
background-size: 100%;
}
.voice_icon_right {
background-image: url('@/static/images/chat/voice/voice-left-3.png');
margin-left: 10rpx;
}
.voice_icon_left {
background-image: url('@/static/images/chat/voice/voice-right-3.png');
margin-right: 10rpx;
}
.voice_icon_right_an {
animation: voiceAn_right 1s linear alternate infinite;
}
.voice_icon_left_an {
animation: voiceAn_left 1s linear alternate infinite;
}
@keyframes voiceAn_right {
0% {
background-image: url('@/static/images/chat/voice/voice-left-1.png');
}
50% {
background-image: url('@/static/images/chat/voice/voice-left-2.png');
}
100% {
background-image: url('@/static/images/chat/voice/voice-left-3.png');
}
}
@keyframes voiceAn_left {
0% {
background-image: url('@/static/images/chat/voice/voice-right-1.png');
}
50% {
background-image: url('@/static/images/chat/voice/voice-right-2.png');
}
100% {
background-image: url('@/static/images/chat/voice/voice-right-3.png');
}
}
}
//我的语音信息样式
.chat-audio-container-me {
background-color: #95ec69;
flex-direction: row-reverse;
}
//文件信息样式
.contentType-file {
width: 450rpx;
padding: 0;
border-radius: 10rpx;
border: 1rpx solid #e4e7ed;
background-color: #ffffff !important;
}
//红包
.contentType-redbag {
padding: 20rpx 30rpx;
padding-bottom: 6rpx;
border-radius: 10rpx;
background-color: #f29100;
color: #ffffff;
}
//位置
.contentType-location {
width: 500rpx;
padding: 0rpx 10rpx;
border-radius: 10rpx;
border: 1rpx solid #e4e7ed;
background-color: #ffffff !important;
}
//组合信息
.contentType-fixed {
border-radius: 10rpx;
font-size: 32rpx;
word-break: break-word;
padding: 20rpx;
background-color: #95ec69 !important;
border: 1rpx solid #e4e7ed;
max-width: 400rpx;
.img {
width: 200rpx;
height: auto;
max-width: 300rpx;
max-height: 400rpx;
}
}
.u-flex-reserve {
flex-direction: row-reverse;
}
.u-text-reserve {
text-align: left;
}
</style>
File diff suppressed because it is too large Load Diff
+441
View File
@@ -0,0 +1,441 @@
<template>
<view class="zhuanfa-container">
<template v-if="moreFlag==false">
<view>
<u-navbar :is-back="false"
back-icon-color="#333333"
title=""
:border-bottom="false"
:background="{ background: '#f0f0f0'}"
z-index="1001">
<view class="slot-wrap u-flex u-row-between u-col-center u-font-32">
<view @click="goback()">
<text>关闭</text>
</view>
<view style="font-weight: bold;font-size: 34rpx;color: #000000;">
<text>选择一个聊天</text>
</view>
<view @click="changeMoreFlag(1)">
<text>多选</text>
</view>
</view>
</u-navbar>
<view>
<view style="background-color: #f0f0f0;" class="u-p-30">
<view class="u-flex u-row-center u-col-center"
style="background-color: #ffffff;height:70rpx;border-radius: 10rpx;color: #c0c0c0;">
<view class="u-m-r-20">
<u-icon class="u-clear-icon" top="6rpx" :size="40" name="search" color="#c0c0c0"></u-icon>
</view>
<view style="color: #c0c0c0;font-size: 34rpx;">搜索</view>
</view>
<view class="u-m-t-40 u-p-b-20" v-if="latestZhuanFa.length>0">
<view style="font-size: 30rpx;font-weight: bold;">
<text>最近转发</text>
</view>
<view class="u-flex u-row-left u-col-center u-m-t-20" style="text-align: center;">
<view class="u-m-r-40" v-for="(lastestItem,index) in latestZhuanFa" :key="index">
<view class="u-flex u-row-center u-col-center">
<view style="height: 100rpx;width: 100rpx;">
<u-image :src="lastestItem.avatar"
:width="100" :height="100" :border-radius="12"></u-image>
</view>
</view>
<view class="u-line-2 u-tips-color"
style="width: 100rpx;height: 64rpx;line-height: 30rpx;font-size: 26rpx;padding:8rpx;">
<text>{{lastestItem.nickName}}</text>
</view>
</view>
</view>
</view>
</view>
<view class="u-p-30" style="background-color: #ffffff;border-top-left-radius: 20rpx;border-top-right-radius: 20rpx;">
<view class="u-flex u-row-between u-col-center u-font-30">
<view style="color: #000000;font-weight: bold;">
<text>最近聊天</text>
</view>
<view style="color:#36648b;">
<text>创建聊天</text>
</view>
</view>
<view v-if="lastestChatUsers.length>0" class="u-m-t-30">
<view v-for="(user,uIndex) in lastestChatUsers" :key="uIndex"
class="u-flex u-row-left u-col-center u-p-t-16 u-p-b-16">
<view style="width:90rpx;" class="u-flex u-row-left u-col-center">
<view>
<u-image :src="user.avatar" :width="76" :height="76" border-radius="8rpx"></u-image>
</view>
</view>
<view style="width: 600rpx;"
class="u-flex u-row-between u-col-center u-p-20 u-border-bottom">
<view style="text-align: left;">
<view class="u-line-1" style="font-size: 32rpx;color: #000000;">
<text>{{user.nickName}}</text>
</view>
</view>
</view>
</view>
</view>
</view>
</view>
</view>
</template>
<template v-if="moreFlag==true">
<view>
<u-navbar :is-back="false"
back-icon-color="#333333"
title=""
:border-bottom="false"
:background="{ background: '#f0f0f0'}"
z-index="1001">
<view class="slot-wrap u-flex u-row-between u-col-center u-font-32">
<view @click="changeMoreFlag(0)">
<text>取消</text>
</view>
<view style="font-weight: bold;font-size: 34rpx;color: #000000;">
<text>选择多个聊天</text>
</view>
<view>
<view v-if="checkedUsers.length<1" style="border-radius: 10rpx;background-color: #dddddd;color: #909399;padding: 10rpx 20rpx;">
<text>完成</text>
</view>
<view v-if="checkedUsers.length>0"
@click="openZhuanFa()"
style="border-radius: 10rpx;background-color: #19be6b;color: #ffffff;padding: 10rpx 20rpx;">
<text>完成({{checkedUsers.length}})</text>
</view>
</view>
</view>
</u-navbar>
<view style="background-color: #f0f0f0;">
<view v-if="checkedUsers.length<1" class="u-p-30">
<view class="u-flex u-row-center u-col-center"
style="background-color: #ffffff;height:70rpx;border-radius: 10rpx;color: #c0c0c0;">
<view class="u-m-r-20">
<u-icon class="u-clear-icon" top="6rpx" :size="40" name="search" color="#c0c0c0"></u-icon>
</view>
<view style="color: #c0c0c0;font-size: 34rpx;">搜索</view>
</view>
</view>
<view v-else class="u-p-30">
<view class="u-flex u-row-left u-col-center"
style="background-color: #ffffff;border-radius: 10rpx;color: #c0c0c0;">
<view class="u-p-20" style="width: 400rpx;">
<scroll-view class="hidden-scroll-bar"
:scroll-into-view="scrollIntoViewId"
:scroll-with-animation="true"
:scroll-y="false" :scroll-x="true" style="width:400rpx;">
<view class="u-flex u-row-left u-col-center">
<view class="u-m-l-20"
v-for="(checkeItem,index) in checkedUsers"
:key="index">
<view :id="'u-'+checkeItem.chatNumber"
class="u-flex u-row-center u-col-center">
<view>
<u-image :src="checkeItem.avatar"
:width="80" :height="80" :border-radius="12"></u-image>
</view>
</view>
</view>
<view class="u-p-l-30" v-if="checkedUsers.length<4" style="color: #909399;font-size: 34rpx;">
<text>搜索</text>
</view>
</view>
</scroll-view>
</view>
<view v-if="checkedUsers.length>=4" class="u-p-l-30" style="color: #909399;font-size: 34rpx;" >
<text>搜索</text>
</view>
</view>
</view>
<view class="u-p-30" v-if="latestZhuanFa.length>0">
<view style="font-size: 30rpx;font-weight: bold;">
<text>最近转发</text>
</view>
<view class="u-flex u-row-left u-col-center u-m-t-20" style="text-align: center;">
<view class="u-m-r-40" v-for="(lastestItem,index) in latestZhuanFa" :key="index">
<view class="u-flex u-row-center u-col-center">
<view>
<u-image :src="lastestItem.avatar"
:width="100" :height="100" :border-radius="12"></u-image>
</view>
</view>
<view class="u-line-2 u-tips-color"
style="width: 100rpx;height: 64rpx;line-height: 30rpx;font-size: 26rpx;padding: 8rpx;">
<text>{{lastestItem.nickName}}</text>
</view>
</view>
</view>
</view>
<view class="u-p-30"
style="background-color: #ffffff;border-top-left-radius: 20rpx;border-top-right-radius: 20rpx;">
<view class="u-flex u-row-between u-col-center u-font-30">
<view style="color: #000000;font-weight: bold;">
<text>最近聊天</text>
</view>
<view style="color:#36648b;">
<text>从通讯录选择</text>
</view>
</view>
<view v-if="lastestChatUsers.length>0" class="u-m-t-30">
<view v-for="(user,uIndex) in lastestChatUsers" :key="uIndex"
class="u-flex u-row-left u-col-center u-m-b-20">
<view>
<u-checkbox :size="46" v-model="user.checked" @click.native="checkChange(user)"
shape="circle" active-color="#19be6b"></u-checkbox>
</view>
<view class="u-flex u-row-left u-col-center u-p-b-20">
<view style="width:90rpx;" class="u-flex u-row-center u-col-center">
<view>
<u-image :src="user.avatar" :width="76" :height="76" border-radius="8rpx"></u-image>
</view>
</view>
<view class="u-flex u-row-between u-col-center u-p-20 u-border-bottom">
<view style="text-align: left;">
<view class="u-line-1" style="font-size: 32rpx;color: #000000;width: 480rpx;">
<text>{{user.nickName}}</text>
</view>
</view>
</view>
</view>
</view>
</view>
</view>
</view>
</view>
</template>
<u-popup v-model="openZhuanFaFlag" mode="center" border-radius="16"
:mask-close-able="false"
width="625rpx" :height="checkedUsers.length>3?'600rpx':'520rpx'">
<view class="u-p-30">
<view style="font-size: 34rpx;font-weight: bold;">
<text>分别发送给:</text>
</view>
<view class="u-m-t-30">
<view class="u-flex u-flex-wrap u-row-left u-col-center">
<view v-for="(checkeItem,index) in checkedUsers" class="u-m-r-16 u-m-t-10"
:key="index">
<view class="u-flex u-row-center u-col-center">
<view>
<u-image :src="checkeItem.avatar"
:width="80" :height="80" :border-radius="12"></u-image>
</view>
</view>
</view>
</view>
</view>
<view class="u-flex u-row-between u-col-center u-m-t-30 u-p-t-30 u-p-b-10 u-tips-color u-border-top">
<view>
<text>[逐条转发]{{selectedMessages.length>0?selectedMessages.length:2}}条信息</text>
</view>
<view>
<u-icon name="arrow-right" size="32"></u-icon>
</view>
</view>
<view class="u-m-t-20 u-p-b-20">
<view style="background-color: #f7f7f7;width: 550rpx;padding:16rpx 20rpx;text-align: left;color: #909399;font-size: 30rpx;">
<text>给朋友留言</text>
</view>
</view>
<view style="position: absolute;width: 560rpx;bottom:30rpx;"
class="u-flex u-row-between u-col-center u-font-34 u-p-t-30 u-border-top">
<view style="color: #000000;text-align: center;width: 50%;">
<view @click="cancelZhuanFa()">
<text>取消</text>
</view>
</view>
<view style="color: #36648b;text-align: center;width: 50%;">
<view @click="confirmSend()">
<text>发送({{checkedUsers.length}})</text>
</view>
</view>
</view>
</view>
</u-popup>
<u-popup v-model="maxLengthFlag" mode="center" border-radius="16"
:mask-close-able="false" height="300rpx"
width="620rpx">
<view style="text-align: center;font-weight: bold;font-size: 34rpx;">
<view class="u-flex u-row-center u-col-center" style="width: 100%; height: 200rpx;">
<view>
<text>最多只能选择9个聊天</text>
</view>
</view>
<view @click="maxLengthFlag=false"
style="color: #36648b;padding-top:30rpx;padding-bottom: 30rpx; width: 100%;" class="u-border-top">
<text>我知道了</text>
</view>
</view>
</u-popup>
</view>
</template>
<script>
export default {
data() {
return {
moreFlag:false,
scrollHidden:false,
checkNum:0,
latestZhuanFa:[],
checkedUsers:[],
scrollIntoViewId:"",
lastestChatUsers:[],
openZhuanFaFlag:false,
maxLengthFlag:false,
selectedMessages:[],
};
},
onPageScroll:function(e){
let top= e.scrollTop;
let pageHeight= this.$u.sys().windowHeight;
if((top/pageHeight)>0.25){
console.log("隐藏");
this.scrollHidden=true;
}else{
this.scrollHidden=false;
}
},
onLoad:function(option){
if(option.checkedMessages){
this.selectedMessages=JSON.parse(decodeURIComponent(option.checkedMessages));
this.selectedMessages[0].showTimeFlag=true;
};
this.checkedUsers=[];
this.latestZhuanFa=this.vuex_lastestZhuanFaUsers;
this.latestZhuanFa.map(function(item){
item.checked=false;
});
this.lastestChatUsers=this.vuex_yyyFriendList.concat(this.latestZhuanFa);
this.lastestChatUsers.map(function(item){
item.checked=false;
});
},
methods:{
goback:function(){
uni.navigateBack();
},
changeMoreFlag:function(value){
this.moreFlag=value;
},
checkChange:function(user){
let that=this;
let isExist = this.checkedUsers.some(item=>item.chatNumber===user.chatNumber);
if(!isExist){
if(that.checkedUsers.length>=9){
this.maxLengthFlag=true;
return;
};
this.checkedUsers.push(user);
this.$nextTick(function(){
that.scrollIntoViewId="u-"+user.chatNumber;
})
}else{
this.checkedUsers = this.checkedUsers.filter(function(item) {
return item.chatNumber!=user.chatNumber
});
}
},
openZhuanFa:function(){
this.openZhuanFaFlag=true;
},
confirmSend:function(){
let that=this;
console.log("===选择的用户===",that.checkedUsers);
console.log("===转发的信息===",that.selectedMessages);
let lastMsg=that.selectedMessages[that.selectedMessages.length-1];
let friendList=that.vuex_yyyFriendList;
for (var i = 0; i < friendList.length; i++) {
let friend= friendList[i];
friend.checked=false;
let isExist = that.checkedUsers.some(item=>item.chatNumber===friend.chatNumber);
if(isExist){
that.setLastMsgContent(friend,lastMsg,that.selectedMessages)
}
};
that.$nextTick(function(){
that.$u.vuex("vuex_yyyFriendList",friendList);
that.openZhuanFaFlag=false;
uni.navigateBack();
});
},
cancelZhuanFa:function(){
this.openZhuanFaFlag=false;
},
setLastMsgContent:function(friend,message){
let that=this;
let formatContent="";
let contentType=message.contentType;
let contentObj=message.content;
switch (contentType+""){
case "1":
formatContent=contentObj.text;
formatContent=formatContent.replace(/face\[([^\s\[\]]+?)]/g, function(face) {
return face.replace(/^face/g, '')
});
break;
case "2":
formatContent="[图片]";
break;
case "3":
formatContent="[视频]";
break;
case "4":
formatContent="[语音]";
break;
case "7":
formatContent="[红包]";
break;
case "10":
formatContent="[聊天记录]";
break;
case "11":
formatContent="[图文]";
break;
case "12":
formatContent="[视频文字]";
break;
default:
formatContent="[其他]";
break;
};
console.log("最后一条信息",formatContent);
console.log("群号",friend.chatNumber);
if(friend.chatNumber=="000000"){
let obj={
"lastMsgContent":formatContent,
"messageList":that.selectedMessages,
"lastMsgTime":message.createTime,
};
this.$u.vuex("vuex_fileAssist",obj);
}else{
friend.lastMsgContent=formatContent;
friend.sendTimeStr=message.createTime;
friend.messageList=that.selectedMessages;
}
},
},
}
</script>
<style lang="scss" scoped>
.slot-wrap {
display: flex;
align-items: center;
/* 如果您想让slot内容占满整个导航栏的宽度 */
flex: 1;
/* 如果您想让slot内容与导航栏左右有空隙 */
padding: 0 30rpx;
}
</style>
+239
View File
@@ -0,0 +1,239 @@
<template>
<view>
<view>
<u-navbar :custom-back="goback" title=" " :background="{ background: '#ffffff' }" :border-bottom="false">
<view class="slot-wrap" @click="toDetail()">
<view>
<u-icon name="more-dot-fill" color="#000000" :size="35"></u-icon>
</view>
</view>
</u-navbar>
</view>
<view class="friendInfo">
<view class="img">
<u-image :src="friendInfo.avatar"
mode="aspectFill" width="120" height="120" border-radius="12">
<u-loading slot="loading"></u-loading>
<view slot="error"
class="u-flex u-row-center u-col-center u-p-t-10"
style="width: 90rpx;height: 90rpx;background-color: #f1f1f1;border-radius: 12rpx;">
<view>
<image src="/static/image/default/default-user/default-user.png"
style="width: 64rpx;height: 64rpx;"></image>
</view>
</view>
</u-image>
</view>
<view class="friendInfo-desc">
<view class="friendInfo-desc-name u-flex u-row-left u-col-center">
<view class="u-line-2" style="font-size:42rpx;max-width: 400rpx;">
<text>{{friendInfo.nickName}}</text>
</view>
<view class="u-m-l-10 u-flex u-row-center u-col-center u-p-b-10">
<view>
<u-image v-if="friendInfo.sex==1" src="/static/image/chat/addFriend/woman.png" width="34rpx" height="34rpx"></u-image>
<u-image v-if="friendInfo.sex==0" src="/static/image/chat/addFriend/man.png" width="34rpx" height="34rpx"></u-image>
</view>
</view>
</view>
<view class="friendInfo-desc-gray u-line-1 u-m-b-4" style="max-width: 500rpx;">微信号{{friendInfo.chatNumber}}</view>
<view v-if="friendInfo.address&&friendInfo.address!=0&&friendInfo.address.length>0" class="friendInfo-desc-gray">地区{{friendInfo.address}}</view>
</view>
</view>
<u-cell-group>
<u-cell-item title="备注和标签" :title-style="titleStyle"></u-cell-item>
<u-cell-item :border-bottom="false" title="朋友权限"
:title-style="titleStyle" @click="setFiendPermission"></u-cell-item>
<u-gap height="20" bg-color="#eee" margin-top="1" margin-bottom="1"></u-gap>
<u-cell-item :title-style="titleStyle">
<view slot="title" class="u-flex u-row-left u-col-center">
<view>
<text>朋友圈</text>
</view>
<view class="u-flex u-row-left u-col-center u-m-l-50"
v-if="friendInfo.friendCircle&&friendInfo.friendCircle.length>0">
<template v-for="(circle,index) in friendInfo.friendCircle.length">
<view class="u-m-l-10" v-if="circle!=circle&&circle.length>0">
<u-image :src="circle" :width="90" :height="90"></u-image>
</view>
</template>
</view>
</view>
</u-cell-item>
<u-cell-item title="视频号" :title-style="titleStyle"></u-cell-item>
<u-cell-item :border-bottom="false" title="更多信息" :title-style="titleStyle" @click="linkToMoreInfoMation"></u-cell-item>
</u-cell-group>
<u-gap height="20" bg-color="#eee" margin-top="0" margin-bottom="1"></u-gap>
<view style="background-color: #ffffff;">
<view class="u-flex u-row-center u-col-center u-p-30"
style="font-size: 32rpx;color: #335f83;">
<view class="u-m-r-20">
<!-- width="36rpx" height="36rpx" -->
<u-image src="/static/image/chat/sms-send.png" mode="aspectFit" width="40rpx" height="40rpx"></u-image>
</view>
<view style="font-weight: 450;">
<text>发信息</text>
</view>
</view>
<u-gap height="1" bg-color="#eee"></u-gap>
<view class="u-flex u-row-center u-col-center u-p-30"
style="font-size: 32rpx;color: #335f83;">
<view class="u-m-r-20">
<!-- src="/static/image/chat/yinshipin.jpg" width="40rpx" height="40rpx"-->
<u-image src="/static/image/chat/video-call.png" mode="aspectFit" width="50rpx" height="50rpx"></u-image>
</view>
<view style="font-weight: 450;">
<text>音视频通话</text>
</view>
</view>
</view>
<u-action-sheet :list="callList" v-model="callShow" @click="callClick"></u-action-sheet>
<u-top-tips ref="uTips"></u-top-tips>
</view>
</template>
<script>
export default {
data() {
return {
titleStyle: {
marginLeft: '10rpx',
color: '#000000',
fontSize: "34rpx",
},
friendInfo: {},
callList:[
{text: '视频通话'},
{text: '语音通话'}
],
callShow:false,
}
},
onLoad(option) {
let that=this;
/* let param=JSON.parse(decodeURIComponent(option.personInfo));
this.friendInfo=param; */
this.friendInfo=this.yyy_current_user;
//往好友里面塞
let arr=JSON.parse(JSON.stringify(this.vuex_yyyFriendList));
let isExist = arr.some(item=>item.chatNumber===this.friendInfo.chatNumber);
if(!isExist){
arr.push(this.friendInfo);
};
this.$u.vuex("vuex_yyyFriendList",arr);
console.log("this.vuex_yyyFriendList=======",this.vuex_yyyFriendList);
},
methods: {
goback(){
console.log("自定义返回");
uni.navigateBack({
delta:3,
animationType:"slide-out-right"
});
},
//创建单聊会话
createSingleChat:function(){
let that=this;
},
//跳转聊天窗口
linkToChatting:function(groupInfo) {
let that=this;
},
//音视频弹窗
toCall() {
return;
},
//确认发起音视频
callClick:function(index){
this.globalUtil.utilAlert("不能进,没完事~敬请期待");
},
//设置标签
setFiendTag() {
this.globalUtil.utilAlert("不能进,没完事~敬请期待");
return;
},
//设置朋友权限
setFiendPermission() {
this.globalUtil.utilAlert("不能进,没完事~敬请期待");
return;
},
//查看朋友的朋友圈
viewHisFiendCircle() {
this.globalUtil.utilAlert("不能进,没完事~敬请期待");
return;
},
//更多信息
linkToMoreInfoMation() {
this.$u.route({
url: "/pages/tabbar/contact/friends/friend-more-info",
params: {
signature: this.friendInfo.signature
}
})
},
toDetail:function(){
this.$u.route({
url: "/pages/tabbar/contact/friends/friend-home-detail",
params: {
friendInfo:encodeURIComponent(JSON.stringify(this.friendInfo))
}
})
}
},
}
</script>
<style scoped lang="scss">
.slot-wrap {
display: flex;
align-items: center;
/* 如果您想让slot内容占满整个导航栏的宽度 */
flex: 1;
width: 100%;
/* 如果您想让slot内容与导航栏左右有空隙 */
padding: 0 30rpx;
flex-direction: row;
justify-content: flex-end;
}
.perch {
height: 10rpx;
}
.friendInfo {
display: flex;
justify-content: flex-start;
align-items: flex-start;
padding: 20rpx 30rpx 40rpx 40rpx;
background-color: #FFFFFF;
.img {
display: block;
width: 130rpx;
height: 130rpx;
border-radius: 10rpx;
}
&-desc {
padding-left: 30rpx;
&-name {
font-weight: bold;
font-size: 36rpx;
transform: translateY(-10rpx);
color: #000000;
}
&-gray {
color: #757575;
font-size: 32rpx;
font-weight: 420rpx;
}
}
}
</style>
<style>
page{
background-color: #eeeeee;
}
</style>
+80
View File
@@ -0,0 +1,80 @@
<template>
<view>
<u-navbar :is-back="true"
back-icon-color="#ffffff"
title="摇一摇"
:background="{ background: '#101010'}"
title-color="#ffffff"
:title-bold="true"
title-size="34"
:border-bottom="false"
z-index="1001">
<view slot="right" class="u-p-r-30" @click="toSet()">
<u-icon name="more-dot-fill" color="#ffffff" :size="36"></u-icon>
</view>
</u-navbar>
<view class="u-flex u-row-center u-col-center" style="padding-top: 60%;">
<view>
<u-image src="/static/image/wx/yaoyiyao-1.jpg" :width="200" :height="200"></u-image>
</view>
</view>
<view class="footer-box u-flex u-row-around u-col-center">
<view @click="activeTab=0">
<view class="u-flex u-row-center u-col-center">
<view>
<u-image v-if="activeTab==0" src="/static/image/wx/yaoyiyao-2.jpg" :width="48" :height="48"></u-image>
<u-image v-if="activeTab==1" src="/static/image/wx/yaoyiyao-b.jpg" :width="48" :height="48"></u-image>
</view>
</view>
<view class="u-m-t-8" :style="activeTab==1?'color:#595959;':''">
<text></text>
</view>
</view>
<view @click="activeTab=1">
<view class="u-flex u-row-center u-col-center">
<view>
<u-image v-if="activeTab==0" src="/static/image/wx/yaoyiyao-3.jpg" :width="48" :height="48"></u-image>
<u-image v-if="activeTab==1" src="/static/image/wx/yaoyiyao-c.jpg" :width="48" :height="48"></u-image>
</view>
</view>
<view class="u-m-t-8" :style="activeTab==0?'color:#595959;':''">
<text>歌曲和哼唱</text>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
activeTab:0,
};
},
methods:{
toSet:function(){
console.log("去摇一摇设置");
uni.$u.route("/pages/find/shake/set");
}
}
}
</script>
<style lang="scss" scoped>
.footer-box{
color: #ffffff;
width: 100%;
position: absolute;
bottom: 80rpx;
padding: 20rpx 100rpx;
text-align: center;
font-size: 22rpx;
}
</style>
<style>
page{
background-color: #101010;
}
</style>
+139
View File
@@ -0,0 +1,139 @@
<template>
<view>
<u-navbar :is-back="true"
back-icon-color="#333333"
title="打招呼的人"
:background="{ background: '#f0f0f0'}"
title-color="#000000"
:title-bold="true"
title-size="34"
:border-bottom="false"
z-index="1001">
<view slot="right" class="u-p-r-30 u-font-34" @click="clear()">
<text :style="linkedUsers.length<1?'color:#909399;':'color:#000000'">清空</text>
</view>
</u-navbar>
<view class="u-p-30">
<view v-if="linkedUsers.length>0">
<view class="u-p-b-20">
<text>近三天</text>
</view>
<view v-for="(user,uIndex) in linkedUsers" :key="uIndex"
class="u-flex u-row-left u-col-center u-p-b-12">
<view style="width:100rpx;" class="u-flex u-row-left u-col-center">
<view @longpress="delUser(user,uIndex)">
<u-image :src="user.avatar" :width="76" :height="76" border-radius="8rpx">
<view slot="error"
class="u-flex u-row-center u-col-center u-p-t-10 "
style="width: 76rpx;height: 76rpx;background-color: #f0f0f0;border-radius: 12rpx;">
<view>
<image src="/static/image/default/default-user/default-user.png"
style="width: 40rpx;height: 40rpx;"></image>
</view>
</view>
</u-image>
</view>
</view>
<view @click="toPersonInfo(user)"
style="width: 600rpx;"
class="u-flex u-row-between u-col-center u-p-t-6 u-p-b-12 u-border-bottom">
<view style="text-align: left;">
<view class="u-line-1" style="font-size: 32rpx;color: #000000;">
<text>{{user.nickName}}</text>
</view>
<view class="u-tips-color u-font-28">
<text>{{user.userRemark}}</text>
</view>
</view>
<template v-if="!idAdd(user)">
<view style="background-color: #f0f0f0;color: #000000;padding: 10rpx 20rpx;border-radius: 6rpx;text-align: center;font-size: 30rpx;">
<text>查看</text>
</view>
</template>
<template v-else>
<view class="u-font-28" style="position:relative;top: -16rpx;color: #595b5f;">
<text>已添加</text>
</view>
</template>
</view>
</view>
</view>
<view v-else style="padding-top: 40%;">
<view style="text-align: center;color: #000000;font-size: 34rpx;">
<text>暂时没有人向你打招呼</text>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
linkedUsers:[],
};
},
onLoad:function(){
this.linkedUsers=JSON.parse(JSON.stringify(this.vuex_linkedUsers));
},
methods:{
idAdd:function(user){
let that=this;
if(that.vuex_yyyFriendList.length<1){
return false;
}else{
for (var i = 0; i < that.vuex_yyyFriendList.length; i++) {
let item= that.vuex_yyyFriendList[i];
if(item.chatNumber==user.chatNumber){
return true;
}
}
}
return false;
},
clear:function(){
this.$u.vuex("vuex_linkedUsers",[]);
this.$u.vuex("vuex_yyyFriendList",[]);
this.$u.vuex("vuex_lastestZhuanFaUsers",[]);
this.$u.vuex("yyy_current_user",null);
this.linkedUsers=[];
},
toPersonInfo:function(user){
let that=this;
that.$u.vuex("yyy_current_user",user);
this.$u.route({
url:'/pages/tabbar/find/yaoyiyao/yaoyiyao-user-detail',
});
},
delUser:function(user,index){
let that=this;
uni.showModal({
title: '操作',
content: user.sendTimeStr,
cancelText:'删除',
confirmText:'修改时间',
editable:true,
success: function (res) {
if (res.confirm) {
let newTime=res.content;
if(newTime.length>0){
that.linkedUsers[index].sendTimeStr=newTime;
that.$u.vuex("vuex_linkedUsers",that.linkedUsers);
}
return;
} else if (res.cancel) {
that.linkedUsers.splice(index,1);
that.$u.vuex("vuex_linkedUsers",that.linkedUsers);
}
}
});
}
}
}
</script>
<style lang="scss">
</style>
+454
View File
@@ -0,0 +1,454 @@
<template>
<view>
<u-navbar :is-back="true"
back-icon-color="#333333"
title="摇一摇设置"
:background="{ background: '#f0f0f0'}"
title-color="#000000"
:title-bold="true"
title-size="34"
:border-bottom="false"
z-index="1001">
</u-navbar>
<view>
<u-cell-group>
<u-cell-item @click="showNewUserPop()" title="背景图片" :title-style="titleStyle"></u-cell-item>
<u-cell-item title="音效" :title-style="titleStyle" :arrow="false">
<u-switch slot="right-icon" size="48" active-color="#19BE6B" v-model="checked"></u-switch>
</u-cell-item>
<u-gap height="20" bg-color="#eee" margin-top="1" margin-bottom="1"></u-gap>
<u-cell-item title="打招呼的人" :title-style="titleStyle" @click="toLinkedList()"></u-cell-item>
<u-cell-item title="摇到的历史" @click="addAndUpdate()" :title-style="titleStyle"></u-cell-item>
<u-gap height="20" bg-color="#eee" margin-top="1" margin-bottom="1"></u-gap>
<u-cell-item title="摇一摇信息" :title-style="titleStyle" @click="toSetLatestUsers()"></u-cell-item>
</u-cell-group>
</view>
<u-popup v-model="newLatestFlag" mode="right"
safe-area-inset-bottom
:mask-close-able="false"
length="100%">
<scroll-view class="u-p-30 u-p-t-80" scroll-y="true" style="height:85%;width: 700rpx;">
<view>
<u-collapse :head-style="{borderBottom:'1rpx solid #909399'}">
<u-collapse-item :title="'第'+(index+1)+'位'"
v-for="(newUser,index) in lastestZhuanFaUsers"
:key="index">
<view style="border: 1rpx solid #595b5f;padding: 10rpx 20rpx;">
<u-form :model="newUser" :ref="'newUser-'+index"
label-width="300rpx"
label-position="top">
<u-form-item label="姓名">
<u-input v-model="newUser.nickName" />
</u-form-item>
<u-form-item label="微信号">
<u-input v-model="newUser.chatNumber" />
</u-form-item>
<u-form-item label="头像">
<u-input type="textarea" v-model="newUser.avatar" />
</u-form-item>
</u-form>
</view>
</u-collapse-item>
</u-collapse>
</view>
</scroll-view>
<view class="u-flex u-row-between u-col-center u-p-30">
<u-button @click="addNewLatestUserItem()">新增</u-button>
<u-button v-if="lastestZhuanFaUsers.length>1" @click="delNewLatestUser()">删除</u-button>
<u-button type="success" @click="submitAddLatestUsers()">确定</u-button>
</view>
</u-popup>
<u-popup v-model="addAndUpdateFlag" mode="right"
safe-area-inset-bottom
:mask-close-able="false"
length="100%">
<scroll-view class="u-p-30 u-p-t-80" scroll-y="true" style="height:85%;width: 700rpx;">
<view>
<u-collapse :head-style="{borderBottom:'1rpx solid #909399'}">
<u-collapse-item :title="'第'+(index+1)+'位'"
v-for="(newUser,index) in newUsers"
:key="index">
<view style="border: 1rpx solid #595b5f;padding: 10rpx 20rpx;">
<u-form :model="newUser" :ref="'newUser-'+index"
label-width="300rpx"
label-position="top">
<u-form-item label="姓名">
<u-input :maxlength="-1" v-model="newUser.nickName" />
</u-form-item>
<u-form-item label="微信号">
<u-input :maxlength="-1" placeholder="不能与其他重复!" v-model="newUser.chatNumber" />
</u-form-item>
<u-form-item label="头像">
<u-input :maxlength="-1" type="textarea" v-model="newUser.avatar" />
</u-form-item>
<u-form-item label="地区(注意空格)">
<u-input :maxlength="-1" placeholder="注意格式,如: 广东 广州" v-model="newUser.address" />
</u-form-item>
<u-form-item label="个性签名">
<u-input :maxlength="-1" v-model="newUser.signature" />
</u-form-item>
<u-form-item label="给你打招呼的内容">
<u-input :maxlength="-1" type="textarea" v-model="newUser.userRemark" />
</u-form-item>
<u-form-item label="给你打招呼的时间">
<u-input :maxlength="-1" placeholder="注意格式,如: 22:30" v-model="newUser.createTime" />
</u-form-item>
<u-form-item label="你通过好友时间">
<u-input :maxlength="-1" placeholder="注意格式,如: 22:35" v-model="newUser.sendTimeStr" />
</u-form-item>
<u-form-item label="第一条朋友圈">
<u-input type="textarea" :maxlength="-1" v-model="newUser.friendCircle[0]" />
</u-form-item>
<u-form-item label="第二条朋友圈">
<u-input type="textarea" :maxlength="-1" v-model="newUser.friendCircle[1]" />
</u-form-item>
<u-form-item label="第三条朋友圈">
<u-input type="textarea" :maxlength="-1" v-model="newUser.friendCircle[2]" />
</u-form-item>
</u-form>
</view>
</u-collapse-item>
</u-collapse>
</view>
</scroll-view>
<view class="u-flex u-row-between u-col-center u-p-30">
<u-button @click="addNewUserItem()">新增</u-button>
<u-button v-if="newUsers.length>1" @click="delNewUser()">删除</u-button>
<u-button type="success" @click="submitAddUsers()">确定</u-button>
</view>
</u-popup>
<u-popup v-model="newUserPopFlag" mode="right"
safe-area-inset-bottom
:mask-close-able="false"
length="100%">
<view style="padding-top:15%;">
<view class="u-border-top">
<u-field v-model="count"
type="number"
label="本次录入数量" label-width="200rpx"
placeholder="录入数量,建议5-10个"></u-field>
</view>
<view v-if="count<1" class="u-p-30 u-font-32" style="font-weight: bold;">
<view>填入数量决定了下面录入的每项信息的数量 !!!</view>
<view class="u-m-t-10">比如5个,那么必须填入5个人的信息,每个用%%隔开 ! </view>
<view class="u-m-t-10">不能多! 也不能少! 没有信息的填0 !</view>
<view>地址为例: "广东 广州,0,湖北 武汉,四川 城都,福建 厦门" </view>
</view>
</view>
<view v-if="count>0">
<scroll-view class="u-p-30 u-p-t-80"
scroll-y="true" style="height:80%;width: 700rpx;">
<view style="padding:10rpx 20rpx;">
<u-form :model="propArrObj" :border-bottom="false"
label-width="300rpx"
label-position="top">
<u-form-item label="姓名">
<u-input placeholder="格式: (张三%%李四%%王五)"
type="textarea" :maxlength="-1"
:height="300" border
v-model="propArrObj.nickNameStr" />
</u-form-item>
<u-form-item label="微信号">
<u-input placeholder="格式: (666666%%aaaaaa%%zzzzzz)"
type="textarea" :maxlength="-1"
:height="200" border
v-model="propArrObj.chatNumberStr" />
</u-form-item>
<u-form-item label="头像">
<u-input placeholder="格式: (xxx.jpg%%yyy.jpg%%%zzz%%jpg)"
type="textarea" :maxlength="-1"
:height="300" border
v-model="propArrObj.avatarStr" />
</u-form-item>
<u-form-item label="个性签名">
<u-input placeholder="格式: (哈哈哈%%嘻嘻嘻%%哇哇哇)"
type="textarea" :maxlength="-1"
:height="200" border
v-model="propArrObj.signatureStr" />
</u-form-item>
<u-form-item label="打招呼的内容">
<u-input placeholder="格式: (哈喽%%你好%%hello)"
type="textarea" :maxlength="-1"
:height="200" border
v-model="propArrObj.userRemarkStr" />
</u-form-item>
<u-form-item label="地址">
<u-input placeholder="每个值用%%隔开!没有地址的用0代替"
type="textarea" :maxlength="-1"
:height="100" border
v-model="propArrObj.addressStr" />
</u-form-item>
<u-form-item label="打招呼时间">
<u-input placeholder="格式: (12:01%%12:02%%12:03)"
type="textarea" :maxlength="-1"
:height="100" border
v-model="propArrObj.createTimeStr" />
</u-form-item>
<u-form-item label="加好友时间">
<u-input placeholder="格式: (12:01%%12:02%%12:03)"
type="textarea" :maxlength="-1"
:height="100" border
v-model="propArrObj.sendTimeStr" />
</u-form-item>
<u-form-item label="朋友圈">
<u-input placeholder="格式: ([xxx.jpg%%yyy.jpg,zzz.jpg]%%[111.jpg,222.jpg]%%[]%%[333.jpg])"
type="textarea" :maxlength="-1"
:height="300" border
v-model="propArrObj.friendCircleStr" />
</u-form-item>
</u-form>
</view>
</scroll-view>
<view class="u-flex u-row-between u-col-center u-p-30">
<u-button @click="cancelAdd()">取消</u-button>
<u-button type="success" @click="submitAdd()">确定</u-button>
</view>
</view>
</u-popup>
</view>
</template>
<script>
export default {
data() {
return {
titleStyle:{
fontSize:"34rpx",
color:'#000000'
},
linkedUsers:[], //摇一摇的人
addAndUpdateFlag:false, //新增
newUsers:[
{
id:new Date().getTime(),
avatar:'',
chatNumber:'',
nickName:'',
signature:'',
userRemark:'',
address:'',
sex:0,
friendPower:0,
forbidSelf:false,
forbidHis:false,
createTime:"",
sendTimeStr:"",
lastMsgContent:'',
delFlag:false,
friendCircle:["","",""],
messageList:[],
},
],
checked:true,
newLatestFlag:false,
lastestZhuanFaUsers:[
{
id:'1',
avatar:'/static/image/default/default-user/1.jpg',
chatNumber:'qwe',
nickName:'猫先生',
}
],
//--------------------------------------
newUserPopFlag:false,
count:5,
propArrObj:{
nickNameStr:"",
chatNumberStr:"",
avatarStr:"",
signatureStr:"",
userRemarkStr:"",
addressStr:"",
createTimeStr:"",
sendTimeStr:"",
friendCircleStr:"",
}
};
},
methods:{
toSetLatestUsers:function(){
if(this.vuex_lastestZhuanFaUsers.length>0){
this.lastestZhuanFaUsers=JSON.parse(JSON.stringify(this.vuex_lastestZhuanFaUsers));
}
this.newLatestFlag=true;
},
addNewLatestUserItem:function(){
let obj={
id:new Date().getTime(),
avatar:'',
chatNumber:'',
nickName:'',
};
this.lastestZhuanFaUsers.push(obj);
},
delNewLatestUser:function(){
this.lastestZhuanFaUsers.splice(this.lastestZhuanFaUsers.length-1,1);
},
submitAddLatestUsers:function(){
let that=this;
this.$u.vuex("vuex_lastestZhuanFaUsers",this.lastestZhuanFaUsers);
this.newLatestFlag=false;
},
addAndUpdate:function(){
let that=this;
that.addAndUpdateFlag=true
},
addNewUserItem:function(){
let oldObj= this.newUsers[this.newUsers.length-1];
let obj={
id:new Date().getTime(),
avatar:'',
chatNumber:'',
nickName:'',
signature:'',
userRemark:'',
address:'',
sex:0,
friendPower:0,
forbidSelf:false,
forbidHis:false,
createTime:oldObj.createTime,
sendTimeStr:oldObj.sendTimeStr,
lastMsgContent:'',
delFlag:false,
friendCircle:["","",""],
messageList:[],
};
//this.newUsers.push(obj);
this.newUsers.unshift(obj);
},
delNewUser:function(){
this.newUsers.splice(this.newUsers.length-1,1);
},
submitAddUsers:function(){
let that=this;
uni.showModal({
title: '确认提示',
content: '请认真检查各项填入内容!',
success: function (res) {
if (res.confirm) {
that.addAndUpdateFlag = false;
that.linkedUsers=that.newUsers.concat(that.linkedUsers);
that.newUsers=[
{
id:new Date().getTime(),
avatar:'',
chatNumber:'',
nickName:'',
signature:'',
userRemark:'',
address:'',
sex:0,
friendPower:0,
forbidSelf:false,
forbidHis:false,
createTime:'',
sendTimeStr:'',
lastMsgContent:'',
delFlag:false,
friendCircle:["","",""],
messageList:[],
},
]
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
},
toLinkedList:function(){
let arr=JSON.parse(JSON.stringify(this.vuex_linkedUsers));
let newLinkedUsers=this.linkedUsers.concat(arr);
console.log("去摇一摇设置",newLinkedUsers);
this.$u.vuex("vuex_linkedUsers",newLinkedUsers);
this.linkedUsers=[];
this.$u.route("/pages/tabbar/find/yaoyiyao/yaoyiyao-linked-list");
},
//------------------------------------------------------------------------------------------------
showNewUserPop:function(){
this.newUserPopFlag=true;
},
cancelAdd:function(){
this.newUserPopFlag=false;
},
submitAdd:function(){
let that=this;
let keys= Object.keys(that.propArrObj);
for (let i = 0; i < keys.length; i++) {
let key= keys[i];
let keyValue= that.propArrObj[key];
let valueArr= keyValue.split("%%");
if(valueArr.length!=that.count){
this.globalUtil.utilAlert("第"+(i+1)+"项录入信息有误!["+key+"]");
return;
}
}
that.muchCreateUser();
},
muchCreateUser(){
let that=this;
let arr=[];
for (var i = 0; i < this.count; i++) {
let item={
id:"u-"+i,
avatar:that.propArrObj.avatarStr.split("%%")[i],
chatNumber:that.propArrObj.chatNumberStr.split("%%")[i],
nickName:that.propArrObj.nickNameStr.split("%%")[i],
signature:that.propArrObj.signatureStr.split("%%")[i],
userRemark:that.propArrObj.userRemarkStr.split("%%")[i],
address:that.propArrObj.addressStr.split("%%")[i],
createTime:that.propArrObj.createTimeStr.split("%%")[i],
sendTimeStr:that.propArrObj.sendTimeStr.split("%%")[i],
friendCircle:that.propArrObj.friendCircleStr.split("%%")[i],
lastMsgContent:"",
messageList:[],
sex:0,
friendPower:0,
forbidSelf:false,
forbidHis:false,
delFlag:false,
};
arr.push(item);
}
console.log("====arr====",arr);
that.linkedUsers=arr.concat(that.linkedUsers);
this.count=0;
this.propArrObj={
avatarStr:"",
chatNumberStr:"",
nickNameStr:"",
signatureStr:"",
userRemarkStr:"",
addressStr:"",
createTimeStr:"",
sendTimeStr:"",
friendCircleStr:"",
};
that.newUserPopFlag=false;
}
}
}
</script>
<style lang="scss">
</style>
<style>
page{
background-color: #f0f0f0;
}
</style>
+138
View File
@@ -0,0 +1,138 @@
<template>
<view class="u-font-34">
<u-navbar :is-back="true" back-icon-color="#333333" title=""
:background="{ background: '#ffffff'}"
:border-bottom="false" z-index="1001">
<view slot="right" class="u-p-r-30">
<u-icon name="more-dot-fill" color="#000000" :size="38"></u-icon>
</view>
</u-navbar>
<view style="background-color: #ffffff;">
<view class="u-p-30 u-flex u-row-left u-col-center">
<view class="u-p-l-20">
<view>
<u-image :src="personInfo.avatar" width="120rpx" height="120rpx" border-radius="12rpx">
<view slot="error"
class="u-flex u-row-center u-col-center u-p-t-10"
style="width: 90rpx;height: 90rpx;background-color: #f1f1f1;border-radius: 12rpx;">
<view>
<image src="/static/image/default/default-user/default-user.png"
style="width: 64rpx;height: 64rpx;"></image>
</view>
</view>
</u-image>
</view>
</view>
<view class="u-m-l-30 u-p-t-20">
<view class="u-line-2" style="width: 350rpx;line-height: 40rpx;">
<text style="color: #000000;font-size: 44rpx;font-weight: bold;">{{personInfo.nickName}}</text>
<!-- <text></text> -->
</view>
<view v-if="personInfo.address&&personInfo.address!=0&&personInfo.address.length>0"
style="margin-top: 10rpx;color: #757575;font-size: 30rpx;">
<text>地区: </text>
<text>{{personInfo.address}}</text>
</view>
<view style="color: #2d5675;font-size: 32rpx;margin-top: 15rpx;">
<text class="u-m-r-30">备注名</text>
<text>朋友权限</text>
</view>
</view>
</view>
<view class="u-p-l-50 u-p-r-50 u-p-b-50 u-p-t-10">
<view style="font-size: 28rpx;border: 1rpx solid #909399;background-color: #f8f8f8;padding: 30rpx;border-radius: 6rpx;">
<view class="u-tips-color">
<text>{{personInfo.nickName}}: </text>
<text>{{personInfo.userRemark}}</text>
</view>
<view style="color: #2d5675;margin-top: 20rpx;">
<text>回复</text>
</view>
</view>
</view>
<u-gap height="20" bg-color="#eee" margin-top="1" margin-bottom="1"></u-gap>
<view class="u-flex u-row-left u-col-center u-p-l-30 u-p-t-20 u-p-b-20">
<view class="u-m-r-30" style="width: 150rpx;text-align: left;">
<text>个性签名</text>
</view>
<view v-if="personInfo.signature&&personInfo.signature!=0&&personInfo.signature.length>0"
class="u-line-3" style="padding-right: 40rpx;width: 500rpx;color: #757575;">
<text>{{personInfo.signature}}</text>
</view>
</view>
<view class="u-p-l-30">
<u-gap height="1" bg-color="#eee" margin-top="1" margin-bottom="1"></u-gap>
</view>
<view class="u-flex u-row-left u-col-center u-p-l-30 u-p-t-20 u-p-b-20">
<view class="u-m-r-30" style="width: 150rpx;text-align: left;">
<text>来源</text>
</view>
<view class="u-line-3" style="padding-right: 40rpx;width: 500rpx;color: #757575;">
<text>对方通过摇一摇添加</text>
</view>
</view>
<u-gap height="20" bg-color="#eee" margin-top="1" margin-bottom="1"></u-gap>
<view @click="toAgree()" style="text-align: center;padding: 30rpx;color: #2d5675;font-weight: bold;">
<text>前往验证</text>
</view>
</view>
<view class="footer-box u-flex u-row-center u-col-center">
<view>
<text>加入黑名单</text>
</view>
<view class="u-m-l-26 u-m-r-26">
<text>|</text>
</view>
<view>
<text>投诉</text>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
personInfo:null,
};
},
onLoad:function(option){
this.personInfo=this.yyy_current_user;
/* let param= option.personInfo;
if(param!=null&&param!=undefined){
this.personInfo=JSON.parse(decodeURIComponent(param));
} */
},
methods:{
toAgree:function(){
this.$u.route({
url:'/pages/tabbar/find/yaoyiyao/yaoyiyao-agree-apply-friend',
params:{
personInfo:encodeURIComponent(JSON.stringify(this.personInfo))
}
})
}
}
}
</script>
<style lang="scss" scoped>
.footer-box{
width: 100%;
position: absolute;
bottom: 80rpx;
padding: 20rpx 100rpx;
text-align: center;
font-size: 28rpx;
color: #2d5675;
}
</style>
<style>
page{
background-color: #f0f0f0;
}
</style>