first commit

This commit is contained in:
编码猿
2024-09-27 01:32:49 +08:00
commit 28ebe05a64
7399 changed files with 1174529 additions and 0 deletions

View File

@@ -0,0 +1 @@
cbef32dc-8f9a-4e53-ba36-2c4ff07ca5f3

View File

@@ -0,0 +1,186 @@
// user/parIncome/parIncome.js
const app = getApp();
const regeneratorRuntime = app.loadAsync()
const model = app.loadModel("index")
const http = app.loadHttp()
Page({
/**
* 页面的初始数据
*/
data: {
system: app.globalData.system, //设备相关信息
pageTitle: "我的返利", //头部标题
isBack: true,//显示返回
isLoading: true,//加载显示关闭
current: '0',//当前所在的标签的 key 值
tabs: ["我推荐的人", "积分记录", "佣金记录"],
page: 1,//当前页码
isPage: true,//当前接口无数据,
recommendList: [],//推荐人列表
score: [],//积分记录
commission: [],//佣金记录
userInfo: {},//用户信息
},
// 获取用户个人信息
userInfo() {
this.setData({
userInfo: app.globalData.userInfo
})
},
// tab选中事件
// 切换tab时把该清空的清空
handleChange(e) {
let index = e.currentTarget.dataset.index
this.setData({
current: index,
page: 1,
isPage: true,
recommendList: [],
score: [],
commission: []
});
this.isSwitch(index)
},
isSwitch(index) {
switch (index) {
case 0:
this.allRecord(http.api.recommend, 0)
break;
case 1:
this.allRecord(http.api.score, 1)
break;
case 2:
this.allRecord(http.api.withDrawRecord, 2)
break;
default:
break;
}
},
//回到顶部
goTop: function (e) { // 一键回到顶部
if (wx.pageScrollTo) {
wx.pageScrollTo({
scrollTop: 0
})
} else {
wx.showModal({
title: '提示',
content: '当前微信版本过低,无法使用该功能,请升级到最新微信版本后重试。'
})
}
},
// 所有记录 0 推荐人列表 1 积分记录 2 佣金记录
async allRecord(url, index) {
if (!this.data.isPage) {
return
}
let data = {
page: this.data.page,
limit: 10
}
let res = await http.http.request2({ url: url, method: "POST", data: data })
if (res.data.data.list.length < 10) {
this.setData({
isPage: false
})
}
let rel = res.data.data.list
switch (index) {
case 0:
let recommendList = this.data.recommendList
this.setData({
recommendList: [...recommendList, ...rel],
isLoading: false
})
break;
case 1:
let score = this.data.score
this.setData({
score: [...score, ...rel],
isLoading: false
})
break;
case 2:
let commission = this.data.commission
this.setData({
commission: [...commission, ...rel],
isLoading: false
})
break;
default:
this.setData({
isLoading: false
})
break;
}
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.setData({
current: options.index || 0
})
if (options['index']) {
this.isSwitch(parseInt(options['index']))
} else {
this.isSwitch(0)
}
this.userInfo()
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
this.userInfo()
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
if (this.data.isPage) {
this.setData({
page: ++this.data.page
})
this.isSwitch(this.data.current)
}
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})

View File

@@ -0,0 +1,5 @@
{
"navigationBarTextStyle": "black",
"usingComponents": {
}
}

View File

@@ -0,0 +1,68 @@
<!-- 头部 -->
<nav-bar isBack="{{isBack}}" pageTitle="{{pageTitle}}" system="{{system}}"></nav-bar>
<!-- user/parIncome/parIncome.wxml -->
<view class="parIncome">
<view class="parIncome_title" style="top:{{system.statusHeight+system.titleHeight+'px'}}">
<view class="parIncome_img">
<view class="flex1">
<view class="par_title">
<span>积分合计</span>
</view>
<view class="par_num">{{userInfo.integral}} <navigator class="span" url="/user/couponExchange/couponExchange">兑换</navigator></view>
</view>
<view class="flex1">
<view class="par_title">
<span>佣金合计(元)</span>
</view>
<view class="par_num">{{userInfo.distribution_money}} <navigator class="span" url="/user/cashWithdrawal/cashWithdrawal">提现</navigator></view>
</view>
</view>
<view class="mt20">
<view class="tabs">
<view wx:for="{{tabs}}" wx:key="{{index}}" bind:tap="handleChange" data-index="{{index}}" class="tab {{current == index?'tabActiv':''}}">
{{item}}
</view>
</view>
</view>
</view>
<view class="data_con">
<scroll-view wx:if="{{ current == 0 }}" class="recommender">
<view wx:for="{{recommendList}}" wx:key="{{index}}" class="recom_list">
<view class="recom_list_row">
<image src="{{item.avatar}}" />
<span class="ml20">{{item.nickname}}</span>
</view>
<view class="recom_list_row recom_row_r">{{item.create_time}}</view>
</view>
<view wx:if="{{ !isPage }}" class="ending">没有更多了</view>
</scroll-view>
<scroll-view wx:if="{{ current == 1 }}" class="recommender">
<view wx:for="{{score}}" wx:key="{{index}}" class="recom_list">
<view class="recom_list_row">
<view>
<view class="mode">{{item.title}}</view>
<view class="mode_time mt10">{{item.create_time}}</view>
</view>
</view>
<view class="recom_list_row recom_row_r mode_num">{{item.intergral}}</view>
</view>
<view wx:if="{{ !isPage }}" class="ending">没有更多了</view>
</scroll-view>
<scroll-view wx:if="{{ current == 2 }}" class="recommender">
<view wx:for="{{commission}}" wx:key="{{index}}" class="recom_list">
<view class="recom_list_row">
<view>
<view class="mode">{{item.type == 1?'提现':'佣金收益'}}</view>
<view class="mode_time mt10">{{item.create_time}}</view>
</view>
</view>
<view class="recom_list_row recom_row_r mode_num">{{item.distribution_money}}</view>
</view>
<view wx:if="{{ !isPage }}" class="ending">没有更多了</view>
</scroll-view>
</view>
</view>
<!-- 加载动画 -->
<loading-prog isLoading="{{isLoading}}"></loading-prog>
<!-- toasta提示 -->
<i-toast id="toast" />

View File

@@ -0,0 +1,169 @@
/* user/parIncome/parIncome.wxss */
page{
background: #ffffff;
}
.parIncome_title{
position: fixed;
height: 360rpx;
width: 100%;
background: #f5f5f5;
padding: 30rpx 30rpx 0rpx 30rpx;
z-index: 998;
}
.parIncome_img{
height: 210rpx;
background: #fdaf44 center no-repeat;
background-size: 100%;
position: relative;
display: flex;
justify-content: center;
overflow: hidden;
align-items: center;
}
.parIncome_img .images{
position: absolute;
bottom: 0;
left: 0;
right: 0;
height: 100rpx;
width: 100%;
mix-blend-mode: screen;
}
.par_title{
font-size: 28rpx;
color: #ffffff;
display: -webkit-flex;
display: flex;
-webkit-align-items: center;
align-items: center;
-webkit-justify-content: center;
justify-content: center;
}
.par_title span{
display: inline-block;
}
.par_num{
margin-top: 14rpx;
font-size: 60rpx;
color: #ffffff;
text-align: center;
overflow: hidden;
}
.par_num .span{
font-family: PingFang-SC-Medium;
text-decoration: underline;
font-size: 28rpx;
font-weight: normal;
font-stretch: normal;
line-height: 36px;
letter-spacing: 0px;
color: #ffffff;
display: inline-block;
background-color: rgba(0, 0, 0, 0);
}
.tabs{
width: 100%;
display: flex;
}
.tab{
line-height: 100rpx;
text-align: center;
flex: 2;
font-size: 28rpx;
color: #333333;
position: relative;
}
.tabActiv{
font-size: 40rpx;
}
.tabActiv::before{
position: absolute;
content: "";
bottom: 0;
left: 50%;
margin-left: -32rpx;
width: 64rpx;
height: 8rpx;
background-color: #1dbf53;
border-radius: 4rpx;
}
.data_con{
margin-top: 360rpx;
}
.recom_list{
height: 100rpx;
display: flex;
border-bottom: 2rpx solid #ebebeb;
padding: 0 30rpx;
}
.recom_list_row{
flex: 2;
display: -webkit-flex;
display: flex;
-webkit-align-items: center;
align-items: center;
}
.recom_list_row image{
width: 50rpx;
height: 50rpx;
border-radius: 50%;
overflow: hidden;
}
.recom_list_row span{
font-size: 32rpx;
color: #333333;
}
.recom_row_r{
text-align: right;
font-size: 26rpx;
color: #999999;
-webkit-justify-content: flex-end;
justify-content: flex-end;
}
.mode{
font-size: 30rpx;
color: #333333;
}
.mode_time{
font-size: 22rpx;
color: #999999;
}
.mode_num{
font-family: PingFang-SC-Bold;
font-size: 28rpx;
color: #fd933f;
font-weight: 600;
}
.ending{
height: 120rpx;
line-height: 120rpx;
text-align: center;
font-size: 26rpx;
color: #999999;
position: relative;
}
.ending::after{
position: absolute;
content: "";
width: 50rpx;
height: 4rpx;
background-color: #cccccc;
top: 50%;
left: 50%;
margin: -2rpx 0 0 100rpx;
}
.ending::before{
position: absolute;
content: "";
width: 50rpx;
height: 4rpx;
background-color: #cccccc;
top: 50%;
right: 50%;
margin: -2rpx 100rpx 0 0;
}