更换版本
This commit is contained in:
45
we7/pages/newsDetail/newsDetail.js
Normal file
45
we7/pages/newsDetail/newsDetail.js
Normal file
@@ -0,0 +1,45 @@
|
||||
var e, o;
|
||||
(e = getApp()),
|
||||
(o = require("../../resource/js/htmlToWxml.js")),
|
||||
Page({
|
||||
data: { scrollHeight: 0, newsData: {} },
|
||||
getNewsDetail: function () {
|
||||
var n = this;
|
||||
wx.request({
|
||||
url: "https://wedengta.com/wxnews/getNews?action=DiscNewsContent&type=4&id=1478677877_1406730_1_9",
|
||||
headers: { "Content-Type": "application/json" },
|
||||
success: function (t) {
|
||||
var s = t.data;
|
||||
if (0 == s.ret) {
|
||||
var a = JSON.parse(s.content);
|
||||
(a.content = o.html2json(a.sContent)),
|
||||
(a.time = e.util.formatTime(1e3 * a.iTime)),
|
||||
n.setData({ newsData: a });
|
||||
} else console.log("数据拉取失败");
|
||||
},
|
||||
fail: function (e) {
|
||||
console.log("数据拉取失败");
|
||||
},
|
||||
});
|
||||
},
|
||||
stockClick: function (e) {
|
||||
var o = e.currentTarget.dataset.seccode,
|
||||
n = e.currentTarget.dataset.secname;
|
||||
console.log("stockClick:" + o + ";secName:" + n);
|
||||
},
|
||||
onLoad: function (e) {
|
||||
this.getNewsDetail(), console.log("onLoad");
|
||||
},
|
||||
onShow: function () {
|
||||
console.log("onShow");
|
||||
},
|
||||
onReady: function () {
|
||||
console.log("onReady");
|
||||
},
|
||||
onHide: function () {
|
||||
console.log("onHide");
|
||||
},
|
||||
onUnload: function () {
|
||||
console.log("onUnload");
|
||||
},
|
||||
});
|
15
we7/pages/newsDetail/newsDetail.wxml
Normal file
15
we7/pages/newsDetail/newsDetail.wxml
Normal file
@@ -0,0 +1,15 @@
|
||||
<import src="/we7/pages/templates/news.wxml"></import>
|
||||
<view class="page_gap page_news">
|
||||
<text class="h1" id="newsTitle">{{newsData.sTitle}}</text>
|
||||
<view class="news_info">
|
||||
<text class="span" id="newsAuthor">{{newsData.sFrom}}</text>
|
||||
<text class="span" id="newsDate">{{newsData.time}}</text>
|
||||
</view>
|
||||
<view id="font-adjust">
|
||||
<view class="news_relative" id="newsRelative"></view>
|
||||
<view class="summary_block" id="summary">{{newsData.sDescription}}</view>
|
||||
<view class="news_txt" id="newsContent">
|
||||
<template is="newsDetail" data="{{...newsData}}"></template>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
93
we7/pages/newsDetail/newsDetail.wxss
Normal file
93
we7/pages/newsDetail/newsDetail.wxss
Normal file
@@ -0,0 +1,93 @@
|
||||
.page_gap {
|
||||
padding: 16px 15px;
|
||||
}
|
||||
.page_news {
|
||||
background-color: #fff;
|
||||
}
|
||||
.page_news a {
|
||||
color: #106fbc;
|
||||
}
|
||||
.page_news .h1 {
|
||||
color: #373737;
|
||||
display: block;
|
||||
font-size: 21px;
|
||||
font-weight: 700;
|
||||
letter-spacing: 0.5px;
|
||||
line-height: 1.3;
|
||||
margin-bottom: 11px;
|
||||
}
|
||||
.news_info {
|
||||
color: rgba(89, 89, 89, 0.6);
|
||||
float: left;
|
||||
font-size: 12px;
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
.news_info .span {
|
||||
display: inline-block;
|
||||
margin-right: 8px;
|
||||
}
|
||||
.summary_block {
|
||||
background-color: #ececec;
|
||||
border-radius: 0 3px 3px 3px;
|
||||
box-sizing: border-box;
|
||||
font-size: 14px;
|
||||
line-height: 1.8;
|
||||
margin-bottom: 20px;
|
||||
padding: 10px;
|
||||
position: relative;
|
||||
text-align: justify;
|
||||
text-indent: 30px;
|
||||
word-break: break-all;
|
||||
}
|
||||
.summary_block:before {
|
||||
background-color: #f79464;
|
||||
border-radius: 0 3px 3px 0;
|
||||
color: #fff;
|
||||
content: "摘要";
|
||||
display: inline-block;
|
||||
font-size: 12px;
|
||||
left: 0;
|
||||
line-height: 1.6;
|
||||
padding: 0 4px;
|
||||
position: absolute;
|
||||
text-indent: 0;
|
||||
top: 0;
|
||||
z-index: 10;
|
||||
}
|
||||
.news_relative {
|
||||
clear: both;
|
||||
font-size: 12px;
|
||||
margin-bottom: 13px;
|
||||
}
|
||||
.news_relative p {
|
||||
line-height: 1.7;
|
||||
}
|
||||
.news_relative p span {
|
||||
color: rgba(89, 89, 89, 0.6);
|
||||
}
|
||||
.news_relative p a {
|
||||
margin-right: 10px;
|
||||
}
|
||||
.news_txt {
|
||||
color: #252525;
|
||||
font-size: 16px;
|
||||
line-height: 1.8;
|
||||
padding-bottom: 30px;
|
||||
word-break: break-all;
|
||||
}
|
||||
.news_txt .div {
|
||||
margin-bottom: 12px;
|
||||
text-align: justify;
|
||||
}
|
||||
.news_txt .a {
|
||||
color: #106fbc;
|
||||
position: relative;
|
||||
}
|
||||
.news_txt .b {
|
||||
font-weight: 700;
|
||||
}
|
||||
.news_txt .img {
|
||||
display: block;
|
||||
padding: 5px;
|
||||
width: 100%;
|
||||
}
|
Reference in New Issue
Block a user