zs 2 years ago
parent
commit
a793b06645
7 changed files with 204 additions and 6 deletions
  1. 1 1
      pages/home/index.less
  2. 1 1
      pages/home/index.wxss
  3. 34 0
      pages/news/index.js
  4. 2 1
      pages/news/index.json
  5. 76 1
      pages/news/index.less
  6. 26 1
      pages/news/index.wxml
  7. 64 1
      pages/news/index.wxss

+ 1 - 1
pages/home/index.less

@@ -59,7 +59,7 @@
                     }
 
                     .content {
-                        padding-left: 10px;
+                        padding: 5px;
 
                         .name {
                             font-size: 14px;

+ 1 - 1
pages/home/index.wxss

@@ -53,7 +53,7 @@
   border-radius: 5px;
 }
 .main .thr .scroll-view .list-scroll-view .list .content {
-  padding-left: 10px;
+  padding: 5px;
 }
 .main .thr .scroll-view .list-scroll-view .list .content .name {
   font-size: 14px;

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


+ 2 - 1
pages/news/index.json

@@ -1,6 +1,7 @@
 {
   "component": true,
   "usingComponents": {
-    "mobile-main": "/commpents/mobile-frame/index"
+    "mobile-main": "/commpents/mobile-frame/index",
+    "e-tabs": "/commpents/tabs/index"
   }
 }

+ 76 - 1
pages/news/index.less

@@ -1,4 +1,79 @@
 .main {
     height: 80.8vh;
-    background-color: #ff0000;
+
+    .one {
+        width: 100%;
+    }
+
+    .two {
+        width: 100%;
+        margin-top: 2px;
+    }
+
+    .thr {
+        width: 96vw;
+        flex-grow: 1;
+        position: relative;
+        background-color: #ffffff;
+
+        .scroll-view {
+            position: absolute;
+            top: 0;
+            left: 0;
+            right: 0;
+            bottom: 0;
+
+            .list-scroll-view {
+                display: flex;
+                flex-wrap: wrap;
+                align-content: flex-start;
+                justify-content: space-between;
+
+                .list {
+                    display: flex;
+                    width: 96vw;
+                    margin: 10px 0;
+                    border-bottom: 0.1px solid #D1CFCF;
+
+                    .image {
+                        display: flex;
+                        justify-content: center;
+                        align-items: center;
+                        width: 30vw;
+
+                        image {
+                            width: 20vw;
+                            height: 20vw;
+                            border-radius: 5px;
+                        }
+                    }
+
+                    .content {
+                        padding: 5px;
+
+                        .name {
+                            font-size: 14px;
+                            font-weight: bold;
+                            padding: 2px 0;
+                            list-style: disc;
+                        }
+
+                        .title {
+                            font-size: 12px;
+                            color: #666;
+                            padding: 2px 0;
+                            display: -webkit-box;
+                            overflow: hidden;
+                            -webkit-line-clamp: 3;
+                            -webkit-box-orient: vertical;
+
+                            text {
+                                padding: 0 10px;
+                            }
+                        }
+                    }
+                }
+            }
+        }
+    }
 }

+ 26 - 1
pages/news/index.wxml

@@ -1,5 +1,30 @@
 <mobile-main frameStyle="{{frameStyle}}" bind:back="back" bind:tabPath="tabPath">
     <view slot="info" class="container main">
-        资讯
+        <view class="one">
+            <e-tabs tabs="{{tabs}}" bind:tabsChange="tabsChange"></e-tabs>
+        </view>
+        <view class="two">
+            <van-search value="{{ searchInfo.name }}" input-align="center" bind:search="onSearch" placeholder="请输入咨询标题" />
+        </view>
+        <view class="thr">
+            <scroll-view scroll-y="true" class="scroll-view">
+                <view class="list-scroll-view">
+                    <view wx:if="{{tabs.active=='a'}}" class="a">
+                        <view class="list" wx:for="{{list}}" wx:key="item">
+                            <view class="content">
+                                <view class="name">
+                                    <van-icon name="stop" size="10px" />{{item.name}}
+                                </view>
+                                <view class="title">{{item.content}}</view>
+                                <view class="title">{{item.status=='0'?'其他':'原创'}}<text>来源:{{item.source}}</text></view>
+                            </view>
+                            <view class="image" wx:if="{{item.src}}">
+                                <image src="{{item.src}}"></image>
+                            </view>
+                        </view>
+                    </view>
+                </view>
+            </scroll-view>
+        </view>
     </view>
 </mobile-main>

+ 64 - 1
pages/news/index.wxss

@@ -1,4 +1,67 @@
 .main {
   height: 80.8vh;
-  background-color: #ff0000;
+}
+.main .one {
+  width: 100%;
+}
+.main .two {
+  width: 100%;
+  margin-top: 2px;
+}
+.main .thr {
+  width: 96vw;
+  flex-grow: 1;
+  position: relative;
+  background-color: #ffffff;
+}
+.main .thr .scroll-view {
+  position: absolute;
+  top: 0;
+  left: 0;
+  right: 0;
+  bottom: 0;
+}
+.main .thr .scroll-view .list-scroll-view {
+  display: flex;
+  flex-wrap: wrap;
+  align-content: flex-start;
+  justify-content: space-between;
+}
+.main .thr .scroll-view .list-scroll-view .list {
+  display: flex;
+  width: 96vw;
+  margin: 10px 0;
+  border-bottom: 0.1px solid #D1CFCF;
+}
+.main .thr .scroll-view .list-scroll-view .list .image {
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  width: 30vw;
+}
+.main .thr .scroll-view .list-scroll-view .list .image image {
+  width: 20vw;
+  height: 20vw;
+  border-radius: 5px;
+}
+.main .thr .scroll-view .list-scroll-view .list .content {
+  padding: 5px;
+}
+.main .thr .scroll-view .list-scroll-view .list .content .name {
+  font-size: 14px;
+  font-weight: bold;
+  padding: 2px 0;
+  list-style: disc;
+}
+.main .thr .scroll-view .list-scroll-view .list .content .title {
+  font-size: 12px;
+  color: #666;
+  padding: 2px 0;
+  display: -webkit-box;
+  overflow: hidden;
+  -webkit-line-clamp: 3;
+  -webkit-box-orient: vertical;
+}
+.main .thr .scroll-view .list-scroll-view .list .content .title text {
+  padding: 0 10px;
 }