123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148 |
- <template>
- <view>
- <u-navbar back-text="内容详情" back-icon-size="28" back-icon-color="#ffffff"
- :background="{backgroundColor: '#2795FD',}" :back-text-style="{color: '#ffffff'}"></u-navbar>
- <view class="main">
- <view class="title">
- {{newsDetail.title}}
- </view>
- <view class="date-views">
- <view class="date">
- {{newsDetail.createTime}}
- </view>
- <view class="views">
- <view class="icon">
- <img src="@/assets/img/riLine-eye-line Copy@1x.png" alt="">
- </view>
- <view class="number">
- {{newsDetail.browseNumber}}
- </view>
- </view>
- </view>
- <u-line color="#e6e6e6"/>
- <view class="content news-content" v-html="newsDetail.content" >
-
- </view>
-
- <image v-if="false" src="http://oss.xiaoxinda.com/enterprise/editor/2023/8/e3335976-7e10-4c2d-a322-ba384a86fc78/下载.png" :show-menu-by-longpress="true" ></image>
-
- </view>
- </view>
- </template>
- <script>
- import * as API from '@/apis/pagejs/packages.js'
- export default {
- data() {
- return {
- id: '',
- newsDetail: {},
- }
- },
- onLoad(op) {
-
-
- this.id =op.id;
- this.getNewsDetail();
- },
- methods: {
- timestart(){
- console.log("aaa1")
- },
- timeend(){
- console.log("aaa2")
- },
- saveImg(){
- console.log("aaa3")
- },
- getNewsDetail() {
- uni.showLoading({
- title: "加载中",
- mask: true,
- })
-
- API.newsDetail({
- id:this.id
- }).then((res) => {
- uni.hideLoading()
- var newsDetail = res.data.newsInfo;
- if(newsDetail.content){
- var reg=new RegExp('alt','gi');
- newsDetail.content=newsDetail.content.replace(reg,'width="100%" height="100%" /> <p')
-
- }
- this.newsDetail=newsDetail
- }).catch(error => {
- uni.showToast({icon: 'none',
- title: error,
- icon: "none"
- })
- })
- }
- }
- }
- </script>
- <style>
- page {
- background: #F0F0F2;
- padding-bottom: 120px;
- }
- </style>
- <style lang="scss" scoped>
- .main{
- padding: 40rpx 32rpx;
- background-color: #fff;
- .title{
- color: rgba(16, 16, 16, 1);
- font-size: 40rpx;
- text-align: justify;
- line-height: 48rpx;
- }
- .date-views{
- margin-top: 64rpx;
- display: flex;
- justify-content: space-between;
- align-items: center;
- margin-bottom: 32rpx;
- .date{
- color: rgba(119, 119, 119, 1);
- font-size: 24rpx;
- }
- .views{
- display: flex;
- align-items: center;
- color: rgba(119, 119, 119, 1);
- font-size: 12px;
- img{
- width: 32rpx;
- height: 32rpx;
- vertical-align: middle;
- margin-right: 8rpx;
- }
- }
- }
- .content{
- color: rgba(51, 51, 51, 1);
- font-size: 32rpx;
- line-height: 56rpx;
- margin-top: 40rpx;
- }
- .news-picture{
- margin-top: 32rpx;
- height: 310rpx;
- overflow: hidden;
- img{
- width: 100%;
- height: 100%;
- }
- }
- .picture-title{
- color: rgba(119, 119, 119, 1);
- font-size: 24rpx;
- margin-top: 16rpx;
- text-align: center;
- }
- }
- </style>
|