作者 李洪娟

合并分支 'suhang' 到 'li_hongjuan'

大兄弟



查看合并请求 !3
@@ -3,6 +3,8 @@ @@ -3,6 +3,8 @@
3 "pages/index/index", 3 "pages/index/index",
4 "pages/homeindex/homeindex", 4 "pages/homeindex/homeindex",
5 5
  6 +
  7 +
6 8
7 9
8 10
@@ -12,7 +14,6 @@ @@ -12,7 +14,6 @@
12 14
13 "pages/kind/kind", 15 "pages/kind/kind",
14 16
15 - "pages/homeindex/result/result",  
16 "pages/homeindex/search/search", 17 "pages/homeindex/search/search",
17 18
18 19
@@ -14,12 +14,15 @@ Page({ @@ -14,12 +14,15 @@ Page({
14 class_id: '', 14 class_id: '',
15 detailCon: {}, 15 detailCon: {},
16 id: '', 16 id: '',
  17 + keyword:'',
  18 + page: 2,
  19 + page_type: true
17 }, 20 },
18 look_category(e) { 21 look_category(e) {
19 - console.log(e) 22 +
20 app.globalData.cid = e.currentTarget.dataset.index 23 app.globalData.cid = e.currentTarget.dataset.index
21 app.globalData.class_id = e.currentTarget.dataset.class_id 24 app.globalData.class_id = e.currentTarget.dataset.class_id
22 - console.log(app.globalData.cid) 25 +
23 wx.switchTab({ 26 wx.switchTab({
24 url: '/pages/kind/kind' 27 url: '/pages/kind/kind'
25 }) 28 })
@@ -41,15 +44,16 @@ Page({ @@ -41,15 +44,16 @@ Page({
41 let params = { 44 let params = {
42 class_id: that.data.class_id 45 class_id: that.data.class_id
43 } 46 }
44 - console.log(params) 47 +
45 app.post(url, params, header).then((res) => { 48 app.post(url, params, header).then((res) => {
46 - console.log(res) 49 +
47 that.setData({ 50 that.setData({
48 banner: res.data.banner, 51 banner: res.data.banner,
49 shop_class: res.data.shop_class, 52 shop_class: res.data.shop_class,
50 middle: res.data.middle, 53 middle: res.data.middle,
51 shop: res.data.shop, 54 shop: res.data.shop,
52 - now_time: res.data.now_time 55 + now_time: res.data.now_time,
  56 + // totalpae: res.last_page
53 }) 57 })
54 that.countDown() 58 that.countDown()
55 59
@@ -58,13 +62,7 @@ Page({ @@ -58,13 +62,7 @@ Page({
58 }).catch((errMsg) => {}) 62 }).catch((errMsg) => {})
59 63
60 }, 64 },
61 - goConfirm: function(e) {  
62 -  
63 - this.setData({  
64 - showModal: true,  
65 - index: e.currentTarget.dataset.index  
66 - })  
67 - }, 65 +
68 m_close: function() { 66 m_close: function() {
69 this.setData({ 67 this.setData({
70 showModal: false, 68 showModal: false,
@@ -113,21 +111,17 @@ Page({ @@ -113,21 +111,17 @@ Page({
113 let that = this 111 let that = this
114 let objs = Object.assign([], that.data.shop) 112 let objs = Object.assign([], that.data.shop)
115 let now_time = parseInt(new Date().getTime()) 113 let now_time = parseInt(new Date().getTime())
116 - // console.log(now_time) 114 +
117 115
118 for (let obj of objs) { 116 for (let obj of objs) {
119 117
120 let end_time = obj.end_time*1000 118 let end_time = obj.end_time*1000
121 - // console.log(end_time)  
122 let open_time = obj.open_time*1000 119 let open_time = obj.open_time*1000
123 if (now_time < open_time) { 120 if (now_time < open_time) {
124 - // console.log(333)  
125 //活动未开始 121 //活动未开始
126 } else if (now_time > end_time) { 122 } else if (now_time > end_time) {
127 - // console.log(222)  
128 //活动结束 123 //活动结束
129 } else { 124 } else {
130 - // console.log(1111)  
131 let time = (end_time - now_time) / 1000; 125 let time = (end_time - now_time) / 1000;
132 let day = parseInt(time / (60 * 60 * 24)); 126 let day = parseInt(time / (60 * 60 * 24));
133 let hou = parseInt(time % (60 * 60 * 24) / 3600); 127 let hou = parseInt(time % (60 * 60 * 24) / 3600);
@@ -139,13 +133,11 @@ Page({ @@ -139,13 +133,11 @@ Page({
139 obj.min = that.timeFormat(min), 133 obj.min = that.timeFormat(min),
140 obj.sec = that.timeFormat(sec) 134 obj.sec = that.timeFormat(sec)
141 135
142 - // console.log(obj.day, obj.hou, obj.min, obj.sec)  
143 } 136 }
144 } 137 }
145 that.setData({ 138 that.setData({
146 shop: objs 139 shop: objs
147 }) 140 })
148 - // console.log(that.data.shop)  
149 setTimeout(that.countDown, 1000); 141 setTimeout(that.countDown, 1000);
150 }, 142 },
151 /** 143 /**
@@ -153,7 +145,53 @@ Page({ @@ -153,7 +145,53 @@ Page({
153 */ 145 */
154 onLoad: function(options) { 146 onLoad: function(options) {
155 let that = this 147 let that = this
156 - that.get_info() 148 + that.get_info();
  149 +
  150 +
  151 + },
  152 +
  153 +
  154 + info() {
  155 + let that = this
  156 + let url = app.interface.shopPage
  157 + let header = {
  158 + 'XX-Device-Type': 'wxapp',
  159 + 'XX-Token': wx.getStorageSync('token')
  160 + }
  161 + let paramer = {
  162 + page: that.data.page,
  163 + type: 1
  164 + }
  165 +
  166 + app.post(url, paramer,header).then((res) => {
  167 + if (res.data.shop.length > 0){
  168 + wx.showLoading({
  169 + title: '加载中',
  170 + })
  171 + let t = setInterval((red)=>{
  172 + wx.hideLoading()
  173 + that.setData({
  174 + shop: that.data.shop.concat(res.data.shop),
  175 + page_type: true
  176 + })
  177 + },1000)
  178 +
  179 + } else{
  180 + that.setData({
  181 + page_type: false
  182 + })
  183 + wx.showToast({
  184 + title: '暂无更多数据',
  185 + icon: 'none',
  186 + duration: 1000
  187 + })
  188 +
  189 +
  190 + }
  191 +
  192 + }).catch((errMsg) => {
  193 +
  194 + })
157 }, 195 },
158 196
159 /** 197 /**
@@ -172,7 +210,6 @@ Page({ @@ -172,7 +210,6 @@ Page({
172 that.setData({ 210 that.setData({
173 currentTab: app.globalData.cid 211 currentTab: app.globalData.cid
174 }) 212 })
175 - console.log(this.data.aa)  
176 } 213 }
177 that.get_info() 214 that.get_info()
178 that.countDown() 215 that.countDown()
@@ -203,7 +240,17 @@ Page({ @@ -203,7 +240,17 @@ Page({
203 * 页面上拉触底事件的处理函数 240 * 页面上拉触底事件的处理函数
204 */ 241 */
205 onReachBottom: function() { 242 onReachBottom: function() {
206 - 243 + let that=this
  244 + if(that.data.page_type == false){
  245 + return false
  246 + }
  247 + let page=that.data.page;
  248 + page++;
  249 + that.setData({
  250 + page:page
  251 + })
  252 + that.info()
  253 +
207 }, 254 },
208 255
209 /** 256 /**
@@ -78,7 +78,7 @@ @@ -78,7 +78,7 @@
78 <view class='ware5_t3'>{{item.text_table}}</view> 78 <view class='ware5_t3'>{{item.text_table}}</view>
79 <view class='ware5_t4'>{{item.text_content}}</view> 79 <view class='ware5_t4'>{{item.text_content}}</view>
80 </view> 80 </view>
81 - <view class='ware_6' data-index="{{index}}" catchtap='goConfirm'> 81 + <view class='ware_6' >
82 <view>立即参团</view> 82 <view>立即参团</view>
83 </view> 83 </view>
84 </view> 84 </view>
@@ -91,6 +91,8 @@ @@ -91,6 +91,8 @@
91 </view> 91 </view>
92 </view> 92 </view>
93 </view> 93 </view>
  94 +<view class='Load'>—— {{page_type?'下拉加载更多':'暂无跟多数据'}} ——</view>
  95 +
94 <!-- 弹窗 --> 96 <!-- 弹窗 -->
95 <view class="mask" catchtouchmove="preventTouchMove" wx:if="{{showModal}}"></view> 97 <view class="mask" catchtouchmove="preventTouchMove" wx:if="{{showModal}}"></view>
96 <!-- 弹出层 --> 98 <!-- 弹出层 -->
1 -/* pages/homeindex/homeindex.wxss */ 1 +page{
  2 + padding-bottom: 50rpx;
  3 +}
2 4
3 .search { 5 .search {
4 padding: 16rpx 32rpx; 6 padding: 16rpx 32rpx;
@@ -171,11 +173,12 @@ @@ -171,11 +173,12 @@
171 173
172 .ware_box { 174 .ware_box {
173 width: 688rpx; 175 width: 688rpx;
174 - height: 400rpx;  
175 margin: 32rpx auto; 176 margin: 32rpx auto;
176 background: #f9fafc; 177 background: #f9fafc;
177 } 178 }
178 - 179 +.ware_box:last-child{
  180 + margin-bottom: 0;
  181 +}
179 .ware_top { 182 .ware_top {
180 overflow: hidden; 183 overflow: hidden;
181 display: flex; 184 display: flex;
@@ -583,3 +586,10 @@ @@ -583,3 +586,10 @@
583 box-shadow: 0rpx 6rpx 40rpx rgba(162, 255, 0, 0.15); 586 box-shadow: 0rpx 6rpx 40rpx rgba(162, 255, 0, 0.15);
584 border-radius: 48rpx; 587 border-radius: 48rpx;
585 } 588 }
  589 +.Load{
  590 + width: 100%;
  591 + text-align: center;
  592 + color: #aaa;
  593 + font-size: 26rpx;
  594 + margin-top: 50rpx;
  595 +}
1 -// pages/homeindex/result/result.js  
2 -Page({  
3 -  
4 - /**  
5 - * 页面的初始数据  
6 - */  
7 - data: {  
8 -  
9 - },  
10 -  
11 - /**  
12 - * 生命周期函数--监听页面加载  
13 - */  
14 - onLoad: function (options) {  
15 -  
16 - },  
17 -  
18 - /**  
19 - * 生命周期函数--监听页面初次渲染完成  
20 - */  
21 - onReady: function () {  
22 -  
23 - },  
24 -  
25 - /**  
26 - * 生命周期函数--监听页面显示  
27 - */  
28 - onShow: function () {  
29 -  
30 - },  
31 -  
32 - /**  
33 - * 生命周期函数--监听页面隐藏  
34 - */  
35 - onHide: function () {  
36 -  
37 - },  
38 -  
39 - /**  
40 - * 生命周期函数--监听页面卸载  
41 - */  
42 - onUnload: function () {  
43 -  
44 - },  
45 -  
46 - /**  
47 - * 页面相关事件处理函数--监听用户下拉动作  
48 - */  
49 - onPullDownRefresh: function () {  
50 -  
51 - },  
52 -  
53 - /**  
54 - * 页面上拉触底事件的处理函数  
55 - */  
56 - onReachBottom: function () {  
57 -  
58 - },  
59 -  
60 - /**  
61 - * 用户点击右上角分享  
62 - */  
63 - onShareAppMessage: function () {  
64 -  
65 - }  
66 -})  
1 -{  
2 - "navigationBarTitleText": "",  
3 - "navigationBarBackgroundColor": "#6EAC3D",  
4 - "navigationBarTextStyle": "white"  
5 -}  
1 -<!--pages/homeindex/result/result.wxml-->  
2 -<!-- <text>pages/homeindex/result/result.wxml</text> -->  
3 -<view class='search'>  
4 - <view class='search_inp'>  
5 - <input type='text' placeholder='请输入商品名称'></input>  
6 - <image src='../../../img/search.png'></image>  
7 - </view>  
8 - <view class='search_txt'>  
9 - 取消  
10 - </view>  
11 -</view>  
12 -  
13 -<view class='container'>  
14 - <view class='mid'>  
15 - <view class='mid_item'>  
16 - <!-- 顶部 -->  
17 - <view class='mid_item_top'>  
18 - <!-- 左边 -->  
19 - <view class='mid_item_top_left'>  
20 - <view class='top_left_pic'>  
21 - <image src='../../../img/goods_1.png'></image>  
22 - </view>  
23 - <view class='top_left_text'>  
24 - 距结束23时59分距结束23时59分  
25 - </view>  
26 - </view>  
27 - <!-- 右边 -->  
28 - <view class='mid_item_top_right'>  
29 - <!-- 右上 -->  
30 - <view class='right_top'>  
31 - <view class='right_top_lef'>  
32 - 纯进口有机菜花  
33 - </view>  
34 - <view class='right_top_rig'>  
35 - 产地:智利  
36 - </view>  
37 - </view>  
38 - <!-- 右中1 -->  
39 - <view class='right_mid'>  
40 - <view class='right_mid_lef'>  
41 - <view class='right_mid_lef_color'></view>  
42 - </view>  
43 - <view class='right_mid_rig'>  
44 - 42%  
45 - </view>  
46 - </view>  
47 - <!-- 右中2 -->  
48 - <view class='right_text'>  
49 - 已拼300份,目标500份  
50 - </view>  
51 - <!-- 右下 -->  
52 - <view class='right_bottom'>  
53 - <!-- 右下左 -->  
54 - <view class='right_bottom_lef'>  
55 - <span class='RBM'>¥</span>  
56 - <span class='number'>52/</span>  
57 - <span class='text'>1磅1份1磅1份</span>  
58 - </view>  
59 - <!-- 右下中 -->  
60 - <view class='right_bottom_mid'>  
61 - <view class='right_bottom_mid_t'>  
62 - 40mm-50m  
63 - </view>  
64 - <view class='right_bottom_mid_b'>  
65 - 番茄果径番茄果径番茄果径  
66 - </view>  
67 - </view>  
68 - <!-- 右下右 -->  
69 - <view class='right_bottom_rig'>  
70 - 立即参团  
71 - </view>  
72 - </view>  
73 - </view>  
74 -  
75 -  
76 - </view>  
77 - <view class='mid_item_bottom'>  
78 - <view class='mid_item_bottom_left'>  
79 - 经典推荐  
80 - </view>  
81 - <!-- 竖线 -->  
82 - <view class='mid_line'></view>  
83 - <!-- 底部文本 -->  
84 - <view class='mid_item_bottom_bot'>  
85 - 智利进口,绿色健康,硕大饱满  
86 - </view>  
87 - </view>  
88 - </view>  
89 - <view class='mid_item'>  
90 - <!-- 顶部 -->  
91 - <view class='mid_item_top'>  
92 - <!-- 左边 -->  
93 - <view class='mid_item_top_left'>  
94 - <view class='top_left_pic'>  
95 - <image src='../../../img/goods_1.png'></image>  
96 - </view>  
97 - <view class='top_left_text'>  
98 - 距结束23时59分距结束23时59分  
99 - </view>  
100 - </view>  
101 - <!-- 右边 -->  
102 - <view class='mid_item_top_right'>  
103 - <!-- 右上 -->  
104 - <view class='right_top'>  
105 - <view class='right_top_lef'>  
106 - 纯进口有机菜花  
107 - </view>  
108 - <view class='right_top_rig'>  
109 - 产地:智利  
110 - </view>  
111 - </view>  
112 - <!-- 右中1 -->  
113 - <view class='right_mid'>  
114 - <view class='right_mid_lef'>  
115 - <view class='right_mid_lef_color'></view>  
116 - </view>  
117 - <view class='right_mid_rig'>  
118 - 42%  
119 - </view>  
120 - </view>  
121 - <!-- 右中2 -->  
122 - <view class='right_text'>  
123 - 已拼300份,目标500份  
124 - </view>  
125 - <!-- 右下 -->  
126 - <view class='right_bottom'>  
127 - <!-- 右下左 -->  
128 - <view class='right_bottom_lef'>  
129 - <span class='RBM'>¥</span>  
130 - <span class='number'>52/</span>  
131 - <span class='text'>1磅1份1磅1份</span>  
132 - </view>  
133 - <!-- 右下中 -->  
134 - <view class='right_bottom_mid'>  
135 - <view class='right_bottom_mid_t'>  
136 - 40mm-50m  
137 - </view>  
138 - <view class='right_bottom_mid_b'>  
139 - 番茄果径番茄果径番茄果径  
140 - </view>  
141 - </view>  
142 - <!-- 右下右 -->  
143 - <view class='right_bottom_rig'>  
144 - 立即参团  
145 - </view>  
146 - </view>  
147 - </view>  
148 -  
149 -  
150 - </view>  
151 - <view class='mid_item_bottom'>  
152 - <view class='mid_item_bottom_left'>  
153 - 经典推荐  
154 - </view>  
155 - <!-- 竖线 -->  
156 - <view class='mid_line'></view>  
157 - <!-- 底部文本 -->  
158 - <view class='mid_item_bottom_bot'>  
159 - 智利进口,绿色健康,硕大饱满  
160 - </view>  
161 - </view>  
162 - </view>  
163 - <view class='mid_item'>  
164 - <!-- 顶部 -->  
165 - <view class='mid_item_top'>  
166 - <!-- 左边 -->  
167 - <view class='mid_item_top_left'>  
168 - <view class='top_left_pic'>  
169 - <image src='../../../img/goods_1.png'></image>  
170 - </view>  
171 - <view class='text_color'>  
172 - 距结束2时22分距结束2时22分  
173 - </view>  
174 - </view>  
175 - <!-- 右边 -->  
176 - <view class='mid_item_top_right'>  
177 - <!-- 右上 -->  
178 - <view class='right_top'>  
179 - <view class='right_top_lef'>  
180 - 纯进口有机菜花  
181 - </view>  
182 - <view class='right_top_rig'>  
183 - 产地:罗利  
184 - </view>  
185 - </view>  
186 - <!-- 右中1 -->  
187 - <view class='right_mid'>  
188 - <view class='right_mid_lef'>  
189 - <view class='right_mid_lef_color'></view>  
190 - </view>  
191 - <view class='right_mid_rig'>  
192 - 42%  
193 - </view>  
194 - </view>  
195 - <!-- 右中2 -->  
196 - <view class='right_text'>  
197 - 已拼300份,目标500份  
198 - </view>  
199 - <!-- 右下 -->  
200 - <view class='right_bottom'>  
201 - <!-- 右下左 -->  
202 - <view class='right_bottom_lef'>  
203 - <span class='RBM'>¥</span>  
204 - <span class='number'>52/</span>  
205 - <span class='text'>1磅1份1磅1份</span>  
206 -  
207 - </view>  
208 - <!-- 右下中 -->  
209 - <view class='right_bottom_mid'>  
210 - <view class='right_bottom_mid_t'>  
211 - 40mm-50m  
212 - </view>  
213 - <view class='right_bottom_mid_b'>  
214 - 番茄果径 番茄果径番茄果径  
215 - </view>  
216 - </view>  
217 - <!-- 右下右 -->  
218 - <view class='right_bottom_rig'>  
219 - 立即参团  
220 - </view>  
221 - </view>  
222 - </view>  
223 -  
224 -  
225 - </view>  
226 - <view class='mid_item_bottom'>  
227 - <view class='mid_item_bottom_left'>  
228 - 经典推荐  
229 - </view>  
230 - <!-- 竖线 -->  
231 - <view class='mid_line'></view>  
232 - <!-- 底部文本 -->  
233 - <view class='mid_item_bottom_bot'>  
234 - 智利进口,绿色健康,硕大饱满  
235 - </view>  
236 - </view>  
237 - </view>  
238 - </view>  
239 -</view>  
1 -/* pages/homeindex/result/result.wxss */  
2 -.search{  
3 - padding: 16rpx 32rpx;  
4 - height: 64rpx;  
5 - background: #6EAC3D;  
6 - display: flex;  
7 - justify-content: center;  
8 - align-content: space-between;  
9 -}  
10 -.search_inp{  
11 - box-sizing: border-box;  
12 - width: 608rpx;  
13 - height: 64rpx;  
14 - border-radius: 32rpx;  
15 - display:flex;  
16 - align-items: center;  
17 - padding-left: 76rpx;  
18 - padding-right: 32rpx;  
19 - background:#fff;  
20 - border: 0;  
21 - outline: none;  
22 - font-size: 26rpx;  
23 - position: relative;  
24 -}  
25 -.search_inp input{  
26 - width: 100%;  
27 -}  
28 -.search_inp image{  
29 - position: absolute;  
30 - left: 32rpx;  
31 - width: 32rpx;  
32 - height: 32rpx;  
33 -}  
34 -.search_txt{  
35 - height: 64rpx;  
36 - font-size: 30rpx;  
37 - color: #fff;  
38 - line-height: 64rpx;  
39 - padding-left: 16rpx;  
40 -}  
41 -.container{  
42 - width: 750rpx;  
43 - display: flex;  
44 - align-items: center;  
45 - flex-flow: column;  
46 -}  
47 -.mid{  
48 - margin-top: 16rpx;  
49 - display: flex;  
50 - flex-flow: column;  
51 -}  
52 -.mid_item{  
53 - margin-top: 16rpx;  
54 - width:688rpx;  
55 - /* height:400rpx; */  
56 - background:rgba(249,250,252,1);  
57 - opacity:1;  
58 - border-radius:8rpx;  
59 - display: flex;  
60 - align-items: center;  
61 - flex-flow: column;  
62 - box-sizing: border-box;  
63 - padding: 52rpx 16rpx 48rpx;  
64 -}  
65 -.mid_item_top{  
66 - display: flex;  
67 - width: 100%;  
68 -}  
69 -.mid_item_top_left{  
70 - width:208rpx;  
71 - height:208rpx;  
72 - /* background:rgba(250,250,250,1); */  
73 - opacity:1;  
74 - display: flex;  
75 - flex-flow: column;  
76 -}  
77 -.top_left_pic{  
78 - width: 208rpx;  
79 - height: 160rpx;  
80 - display: flex;  
81 -}  
82 -.top_left_pic image{  
83 - width: 100%;  
84 - height: 100%;  
85 -}  
86 -.top_left_text{  
87 - width: 202rpx;  
88 - height:48rpx;  
89 - background:rgba(251,4,4,1);  
90 - opacity:0.2;  
91 - text-align: center;  
92 - font-size:24rpx;  
93 - font-family:PingFang SC;  
94 - font-weight:400;  
95 - line-height:48rpx;  
96 - color:rgba(255,255,255,1);  
97 -  
98 - overflow: hidden;  
99 - text-overflow: ellipsis;  
100 - white-space: nowrap;  
101 -}  
102 -.mid_item_top_right{  
103 - width: 100%;  
104 - margin-left: 14rpx;  
105 -}  
106 -.right_top{  
107 - display: flex;  
108 - align-items: center;  
109 - justify-content: space-between;  
110 - margin-top: 20rpx;  
111 -}  
112 -.right_top_lef{  
113 - width: 270rpx;  
114 - font-size:32rpx;  
115 - font-family:PingFang SC;  
116 - font-weight:600;  
117 - color:rgba(51,51,51,1);  
118 - opacity:1;  
119 - overflow: hidden;  
120 - text-overflow: ellipsis;  
121 - white-space: nowrap;  
122 -}  
123 -.right_top_rig{  
124 - font-size:22rpx;  
125 - font-family:PingFang SC;  
126 - font-weight:400;  
127 - line-height:32rpx;  
128 - color:rgba(204,204,204,1);  
129 - opacity:1;  
130 -}  
131 -.right_mid{  
132 - margin-top: 16rpx;  
133 - display: flex;  
134 - align-items: center;  
135 -}  
136 -.right_mid_lef{  
137 - width:288rpx;  
138 - height:16rpx;  
139 - background:rgba(236,236,236,1);  
140 - opacity:1;  
141 - border-radius:8rpx;  
142 -}  
143 -.right_mid_lef_color{  
144 - width:206rpx;  
145 - height:16rpx;  
146 - background:rgba(181,222,150,1);  
147 - opacity:1;  
148 - border-radius:8rpx;  
149 -}  
150 -.right_mid_rig{  
151 - margin-left: 16rpx;  
152 - font-size:24rpx;  
153 - font-family:PingFang SC;  
154 - font-weight:400;  
155 - line-height:34rpx;  
156 - color:rgba(181,222,150,1);  
157 - opacity:1;  
158 -}  
159 -.right_text{  
160 - margin-top: 14rpx;  
161 - font-size:22rpx;  
162 - font-family:PingFang SC;  
163 - font-weight:400;  
164 - color:rgba(204,204,204,1);  
165 - opacity:1;  
166 -}  
167 -.right_bottom{  
168 - display: flex;  
169 - align-items: center;  
170 - justify-content: space-between;  
171 -}  
172 -.RBM{  
173 - font-size: 22rpx;  
174 - color: #ff0000;  
175 -}  
176 -.number{  
177 - font-size: 30rpx;  
178 - color: #ff0000;  
179 -}  
180 -.text{  
181 -  
182 - font-size:22rpx;  
183 - font-family:PingFang SC;  
184 - font-weight:400;  
185 - line-height:32rpx;  
186 - color:rgba(204,204,204,1);  
187 - opacity:1;  
188 -}  
189 -.right_bottom_mid{  
190 - width: 122rpx;  
191 -}  
192 -.right_bottom_mid_t{  
193 -  
194 - font-size:22rpx;  
195 - font-family:PingFang SC;  
196 - font-weight:400;  
197 - color:rgba(51,51,51,1);  
198 - opacity:1;  
199 -  
200 - overflow: hidden;  
201 - text-overflow: ellipsis;  
202 - white-space: nowrap;  
203 -  
204 -}  
205 -.right_bottom_mid_b{  
206 - font-size:18rpx;  
207 - font-family:PingFang SC;  
208 - font-weight:400;  
209 - color:rgba(153,153,153,1);  
210 - opacity:1;  
211 -  
212 - overflow: hidden;  
213 - text-overflow: ellipsis;  
214 - white-space: nowrap;  
215 -}  
216 -.right_bottom_rig{  
217 - width:144rpx;  
218 - height:48rpx;  
219 - line-height: 48rpx;  
220 - background:rgba(249,150,20,1);  
221 - box-shadow:0rpx 2rpx 12rpx rgba(255,145,0,0.16);  
222 - opacity:1;  
223 - border-radius:24rpx;  
224 -  
225 - text-align: center;  
226 - font-size:26rpx;  
227 - font-family:PingFang SC;  
228 - font-weight:400;  
229 - color:rgba(255,255,255,1);  
230 -}  
231 -.mid_item_bottom{  
232 - margin-top: 32rpx;  
233 - width:640rpx;  
234 - height:80rpx;  
235 - background:rgba(181,222,150,0.1);  
236 - border-radius:16rpx;  
237 - display: flex;  
238 - align-items: center;  
239 - box-sizing: border-box;  
240 - padding: 0 32rpx;  
241 -}  
242 -.mid_item_bottom_left{  
243 - font-size:30rpx;  
244 - font-family:汉真广标;  
245 - font-weight:400;  
246 - color:rgba(110,172,61,1);  
247 - opacity:1;  
248 -  
249 -}  
250 -.mid_line{  
251 - margin: 0 36rpx;  
252 - width:2rpx;  
253 - height:60rpx;  
254 - background:rgba(181,222,150,1);  
255 - opacity:1;  
256 - border-radius:4rpx;  
257 -}  
258 -.mid_item_bottom_bot{  
259 - font-size:24rpx;  
260 - font-family:PingFang SC;  
261 - font-weight:400;  
262 - color:rgba(153,153,153,1);  
263 - opacity:1;  
264 - overflow: hidden;  
265 - text-overflow: ellipsis;  
266 - white-space: nowrap;  
267 -}  
268 -.text_color{  
269 - width:202rpx;  
270 - height:48rpx;  
271 - line-height: 48rpx;  
272 - text-align: center;  
273 - background:rgba(204,204,204,0.7);  
274 - font-size:24rpx;  
275 - font-family:PingFang SC;  
276 - font-weight:400;  
277 - color:rgba(255,255,255,1);  
278 - opacity:1;  
279 - overflow: hidden;  
280 - text-overflow: ellipsis;  
281 - white-space: nowrap;  
282 -}  
283 -.right_bottom_lef{  
284 - width: 140rpx;  
285 - overflow: hidden;  
286 - text-overflow: ellipsis;  
287 - white-space: nowrap;  
288 -}  
@@ -57,6 +57,7 @@ Page({ @@ -57,6 +57,7 @@ Page({
57 keyword: e._relatedInfo.anchorTargetText 57 keyword: e._relatedInfo.anchorTargetText
58 }) 58 })
59 }, 59 },
  60 +
60 info(event) { 61 info(event) {
61 let that = this 62 let that = this
62 if (that.data.keyword == '') { 63 if (that.data.keyword == '') {
@@ -81,11 +82,13 @@ Page({ @@ -81,11 +82,13 @@ Page({
81 page: 1, 82 page: 1,
82 keyword: keyword 83 keyword: keyword
83 },header).then((res) => { 84 },header).then((res) => {
  85 + console.log
84 that.setData({ 86 that.setData({
85 shop: res.data.shop, 87 shop: res.data.shop,
86 type:false, 88 type:false,
87 dis: false, 89 dis: false,
88 - keyword: '' 90 + keyword: '',
  91 + shop: that.data.shop.concat(res.data.shop)
89 }) 92 })
90 that.get_info() 93 that.get_info()
91 }).catch((errMsg) => { 94 }).catch((errMsg) => {
@@ -144,6 +147,12 @@ Page({ @@ -144,6 +147,12 @@ Page({
144 timeFormat(param) { //小于10的格式化函数 147 timeFormat(param) { //小于10的格式化函数
145 return param < 10 ? '0' + param : param; 148 return param < 10 ? '0' + param : param;
146 }, 149 },
  150 + shoptail(e) {
  151 + let id = e.currentTarget.dataset.shop_id;
  152 + wx.navigateTo({
  153 + url: '/pages/kind/detail_1/detail_1?id=' + id,
  154 + })
  155 + },
147 //团购倒计时 156 //团购倒计时
148 countDown() { 157 countDown() {
149 let that = this 158 let that = this
@@ -187,46 +196,7 @@ Page({ @@ -187,46 +196,7 @@ Page({
187 timeFormat(param) { //小于10的格式化函数 196 timeFormat(param) { //小于10的格式化函数
188 return param < 10 ? '0' + param : param; 197 return param < 10 ? '0' + param : param;
189 }, 198 },
190 - //团购倒计时  
191 - countDown() {  
192 - let that = this  
193 - let objs = Object.assign([], that.data.shop)  
194 - let now_time = parseInt(new Date().getTime())  
195 - // console.log(now_time)  
196 -  
197 - for (let obj of objs) {  
198 -  
199 - let end_time = obj.end_time * 1000  
200 - // console.log(end_time)  
201 - let open_time = obj.open_time * 1000  
202 - if (now_time < open_time) {  
203 - // console.log(333)  
204 - //活动未开始  
205 - } else if (now_time > end_time) {  
206 - // console.log(222)  
207 - //活动结束  
208 - } else {  
209 - // console.log(1111)  
210 - let time = (end_time - now_time) / 1000;  
211 - let day = parseInt(time / (60 * 60 * 24));  
212 - let hou = parseInt(time % (60 * 60 * 24) / 3600);  
213 - let min = parseInt(time % (60 * 60 * 24) % 3600 / 60);  
214 - let sec = parseInt(time % (60 * 60 * 24) % 3600 % 60);  
215 -  
216 - obj.day = that.timeFormat(day),  
217 - obj.hou = that.timeFormat(hou),  
218 - obj.min = that.timeFormat(min),  
219 - obj.sec = that.timeFormat(sec)  
220 -  
221 - // console.log(obj.day, obj.hou, obj.min, obj.sec)  
222 - }  
223 - }  
224 - that.setData({  
225 - shop: objs  
226 - })  
227 - // console.log(that.data.shop)  
228 - setTimeout(that.countDown, 1000);  
229 - }, 199 +
230 add(){ 200 add(){
231 201
232 }, 202 },
@@ -241,7 +211,7 @@ Page({ @@ -241,7 +211,7 @@ Page({
241 * 生命周期函数--监听页面显示 211 * 生命周期函数--监听页面显示
242 */ 212 */
243 onShow: function() { 213 onShow: function() {
244 - that.countDown() 214 + this.countDown()
245 215
246 }, 216 },
247 217
@@ -270,7 +240,14 @@ Page({ @@ -270,7 +240,14 @@ Page({
270 * 页面上拉触底事件的处理函数 240 * 页面上拉触底事件的处理函数
271 */ 241 */
272 onReachBottom: function() { 242 onReachBottom: function() {
  243 + let that = this;
  244 + let page = that.data.page;
273 245
  246 + page++;
  247 + that.setData({
  248 + page: page
  249 + })
  250 + that.info()
274 }, 251 },
275 252
276 /** 253 /**
@@ -34,7 +34,7 @@ @@ -34,7 +34,7 @@
34 </view> 34 </view>
35 <view class='container' bindtap='display' wx:else> 35 <view class='container' bindtap='display' wx:else>
36 <view class='mid'> 36 <view class='mid'>
37 - <view class='ware_box' wx:for='{{shop}}' wx:key="index"> 37 + <view class='ware_box' wx:for='{{shop}}' bindtap="shoptail" data-shop_id='{{item.shop_id}}' wx:key="index">
38 <view class='ware_top'> 38 <view class='ware_top'>
39 <view class='ware_1'> 39 <view class='ware_1'>
40 <image src='{{item.thumb}}'></image> 40 <image src='{{item.thumb}}'></image>
@@ -78,4 +78,35 @@ @@ -78,4 +78,35 @@
78 <view class='empty' wx:if="{{shop.length == 0}}">暂无更多结果</view> 78 <view class='empty' wx:if="{{shop.length == 0}}">暂无更多结果</view>
79 79
80 80
  81 +</view>
  82 +<!-- 弹窗 -->
  83 +<view class="mask" catchtouchmove="preventTouchMove" wx:if="{{showModal}}"></view>
  84 +<!-- 弹出层 -->
  85 +<view class="modalDlg" wx:if="{{showModal}}">
  86 + <view class='modalDlg_p'>
  87 + <view class='m_top'>
  88 + <view class='m_topImg'>
  89 + <image src='{{shop[index].thumb}}'></image>
  90 + </view>
  91 + <view class='m_topTxt'>
  92 + <view class='m_topTxt1'>
  93 + <view class='m_topName'>{{shop[index].name}}</view>
  94 + <image bindtap='m_close' src='../../img/cha.png'></image>
  95 + </view>
  96 + <view class='m_topTxt2'>
  97 + <view class='m_topPrice'>¥{{shop[index].money_sale}}</view>
  98 + <view class='m_topHelf'>{{shop[index].shop_type}}</view>
  99 + </view>
  100 + </view>
  101 + </view>
  102 + <view class='m_number'>
  103 + <view class='m_numTxt'>购买数量</view>
  104 + <view class='minus_push'>
  105 + <view class='minus' bindtap="bindMinus">-</view>
  106 + <view class='num' bindchange="bindManual">{{num}}</view>
  107 + <view class='push' bindtap="bindPlus">+</view>
  108 + </view>
  109 + </view>
  110 + <button class='m_btn' bindtap='goFirm_order1' data-id="{{shop[index].shop_id}}">确认</button>
  111 + </view>
81 </view> 112 </view>
@@ -318,4 +318,148 @@ @@ -318,4 +318,148 @@
318 margin-top: 120px; 318 margin-top: 120px;
319 text-align: center; 319 text-align: center;
320 color: #ccc; 320 color: #ccc;
  321 +}
  322 +/* 弹出层 */
  323 +
  324 +.modalDlg {
  325 + width: 100%;
  326 + height: 454rpx;
  327 + bottom: 0;
  328 + position: fixed;
  329 + z-index: 9999;
  330 + background-color: #fff;
  331 +}
  332 +
  333 +.modalDlg_p {
  334 + padding: 0 30rpx;
  335 +}
  336 +
  337 +.m_top {
  338 + display: flex;
  339 +}
  340 +
  341 +.m_topTxt1 {
  342 + display: flex;
  343 + align-self: center;
  344 + justify-content: space-between;
  345 + margin-top: 30rpx;
  346 +}
  347 +
  348 +.m_topTxt {
  349 + width: 100%;
  350 + margin-left: 16rpx;
  351 +}
  352 +
  353 +.m_topImg {
  354 + margin-top: -48rpx;
  355 + display: flex;
  356 +}
  357 +
  358 +.m_topImg image {
  359 + width: 208rpx;
  360 + height: 208rpx;
  361 +}
  362 +
  363 +.m_topTxt1 image {
  364 + width: 32rpx;
  365 + height: 32rpx;
  366 +}
  367 +
  368 +.m_topName {
  369 + font-size: 32rpx;
  370 + font-family: PingFang SC;
  371 + font-weight: 600;
  372 + color: rgba(51, 51, 51, 1);
  373 +}
  374 +
  375 +.m_topTxt2 {
  376 + display: flex;
  377 + margin-top: 16rpx;
  378 + align-items: center;
  379 +}
  380 +
  381 +.m_topPrice {
  382 + width: 120rpx;
  383 + overflow: hidden;
  384 + text-overflow: ellipsis;
  385 + white-space: nowrap;
  386 + font-size: 28rpx;
  387 + font-family: DIN 1451 Std Mittelschrift;
  388 + font-weight: 400;
  389 + color: #f00;
  390 +}
  391 +
  392 +.m_topHelf {
  393 + width: 280rpx;
  394 + overflow: hidden;
  395 + text-overflow: ellipsis;
  396 + white-space: nowrap;
  397 + font-size: 22rpx;
  398 + font-family: PingFang SC;
  399 + font-weight: 400;
  400 + margin-left: 16rpx;
  401 + color: rgba(204, 204, 204, 1);
  402 +}
  403 +
  404 +.m_number {
  405 + display: flex;
  406 + align-items: center;
  407 + margin-top: 18rpx;
  408 +}
  409 +
  410 +.minus_push {
  411 + display: flex;
  412 + margin-left: auto;
  413 + align-items: center;
  414 +}
  415 +
  416 +.m_numTxt {
  417 + font-size: 24rpx;
  418 + font-family: PingFang SC;
  419 + font-weight: 400;
  420 + color: rgba(153, 153, 153, 1);
  421 +}
  422 +
  423 +.minus, .push {
  424 + width: 48rpx;
  425 + height: 48rpx;
  426 + font-size: 40rpx;
  427 + text-align: center;
  428 + line-height: 48rpx;
  429 + border: 2px solid rgba(110, 172, 61, 1);
  430 + border-radius: 50%;
  431 +}
  432 +
  433 +.minus {
  434 + color: #6eac3d;
  435 +}
  436 +
  437 +.num {
  438 + margin: 0 26rpx;
  439 + font-size: 32rpx;
  440 + font-family: PingFang SC;
  441 + font-weight: 400;
  442 + color: rgba(110, 172, 61, 1);
  443 +}
  444 +
  445 +.push {
  446 + color: white;
  447 + background: rgba(110, 172, 61, 1);
  448 +}
  449 +
  450 +.m_btn {
  451 + width: 688rpx;
  452 + height: 80rpx;
  453 + border: 0;
  454 + margin-top: 62rpx;
  455 + font-size: 32rpx;
  456 + font-family: PingFang SC;
  457 + font-weight: 600;
  458 + color: rgba(255, 255, 255, 1);
  459 + background: linear-gradient(170deg, rgba(181, 222, 150, 1) 0%, rgba(169, 209, 33, 1) 100%);
  460 + box-shadow: 0rpx 6rpx 40rpx rgba(162, 255, 0, 0.15);
  461 + border-radius: 48rpx;
  462 +}
  463 +.ware_box:last-child{
  464 + margin-bottom: 0;
321 } 465 }
@@ -125,6 +125,44 @@ Page({ @@ -125,6 +125,44 @@ Page({
125 that.get_info() 125 that.get_info()
126 that.countDown() 126 that.countDown()
127 }, 127 },
  128 + info(event) {
  129 + let that = this
  130 + // if (that.data.keyword == '') {
  131 + // wx.showToast({
  132 + // title: '商品名称不能为空',
  133 + // icon: 'none',
  134 + // duration: 1000
  135 + // })
  136 + // return false
  137 + // }
  138 + // 接口地址
  139 + let url = app.interface.shopPage
  140 + let header = {
  141 + 'XX-Device-Type': 'wxapp',
  142 + 'XX-Token': wx.getStorageSync('token')
  143 + }
  144 + let paramer = {
  145 + page: that.data.page,
  146 + keyword: keyword
  147 + }
  148 +
  149 +
  150 + let keyword = this.data.keyword
  151 +
  152 + app.post(url, paramer, header).then((res) => {
  153 + console.log(res)
  154 + that.setData({
  155 + shop: res.data.shop,
  156 + type: false,
  157 + dis: false,
  158 + keyword: '',
  159 + shop: that.data.shop.concat(res.data.shop)
  160 + })
  161 + // that.get_info()
  162 + }).catch((errMsg) => {
  163 +
  164 + })
  165 + },
128 166
129 /** 167 /**
130 * 生命周期函数--监听页面隐藏 168 * 生命周期函数--监听页面隐藏
@@ -151,7 +189,14 @@ Page({ @@ -151,7 +189,14 @@ Page({
151 * 页面上拉触底事件的处理函数 189 * 页面上拉触底事件的处理函数
152 */ 190 */
153 onReachBottom: function () { 191 onReachBottom: function () {
  192 + let that = this;
  193 + let page = that.data.page;
154 194
  195 + page++;
  196 + that.setData({
  197 + page: page
  198 + })
  199 + that.info()
155 }, 200 },
156 201
157 /** 202 /**
@@ -277,4 +277,7 @@ @@ -277,4 +277,7 @@
277 margin-top: 120px; 277 margin-top: 120px;
278 text-align: center; 278 text-align: center;
279 color: #ccc; 279 color: #ccc;
  280 +}
  281 +.ware_box:last-child{
  282 + margin-bottom: 0;
280 } 283 }
@@ -13,7 +13,7 @@ @@ -13,7 +13,7 @@
13 }, 13 },
14 "compileType": "miniprogram", 14 "compileType": "miniprogram",
15 "libVersion": "2.6.2", 15 "libVersion": "2.6.2",
16 - "appid": "wxd577c8d542ca150e", 16 + "appid": "wx9f7abdcb841c8fb1",
17 "projectname": "teamshop", 17 "projectname": "teamshop",
18 "debugOptions": { 18 "debugOptions": {
19 "hidedInDevtools": [] 19 "hidedInDevtools": []