xcx 4 år sedan
förälder
incheckning
6aad9bc471

+ 11
- 2
src/assets/css/iconfont.css
Filskillnaden har hållits tillbaka eftersom den är för stor
Visa fil


+ 18
- 6
src/assets/css/iconfont.less
Filskillnaden har hållits tillbaka eftersom den är för stor
Visa fil


+ 53
- 0
src/components/PrizeListItem/index.css Visa fil

@@ -0,0 +1,53 @@
1
+.PrizeListItem {
2
+  width: 100%;
3
+  position: relative;
4
+  overflow: hidden;
5
+  background: #fff;
6
+  border-radius: 12px;
7
+}
8
+.PrizeListItem > .Img {
9
+  width: 100%;
10
+  padding-bottom: 100%;
11
+  position: relative;
12
+  overflow: hidden;
13
+  background: #ccc;
14
+}
15
+.PrizeListItem > .Img > image {
16
+  width: 100%;
17
+  height: 100%;
18
+}
19
+.PrizeListItem > .Info {
20
+  padding: 10px;
21
+  position: relative;
22
+  overflow: hidden;
23
+}
24
+.PrizeListItem > .Info > text {
25
+  font-size: 28px;
26
+  color: #333;
27
+  line-height: 40px;
28
+  display: block;
29
+  font-weight: bold;
30
+  height: 80px;
31
+  overflow: hidden;
32
+  text-overflow: ellipsis;
33
+  display: -webkit-box;
34
+  -webkit-box-orient: vertical;
35
+  -webkit-line-clamp: 2;
36
+}
37
+.PrizeListItem > .Info > .flex-h {
38
+  align-items: center;
39
+}
40
+.PrizeListItem > .Info > .flex-h > text {
41
+  font-size: 24px;
42
+  color: #333;
43
+  line-height: 40px;
44
+}
45
+.PrizeListItem > .Info > .flex-h > text.Count {
46
+  color: #971C21;
47
+}
48
+.PrizeListItem > .Info > .flex-h > text.Num {
49
+  color: #FF2C28;
50
+}
51
+.PrizeListItem > .Info > .flex-h > text:last-child {
52
+  color: #999;
53
+}

+ 41
- 0
src/components/PrizeListItem/index.jsx Visa fil

@@ -0,0 +1,41 @@
1
+import React, { Component } from 'react'
2
+import '../../assets/css/reset.less'
3
+import '../../assets/css/iconfont.less'
4
+import './index.less'
5
+
6
+export default class PrizeListItem extends Component {
7
+
8
+  state = {
9
+    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'
10
+  }
11
+
12
+  componentWillMount () { }
13
+
14
+  componentDidMount () { }
15
+
16
+  componentWillUnmount () { }
17
+
18
+  componentDidShow () { }
19
+
20
+  componentDidHide () { }
21
+
22
+  render () {
23
+    const { TestImg } = this.state
24
+    return (
25
+      <view className='PrizeListItem'>
26
+        <view className='Img'>
27
+          <image mode='aspectFill' src={TestImg} className='centerLabel'></image>
28
+        </view>
29
+        <view className='Info'>
30
+          <text>沙发垫欧式轻奢</text>
31
+          <view className='flex-h'>
32
+            <text className='Count'>70</text>
33
+            <text className='flex-item'>人已兑换</text>
34
+            <text className='Num'>30000</text>
35
+            <text>积分</text>
36
+          </view>
37
+        </view>
38
+      </view >
39
+    )
40
+  }
41
+}

+ 62
- 0
src/components/PrizeListItem/index.less Visa fil

@@ -0,0 +1,62 @@
1
+.PrizeListItem {
2
+  width: 100%;
3
+  position: relative;
4
+  overflow: hidden;
5
+  background: #fff;
6
+  border-radius: 12px;
7
+
8
+  >.Img {
9
+    width: 100%;
10
+    padding-bottom: 100%;
11
+    position: relative;
12
+    overflow: hidden;
13
+    background: #ccc;
14
+
15
+    >image {
16
+      width: 100%;
17
+      height: 100%;
18
+    }
19
+  }
20
+
21
+  >.Info {
22
+    padding: 10px;
23
+    position: relative;
24
+    overflow: hidden;
25
+
26
+    >text {
27
+      font-size: 28px;
28
+      color: #333;
29
+      line-height: 40px;
30
+      display: block;
31
+      font-weight: bold;
32
+      height: 80px;
33
+      overflow: hidden;
34
+      text-overflow: ellipsis;
35
+      display: -webkit-box;
36
+      -webkit-box-orient: vertical;
37
+      -webkit-line-clamp: 2;
38
+    }
39
+
40
+    >.flex-h {
41
+      align-items: center;
42
+
43
+      >text {
44
+        font-size: 24px;
45
+        color: #333;
46
+        line-height: 40px;
47
+
48
+        &.Count {
49
+          color: #971C21;
50
+        }
51
+
52
+        &.Num {
53
+          color: #FF2C28;
54
+        }
55
+
56
+        &:last-child {
57
+          color: #999;
58
+        }
59
+      }
60
+    }
61
+  }
62
+}

+ 2
- 1
src/pages/FuLi/index.config.js Visa fil

@@ -1,3 +1,4 @@
1 1
 export default {
2
-  navigationBarTitleText: '首页'
2
+  navigationStyle: 'custom',
3
+  navigationBarTextStyle: 'white'
3 4
 }

+ 179
- 0
src/pages/FuLi/index.css Visa fil

@@ -0,0 +1,179 @@
1
+.FuLi {
2
+  width: 100%;
3
+  height: 100%;
4
+  position: relative;
5
+  overflow: hidden;
6
+  background: #f8f8f8;
7
+}
8
+.FuLi > .TopBg {
9
+  width: 100%;
10
+  position: relative;
11
+  overflow: hidden;
12
+  padding-bottom: 56.25%;
13
+  background-image: linear-gradient(#ff8d61, #F35844);
14
+}
15
+.FuLi > .TopBg > image {
16
+  width: 100%;
17
+  height: 100%;
18
+}
19
+.FuLi > .flex-item {
20
+  position: relative;
21
+  overflow: hidden;
22
+}
23
+.FuLi > .flex-item > view {
24
+  width: 100%;
25
+  height: 100%;
26
+  position: relative;
27
+  overflow: hidden;
28
+}
29
+.FuLi > .flex-item > view .FuLiContent {
30
+  position: relative;
31
+  overflow: hidden;
32
+}
33
+.FuLi > .flex-item > view .FuLiContent > .UserTab {
34
+  padding: 0 30px;
35
+  position: relative;
36
+  overflow: hidden;
37
+  margin-top: 30px;
38
+}
39
+.FuLi > .flex-item > view .FuLiContent > .UserTab > view {
40
+  padding: 20px;
41
+  position: relative;
42
+  overflow: hidden;
43
+  background: #fff;
44
+  border-radius: 24px;
45
+}
46
+.FuLi > .flex-item > view .FuLiContent > .UserTab > view > .Info {
47
+  align-items: center;
48
+}
49
+.FuLi > .flex-item > view .FuLiContent > .UserTab > view > .Info > .Icon {
50
+  width: 132px;
51
+  height: 132px;
52
+  background: #ccc;
53
+  border-radius: 100%;
54
+  position: relative;
55
+  overflow: hidden;
56
+  margin-right: 20px;
57
+}
58
+.FuLi > .flex-item > view .FuLiContent > .UserTab > view > .Info > .Icon > image {
59
+  width: 100%;
60
+  height: 100%;
61
+}
62
+.FuLi > .flex-item > view .FuLiContent > .UserTab > view > .Info > .flex-item {
63
+  position: relative;
64
+  overflow: hidden;
65
+}
66
+.FuLi > .flex-item > view .FuLiContent > .UserTab > view > .Info > .flex-item > text {
67
+  display: block;
68
+  font-size: 28px;
69
+  color: #666;
70
+  line-height: 40px;
71
+}
72
+.FuLi > .flex-item > view .FuLiContent > .UserTab > view > .Info > .flex-item > text:first-child {
73
+  font-size: 32px;
74
+  color: #333;
75
+  white-space: nowrap;
76
+  overflow: hidden;
77
+  text-overflow: ellipsis;
78
+  margin-bottom: 20px;
79
+}
80
+.FuLi > .flex-item > view .FuLiContent > .UserTab > view > .Info > text {
81
+  line-height: 48px;
82
+  font-size: 28px;
83
+  border: 2px solid rgba(243, 88, 68, 0.5);
84
+  border-radius: 8px;
85
+  padding: 0 10px;
86
+  color: rgba(243, 88, 68, 0.5);
87
+  margin-left: 20px;
88
+  margin-right: 20px;
89
+}
90
+.FuLi > .flex-item > view .FuLiContent > .UserTab > view > .Info > text.active {
91
+  color: #f35844;
92
+  border-color: #f35844;
93
+}
94
+.FuLi > .flex-item > view .FuLiContent > .UserTab > view > .Rule {
95
+  align-items: center;
96
+  border-top: 2px solid rgba(0, 0, 0, 0.08);
97
+  margin-top: 20px;
98
+  padding-top: 20px;
99
+}
100
+.FuLi > .flex-item > view .FuLiContent > .UserTab > view > .Rule > view {
101
+  overflow: hidden;
102
+  font-size: 0;
103
+  white-space: nowrap;
104
+  text-align: center;
105
+  position: relative;
106
+}
107
+.FuLi > .flex-item > view .FuLiContent > .UserTab > view > .Rule > view::after {
108
+  content: '';
109
+  display: block;
110
+  width: 2px;
111
+  position: absolute;
112
+  left: 0;
113
+  top: 50%;
114
+  transform: translateY(-50%);
115
+  -webkit-transform: translateY(-50%);
116
+  height: 50px;
117
+  background: rgba(0, 0, 0, 0.08);
118
+}
119
+.FuLi > .flex-item > view .FuLiContent > .UserTab > view > .Rule > view:first-child::after {
120
+  display: none;
121
+}
122
+.FuLi > .flex-item > view .FuLiContent > .UserTab > view > .Rule > view > text {
123
+  font-size: 28px;
124
+  color: #333;
125
+  line-height: 60px;
126
+  display: inline-block;
127
+  vertical-align: middle;
128
+}
129
+.FuLi > .flex-item > view .FuLiContent > .UserTab > view > .Rule > view > text.iconfont {
130
+  font-size: 46px;
131
+  color: #F35844;
132
+  margin-right: 20px;
133
+}
134
+.FuLi > .flex-item > view .FuLiContent > .SearchContainer {
135
+  padding: 0 30px;
136
+  position: relative;
137
+  overflow: hidden;
138
+  margin-top: 30px;
139
+}
140
+.FuLi > .flex-item > view .FuLiContent > .SearchContainer > view {
141
+  position: relative;
142
+  overflow: hidden;
143
+  background: #fff;
144
+  font-size: 0;
145
+  white-space: nowrap;
146
+  border-radius: 68px;
147
+  text-align: center;
148
+}
149
+.FuLi > .flex-item > view .FuLiContent > .SearchContainer > view > text {
150
+  font-size: 24px;
151
+  color: #666;
152
+  display: inline-block;
153
+  vertical-align: middle;
154
+  line-height: 68px;
155
+}
156
+.FuLi > .flex-item > view .FuLiContent > .SearchContainer > view > text:first-child {
157
+  margin-right: 10px;
158
+}
159
+.FuLi > .flex-item > view .FuLiContent > .SearchContainer > view > text.iconfont {
160
+  font-size: 36px;
161
+}
162
+.FuLi > .flex-item > view .FuLiContent > .PirzeList {
163
+  padding-right: 30px;
164
+  position: relative;
165
+  overflow: hidden;
166
+  font-size: 0;
167
+  padding-bottom: 30px;
168
+}
169
+.FuLi > .flex-item > view .FuLiContent > .PirzeList > view {
170
+  width: 50%;
171
+  display: inline-block;
172
+  vertical-align: middle;
173
+  margin-top: 30px;
174
+}
175
+.FuLi > .flex-item > view .FuLiContent > .PirzeList > view > view {
176
+  padding-left: 30px;
177
+  position: relative;
178
+  overflow: hidden;
179
+}

+ 91
- 5
src/pages/FuLi/index.jsx Visa fil

@@ -1,8 +1,17 @@
1 1
 import React, { Component } from 'react'
2
-import { View, Text } from '@tarojs/components'
2
+import NavHeader from '../../components/NavHeader/index'
3
+import PrizeListItem from '../../components/PrizeListItem/index'
4
+import '../../assets/css/reset.less'
5
+import '../../assets/css/iconfont.less'
3 6
 import './index.less'
4 7
 
5
-export default class Index extends Component {
8
+export default class FuLi extends Component {
9
+
10
+  state = {
11
+    PirzeList: ['', '', '', '', '', '', '', '', ''],
12
+    IsPull: false,
13
+    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'
14
+  }
6 15
 
7 16
   componentWillMount () { }
8 17
 
@@ -14,11 +23,88 @@ export default class Index extends Component {
14 23
 
15 24
   componentDidHide () { }
16 25
 
26
+  OnRefresh () {
27
+    this.setState({
28
+      IsPull: true
29
+    }, () => {
30
+      window.setTimeout(() => {
31
+        this.setState({
32
+          IsPull: false
33
+        })
34
+      }, 1000)
35
+    })
36
+  }
37
+
17 38
   render () {
39
+    const { IsPull, TestImg, PirzeList } = this.state
18 40
     return (
19
-      <View className='index'>
20
-        <Text>Hello world!</Text>
21
-      </View>
41
+      <view className='FuLi flex-v'>
42
+        <NavHeader BgColor='none' Title='福利' IsFixed={true}></NavHeader>
43
+
44
+        {/* 顶部背景图 */}
45
+        <view className='TopBg'>
46
+          {/* <image mode='aspectFill' src={TestImg} class='centerLabel'></image> */}
47
+        </view>
48
+
49
+        {/* 正文 */}
50
+        <view className='flex-item'>
51
+          <view>
52
+            <scroll-view scroll-y='true' style='height: 100%;' refresher-enabled={true} onrefresherrefresh={this.OnRefresh.bind(this)} refresher-triggered={IsPull} refresher-background='none'>
53
+              <view className='FuLiContent'>
54
+
55
+                {/* 用户面板 */}
56
+                <view className='UserTab'>
57
+                  <view>
58
+                    <view className='Info flex-h'>
59
+                      <view className='Icon'>
60
+                        <image mode='aspectFill' src={TestImg} class='centerLabel'></image>
61
+                      </view>
62
+                      <view className='flex-item'>
63
+                        <text>三十而已</text>
64
+                        <text>积分10</text>
65
+                      </view>
66
+                      <text className='active'>签到</text>
67
+                    </view>
68
+                    <view className='Rule flex-h'>
69
+                      <view className='flex-item'>
70
+                        <text className='iconfont iconjifen'></text>
71
+                        <text>积分规则</text>
72
+                      </view>
73
+                      <view className='flex-item'>
74
+                        <text className='iconfont iconjifenguize'></text>
75
+                        <text>积分明细</text>
76
+                      </view>
77
+                    </view>
78
+                  </view>
79
+                </view>
80
+
81
+                {/* 搜索框 */}
82
+                <view className='SearchContainer'>
83
+                  <view>
84
+                    <text className='iconfont iconsousuo'></text>
85
+                    <text>附近热搜:火锅</text>
86
+                  </view>
87
+                </view>
88
+
89
+                {/* 积分礼品列表 */}
90
+                <view className='PirzeList'>
91
+                  {
92
+                    PirzeList.map((item, index) => (
93
+                      <view key={`PirzeListItem-${index}`}>
94
+                        <view>
95
+                          <PrizeListItem></PrizeListItem>
96
+                        </view>
97
+                      </view>
98
+                    ))
99
+                  }
100
+                </view>
101
+
102
+              </view>
103
+            </scroll-view>
104
+          </view>
105
+        </view>
106
+
107
+      </view>
22 108
     )
23 109
   }
24 110
 }

+ 210
- 0
src/pages/FuLi/index.less Visa fil

@@ -0,0 +1,210 @@
1
+.FuLi {
2
+  width: 100%;
3
+  height: 100%;
4
+  position: relative;
5
+  overflow: hidden;
6
+  background: #f8f8f8;
7
+
8
+  >.TopBg {
9
+    width: 100%;
10
+    position: relative;
11
+    overflow: hidden;
12
+    padding-bottom: 56.25%;
13
+    background-image: linear-gradient(rgba(255, 141, 97, 1, 0.5), #F35844);
14
+
15
+    >image {
16
+      width: 100%;
17
+      height: 100%;
18
+    }
19
+  }
20
+
21
+  >.flex-item {
22
+    position: relative;
23
+    overflow: hidden;
24
+
25
+    >view {
26
+      width: 100%;
27
+      height: 100%;
28
+      position: relative;
29
+      overflow: hidden;
30
+
31
+      .FuLiContent {
32
+        position: relative;
33
+        overflow: hidden;
34
+
35
+        >.UserTab {
36
+          padding: 0 30px;
37
+          position: relative;
38
+          overflow: hidden;
39
+          margin-top: 30px;
40
+
41
+          >view {
42
+            padding: 20px;
43
+            position: relative;
44
+            overflow: hidden;
45
+            background: #fff;
46
+            border-radius: 24px;
47
+
48
+            >.Info {
49
+              align-items: center;
50
+
51
+              >.Icon {
52
+                width: 132px;
53
+                height: 132px;
54
+                background: #ccc;
55
+                border-radius: 100%;
56
+                position: relative;
57
+                overflow: hidden;
58
+                margin-right: 20px;
59
+
60
+                >image {
61
+                  width: 100%;
62
+                  height: 100%;
63
+                }
64
+              }
65
+
66
+              >.flex-item {
67
+                position: relative;
68
+                overflow: hidden;
69
+
70
+                >text {
71
+                  display: block;
72
+                  font-size: 28px;
73
+                  color: #666;
74
+                  line-height: 40px;
75
+
76
+                  &:first-child {
77
+                    font-size: 32px;
78
+                    color: #333;
79
+                    white-space: nowrap;
80
+                    overflow: hidden;
81
+                    text-overflow: ellipsis;
82
+                    margin-bottom: 20px;
83
+                  }
84
+                }
85
+              }
86
+
87
+              >text {
88
+                line-height: 48px;
89
+                font-size: 28px;
90
+                border: 2px solid rgba(243, 88, 68, 0.5);
91
+                border-radius: 8px;
92
+                padding: 0 10px;
93
+                color: rgba(243, 88, 68, 0.5);
94
+                margin-left: 20px;
95
+                margin-right: 20px;
96
+
97
+                &.active {
98
+                  color: rgba(243, 88, 68, 1);
99
+                  border-color: rgba(243, 88, 68, 1);
100
+                }
101
+              }
102
+            }
103
+
104
+            >.Rule {
105
+              align-items: center;
106
+              border-top: 2px solid rgba(0, 0, 0, 0.08);
107
+              margin-top: 20px;
108
+              padding-top: 20px;
109
+
110
+              >view {
111
+                position: relative;
112
+                overflow: hidden;
113
+                font-size: 0;
114
+                white-space: nowrap;
115
+                text-align: center;
116
+                position: relative;
117
+
118
+                &::after {
119
+                  content: '';
120
+                  display: block;
121
+                  width: 2px;
122
+                  position: absolute;
123
+                  left: 0;
124
+                  top: 50%;
125
+                  transform: translateY(-50%);
126
+                  -webkit-transform: translateY(-50%);
127
+                  height: 50px;
128
+                  background: rgba(0, 0, 0, 0.08);
129
+                }
130
+
131
+                &:first-child {
132
+                  &::after {
133
+                    display: none;
134
+                  }
135
+                }
136
+
137
+                >text {
138
+                  font-size: 28px;
139
+                  color: #333;
140
+                  line-height: 60px;
141
+                  display: inline-block;
142
+                  vertical-align: middle;
143
+
144
+                  &.iconfont {
145
+                    font-size: 46px;
146
+                    color: #F35844;
147
+                    margin-right: 20px;
148
+                  }
149
+                }
150
+              }
151
+            }
152
+          }
153
+        }
154
+
155
+        >.SearchContainer {
156
+          padding: 0 30px;
157
+          position: relative;
158
+          overflow: hidden;
159
+          margin-top: 30px;
160
+
161
+          >view {
162
+            position: relative;
163
+            overflow: hidden;
164
+            background: #fff;
165
+            font-size: 0;
166
+            white-space: nowrap;
167
+            border-radius: 68px;
168
+            text-align: center;
169
+
170
+            >text {
171
+              font-size: 24px;
172
+              color: #666;
173
+              display: inline-block;
174
+              vertical-align: middle;
175
+              line-height: 68px;
176
+
177
+              &:first-child {
178
+                margin-right: 10px;
179
+              }
180
+
181
+              &.iconfont {
182
+                font-size: 36px;
183
+              }
184
+            }
185
+          }
186
+        }
187
+
188
+        >.PirzeList {
189
+          padding-right: 30px;
190
+          position: relative;
191
+          overflow: hidden;
192
+          font-size: 0;
193
+          padding-bottom: 30px;
194
+
195
+          >view {
196
+            width: 50%;
197
+            display: inline-block;
198
+            vertical-align: middle;
199
+            margin-top: 30px;
200
+            >view {
201
+              padding-left: 30px;
202
+              position: relative;
203
+              overflow: hidden;
204
+            }
205
+          }
206
+        }
207
+      }
208
+    }
209
+  }
210
+}