You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1368 lines
33 KiB
1368 lines
33 KiB
<template>
|
|
<view class="postList">
|
|
<!-- 帖子列表循环模板 -->
|
|
<view class="postListMb" @click="goPostDetails">
|
|
<view class="zd" v-if="itemInfos.top >0">
|
|
<text></text>
|
|
<image :src="imgfixUrls+'merchant/zd.png'" />
|
|
</view>
|
|
<view class="postListMbPackage">
|
|
<!-- 头部信息 -->
|
|
<view class="postListMbTitle" @click.stop="goHome(itemInfos.mid)">
|
|
<view class="postListMbTitleLeft">
|
|
<view class="postListHead">
|
|
<image :src="itemInfos.avatar" />
|
|
</view>
|
|
<text style="display: inline-block;width: 260upx;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;">{{ itemInfos.nickname }}</text>
|
|
<view class="post-label">
|
|
<image :src="imgfixUrls+'merchant/smrz.png'" v-if="!!itemInfos.attestation && itemInfos.attestation.attestation == 1" />
|
|
<!-- <image :src="imgfixUrl+'merchant/qyrz.p'ng" /> -->
|
|
<image :src="imgfixUrls+'merchant/gfrz.png'" v-if="!!itemInfos.attestation && itemInfos.attestation.bondflag == 1" />
|
|
</view>
|
|
<view class="hb" v-if="itemInfos.package > 0"><text>红包</text></view>
|
|
</view>
|
|
<view class="postListMbTitleRight">
|
|
<text>{{ itemInfos.type==''?itemInfos.onetype:itemInfos.type }}</text>
|
|
</view>
|
|
</view>
|
|
<!-- 头部信息 -->
|
|
<!-- 标签 -->
|
|
<view class="labelList">
|
|
<!-- 标签循环模板 -->
|
|
<view class="labelMb" :style="{ color: textTip_color[indexs % textTip_color.length].color,border:textTip_color[indexs % textTip_color.length].border }"
|
|
v-for="(items, indexs) in itemInfos.keyword" :key="indexs">
|
|
<text>{{ items }}</text>
|
|
</view>
|
|
<!-- 标签循环模板 -->
|
|
</view>
|
|
<!-- 标签 -->
|
|
|
|
<!-- 正文区域 -->
|
|
<view class="postListText">
|
|
<view :class="textList.indexOf(indexNumber) !== -1 ? 'fullText' : 'postListTextMain'">
|
|
<text>{{ itemInfos.content }}</text>
|
|
</view>
|
|
<text @click.stop="fullText(indexNumber)" v-if="itemInfos.content.length > 50">{{ textTips }}</text>
|
|
</view>
|
|
<!-- 正文区域 -->
|
|
|
|
<!-- 图文区域 -->
|
|
<view class="postListMbImg" >
|
|
<!-- 图片循环模板 -->
|
|
<view class="postListMbImgShow" v-for="(items, indexs) in itemInfos.img" @click.stop="imgPre(indexs,itemInfos.img)" :key="indexs">
|
|
<image :src="items" mode="aspectFill" />
|
|
</view>
|
|
<!-- #ifdef H5 -->
|
|
<!-- <video id="myvideo" :src="itemInfos.video_link" class="postListMbImgShow" v-if="!!itemInfos.video_link&&itemInfos.img.length!=0"
|
|
:poster='itemInfos.video_img_link' @click.stop="" :controls="false" show-center-play-btn="false"></video> -->
|
|
<!-- #endif -->
|
|
|
|
<view style="position: relative;">
|
|
<video id="myvideo" :src="itemInfos.video_link" class="postListMbImgShow" v-if="!!itemInfos.video_link&&itemInfos.img.length!=0"
|
|
:poster='poster' @click.stop="" :show-center-play-btn="false"></video>
|
|
<view class="postListMbImgShow"
|
|
@click.stop="playing(itemInfos.video_link)"
|
|
style="font-size: 40upx;
|
|
position: absolute;
|
|
left:0;top: 0;
|
|
width: 200upx;
|
|
height: 200upx;
|
|
color: #FFFFFF;
|
|
text-align: center;
|
|
line-height: 200upx;"
|
|
v-if="!!itemInfos.video_link&&itemInfos.img.length!=0">
|
|
</view>
|
|
</view>
|
|
|
|
|
|
|
|
<!-- 图片循环模板 -->
|
|
</view>
|
|
<!-- 图文区域 -->
|
|
|
|
<view v-if="!!itemInfos.video_link&&itemInfos.img.length==0" @click.stop="" style="position: relative;">
|
|
<!-- <view class="videoPlay" @click="playing" style="font-size: 28upx;">
|
|
播放
|
|
</view> -->
|
|
<!-- #ifdef H5 -->
|
|
<video id="myvideo" :src="itemInfos.video_link" @fullscreenchange="videoControl" class="videoPlay" :poster='poster'></video>
|
|
<!-- #endif -->
|
|
<!-- #ifndef H5 -->
|
|
<video id="myvideo" :src="itemInfos.video_link" @fullscreenchange="videoControl" class="videoPlay" :poster='poster'></video>
|
|
<view class="videoPlay" style="position: absolute;left: 0;top: 0;" @click.stop="playing(itemInfos.video_link)">
|
|
|
|
</view>
|
|
<!-- #endif -->
|
|
|
|
</view>
|
|
|
|
<!-- 帖子流量 -->
|
|
<view class="postListMbFlow">
|
|
<view class="postListMbFlowLeft">
|
|
<text>
|
|
阅读
|
|
<text>{{ itemInfos.look }}</text>
|
|
</text>
|
|
<text>
|
|
<!-- 分享
|
|
<text>{{ itemInfos.share }}</text> -->
|
|
</text>
|
|
<text>{{ itemInfos.createtime }}发布</text>
|
|
</view>
|
|
<view class="postListMbFlowRight">
|
|
<view class="postListMbFlowRightPackage" @click.stop="show1">
|
|
<view class="dot"></view>
|
|
<view class="dot"></view>
|
|
</view>
|
|
<view class="operationShow" :style="{width: itemInfos.phone?'440rpx':'300rpx',right:itemInfos.phone?'480rpx':'340rpx'}" v-if="indexShow == indexNumber">
|
|
<view @click.stop="fabulous">
|
|
<image :src="imgfixUrls+'merchant/xx.png'" v-if="itemInfos.is_fabulous == 0" />
|
|
<image :src="imgfixUrls+'merchant/xin.png'" v-else />
|
|
<span>赞</span>
|
|
</view>
|
|
<view @click.stop="replyShow">
|
|
<image :src="imgfixUrls+'merchant/pl.png'" />
|
|
<span>评论</span>
|
|
</view>
|
|
<view @click.stop="kfPhone" v-if="itemInfos.phone">
|
|
<image :src="imgfixUrls+'merchant/dh.png'" />
|
|
<span>电话</span>
|
|
</view>
|
|
<view class="operationView" :style="{marginLeft:itemInfos.phone?'0rpx':'0rpx'}"></view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<!-- 帖子流量 -->
|
|
|
|
<!-- 评论区域 -->
|
|
<view class="postListMbComment" :key="itemInfos.fabulous_num" v-if="(itemInfos.fabulous_num !== 0) || (itemInfos.comment_list&&(!!itemInfos.comment_list.list && itemInfos.comment_list.list.length !== 0))">
|
|
<!-- 点赞人数 -->
|
|
<view class="sj">
|
|
|
|
</view>
|
|
<view class="postListMbCommentTitle" v-if="itemInfos.fabulous_num !== 0" :key="itemInfos.fabulous_num">
|
|
<view class="postListMbCommentTitlePackage">
|
|
<view class="col-9 dianzan-icon iconfont icon-zan1"></view>
|
|
<text>{{ itemInfos.fabulous_num }}人</text>
|
|
<!-- 点赞头像循环 -->
|
|
<!-- #ifndef H5 -->
|
|
<view class="zanHead" v-for="(item, index) in itemInfos.fabulous_avatar" :key="index">
|
|
<image :src="item" />
|
|
</view>
|
|
<!-- #endif -->
|
|
<!-- #ifdef H5 -->
|
|
<view class="zanHead" v-for="(item, index) in itemInfos.fabulous_avatar" :key="index">
|
|
<image :src="item?item:''" />
|
|
</view>
|
|
<!-- #endif -->
|
|
|
|
<!-- 点赞头像循环 -->
|
|
<!-- 点赞防抖动 -->
|
|
<view class="zanHeadFd"></view>
|
|
<!-- 点赞防抖动 -->
|
|
</view>
|
|
|
|
</view>
|
|
<!-- 点赞人数 -->
|
|
<view class="postListMbCommentBody" v-if="!!itemInfos.comment_list && (!!itemInfos.comment_list.list && itemInfos.comment_list.list.length !== 0)">
|
|
<view class="postListMbCommentBodyPackage">
|
|
<!-- 评论循环模板 -->
|
|
<view v-for="(items, indexs) in comment_list.list" @click.stop="answerPop(items.id, items.mid, items, items.nickname)" :key="indexs"
|
|
class="marB5" v-if="comment_list.list">
|
|
<text class="member">{{ items.nickname }}</text>
|
|
<text class="maohao">:</text>
|
|
<text class="memberMain">{{ items.content }}</text>
|
|
<view class="menbottom" v-if="items.mid == myMid">
|
|
<text class="f-24 iconfont icon-bianji" @click.stop="replyShow(items,indexs)" style="color: #80A9D6;padding-right: 20upx;font-size: 20upx;"></text>
|
|
<text class="f-24 col-f4 iconfont icon-delete" style="font-size: 20upx;" @click.stop="deleteCommit(items,indexs)"></text>
|
|
</view>
|
|
<view v-for="(itemss, indexss) in items.list" @click.stop="answerPop(items.id, itemss.smid, itemss, itemss.reply_name)" :key="indexss"
|
|
class="marB5" v-if="items.list">
|
|
<text class="member">{{ itemss.reply_name }}</text>
|
|
<text class="hf">回复</text>
|
|
<text class="member1">{{ itemss.name }}</text>
|
|
<text class="maohao">:</text>
|
|
<text class="memberMain">{{ itemss.content }}</text>
|
|
<view class="menbottom" v-if="itemss.smid == myMid">
|
|
<text class="f-24 iconfont icon-bianji" style="color: #80A9D6;padding-right: 20upx;font-size: 20upx;" @click.stop="answerPop(items.id, items.smid, itemss, itemss.reply_name,indexs,indexss)"></text>
|
|
<text class="f-24 col-f4 iconfont icon-delete" style="font-size: 20upx;" @click.stop="deleteCommitIn(itemss,indexs,indexss)"></text>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<!-- 评论循环模板 -->
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<!-- 评论区域 -->
|
|
</view>
|
|
</view>
|
|
<!-- 帖子列表 -->
|
|
|
|
<!-- 评论框 -->
|
|
<PopManager :show="replyShow1" @clickmask="replyClose" :type="replyType">
|
|
<view class="replyView" >
|
|
<view class="replyViewPackage" >
|
|
<view class="replyInput" ><textarea placeholder="评论" v-model="text" @blur="lose" v-if="replyShow1"></textarea></view>
|
|
<view class="sendButton" @click="comment()" ><text>发送</text></view>
|
|
</view>
|
|
</view>
|
|
</PopManager>
|
|
<!-- 评论框 -->
|
|
|
|
<!-- 视频 -->
|
|
<PopManager :show="videoshow" @clickmask="videoshow = false" type="center">
|
|
<view v-if="videoshow" style="width: 100vw;height: 100vh;position: relative;">
|
|
<video id="myvideo" :src="videolint" @fullscreenchange="videoControl" style="width: 100%;height: 100%;"
|
|
:poster='poster' @click.stop="" :show-fullscreen-btn="false" autoplay ></video>
|
|
<view style="position: absolute;left: 30upx;top: 30upx;color: #ffffff;padding: 10upx 20upx;border-radius: 60upx;background-color: rgba(255,255,255,0.3);" @click="videoshow = false">
|
|
<text class="iconfont icon-roundleftfill" style="font-size: 36upx;"></text>
|
|
<text class="f-36">返回</text>
|
|
</view>
|
|
</view>
|
|
</PopManager>
|
|
|
|
<!-- 回复框 -->
|
|
<PopManager :show="answerShow1" @clickmask="replyClose" :type="replyType">
|
|
<view class="replyView" v-if="answerShow1">
|
|
<view class="replyViewPackage" v-if="answerShow1">
|
|
<view class="replyInput" v-if="answerShow1"><textarea placeholder="回复:" v-model="answerText" @blur="lose" v-if="answerShow1"></textarea></view>
|
|
<view class="sendButton" @click="reply" v-if="answerShow1"><text>发送</text></view>
|
|
</view>
|
|
</view>
|
|
</PopManager>
|
|
<!-- 回复框 -->
|
|
|
|
<!-- 遮罩层 -->
|
|
<view class="coverView" v-if="coverShow == true" :style="{ height: phoneHight }" @click="coverClosePop"></view>
|
|
<!-- 遮罩层 -->
|
|
<PhoneMask :show1="popShow" @clickmask1="closePop"></PhoneMask>
|
|
<getvxphone :show="vxshow" @showFalse="showFalse"></getvxphone>
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
import App from '@/common/js/app.js';
|
|
|
|
// #ifdef H5
|
|
import wxApi from '@/common/js/wxApi.js';
|
|
// #endif
|
|
|
|
import PopManager from '@/components/template/PopManager';
|
|
import PhoneMask from '@/components/template/PhoneMask';
|
|
import getvxphone from '@/components/template/getVXphone.vue'
|
|
|
|
export default {
|
|
components: {
|
|
PopManager,
|
|
PhoneMask,
|
|
getvxphone
|
|
},
|
|
props: {
|
|
// 帖子信息
|
|
itemInfo: {
|
|
type: Object,
|
|
default: {}
|
|
},
|
|
indexNumber: {
|
|
type: Number,
|
|
default: 0
|
|
},
|
|
indexShow: {
|
|
type: Number,
|
|
default: -1
|
|
}
|
|
},
|
|
data() {
|
|
return {
|
|
itemInfos: {
|
|
attestation: '',
|
|
avatar: "",
|
|
comment_list: [],
|
|
content: "",
|
|
createtime: "",
|
|
fabulous_avatar: [],
|
|
fabulous_num: null,
|
|
id: "",
|
|
img: [],
|
|
is_fabulous: null,
|
|
keyword: [],
|
|
look: "",
|
|
mid: "",
|
|
nickname: "",
|
|
onetype: "",
|
|
package: "",
|
|
phone: "",
|
|
share: "",
|
|
top: "",
|
|
type: "",
|
|
},
|
|
videolint:'',
|
|
popShow: false,
|
|
vxshow:false,
|
|
comment_list: [],
|
|
show: false,
|
|
replyShow1: false,
|
|
answerShow1: false,
|
|
coverShow: false,
|
|
// 评论展示方向
|
|
replyType: 'center',
|
|
text: '',
|
|
phoneHight: 0,
|
|
cid: null,
|
|
amid: null,
|
|
answerText: '',
|
|
items: null,
|
|
answerName: '',
|
|
videoshow:false,
|
|
textList: [],
|
|
textTips: '全文',
|
|
videoContext:null,
|
|
fabulous_num: null,
|
|
fabulous_avatar: null,
|
|
isComment: false,
|
|
myMid:0,
|
|
commitem:null,
|
|
poster:'',
|
|
textTip_color: [{
|
|
color: '#2196F3',
|
|
border: '0.5px solid #2196F3'
|
|
},
|
|
{
|
|
color: '#25DC4C',
|
|
border: '0.5px solid #25DC4C'
|
|
},
|
|
{
|
|
color: '#F58F57',
|
|
border: '0.5px solid #F58F57'
|
|
},
|
|
{
|
|
color: '#A59DD1',
|
|
border: '0.5px solid #A59DD1'
|
|
},
|
|
{
|
|
color: '#DBB065',
|
|
border: '0.5px solid #DBB065'
|
|
}
|
|
]
|
|
};
|
|
},
|
|
watch: {
|
|
itemInfo: {
|
|
handler(newValue, oldValue) {
|
|
let _this = this;
|
|
for (let key in newValue) {
|
|
_this.itemInfos[key] = newValue[key]
|
|
}
|
|
//_this.init();
|
|
},
|
|
deep: true, //对象内部的属性监听,也叫深度监听
|
|
immediate: true //immediate表示在watch中首次绑定的时候,是否执行handler,值为true则表示在watch中声明的时候,就立即执行handler方法,值为false,则和一般使用watch一样,在数据发生变化的时候才执行handler
|
|
}
|
|
},
|
|
mounted() {
|
|
let _this = this;
|
|
_this.poster = uni.getStorageSync('platformInfor').videoimg;
|
|
_this.myMid = uni.getStorageSync('userinfo').mid;
|
|
for (let key in _this.itemInfo) {
|
|
_this.itemInfos[key] = _this.itemInfo[key]
|
|
}
|
|
_this.init();
|
|
},
|
|
onReady(){
|
|
// 页面初次渲染! createVideoContext uni video自带 上下文 如果不懂可以去百度
|
|
this.videoContext = uni.createVideoContext('myvideo');
|
|
this.videoContext.requestFullScreen();
|
|
},
|
|
onShow() {
|
|
let _this = this;
|
|
_this.isComment = false;
|
|
},
|
|
methods: {
|
|
deleteCommitIn(item,index,i){
|
|
let _this = this;
|
|
let datas = {
|
|
id:item.id,
|
|
type:0
|
|
}
|
|
App.showError(
|
|
`确认删除此条回复?`,
|
|
data => {
|
|
if (data.confirm) {
|
|
App._post_form('&p=pocket&do=changeReply', datas, res => {
|
|
_this.replyShow1 = false;
|
|
_this.show = false;
|
|
_this.answerShow1 = false;
|
|
_this.coverShow = false;
|
|
App.showSuccess('删除成功', () => {
|
|
_this.isComment = false;
|
|
})
|
|
_this.comment_list.list.map((items,indexs)=>{
|
|
if(index == indexs){
|
|
items.list.map((itemss,indexss)=>{
|
|
if(indexss == i){
|
|
_this.comment_list.list[indexs].list.splice(indexss,1);
|
|
}
|
|
})
|
|
}
|
|
})
|
|
},fail=>{
|
|
_this.isComment = false;
|
|
if (fail.data.message == '未绑定手机号') {
|
|
//#ifdef H5
|
|
_this.popShow = true;
|
|
//#endif
|
|
//#ifndef H5
|
|
_this.vxshow = true;
|
|
//#endif
|
|
|
|
}
|
|
});
|
|
}
|
|
},
|
|
true
|
|
);
|
|
},
|
|
deleteCommit(item,index){
|
|
let _this = this;
|
|
let datas = {
|
|
id:item.id,
|
|
type:0
|
|
}
|
|
App.showError(
|
|
`确认删除此条评论?`,
|
|
data => {
|
|
if (data.confirm) {
|
|
App._post_form('&p=pocket&do=changeComment', datas, res => {
|
|
_this.replyShow1 = false;
|
|
_this.show = false;
|
|
_this.answerShow1 = false;
|
|
_this.coverShow = false;
|
|
App.showSuccess('删除成功', () => {
|
|
_this.isComment = false;
|
|
})
|
|
_this.comment_list.list.map((item,indexs)=>{
|
|
if(index == indexs){
|
|
_this.comment_list.list.splice(indexs,1);
|
|
}
|
|
})
|
|
},fail=>{
|
|
_this.isComment = false;
|
|
if (fail.data.message == '未绑定手机号') {
|
|
//#ifdef H5
|
|
_this.popShow = true;
|
|
//#endif
|
|
//#ifndef H5
|
|
_this.vxshow = true;
|
|
//#endif
|
|
|
|
}
|
|
});
|
|
}
|
|
},
|
|
true
|
|
);
|
|
|
|
},
|
|
videoControl(e){
|
|
console.log(e)
|
|
if(e.detail.fullScreen){ //e.detail.fullScreen是否为全屏
|
|
this.videoContext.play();
|
|
}else{
|
|
//停止播放
|
|
// this.videoContext.stop(); 各位老板不要选择stop 选择了stop 缩小视频还会自动播放
|
|
this.videoContext.pause();
|
|
}
|
|
},
|
|
playing(lint) {
|
|
this.videoshow = true;
|
|
this.videolint = lint;
|
|
// 获取当前视频id
|
|
// let currentId = e.currentTarget.dataset.id
|
|
// uni.createVideoContext获取视频上下文对象
|
|
this.videoContext.requestFullScreen({
|
|
direction:0
|
|
})
|
|
|
|
},
|
|
showFalse(){
|
|
console.log('进了showfalse')
|
|
this.vxshow = false;
|
|
},
|
|
closePop() {
|
|
let _this = this
|
|
_this.popShow = false
|
|
},
|
|
goHome(mid) {
|
|
let _this = this;
|
|
if (mid > 0) {
|
|
App.navigationTo({
|
|
url: 'pages/subPages/homepage/homepage/homepage?mid=' + mid + '&checkType=' + 1
|
|
});
|
|
}
|
|
},
|
|
imgPre(index, imgList) {
|
|
this.$emit('lookimg');
|
|
uni.previewImage({
|
|
current: imgList[index],
|
|
urls: imgList
|
|
});
|
|
},
|
|
init() {
|
|
let _this = this;
|
|
uni.getSystemInfo({
|
|
success(res) {
|
|
_this.phoneHight = res.windowHeight + 'px';
|
|
}
|
|
});
|
|
_this.itemInfos.comment_list = !!_this.itemInfo.comment_list ? _this.itemInfo.comment_list : "";
|
|
_this.fabulous_avatar = _this.itemInfos.fabulous_avatar;
|
|
_this.fabulous_num = _this.itemInfos.fabulous_num;
|
|
_this.comment_list = !!_this.itemInfo.comment_list ? _this.itemInfo.comment_list : "";
|
|
|
|
},
|
|
|
|
goPostDetails() {
|
|
let _this = this;
|
|
App.navigationTo({
|
|
url: 'pages/subPages/postDetails/postDetails?id=' + _this.itemInfos.id
|
|
});
|
|
},
|
|
// 遮罩层关闭
|
|
coverClosePop() {
|
|
let _this = this;
|
|
_this.$emit('operationShow', -1);
|
|
_this.coverShow = false;
|
|
_this.show = false;
|
|
_this.replyShow1 = false;
|
|
_this.answerShow1 = false;
|
|
},
|
|
lose() {
|
|
// #ifdef H5
|
|
// document.body.scrollTop = document.documentElement.scrollTop = 0;
|
|
// #endif
|
|
},
|
|
// 帖子评论
|
|
comment() {
|
|
let _this = this,
|
|
data = {
|
|
text: _this.text,
|
|
id: _this.itemInfos.id
|
|
};
|
|
if (_this.isComment) return
|
|
_this.isComment = true;
|
|
setTimeout(()=>{
|
|
_this.isComment = false;
|
|
},1000)
|
|
// debugger
|
|
if(_this.commitem != null && _this.commitem.index>= 0){
|
|
if(_this.text == _this.commitem.item.content){
|
|
uni.showToast({
|
|
icon:'none',
|
|
title:'请先进行修改'
|
|
});
|
|
return
|
|
}
|
|
// console.log(_this.item.)
|
|
let datas = {
|
|
id:_this.commitem.item.id,
|
|
type:1,
|
|
text:_this.text
|
|
}
|
|
App._post_form('&p=pocket&do=changeComment', datas, res => {
|
|
_this.replyShow1 = false;
|
|
_this.show = false;
|
|
_this.answerShow1 = false;
|
|
_this.coverShow = false;
|
|
App.showSuccess('评论修改成功', () => {
|
|
_this.isComment = false;
|
|
})
|
|
_this.comment_list.list.map((item,index)=>{
|
|
if(index == _this.commitem.index){
|
|
item.content = _this.text;
|
|
}
|
|
})
|
|
_this.text = '';
|
|
},fail=>{
|
|
_this.isComment = false;
|
|
if (fail.data.message == '未绑定手机号') {
|
|
//#ifdef H5
|
|
_this.popShow = true;
|
|
//#endif
|
|
//#ifndef H5
|
|
_this.vxshow = true;
|
|
//#endif
|
|
|
|
}
|
|
});
|
|
}else{
|
|
App._post_form('&p=pocket&do=comment', data, res => {
|
|
_this.replyShow1 = false;
|
|
_this.show = false;
|
|
_this.answerShow1 = false;
|
|
_this.coverShow = false;
|
|
|
|
App.showSuccess('评论成功', () => {
|
|
_this.isComment = false;
|
|
})
|
|
let plPush = {
|
|
nickname: uni.getStorageSync('userinfo').nickname,
|
|
mid:res.data.amid,
|
|
smid:res.data.amid,
|
|
id:res.data.cid,
|
|
content: _this.text,
|
|
list:[]
|
|
};
|
|
_this.comment_list.list.unshift(plPush);
|
|
|
|
_this.text = '';
|
|
},fail=>{
|
|
_this.isComment = false;
|
|
if (fail.data.message == '未绑定手机号') {
|
|
//#ifdef H5
|
|
_this.popShow = true;
|
|
//#endif
|
|
//#ifndef H5
|
|
_this.vxshow = true;
|
|
//#endif
|
|
|
|
}
|
|
});
|
|
}
|
|
|
|
|
|
},
|
|
show1() {
|
|
let _this = this;
|
|
if (_this.indexShow === _this.indexNumber) {
|
|
_this.$emit('operationShow', -1);
|
|
_this.coverShow = false;
|
|
} else {
|
|
_this.$emit('operationShow', _this.indexNumber);
|
|
_this.coverShow = true;
|
|
}
|
|
},
|
|
// 展开全文
|
|
fullText(index) {
|
|
let _this = this;
|
|
if (_this.textList.indexOf(index) == -1) {
|
|
_this.textList.push(index);
|
|
_this.textTips = '收起';
|
|
} else {
|
|
_this.textTips = '展开全文';
|
|
for (let i = 0; i < _this.textList.length; i++) {
|
|
if (_this.textList[i] == index) {
|
|
_this.textList.splice(i, 1);
|
|
}
|
|
}
|
|
}
|
|
},
|
|
// 拨打电话
|
|
kfPhone() {
|
|
let _this = this;
|
|
_this.$emit('operationShow', -1);
|
|
_this.replyShow1 = false;
|
|
_this.answerShow1 = false;
|
|
_this.show = false;
|
|
_this.coverShow = false;
|
|
uni.showModal({
|
|
title: '联系客户',
|
|
content: _this.itemInfos.phone,
|
|
success: function(res) {
|
|
if (res.confirm) {
|
|
uni.makePhoneCall({
|
|
phoneNumber: _this.itemInfos.phone //仅为示例
|
|
});
|
|
} else if (res.cancel) {}
|
|
}
|
|
});
|
|
},
|
|
// 回复弹窗
|
|
answerPop(cid, amid, items, name,index,indexs) {
|
|
let _this = this;
|
|
// debugger
|
|
_this.$emit('operationShow', -1);
|
|
_this.answerShow1 = true;
|
|
_this.cid = cid;
|
|
_this.amid = amid;
|
|
_this.items = items;
|
|
_this.$set(_this.items,'index',index);
|
|
_this.$set(_this.items,'indexs',indexs)
|
|
if(index == 0 || index){
|
|
_this.answerText = _this.items.content;
|
|
}
|
|
_this.answerName = name;
|
|
console.info(_this.answerName);
|
|
},
|
|
// 关闭评论弹窗
|
|
replyClose() {
|
|
let _this = this;
|
|
_this.replyShow1 = false;
|
|
_this.answerShow1 = false;
|
|
_this.show = false;
|
|
_this.coverShow = false;
|
|
_this.commitem = null;
|
|
_this.items = {};
|
|
},
|
|
// 评论按钮
|
|
replyShow(item,index) {
|
|
let _this = this;
|
|
console.log(item,index)
|
|
if(!!item && item.type != 'click'){
|
|
_this.commitem = {}
|
|
_this.commitem.item = item;
|
|
_this.text = item.content;
|
|
console.log(_this.text)
|
|
_this.commitem.index = index;
|
|
}else{
|
|
_this.commitem = null;
|
|
}
|
|
_this.$emit('operationShow', -1);
|
|
this.replyShow1 = true;
|
|
},
|
|
// 回复评论
|
|
reply() {
|
|
let _this = this;
|
|
let data = {
|
|
id: _this.itemInfos.id,
|
|
cid: _this.cid,
|
|
amid: _this.amid,
|
|
text: _this.answerText
|
|
};
|
|
|
|
if (_this.isComment) return
|
|
_this.isComment = true;
|
|
setTimeout(()=>{
|
|
_this.isComment = false;
|
|
},1000)
|
|
if(_this.items.index == 0 || !!_this.items.index){
|
|
if(_this.answerText == _this.items.content){
|
|
uni.showToast({
|
|
icon:'none',
|
|
title:'请先进行修改'
|
|
});
|
|
return
|
|
}
|
|
let datas = {
|
|
id:_this.items.id,
|
|
type:1,
|
|
text:_this.answerText
|
|
}
|
|
App._post_form('&p=pocket&do=changeReply', datas, res => {
|
|
App.showSuccess('修改回复成功', () => {
|
|
_this.isComment = false;
|
|
})
|
|
_this.comment_list.list.map((item,index)=>{
|
|
if(index == _this.items.index){
|
|
item.list.map((itemss,indexss)=>{
|
|
if(indexss == _this.items.indexs){
|
|
_this.$set(itemss,'content',_this.answerText)
|
|
}
|
|
})
|
|
}
|
|
})
|
|
_this.answerText = '';
|
|
_this.answerShow1 = false;
|
|
_this.replyShow1 = false;
|
|
console.log(res.data.message,'ahaha')
|
|
})
|
|
}else{
|
|
App._post_form('&p=pocket&do=reply', data, res => {
|
|
console.log(res)
|
|
App.showSuccess('回复成功', () => {
|
|
_this.isComment = false;
|
|
})
|
|
if (_this.items !== null) {
|
|
let list = {
|
|
id:res.data,
|
|
smid: uni.getStorageSync('userinfo').mid,
|
|
reply_name: uni.getStorageSync('userinfo').nickname,
|
|
name: _this.answerName,
|
|
content: _this.answerText
|
|
};
|
|
_this.comment_list.list.map((item,index)=>{
|
|
if(item.id == _this.cid && item.mid == _this.amid){
|
|
console.log(12212121212,item)
|
|
item.list.push(list);
|
|
}
|
|
})
|
|
// _this.items.list.push(list);
|
|
}
|
|
_this.answerText = '';
|
|
_this.answerShow1 = false;
|
|
_this.replyShow1 = false;
|
|
console.log(res.data.message,'ahaha')
|
|
})
|
|
}
|
|
// App._post_form('&p=pocket&do=reply', data, res => {
|
|
// App.showSuccess('回复成功', () => {
|
|
// _this.isComment = false;
|
|
// })
|
|
// if (_this.items !== null) {
|
|
// let list = {
|
|
// amid: uni.getStorageSync('userinfo').mid,
|
|
// reply_name: uni.getStorageSync('userinfo').nickname,
|
|
// name: _this.answerName,
|
|
// content: _this.answerText
|
|
// };
|
|
// _this.items.list.push(list);
|
|
// }
|
|
// _this.answerText = '';
|
|
// _this.answerShow1 = false;
|
|
// console.log(res.data.message,'ahaha')
|
|
// },fail=>{
|
|
// if (fail.data.message == '未绑定手机号') {
|
|
// //#ifdef H5
|
|
// _this.popShow = true;
|
|
// //#endif
|
|
// //#ifndef H5
|
|
// _this.vxshow = true;
|
|
// //#endif
|
|
|
|
// }
|
|
// })
|
|
},
|
|
// 帖子点赞
|
|
fabulous() {
|
|
let _this = this;
|
|
let data = {
|
|
id: _this.itemInfos.id
|
|
};
|
|
App._post_form('&p=pocket&do=fabulous', data, res => {
|
|
_this.$emit('operationShow', -1);
|
|
_this.replyShow1 = false;
|
|
_this.answerShow1 = false;
|
|
_this.show = false;
|
|
_this.coverShow = false;
|
|
if (_this.itemInfos.is_fabulous == 1) {
|
|
uni.showToast({
|
|
icon: 'none',
|
|
title: '取消点赞',
|
|
duration: 2000
|
|
});
|
|
_this.$emit('getover',_this.itemInfos.id,false);
|
|
} else {
|
|
uni.showToast({
|
|
icon: 'none',
|
|
title: '点赞成功',
|
|
duration: 2000
|
|
});
|
|
_this.$emit('getover',_this.itemInfos.id,true);
|
|
}
|
|
});
|
|
}
|
|
}
|
|
};
|
|
</script>
|
|
|
|
<style lang="less" scoped>
|
|
.replyViewPackage {
|
|
padding: 30upx;
|
|
}
|
|
|
|
.coverView {
|
|
z-index: 2;
|
|
position: fixed;
|
|
top: 84upx;
|
|
background: rgba(0, 0, 0, 0);
|
|
width: 750upx;
|
|
}
|
|
|
|
.replyInput {
|
|
background: rgba(248, 248, 248, 1);
|
|
width: 500upx;
|
|
height: 200upx;
|
|
vertical-align: middle;
|
|
margin: 20upx auto 0 auto;
|
|
background: white;
|
|
font-size: 24upx;
|
|
font-family: Source Han Sans CN;
|
|
|
|
color: rgba(51, 51, 51, 1);
|
|
|
|
>textarea {
|
|
background: rgba(248, 248, 248, 1);
|
|
width: 500upx !important;
|
|
height: 200upx !important;
|
|
}
|
|
}
|
|
|
|
.sendButton {
|
|
text-align: center;
|
|
margin: 20upx auto 0 auto;
|
|
width: 292upx;
|
|
height: 74upx;
|
|
background: #3388ff;
|
|
border-radius: 37upx;
|
|
|
|
>text {
|
|
line-height: 74upx;
|
|
font-size: 24upx;
|
|
|
|
|
|
color: #ffffff;
|
|
}
|
|
}
|
|
|
|
.replyView {
|
|
border: 1upx solid rgba(0, 0, 0, 0);
|
|
width: 600upx;
|
|
background: rgba(255, 255, 255, 1);
|
|
border-radius: 20upx;
|
|
background: #f8f8f8;
|
|
}
|
|
|
|
.operationView {
|
|
transform: rotate(45deg);
|
|
display: inline-block;
|
|
position: relative;
|
|
bottom: 3upx;
|
|
left: 15upx;
|
|
width: 38upx;
|
|
height: 38upx;
|
|
background: rgba(51, 51, 51, 1);
|
|
border: 1upx solid rgba(51, 51, 51, 1);
|
|
}
|
|
|
|
.sj {
|
|
left: 17upx;
|
|
position: absolute;
|
|
top: -12upx;
|
|
transform: rotate(45deg);
|
|
display: inline-block;
|
|
width: 30upx !important;
|
|
height: 30upx !important;
|
|
background: rgba(248, 248, 248, 1);
|
|
}
|
|
|
|
.operationShow {
|
|
z-index: 3;
|
|
position: relative;
|
|
right: 480upx;
|
|
bottom: 64upx;
|
|
width: 440upx;
|
|
height: 80upx;
|
|
background: rgba(51, 51, 51, 1);
|
|
border-radius: 10upx;
|
|
|
|
>view:nth-child(1) {
|
|
margin-left: 42upx;
|
|
|
|
>image {
|
|
width: 50upx;
|
|
height: 50upx;
|
|
}
|
|
}
|
|
|
|
>view:nth-child(2) {
|
|
margin-left: 40upx;
|
|
|
|
>image {
|
|
width: 50upx;
|
|
height: 50upx;
|
|
}
|
|
}
|
|
|
|
>view:nth-child(3) {
|
|
margin-left: 40upx;
|
|
|
|
>image {
|
|
width: 50upx;
|
|
height: 50upx;
|
|
}
|
|
}
|
|
|
|
>view {
|
|
vertical-align: middle;
|
|
display: inline-block;
|
|
|
|
>image {
|
|
vertical-align: middle;
|
|
}
|
|
|
|
>span {
|
|
line-height: 80upx;
|
|
vertical-align: middle;
|
|
font-size: 24upx;
|
|
|
|
|
|
color: rgba(255, 255, 255, 1);
|
|
}
|
|
}
|
|
}
|
|
|
|
.postList {
|
|
|
|
font-size: 0;
|
|
}
|
|
|
|
.zd {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
float: right;
|
|
|
|
>image {
|
|
position: relative;
|
|
right: 630upx;
|
|
width: 58upx;
|
|
height: 58upx;
|
|
}
|
|
}
|
|
|
|
.menbottom{
|
|
display: inline-block;
|
|
float: right;
|
|
}
|
|
|
|
.memberMain {
|
|
padding-left: 10upx;
|
|
vertical-align: middle;
|
|
display: inline-block;
|
|
width: 250upx;
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
white-space: nowrap;
|
|
font-size: 24upx;
|
|
|
|
|
|
color: #999999;
|
|
}
|
|
|
|
.member {
|
|
vertical-align: middle;
|
|
font-size: 24upx;
|
|
|
|
|
|
color: rgba(66, 128, 197, 1);
|
|
}
|
|
|
|
.maohao {
|
|
vertical-align: middle;
|
|
font-size: 24upx;
|
|
|
|
|
|
color: rgba(66, 128, 197, 1);
|
|
}
|
|
|
|
.member1 {
|
|
vertical-align: middle;
|
|
margin-left: 10upx;
|
|
font-size: 24upx;
|
|
|
|
|
|
color: rgba(66, 128, 197, 1);
|
|
}
|
|
|
|
.hf {
|
|
vertical-align: middle;
|
|
margin-left: 10upx;
|
|
font-size: 24upx;
|
|
|
|
|
|
color: #333333;
|
|
}
|
|
|
|
.postListMbCommentBodyPackage {
|
|
padding: 15upx 20upx 20upx 20upx;
|
|
}
|
|
|
|
.zan {
|
|
width: 26upx;
|
|
height: 27upx;
|
|
}
|
|
|
|
.zanHead {
|
|
vertical-align: middle;
|
|
width: 38upx;
|
|
height: 39upx;
|
|
border-radius: 50%;
|
|
overflow: hidden;
|
|
display: inline-block;
|
|
|
|
>image {
|
|
width: 38upx;
|
|
height: 39upx;
|
|
}
|
|
}
|
|
|
|
.zanHeadFd {
|
|
vertical-align: middle;
|
|
width: 38upx;
|
|
height: 39upx;
|
|
border-radius: 50%;
|
|
overflow: hidden;
|
|
display: inline-block;
|
|
}
|
|
|
|
.postListMbCommentTitle {}
|
|
|
|
.postListMbCommentTitlePackage {
|
|
padding: 30upx 20upx;
|
|
border-bottom: 1upx solid rgba(238, 238, 238, 1);
|
|
|
|
>text {
|
|
margin-right: 10upx;
|
|
vertical-align: middle;
|
|
margin-left: 15upx;
|
|
font-size: 24upx;
|
|
|
|
|
|
color: rgba(153, 153, 153, 1);
|
|
}
|
|
}
|
|
|
|
.postListMbComment {
|
|
position: relative;
|
|
margin: 40upx 0 0 0;
|
|
width: 630upx;
|
|
background: rgba(248, 248, 248, 1);
|
|
border-radius: 4upx;
|
|
}
|
|
|
|
.dot {
|
|
margin: 20upx 0 0 0;
|
|
display: inline-block;
|
|
width: 8upx;
|
|
height: 8upx;
|
|
background: rgba(66, 128, 197, 1);
|
|
border-radius: 50%;
|
|
}
|
|
|
|
.postListMbFlowRightPackage {
|
|
display: flex;
|
|
justify-content: space-around;
|
|
width: 100%;
|
|
height: 100%;
|
|
}
|
|
|
|
.postListMbFlowRight {
|
|
display: ;
|
|
width: 80upx;
|
|
height: 50upx;
|
|
background: rgba(248, 248, 248, 1);
|
|
border-radius: 6upx;
|
|
}
|
|
|
|
.postListMbFlowLeft {
|
|
line-height: 50upx;
|
|
>text {
|
|
margin-right: 20upx;
|
|
font-size: 24upx;
|
|
|
|
|
|
color: rgba(153, 153, 153, 1);
|
|
|
|
>text {
|
|
margin-left: 10upx;
|
|
}
|
|
}
|
|
}
|
|
|
|
.postListMbFlow {
|
|
margin-top: 20upx;
|
|
display: flex;
|
|
justify-content: space-between;
|
|
|
|
>view {
|
|
vertical-align: middle;
|
|
display: inline-block;
|
|
}
|
|
}
|
|
|
|
.postListMbImgShow {
|
|
vertical-align: middle;
|
|
margin-right: 10upx;
|
|
margin-top: 10upx;
|
|
width: 200upx;
|
|
height: 200upx;
|
|
border-radius: 10upx;
|
|
overflow: hidden;
|
|
display: inline-block;
|
|
|
|
>image {
|
|
width: 202upx;
|
|
height: 202upx;
|
|
}
|
|
}
|
|
|
|
.videoPlay {
|
|
width: 630upx;
|
|
height: 450upx;
|
|
}
|
|
|
|
.postListMbImg {
|
|
flex-wrap: wrap;
|
|
margin-top: 20upx;
|
|
|
|
>view {
|
|
display: inline-block;
|
|
vertical-align: middle;
|
|
}
|
|
}
|
|
|
|
.postListTextMain {
|
|
font-size: 32upx;
|
|
color: rgba(51, 51, 51, 1);
|
|
text-overflow: -o-ellipsis-lastline;
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
display: -webkit-box;
|
|
-webkit-line-clamp: 3;
|
|
line-clamp: 3;
|
|
-webkit-box-orient: vertical;
|
|
}
|
|
|
|
.postListText {
|
|
margin-top: 30upx;
|
|
|
|
>text {
|
|
display: inline-block;
|
|
margin-top: 30upx;
|
|
font-size: 28upx;
|
|
color: rgba(66, 128, 197, 1);
|
|
}
|
|
}
|
|
|
|
.labelList {
|
|
margin-top: 20upx;
|
|
}
|
|
|
|
.labelMb {
|
|
margin: 0 10upx 0upx 0;
|
|
display: inline-block;
|
|
height: 34upx;
|
|
border-radius: 4upx;
|
|
line-height: 30upx;
|
|
|
|
>text {
|
|
padding: 0 10upx;
|
|
font-size: 20upx;
|
|
}
|
|
}
|
|
|
|
.postListMbTitleRight {
|
|
text-align: right;
|
|
min-width: 100upx;
|
|
|
|
>text {
|
|
line-height: 53upx;
|
|
font-size: 24upx;
|
|
|
|
|
|
color: rgba(66, 128, 197, 1);
|
|
}
|
|
}
|
|
|
|
.hb {
|
|
display: inline-block;
|
|
vertical-align: middle;
|
|
width: 63upx;
|
|
height: 34upx;
|
|
line-height: 30upx;
|
|
background: rgba(255, 68, 68, 1);
|
|
border-radius: 4upx;
|
|
text-align: center;
|
|
margin-left: 10upx;
|
|
|
|
>text {
|
|
font-size: 24upx;
|
|
font-family: Source Han Sans CN;
|
|
|
|
color: rgba(255, 255, 255, 1);
|
|
}
|
|
}
|
|
|
|
.fullText {
|
|
word-wrap: break-word;
|
|
|
|
>text {
|
|
font-size: 30upx;
|
|
|
|
|
|
color: rgba(51, 51, 51, 1);
|
|
}
|
|
}
|
|
|
|
.postListMbTitleLeft {
|
|
>text {
|
|
margin-left: 20upx;
|
|
vertical-align: middle;
|
|
font-size: 28upx;
|
|
|
|
|
|
color: rgba(51, 51, 51, 1);
|
|
}
|
|
|
|
.post-label {
|
|
display: inline-block;
|
|
margin: 0 0 0 20upx;
|
|
vertical-align: middle;
|
|
height: 40upx;
|
|
line-height: 48upx;
|
|
|
|
>image {
|
|
margin-left: 10upx;
|
|
vertical-align: middle;
|
|
width: 40upx;
|
|
height: 40upx;
|
|
}
|
|
}
|
|
}
|
|
|
|
.postListHead {
|
|
display: inline-block;
|
|
vertical-align: middle;
|
|
width: 54upx;
|
|
height: 53upx;
|
|
border-radius: 50%;
|
|
overflow: hidden;
|
|
|
|
>image {
|
|
width: 54upx;
|
|
height: 53upx;
|
|
}
|
|
}
|
|
|
|
.postListMbTitle {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
|
|
>view {
|
|
display: inline-block;
|
|
vertical-align: middle;
|
|
}
|
|
}
|
|
|
|
.full {
|
|
height: 80upx;
|
|
text-align: center;
|
|
|
|
>text {
|
|
line-height: 80upx;
|
|
font-size: 28upx;
|
|
|
|
|
|
color: black;
|
|
}
|
|
}
|
|
|
|
.postListMbPackage {
|
|
padding: 30upx;
|
|
}
|
|
|
|
.postListMb {
|
|
margin: 20upx auto 0 auto;
|
|
width: 690upx;
|
|
background: rgba(255, 255, 255, 1);
|
|
border-radius: 10upx;
|
|
}
|
|
|
|
.dianzan-icon {
|
|
display: inline-block;
|
|
font-size: 32upx;
|
|
vertical-align: middle;
|
|
}
|
|
|
|
.marB5 {
|
|
margin-top: 5upx;
|
|
}
|
|
</style>
|
|
|