<template>
|
<view class="main">
|
<view v-if="fromW == 0">
|
<view class="friend-list" @click="chating">
|
|
<view class="head-wrap">
|
<image :src=Pdata.avatar class="head" />
|
<!-- <view v-if="1 != ''" class="tip">233</view> -->
|
</view>
|
<view class="content-wrap">
|
<text class="name">{{Pdata.recipientName}}</text>
|
<text class="mess">{{isJSON(Pdata.postMessage) == true ? '[语音]' : Pdata.postMessage}}</text>
|
</view>
|
<view class="data-wrap">
|
<text class="data">{{Pdata.postTime}}</text>
|
</view>
|
|
</view>
|
</view>
|
|
<view v-if="fromW == 1">
|
<view class="friend-list" @click="TXLchating">
|
|
<view class="head-wrap">
|
<image :src=Pdata.avatar class="head" />
|
<!-- <view v-if="1 != ''" class="tip">233</view> -->
|
</view>
|
<view class="content-wrap">
|
<text class="name">{{Pdata.realName}}</text>
|
<text class="mess">电话:{{Pdata.phone}}</text>
|
</view>
|
<view class="data-wrap">
|
<!-- <text class="data">{{Pdata.postTime}}</text> -->
|
</view>
|
|
</view>
|
</view>
|
|
<view v-if="fromW == 2">
|
<view class="friend-list" @click="QZchating">
|
|
<view class="head-wrap">
|
<image :src=Pdata.avatar class="head" />
|
<!-- <view v-if="1 != ''" class="tip">233</view> -->
|
</view>
|
<view class="content-wrap">
|
<text class="name">{{Pdata.GroupName}}</text>
|
<text class="mess">{{Pdata.GroupContent}}</text>
|
</view>
|
<view class="data-wrap">
|
<!-- <text class="data">{{Pdata.time}}</text> -->
|
</view>
|
|
</view>
|
</view>
|
</view>
|
</template>
|
|
<script>
|
export default {
|
props: ['fromW', 'Pdata'],
|
data() {
|
return {
|
popuShow: false,
|
bmainb: ''
|
}
|
},
|
methods: {
|
isJSON(str) {
|
|
if (typeof str == 'string') {
|
try {
|
var obj = JSON.parse(str);
|
if (typeof obj == 'object' && obj) {
|
return true;
|
} else {
|
return false;
|
}
|
|
} catch (e) {
|
return false;
|
}
|
}
|
|
},
|
beginObj() {
|
this.bmainb = '3rem';
|
//#ifdef MP-WEIXIN
|
this.bmainb = '0';
|
//#endif
|
},
|
chating() {
|
//发起聊天
|
var datas = this.Pdata;
|
//alert(datas.name)
|
uni.navigateTo({
|
url: '/pages/groupChat/chating?chatID=' + datas.recipientId.toString() + '&data=' + JSON.stringify(
|
datas)
|
});
|
},
|
QZchating() {
|
//发起聊天
|
var datas = this.Pdata;
|
console.log(datas)
|
uni.navigateTo({
|
url: '/pages/groupChat/chatingQZ?chatID=' + datas.id.toString()+ '&data=' + JSON.stringify(
|
datas)
|
});
|
},
|
TXLchating() {
|
//发起聊天
|
var datas = this.Pdata;
|
//alert(datas.name)
|
uni.navigateTo({
|
url: '/pages/groupChat/chating?chatID=' + datas.friendid.toString() + '&data=' + JSON.stringify(
|
datas)
|
});
|
},
|
onClose() { //触摸遮罩事件
|
this.setData({
|
popuShow: false
|
});
|
},
|
},
|
mounted() {
|
this.beginObj();
|
}
|
|
}
|
</script>
|
|
<style lang="scss" scoped>
|
.top-bar {
|
background-color: rgba(255, 255, 255, .96);
|
// background-color: #42B983;
|
box-shadow: 0px 1px 0px 0px rgba(0, 0, 0, .1);
|
}
|
|
.main {
|
// margin-top: 108rpx;
|
// padding: 0 32upx ;
|
|
.friend-list,
|
.apply {
|
display: flex;
|
// margin: 40rpx 0;
|
// padding: 20rpx 0;
|
height: 130rpx;
|
// padding: 16upx 0;
|
align-items: center;
|
border-bottom: 1px solid rgba(0, 0, 0, .1);
|
|
&:active {
|
background-color: rgba(243,244,246,1);
|
}
|
|
.head-wrap {
|
position: relative;
|
|
|
image {
|
width: 96rpx;
|
height: 96rpx;
|
border-radius: 20upx;
|
// background-color: rgba(255,228,49,1);
|
}
|
|
.tip {
|
position: absolute;
|
top: -6rpx;
|
left: 68rpx;
|
height: 36rpx;
|
min-width: 20rpx;
|
min-height: 20rpx;
|
background-color: rgba(255,93,91,1);
|
border-radius: 18rpx;
|
padding: 0 6rpx;
|
font-size: 24upx;
|
color: rgba(255,228,49,1);
|
line-height: 36rpx;
|
text-align: center;
|
}
|
}
|
|
.content-wrap {
|
margin-left: 32rpx;
|
flex: 1;
|
|
.name {
|
display: block;
|
color: rgba(39,40,50,1);
|
font-size: 36rpx;
|
font-weight: 400;
|
line-height: 50rpx;
|
}
|
|
.mess {
|
display: block;
|
color: rgba(39,40,50,.6);
|
font-size: 28upx;
|
line-height: 40rpx;
|
display: -webkit-box;
|
-webkit-box-orient: vertical;
|
-webkit-line-clamp: 1;
|
overflow: hidden;
|
}
|
}
|
|
.data-wrap {
|
|
justify-content: right;
|
|
.data {
|
font-size: 24upx;
|
color: rgba(39,40,50,0.4);
|
line-height: 50rpx;
|
}
|
}
|
}
|
|
}
|
</style>
|