作者 吴孟雨

首页添加分页,团购列表和成交记录添加分页,优化申诉上传的图片格式,去掉活动详情的默认图,首页添加购买背景图接口,优化弹框高度

... ... @@ -104,8 +104,9 @@ Page({
const images = [];
const new_images = [];
images.push(self.data.image_params,self.data.image_params1,self.data.image_params2);
console.log('images push后',images);
images.map((item)=> {
if(item !== '') {
if(item !== undefined) {
new_images.push(item)
}
});
... ...
... ... @@ -56,7 +56,7 @@
<view class='review_content_box'>
<view class='review_img'>
<image src='{{item.images[0]}}' wx:if="{{item.re_description === ''}}"></image>
<image src='{{item.re_images}}' wx:if="{{item.re_description !== ''}}"></image>
<image src='{{item.re_images[0]}}' wx:if="{{item.re_description !== ''}}"></image>
</view>
<view class='review_content'>
<view class='review_info' wx:if="{{item.re_description === ''}}" >{{item.description}}</view>
... ...
... ... @@ -101,7 +101,7 @@ Page({
const new_images = [];
images.push(self.data.image_params,self.data.image_params1,self.data.image_params2);
images.map((item)=> {
if(item !== '') {
if(item !== undefined) {
new_images.push(item)
}
});
... ...
... ... @@ -2,8 +2,8 @@
<view class="content">
<view class="head" style="border-bottom: 20rpx solid #f2f2f2">
<view class="img_box">
<!--<image src="{{detail.thumb}}" class="activity_img" mode="aspectFill"></image>-->
<image src="../../../images/test_img.jpg" class="activity_img" mode="aspectFill"></image>
<image src="{{detail.thumb}}" class="activity_img" mode="aspectFill"></image>
<!--<image src="../../../images/test_img.jpg" class="activity_img" mode="aspectFill"></image>-->
</view>
<view class="title">
<view class="line"></view>
... ... @@ -15,7 +15,7 @@
</view>
<view class="jiexi" style="margin-bottom: 150rpx">
<image src="../../../images/i.jpg" style="width:100%;height:100%;"></image>
<!--<image src="../../../images/i.jpg" style="width:100%;height:100%;"></image>-->
<import src="/wxParse/wxParse.wxml"/>
<template is="wxParse" data="{{wxParseData:article.nodes}}"/>
</view>
... ...
... ... @@ -14,9 +14,27 @@ Page({
interval: 2000, //间隔时间
duration: 500, //滑动时间
this_week_test_info: {},
past_test_info: {},
past_test_info: [],
is_buy: false,
student_id: '',
page_number:1,
has_more:true,
},
//获取购买背景图
getBuyCard() {
let url = '/portal/Index/buy';
let header = {
"XX-token": wx.getStorageSync('token')
};
app.post(url, {}, {}).then((res) => {
console.log('获取购买背景图',res);
this.setData({buy_card: res.info})
// if (res.is_binding) {
// this.setData({is_bingding: true})
// } else {
// this.setData({is_bingding: false})
// }
})
},
//判断手机号是否绑定
checkMobile() {
... ... @@ -97,13 +115,19 @@ Page({
},
//获取往期实验
getPastWeekTest() {
if(!this.data.has_more) return;
this.setData({has_more: false});
let url = '/portal/Index/history';
let params = {
page: 1,
page: this.data.page_number,
}
app.post(url, params,{}).then((res) => {
// console.log(res);
this.setData({past_test_info: res})
console.log('获取往期实验',res);
if(res.this_page < res.total_page) {
this.setData({has_more: true});
}
// console.log('list', list);
this.setData({past_test_info: this.data.past_test_info.concat(res.list)});
// console.log(this.data.this_week_test_info);
})
},
... ... @@ -189,6 +213,7 @@ Page({
// self.checkMobile();
self.getTheWeekTest();
self.getPastWeekTest();
self.getBuyCard();
//获取当前城市
wx.getLocation({
type: 'wgs84',
... ... @@ -224,4 +249,17 @@ Page({
onShow() {
console.log('show-globalData',app.globalData.is_bingding,typeof(app.globalData.is_bingding));
},
onReachBottom: function () {
const self = this;
if(self.data.has_more) {
self.data.page_number ++;
self.getPastWeekTest();
}else {
wx.showToast({
title: '没有更多数据了~',
icon: 'none'
});
}
console.log('上拉加载');
},
});
... ...
... ... @@ -27,8 +27,9 @@
<!--购买-->
<view class="btn-box" bindtap="goBuyCard">
<view class="buy-btn">
<text>点击图片可跳转到购买页</text>
<image src="../../images/taimiao@2x.png" mode="aspectFill"></image>
<!--<text>点击图片可跳转到购买页</text>-->
<!--<image src="../../images/taimiao@2x.png" mode="aspectFill"></image>-->
<image src="{{buy_card}}" mode="aspectFill"></image>
</view>
</view>
... ... @@ -69,7 +70,7 @@
<view class="line"></view>
<text>往期实验</text>
</view>
<view wx:for="{{past_test_info.list}}" wx:key="index" data-index="{{index}}" data-id="{{item.id}}" bindtap="goTestDetail"
<view wx:for="{{past_test_info}}" wx:key="index" data-index="{{index}}" data-id="{{item.id}}" bindtap="goTestDetail"
data-is_the_week='{{false}}'>
<view class="test_box">
<view class="time">{{item.start_time}} - {{item.end_time}}</view>
... ...
... ... @@ -2,10 +2,10 @@
/* 团购成交记录 */
page {
height: 100%;
/* height: 100%; */
}
.content_box {
height: 100%;
/* height: 100%; */
}
.no-data {
width: 100%;
... ...
... ... @@ -31,7 +31,12 @@ Page({
//兑换并绑定按钮
chargeBtn(e) {
// console.log('34',e.detail);
// this.setData({
// // detail: e.detail,
// 'modal_data.is_showModal': true,
// 'modal_data.title': '绑定后无法更改,确认绑定' + this.data.picker_list[this.data.index] + '吗?',
// });
console.log('34',e.detail);
const self = this;
if(self.data.code === '') {
wx.showToast({title: '请输入兑换码!',icon: 'none'})
... ...
... ... @@ -4,7 +4,8 @@
}
.modal {
height: 224rpx;
/* height: 224rpx; */
/* min-height: 183rpx; */
position: absolute;
top: 280rpx;
left: 50%;
... ...
... ... @@ -9,7 +9,10 @@
data: {
current: 0,
chargenum: "",
page: 0,
group_page_number: 1,
record_page_number: 1,
group_has_more: true,
record_has_more: true,
groupList: [],
recordList: [],
pay_info: [],
... ... @@ -75,42 +78,49 @@
//参与的组团
takeGroup() {
if(!this.data.group_has_more) return;
this.setData({group_has_more: false});
let url = '/portal/Group/group_list'
let params = {
page: this.data.page
page: this.data.group_page_number
}
let header = {
"XX-Token": wx.getStorageSync('token')
}
app.post(url, params, header).then((res) => {
console.log(res)
this.setData({
groupList: res.list
})
if(res.this_page < res.total_page) {
this.setData({group_has_more: true});
}
// console.log('list', list);
this.setData({groupList: this.data.groupList.concat(res.list)});
})
},
//成交记录
record() {
if(!this.data.record_has_more) return;
this.setData({record_has_more: false});
let url = '/portal/Group/group_complete'
let params = {
page: this.data.page
page: this.data.record_page_number
}
let header = {
"XX-Token": wx.getStorageSync('token')
}
app.post(url, params, header).then((res) => {
console.log(res)
var recordList= res.list
for(var i=0;i<recordList.length;i++){
var chargeTime = recordList[i].create_time
chargeTime = time.formatTimeTwo(chargeTime, 'Y-M-D')
console.log(chargeTime)
recordList[i].create_time = chargeTime
if(res.this_page < res.total_page) {
this.setData({record_has_more: true});
}
this.setData({
recordList: recordList
})
var recordList= res.list
for(var i=0;i<recordList.length;i++){
var chargeTime = recordList[i].create_time
chargeTime = time.formatTimeTwo(chargeTime, 'Y-M-D')
console.log(chargeTime)
recordList[i].create_time = chargeTime
}
this.setData({recordList: this.data.recordList.concat(recordList)});
})
},
... ... @@ -210,6 +220,36 @@
this.PayDetail()
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
const self = this;
if(+self.data.current === 0) {
if(self.data.group_has_more) {
self.data.group_page_number ++;
self.takeGroup();
}else {
wx.showToast({
title: '没有更多数据了~',
icon: 'none'
});
}
console.log('上拉加载');
}else if(+self.data.current === 1) {
if(self.data.record_has_more) {
self.data.record_page_number ++;
self.record();
}else {
wx.showToast({
title: '没有更多数据了~',
icon: 'none'
});
}
console.log('上拉加载');
}
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
... ... @@ -246,13 +286,6 @@
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function() {
... ...