瀏覽代碼

静态页面

1002884655 4 年之前
父節點
當前提交
e44d021f6b
共有 4 個檔案被更改,包括 69 行新增31 行删除
  1. 10
    10
      project.config.json
  2. 10
    15
      src/pages/Index/BookDetail/index.vue
  3. 43
    5
      src/pages/Index/BookDetail/page.scss
  4. 6
    1
      src/pages/Index/index.vue

+ 10
- 10
project.config.json 查看文件

@@ -5,22 +5,25 @@
5 5
 	"appid": "wx75ce0dc4b59e0458",
6 6
 	"setting": {
7 7
 		"urlCheck": false,
8
+		"scopeDataCheck": false,
9
+		"coverView": true,
8 10
 		"es6": false,
9
-		"enhance": false,
10 11
 		"postcss": false,
12
+		"compileHotReLoad": false,
11 13
 		"preloadBackgroundData": false,
12 14
 		"minified": false,
15
+		"autoAudits": false,
13 16
 		"newFeature": false,
14
-		"coverView": true,
17
+		"uglifyFileName": false,
18
+		"uploadWithSourceMap": true,
19
+		"useIsolateContext": true,
15 20
 		"nodeModules": false,
16
-		"autoAudits": false,
21
+		"enhance": false,
22
+		"useCompilerModule": false,
23
+		"userConfirmedUseCompilerModuleSwitch": false,
17 24
 		"showShadowRootInWxmlPanel": true,
18
-		"scopeDataCheck": false,
19
-		"uglifyFileName": false,
20 25
 		"checkInvalidKey": true,
21 26
 		"checkSiteMap": true,
22
-		"uploadWithSourceMap": true,
23
-		"compileHotReLoad": false,
24 27
 		"useMultiFrameRuntime": true,
25 28
 		"useApiHook": true,
26 29
 		"useApiHostProcess": false,
@@ -31,9 +34,6 @@
31 34
 		},
32 35
 		"enableEngineNative": false,
33 36
 		"bundle": false,
34
-		"useIsolateContext": true,
35
-		"useCompilerModule": false,
36
-		"userConfirmedUseCompilerModuleSwitch": false,
37 37
 		"userConfirmedBundleSwitch": false,
38 38
 		"packNpmManually": false,
39 39
 		"packNpmRelationList": [],

+ 10
- 15
src/pages/Index/BookDetail/index.vue 查看文件

@@ -8,6 +8,10 @@
8 8
 
9 9
             <!-- 封面内容 -->
10 10
             <view class="FrontInfo">
11
+              <view class="Like" @tap="TriggerSave">
12
+                <text class="iconfont iconshoucang1" :class="{'active': ArticleInfo.isSaved}"></text>
13
+                <!-- <text>收藏</text> -->
14
+              </view>
11 15
               <view class="Img">
12 16
                 <view>
13 17
                   <image mode="aspectFit" :src="ArticleInfo.poster" class="centerLabel"></image>
@@ -17,14 +21,14 @@
17 21
                 <view class="Tag">
18 22
                   <text class="iconfont iconbiaoqian"></text>
19 23
                   <text>分类:</text>
20
-                  <text v-for="(item, index) in (ArticleInfo.tags || [])" :key="index">{{item}}</text>
24
+                  <text class="active">{{ArticleInfo.typeName}}</text>
21 25
                 </view>
22 26
                 <view class="flex-h">
23
-                  <view class="flex-item flex-h">
27
+                  <view class="flex-item flex-h" style="flex: 3; -webkit-flex: 3;">
24 28
                     <text>名称:</text>
25 29
                     <text class="flex-item">{{ArticleInfo.name}}</text>
26 30
                   </view>
27
-                  <view class="flex-item flex-h">
31
+                  <view class="flex-item flex-h" style="flex: 1; -webkit-flex: 1;">
28 32
                     <text>阅读量:</text>
29 33
                     <text class="flex-item">{{ArticleInfo.answerNum}}</text>
30 34
                   </view>
@@ -40,7 +44,7 @@
40 44
                   </view>
41 45
                 </view>
42 46
                 <view class="Desc">
43
-                  <text>简介:{{ArticleInfo.summary}}</text>
47
+                  简介:<text>{{ArticleInfo.summary}}</text>
44 48
                 </view>
45 49
               </view>
46 50
 
@@ -61,7 +65,7 @@
61 65
         </view>
62 66
 
63 67
         <!-- 底部 -->
64
-        <view class="flex-h Bottom">
68
+        <!-- <view class="flex-h Bottom">
65 69
           <view class="Share" @tap="ShareArticle">
66 70
             <text class="iconfont iconfenxiang"></text>
67 71
             <text>分享</text>
@@ -74,16 +78,7 @@
74 78
           <view class="Answer">
75 79
             <navigator :url="`/pages/Index/BookAnswer/index?id=${ArticleInfo.postId}`" hover-class="none">去答题</navigator>
76 80
           </view>
77
-          <!-- <view class="ReadInfo">
78
-            <text>阅读时长:1小时22分钟22秒</text>
79
-            <view class="Progress flex-h">
80
-              <view class="flex-item">
81
-                <view :style="{width: '50%'}"></view>
82
-              </view>
83
-              <text>完成进度</text>
84
-            </view>
85
-          </view> -->
86
-        </view>
81
+        </view> -->
87 82
       </view>
88 83
     </MainPage>
89 84
   </view>

+ 43
- 5
src/pages/Index/BookDetail/page.scss 查看文件

@@ -17,8 +17,32 @@
17 17
       > .FrontInfo {
18 18
         position: relative;
19 19
         overflow: hidden;
20
+        > .Like {
21
+          display: inline-block;
22
+          position: absolute;
23
+          z-index: 2;
24
+          right: 30px;
25
+          top: 30px;
26
+          font-size: 0;
27
+          white-space: nowrap;
28
+          > text {
29
+            display: inline-block;
30
+            vertical-align: middle;
31
+            font-size: 28px;
32
+            color: #333;
33
+            &:first-child {
34
+              font-size: 48px;
35
+              color: #ccc;
36
+              &.active {
37
+                color: #f4c819;
38
+              }
39
+            }
40
+          }
41
+        }
20 42
         > .Img {
21 43
           padding: 30px 120px;
44
+          position: relative;
45
+          z-index: 1;
22 46
           > view {
23 47
             width: 100%;
24 48
             padding-bottom: 125%;
@@ -48,11 +72,20 @@
48 72
                 font-weight: normal;
49 73
                 font-size: 40px;
50 74
               }
75
+              &.active {
76
+                font-size: 24px;
77
+                line-height: 50px;
78
+                font-weight: normal;
79
+                background: #f4c819;
80
+                padding: 0 20px;
81
+                border-radius: 6px;
82
+              }
51 83
             }
52 84
           }
53 85
           > .flex-h {
54 86
             align-items: center;
55 87
             padding: 0 30px;
88
+            margin-top: 30px;
56 89
             > view {
57 90
               align-items: center;
58 91
               > text {
@@ -61,9 +94,12 @@
61 94
                 white-space: nowrap;
62 95
                 overflow: hidden;
63 96
                 text-overflow: ellipsis;
64
-                color: #999;
97
+                color: #333;
98
+                font-weight: bold;
65 99
                 &:first-child {
66 100
                   margin-right: 10px;
101
+                  color: #999;
102
+                  font-weight: normal;
67 103
                 }
68 104
               }
69 105
             }
@@ -72,12 +108,14 @@
72 108
             padding: 0 30px;
73 109
             position: relative;
74 110
             overflow: hidden;
111
+            margin-top: 30px;
112
+            font-size: 28px;
113
+            line-height: 60px;
114
+            color: #999;
75 115
             > text {
76
-              width: 100%;
77
-              display: block;
78 116
               font-size: 28px;
79
-              line-height: 40px;
80
-              color: #999;
117
+              line-height: 60px;
118
+              color: #333;
81 119
             }
82 120
           }
83 121
         }

+ 6
- 1
src/pages/Index/index.vue 查看文件

@@ -24,7 +24,7 @@
24 24
                   <view>
25 25
                     <swiper :indicator-dots="true" :autoplay="true" :interval="3000">
26 26
                       <swiper-item v-for="(item, index) in BannerList" :key="index">
27
-                        <view class="BannerItem">
27
+                        <view class="BannerItem" @tap="BannerClick(item)">
28 28
                           <image mode="aspectFill" :src="item.image" class="centerLabel"></image>
29 29
                         </view>
30 30
                       </swiper-item>
@@ -118,6 +118,11 @@ export default {
118 118
       'GetIndexHotList',
119 119
       'GetIndexNewestArticle'
120 120
     ]),
121
+    BannerClick (item) {
122
+      if (item.targetType === 'post') {
123
+        wx.navigateTo({ url: `/pages/Index/BookDetail/index?id=${item.targetId}` })
124
+      }
125
+    },
121 126
     UserInfoChange () {
122 127
       this.GetIndexBanner().then((res) => {
123 128
         this.BannerList = [...res.data.data]