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 @@