lex 2 سال پیش
والد
کامیت
386ce3a37b
2فایلهای تغییر یافته به همراه69 افزوده شده و 1 حذف شده
  1. 39 0
      src/student/home/components/info-list/index.module.less
  2. 30 1
      src/student/home/components/info-list/index.tsx

+ 39 - 0
src/student/home/components/info-list/index.module.less

@@ -0,0 +1,39 @@
+.cellGroup {
+  padding: 10px 8px;
+  margin-top: 8px;
+
+  :global {
+    .van-cell {
+      padding: 0 0 16px;
+      &:last-child {
+        padding: 0;
+      }
+    }
+  }
+}
+
+.infoImg {
+  width: 104px;
+  height: 72px;
+  border-radius: 6px;
+  overflow: hidden;
+}
+
+.valueContent {
+  margin-left: 10px;
+  display: flex;
+  flex-direction: column;
+  justify-content: space-between;
+
+  h2 {
+    font-size: 14px;
+    font-weight: 400;
+    color: #333333;
+    line-height: 20px;
+  }
+  p {
+    font-size: 11px;
+    color: #999999;
+    line-height: 16px;
+  }
+}

+ 30 - 1
src/student/home/components/info-list/index.tsx

@@ -1,9 +1,38 @@
+import request from '@/helpers/request'
+import { Cell, CellGroup, Image } from 'vant'
 import { defineComponent } from 'vue'
 import styles from './index.module.less'
 
 export default defineComponent({
   name: 'info-list',
   setup() {
-    return () => <>资讯列表</>
+    const init = async () => {
+      try {
+        const res = await request.post('/api-cms/news/page', {
+          data: {}
+        })
+      } catch {
+        //
+      }
+    }
+    return () => (
+      <>
+        <CellGroup inset class={styles.cellGroup}>
+          <Cell valueClass={styles.valueContent}>
+            {{
+              icon: () => <Image src="" class={styles.infoImg} />,
+              value: () => (
+                <>
+                  <h2 class={'van-multi-ellipsis--l2'}>
+                    当偌当偌当偌当偌当偌当偌当偌当偌当偌当偌当偌当偌当偌当偌当偌当偌当偌当偌当偌当偌当偌当偌当偌当偌当偌当偌当偌当偌
+                  </h2>
+                  <p>10:36:49</p>
+                </>
+              )
+            }}
+          </Cell>
+        </CellGroup>
+      </>
+    )
   }
 })