lx 5 anni fa
parent
commit
495cb808c7
7 ha cambiato i file con 164 aggiunte e 3 eliminazioni
  1. 2 1
      app.json
  2. 21 0
      pages/index/index.js
  3. 2 2
      pages/index/index.wxml
  4. 12 0
      pages/news/news.js
  5. 4 0
      pages/news/news.json
  6. 21 0
      pages/news/news.wxml
  7. 102 0
      pages/news/news.wxss

+ 2 - 1
app.json

@@ -5,7 +5,8 @@
     "pages/rise/rise",
     "pages/drop/drop",
     "pages/me/me",
-    "pages/details/details"
+    "pages/details/details",
+    "pages/news/news"
   ],
   "window": {
     "backgroundTextStyle": "light",

+ 21 - 0
pages/index/index.js

@@ -14,90 +14,105 @@ Page({
     imageheight: 0,//缩放后的高 
     aa:[
       {
+        id:'0',
         from:"Investing.com 中文",
         nickName:"买入波音(BA.US)好时机?两个问题没解决之前劝你住手",
         reward:"今年迄今,美股航空板块受到公共卫生事件的冲击.....",
         time:"6天前"
       },
       { 
+        id:'1',
         from:"chinese.aljazeera.net",
         nickName: "波音裁员超1.2万人与警惕最坏时刻尚未到来",
         reward: "波音公司当地时间27日宣布,将在美国裁减超1...",
         time:"6天前"
       },
       {
+        id:'2',
         from:"Investing.com 中文",
         nickName: "美股异动|波音737MAX客机恢复生产,盘前涨逾5%",
         reward: "Reuters.美股异动|波音(BA.US)737MAX客...",
         time:"5天前"
       },
       {
+        id:'3',
         from:"Investing.com 中文",
         nickName:"买入波音(BA.US)好时机?两个问题没解决之前劝你住手",
         reward:"今年迄今,美股航空板块受到公共卫生事件的冲击.....",
         time:"6天前"
       },
       { 
+        id:'4',
         from:"chinese.aljazeera.net",
         nickName: "波音裁员超1.2万人与警惕最坏时刻尚未到来",
         reward: "波音公司当地时间27日宣布,将在美国裁减超1...",
         time:"6天前"
       },
       {
+        id:'5',
         from:"Investing.com 中文",
         nickName: "美股异动|波音737MAX客机恢复生产,盘前涨逾5%",
         reward: "Reuters.美股异动|波音(BA.US)737MAX客...",
         time:"5天前"
       },
       {
+        id:'6',
         from:"Investing.com 中文",
         nickName:"买入波音(BA.US)好时机?两个问题没解决之前劝你住手",
         reward:"今年迄今,美股航空板块受到公共卫生事件的冲击.....",
         time:"6天前"
       },
       { 
+        id:'7',
         from:"chinese.aljazeera.net",
         nickName: "波音裁员超1.2万人与警惕最坏时刻尚未到来",
         reward: "波音公司当地时间27日宣布,将在美国裁减超1...",
         time:"6天前"
       },
       {
+        id:'8',
         from:"Investing.com 中文",
         nickName: "美股异动|波音737MAX客机恢复生产,盘前涨逾5%",
         reward: "Reuters.美股异动|波音(BA.US)737MAX客...",
         time:"5天前"
       },
       {
+        id:'9',
         from:"Investing.com 中文",
         nickName:"买入波音(BA.US)好时机?两个问题没解决之前劝你住手",
         reward:"今年迄今,美股航空板块受到公共卫生事件的冲击.....",
         time:"6天前"
       },
       { 
+        id:'10',
         from:"chinese.aljazeera.net",
         nickName: "波音裁员超1.2万人与警惕最坏时刻尚未到来",
         reward: "波音公司当地时间27日宣布,将在美国裁减超1...",
         time:"6天前"
       },
       {
+        id:'11',
         from:"Investing.com 中文",
         nickName: "美股异动|波音737MAX客机恢复生产,盘前涨逾5%",
         reward: "Reuters.美股异动|波音(BA.US)737MAX客...",
         time:"5天前"
       },
       {
+        id:'12',
         from:"Investing.com 中文",
         nickName:"买入波音(BA.US)好时机?两个问题没解决之前劝你住手",
         reward:"今年迄今,美股航空板块受到公共卫生事件的冲击.....",
         time:"6天前"
       },
       { 
+        id:'13',
         from:"chinese.aljazeera.net",
         nickName: "波音裁员超1.2万人与警惕最坏时刻尚未到来",
         reward: "波音公司当地时间27日宣布,将在美国裁减超1...",
         time:"6天前"
       },
       {
+        id:'14',
         from:"Investing.com 中文",
         nickName: "美股异动|波音737MAX客机恢复生产,盘前涨逾5%",
         reward: "Reuters.美股异动|波音(BA.US)737MAX客...",
@@ -176,6 +191,12 @@ Page({
     }) 
     this.computeScrollViewHeight();
    },
+  onFold:function(e){
+    console.log( e.currentTarget.dataset.id);
+    wx.navigateTo({
+      url:"../news/news"
+      });
+  },
   getUserInfo: function(e) {
     console.log(e)
     app.globalData.userInfo = e.detail.userInfo

+ 2 - 2
pages/index/index.wxml

@@ -35,8 +35,8 @@
     </swiper> -->
     <!-- <scroll-view scroll-y style='height:500rpx' class="tab"> -->
     <scroll-view scroll-y="true"  style='height: {{scrollHeight}}rpx' class="tab">
-            <block wx:for-index="idx" wx:for='{{aa}}' wx:key="key">
-            <view class='content-item' >
+            <block wx:for-index="idx" wx:for='{{aa}}' wx:key="key" >
+            <view class='content-item' bindtap="onFold" data-id="{{item.id}}" >
               <text class='from' >{{item.from}}</text>
               <text class='name'>{{item.nickName}}</text>
               <text class='wawa'>{{item.reward}}</text>

File diff suppressed because it is too large
+ 12 - 0
pages/news/news.js


+ 4 - 0
pages/news/news.json

@@ -0,0 +1,4 @@
+{ 
+  "navigationBarTitleText": "新闻详情",
+  "usingComponents": {}
+}

+ 21 - 0
pages/news/news.wxml

@@ -0,0 +1,21 @@
+<!--pages/news/news.wxml-->
+<view class="news-detail-container">
+  <!-- <image class="head-img" src="../{{ currentNews.image }}"></image> -->
+   <text class="title">{{ currentNews.title }}</text>
+   <view class="author-time">
+    <!-- <image class="author-avatar" src="../{{currentNews.icon}}"></image> -->
+    <text class="author-name">{{ currentNews.author }}</text>
+    <text class="const-text">发表于</text>
+    <text class="time">{{ currentNews.time }}</text>
+  </view>
+  <view class="horizon"></view>
+  <view class="tool">
+    <!-- <view class="circle-img">
+      <image src="../../../image/sch.png" ></image> 
+      <image src="../../../image/sc.png" ></image> 
+      <image class="share-img" src="../../../image/fx.png"></image>
+    </view> -->
+    <text class="detail">{{ currentNews.desc }}</text>
+  </view>
+</view>
+

+ 102 - 0
pages/news/news.wxss

@@ -0,0 +1,102 @@
+/* pages/news/news.wxss */
+.news-detail-container{
+  color:#fff;
+  display: flex;
+  flex-direction: column;
+}
+
+.head-img{
+  width: 100%;
+}
+
+.author-time{
+  flex-direction: row;
+  margin-left: 30rpx;
+  margin-top: 20rpx;
+}
+
+.author-avatar{
+  height: 64rpx;
+  width: 64rpx;
+  border-radius: 50%;
+  vertical-align: middle;
+}
+
+.author-name{
+  font-size: 30rpx;
+  font-weight: 700;
+  margin-left: 20rpx;
+  vertical-align: middle;
+  color:#666;
+}
+
+.const-text{
+  font-size: 24rpx;
+  /* color:#999; */
+  margin-left: 20rpx;
+}
+
+.time{
+  font-size: 24rpx;
+  margin-left: 30rpx;
+  vertical-align: middle;
+  color: #999;
+}
+
+.title{
+  margin-left: 40rpx;
+  font-size: 36rpx;
+  font-weight: 700;
+  margin-top: 30rpx;
+  letter-spacing: 2px;
+  /* color: #4b556c; */
+}
+
+.tool{
+  margin-top: 20rpx;
+  margin-left: 10rpx;
+}
+
+.circle-img{
+  float: right;
+  margin-right: 40rpx;
+  vertical-align: middle;
+}
+
+.circle-img image{
+  width: 50rpx;
+  height: 50rpx;
+}
+
+.share-img{
+  margin-left: 30rpx;
+}
+
+.horizon{
+  width: 660rpx;
+  height: 1px;
+  background-color: #e5e5e5;
+  vertical-align: middle;
+  /* position: relative;
+  top: 46rpx; */
+  margin: 0 auto;
+  /* z-index: -99; */
+}
+
+.detail{
+  /* color:#666; */
+  margin-top: 20rpx;
+  margin-right: 30rpx;
+  margin-left: 30rpx;
+  line-height: 44rpx;
+  letter-spacing: 2px;
+  font-size: 24rpx;
+  white-space:pre-wrap
+}
+
+.playermusic{
+  width: 60rpx;
+  height: 60rpx;
+  vertical-align: middle;
+  margin-left: 40rpx;
+}

Some files were not shown because too many files changed in this diff