| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387 |
- <template>
- <view class="circle-info-box iPhone-bottom flex-common-css box-border-box bgc-f">
- <view class="nav-box bgc-f">
- <Nav :leftShow='false' :customNav='true' bgckgroundBox='transparent'>
- <template>
- <view slot="custom" class="display-flex ">
- <image class="nav-img" @click="toBack()" src="@/static/img/takeout/bg-back.png" mode="scaleToFill"></image>
- <view class="info-nav display-flex">
- <image :src="obj.head_img" mode=""></image>
- <view class="">
- <view class="fs-32 fw-600 w348 text-overflow-ellipsis-one">{{obj.nickname||''}}</view>
- <view class="fs-24 fc-9 fw-400">{{obj.created_date||''}}</view>
- </view>
- </view>
- </view>
- </template>
- </Nav>
- </view>
-
-
-
- <scroll-view scroll-y="true" class="scroll-view-css">
- <view class="scroll-view-css">
- <view class="box-border-box mb-26" v-if="obj.image.length > 0">
- <swiper class="swiper mb-32 " circular indicator-dots indicator-active-color="#4FB3EF" :autoplay="true" :interval="3000" :duration="500">
- <swiper-item v-for="(item,i) in obj.image" :key="i">
- <image class="swiper-item" :src="item" mode="aspectFill"></image>
- </swiper-item>
- </swiper>
- </view>
- <view class="box-border-box bz-box bgc-f b-b-F9F9F9 mt-24">
- <view class="fs-30 fw-600 mb-32">{{obj.content||''}}</view>
- <view class="card-4 flex-wrap-wrap">
- <view class="">{{obj.school_name||''}}</view>
- <view class="">{{obj.topic_name||''}}</view>
- </view>
- </view>
-
- <view v-if="list.length == 0" class="scroll-view-css">
- <EnBlank :customSrc='true'>
- <template v-slot:blankImg>
- <image class="black-custom-img" src="@/static/img/common/no-order.png" mode=""></image>
- </template>
- </EnBlank>
- </view>
-
- <view v-else class="pop-box pop-msg box-border-box p-24">
- <view class=" box-border-box plr-24">
- <view class="list-box flex-justify-space" v-for="(item,i) in list" :key="i">
- <image class="list-box-img" src="@/static/img/my/bg.png" mode="scaleToFill"></image>
- <view class="flex-1">
- <view class=" flex-justify-space">
- <view class="p-b-20 b-b-F9F9F9 mr-20">
- <view class="fs-28 fw-400 fc-9 mb-8 align-items-center">
- {{item.nickname}}
- <span v-if="item.is_author == 1" class='only-box text-align-center fs-24 fc-41ABF5 ml-10'>作者</span>
- <view class="ml-10" v-if="item.is_self == 1" @click="delInfo(item)">
- <uni-icons type="trash" size="18"></uni-icons>
- </view>
- </view>
- <view class="fs-30 fw-400 mb-8" @click.stop="openInput(1,item)">
- {{item.content}}
- </view>
- <view class="fs-24 fw-400 fc-9 mb-8">{{item.created_date}}</view>
- </view>
- <view class="display-flex" @click.stop="handUp(2,item)">
- <uni-icons type="hand-up" size="20" :color="item.is_like==1?'#FD5C02':'#999'"></uni-icons>
- <view class="fs-24 fw-400 mt-5" :class="item.is_like==1?'fc-FD5C02':'fc-9'">{{item.like}}</view>
- </view>
- </view>
-
- <view v-if="item.isOpen" class="fs-24 fc-6 text-align-center mb-12" @click="openReply(1,item,i)">展开更多评论</view>
-
- <!-- <view class="list-box flex-justify-space" v-for="(info,index) in 5" :key="index">
- <image class="list-box-img" src="@/static/img/my/bg.png" mode="scaleToFill"></image>
- <view class="flex-1">
- <view class=" flex-justify-space">
- <view class="p-b-20 b-b-F9F9F9 mr-20">
- <view class="fs-28 fw-400 fc-9 mb-8">
- 最佳损友最佳损友
- <span v-if="info.is_author == 1" class='only-box text-align-center fs-24 fc-41ABF5 ml-10'>作者</span>
- <view class="ml-10" v-if="info.is_self == 1" @click="delInfo(info)">
- <uni-icons type="trash" size="18"></uni-icons>
- </view>
- </view>
- <view class="fs-30 fw-400 mb-8" @click="openInput()">
- 回关一下啊,这么近这么近这么近这么近这么近这么近
- </view>
- <view class="fs-24 fw-400 fc-9 mb-8">2021-04-17 15:53</view>
- </view>
- <view class="display-flex">
- <uni-icons type="hand-up" size="20" color="#999"></uni-icons>
- <view class="fs-24 fw-400 fc-9 mt-5">11</view>
- </view>
- </view>
- </view>
- </view> -->
- </view>
- </view>
- </view>
- </view>
- </view>
- </scroll-view>
-
- <view class="card-5 flex-justify-space box-border-box ">
- <view class="align-items-center"></view>
- <view class="align-items-center" @click.stop="handUp(1,obj)">
- <uni-icons type="hand-up" size="22" :color="obj.is_like==1?'#FD5C02':'#999'"></uni-icons>
- <view class="fs-24 " :class="obj.is_like==1?'fc-FD5C02':'fc-9'">{{obj.like}}</view>
- </view>
- <view class="align-items-center" @click.stop="openInput(0,item)">
- <image src="@/static/img/school/info.png" mode=""></image>
- <view class="fs-24 fc-9">{{obj.remark}}</view>
- </view>
- </view>
-
- <uni-popup ref="popup" type="bottom">
- <view class="pop-input">
- <view class="head-pop flex-justify-space align-items-center mb-24 box-border-box p-24">
- <uni-icons @click="closeInput()" type="closeempty" size="24"></uni-icons>
- <view class="fs-36 fc-0 fw-600">评论</view>
- <view class="fs-28 fw-600 fc-41ABF5" @click="save()">确定</view>
- </view>
- <view class="scroll-view-css">
- <view class="bgc-f box-border-box p-32">
- <view class="fs-34 fw-600 mb-20">评论</view>
- <textarea class=" fs-24" placeholder='友善评论,文明发言'></textarea>
- </view>
- </view>
- </view>
- </uni-popup>
- </view>
- </template>
- <script>
- import EnBlank from "@/components/en-utils/en-blank/en-blank";
- import {alumnInfo,getRemarkList,setAlumniLike,delRemark} from '@/api/alumni.js';
- import tools from "@/service/tools";
- export default {
- components:{EnBlank},
- data(){
- return{
- id:0,
-
- news_id:'',
- obj:{
- image:[],
- },
- list:[],
- page:1,
- total:0,
- }
- },
- onLoad(e) {
- this.news_id = e.news_id;
- this.getInfo();
- this.getList();
- },
- methods:{
- toBack(){
- tools.leftClick()
- },
- getInfo(){
- alumnInfo({news_id:this.news_id}).then((res)=>{
- if(res.code === 1){
- this.obj = res.data;
- }
- })
- },
- getList(){
- getRemarkList({news_id:this.news_id,remark_id:0,page:this.page}).then((res)=>{
- if(res.code === 1){
- this.list = [...this.list,...res.data.items];
- this.total = res.data.total;
- this.list.forEach((v)=>{
- v.replyList = [];
- if(v.count > 0){
- v.isOpen = true;
- }
- })
- }
- })
- },
-
-
- // 点赞
- handUp(type,item){
- if(this.isAJAX){
- return
- }
- this.isAJAX = true;
- let is_like = item.is_like == 1?0:1;
- if(type == 1){
- // 点赞贴子
- setAlumniLike({news_id:item.news_id,is_like:is_like}).then((res)=>{
- this.handUpFun(res,item,is_like)
- })
- }else{
- // 点赞评论
- setRemarkLike({news_id:item.news_id,is_like:is_like,remark_id:item.id}).then((res)=>{
- this.handUpFun(res,item,is_like)
- })
- }
- },
- // 点赞公共回复
- handUpFun(res,item,is_like){
- if(res.code === 1){
- item.is_like = is_like;
- if(is_like == 0){
- item.like -= 1
- }else{
- item.like += 1
- }
- this.isAJAX = false;
- tools.success(res.msg);
- }else{
- this.isAJAX = false;
- tools.error(res.msg);
- }
- },
-
- openInput(type,item){
- if(type == 0){
- this.msgData.remark_id = 0;
- }else if(type == 1){
- this.msgData.remark_id = item.id;
- this.msgData.reply_id = item.m_id;
- }else{
- this.msgData.remark_id = item.remark_id;
- this.msgData.reply_id = item.m_id;
- }
- this.$refs.popup.open();
- },
- closeInput(){
- this.$refs.popup.close();
- },
-
- save(){
- this.closeInput()
- },
-
-
- delInfo(item){
- if(this.isAJAX){
- return
- }
- this.isAJAX = true;
- delRemark({remark_id:item.id}).then((res)=>{
- if(res.code === 1){
- tools.success('删除成功')
- setTimeout(()=>{
- this.list = [];
- this.page = 1;
- this.getList();
- },1500)
- }else{
- this.isAJAX = false;
- tools.error(res.msg)
- }
- })
- },
- },
- }
- </script>
- <style scoped lang="scss">
- .circle-info-box{
- .card-5{
- padding: 50rpx;
- image{
- width: 40rpx;
- height: 40rpx;
- margin-right: 8rpx;
- }
- }
- .w348{
- width: 348rpx;
- }
- .nav-box{
- z-index: 99;
- padding-bottom: 10rpx;
- .nav-img{
- width: 56rpx;
- height: 56rpx;
- margin-right: 30rpx;
- }
- .info-nav{
- image{
- width: 64rpx;
- height: 64rpx;
- border-radius: 50%;
- margin-right: 20rpx;
- }
- }
- }
- .swiper{
- width: 100%rpx;
- height: 920rpx;
- .swiper-item{
- width: 100%;
- height: 920rpx;
- background-color: skyblue;
- }
- }
- .bz-box{
- padding: 0 32rpx 20rpx 32rpx;
- .card-4{
- view{
- padding: 4rpx 16rpx;
- background: #F2F2F2;
- border-radius: 200rpx;
- font-size: 24rpx;
- color: #999;
- margin-right: 20rpx;
- margin-bottom: 10rpx;
- }
- }
- }
-
- .pop-input{
- z-index: 100;
- width: 100%;
- height: 70vh;
- background-color: #fff;
- bottom: 0;
- left: 0;
- border-top: 1rpx solid #ccc;
- border-radius: 20rpx 20rpx 0 0;
- display: flex;
- flex-direction: column;
- }
-
- .pop-box{
-
- width: 100%;
- height: 50vh;
- background-color: #fff;
- border-radius: 24rpx 24rpx 0rpx 0rpx;
- display: flex;
- flex-direction: column;
- .item-box{
- width: 100%;
- height: 92rpx;
-
- border-radius: 200rpx;
- line-height: 92rpx;
- text-align: center;
- margin-bottom: 24rpx;
- }
- }
- .pop-msg{
- // height: 70vh;
- .head-pop{
- padding-bottom: 34rpx !important;
- border-bottom: 1rpx solid #F2F2F2;
- }
- .list-box{
- .list-box-img{
- width: 80rpx;
- height: 80rpx;
- border-radius: 50%;
- margin-right: 16rpx;
- }
- .only-box{
- padding: 4rpx 16rpx;
- background: rgba(65,171,245,0.1);
- border-radius: 8rpx 8rpx 8rpx 8rpx;
- }
- .msg-img{
- width: 144rpx;
- height: 144rpx;
- border-radius: 12rpx;
- margin-right:5rpx;
- margin-bottom: 5rpx;
- }
-
- .msg-img:nth-child(3n){
- margin-right: 0rpx;
- }
- .msg-img-1{
- width: 100rpx !important;
- height: 100rpx !important;
- }
- }
- }
- }
- </style>
|