银花优选微信小程序修改后的最新版本代码
This commit is contained in:
152
pages/myusers/index.js
Normal file
152
pages/myusers/index.js
Normal file
@@ -0,0 +1,152 @@
|
||||
|
||||
var app = getApp()
|
||||
var that=null
|
||||
var sopenFrame=null
|
||||
Page( {
|
||||
data: {
|
||||
orderImg: '../../images/iconfont-dingdan.png',
|
||||
tipWords: '亲,您还没有推荐会员哦!',
|
||||
dataHidden:false,
|
||||
nodataHidden:true,
|
||||
loadingHidden:false,
|
||||
tjcount:0,
|
||||
temcount:0,
|
||||
zyj:0,
|
||||
maxzcount:0.00,
|
||||
minzcount:0.00,
|
||||
zcount:0.00,
|
||||
datas:[],
|
||||
Start: 0,
|
||||
t:1
|
||||
},
|
||||
|
||||
onLoad: function() {
|
||||
that = this
|
||||
that.clearCache();//清本页缓存
|
||||
that.getlist(0)
|
||||
}, // 下拉刷新
|
||||
onPullDownRefresh: function () {
|
||||
//在当前页面显示导航条加载动画
|
||||
wx.showNavigationBarLoading();
|
||||
//显示 loading 提示框。需主动调用 wx.hideLoading 才能关闭提示框
|
||||
wx.showLoading({
|
||||
title: '刷新中...',
|
||||
})
|
||||
that.clearCache();
|
||||
that.getlist(1);//第一次加载数据
|
||||
},
|
||||
|
||||
// 页面上拉触底事件(上拉加载更多)
|
||||
onReachBottom: function () {
|
||||
that.setData({
|
||||
loadingHidden:false
|
||||
});
|
||||
that.getlist(2);//后台获取新数据并追加渲染
|
||||
},
|
||||
|
||||
// 清缓存
|
||||
clearCache:function(){
|
||||
that.setData({
|
||||
dataHidden:false,
|
||||
nodataHidden:true,
|
||||
loadingHidden:false,
|
||||
Start: 0,
|
||||
datas:[]
|
||||
});
|
||||
},getlist: function(gp) {
|
||||
var userId = wx.getStorageSync("userId")
|
||||
var LoginId = wx.getStorageSync("LoginId")
|
||||
|
||||
wx.request({
|
||||
url: app.globalData.apiurl + "/xapiajax.ashx",
|
||||
data: {
|
||||
action:"getmyfriendlist",
|
||||
Start:that.data.Start,
|
||||
t:that.data.t,
|
||||
userId:(userId==null?"":userId),
|
||||
LoginId:(LoginId==null?"":LoginId)
|
||||
},
|
||||
method:"GET",
|
||||
dataType:"json",
|
||||
header: {
|
||||
"content-type": "application/json" // 默认值
|
||||
},
|
||||
success (res) {
|
||||
if(res.data.status==1){
|
||||
var tmpArr = null;
|
||||
tmpArr = that.data.datas;
|
||||
tmpArr.push.apply(tmpArr,res.data.data);
|
||||
|
||||
that.setData({
|
||||
datas: tmpArr,
|
||||
Start: that.data.Start+res.data.data.length,
|
||||
loadingHidden:true
|
||||
})
|
||||
if(gp==0||gp==1){
|
||||
that.setData({
|
||||
tjcount:res.data.tjcount,
|
||||
temcount:res.data.temcount,
|
||||
zyj:res.data.zyj,
|
||||
maxzcount:res.data.maxzcount,
|
||||
minzcount:res.data.minzcount,
|
||||
zcount:res.data.zcount
|
||||
})
|
||||
if(res.data.data.length>0){
|
||||
that.setData({
|
||||
dataHidden:false,
|
||||
nodataHidden:true
|
||||
|
||||
})
|
||||
|
||||
}else{
|
||||
that.setData({
|
||||
dataHidden:true,
|
||||
nodataHidden:false
|
||||
})
|
||||
}
|
||||
that.setData({
|
||||
tipWords: '亲,您还没有推荐会员哦!'
|
||||
})
|
||||
}else{
|
||||
that.setData({
|
||||
tipWords: '亲,找不到会员哦!'
|
||||
})
|
||||
}
|
||||
}
|
||||
if(gp==1){
|
||||
//隐藏loading 提示框
|
||||
wx.hideLoading();
|
||||
//隐藏导航条加载动画
|
||||
wx.hideNavigationBarLoading();
|
||||
//停止下拉刷新
|
||||
wx.stopPullDownRefresh();
|
||||
}
|
||||
}
|
||||
})
|
||||
},getkeyword:function(e) {
|
||||
that.setData({
|
||||
keyword:e.detail.value
|
||||
})
|
||||
},onskusers:function() {
|
||||
wx.navigateTo({
|
||||
url: "../myskusers/index"
|
||||
})
|
||||
},onsearch:function() {
|
||||
that.clearCache();
|
||||
that.getlist(1);//第一次加载数据
|
||||
},onyj:function(e) {
|
||||
var tjcount = e.currentTarget.dataset.tjcount
|
||||
var temcount = e.currentTarget.dataset.temcount
|
||||
var zyj = e.currentTarget.dataset.zyj
|
||||
wx.showModal({
|
||||
title: "会员情况",
|
||||
content: "推荐人数:"+tjcount+"\r\n团队人数:"+temcount+"\r\n总业绩:"+zyj+"",
|
||||
showCancel:false,
|
||||
success (res0) {
|
||||
if (res0.confirm) {
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
})
|
||||
3
pages/myusers/index.json
Normal file
3
pages/myusers/index.json
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"navigationBarTitleText": "我的会员"
|
||||
}
|
||||
65
pages/myusers/index.wxml
Normal file
65
pages/myusers/index.wxml
Normal file
@@ -0,0 +1,65 @@
|
||||
<view class="container">
|
||||
<view class="mydata_box0">
|
||||
|
||||
<view class="umoney1">
|
||||
|
||||
<text>{{maxzcount}}</text>
|
||||
<text>月单部门业绩</text>
|
||||
</view>
|
||||
<view class="umoney1">
|
||||
|
||||
<text>{{minzcount}}</text>
|
||||
<text>月多部门业绩</text>
|
||||
</view>
|
||||
<view class="umoney1">
|
||||
<text>{{zcount}}</text>
|
||||
<text>月总业绩</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="mydata_box0">
|
||||
<view class="umoney1">
|
||||
|
||||
<text>{{tjcount}}</text>
|
||||
<text>直推人数</text>
|
||||
</view>
|
||||
<view class="umoney1">
|
||||
|
||||
<text>{{temcount}}</text>
|
||||
<text>团队人数</text>
|
||||
</view>
|
||||
<view class="umoney1">
|
||||
|
||||
<text>{{zyj}}</text>
|
||||
<text>总业绩</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
|
||||
<view class="datas-box" hidden="{{dataHidden}}">
|
||||
|
||||
<view class="datas-item" wx:for="{{datas}}" bindtap="onyj" data-tjcount="{{item.tjcount}}" data-temcount="{{item.temcount}}" data-zyj="{{item.zyj}}">
|
||||
<view class="image"><image src='{{item.UserPic==""?"../../images/logo.png":item.UserPic}}'></image>
|
||||
</view>
|
||||
<view class="name">
|
||||
<view>{{item.UserName}}<text>{{item.RealName}}</text></view>
|
||||
<view class="time">{{item.uLevel}} 当月业绩:{{item.zcount}}</view>
|
||||
</view>
|
||||
<view class="uLevel">
|
||||
{{item.zt}}{{item.zt0}}
|
||||
</view>
|
||||
<view class="faifeito">
|
||||
<image src="../../images/faifeito.png"></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="nodata" hidden="{{nodataHidden}}">
|
||||
<image src="{{orderImg}}" class="order-image"/>
|
||||
<view>{{tipWords}}</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
<loading hidden="{{loadingHidden}}">
|
||||
加载中...
|
||||
</loading>
|
||||
71
pages/myusers/index.wxss
Normal file
71
pages/myusers/index.wxss
Normal file
@@ -0,0 +1,71 @@
|
||||
page{
|
||||
background: #ccc;
|
||||
}
|
||||
.container {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
font-size: 14px;
|
||||
color: #000;
|
||||
}
|
||||
.mydata_box0{
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
background-color: #fff;
|
||||
}
|
||||
.mydata_box0 view{
|
||||
margin-top:0.8em;
|
||||
margin-bottom: 0.8em;
|
||||
width: 33.33333333333%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
color: #000;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.mydata_box0 view.umoney1{
|
||||
border-left:1px solid #f5f5f5;
|
||||
}
|
||||
.mydata_box0 view.umoney1.alink{
|
||||
color:#00B050;
|
||||
}
|
||||
.mydata_box0 view image{
|
||||
width: 4em;
|
||||
height: 4em;
|
||||
}
|
||||
.mydata_box0 view view{
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
.datas-box{display: flex;flex-direction: column;align-items: center;justify-content: center;width:100%;padding:0.8em; box-sizing: border-box;}
|
||||
|
||||
.datas-item{ display: flex;flex-direction: row; width:100%; margin:0; margin-bottom: 0.8em; padding:0.8em; align-items: center;justify-content: center;box-sizing: border-box;margin-top: 0; background-color:#fff;border-radius:0.5em;}
|
||||
.datas-item view{display: flex;flex-direction: column;}
|
||||
.datas-item view.image{width:2.5em;height:2.5em;border-radius:50%;}
|
||||
.datas-item view.image image{width:100%;height:100%;border-radius:50%;}
|
||||
.datas-item view.name{flex-grow: 1;height:2.5em; padding-left:0.5em; padding-top:0.35em;}
|
||||
.datas-item view.name view{display: flex;flex-direction: row;line-height:1.2em;}
|
||||
.datas-item view.name view.time{color:#848484;margin-top: 0.3em;}
|
||||
.datas-item view.name view text{margin-left:0.5em;color:#848484;}
|
||||
.datas-item view.uLevel{margin-top:-1.2em; width:3em;height:1.5em;color:#848484;}
|
||||
.datas-item view.faifeito{width:1.5em;height:1.5em;}
|
||||
.datas-item view.faifeito image{width:100%;height:100%;}
|
||||
.searchbox2{ display: flex; flex-direction: row; margin:0 1em; margin-top:1em;height:3.5em; border-bottom:1px solid #f1f1f1; font-size:0.85em;}
|
||||
.searchbox2{ display: flex; flex-direction: row; margin:0 1em; margin-top:1em;height:4em; font-size:0.85em;}
|
||||
.searchbox2 .inpubox{flex-grow: 1; height:3em; }
|
||||
.searchbox2 .inpubox #keyword{ margin:0; padding-left: 0.2em; width: 100%; font-size:1em; height:3em; border:1px solid #f01a4d; outline: none; text-indent: 0.3em;box-sizing:border-box;}
|
||||
.searchbox2 .icobox{width:3em;height:3em; font-size:1em; background: linear-gradient(to bottom, #f01a4d, #f01a4d); color:#fff;box-sizing:border-box;}
|
||||
.searchbox2 .icobox image{width: 1.6em; height:1.6em; margin-top: .75em; margin-left: 0.6em;}
|
||||
.searchbox2 .icobox0{width:auto; padding:0 0.5em; height:3em; font-size:1em; background: linear-gradient(to bottom, #ff401a, #ff401a); color:#fff;box-sizing:border-box;}
|
||||
.searchbox2 .icobox0 image{float:left; margin-left: 0em; width: 1.6em; height:1.6em; margin-top: .75em;}
|
||||
.searchbox2 .icobox0 text{float:left;display: block; width:auto;height:3em; line-height:3em; color:#fff;}
|
||||
|
||||
|
||||
.nodata{padding-top:1em; text-align: center; line-height: 1.5em; color:#939393;}
|
||||
.nodata image {
|
||||
width: 80px;
|
||||
height: 80px;
|
||||
}
|
||||
Reference in New Issue
Block a user