作者 刘晓艳

合并分支 'wumengyu' 到 'master'

Wumengyu



查看合并请求 !14
@@ -104,8 +104,9 @@ Page({ @@ -104,8 +104,9 @@ Page({
104 const images = []; 104 const images = [];
105 const new_images = []; 105 const new_images = [];
106 images.push(self.data.image_params,self.data.image_params1,self.data.image_params2); 106 images.push(self.data.image_params,self.data.image_params1,self.data.image_params2);
  107 + console.log('images push后',images);
107 images.map((item)=> { 108 images.map((item)=> {
108 - if(item !== '') { 109 + if(item !== undefined) {
109 new_images.push(item) 110 new_images.push(item)
110 } 111 }
111 }); 112 });
@@ -56,7 +56,7 @@ @@ -56,7 +56,7 @@
56 <view class='review_content_box'> 56 <view class='review_content_box'>
57 <view class='review_img'> 57 <view class='review_img'>
58 <image src='{{item.images[0]}}' wx:if="{{item.re_description === ''}}"></image> 58 <image src='{{item.images[0]}}' wx:if="{{item.re_description === ''}}"></image>
59 - <image src='{{item.re_images}}' wx:if="{{item.re_description !== ''}}"></image> 59 + <image src='{{item.re_images[0]}}' wx:if="{{item.re_description !== ''}}"></image>
60 </view> 60 </view>
61 <view class='review_content'> 61 <view class='review_content'>
62 <view class='review_info' wx:if="{{item.re_description === ''}}" >{{item.description}}</view> 62 <view class='review_info' wx:if="{{item.re_description === ''}}" >{{item.description}}</view>
@@ -101,7 +101,7 @@ Page({ @@ -101,7 +101,7 @@ Page({
101 const new_images = []; 101 const new_images = [];
102 images.push(self.data.image_params,self.data.image_params1,self.data.image_params2); 102 images.push(self.data.image_params,self.data.image_params1,self.data.image_params2);
103 images.map((item)=> { 103 images.map((item)=> {
104 - if(item !== '') { 104 + if(item !== undefined) {
105 new_images.push(item) 105 new_images.push(item)
106 } 106 }
107 }); 107 });
@@ -2,8 +2,8 @@ @@ -2,8 +2,8 @@
2 <view class="content"> 2 <view class="content">
3 <view class="head" style="border-bottom: 20rpx solid #f2f2f2"> 3 <view class="head" style="border-bottom: 20rpx solid #f2f2f2">
4 <view class="img_box"> 4 <view class="img_box">
5 - <!--<image src="{{detail.thumb}}" class="activity_img" mode="aspectFill"></image>-->  
6 - <image src="../../../images/test_img.jpg" class="activity_img" mode="aspectFill"></image> 5 + <image src="{{detail.thumb}}" class="activity_img" mode="aspectFill"></image>
  6 + <!--<image src="../../../images/test_img.jpg" class="activity_img" mode="aspectFill"></image>-->
7 </view> 7 </view>
8 <view class="title"> 8 <view class="title">
9 <view class="line"></view> 9 <view class="line"></view>
@@ -15,7 +15,7 @@ @@ -15,7 +15,7 @@
15 </view> 15 </view>
16 16
17 <view class="jiexi" style="margin-bottom: 150rpx"> 17 <view class="jiexi" style="margin-bottom: 150rpx">
18 - <image src="../../../images/i.jpg" style="width:100%;height:100%;"></image> 18 + <!--<image src="../../../images/i.jpg" style="width:100%;height:100%;"></image>-->
19 <import src="/wxParse/wxParse.wxml"/> 19 <import src="/wxParse/wxParse.wxml"/>
20 <template is="wxParse" data="{{wxParseData:article.nodes}}"/> 20 <template is="wxParse" data="{{wxParseData:article.nodes}}"/>
21 </view> 21 </view>
@@ -14,9 +14,27 @@ Page({ @@ -14,9 +14,27 @@ Page({
14 interval: 2000, //间隔时间 14 interval: 2000, //间隔时间
15 duration: 500, //滑动时间 15 duration: 500, //滑动时间
16 this_week_test_info: {}, 16 this_week_test_info: {},
17 - past_test_info: {}, 17 + past_test_info: [],
18 is_buy: false, 18 is_buy: false,
19 student_id: '', 19 student_id: '',
  20 + page_number:1,
  21 + has_more:true,
  22 + },
  23 + //获取购买背景图
  24 + getBuyCard() {
  25 + let url = '/portal/Index/buy';
  26 + let header = {
  27 + "XX-token": wx.getStorageSync('token')
  28 + };
  29 + app.post(url, {}, {}).then((res) => {
  30 + console.log('获取购买背景图',res);
  31 + this.setData({buy_card: res.info})
  32 + // if (res.is_binding) {
  33 + // this.setData({is_bingding: true})
  34 + // } else {
  35 + // this.setData({is_bingding: false})
  36 + // }
  37 + })
20 }, 38 },
21 //判断手机号是否绑定 39 //判断手机号是否绑定
22 checkMobile() { 40 checkMobile() {
@@ -97,13 +115,19 @@ Page({ @@ -97,13 +115,19 @@ Page({
97 }, 115 },
98 //获取往期实验 116 //获取往期实验
99 getPastWeekTest() { 117 getPastWeekTest() {
  118 + if(!this.data.has_more) return;
  119 + this.setData({has_more: false});
100 let url = '/portal/Index/history'; 120 let url = '/portal/Index/history';
101 let params = { 121 let params = {
102 - page: 1, 122 + page: this.data.page_number,
103 } 123 }
104 app.post(url, params,{}).then((res) => { 124 app.post(url, params,{}).then((res) => {
105 - // console.log(res);  
106 - this.setData({past_test_info: res}) 125 + console.log('获取往期实验',res);
  126 + if(res.this_page < res.total_page) {
  127 + this.setData({has_more: true});
  128 + }
  129 + // console.log('list', list);
  130 + this.setData({past_test_info: this.data.past_test_info.concat(res.list)});
107 // console.log(this.data.this_week_test_info); 131 // console.log(this.data.this_week_test_info);
108 }) 132 })
109 }, 133 },
@@ -189,6 +213,7 @@ Page({ @@ -189,6 +213,7 @@ Page({
189 // self.checkMobile(); 213 // self.checkMobile();
190 self.getTheWeekTest(); 214 self.getTheWeekTest();
191 self.getPastWeekTest(); 215 self.getPastWeekTest();
  216 + self.getBuyCard();
192 //获取当前城市 217 //获取当前城市
193 wx.getLocation({ 218 wx.getLocation({
194 type: 'wgs84', 219 type: 'wgs84',
@@ -224,4 +249,17 @@ Page({ @@ -224,4 +249,17 @@ Page({
224 onShow() { 249 onShow() {
225 console.log('show-globalData',app.globalData.is_bingding,typeof(app.globalData.is_bingding)); 250 console.log('show-globalData',app.globalData.is_bingding,typeof(app.globalData.is_bingding));
226 }, 251 },
  252 + onReachBottom: function () {
  253 + const self = this;
  254 + if(self.data.has_more) {
  255 + self.data.page_number ++;
  256 + self.getPastWeekTest();
  257 + }else {
  258 + wx.showToast({
  259 + title: '没有更多数据了~',
  260 + icon: 'none'
  261 + });
  262 + }
  263 + console.log('上拉加载');
  264 + },
227 }); 265 });
@@ -27,8 +27,9 @@ @@ -27,8 +27,9 @@
27 <!--购买--> 27 <!--购买-->
28 <view class="btn-box" bindtap="goBuyCard"> 28 <view class="btn-box" bindtap="goBuyCard">
29 <view class="buy-btn"> 29 <view class="buy-btn">
30 - <text>点击图片可跳转到购买页</text>  
31 - <image src="../../images/taimiao@2x.png" mode="aspectFill"></image> 30 + <!--<text>点击图片可跳转到购买页</text>-->
  31 + <!--<image src="../../images/taimiao@2x.png" mode="aspectFill"></image>-->
  32 + <image src="{{buy_card}}" mode="aspectFill"></image>
32 </view> 33 </view>
33 </view> 34 </view>
34 35
@@ -69,7 +70,7 @@ @@ -69,7 +70,7 @@
69 <view class="line"></view> 70 <view class="line"></view>
70 <text>往期实验</text> 71 <text>往期实验</text>
71 </view> 72 </view>
72 - <view wx:for="{{past_test_info.list}}" wx:key="index" data-index="{{index}}" data-id="{{item.id}}" bindtap="goTestDetail" 73 + <view wx:for="{{past_test_info}}" wx:key="index" data-index="{{index}}" data-id="{{item.id}}" bindtap="goTestDetail"
73 data-is_the_week='{{false}}'> 74 data-is_the_week='{{false}}'>
74 <view class="test_box"> 75 <view class="test_box">
75 <view class="time">{{item.start_time}} - {{item.end_time}}</view> 76 <view class="time">{{item.start_time}} - {{item.end_time}}</view>
@@ -2,10 +2,10 @@ @@ -2,10 +2,10 @@
2 2
3 /* 团购成交记录 */ 3 /* 团购成交记录 */
4 page { 4 page {
5 - height: 100%; 5 + /* height: 100%; */
6 } 6 }
7 .content_box { 7 .content_box {
8 - height: 100%; 8 + /* height: 100%; */
9 } 9 }
10 .no-data { 10 .no-data {
11 width: 100%; 11 width: 100%;
@@ -31,7 +31,12 @@ Page({ @@ -31,7 +31,12 @@ Page({
31 31
32 //兑换并绑定按钮 32 //兑换并绑定按钮
33 chargeBtn(e) { 33 chargeBtn(e) {
34 - // console.log('34',e.detail); 34 + // this.setData({
  35 + // // detail: e.detail,
  36 + // 'modal_data.is_showModal': true,
  37 + // 'modal_data.title': '绑定后无法更改,确认绑定' + this.data.picker_list[this.data.index] + '吗?',
  38 + // });
  39 + console.log('34',e.detail);
35 const self = this; 40 const self = this;
36 if(self.data.code === '') { 41 if(self.data.code === '') {
37 wx.showToast({title: '请输入兑换码!',icon: 'none'}) 42 wx.showToast({title: '请输入兑换码!',icon: 'none'})
@@ -4,7 +4,8 @@ @@ -4,7 +4,8 @@
4 4
5 } 5 }
6 .modal { 6 .modal {
7 - height: 224rpx; 7 + /* height: 224rpx; */
  8 + /* min-height: 183rpx; */
8 position: absolute; 9 position: absolute;
9 top: 280rpx; 10 top: 280rpx;
10 left: 50%; 11 left: 50%;
@@ -10,7 +10,10 @@ @@ -10,7 +10,10 @@
10 data: { 10 data: {
11 current: 0, 11 current: 0,
12 chargenum: "", 12 chargenum: "",
13 - page: 0, 13 + group_page_number: 1,
  14 + record_page_number: 1,
  15 + group_has_more: true,
  16 + record_has_more: true,
14 groupList: [], 17 groupList: [],
15 recordList: [], 18 recordList: [],
16 pay_info: [], 19 pay_info: [],
@@ -88,23 +91,28 @@ @@ -88,23 +91,28 @@
88 91
89 //成交记录 92 //成交记录
90 record() { 93 record() {
  94 + if(!this.data.record_has_more) return;
  95 + this.setData({record_has_more: false});
91 let url = '/portal/Group/group_complete' 96 let url = '/portal/Group/group_complete'
92 let params = { 97 let params = {
93 - page: this.data.page 98 + page: this.data.record_page_number
94 } 99 }
95 let header = { 100 let header = {
96 "XX-Token": wx.getStorageSync('token') 101 "XX-Token": wx.getStorageSync('token')
97 } 102 }
98 app.post(url, params, header).then((res) => { 103 app.post(url, params, header).then((res) => {
99 - var recordList = res.list  
100 - for (var i = 0; i < recordList.length; i++) {  
101 - var chargeTime = recordList[i].create_time  
102 - chargeTime = time.formatTimeTwo(chargeTime, 'Y-M-D')  
103 - recordList[i].create_time = chargeTime 104 + console.log(res)
  105 + if(res.this_page < res.total_page) {
  106 + this.setData({record_has_more: true});
104 } 107 }
105 - this.setData({  
106 - recordList: recordList  
107 - }) 108 + var recordList= res.list
  109 + for(var i=0;i<recordList.length;i++){
  110 + var chargeTime = recordList[i].create_time
  111 + chargeTime = time.formatTimeTwo(chargeTime, 'Y-M-D')
  112 + console.log(chargeTime)
  113 + recordList[i].create_time = chargeTime
  114 + }
  115 + this.setData({recordList: this.data.recordList.concat(recordList)});
108 }) 116 })
109 }, 117 },
110 118
@@ -196,9 +204,11 @@ @@ -196,9 +204,11 @@
196 204
197 //参与的组团 205 //参与的组团
198 takeGroup() { 206 takeGroup() {
  207 + if(!this.data.group_has_more) return;
  208 + this.setData({group_has_more: false});
199 let url = '/portal/Group/group_list' 209 let url = '/portal/Group/group_list'
200 let params = { 210 let params = {
201 - page: this.data.page 211 + page: this.data.group_page_number
202 } 212 }
203 let header = { 213 let header = {
204 "XX-Token": wx.getStorageSync('token') 214 "XX-Token": wx.getStorageSync('token')
@@ -224,10 +234,14 @@ @@ -224,10 +234,14 @@
224 }); 234 });
225 // console.log(endTimeList) 235 // console.log(endTimeList)
226 this.countDown(); 236 this.countDown();
  237 + if(res.this_page < res.total_page) {
  238 + this.setData({group_has_more: true});
  239 + }
  240 + // console.log('list', list);
227 this.setData({ 241 this.setData({
228 - groupList: res.list,  
229 - goodsList: goodsList  
230 - }) 242 + groupList: this.data.groupList.concat(res.list),
  243 + goodsList: goodsList
  244 + });
231 }) 245 })
232 }, 246 },
233 247
@@ -299,6 +313,36 @@ @@ -299,6 +313,36 @@
299 313
300 }, 314 },
301 315
  316 + /**
  317 + * 页面上拉触底事件的处理函数
  318 + */
  319 + onReachBottom: function () {
  320 + const self = this;
  321 + if(+self.data.current === 0) {
  322 + if(self.data.group_has_more) {
  323 + self.data.group_page_number ++;
  324 + self.takeGroup();
  325 + }else {
  326 + wx.showToast({
  327 + title: '没有更多数据了~',
  328 + icon: 'none'
  329 + });
  330 + }
  331 + console.log('上拉加载');
  332 + }else if(+self.data.current === 1) {
  333 + if(self.data.record_has_more) {
  334 + self.data.record_page_number ++;
  335 + self.record();
  336 + }else {
  337 + wx.showToast({
  338 + title: '没有更多数据了~',
  339 + icon: 'none'
  340 + });
  341 + }
  342 + console.log('上拉加载');
  343 + }
  344 +
  345 + },
302 /** 346 /**
303 * 生命周期函数--监听页面初次渲染完成 347 * 生命周期函数--监听页面初次渲染完成
304 */ 348 */
@@ -335,13 +379,6 @@ @@ -335,13 +379,6 @@
335 }, 379 },
336 380
337 /** 381 /**
338 - * 页面上拉触底事件的处理函数  
339 - */  
340 - onReachBottom: function() {  
341 -  
342 - },  
343 -  
344 - /**  
345 * 用户点击右上角分享 382 * 用户点击右上角分享
346 */ 383 */
347 onShareAppMessage: function() { 384 onShareAppMessage: function() {