Commit 3732e84f authored by Aivs's avatar Aivs

添加我的EB

parent 5ffa6e8d
{
"pages": [
"pages/index/index",
"pages/clockin-list/clockin-list",
"pages/index2/index2",
"pages/search/search",
"pages/hotGoods/hotGoods",
......
const app = getApp();
import { request, formateWeek } from '../../utils/util.js';
import api from '../../config/api.js';
Page({
/**
* 页面的初始数据
*/
data: {
lists: [],
dataForm: {
page: 1,
limit: 15,
appId: 2030001,
searchAppId: 2030001,
},
types: {
0: '每日打卡',
1: '目标步数达成',
2: '赛程奖励',
},
totalPage: 0,
EBitems: [
{
name: '戈友商城EB',
},
{
name: '戈友圈EB',
},
{
name: '工商大道EB',
},
],
selindex: 0,
allEB: [
{
name: '全部',
},
{
name: '收入',
},
{
name: '支出',
},
],
ebindex: 0,
},
/**
* 获取已报名过的信息
*/
getData() {
const userId = wx.getStorageSync('userInfo').userId;
request(api.detailPoint, { ...this.data.dataForm, userId }, 'GET').then((res) => {
if (res.errno === 0) {
console.log(res);
const page = this.data.page;
const items = res.data.userPointRecordInApp;
console.log([...this.data.lists, ...items]);
this.setData({
lists: this.data.dataForm.page > 1 ? [...this.data.lists, ...items] : items,
totalRemainPoint: res.data.userRemainPoint,
totalPage: Math.ceil(res.data.totalLength / this.data.dataForm.limit),
});
} else {
wx.showToast({
title: res.errmsg, //提示的内容,
icon: 'none', //图标,
duration: 2000, //延迟时间,
success: (res) => {},
});
if (res.errno === 501) {
this.setData({
requestMethods: 'initData',
author: true,
});
}
}
});
},
selectItem(e) {
this.setData({
selindex: e.currentTarget.dataset.index,
});
let searchAppId = 2030001;
// if (e.currentTarget.dataset.index == 1) {
// searchAppId = 2030001;
// }
switch (e.currentTarget.dataset.index){
case 0:
searchAppId = 2030001;
break;
case 1:
searchAppId = 2010001;
break;
case 2:
searchAppId = 2060001;
break;
}
this.setData({
lists: [],
totalRemainPoint: '',
'dataForm.searchAppId': searchAppId,
});
this.getData();
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.getData();
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
this.setData({
lists: [],
'dataForm.page': 1,
});
this.getData();
setTimeout(() => {
wx.stopPullDownRefresh();
}, 300);
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
const dataForm = this.data.dataForm;
if (dataForm.page >= this.data.totalPage) {
wx.showToast({
title: '已没有更多数据',
icon: 'none',
duration: 2000,
});
} else {
this.setData({
'dataForm.page': dataForm.page + 1,
});
this.getData();
}
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {},
});
{
"navigationBarTitleText": "EB明细",
"enablePullDownRefresh": true,
"backgroundTextStyle": "dark",
"usingComponents": {}
}
\ No newline at end of file
<view class='container'>
<view class="top">
<!-- <view class="top-name">我的EB</view> -->
<view class='EB {{selindex==index?"ebwhite":""}}' wx:for='{{EBitems}}' wx:for-index='index' wx:key='index' bindtap='selectItem' data-index='{{index}}' >{{item.name}}</view>
</view>
<view class='content'>
<view class="lists">
<view class="list listtotal">
<view class="list-left">
<view class="list-content">总EB:<text class='count'>{{totalRemainPoint}}</text></view>
</view>
</view>
<view class="list allbox" wx:for="{{lists}}" wx:for-item="item" wx:for-index="index" wx:key="index">
<view class="">
<view class="list-content">{{item.appPointServiceName}}</view>
<view class="time">{{item.addTime}}</view>
</view>
<view class="">
<view class="count"><text wx:if='{{item.point>=0}}'>+</text>{{item.point}}EB</view>
</view>
</view>
</view>
</view>
<login loginshow="{{author}}" wx:if="{{author}}" bind:close="close"></login>
</view>
\ No newline at end of file
page {
background: #F5F5F5;
}
.container {
width: 100%;
background: #E31436
}
.flex{
display: flex;
justify-content: flex-start;
align-items: center;
}
.top {
width: 100%;
height: 110rpx;
overflow: hidden;
display: flex;
justify-content: flex-start;
}
.top-name {
font-size:36rpx;
color:rgba(255,255,255,1);
margin: 38rpx 40rpx 31rpx 40rpx;
line-height: 1;
}
.top-detail {
display: flex;
justify-content: space-between;
}
.content {
width: 100%;
padding-top: 24rpx;
padding-bottom: 30rpx;
background:rgba(246,246,246,1);
border-radius:40rpx 40rpx 0px 0px;
overflow: hidden;
}
.lists {
margin: 0 auto;
}
.list {
display: flex;
justify-content: space-between;
line-height: 1;
border-bottom: 2rpx dashed #989898;
overflow: hidden;
}
.listtotal{
height: 90rpx;
}
.list-left {
flex: 1;
margin-top: 30rpx;
padding:0 45rpx;
}
.list-content {
font-size:28rpx;
font-weight:400;
color:rgba(74,74,74,1);
}
.list-right {
margin-top: 28rpx;
}
.time {
font-size:24rpx;
font-weight:400;
color:rgba(152,152,152,1);
margin-top: 10rpx;
}
.count {
font-size:30rpx;
font-weight:400;
color:rgba(254,100,80,1);
}
.EB{
font-size:20rpx;
font-family:Helvetica;
color:rgba(255,255,255,1);
line-height:44rpx;
height:44rpx;
border-radius:40rpx;
border:1px solid rgba(255,255,255,1);
margin:28rpx;
padding:0 20rpx;
}
.ebwhite{
background-color: #fff;
color:#4A4A4A;
}
.allebitem{
font-size:28rpx;
font-family:PingFangSC-Regular,PingFang SC;
font-weight:400;
color:rgba(17,17,17,1);
line-height:40rpx;
margin-left:55rpx;
height: 50rpx;
}
.allebitem:first-child{
margin-left:0;
}
.allbox{
padding:26rpx 45rpx;
}
.yboder{
border-bottom: 1px solid rgba(254,100,80,1);
}
.backwhite{
background-color: #fff;
}
\ No newline at end of file
......@@ -92,6 +92,11 @@ Page({
});
}
},
goEBlist(){
wx.navigateTo({
url: '/pages/clockin-list/clockin-list',
})
},
goOrderIndex(e) {
if (this.data.hasLogin) {
let tab = e.currentTarget.dataset.index
......
......@@ -100,7 +100,7 @@
<text class='my-menu-name'>领券中心</text>
<image class='my-menu-arrow' src='/static/images/ucenter-more.png'></image>
</view>
<view class='my-menu my-integral'>
<view class='my-menu my-integral' bindtap='goEBlist'>
<view class='menu-icon'>
<image class='my-menu-icon' style="width:34rpx; height: 34rpx;" src="/static/images/my-integral.png"></image>
</view>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment