網(wǎng)站首頁(yè) 編程語(yǔ)言 正文
<template>
<navigationBar title='資訊詳情' />
<!-- 公共背景圖 -->
<publicContext />
<image v-if="newsLists.img" class="fengmian" :src="$imgUrl + newsLists.img"></image>
<video v-if="newsLists.video" class="fengmian" :src="$imgUrl + newsLists.video"></video>
<view class="center" v-html="newsLists.content">{{newsLists.content}}</view>
<view class="pinglun">
<view>
<image v-if='isShare' src="/Apages/static/img/icon07.png"></image>
<image v-else src="/Apages/static/img/icon08.png"></image>
<view>{{newsLists.share_num}}</view>
</view>
<view>
<image v-if='!newsLists.collection' src="/Apages/static/img/icon09.png"></image>
<image v-else src="/Apages/static/img/icon10.png"></image>
<view>{{newsLists.collection_num}}</view>
</view>
<view>
<image v-if='!newsLists.like' src="/Apages/static/img/icon11.png"></image>
<image v-else src="/Apages/static/img/icon12.png"></image>
<view>{{newsLists.like_num}}</view>
</view>
</view>
<view class="commentBox">
<view class="title">評(píng)論({{newsCommentListArr.length}})</view>
<view class="comment" v-for="(item,index) in newsCommentListArr" :key="index">
<view class="name">{{item.user.nickname}}:</view>
<view class="txt">{{item.content}}</view>
</view>
</view>
<view class="inputBox">
<view class="input">
<u--input
placeholder="單行輸入"
prefixIcon="edit-pen"
prefixIconStyle="font-size: 22px;color: #909399"
></u--input>
</view>
<view class="buttom">發(fā)送</view>
</view>
</template>
<script>
export default{
data(){
return{
isShare:true,
newsLists:{},
newsCommentListArr:[],
page:1
}
},
onReachBottom(){//do sth
console.log('觸底了哦')
this.onNewsCommentList(this.newsLists.id)
},
onLoad(p) {
this.onNewsList(p.id);
this.onNewsCommentList(p.id)
},
methods:{
onNewsList(id){
this.$http(this.$api.newsDetail,{id:id,api_token:uni.getStorageSync('token')}).then(res=>{
console.log(res,'咨詢?cè)斍?);
this.newsLists = res.data.data;
})
},
onNewsCommentList(id){
this.$http(this.$api.newsCommentList,{news_id:id,page:this.page++,pageSize:10}).then(res=>{
console.log(res);
this.newsCommentListArr = [...this.newsCommentListArr,...res.data.data];
})
}
}
}
</script>
<style lang="scss" scoped>
.fengmian{
width: 100%;
height: 400rpx;
}
.center{
// height: 224rpx;
font-size: 28rpx;
font-weight: 400;
text-align: left;
color: #000000;
line-height: 46rpx;
padding: 24rpx;
}
.pinglun{
width: 702rpx;
padding: 24rpx 0;
border-top: 2rpx solid #f2f2f2;
display: flex;
justify-content: space-around;
align-items: center;
view{
display: flex;
justify-content: center;
align-items: center;
image{
width: 32rpx;
height: 32rpx;
margin-right: 8rpx;
}
view{
font-size: 24rpx;
font-weight: 400;
color: #999999;
}
}
}
.commentBox{
width: 702rpx;
margin: 0 auto;
padding-bottom: 100rpx;
.title{
font-size: 30rpx;
font-weight: 500;
color: #333333;
}
.comment{
width: 100%;
display: flex;
justify-content: flex-start;
align-items: flex-start;
padding: 24rpx 0;
border-bottom: 2rpx solid #f2f2f2;
.name{
width: 112rpx;
height: 40rpx;
font-size: 28rpx;
font-weight: 400;
text-align: left;
color: #333333;
line-height: 42rpx;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.txt{
width: 590rpx;
font-size: 28rpx;
font-weight: 400;
text-align: left;
color: #333333;
line-height: 42rpx;
}
}
}
.inputBox{
width: 100%;
height: 92rpx;
background: #f0f0f0;
display: flex;
justify-content: center;
align-items: center;
position: fixed;
bottom: 0;
left: 0;
.input{
width: 574rpx;
height: 60rpx;
background: #ffffff;
border-radius: 30rpx;
}
::v-deep .u-border{
border-color: #f0f0f0 !important;
}
.buttom{
width: 112rpx;
height: 60rpx;
background: linear-gradient(180deg,#4170bc, #0b5099);
border-radius: 30rpx;
font-size: 28rpx;
font-weight: 400;
text-align: center;
color: #ffffff;
letter-spacing: 0.84rpx;
line-height: 60rpx;
margin-left: 16rpx;
}
}
</style>
原文鏈接:https://blog.csdn.net/L_15737525552/article/details/127729543
- 上一篇:沒(méi)有了
- 下一篇:沒(méi)有了
相關(guān)推薦
- 2022-12-26 Python中pywifi模塊的基本用法講解_python
- 2022-06-23 python入門(mén)語(yǔ)句基礎(chǔ)之if語(yǔ)句、while語(yǔ)句_python
- 2022-05-23 高效的數(shù)據(jù)同步工具DataX的使用及實(shí)現(xiàn)示例_數(shù)據(jù)庫(kù)其它
- 2023-03-04 c++元編程模板函數(shù)重載匹配規(guī)則示例詳解_C 語(yǔ)言
- 2022-06-19 C++深入探究引用的本質(zhì)與意義_C 語(yǔ)言
- 2022-11-09 Flutter?異步編程之單線程下異步模型圖文示例詳解_Android
- 2022-07-13 常用類(lèi)之BigDecimal、Date、Calender、SimpleDateFormat及Syst
- 2022-08-15 Python?time模塊之時(shí)間戳與結(jié)構(gòu)化時(shí)間的使用_python
- 欄目分類(lèi)
-
- 最近更新
-
- window11 系統(tǒng)安裝 yarn
- 超詳細(xì)win安裝深度學(xué)習(xí)環(huán)境2025年最新版(
- Linux 中運(yùn)行的top命令 怎么退出?
- MySQL 中decimal 的用法? 存儲(chǔ)小
- get 、set 、toString 方法的使
- @Resource和 @Autowired注解
- Java基礎(chǔ)操作-- 運(yùn)算符,流程控制 Flo
- 1. Int 和Integer 的區(qū)別,Jav
- spring @retryable不生效的一種
- Spring Security之認(rèn)證信息的處理
- Spring Security之認(rèn)證過(guò)濾器
- Spring Security概述快速入門(mén)
- Spring Security之配置體系
- 【SpringBoot】SpringCache
- Spring Security之基于方法配置權(quán)
- redisson分布式鎖中waittime的設(shè)
- maven:解決release錯(cuò)誤:Artif
- restTemplate使用總結(jié)
- Spring Security之安全異常處理
- MybatisPlus優(yōu)雅實(shí)現(xiàn)加密?
- Spring ioc容器與Bean的生命周期。
- 【探索SpringCloud】服務(wù)發(fā)現(xiàn)-Nac
- Spring Security之基于HttpR
- Redis 底層數(shù)據(jù)結(jié)構(gòu)-簡(jiǎn)單動(dòng)態(tài)字符串(SD
- arthas操作spring被代理目標(biāo)對(duì)象命令
- Spring中的單例模式應(yīng)用詳解
- 聊聊消息隊(duì)列,發(fā)送消息的4種方式
- bootspring第三方資源配置管理
- GIT同步修改后的遠(yuǎn)程分支