Commit 7b5a7635 by wangyalan-git

分佣

parent 0a1bbdd9
...@@ -18,7 +18,6 @@ Page({ ...@@ -18,7 +18,6 @@ Page({
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { onLoad: function (options) {
}, },
/** /**
......
...@@ -97,6 +97,7 @@ page { ...@@ -97,6 +97,7 @@ page {
.offList{ .offList{
font-size: 30rpx; font-size: 30rpx;
color: #999999; color: #999999;
margin-top: 20rpx;
} }
.li-head{ .li-head{
......
...@@ -12,7 +12,8 @@ Page({ ...@@ -12,7 +12,8 @@ Page({
getTabs: 0, getTabs: 0,
list: [], list: [],
pageNum: 1, pageNum: 1,
total: 0 total: 0,
userId: null
}, },
// 选项卡切换 // 选项卡切换
...@@ -20,7 +21,12 @@ Page({ ...@@ -20,7 +21,12 @@ Page({
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)
}, },
goPage(e) {
let url = e.currentTarget.dataset.url
wx.navigateTo({
url: url,
})
},
// 列表内容 // 列表内容
getList() { getList() {
var that = this var that = this
...@@ -28,7 +34,7 @@ Page({ ...@@ -28,7 +34,7 @@ Page({
url: "/commission/getOrderPageList", url: "/commission/getOrderPageList",
method: "GET", method: "GET",
data: { data: {
userId: app.globalData.userInfo.userId, userId: this.data.userId,
pageNum: this.data.pageNum, pageNum: this.data.pageNum,
pageSize: 10 pageSize: 10
}, },
...@@ -41,7 +47,7 @@ Page({ ...@@ -41,7 +47,7 @@ Page({
list: list, list: list,
total: res.result.total total: res.result.total
}) })
console.log('list',that.data.list) console.log('list', that.data.list)
} }
}; };
http.request(params); http.request(params);
...@@ -51,7 +57,7 @@ Page({ ...@@ -51,7 +57,7 @@ Page({
url: "/commission/getParentName", url: "/commission/getParentName",
method: "GET", method: "GET",
data: { data: {
userId: app.globalData.userInfo.userId userId: this.data.userId
}, },
callBack: (res) => { callBack: (res) => {
this.setData({ this.setData({
...@@ -65,7 +71,6 @@ Page({ ...@@ -65,7 +71,6 @@ Page({
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { onLoad: function (options) {
this.getParentName()
}, },
/** /**
...@@ -79,13 +84,15 @@ Page({ ...@@ -79,13 +84,15 @@ Page({
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow: function () { onShow: function () {
console.log("options", this.options.userId)
this.setData({ this.setData({
userId: this.options.userId ? this.options.userId : app.globalData.userInfo.userId,
list: [], list: [],
pageNum: 1, pageNum: 1,
total: 0 total: 0
}) })
this.getParentName()
this.getList(); this.getList();
}, },
/** /**
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<image class="user-portrait" src="{{pageInfo.pic}}"></image> <image class="user-portrait" src="{{pageInfo.pic}}"></image>
<view class="user-name"> <view class="user-name">
<view>{{pageInfo.nickName}}</view> <view>{{pageInfo.nickName}}</view>
<view>推荐人:您是由{{pageInfo.parentNickName}}推荐</view> <view>我的推荐人:您是由{{pageInfo.parentNickName}}推荐</view>
</view> </view>
</view> </view>
<!-- <view class="tabs"> <!-- <view class="tabs">
...@@ -16,11 +16,11 @@ ...@@ -16,11 +16,11 @@
<!-- 列表展示 --> <!-- 列表展示 -->
<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" bindtap="goPage" data-url="/pages/userAccount/myTeam/index?userId={{item.userId}}">
<image src="{{item.pic}}"></image> <image src="{{item.pic}}"></image>
<view class="li-user"> <view class="li-user">
<text>会员名称:{{item.nickName}}</text> <view>{{item.nickName}}</view>
<text>成为会员:{{itme.userRegtime}}</text> <text>{{item.userRegtime}}</text>
</view> </view>
<view class="li-num"> <view class="li-num">
<text>¥{{item.orderAmount}}</text> <text>¥{{item.orderAmount}}</text>
......
...@@ -99,7 +99,7 @@ page { ...@@ -99,7 +99,7 @@ page {
.li-user{ .li-user{
flex: 1; flex: 1;
display: flex; display: flex;
align-items: center; /* align-items: center; */
flex-direction: column; flex-direction: column;
font-size: 30rpx; font-size: 30rpx;
} }
...@@ -110,6 +110,8 @@ page { ...@@ -110,6 +110,8 @@ page {
.li-user text:nth-child(2){ .li-user text:nth-child(2){
color: #999999; color: #999999;
font-size: 26rpx;
margin-top: 10rpx;
} }
.li-num{ .li-num{
...@@ -133,6 +135,7 @@ page { ...@@ -133,6 +135,7 @@ page {
} }
.offList{ .offList{
font-size: 30rpx; font-size: 28rpx;
color: #999999; color: #999999;
margin-top: 20rpx;
} }
\ No newline at end of file
...@@ -86,8 +86,9 @@ page { ...@@ -86,8 +86,9 @@ page {
} }
.offList{ .offList{
font-size: 30rpx; font-size: 28rpx;
color: #999999; color: #999999;
margin-top: 20rpx;
} }
.li-head{ .li-head{
......
var domain = "http://192.168.31.132:8086/capi"; //统一接口域名,测试环境 var domain = "http://192.168.31.118:8086/capi"; //统一接口域名,测试环境
exports.domain = domain; exports.domain = domain;
...@@ -22,11 +22,19 @@ function request(params, isGetTonken) { ...@@ -22,11 +22,19 @@ function request(params, isGetTonken) {
responseType: params.responseType == undefined ? 'text' : params.responseType, responseType: params.responseType == undefined ? 'text' : params.responseType,
success: function (res) { success: function (res) {
if (res.statusCode == 200) { if (res.statusCode == 200) {
console.log(res.data.code)
//如果有定义了params.callBack,则调用 params.callBack(res.data) //如果有定义了params.callBack,则调用 params.callBack(res.data)
if (res.data.code == undefined || res.data.code == 1) {
if (params.callBack) { if (params.callBack) {
params.callBack(res.data); params.callBack(res.data);
} }
} else {
wx.showToast({
title: res.data.note,
icon: "none"
});
}
} else if (res.statusCode == 500) { } else if (res.statusCode == 500) {
wx.showToast({ wx.showToast({
title: "服务器出了点小差", title: "服务器出了点小差",
......
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