锶源昆仑会员+体验官
This commit is contained in:
68
pages/recommend/index.js
Normal file
68
pages/recommend/index.js
Normal file
@@ -0,0 +1,68 @@
|
||||
/*
|
||||
* 手太欠
|
||||
* 愿这世界都如故事里一样 美好而动人~
|
||||
*/
|
||||
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
larerType : 1, //默认列表 1 直接 2 间接
|
||||
count : '', //数量
|
||||
identity : '', //身份
|
||||
relationArr: [], //我的伙伴列表
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad(options) {
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow() {
|
||||
// 获取商品详情数据
|
||||
this.relationsInfo();
|
||||
},
|
||||
|
||||
/**
|
||||
* 商品详情数据
|
||||
*/
|
||||
relationsInfo() {
|
||||
wx.$api.user.relations({
|
||||
larer: this.data.larerType
|
||||
}).then(res => {
|
||||
this.setData({
|
||||
count : res.data.count,
|
||||
relationArr : res.data.users
|
||||
})
|
||||
}).catch(err => {})
|
||||
},
|
||||
|
||||
/**
|
||||
* 状态筛选
|
||||
*/
|
||||
onTabs(e){
|
||||
let val = e.currentTarget.dataset.type
|
||||
if(this.data.larerType === val) return
|
||||
this.setData({
|
||||
larerType: val
|
||||
})
|
||||
|
||||
// 获取商品详情数据
|
||||
this.relationsInfo();
|
||||
},
|
||||
|
||||
/**
|
||||
* 拨打电话
|
||||
*/
|
||||
telClick(e){
|
||||
wx.makePhoneCall({
|
||||
phoneNumber: e.currentTarget.dataset.name
|
||||
});
|
||||
}
|
||||
})
|
||||
4
pages/recommend/index.json
Normal file
4
pages/recommend/index.json
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"usingComponents": {},
|
||||
"navigationBarTitleText": "我的推荐"
|
||||
}
|
||||
43
pages/recommend/index.wxml
Normal file
43
pages/recommend/index.wxml
Normal file
@@ -0,0 +1,43 @@
|
||||
<view class="all">
|
||||
<image class="all-back" src="http://api.siyuankunlun.com/storage/materials/2022/09/14/friend_back.png" mode="widthFix"></image>
|
||||
<view class="all-text">
|
||||
<text>我的推荐(总)</text>
|
||||
<view class="number">{{count.all}}<text>人</text></view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="tab">
|
||||
<view class="item {{larerType == 1 ? 'active ' : ''}}" bindtap="onTabs" data-type="1">
|
||||
<image src="/static/icons/friendIcon_00.png" mode="widthFix"></image>直接推荐
|
||||
</view>
|
||||
<view class="item {{larerType == 2 ? 'active ' : ''}}" bindtap="onTabs" data-type="2">
|
||||
<image src="/static/icons/friendIcon_01.png" mode="widthFix"></image>间接推荐
|
||||
</view>
|
||||
</view>
|
||||
<block wx:if="{{relationArr.length > 0}}">
|
||||
<view class="list">
|
||||
<view class="item" wx:for="{{relationArr}}" wx:key="relationArr">
|
||||
<image class="list-cover" src="{{item.avatar || '/static/imgs/default_myHead.png'}}" mode="aspectFill"></image>
|
||||
<view class="list-text">
|
||||
<view class="list-nick nowrap">
|
||||
<view class="name">{{ item.nickname }}</view>
|
||||
<image class="user-sex" src="/static/icons/userIcon_00.png" mode="widthFix"></image>
|
||||
</view>
|
||||
<view class="identity">
|
||||
<image wx:if="{{item.identity.order == '1'}}" class="user-identity" src="/static/icons/member_01.png" mode="widthFix"></image>
|
||||
<image wx:elif="{{item.identity.order == '2'}}" class="user-identity" src="/static/icons/member_02.png" mode="widthFix"></image>
|
||||
<image wx:elif="{{item.identity.order == '3'}}" class="user-identity" src="/static/icons/member_03.png" mode="widthFix"></image>
|
||||
<image wx:elif="{{item.identity.order == '4'}}" class="user-identity" src="/static/icons/member_04.png" mode="widthFix"></image>
|
||||
<image wx:elif="{{item.identity.order == '5'}}" class="user-identity" src="/static/icons/member_05.png" mode="widthFix"></image>
|
||||
<image wx:else src="/static/icons/member_06.png" class="user-identity" mode="widthFix"></image>
|
||||
</view>
|
||||
<view class="list-user" bindtap="telClick" data-name="{{item.username}}">
|
||||
<image src="/static/icons/orderTel.png" mode="widthFix"></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
<view class="pack-center pages-hint" wx:else>
|
||||
<image src="/static/imgs/coupon_null.png"></image>
|
||||
<view>暂无数据</view>
|
||||
</view>
|
||||
139
pages/recommend/index.wxss
Normal file
139
pages/recommend/index.wxss
Normal file
@@ -0,0 +1,139 @@
|
||||
page {
|
||||
background: #f3f4f6;
|
||||
}
|
||||
|
||||
.all {
|
||||
background-color: #FFFFFF;
|
||||
position: relative;
|
||||
height: 220rpx;
|
||||
}
|
||||
|
||||
.all-back {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
}
|
||||
|
||||
.all-text {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
padding: 30rpx;
|
||||
box-sizing: border-box;
|
||||
color: #FFFFFF;
|
||||
font-size: 34rpx;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.number {
|
||||
font-size: 62rpx;
|
||||
font-weight: 600;
|
||||
margin-top: 10rpx;
|
||||
}
|
||||
|
||||
.number text {
|
||||
font-size: 26rpx;
|
||||
}
|
||||
|
||||
.tab {
|
||||
height: 100rpx;
|
||||
line-height: 100rpx;
|
||||
position: relative;
|
||||
display: flex;
|
||||
margin-top: -20rpx;
|
||||
}
|
||||
|
||||
.tab .item {
|
||||
flex: 2;
|
||||
text-align: center;
|
||||
border-radius: 30rpx 30rpx 0 0;
|
||||
font-weight: 600;
|
||||
background-color: #1e50f1;
|
||||
color: #b4c8ff;
|
||||
}
|
||||
|
||||
.tab .item.active {
|
||||
background-color: #FFFFFF;
|
||||
color: #000000;
|
||||
}
|
||||
|
||||
.tab .item image {
|
||||
width: 34rpx;
|
||||
height: 34rpx;
|
||||
vertical-align: -7rpx;
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
|
||||
.list {
|
||||
background-color: #FFFFFF;
|
||||
padding: 30rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.list .item {
|
||||
margin-bottom: 30rpx;
|
||||
display: flex;
|
||||
border-bottom: 2rpx solid #f3f3f3;
|
||||
padding-bottom: 30rpx;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.list .item:last-child {
|
||||
padding-bottom: 0;
|
||||
margin-bottom: 0;
|
||||
border: none;
|
||||
}
|
||||
|
||||
.list-cover {
|
||||
width: 100rpx;
|
||||
height: 100rpx;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.list-text {
|
||||
width: calc(100% - 120rpx);
|
||||
margin-left: 20rpx;
|
||||
margin-top: 5rpx;
|
||||
}
|
||||
|
||||
.list-nick {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.name {
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.user-sex {
|
||||
width: 40rpx;
|
||||
margin-left: 10rpx;
|
||||
}
|
||||
|
||||
.identity {
|
||||
margin-top: 10rpx;
|
||||
}
|
||||
|
||||
.user-identity {
|
||||
width: 130rpx;
|
||||
}
|
||||
|
||||
.list-user {
|
||||
background-color: #f2f5fd;
|
||||
width: 70rpx;
|
||||
height: 70rpx;
|
||||
border-radius: 50%;
|
||||
text-align: center;
|
||||
padding: 18rpx;
|
||||
box-sizing: border-box;
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: 20rpx;
|
||||
}
|
||||
|
||||
.list-user image {
|
||||
width: 100%;
|
||||
}
|
||||
Reference in New Issue
Block a user