From b28caaad4c0d12b0b5bc2064038ea92dc4dd7c43 Mon Sep 17 00:00:00 2001 From: zhangjing Date: Thu, 21 Sep 2023 12:00:51 +0800 Subject: [PATCH] =?UTF-8?q?[=E6=9C=80=E6=96=B0]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/interfaces/mall.js | 10 ++- pages/login/index.js | 2 +- pages/mall/details/details.js | 52 +++++++++++++- pages/mall/details/details.wxml | 17 +++++ pages/mall/details/details.wxss | 105 +++++++++++++++++++++++++++ pages/register/index.js | 3 +- pages/register/index.wxml | 3 + pages/user/index.js | 35 +++++++++ pages/user/index.wxml | 44 +++++++++--- pages/user/index.wxss | 121 +++++++++++++++++++++++++++++++- pages/user/team/index.wxml | 19 ++--- pages/user/team/index.wxss | 23 +++--- 12 files changed, 397 insertions(+), 37 deletions(-) diff --git a/api/interfaces/mall.js b/api/interfaces/mall.js index 86275bb..b552e5e 100644 --- a/api/interfaces/mall.js +++ b/api/interfaces/mall.js @@ -56,6 +56,13 @@ const articlesSee = (article_id) => req({ url: "cms/articles/" + article_id }) +//绑定业务员 +const userBind = (data) => req({ + url: "user/bind", + method: "POST", + data: data +}) + export default ({ Banner, idpackage, @@ -65,5 +72,6 @@ export default ({ place, placeTrue, articles, - articlesSee + articlesSee, + userBind }) \ No newline at end of file diff --git a/pages/login/index.js b/pages/login/index.js index c6f61ee..cd68024 100644 --- a/pages/login/index.js +++ b/pages/login/index.js @@ -41,7 +41,7 @@ Page({ let value = e.detail.value let data = { username : value.username, - password : value.password, + password : value.password } wx.$api.auth.Login(data).then(res => { // 存储登录信息 diff --git a/pages/mall/details/details.js b/pages/mall/details/details.js index 4e91d60..4f45342 100644 --- a/pages/mall/details/details.js +++ b/pages/mall/details/details.js @@ -23,7 +23,8 @@ Page({ specselectIndex : '', qtyNumber : 1, // 产品数量 goodsSize : false, - invite : '' + invite : '', + isParent : false, // 绑定邀请码 }, /** @@ -257,8 +258,16 @@ Page({ skuid : sku_id, 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 { 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 + }) + }) + }, + /** * 放大轮播相册图片 */ diff --git a/pages/mall/details/details.wxml b/pages/mall/details/details.wxml index 87e0843..fe50e2c 100644 --- a/pages/mall/details/details.wxml +++ b/pages/mall/details/details.wxml @@ -95,4 +95,21 @@ + + + + + + + + 绑定业务联系人 + + + + + + 暂不绑定 + 立即绑定 + + \ No newline at end of file diff --git a/pages/mall/details/details.wxss b/pages/mall/details/details.wxss index f2ab168..ab3db16 100644 --- a/pages/mall/details/details.wxss +++ b/pages/mall/details/details.wxss @@ -419,3 +419,108 @@ button[disabled]{ .goods-size-btn view.active { 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; +} \ No newline at end of file diff --git a/pages/register/index.js b/pages/register/index.js index bfa5386..93332cf 100644 --- a/pages/register/index.js +++ b/pages/register/index.js @@ -113,11 +113,12 @@ Page({ registerForm(e) { let value = e.detail.value let data = { + nickname : value.nickname, username : this.data.phone, code : value.code, password : value.password, password_confirmation : value.password_confirmation, - parent_id : getApp().globalData.invite + parent_id : getApp().globalData.invite, } wx.$api.auth.register(data).then(res => { // 存储登录信息 diff --git a/pages/register/index.wxml b/pages/register/index.wxml index 52102ba..30dcf9b 100644 --- a/pages/register/index.wxml +++ b/pages/register/index.wxml @@ -4,6 +4,9 @@
+ + + diff --git a/pages/user/index.js b/pages/user/index.js index 9348897..48fddbc 100644 --- a/pages/user/index.js +++ b/pages/user/index.js @@ -10,6 +10,8 @@ Page({ data: { userLogin : false, 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 + }) + }) + }, }) \ No newline at end of file diff --git a/pages/user/index.wxml b/pages/user/index.wxml index 3e1614b..7173c5f 100644 --- a/pages/user/index.wxml +++ b/pages/user/index.wxml @@ -23,18 +23,26 @@ - + - - {{userData.parent.nickname}}推荐人 - {{userData.parent.hidden_username}} - - - - 智能电话 - + + + {{userData.parent.nickname}}业务联系人 + {{userData.parent.hidden_username}} + + + + 智能电话 + + + + + 暂无业务联系人 + + 绑定业务联系人 + @@ -138,4 +146,22 @@ + + + + + + + + + 绑定业务联系人 + + + + + + 暂不绑定 + 立即绑定 + + \ No newline at end of file diff --git a/pages/user/index.wxss b/pages/user/index.wxss index f733029..9778411 100644 --- a/pages/user/index.wxss +++ b/pages/user/index.wxss @@ -150,6 +150,10 @@ page { color: #000000; } +.parent-cont-no { + line-height: 72rpx; +} + .parent-cont-name { font-weight: 600; margin-bottom: 6rpx; @@ -175,7 +179,8 @@ page { color: #333; } -.parent-tel { +.parent-tel, +.parent-bd { position: absolute; right: 30rpx; top: 32rpx; @@ -183,6 +188,15 @@ page { 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 { width: 36rpx; height: 36rpx; @@ -313,4 +327,109 @@ page { .goodsItem-sales { font-size: 26rpx; 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; } \ No newline at end of file diff --git a/pages/user/team/index.wxml b/pages/user/team/index.wxml index 8873b11..5cb0665 100644 --- a/pages/user/team/index.wxml +++ b/pages/user/team/index.wxml @@ -39,25 +39,28 @@ - {{item.nickname || '-'}} - {{item.hidden_username || '-'}}{{item.created_at}} + + {{item.nickname || '-'}} + {{item.hidden_username || '-'}} + + {{item.created_at}} - - 个人业绩(元) - {{item.self_perf}} + + 个人业绩(元) + - - 总业绩(元) - {{item.group_perf}} + + 总业绩(元) + diff --git a/pages/user/team/index.wxss b/pages/user/team/index.wxss index 625f697..7bf011b 100644 --- a/pages/user/team/index.wxss +++ b/pages/user/team/index.wxss @@ -76,7 +76,7 @@ page { } .listItem-item { - background-color: #ffffff; + background-image: linear-gradient(to bottom, #ffffff, #ecf4ff); border-radius: 20rpx; padding: 25rpx 30rpx; box-sizing: border-box; @@ -103,6 +103,7 @@ page { line-height: 40rpx; margin-bottom: 10rpx; display: flex; + flex: 1; } .listItem-name image { @@ -115,10 +116,6 @@ page { display: flex; } -.listItem-tel-user { - flex: 1; -} - .listItem-name text { padding-left: 20rpx; font-weight: normal; @@ -132,12 +129,11 @@ page { .listItem-flex { display: flex; - margin-top: 20rpx; - padding-top: 20rpx; - background-color: #f6f6f6; - padding: 20rpx; + margin-top: 30rpx; + padding-top: 30rpx; + padding-bottom: 10rpx; box-sizing: border-box; - border-radius: 10rpx; + border-top: 2rpx dotted #89bdff; } .listItem-label { @@ -147,12 +143,13 @@ page { .listItem-label-name { font-size: 26rpx; - margin-bottom: 15rpx; + margin-top: 15rpx; } .listItem-label-number { - font-size: 30rpx; - font-weight: 600; + font-size: 32rpx; + font-weight: 600; + color: #318dff; } /* 暂无数据 */