1002884655 преди 4 години
родител
ревизия
ca4348f93b

+ 1
- 1
project.config.json Целия файл

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

+ 45
- 0
src/components/ActivityListItem/index.vue Целия файл

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 Целия файл

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
 <template>
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
   </view>
4
   </view>
5
 </template>
5
 </template>
6
 
6
 
15
     BgColor: {
15
     BgColor: {
16
       default: '#fff',
16
       default: '#fff',
17
       type: String
17
       type: String
18
+    },
19
+    Fixed: {
20
+      default: false,
21
+      type: Boolean
18
     }
22
     }
19
   },
23
   },
20
   data () {
24
   data () {
21
     return {
25
     return {
26
+      MarginTop: 0,
27
+      LineHeight: 0
22
     }
28
     }
23
   },
29
   },
24
   computed: {
30
   computed: {
26
   components: {
32
   components: {
27
   },
33
   },
28
   created () {
34
   created () {
35
+    this.MarginTop = wx.getMenuButtonBoundingClientRect().top
36
+    this.LineHeight = wx.getMenuButtonBoundingClientRect().height
29
   },
37
   },
30
   methods: {
38
   methods: {
31
     Init () {
39
     Init () {

+ 1
- 1
src/components/NavHeader/page.scss Целия файл

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

+ 2
- 1
src/pages/HuoDong/index.config.js Целия файл

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

+ 47
- 3
src/pages/HuoDong/index.vue Целия файл

1
 <template>
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
   </view>
26
   </view>
5
 </template>
27
 </template>
6
 
28
 
7
 <script>
29
 <script>
30
+import NavHeader from '../../components/NavHeader'
31
+import ActivityListItem from '../../components/ActivityListItem'
8
 import { createNamespacedHelpers } from 'vuex'
32
 import { createNamespacedHelpers } from 'vuex'
9
 const { mapState: mapUserState, mapActions: mapUserActions, mapMutations: mapUserMutations } = createNamespacedHelpers('user')
33
 const { mapState: mapUserState, mapActions: mapUserActions, mapMutations: mapUserMutations } = createNamespacedHelpers('user')
10
 export default {
34
 export default {
11
   name: 'HuoDong',
35
   name: 'HuoDong',
12
   data () {
36
   data () {
13
     return {
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
   computed: {
53
   computed: {
20
     })
56
     })
21
   },
57
   },
22
   components: {
58
   components: {
59
+    NavHeader,
60
+    ActivityListItem
23
   },
61
   },
24
   created () {
62
   created () {
25
   },
63
   },
29
     ...mapUserMutations([
67
     ...mapUserMutations([
30
     ]),
68
     ]),
31
     Init () {
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
 .page.HuoDong {
1
 .page.HuoDong {
2
   width: 100%;
2
   width: 100%;
3
   height: 100%;
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
 export default {
1
 export default {
2
-  navigationBarTitleText: '香颂蔚澜',
3
   navigationStyle: 'custom',
2
   navigationStyle: 'custom',
4
   navigationBarTextStyle: 'white'
3
   navigationBarTextStyle: 'white'
5
 }
4
 }

+ 13
- 2
src/pages/ShouYe/index.vue Целия файл

2
   <view class="page ShouYe flex-v">
2
   <view class="page ShouYe flex-v">
3
     <NavHeader Title="首页" BgColor="#f35844"></NavHeader>
3
     <NavHeader Title="首页" BgColor="#f35844"></NavHeader>
4
     <view class="flex-item">
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
       <view class="PageContainer">
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
           <view class="Content">
13
           <view class="Content">
8
 
14
 
9
             <view class="TopBg"></view>
15
             <view class="TopBg"></view>
17
                 <view>
23
                 <view>
18
                   <view>
24
                   <view>
19
                     <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)">
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
                         <view class="BannerItem">
27
                         <view class="BannerItem">
22
                           <image mode="aspectFill" :src="item.img"></image>
28
                           <image mode="aspectFill" :src="item.img"></image>
23
                         </view>
29
                         </view>
107
   name: 'ShouYe',
113
   name: 'ShouYe',
108
   data () {
114
   data () {
109
     return {
115
     return {
116
+      ShowAdvLayer: false,
110
       IsPull: false,
117
       IsPull: false,
111
       NewsList: [
118
       NewsList: [
112
         { 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: '描述' },
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
   },
153
   },
147
   created () {
154
   created () {
148
   },
155
   },
156
+  mounted(){
157
+    this.$nextTick(() => {
158
+    })
159
+  },
149
   methods: {
160
   methods: {
150
     ...mapUserActions([
161
     ...mapUserActions([
151
     ]),
162
     ]),

+ 38
- 0
src/pages/ShouYe/page.scss Целия файл

6
   > view {
6
   > view {
7
     position: relative;
7
     position: relative;
8
     &.flex-item {
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
       > .PageContainer {
44
       > .PageContainer {
10
         width: 100%;
45
         width: 100%;
11
         position: relative;
46
         position: relative;
12
         z-index: 2;
47
         z-index: 2;
13
         height: 100%;
48
         height: 100%;
14
         overflow: hidden;
49
         overflow: hidden;
50
+        z-index: 1;
15
         .Content {
51
         .Content {
16
           position: relative;
52
           position: relative;
17
           overflow: hidden;
53
           overflow: hidden;
61
                     height: 100%;
97
                     height: 100%;
62
                     position: relative;
98
                     position: relative;
63
                     overflow: hidden;
99
                     overflow: hidden;
100
+                    border-radius: 24px;
64
                     .BannerItem {
101
                     .BannerItem {
65
                       width: 100%;
102
                       width: 100%;
66
                       height: 100%;
103
                       height: 100%;
67
                       position: relative;
104
                       position: relative;
68
                       overflow: hidden;
105
                       overflow: hidden;
106
+                      border-radius: 24px;
69
                       > image {
107
                       > image {
70
                         width: 100%;
108
                         width: 100%;
71
                         height: 100%;
109
                         height: 100%;