This commit is contained in:
2023-09-21 12:00:51 +08:00
parent a626d36591
commit b28caaad4c
12 changed files with 397 additions and 37 deletions

View File

@@ -56,6 +56,13 @@ const articlesSee = (article_id) => req({
url: "cms/articles/" + article_id url: "cms/articles/" + article_id
}) })
//绑定业务员
const userBind = (data) => req({
url: "user/bind",
method: "POST",
data: data
})
export default ({ export default ({
Banner, Banner,
idpackage, idpackage,
@@ -65,5 +72,6 @@ export default ({
place, place,
placeTrue, placeTrue,
articles, articles,
articlesSee articlesSee,
userBind
}) })

View File

@@ -41,7 +41,7 @@ Page({
let value = e.detail.value let value = e.detail.value
let data = { let data = {
username : value.username, username : value.username,
password : value.password, password : value.password
} }
wx.$api.auth.Login(data).then(res => { wx.$api.auth.Login(data).then(res => {
// 存储登录信息 // 存储登录信息

View File

@@ -23,7 +23,8 @@ Page({
specselectIndex : '', specselectIndex : '',
qtyNumber : 1, // 产品数量 qtyNumber : 1, // 产品数量
goodsSize : false, goodsSize : false,
invite : '' invite : '',
isParent : false, // 绑定邀请码
}, },
/** /**
@@ -257,8 +258,16 @@ Page({
skuid : sku_id, skuid : sku_id,
goodsSize : false goodsSize : false
}) })
wx.navigateTo({ // 是否有推荐人
url: '/pages/mall/confirm/confirm?skuId=' + sku_id + '&qty=' + this.data.qtyNumber || 1 if(this.data.goodsData.has_parent) {
wx.navigateTo({
url: '/pages/mall/confirm/confirm?skuId=' + sku_id + '&qty=' + this.data.qtyNumber || 1
})
return
}
// 显示绑定手机号弹窗
this.setData({
isParent: true
}) })
} else { } else {
uni.showToast({ uni.showToast({
@@ -309,6 +318,43 @@ Page({
}) })
}, },
/*
获取邀请码
*/
bindinput(e) {
this.setData({
nameValue: e.detail.value
})
},
/**
* 关闭绑定邀请码弹窗
*/
nameCancel() {
this.setData({
isParent: !this.data.isParent
})
},
/**
* 绑定邀请码
*/
nameTrue() {
let {
sku_id
} = this.data.selectSkusValues;
wx.$api.mall.userBind({
username: this.data.nameValue
}).then(res => {
wx.navigateTo({
url: '/pages/mall/confirm/confirm?skuId=' + sku_id + '&qty=' + this.data.qtyNumber || 1
})
this.setData({
isParent: false
})
})
},
/** /**
* 放大轮播相册图片 * 放大轮播相册图片
*/ */

View File

@@ -96,3 +96,20 @@
<button bindtap="buyTap" size="default" disabled="{{selectSkusValues.stock == 0 || qtyNumber == 0}}">立即购买</button> <button bindtap="buyTap" size="default" disabled="{{selectSkusValues.stock == 0 || qtyNumber == 0}}">立即购买</button>
</view> </view>
</view> </view>
<!-- 绑定业务联系人 -->
<view class="namePop {{isParent ? 'active' : ''}}"></view>
<view class="nameCont {{isParent ? 'active' : ''}}">
<view class="nameCont-white">
<view class="nameCont-top">
<view class="nameCont-title">绑定业务联系人</view>
<view class="nameCont-input">
<input type="text" name="name" value="{{nameValue}}" placeholder="请输入业务联系人手机号" bindinput="bindinput" />
</view>
</view>
<view class="nameCont-btn">
<view class="nameCont-btn-go" bindtap="nameCancel">暂不绑定</view>
<view class="nameCont-btn-go" bindtap="nameTrue">立即绑定</view>
</view>
</view>
</view>

View File

@@ -419,3 +419,108 @@ button[disabled]{
.goods-size-btn view.active { .goods-size-btn view.active {
background: #b8b8b8; background: #b8b8b8;
} }
/* 邀请码弹出 */
.namePop {
position: fixed;
background-color: rgba(0, 0, 0, .5);
left: 0;
top: 0;
height: 100vh;
width: 100vw;
z-index: 100000;
display: none;
}
.namePop.active {
display: block;
}
.nameCont {
-webkit-box-orient: vertical;
-webkit-box-pack: center;
position: fixed;
left: 0;
right: 0;
top: 0;
bottom: 0;
z-index: 100000;
padding: 0 15%;
box-sizing: border-box;
display: none;
}
.nameCont.active {
display: -webkit-box;
}
.nameCont-white {
background-color: #ffffff;
border-radius: 15rpx;
overflow: hidden;
}
.nameCont-top {
padding: 30rpx;
box-sizing: border-box;
}
.nameCont-title {
font-size: 34rpx;
margin-bottom: 30rpx;
}
.nameCont-input {
height: 90rpx;
line-height: 90rpx;
position: relative;
background-color: #f3f3f3;
border-radius: 10rpx;
overflow: hidden;
padding: 0 25rpx;
box-sizing: border-box;
}
.nameCont-input input {
width: calc(100% - 40rpx);
height: 100%;
background-color: transparent;
}
.nameCont-colse {
width: 40rpx;
height: 40rpx;
top: 25rpx;
right: 20rpx;
position: absolute;
z-index: 9;
}
.nameCont-btn {
line-height: 100rpx;
background-color: #f3f3f3;
display: flex;
margin-top: 30rpx;
border-top: 2rpx solid #dfdfdf;
}
.nameCont-btn-go {
text-align: center;
flex: 2;
}
.nameCont-btn-go:last-child {
position: relative;
color: #ff9951;
}
.nameCont-btn-go:last-child::after {
position: absolute;
content: '';
left: 0;
top: 0;
width: 2rpx;
height: 100%;
background-color: #dfdfdf;
}

View File

@@ -113,11 +113,12 @@ Page({
registerForm(e) { registerForm(e) {
let value = e.detail.value let value = e.detail.value
let data = { let data = {
nickname : value.nickname,
username : this.data.phone, username : this.data.phone,
code : value.code, code : value.code,
password : value.password, password : value.password,
password_confirmation : value.password_confirmation, password_confirmation : value.password_confirmation,
parent_id : getApp().globalData.invite parent_id : getApp().globalData.invite,
} }
wx.$api.auth.register(data).then(res => { wx.$api.auth.register(data).then(res => {
// 存储登录信息 // 存储登录信息

View File

@@ -4,6 +4,9 @@
</view> </view>
<form bindsubmit="registerForm" class="site-form"> <form bindsubmit="registerForm" class="site-form">
<!-- 输入手机号相关 --> <!-- 输入手机号相关 -->
<view class="inputs">
<input type="text" placeholder="请输入姓名" name="nickname" />
</view>
<view class="inputs"> <view class="inputs">
<input type="number" placeholder="请输入手机号" maxlength="11" bindinput="bindInput" /> <input type="number" placeholder="请输入手机号" maxlength="11" bindinput="bindInput" />
</view> </view>

View File

@@ -10,6 +10,8 @@ Page({
data: { data: {
userLogin : false, userLogin : false,
userData : '', userData : '',
nameValue : '',
isParent : false
}, },
/** /**
@@ -97,4 +99,37 @@ Page({
} }
}) })
}, },
/*
获取邀请码
*/
bindinput(e) {
this.setData({
nameValue: e.detail.value
})
},
/**
* 关闭绑定邀请码弹窗
*/
toBd() {
this.setData({
isParent: !this.data.isParent
})
},
/**
* 绑定邀请码
*/
nameTrue() {
wx.$api.mall.userBind({
username: this.data.nameValue
}).then(res => {
// 获取用户信息
this.userInfo();
this.setData({
isParent: false
})
})
},
}) })

View File

@@ -23,18 +23,26 @@
<!-- 推荐人 --> <!-- 推荐人 -->
<block wx:if="{{userLogin}}"> <block wx:if="{{userLogin}}">
<view class="userCont" wx:if="{{userData.parent != ''}}"> <view class="userCont">
<view class="white"> <view class="white">
<view class="parent-user"> <view class="parent-user">
<image class="parent-icon" src="/static/icons/parent_icon.png"></image> <image class="parent-icon" src="/static/icons/parent_icon.png"></image>
<view class="parent-cont"> <block wx:if="{{userData.parent != ''}}">
<view class="parent-cont-name">{{userData.parent.nickname}}<view class="parent-cont-tips">推荐人</view></view> <view class="parent-cont">
<view class="parent-cont-tel">{{userData.parent.hidden_username}}</view> <view class="parent-cont-name">{{userData.parent.nickname}}<view class="parent-cont-tips">业务联系人</view></view>
</view> <view class="parent-cont-tel">{{userData.parent.hidden_username}}</view>
<view class="parent-tel" bindtap="toCall"> </view>
<image class="parent-tel-icon" src="/static/icons/parent_tel.png"></image> <view class="parent-tel" bindtap="toCall">
<view class="parent-tel-name">智能电话</view> <image class="parent-tel-icon" src="/static/icons/parent_tel.png"></image>
</view> <view class="parent-tel-name">智能电话</view>
</view>
</block>
<block wx:else>
<view class="parent-cont">
<view class="parent-cont-no">暂无业务联系人</view>
</view>
<view class="parent-bd" bindtap="toBd">绑定业务联系人</view>
</block>
</view> </view>
</view> </view>
</view> </view>
@@ -139,3 +147,21 @@
</view> </view>
</view> </view>
</view> </view>
<!-- 绑定业务联系人 -->
<view class="namePop {{isParent ? 'active' : ''}}"></view>
<view class="nameCont {{isParent ? 'active' : ''}}">
<view class="nameCont-white">
<view class="nameCont-top">
<view class="nameCont-title">绑定业务联系人</view>
<view class="nameCont-input">
<input type="text" name="name" value="{{nameValue}}" placeholder="请输入业务联系人手机号" bindinput="bindinput" />
</view>
</view>
<view class="nameCont-btn">
<view class="nameCont-btn-go" bindtap="toBd">暂不绑定</view>
<view class="nameCont-btn-go" bindtap="nameTrue">立即绑定</view>
</view>
</view>
</view>

View File

@@ -150,6 +150,10 @@ page {
color: #000000; color: #000000;
} }
.parent-cont-no {
line-height: 72rpx;
}
.parent-cont-name { .parent-cont-name {
font-weight: 600; font-weight: 600;
margin-bottom: 6rpx; margin-bottom: 6rpx;
@@ -175,7 +179,8 @@ page {
color: #333; color: #333;
} }
.parent-tel { .parent-tel,
.parent-bd {
position: absolute; position: absolute;
right: 30rpx; right: 30rpx;
top: 32rpx; top: 32rpx;
@@ -183,6 +188,15 @@ page {
text-align: center; text-align: center;
} }
.parent-bd {
font-size: 26rpx;
border: 2rpx solid #da2b54;
color: #da2b54;
border-radius: 10rpx;
line-height: 64rpx;
padding: 0 15rpx;
}
.parent-tel-icon { .parent-tel-icon {
width: 36rpx; width: 36rpx;
height: 36rpx; height: 36rpx;
@@ -314,3 +328,108 @@ page {
font-size: 26rpx; font-size: 26rpx;
color: #999999; color: #999999;
} }
/* 邀请码弹出 */
.namePop {
position: fixed;
background-color: rgba(0, 0, 0, .5);
left: 0;
top: 0;
height: 100vh;
width: 100vw;
z-index: 100000;
display: none;
}
.namePop.active {
display: block;
}
.nameCont {
-webkit-box-orient: vertical;
-webkit-box-pack: center;
position: fixed;
left: 0;
right: 0;
top: 0;
bottom: 0;
z-index: 100000;
padding: 0 15%;
box-sizing: border-box;
display: none;
}
.nameCont.active {
display: -webkit-box;
}
.nameCont-white {
background-color: #ffffff;
border-radius: 15rpx;
overflow: hidden;
}
.nameCont-top {
padding: 30rpx;
box-sizing: border-box;
}
.nameCont-title {
font-size: 34rpx;
margin-bottom: 30rpx;
}
.nameCont-input {
height: 90rpx;
line-height: 90rpx;
position: relative;
background-color: #f3f3f3;
border-radius: 10rpx;
overflow: hidden;
padding: 0 25rpx;
box-sizing: border-box;
}
.nameCont-input input {
width: calc(100% - 40rpx);
height: 100%;
background-color: transparent;
}
.nameCont-colse {
width: 40rpx;
height: 40rpx;
top: 25rpx;
right: 20rpx;
position: absolute;
z-index: 9;
}
.nameCont-btn {
line-height: 100rpx;
background-color: #f3f3f3;
display: flex;
margin-top: 30rpx;
border-top: 2rpx solid #dfdfdf;
}
.nameCont-btn-go {
text-align: center;
flex: 2;
}
.nameCont-btn-go:last-child {
position: relative;
color: #ff9951;
}
.nameCont-btn-go:last-child::after {
position: absolute;
content: '';
left: 0;
top: 0;
width: 2rpx;
height: 100%;
background-color: #dfdfdf;
}

View File

@@ -39,25 +39,28 @@
<view class="listItem-item" wx:for="{{childrenArr}}" wx:key="childrenArr"> <view class="listItem-item" wx:for="{{childrenArr}}" wx:key="childrenArr">
<image class="listItem-head" src="{{item.avatar ? item.avatar : '/static/imgs/userHead.png'}}" mode="widthFix"></image> <image class="listItem-head" src="{{item.avatar ? item.avatar : '/static/imgs/userHead.png'}}" mode="widthFix"></image>
<view class="listItem-cont"> <view class="listItem-cont">
<view class="listItem-name nowrap">{{item.nickname || '-'}} <image src="{{item.identity.cover}}" mode="widthFix"></image></view> <view class="listItem-tel nowrap">
<view class="listItem-tel nowrap"><view class="listItem-tel-user">{{item.hidden_username || '-'}}</view><view class="listItem-time nowrap">{{item.created_at}}</view></view> <view class="listItem-name">{{item.nickname || '-'}} <image src="{{item.identity.cover}}" mode="widthFix"></image></view>
<view class="listItem-tel-user">{{item.hidden_username || '-'}}</view>
</view>
<view class="listItem-tel nowrap"><view class="listItem-time nowrap">{{item.created_at}}</view></view>
</view> </view>
<view class="listItem-flex"> <view class="listItem-flex">
<view class="listItem-label"> <view class="listItem-label">
<view class="listItem-label-name">
个人业绩(元)
</view>
<view class="listItem-label-number"> <view class="listItem-label-number">
{{item.self_perf}} {{item.self_perf}}
</view> </view>
<view class="listItem-label-name">
个人业绩(元)
</view>
</view> </view>
<view class="listItem-label"> <view class="listItem-label">
<view class="listItem-label-name">
总业绩(元)
</view>
<view class="listItem-label-number"> <view class="listItem-label-number">
{{item.group_perf}} {{item.group_perf}}
</view> </view>
<view class="listItem-label-name">
总业绩(元)
</view>
</view> </view>
</view> </view>
</view> </view>

View File

@@ -76,7 +76,7 @@ page {
} }
.listItem-item { .listItem-item {
background-color: #ffffff; background-image: linear-gradient(to bottom, #ffffff, #ecf4ff);
border-radius: 20rpx; border-radius: 20rpx;
padding: 25rpx 30rpx; padding: 25rpx 30rpx;
box-sizing: border-box; box-sizing: border-box;
@@ -103,6 +103,7 @@ page {
line-height: 40rpx; line-height: 40rpx;
margin-bottom: 10rpx; margin-bottom: 10rpx;
display: flex; display: flex;
flex: 1;
} }
.listItem-name image { .listItem-name image {
@@ -115,10 +116,6 @@ page {
display: flex; display: flex;
} }
.listItem-tel-user {
flex: 1;
}
.listItem-name text { .listItem-name text {
padding-left: 20rpx; padding-left: 20rpx;
font-weight: normal; font-weight: normal;
@@ -132,12 +129,11 @@ page {
.listItem-flex { .listItem-flex {
display: flex; display: flex;
margin-top: 20rpx; margin-top: 30rpx;
padding-top: 20rpx; padding-top: 30rpx;
background-color: #f6f6f6; padding-bottom: 10rpx;
padding: 20rpx;
box-sizing: border-box; box-sizing: border-box;
border-radius: 10rpx; border-top: 2rpx dotted #89bdff;
} }
.listItem-label { .listItem-label {
@@ -147,12 +143,13 @@ page {
.listItem-label-name { .listItem-label-name {
font-size: 26rpx; font-size: 26rpx;
margin-bottom: 15rpx; margin-top: 15rpx;
} }
.listItem-label-number { .listItem-label-number {
font-size: 30rpx; font-size: 32rpx;
font-weight: 600; font-weight: 600;
color: #318dff;
} }
/* 暂无数据 */ /* 暂无数据 */