|
|
|
@ -61,6 +61,7 @@ Page({ |
|
|
|
testMode: true, |
|
|
|
partnerstatus: '', |
|
|
|
viewedGoods: [], // 已浏览商品ID列表
|
|
|
|
isInPersonnel: false, // 用户手机号是否在personnel表中
|
|
|
|
|
|
|
|
// 广告轮播图数据
|
|
|
|
adCarouselList: [ |
|
|
|
@ -452,6 +453,27 @@ Page({ |
|
|
|
}); |
|
|
|
}, |
|
|
|
|
|
|
|
// 检查用户手机号是否在personnel表中
|
|
|
|
checkPhoneInPersonnel() { |
|
|
|
const userInfo = this.data.userInfo; |
|
|
|
const phoneNumber = userInfo.phoneNumber; |
|
|
|
|
|
|
|
if (!phoneNumber) { |
|
|
|
this.setData({ isInPersonnel: false }); |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
console.log('开始检查手机号是否在personnel表中:', phoneNumber); |
|
|
|
|
|
|
|
API.checkPhoneInPersonnel(phoneNumber).then(isInPersonnel => { |
|
|
|
console.log('用户手机号是否在personnel表中:', isInPersonnel); |
|
|
|
this.setData({ isInPersonnel }); |
|
|
|
}).catch(err => { |
|
|
|
console.error('检查personnel表失败:', err); |
|
|
|
this.setData({ isInPersonnel: false }); |
|
|
|
}); |
|
|
|
}, |
|
|
|
|
|
|
|
// 切换按钮显示/隐藏到侧边栏
|
|
|
|
toggleSidebarBtn() { |
|
|
|
this.setData({ |
|
|
|
@ -558,6 +580,7 @@ Page({ |
|
|
|
this.checkAndRestoreLoginStatus() |
|
|
|
this.loadCategories() |
|
|
|
this.loadGoods() |
|
|
|
this.checkPhoneInPersonnel() |
|
|
|
|
|
|
|
// 计算搜索区域高度
|
|
|
|
setTimeout(() => { |
|
|
|
@ -634,6 +657,7 @@ Page({ |
|
|
|
}); |
|
|
|
|
|
|
|
this.checkAndRestoreLoginStatus() |
|
|
|
this.checkPhoneInPersonnel() |
|
|
|
}, |
|
|
|
|
|
|
|
onHide: function () { |
|
|
|
|