瀏覽代碼

静态页面

1002884655 4 年之前
父節點
當前提交
ca4348f93b

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

@@ -27,7 +27,7 @@
27 27
 			"outputPath": ""
28 28
 		},
29 29
 		"useIsolateContext": true,
30
-		"useCompilerModule": false,
30
+		"useCompilerModule": true,
31 31
 		"userConfirmedUseCompilerModuleSwitch": false
32 32
 	},
33 33
 	"compileType": "miniprogram",

+ 45
- 0
src/components/ActivityListItem/index.vue 查看文件

@@ -0,0 +1,45 @@
1
+<template>
2
+  <view class="ActivityListItem">
3
+    <view class="Img">
4
+
5
+    </view>
6
+    <view class="Info flex-h">
7
+      <view class="flex-item">
8
+        <text>核销拼团</text>
9
+        <text>参与截止时间:2019年10月20日 10:00:00</text>
10
+      </view>
11
+      <text>未开始</text>
12
+    </view>
13
+  </view>
14
+</template>
15
+
16
+<script>
17
+export default {
18
+  name: 'ActivityListItem',
19
+  props: {
20
+    Data: {
21
+      default: null,
22
+      type: Object
23
+    }
24
+  },
25
+  data () {
26
+    return {
27
+      TestImg: 'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1606120989360&di=8610f1678b51e26de6d4c6af39d1cf63&imgtype=0&src=http%3A%2F%2Fattachments.gfan.com%2Fforum%2F201503%2F19%2F211608ztcq7higicydxhsy.jpg'
28
+    }
29
+  },
30
+  computed: {
31
+  },
32
+  components: {
33
+  },
34
+  created () {
35
+  },
36
+  methods: {
37
+    Init () {
38
+    }
39
+  }
40
+}
41
+</script>
42
+
43
+<style lang="scss">
44
+@import "page.scss";
45
+</style>

+ 12
- 0
src/components/ActivityListItem/page.scss 查看文件

@@ -0,0 +1,12 @@
1
+.ActivityListItem {
2
+  width: 100%;
3
+  position: relative;
4
+  overflow: hidden;
5
+  > .Img {
6
+    width: 100%;
7
+    padding-bottom: 56.25%;
8
+    position: relative;
9
+    overflow: hidden;
10
+    background: #ccc;
11
+  }
12
+}

+ 10
- 2
src/components/NavHeader/index.vue 查看文件

@@ -1,6 +1,6 @@
1 1
 <template>
2
-  <view class="NavHeader" :style="{background: BgColor}">
3
-    <text>{{Title}}</text>
2
+  <view class="NavHeader" :style="{background: BgColor, position: Fixed ? 'absolute' : 'relative'}">
3
+    <text :style="{marginTop: `${MarginTop}px`, lineHeight: `${LineHeight}px`}">{{Title}}</text>
4 4
   </view>
5 5
 </template>
6 6
 
@@ -15,10 +15,16 @@ export default {
15 15
     BgColor: {
16 16
       default: '#fff',
17 17
       type: String
18
+    },
19
+    Fixed: {
20
+      default: false,
21
+      type: Boolean
18 22
     }
19 23
   },
20 24
   data () {
21 25
     return {
26
+      MarginTop: 0,
27
+      LineHeight: 0
22 28
     }
23 29
   },
24 30
   computed: {
@@ -26,6 +32,8 @@ export default {
26 32
   components: {
27 33
   },
28 34
   created () {
35
+    this.MarginTop = wx.getMenuButtonBoundingClientRect().top
36
+    this.LineHeight = wx.getMenuButtonBoundingClientRect().height
29 37
   },
30 38
   methods: {
31 39
     Init () {

+ 1
- 1
src/components/NavHeader/page.scss 查看文件

@@ -2,12 +2,12 @@
2 2
   width: 100%;
3 3
   position: relative;
4 4
   overflow: hidden;
5
+  z-index: 2;
5 6
   > text {
6 7
     display: block;
7 8
     font-size: 32px;
8 9
     color: #fff;
9 10
     text-indent: 30px;
10
-    margin-top: 60px;
11 11
     padding-bottom: 20px;
12 12
   }
13 13
 }

+ 2
- 1
src/pages/HuoDong/index.config.js 查看文件

@@ -1,3 +1,4 @@
1 1
 export default {
2
-  navigationBarTitleText: '香颂蔚澜'
2
+  navigationStyle: 'custom',
3
+  navigationBarTextStyle: 'white'
3 4
 }

+ 47
- 3
src/pages/HuoDong/index.vue 查看文件

@@ -1,17 +1,53 @@
1 1
 <template>
2
-  <view class="page HuoDong">
3
-    活动
2
+  <view class="page HuoDong flex-v">
3
+    <view class="TopNav">
4
+      <view>
5
+        <text v-for="(item, index) in NavList" :key="index" :class="{'active': item.id - 0 === CurrentNavId - 0}">{{item.name}}</text>
6
+      </view>
7
+    </view>
8
+    <NavHeader Title="活动" BgColor="none" :Fixed="true"></NavHeader>
9
+    <view class="flex-item">
10
+      <scroll-view scroll-y="true" style="height: 100%;" :refresher-enabled="true" @refresherrefresh="OnRefresh" :refresher-triggered="IsPull" refresher-background="none">
11
+
12
+        <!-- 活动 -->
13
+        <view class="Content Activity" v-if="CurrentNavId === 1">
14
+          <view v-for="(item, index) in 10" :key="index" class="ListItem">
15
+            <ActivityListItem :Data="null"></ActivityListItem>
16
+          </view>
17
+        </view>
18
+
19
+        <!-- 资讯 -->
20
+        <view class="Content News" v-if="CurrentNavId === 2">
21
+
22
+        </view>
23
+
24
+      </scroll-view>
25
+    </view>
4 26
   </view>
5 27
 </template>
6 28
 
7 29
 <script>
30
+import NavHeader from '../../components/NavHeader'
31
+import ActivityListItem from '../../components/ActivityListItem'
8 32
 import { createNamespacedHelpers } from 'vuex'
9 33
 const { mapState: mapUserState, mapActions: mapUserActions, mapMutations: mapUserMutations } = createNamespacedHelpers('user')
10 34
 export default {
11 35
   name: 'HuoDong',
12 36
   data () {
13 37
     return {
14
-      DataLock: false
38
+      NavList: [
39
+        { name: '活动', id: 1 },
40
+        { name: '资讯', id: 2 }
41
+      ],
42
+      CurrentNavId: 1,
43
+      IsPull: false,
44
+      DataLock: false,
45
+      PageList: [],
46
+      PageData: {
47
+        pageNum: 1,
48
+        pageSize: 10
49
+      },
50
+      HasNextPage: true
15 51
     }
16 52
   },
17 53
   computed: {
@@ -20,6 +56,8 @@ export default {
20 56
     })
21 57
   },
22 58
   components: {
59
+    NavHeader,
60
+    ActivityListItem
23 61
   },
24 62
   created () {
25 63
   },
@@ -29,6 +67,12 @@ export default {
29 67
     ...mapUserMutations([
30 68
     ]),
31 69
     Init () {
70
+    },
71
+    OnRefresh (e) {
72
+      this.IsPull = true
73
+      window.setTimeout(() => {
74
+        this.IsPull = false
75
+      }, 1000)
32 76
     }
33 77
   }
34 78
 }

+ 65
- 2
src/pages/HuoDong/page.scss 查看文件

@@ -1,6 +1,69 @@
1 1
 .page.HuoDong {
2 2
   width: 100%;
3 3
   height: 100%;
4
-  overflow-y: scroll;
5
-  background: #fff;
4
+  overflow: hidden;
5
+  background: #f8f8f8;
6
+  > .TopNav {
7
+    width: 100%;
8
+    padding-bottom: 35%;
9
+    background-image: linear-gradient(#f35844, #ff8d61);
10
+    position: relative;
11
+    z-index: 1;
12
+    > view {
13
+      width: 100%;
14
+      font-size: 0;
15
+      white-space: nowrap;
16
+      text-align: center;
17
+      position: absolute;
18
+      left: 0;
19
+      bottom: 0;
20
+      > text {
21
+        display: inline-block;
22
+        vertical-align: middle;
23
+        font-size: 32px;
24
+        color: #fff;
25
+        margin-left: 160px;
26
+        position: relative;
27
+        padding: 0 30px;
28
+        padding-bottom: 20px;
29
+        &:first-child {
30
+          margin-left: 0;
31
+        }
32
+        &.active {
33
+          color: #333;
34
+          line-height: 60px;
35
+          font-weight: bold;
36
+          &::after {
37
+            content: "";
38
+            display: block;
39
+            position: absolute;
40
+            left: 0;
41
+            bottom: 0;
42
+            height: 2px;
43
+            background: #000;
44
+            width: 100%;
45
+          }
46
+        }
47
+      }
48
+    }
49
+  }
50
+  > .flex-item {
51
+    position: relative;
52
+    overflow: hidden;
53
+    .Content {
54
+      position: relative;
55
+      overflow: hidden;
56
+      &.Activity {
57
+        padding: 0 30px;
58
+        > .ListItem {
59
+          width: 100%;
60
+          position: relative;
61
+          overflow: hidden;
62
+          background: #fff;
63
+          border-radius: 12px;
64
+          margin-top: 30px;
65
+        }
66
+      }
67
+    }
68
+  }
6 69
 }

+ 0
- 1
src/pages/ShouYe/index.config.js 查看文件

@@ -1,5 +1,4 @@
1 1
 export default {
2
-  navigationBarTitleText: '香颂蔚澜',
3 2
   navigationStyle: 'custom',
4 3
   navigationBarTextStyle: 'white'
5 4
 }

+ 13
- 2
src/pages/ShouYe/index.vue 查看文件

@@ -2,8 +2,14 @@
2 2
   <view class="page ShouYe flex-v">
3 3
     <NavHeader Title="首页" BgColor="#f35844"></NavHeader>
4 4
     <view class="flex-item">
5
+      <view class="AdvLayer" v-show="ShowAdvLayer">
6
+        <view class="centerLabel">
7
+          <image mode="aspectFit" :src="TestImg"></image>
8
+          <text class="iconfont iconguanbi" @tap="ShowAdvLayer = false"></text>
9
+        </view>
10
+      </view>
5 11
       <view class="PageContainer">
6
-        <scroll-view scroll-y="true" style="height: 100%;" :refresher-enabled="true" @refresherrefresh="OnRefresh" :refresher-triggered="IsPull" refresher-background="none">
12
+        <scroll-view scroll-y="true" style="height: 100%;" :refresher-enabled="true" @refresherrefresh="OnRefresh" :refresher-triggered="IsPull" refresher-background="none" refresher-default-style="black">
7 13
           <view class="Content">
8 14
 
9 15
             <view class="TopBg"></view>
@@ -17,7 +23,7 @@
17 23
                 <view>
18 24
                   <view>
19 25
                     <swiper class="BannerSwiper" :autoplay="true" :circular="true" :indicator-dots="true" indicator-color="rgba(0,0,0,0.4)" indicator-active-color="rgba(255,255,255,0.8)">
20
-                      <swiper-item v-for="(item, index) in BannerList" :key="index">
26
+                      <swiper-item class="SwiperItem" v-for="(item, index) in BannerList" :key="index">
21 27
                         <view class="BannerItem">
22 28
                           <image mode="aspectFill" :src="item.img"></image>
23 29
                         </view>
@@ -107,6 +113,7 @@ export default {
107 113
   name: 'ShouYe',
108 114
   data () {
109 115
     return {
116
+      ShowAdvLayer: false,
110 117
       IsPull: false,
111 118
       NewsList: [
112 119
         { img: 'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1606120989360&di=8610f1678b51e26de6d4c6af39d1cf63&imgtype=0&src=http%3A%2F%2Fattachments.gfan.com%2Fforum%2F201503%2F19%2F211608ztcq7higicydxhsy.jpg', title: '标题', desc: '描述' },
@@ -146,6 +153,10 @@ export default {
146 153
   },
147 154
   created () {
148 155
   },
156
+  mounted(){
157
+    this.$nextTick(() => {
158
+    })
159
+  },
149 160
   methods: {
150 161
     ...mapUserActions([
151 162
     ]),

+ 38
- 0
src/pages/ShouYe/page.scss 查看文件

@@ -6,12 +6,48 @@
6 6
   > view {
7 7
     position: relative;
8 8
     &.flex-item {
9
+      position: relative;
10
+      overflow: hidden;
11
+      > .AdvLayer {
12
+        width: 100%;
13
+        position: absolute;
14
+        left: 0;
15
+        top: 0;
16
+        bottom: 0;
17
+        z-index: 2;
18
+        background: rgba(0, 0, 0, 0.8);
19
+        > view {
20
+          width: 100%;
21
+          height: 100vw;
22
+          overflow: visible;
23
+          > image {
24
+            width: 60%;
25
+            height: 60%;
26
+            position: relative;
27
+            z-index: 1;
28
+            margin: 0 auto;
29
+            display: block;
30
+          }
31
+          >text {
32
+            display: inline-block;
33
+            color: #fff;
34
+            font-size: 60px;
35
+            position: absolute;
36
+            left: 50%;
37
+            bottom: -30px;
38
+            transform: translateX(-50%);
39
+            -webkit-transform: translateX(-50%);
40
+            z-index: 2;
41
+          }
42
+        }
43
+      }
9 44
       > .PageContainer {
10 45
         width: 100%;
11 46
         position: relative;
12 47
         z-index: 2;
13 48
         height: 100%;
14 49
         overflow: hidden;
50
+        z-index: 1;
15 51
         .Content {
16 52
           position: relative;
17 53
           overflow: hidden;
@@ -61,11 +97,13 @@
61 97
                     height: 100%;
62 98
                     position: relative;
63 99
                     overflow: hidden;
100
+                    border-radius: 24px;
64 101
                     .BannerItem {
65 102
                       width: 100%;
66 103
                       height: 100%;
67 104
                       position: relative;
68 105
                       overflow: hidden;
106
+                      border-radius: 24px;
69 107
                       > image {
70 108
                         width: 100%;
71 109
                         height: 100%;