Commit 0a1bbdd9 by wangyalan-git

分佣模块

parent 306fed17
// pages/person/person2.js // pages/person/person2.js
var http = require("../../utils/http.js");
// var util = require('../../config/util.js'); var app = getApp()
// var api = require('../../config/api.js');
// var user = require('../../services/user.js');
Page({ Page({
/** /**
...@@ -20,25 +16,18 @@ Page({ ...@@ -20,25 +16,18 @@ Page({
}, },
// 获取分销基础信息 // 获取分销基础信息
distribution(token) { distribution() {
var that = this; var params = {
util.request(api.distribution, { token: token }).then(res => { url: "/commission/getCommissionCenter",
console.log(res) method: "GET",
that.setData({ data: {},
pageInfo: res.data callBack: (res) => {
}) this.setData({
}) pageInfo: res.result
}, })
}
// 提现信息 };
myAccount(token) { http.request(params);
var that = this;
var token = wx.getStorageSync('token');
util.request(api.myAccount, { 'token': token }).then(res => {
that.setData({
myAccountInfo: res.data
})
})
}, },
// 页面跳转 // 页面跳转
...@@ -52,7 +41,7 @@ Page({ ...@@ -52,7 +41,7 @@ Page({
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { onLoad: function (options) {
}, },
/** /**
...@@ -66,10 +55,11 @@ Page({ ...@@ -66,10 +55,11 @@ Page({
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow: function () { onShow: function () {
// let that = this; this.setData({
// var token = wx.getStorageSync('token'); userInfo: app.globalData.userInfo
// that.distribution(token); })
// that.myAccount(token); this.distribution();
// this.myAccount(token);
}, },
...@@ -106,55 +96,7 @@ Page({ ...@@ -106,55 +96,7 @@ Page({
*/ */
onShareAppMessage: function () { onShareAppMessage: function () {
}, }
clickLogin() {
user.checkLogin().then(res => {
console.log('has login');
}).catch(() => {
wx.navigateTo({
url: '/pages/auth/login/login',
});
});
},
toset() {
// wx.navigateTo({
// url: "/pages/baoming/baoming"
// });
// return;
user.checkLogin().then(res => {
wx.navigateTo({
url: '/pages/person/personSet/personSet'
});
}).catch(() => {
wx.navigateTo({
url: '/pages/auth/login/login',
});
});
},
clickOrder(event) {
let idx = event.currentTarget.dataset.index;
user.checkLogin().then(res => {
if (idx == 5) {
wx.navigateTo({
url: '/pages/orders/addressSelect/address',
})
} else {
wx.navigateTo({
url: '/pages/orders/orderList/index?index=' + idx,
});
}
}).catch(() => {
wx.navigateTo({
url: '/pages/auth/login/login',
});
});
},
}) })
<!--pages/me/me.wxml--> <!--pages/me/me.wxml-->
<view class="view-page"> <view class="view-page">
<!-- 用户信息-背景 --> <!-- 用户信息-背景 -->
<image class="background-img-head" src="../../images/bg@2x.png"></image> <!-- <image class="background-img-head" src="../../images/bg@2x.png"></image> -->
<!-- 用户信息 --> <!-- 用户信息 -->
<view class="user-info-box"> <view class="user-info-box">
<!-- 信息 --> <!-- 信息 -->
<view class="user-info-show"> <view class="user-info-show">
<image class="user-portrait" src="{{pageInfo.userInfo.picture}}"></image> <image class="user-portrait" src="{{userInfo.pic}}"></image>
<view class="user-name"> <view class="user-name">
<view>{{pageInfo.userInfo.userName}}</view> <view>{{userInfo.nickName}}</view>
<view>推荐人:您是由{{pageInfo.userInfo.parentName}}推荐</view> <view>推荐人:您是由{{pageInfo.parentMame}}推荐</view>
</view> </view>
</view> </view>
<!-- 数字 --> <!-- 数字 -->
<view class="user-info-num"> <view class="user-info-num">
<view> <view>
<text>{{myAccountInfo ? myAccountInfo.withdrawalSuccessful : 0}}</text> <text>{{pageInfo.cashAmount || 0}}</text>
<text>成功提现佣金</text> <text>成功提现佣金</text>
</view> </view>
<view> <view>
<text>{{myAccountInfo ? myAccountInfo.incomeTotal : 0}}</text> <text>{{pageInfo.userAccount || 0}}</text>
<text>可提现佣金</text> <text>可提现佣金</text>
</view> </view>
</view> </view>
...@@ -32,14 +32,14 @@ ...@@ -32,14 +32,14 @@
<image src="../../images/icon/team@2x.png"></image> <image src="../../images/icon/team@2x.png"></image>
<view> <view>
<text>我的团队</text> <text>我的团队</text>
<text>{{pageInfo.teamNum}}人</text> <text>{{pageInfo.teamNumber || 0}}人</text>
</view> </view>
</view> </view>
<view class="menu-li" bindtap="goPage" data-page="/pages/userAccount/distributionOrder/index"> <view class="menu-li" bindtap="goPage" data-page="/pages/userAccount/distributionOrder/index">
<image src="../../images/icon/management@2x.png"></image> <image src="../../images/icon/management@2x.png"></image>
<view> <view>
<text>分销订单</text> <text>分销订单</text>
<text>{{pageInfo.distributionOrderNum}}笔</text> <text>{{pageInfo.commissionOrderTimes || 0}}笔</text>
</view> </view>
</view> </view>
</view> </view>
...@@ -48,14 +48,14 @@ ...@@ -48,14 +48,14 @@
<image src="../../images/icon/commission@2x.png"></image> <image src="../../images/icon/commission@2x.png"></image>
<view> <view>
<text>佣金明细</text> <text>佣金明细</text>
<text>{{pageInfo.commissionNum}}笔</text> <text>{{pageInfo.commissionOrderTimes || 0}}笔</text>
</view> </view>
</view> </view>
<view class="menu-li" bindtap="goPage" data-page="/pages/userAccount/withdrawalRecord/index"> <view class="menu-li" bindtap="goPage" data-page="/pages/userAccount/withdrawalRecord/index">
<image src="../../images/icon/detaileds@2x.png"></image> <image src="../../images/icon/detaileds@2x.png"></image>
<view> <view>
<text>提现明细</text> <text>提现明细</text>
<text>{{pageInfo.withdrawalSuccessful}}笔</text> <text>{{pageInfo.cashRecordTimes}}笔</text>
</view> </view>
</view> </view>
</view> </view>
...@@ -71,7 +71,7 @@ ...@@ -71,7 +71,7 @@
<image src="../../images/icon/cash.png"></image> <image src="../../images/icon/cash.png"></image>
<view> <view>
<text>我要提现</text> <text>我要提现</text>
<text>{{pageInfo.toBeWithdrawal}}元</text> <text>{{pageInfo.userAccount || 0}}元</text>
</view> </view>
</view> </view>
</view> </view>
......
...@@ -12,7 +12,7 @@ page { ...@@ -12,7 +12,7 @@ page {
.background-img-head{ .background-img-head{
width: 100%; width: 100%;
height: 400rpx; /* height: 400rpx; */
margin-bottom: 40rpx; margin-bottom: 40rpx;
} }
...@@ -21,12 +21,10 @@ page { ...@@ -21,12 +21,10 @@ page {
height: 330rpx; height: 330rpx;
border-radius: 20rpx; border-radius: 20rpx;
background: white; background: white;
position: absolute;
top: 80rpx;
left: 30rpx;
display: flex; display: flex;
align-items: center; align-items: center;
flex-direction: column; flex-direction: column;
margin: 20rpx 0;
} }
.user-info-show{ .user-info-show{
...@@ -73,7 +71,7 @@ page { ...@@ -73,7 +71,7 @@ page {
.rule{ .rule{
width: 120rpx; width: 120rpx;
height: 50rpx; height: 50rpx;
background: #030521; background: #3a86b9;
border-radius: 25rpx; border-radius: 25rpx;
text-align: center; text-align: center;
line-height: 50rpx; line-height: 50rpx;
......
...@@ -24,7 +24,7 @@ Page({ ...@@ -24,7 +24,7 @@ Page({
url: '../logs/logs' url: '../logs/logs'
}) })
}, },
onLoad: function () { onLoad: function (options) {
let token = wx.getStorageSync('token') let token = wx.getStorageSync('token')
this.getAllData(); this.getAllData();
// 如果是点击转发跳转进来,分析参数page // 如果是点击转发跳转进来,分析参数page
......
{ {
"usingComponents": {}, "usingComponents": {},
"navigationBarTitleText": "邀请海报", "navigationBarTitleText": "邀请海报",
"navigationBarBackgroundColor": "#000000", "navigationBarBackgroundColor": "#fff",
"navigationBarTextStyle": "white" "navigationBarTextStyle": "black"
} }
\ No newline at end of file
/* pages/ininvite/ininvite.wxss */ /* pages/ininvite/ininvite.wxss */
page{ page{
background-color: #000000; background-color: #fff;
} }
.box{ .box{
width: 100%; width: 100%;
......
...@@ -13,8 +13,8 @@ ...@@ -13,8 +13,8 @@
</view> </view>
<view class="prod-col" style="margin-top: 0;padding-top: 0;"> <view class="prod-col" style="margin-top: 0;padding-top: 0;">
<view class="col-item" bindtap=''> <view class="col-item" bindtap=''>
<view class="num">{{userAccount.amount || 0}}</view> <view class="num">{{(userAccount.amount + userAccount.waitAmount) || 0}}</view>
<view class="tit">额</view> <view class="tit">额</view>
</view> </view>
<view class="col-item"> <view class="col-item">
<view class="num">{{userAccount.integral || 0}}</view> <view class="num">{{userAccount.integral || 0}}</view>
...@@ -85,20 +85,6 @@ ...@@ -85,20 +85,6 @@
</view> </view>
<view class='arrowhead'></view> <view class='arrowhead'></view>
</view> </view>
<view class='memu-item' bindtap='toCouponCenter'>
<view class="i-name">
<image src='../../images/icon/getCoupon.png'></image>
<text>领券中心</text>
</view>
<view class='arrowhead'></view>
</view>
<view class='memu-item' bindtap='toMyCouponPage'>
<view class="i-name">
<image src='../../images/icon/myCoupon.png'></image>
<text>我的优惠券</text>
</view>
<view class='arrowhead'></view>
</view>
<view class='memu-item' bindtap='toInvitePage'> <view class='memu-item' bindtap='toInvitePage'>
<view class="i-name"> <view class="i-name">
<image src='../../images/icon/toDelivery.png'></image> <image src='../../images/icon/toDelivery.png'></image>
......
// pages/newly/redpacket.js // pages/newly/redpacket.js
// var util = require('../../config/util.js'); var http = require("../../../utils/http.js");
// var api = require('../../config/api.js'); var app = getApp()
Page({ Page({
/** /**
...@@ -13,72 +13,88 @@ Page({ ...@@ -13,72 +13,88 @@ Page({
actualAmount: '', actualAmount: '',
how: false,//是否显示如何上传收款码提示框 how: false,//是否显示如何上传收款码提示框
}, },
getRate() {
var params = {
url: "/apiCommon/getBaseParamByCode",
method: "GET",
data: {
paramCode: 'cash_service_rate'
},
callBack: (res) => {
let rate = JSON.parse(res.result.paramValue).rate
console.log('rate', JSON.parse(res.result.paramValue))
this.setData({
rate: rate
});
}
};
http.request(params);
},
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function(options) { onLoad: function (options) {
this.getRate()
}, },
/** /**
* 生命周期函数--监听页面初次渲染完成 * 生命周期函数--监听页面初次渲染完成
*/ */
onReady: function() { onReady: function () {
}, },
/** /**
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow: function() { onShow: function () {
this.getData(); this.getData();
}, },
/** /**
* 生命周期函数--监听页面隐藏 * 生命周期函数--监听页面隐藏
*/ */
onHide: function() { onHide: function () {
}, },
/** /**
* 生命周期函数--监听页面卸载 * 生命周期函数--监听页面卸载
*/ */
onUnload: function() { onUnload: function () {
}, },
/** /**
* 页面相关事件处理函数--监听用户下拉动作 * 页面相关事件处理函数--监听用户下拉动作
*/ */
onPullDownRefresh: function() { onPullDownRefresh: function () {
}, },
/** /**
* 页面上拉触底事件的处理函数 * 页面上拉触底事件的处理函数
*/ */
onReachBottom: function() { onReachBottom: function () {
}, },
/** /**
* 用户点击右上角分享 * 用户点击右上角分享
*/ */
onShareAppMessage: function() { onShareAppMessage: function () {
}, },
getData() { getData() {
}, },
gotoShow: function() { gotoShow: function () {
var that = this var that = this
wx.chooseImage({ wx.chooseImage({
count: 1, // 最多可以选择的图片张数,默认9 count: 1, // 最多可以选择的图片张数,默认9
sizeType: ['original', 'compressed'], // original 原图,compressed 压缩图,默认二者都有 sizeType: ['original', 'compressed'], // original 原图,compressed 压缩图,默认二者都有
sourceType: ['album', 'camera'], // album 从相册选图,camera 使用相机,默认二者都有 sourceType: ['album', 'camera'], // album 从相册选图,camera 使用相机,默认二者都有
success: function(res) { success: function (res) {
// success // success
var tempFilePaths = res.tempFilePaths; var tempFilePaths = res.tempFilePaths;
// that.setData({ // that.setData({
...@@ -88,17 +104,17 @@ Page({ ...@@ -88,17 +104,17 @@ Page({
imgStr: res.tempFilePaths imgStr: res.tempFilePaths
}) })
}, },
fail: function() { fail: function () {
// fail // fail
}, },
complete: function() { complete: function () {
// complete // complete
} }
}) })
}, },
amountinput(e) { amountinput(e) {
let value = e.detail.value let value = e.detail.value
let actualAmount = (value * 0.92).toFixed(2); let actualAmount = (value * (1 - (this.data.rate / 100))).toFixed(2);
console.log(value, actualAmount) console.log(value, actualAmount)
this.setData({ this.setData({
amount: value, amount: value,
...@@ -116,7 +132,7 @@ Page({ ...@@ -116,7 +132,7 @@ Page({
let value = e.detail.value let value = e.detail.value
console.log(value) console.log(value)
this.setData({ this.setData({
bank: value bankName: value
}) })
}, },
bankCardinput(e) { bankCardinput(e) {
...@@ -127,44 +143,56 @@ Page({ ...@@ -127,44 +143,56 @@ Page({
}) })
}, },
//最新提现做法 //最新提现做法
inputimg: function() { inputimg: function () {
let that = this; let that = this;
if (!that.data.name) {
var token = wx.getStorageSync('token'); wx.showToast({ title: '请填写收款人', icon: 'none' })
var openid = wx.getStorageSync('openid') return
}
util.request(api.newly_balanceWithdraw, { if (!that.data.bankName) {
wx.showToast({ title: '请填写开户行', icon: 'none' })
token: token, return
openid: openid, }
amount: that.data.amount, if (!that.data.bankCard) {
name: that.data.name, wx.showToast({ title: '请填写银行卡号', icon: 'none' })
bank: that.data.bank, return
bankCard: that.data.bankCard }
}).then(function (res) { var stockAmount = /^\d{1,}$/
if (!stockAmount.test(that.data.amount)) {
if (res.status === 200) { wx.showToast({ title: '请填写提现金额', icon: 'none' })
wx.hideLoading() return
wx.showToast({ }
title: '操作成功,我们将尽快为您提现', wx.showLoading()
icon: 'none' var params = {
}) url: "/cashApplyRecord/applyToCash",
method: "POST",
} else { data: {
wx.hideLoading() userId: app.globalData.userInfo.userId,
wx.showToast({ amount: that.data.amount,
title: res.desc, name: that.data.name,
icon: 'none' bankName: that.data.bankName,
}) bankCard: that.data.bankCard
} },
}); callBack: (res) => {
wx.hideLoading()
wx.showToast({
title: '操作成功,我们将尽快为您提现',
icon: 'none'
})
},
errBack: (res) => {
wx.hideLoading()
wx.showToast({
title: res.note,
icon: 'none'
})
}
};
http.request(params);
}, },
//之前提现做法 //之前提现做法
inputimg2: function() { inputimg2: function () {
let that = this; let that = this;
if (that.data.imgStr != '' && that.data.amount > 0 && that.data.name != '') { if (that.data.imgStr != '' && that.data.amount > 0 && that.data.name != '') {
...@@ -183,14 +211,14 @@ Page({ ...@@ -183,14 +211,14 @@ Page({
amount: that.data.amount, amount: that.data.amount,
name: that.data.name name: that.data.name
}, },
success: function(res) { success: function (res) {
console.log(res) console.log(res)
wx.hideLoading() wx.hideLoading()
if (res.statusCode == 200) { if (res.statusCode == 200) {
var obj = JSON.parse(res.data) var obj = JSON.parse(res.data)
console.log(obj, obj.status) console.log(obj, obj.status)
if (obj.status==200){ if (obj.status == 200) {
wx.showToast({ wx.showToast({
title: '操作成功,我们将尽快为您提现', title: '操作成功,我们将尽快为您提现',
icon: 'none' icon: 'none'
...@@ -201,14 +229,14 @@ Page({ ...@@ -201,14 +229,14 @@ Page({
name: '' name: ''
}) })
}else{ } else {
wx.showToast({ wx.showToast({
title: obj.desc, title: obj.desc,
icon: 'none' icon: 'none'
}) })
} }
} else { } else {
wx.showToast({ wx.showToast({
title: '操作失败,请稍后重试', title: '操作失败,请稍后重试',
...@@ -217,30 +245,6 @@ Page({ ...@@ -217,30 +245,6 @@ Page({
} }
} }
}) })
// util.request(api.newly_balanceWithdraw, {
// token: token,
// file: that.data.imgStr,
// amount: that.data.amount,
// name: that.data.name
// }).then(function (res) {
// if (res.status === 200) {
// wx.hideLoading()
// wx.showToast({
// title: '操作成功,我们将尽快为您提现',
// icon: 'none'
// })
// } else {
// wx.hideLoading()
// wx.showToast({
// title: res.desc,
// icon: 'none'
// })
// }
// });
} }
} else { } else {
...@@ -255,13 +259,13 @@ Page({ ...@@ -255,13 +259,13 @@ Page({
}, },
//点击如何上传收款码 //点击如何上传收款码
showHow(){ showHow() {
this.setData({ this.setData({
how: true, how: true,
}); });
}, },
hideHow(){ hideHow() {
this.setData({ this.setData({
how: false, how: false,
}) })
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
</view> </view>
<view class='li'> <view class='li'>
<text class='txt'>开户行</text> <text class='txt'>开户行</text>
<input class='input' type='text' value="{{bank}}" bindinput="bankinput" placeholder-class='phcolor' placeholder='请输入开户行'></input> <input class='input' type='text' value="{{bankName}}" bindinput="bankinput" placeholder-class='phcolor' placeholder='请输入开户行'></input>
</view> </view>
<view class='li'> <view class='li'>
<text class='txt'>银行卡号</text> <text class='txt'>银行卡号</text>
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
<view class="notice-container"> <view class="notice-container">
<text class='txt-notice-title'>【温馨提醒】</text> <text class='txt-notice-title'>【温馨提醒】</text>
<text class='txt-notice'></text> <text class='txt-notice'></text>
<text class='txt-notice'>1、金额满200元方可提现;\n2、提现收0.6%手续费;\n3、购物可全额抵扣;</text> <text class='txt-notice'>1、金额满100元方可提现;\n2、提现收{{rate}}%手续费;\n3、购物可全额抵扣;</text>
</view> </view>
<view class="coupon-notice-window" wx:if="{{how}}"> <view class="coupon-notice-window" wx:if="{{how}}">
......
// pages/userAccount/comDetails/index.js // pages/userAccount/comDetails/index.js
// var util = require('../../../config/util.js'); var http = require("../../../utils/http.js");
// var api = require('../../../config/api.js'); var app = getApp()
// var user = require('../../../services/user.js');
// var utils = require('../../../utils/util.js')
Page({ Page({
...@@ -10,14 +8,34 @@ Page({ ...@@ -10,14 +8,34 @@ Page({
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
},
},
getRate() {
var params = {
url: "/commission/getCommissionDetail",
method: "GET",
data: {
},
callBack: (res) => {
let list = res.result.list
if (that.data.pageNum > 1) {
list = that.data.list.concat(list)
}
that.setData({
list: list,
total: res.result.total
})
console.log('list', that.data.list)
}
};
http.request(params);
},
// 获取页面数据 // 获取页面数据
myAccount(){ myAccount() {
var that = this; var that = this;
var token = wx.getStorageSync('token'); var token = wx.getStorageSync('token');
util.request(api.myAccount, {'token': token}).then(res => { util.request(api.myAccount, { 'token': token }).then(res => {
that.setData({ that.setData({
pageInfo: res.data pageInfo: res.data
}) })
...@@ -25,7 +43,7 @@ Page({ ...@@ -25,7 +43,7 @@ Page({
}, },
// 页面跳转 // 页面跳转
goPage(data){ goPage(data) {
wx.navigateTo({ wx.navigateTo({
url: data.currentTarget.dataset.page, url: data.currentTarget.dataset.page,
}) })
......
...@@ -88,7 +88,7 @@ page { ...@@ -88,7 +88,7 @@ page {
} }
.li-num{ .li-num{
color: #030521; color: #3a86b9;
font-size: 32rpx; font-size: 32rpx;
margin: 0 20rpx; margin: 0 20rpx;
font-weight: bold; font-weight: bold;
...@@ -144,7 +144,7 @@ page { ...@@ -144,7 +144,7 @@ page {
.li-bottom view:nth-child(2){ .li-bottom view:nth-child(2){
font-size: 32rpx; font-size: 32rpx;
color: #030521; color: #3a86b9;
font-weight: bold; font-weight: bold;
margin: 0 20rpx; margin: 0 20rpx;
} }
\ No newline at end of file
// pages/userAccount/myTeam/index.js // pages/userAccount/myTeam/index.js
// var util = require('../../../config/util.js'); var http = require("../../../utils/http.js")
// var api = require('../../../config/api.js'); var app = getApp()
// var user = require('../../../services/user.js');
Page({ Page({
...@@ -9,37 +8,64 @@ Page({ ...@@ -9,37 +8,64 @@ Page({
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
tabs: [{name: '一级会员'}, {name: '二级会员'}], tabs: [{ name: '一级会员' }, { name: '二级会员' }],
getTabs: 0, getTabs: 0,
list: [] list: [],
pageNum: 1,
total: 0
}, },
// 选项卡切换 // 选项卡切换
tabsGet(data){ tabsGet(data) {
this.setData({ getTabs: data.currentTarget.dataset.index, list: [] }) this.setData({ getTabs: data.currentTarget.dataset.index, list: [] })
this.userMyTeam(data.currentTarget.dataset.index) this.userMyTeam(data.currentTarget.dataset.index)
}, },
// 列表内容 // 列表内容
userMyTeam(type){ getList() {
var that = this; var that = this
var token = wx.getStorageSync('token'); var params = {
var userInfo = JSON.parse(wx.getStorageSync('userinfo')); url: "/commission/getOrderPageList",
util.request(api.userMyTeam, { method: "GET",
'type': type + 1, data: {
'token': token userId: app.globalData.userInfo.userId,
}).then(res => { pageNum: this.data.pageNum,
that.setData({ pageSize: 10
list: res.data.teamParamList },
}) callBack: (res) => {
}) let list = res.result.list
if (that.data.pageNum > 1) {
list = that.data.list.concat(list)
}
that.setData({
list: list,
total: res.result.total
})
console.log('list',that.data.list)
}
};
http.request(params);
},
getParentName() {
var params = {
url: "/commission/getParentName",
method: "GET",
data: {
userId: app.globalData.userInfo.userId
},
callBack: (res) => {
this.setData({
pageInfo: res.result
})
}
};
http.request(params);
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { onLoad: function (options) {
// this.userMyTeam(0); this.getParentName()
}, },
/** /**
...@@ -53,6 +79,12 @@ Page({ ...@@ -53,6 +79,12 @@ Page({
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow: function () { onShow: function () {
this.setData({
list: [],
pageNum: 1,
total: 0
})
this.getList();
}, },
...@@ -81,7 +113,10 @@ Page({ ...@@ -81,7 +113,10 @@ Page({
* 页面上拉触底事件的处理函数 * 页面上拉触底事件的处理函数
*/ */
onReachBottom: function () { onReachBottom: function () {
if (this.data.total > this.data.list.length) {
this.data.pageNum++
this.getList()
}
}, },
/** /**
......
<!--pages/userAccount/myTeam/index.wxml--> <!--pages/userAccount/myTeam/index.wxml-->
<view class="page"> <view class="page">
<!-- 选项卡 --> <!-- 选项卡 -->
<view class="tabs"> <view class="user-info-show">
<image class="user-portrait" src="{{pageInfo.pic}}"></image>
<view class="user-name">
<view>{{pageInfo.nickName}}</view>
<view>推荐人:您是由{{pageInfo.parentNickName}}推荐</view>
</view>
</view>
<!-- <view class="tabs">
<view wx:for="{{tabs}}" wx:key="index" bindtap="tabsGet" data-index="{{index}}" <view wx:for="{{tabs}}" wx:key="index" bindtap="tabsGet" data-index="{{index}}"
class="{{getTabs == index ? 'tabsTrue' : 'tabsFalse'}}">{{item.name}}</view> class="{{getTabs == index ? 'tabsTrue' : 'tabsFalse'}}">{{item.name}}</view>
</view> </view> -->
<!-- 列表展示 --> <!-- 列表展示 -->
<view class="list-box"> <view class="list-box">
<!-- 列表展示 --> <!-- 列表展示 -->
<view class="li-box" wx:for="{{list}}" wx:key="index"> <view class="li-box" wx:for="{{list}}" wx:key="index">
<image src="{{item.picture}}"></image> <image src="{{item.pic}}"></image>
<view class="li-user"> <view class="li-user">
<text>会员名称:{{item.userName}}</text> <text>会员名称:{{item.nickName}}</text>
<text>成为会员:{{itme.registerTime}}</text> <text>成为会员:{{itme.userRegtime}}</text>
</view> </view>
<view class="li-num"> <view class="li-num">
<text>¥{{item.amount}}</text> <text>¥{{item.orderAmount}}</text>
<view>{{item.teamNum}}个成员</view> <view>{{item.teamNumber}}个成员</view>
</view> </view>
</view> </view>
<!-- 暂无内容 --> <!-- 暂无内容 -->
......
...@@ -2,7 +2,47 @@ ...@@ -2,7 +2,47 @@
page { page {
background: #f4f4f4; background: #f4f4f4;
} }
.user-info-show{
display: flex;
align-items: center;
flex-direction: row;
width: 100%;
padding: 20rpx 0;
background: #fff;
}
.user-portrait{
width: 112rpx;
height: 112rpx;
border-radius: 50%;
margin: 0 33rpx 0 40rpx;
}
.user-name{
flex: 1;
display: flex;
align-items: center;
flex-direction: column;
}
.user-name view:nth-child(1){
width: 100%;
font-size: 40rpx;
font-family: PingFang SC Semibold, PingFang SC Semibold-Semibold;
font-weight: 600;
text-align: left;
color: #020202;
}
.user-name view:nth-child(2){
width: 100%;
font-size: 24rpx;
font-family: PingFang SC Regular, PingFang SC Regular-Regular;
font-weight: 400;
text-align: left;
color: #999999;
margin-top: 10rpx;
}
.tabs{ .tabs{
width: 100%; width: 100%;
display: flex; display: flex;
...@@ -30,7 +70,7 @@ page { ...@@ -30,7 +70,7 @@ page {
} }
.list-box{ .list-box{
margin-top: 90rpx; margin-top: 20rpx;
display: flex; display: flex;
align-items: center; align-items: center;
flex-direction: column; flex-direction: column;
...@@ -84,7 +124,7 @@ page { ...@@ -84,7 +124,7 @@ page {
.li-num view{ .li-num view{
color: white; color: white;
background: #030521; background: #3a86b9;
font-size: 22rpx; font-size: 22rpx;
height: 40rpx; height: 40rpx;
line-height: 40rpx; line-height: 40rpx;
......
// var util = require('../../../config/util.js'); var http = require("../../../utils/http.js")
// var api = require('../../../config/api.js'); var app = getApp()
// var user = require('../../../services/user.js');
// var utils = require('../../../utils/util.js')
Page({ Page({
...@@ -16,7 +14,7 @@ Page({ ...@@ -16,7 +14,7 @@ Page({
{ name: '未通过', type: 2 } { name: '未通过', type: 2 }
], ],
getTabs: 0, getTabs: 0,
pageNo: 1, pageNum: 1,
list: [], list: [],
total: 0 total: 0
}, },
...@@ -24,39 +22,43 @@ Page({ ...@@ -24,39 +22,43 @@ Page({
// 选项卡切换 // 选项卡切换
tabsGet(data) { tabsGet(data) {
this.setData({ getTabs: data.currentTarget.dataset.index, list: [] }) this.setData({ getTabs: data.currentTarget.dataset.index, list: [] })
this.userMyTeam(data.currentTarget.dataset.index) this.getList(data.currentTarget.dataset.index)
}, },
getList(type) {
// 列表内容 var that = this
userMyTeam(type) { var params = {
var that = this; url: "/cashApplyRecord/selectListByOther",
var token = wx.getStorageSync('token'); method: "GET",
var userInfo = JSON.parse(wx.getStorageSync('userinfo')); data: {
util.request(api.listWithdraw, { applyStatus: that.data.tabs[type].type,
'type': that.data.tabs[type].type, userId: app.globalData.userInfo.userId,
'token': token, pageNum: this.data.pageNum,
'pageNo': that.data.pageNo, pageSize: 10
'pageSize': 10 },
}).then(res => { callBack: (res) => {
var info = res.data.withdrawList.list; let list = res.result.list
// debugger for(var i in list){
for(var i in info){ list[i].createTime = utils.formatTimeTwo(list[i].createTime, 'Y:M:D h:m:s')
info[i].createTime = utils.formatTimeTwo(info[i].createTime.time, 'Y:M:D h:m:s') }createTime
that.data.list.push(info[i]) if (that.data.pageNum > 1) {
list = that.data.list.concat(list)
}
that.setData({
list: list,
total: res.result.total
})
console.log('list',that.data.list)
} }
that.setData({ };
list: that.data.list, http.request(params);
total: res.data.withdrawList.totalCount
})
console.log(that.data.list)
})
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { onLoad: function (options) {
// this.userMyTeam(0); // this.getList(0);
}, },
/** /**
...@@ -70,7 +72,12 @@ Page({ ...@@ -70,7 +72,12 @@ Page({
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow: function () { onShow: function () {
this.setData({
list: [],
pageNum: 1,
total: 0
})
this.getList(0)
}, },
/** /**
...@@ -98,11 +105,9 @@ Page({ ...@@ -98,11 +105,9 @@ Page({
* 页面上拉触底事件的处理函数 * 页面上拉触底事件的处理函数
*/ */
onReachBottom: function () { onReachBottom: function () {
if (this.data.total > this.data.list.length){ if (this.data.total > this.data.list.length) {
that.setData({ this.data.pageNum++
pageNo: pageNo++ this.getList(this.data.tabs[this.data.getTabs].type)
})
this.userMyTeam(this.data.tabs[this.data.getTabs].type)
} }
}, },
......
...@@ -10,17 +10,17 @@ ...@@ -10,17 +10,17 @@
<!-- 列表展示 --> <!-- 列表展示 -->
<view class="li-box" wx:for="{{list}}" wx:key="index"> <view class="li-box" wx:for="{{list}}" wx:key="index">
<view class="li-head"> <view class="li-head">
<text wx:if="{{item.status == 0}}">待审核</text> <text wx:if="{{item.applyStatus == 0}}">待审核</text>
<text wx:if="{{item.status == 1}}">已审核</text> <text wx:if="{{item.applyStatus == 1}}">已审核</text>
<text wx:if="{{item.status == 0}}">未通过</text> <text wx:if="{{item.applyStatus == 2}}">未通过</text>
<text>-</text> <text>-</text>
</view> </view>
<view class="li-body"> <view class="li-body">
<view class="li-user"> <view class="li-user">
<text>姓名:{{item.name}}</text> <text>姓名:{{item.bankName}}</text>
<text>提现时间:{{item.createTime}}</text> <text>提现时间:{{item.createTime}}</text>
</view> </view>
<view class="li-num">¥{{item.amount}}</view> <view class="li-num">¥{{item.cashAmount}}</view>
</view> </view>
</view> </view>
<!-- 暂无内容 --> <!-- 暂无内容 -->
......
...@@ -80,7 +80,7 @@ page { ...@@ -80,7 +80,7 @@ page {
} }
.li-num{ .li-num{
color: #030521; color: #3a86b9;
font-size: 32rpx; font-size: 32rpx;
margin-right: 20rpx; margin-right: 20rpx;
} }
......
var domain = "http://192.168.31.108:8086/capi"; //统一接口域名,测试环境 var domain = "http://192.168.31.132:8086/capi"; //统一接口域名,测试环境
exports.domain = domain; exports.domain = domain;
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