正在显示
10 个修改的文件
包含
137 行增加
和
22 行删除
@@ -22,7 +22,7 @@ Page({ | @@ -22,7 +22,7 @@ Page({ | ||
22 | noMore:!1, | 22 | noMore:!1, |
23 | imgUrls: [], | 23 | imgUrls: [], |
24 | indicatorDots: false, | 24 | indicatorDots: false, |
25 | - autoplay: false, | 25 | + autoplay: true, |
26 | interval: 2000, | 26 | interval: 2000, |
27 | duration: 1000, | 27 | duration: 1000, |
28 | currentSwiper: 0, | 28 | currentSwiper: 0, |
@@ -46,6 +46,26 @@ Page({ | @@ -46,6 +46,26 @@ Page({ | ||
46 | }), this.policyType(), this.getBanner(); | 46 | }), this.policyType(), this.getBanner(); |
47 | }, | 47 | }, |
48 | 48 | ||
49 | + getUserInfo() { | ||
50 | + let d = this, url = '/api/user/index'; | ||
51 | + app.post(url, {}).then((r) => { | ||
52 | + console.log(r.noticeNum) | ||
53 | + d.setData({ userInfo: r.userInfo, noticeNum: r.noticeNum }) | ||
54 | + if (r.noticeNum != 0) { | ||
55 | + let num = r.noticeNum | ||
56 | + num = num.toString() | ||
57 | + wx.setTabBarBadge({ | ||
58 | + index: 4, | ||
59 | + text: num | ||
60 | + }) | ||
61 | + } else { | ||
62 | + wx.hideTabBarRedDot({ | ||
63 | + index: 4, | ||
64 | + }) | ||
65 | + } | ||
66 | + }) | ||
67 | + }, | ||
68 | + | ||
49 | //获取轮播图 | 69 | //获取轮播图 |
50 | getopbanner(){ | 70 | getopbanner(){ |
51 | let that=this; | 71 | let that=this; |
@@ -128,7 +148,7 @@ Page({ | @@ -128,7 +148,7 @@ Page({ | ||
128 | page: res.current_page, | 148 | page: res.current_page, |
129 | lastPage: res.last_page, | 149 | lastPage: res.last_page, |
130 | ifData: !0, | 150 | ifData: !0, |
131 | - noMore: res.last_page==res.per_page?!0:!1 | 151 | + noMore: res.last_page==res.current_page?!0:!1 |
132 | }) | 152 | }) |
133 | !e.data.list.concat(res.data).length?e.setData({ | 153 | !e.data.list.concat(res.data).length?e.setData({ |
134 | ifData:!1 | 154 | ifData:!1 |
@@ -154,7 +174,8 @@ Page({ | @@ -154,7 +174,8 @@ Page({ | ||
154 | * 生命周期函数--监听页面显示 | 174 | * 生命周期函数--监听页面显示 |
155 | */ | 175 | */ |
156 | onShow: function () { | 176 | onShow: function () { |
157 | - this.getopbanner() | 177 | + this.getopbanner(); |
178 | + this.getUserInfo() | ||
158 | }, | 179 | }, |
159 | 180 | ||
160 | /** | 181 | /** |
@@ -180,6 +201,7 @@ Page({ | @@ -180,6 +201,7 @@ Page({ | ||
180 | page:1 | 201 | page:1 |
181 | }) | 202 | }) |
182 | t.getList(t.data.category_id,1) | 203 | t.getList(t.data.category_id,1) |
204 | + t.getopbanner() | ||
183 | }, | 205 | }, |
184 | 206 | ||
185 | /** | 207 | /** |
@@ -191,6 +213,7 @@ Page({ | @@ -191,6 +213,7 @@ Page({ | ||
191 | page:t.data.page+1 | 213 | page:t.data.page+1 |
192 | }),t.getList(t.data.category_id,t.data.page)) : wx.showToast({ | 214 | }),t.getList(t.data.category_id,t.data.page)) : wx.showToast({ |
193 | title: '没有更多了', | 215 | title: '没有更多了', |
216 | + icon:'none' | ||
194 | }) | 217 | }) |
195 | }, | 218 | }, |
196 | 219 |
@@ -6,7 +6,7 @@ | @@ -6,7 +6,7 @@ | ||
6 | 6 | ||
7 | 7 | ||
8 | <view class="swiper_image" wx:if="{{imgUrls.length!=0}}"> | 8 | <view class="swiper_image" wx:if="{{imgUrls.length!=0}}"> |
9 | - <swiper indicator-dots="{{indicatorDots}}" autoplay="{{autoplay}}" interval="{{interval}}" duration="{{duration}}" class="swiper_item_img" bindchange="swiperChange"> | 9 | + <swiper indicator-dots="{{indicatorDots}}" autoplay="{{autoplay}}" interval="{{interval}}" duration="{{duration}}" class="swiper_item_img" bindchange="swiperChange" data-current="{{index}}" circular="true"> |
10 | <block wx:for="{{imgUrls}}" wx:key="doct"> | 10 | <block wx:for="{{imgUrls}}" wx:key="doct"> |
11 | <swiper-item style="border-radius:10px;" > | 11 | <swiper-item style="border-radius:10px;" > |
12 | <image src="{{item.banner}}" data-index='{{index}}' class="slide-image" bindtap='viewImg' width="355" height="150" data-src="{{item.url}}" data-id="{{item.id}}" bindtap='bannerDetail'/> | 12 | <image src="{{item.banner}}" data-index='{{index}}' class="slide-image" bindtap='viewImg' width="355" height="150" data-src="{{item.url}}" data-id="{{item.id}}" bindtap='bannerDetail'/> |
@@ -20,7 +20,12 @@ Page({ | @@ -20,7 +20,12 @@ Page({ | ||
20 | list: [], | 20 | list: [], |
21 | ifData: !1, | 21 | ifData: !1, |
22 | noMore: !1, | 22 | noMore: !1, |
23 | - top:'' | 23 | + top:'', |
24 | + interval: 2000, | ||
25 | + duration: 1000, | ||
26 | + currentSwiper:0, | ||
27 | + indicatorDots: false, | ||
28 | + autoplay: true, | ||
24 | }, | 29 | }, |
25 | 30 | ||
26 | /** | 31 | /** |
@@ -38,7 +43,12 @@ Page({ | @@ -38,7 +43,12 @@ Page({ | ||
38 | } | 43 | } |
39 | }), this.policyType(), this.getBanner(); | 44 | }), this.policyType(), this.getBanner(); |
40 | }, | 45 | }, |
46 | + swiperChange: function (e) { | ||
47 | + this.setData({ | ||
48 | + currentSwiper: e.detail.current | ||
49 | + }) | ||
41 | 50 | ||
51 | + }, | ||
42 | //获取轮播图 | 52 | //获取轮播图 |
43 | getopbanner() { | 53 | getopbanner() { |
44 | let that=this | 54 | let that=this |
@@ -97,19 +107,20 @@ Page({ | @@ -97,19 +107,20 @@ Page({ | ||
97 | }) : '', b.getList(e.currentTarget.id, 1) | 107 | }) : '', b.getList(e.currentTarget.id, 1) |
98 | }, | 108 | }, |
99 | getList(id, page) { | 109 | getList(id, page) { |
100 | - let e = this, url = '/api/Party/index', params = { | 110 | + let t = this, url = '/api/Party/index', params = { |
101 | category_id: id, | 111 | category_id: id, |
102 | page: page, | 112 | page: page, |
103 | header: true | 113 | header: true |
104 | }, list = page == 1 ? [] : t.data.list; app.post(url, params).then((res) => { | 114 | }, list = page == 1 ? [] : t.data.list; app.post(url, params).then((res) => { |
105 | - e.setData({ | 115 | + console.log(res) |
116 | + t.setData({ | ||
106 | list: list.concat(res.data), | 117 | list: list.concat(res.data), |
107 | page: res.current_page, | 118 | page: res.current_page, |
108 | lastPage: res.last_page, | 119 | lastPage: res.last_page, |
109 | ifData: !0, | 120 | ifData: !0, |
110 | - noMore: res.last_page == res.per_page ? !0 : !1 | 121 | + noMore: res.last_page == res.current_page ? !0 : !1 |
111 | }) | 122 | }) |
112 | - !e.data.list.concat(res.data).length ? e.setData({ | 123 | + !t.data.list.concat(res.data).length ? t.setData({ |
113 | ifData: !1 | 124 | ifData: !1 |
114 | }) : '' | 125 | }) : '' |
115 | wx.stopPullDownRefresh(); | 126 | wx.stopPullDownRefresh(); |
@@ -125,6 +136,26 @@ Page({ | @@ -125,6 +136,26 @@ Page({ | ||
125 | // + '&content=' + JSON.stringify(e.currentTarget.dataset.content) | 136 | // + '&content=' + JSON.stringify(e.currentTarget.dataset.content) |
126 | }) | 137 | }) |
127 | }, | 138 | }, |
139 | + | ||
140 | + getUserInfo() { | ||
141 | + let d = this, url = '/api/user/index'; | ||
142 | + app.post(url, {}).then((r) => { | ||
143 | + console.log(r.noticeNum) | ||
144 | + d.setData({ userInfo: r.userInfo, noticeNum: r.noticeNum }) | ||
145 | + if (r.noticeNum != 0) { | ||
146 | + let num = r.noticeNum | ||
147 | + num = num.toString() | ||
148 | + wx.setTabBarBadge({ | ||
149 | + index: 4, | ||
150 | + text: num | ||
151 | + }) | ||
152 | + } else { | ||
153 | + wx.hideTabBarRedDot({ | ||
154 | + index: 4, | ||
155 | + }) | ||
156 | + } | ||
157 | + }) | ||
158 | + }, | ||
128 | /** | 159 | /** |
129 | * 生命周期函数--监听页面初次渲染完成 v | 160 | * 生命周期函数--监听页面初次渲染完成 v |
130 | */ | 161 | */ |
@@ -136,7 +167,8 @@ Page({ | @@ -136,7 +167,8 @@ Page({ | ||
136 | * 生命周期函数--监听页面显示 | 167 | * 生命周期函数--监听页面显示 |
137 | */ | 168 | */ |
138 | onShow: function () { | 169 | onShow: function () { |
139 | - this.getopbanner() | 170 | + this.getopbanner(); |
171 | + this.getUserInfo() | ||
140 | }, | 172 | }, |
141 | 173 | ||
142 | /** | 174 | /** |
@@ -162,6 +194,8 @@ Page({ | @@ -162,6 +194,8 @@ Page({ | ||
162 | page: 1 | 194 | page: 1 |
163 | }) | 195 | }) |
164 | t.getList(t.data.category_id, 1) | 196 | t.getList(t.data.category_id, 1) |
197 | + | ||
198 | + t.getopbanner(); | ||
165 | }, | 199 | }, |
166 | 200 | ||
167 | /** | 201 | /** |
@@ -173,6 +207,7 @@ Page({ | @@ -173,6 +207,7 @@ Page({ | ||
173 | page: t.data.page + 1 | 207 | page: t.data.page + 1 |
174 | }), t.getList(t.data.category_id, t.data.page)) : wx.showToast({ | 208 | }), t.getList(t.data.category_id, t.data.page)) : wx.showToast({ |
175 | title: '没有更多了', | 209 | title: '没有更多了', |
210 | + icon:'none' | ||
176 | }) | 211 | }) |
177 | }, | 212 | }, |
178 | 213 |
@@ -2,9 +2,9 @@ | @@ -2,9 +2,9 @@ | ||
2 | <view class='top_view'> | 2 | <view class='top_view'> |
3 | 3 | ||
4 | <view class="swiper_image" wx:if="{{imgUrls.length!=0}}"> | 4 | <view class="swiper_image" wx:if="{{imgUrls.length!=0}}"> |
5 | - <swiper indicator-dots="{{indicatorDots}}" autoplay="{{autoplay}}" interval="{{interval}}" duration="{{duration}}" class="swiper_item_img" > | 5 | + <swiper indicator-dots="{{indicatorDots}}" autoplay="{{autoplay}}" interval="{{interval}}" duration="{{duration}}" class="swiper_item_img" bindchange="swiperChange" circular="true"> |
6 | <block wx:for="{{imgUrls}}" wx:key="doct"> | 6 | <block wx:for="{{imgUrls}}" wx:key="doct"> |
7 | - <swiper-item style="border-radius:10px;" > | 7 | + <swiper-item style="border-radius:10px;"> |
8 | <image src="{{item.image}}" data-index='{{index}}' class="slide-image" bindtap='viewImg' width="355" height="150" data-src="{{item.url}}" data-id="{{item.id}}" bindtap='bannerDetail' data-title="{{item.title}}" data-content="{{item.content}}"/> | 8 | <image src="{{item.image}}" data-index='{{index}}' class="slide-image" bindtap='viewImg' width="355" height="150" data-src="{{item.url}}" data-id="{{item.id}}" bindtap='bannerDetail' data-title="{{item.title}}" data-content="{{item.content}}"/> |
9 | </swiper-item> | 9 | </swiper-item> |
10 | </block> | 10 | </block> |
@@ -12,7 +12,7 @@ | @@ -12,7 +12,7 @@ | ||
12 | 12 | ||
13 | <view class="dots"> | 13 | <view class="dots"> |
14 | <block wx:for="{{imgUrls}}" wx:key=""> | 14 | <block wx:for="{{imgUrls}}" wx:key=""> |
15 | - <view class="dot{{index == currentSwiper ? ' active' : ''}}"></view> | 15 | + <view class="dot {{index == currentSwiper ? 'dotactive' : ''}}"></view> |
16 | </block> | 16 | </block> |
17 | </view> | 17 | </view> |
18 | 18 |
@@ -42,7 +42,7 @@ page{ | @@ -42,7 +42,7 @@ page{ | ||
42 | 42 | ||
43 | } | 43 | } |
44 | .menu_item{ | 44 | .menu_item{ |
45 | - padding:0 33rpx; | 45 | + padding:0 20rpx; |
46 | display: inline-block; | 46 | display: inline-block; |
47 | text-align: center; | 47 | text-align: center; |
48 | } | 48 | } |
@@ -194,7 +194,7 @@ page{ | @@ -194,7 +194,7 @@ page{ | ||
194 | 194 | ||
195 | /*选中以后的小圆点样式 */ | 195 | /*选中以后的小圆点样式 */ |
196 | 196 | ||
197 | -.active { | 197 | +.dotactive { |
198 | width: 16rpx; | 198 | width: 16rpx; |
199 | height: 16rpx; | 199 | height: 16rpx; |
200 | border-radius: 50%; | 200 | border-radius: 50%; |
1 | - let A = getApp(); | 1 | +let A = getApp(); |
2 | Page({ | 2 | Page({ |
3 | 3 | ||
4 | /** | 4 | /** |
@@ -183,16 +183,39 @@ Page({ | @@ -183,16 +183,39 @@ Page({ | ||
183 | url: '', | 183 | url: '', |
184 | }) | 184 | }) |
185 | }, | 185 | }, |
186 | + | ||
186 | /** | 187 | /** |
187 | * 生命周期函数--监听页面初次渲染完成 | 188 | * 生命周期函数--监听页面初次渲染完成 |
188 | */ | 189 | */ |
189 | onReady: function () { | 190 | onReady: function () { |
190 | 191 | ||
191 | }, | 192 | }, |
193 | + | ||
194 | + | ||
195 | + getUserInfo() { | ||
196 | + let d = this, url = '/api/user/index'; | ||
197 | + A.post(url, {}).then((r) => { | ||
198 | + console.log(r.noticeNum) | ||
199 | + d.setData({ userInfo: r.userInfo, noticeNum: r.noticeNum }) | ||
200 | + if (r.noticeNum != 0) { | ||
201 | + let num = r.noticeNum | ||
202 | + num = num.toString() | ||
203 | + wx.setTabBarBadge({ | ||
204 | + index: 4, | ||
205 | + text: num | ||
206 | + }) | ||
207 | + } else { | ||
208 | + wx.hideTabBarRedDot({ | ||
209 | + index: 4, | ||
210 | + }) | ||
211 | + } | ||
212 | + }) | ||
213 | + }, | ||
192 | /** | 214 | /** |
193 | * 生命周期函数--监听页面显示 | 215 | * 生命周期函数--监听页面显示 |
194 | */ | 216 | */ |
195 | onShow: function () { | 217 | onShow: function () { |
218 | + this.getUserInfo(); | ||
196 | this.checkstatus(); | 219 | this.checkstatus(); |
197 | this.setData({ | 220 | this.setData({ |
198 | zixunList: [], | 221 | zixunList: [], |
@@ -200,7 +223,8 @@ Page({ | @@ -200,7 +223,8 @@ Page({ | ||
200 | page: 1, | 223 | page: 1, |
201 | show:!0 | 224 | show:!0 |
202 | }) | 225 | }) |
203 | - this.data.currentTab=='0'?this.getzixun():this.postList() | 226 | + this.data.currentTab=='0'?this.getzixun():this.postList(); |
227 | + | ||
204 | }, | 228 | }, |
205 | 229 | ||
206 | /** | 230 | /** |
@@ -20,7 +20,8 @@ Page({ | @@ -20,7 +20,8 @@ Page({ | ||
20 | navScrollLeft:0, | 20 | navScrollLeft:0, |
21 | noMore:!0, | 21 | noMore:!0, |
22 | beautiful_switch:0, | 22 | beautiful_switch:0, |
23 | - selectindex:0 | 23 | + selectindex:0, |
24 | + heigh:"200rpx" | ||
24 | }, | 25 | }, |
25 | changeShow(){ | 26 | changeShow(){ |
26 | this.setData({ | 27 | this.setData({ |
@@ -168,7 +169,39 @@ Page({ | @@ -168,7 +169,39 @@ Page({ | ||
168 | * 生命周期函数--监听页面显示 | 169 | * 生命周期函数--监听页面显示 |
169 | */ | 170 | */ |
170 | onShow: function() { | 171 | onShow: function() { |
171 | - | 172 | + this.getUserInfo |
173 | + | ||
174 | + let heigh = wx.getSystemInfoSync().windowHeight; | ||
175 | + console.log('89898989',heigh) | ||
176 | + if (heigh==555){ | ||
177 | + this.setData({ | ||
178 | + heigh:'204rpx' | ||
179 | + }) | ||
180 | + } else if (heigh ==624){ | ||
181 | + this.setData({ | ||
182 | + heigh: '222rpx' | ||
183 | + }) | ||
184 | + } else if (heigh == 594){ | ||
185 | + this.setData({ | ||
186 | + heigh: '245rpx' | ||
187 | + }) | ||
188 | + }else if (heigh == 584){ | ||
189 | + this.setData({ | ||
190 | + heigh: '248rpx' | ||
191 | + }) | ||
192 | + } else if(heigh ==609) { | ||
193 | + this.setData({ | ||
194 | + heigh: '228rpx' | ||
195 | + }) | ||
196 | + }else if (heigh == 514) { | ||
197 | + this.setData({ | ||
198 | + heigh: '200rpx' | ||
199 | + }) | ||
200 | + }else{ | ||
201 | + this.setData({ | ||
202 | + heigh: '200rpx' | ||
203 | + }) | ||
204 | + } | ||
172 | }, | 205 | }, |
173 | 206 | ||
174 | /** | 207 | /** |
@@ -48,7 +48,7 @@ | @@ -48,7 +48,7 @@ | ||
48 | 48 | ||
49 | <image class='label_img' hidden='{{!item.recommend_switch}}' src='/images/zuire@2x.png'></image> | 49 | <image class='label_img' hidden='{{!item.recommend_switch}}' src='/images/zuire@2x.png'></image> |
50 | <text class='label_info' hidden='{{!item.recommend_switch}}'>推荐</text> | 50 | <text class='label_info' hidden='{{!item.recommend_switch}}'>推荐</text> |
51 | - <image src='{{item.logo_image}}' mode='aspectFill' class='top_logo'></image> | 51 | + <image src='{{item.logo_image}}' mode='aspectFill' class='top_logo' style="height:{{heigh}}"></image> |
52 | 52 | ||
53 | 53 | ||
54 | 54 |
@@ -31,7 +31,7 @@ page { | @@ -31,7 +31,7 @@ page { | ||
31 | color: #999; | 31 | color: #999; |
32 | display: inline-block; | 32 | display: inline-block; |
33 | position: relative; | 33 | position: relative; |
34 | - padding: 0 12rpx; | 34 | + padding: 0 14rpx; |
35 | height: 100%; | 35 | height: 100%; |
36 | text-align: center; | 36 | text-align: center; |
37 | } | 37 | } |
-
请 注册 或 登录 后发表评论