1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889 |
- <template>
- <view class="cmain">
- <view class="title">{{ item.title }}</view>
- <view class="desc">
- <view>{{ item.source }}<text class="source" style="margin-left: 10px;" v-if="item.url" @click="toSource(item.url)">原文连接</text></view>
- <view>{{ item.createTime.substring(0,16) }}</view>
-
- {{ item.readCount }}
- </view>
- <u-divider :dot="true"></u-divider>
- <view v-html="item.content"></view>
-
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- item: {createTime:''}
- };
- },
- onLoad(e) {
- if (e.id) {
- this.http.request({
- url: '/level-one-server/app/TbPortNews/getById?id=' + e.id,
- success: res => {
- this.item = res.data.data;
- this.item.content = this.item.content.replace(/\<img/gi,
- '<img style="border-radius: 5px;"');
- }
- });
- }
- },
- methods: {
- toSource(url) {
-
- plus.runtime.openURL(url)
-
-
- window.open(url)
-
- }
- }
- };
- </script>
- <style lang="scss">
- .cmain {
- padding: 20px 16px 15px 16px;
- .title {
- font-weight: bold;
- color: #192b20;
- line-height: 32px;
- font-size: 22px;
- }
- .desc {
- margin-top: 10px;
- overflow: hidden;
- color: #a0a2a6;
- text {
- // float: left;
- }
- .source {
- color: #0081ff;
- margin-right: 10px;
- }
- margin-right: 10px;
- .read {
- float: right;
- margin-top: -2px;
- .icon {
- padding-right: 3px;
- float: left;
- margin-top: 2px;
- }
- }
- }
- }
- </style>
|