123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208 |
- <template>
- <view class="main">
- <view class="btn btns">
- <image src="../../static/tuijian/mytuijian.png" mode=""></image>
- <view class="txt">
- 我的上级:{{upUser!=null? upUser.realname:'总部'}}
- <!-- 我的推荐人:{{upUser!=null? upUser.realname:'总部'}} -->
- </view>
- </view>
- <view class="btn btns">
- <image src="../../static/tuijian/mine.png" mode=""></image>
- <view class="txt">
- 我推荐的人
- </view>
- </view>
- <view class="infoboxData" v-if="tuijians.length<=0">暂无数据</view>
- <view class="infobox btns" v-for="( item , index ) in tuijians" :key="index">
- <view class="top">
- <image :src="item.avatar" mode=""></image>
- <view class="name">
- {{item.realname}}
- </view>
- <view class="time">
- 注册时间:{{item.register_time}}
- </view>
- <view class="num">
- 推广{{item.invite_num}}人
- </view>
- </view>
- <view class="bottom">
- <view class="xiaofei">
- 消费{{item.consume_amount}}元
- </view>
- <view class="dans">
- {{item.complete_order_num}}个订单
- </view>
- </view>
- </view>
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- tuijians:[],
- param: {
- page: 0
- },
- loadingType: 0,
- upUser:{}
- }
- },
- onLoad() {
- this.loadInviteUserList();
- },
- onReachBottom() {
- if (this.loadingType !== 0) {
- return;
- }
- this.loadingType = 1;
- this.loadPage();
- },
- onPullDownRefresh() {
- this.loadInviteUserList();
- },
- methods: {
- loadInviteUserList: function() {
- this.loadingType = 1;
- this.param.page = 0;
- this.loadPage();
- },
- loadPage: async function() {
- if (this.loadingType == 2) {
- return;
- }
- try {
- this.param.page++;
- let data = await this.$request.post('/api/userPromote/inviteUserList', this.param, false);
- console.log(data)
- if (data.code == 200) {
- this.upUser = data.data.upUser;
- if (data.data.list.current_page == 1) {
- this.tuijians = [];
- }
- this.tuijians = this.tuijians.concat(data.data.list.data);
- if (data.data.list.data.current_page == data.data.list.last_page) {
- this.loadingType = 2;
- } else {
- this.loadingType = 0;
- }
- } else {
- uni.showToast({
- icon: 'none',
- title: data.message
- });
- this.loadingType = 0;
- }
- } catch (e) {
- console.info(e)
- uni.showToast({
- icon: 'none',
- title: '数据获取失败'
- });
- this.loadingType = 0;
- }
- uni.stopPullDownRefresh();
- }
- }
- }
- </script>
- <style>
- page{
- background: #F5F5F5;
- }
- .main{
- width: 100vw;
- height: auto;margin-bottom: 20px;
- }
- .main .btns{
- width: 90vw;
- height: 60px;
- border-radius: 5px;
- background: #fff;
- margin:0 5vw;
- margin-top: 5vw;
- }
- .main .btn{
- display: flex;
- }
- .btn image{
- width: 20px;
- height: 20px;
- margin: 20px;
- }
- .btn .txt{
- width: auto;
- height: 20px;
- font-size: 32rpx;
- line-height: 20px;
- margin: 20px 0;
- font-family: PingFangSC-Regular, sans-serif;
- }
- .infoboxData{
- text-align: center;
- margin: 15px 0;
- font-size: 32rpx;
- font-family: PingFangSC-Regular, sans-serif;
- }
- .main .infobox{
- width: 90vw;
- height: auto;
- padding: 15px;
- }
- .infobox .top{
- width: 100%;
- height: 70px;
- position: relative;
- border-bottom: 1px solid #d8d8d8;
- }
- .top image{
- width: 60px;
- height: 60px;
- border-radius: 60px;
- background: #eee;
- }
- .top .name{
- width: auto;
- height: 30px;
- line-height: 30px;
- font-size: 16px;
- color: #555;
- position: absolute;
- top: 0;
- left: 70px;
- }
- .top .time{
- width: auto;
- height: 30px;
- line-height: 30px;
- color: #888;
- font-size: 14px;
- position: absolute;
- top: 30px;
- left: 70px;
- }
- .top .num{
- width: auto;
- height: 30px;
- line-height: 30px;
- padding: 0 10px;
- position: absolute;
- top: 0;
- right: 0;
- color: #777;
- }
- .infobox .bottom{
- width: 100%;
- height: 30px;
- line-height: 40px;
- display: flex;
- justify-content: space-between;
- color: #888;
- font-size: 14px;
- }
- </style>
|