tanyanfei 4 年之前
父節點
當前提交
db1a5488ea
共有 5 個文件被更改,包括 111 次插入5 次删除
  1. 6 1
      pages/actDetail/actDetail.js
  2. 32 2
      pages/number/number.js
  3. 17 0
      pages/number/number.wxml
  4. 54 0
      pages/number/number.wxss
  5. 2 2
      pages/wenzhang/wenzhang.wxml

+ 6 - 1
pages/actDetail/actDetail.js

@@ -137,6 +137,11 @@ Page({
    * 用户点击右上角分享
    */
   onShareAppMessage: function () {
-      console.log(233)
+      wx.request({
+        url: host+'/api/article/forward',
+        data:{
+          id:this.data.id
+        }
+      })
   }
 })

+ 32 - 2
pages/number/number.js

@@ -17,7 +17,8 @@ Page({
     },
     page:0,
     casci:0,
-    act:0
+    act:0,
+    list:[]
   },
 
   /**
@@ -66,8 +67,37 @@ Page({
 
       }
     })
-
+    this.getData(options.id)
   },
+  getData: function (id) {
+    wx.showNavigationBarLoading()
+    const _list = this.data.list;
+    var index = this.data.index;
+    wx.request({
+      url: host + '/api/article/list',
+      method: 'GET',
+      data: {
+        journal_id:id,
+        page_size:9999
+        // order_by: this.data.val[index],
+        // keyword: this.data.keyword,
+        // page: this.data.page
+      },
+      success: res => {
+        wx.hideNavigationBarLoading()
+        if (res.data.code == 0) {
+          const list = res.data.data.list;
+          for (let i = 0; i < list.length; i++) {
+            _list.push(list[i])
+          }
+          this.setData({
+            list: _list,
+            total: res.data.data.total
+          })
+        }
+      }
+    })
+  }, 
   checkpage:function(e){
     this.setData({
       act: e.target.dataset.id

+ 17 - 0
pages/number/number.wxml

@@ -97,4 +97,21 @@
           </ec-canvas>
         </view>
     </view>
+    <view wx:if='{{act == 2}}' style="padding:0 30rpx;">
+        <navigator url="../actDetail/actDetail?id={{item.id}}" class="list" wx:for='{{list}}'>
+              <image   src="{{item.img}}"></image>
+              <view>
+                  <view class="_title">{{item.name}}</view>
+                  <view class="ly"> 
+                              <view>
+                                  <text>{{item.publish_time}}</text>
+                              </view>
+                              <text>作者:{{item.author}}</text>
+                              <text></text> 
+                  </view>
+                  <text class="">{{item.desc}}</text>
+              </view>
+        </navigator>
+        <view wx:if='{{list.length<=0}}' style="color:#999;margin:100rpx 0;text-align:center;">暂无资源!</view>
+    </view>
 </view>

+ 54 - 0
pages/number/number.wxss

@@ -148,4 +148,58 @@ swiper{
 .today1 image{
   width: 20rpx;
   height: 20rpx;
+}
+
+
+.list{
+  /* box-shadow: 0px 2rpx 9rpx 0px rgba(0, 0, 0, 0.2); */
+  /* border-radius: 20rpx; */
+  display: flex;
+  /* padding: 20rpx; */
+  /* box-shadow: 0 0 15rpx 0px rgba(0, 0, 0, 0.2); */
+  /* margin: 0 20rpx 40rpx; */
+  border-bottom: 1px solid #F0F0F0;
+  padding: 28rpx 0;
+  
+}
+.list image{
+  width: 25%;
+  height: 210rpx;
+}
+.list>view{
+  width: 75%;
+  padding-left: 20rpx;
+  vertical-align: middle;
+}
+.list ._title{
+  margin-bottom: 20rpx;
+  text-overflow: ellipsis;
+  overflow: hidden;
+  white-space: nowrap;
+}
+.list text{
+  color: #999;
+  display: block;
+  overflow: hidden;
+    text-overflow: ellipsis;
+    display: -webkit-box;
+    -webkit-line-clamp: 2;
+    -webkit-box-orient: vertical;
+    white-space: normal;
+  font-size: 26rpx;
+}
+.ly{
+  margin-bottom: 20rpx;
+}
+.ly text{
+  display: block;
+  color: #666;
+  font-size: 22rpx;
+}
+.ly view{
+  float: right;
+  text-align: right;
+}
+.ly view text{
+  font-size: 18rpx;
 }

+ 2 - 2
pages/wenzhang/wenzhang.wxml

@@ -4,14 +4,14 @@
 </view>
 
 <scroll-view wx:if='{{list.length>0}}' scroll-y="true" scroll-into-view="{{scroll}}" class="content"  bindscrolltolower='next'>
-          <navigator url="../actDetail/actDetail?id={{item.id}}" class="list" wx:for='{{list}}' wx:key="journals{{index}}">
+          <navigator url="../actDetail/actDetail?id={{item.id}}" class="list" wx:for='{{list}}'>
               <image   src="{{item.img}}"></image>
               <view>
                   <view class="title"> <rich-text nodes="{{item.name}}"></rich-text></view>
 
                   <view class="ly"> 
                               <view>
-                                  <text>2018.5.28</text>
+                                  <text>{{item.publish_time}}</text>
                               </view>
                               <text>作者:{{item.author}}</text>
                               <text></text>