对接活动实况接口;注掉登录接口代码

This commit is contained in:
zhouyanli
2026-04-27 13:38:24 +08:00
parent ae9465cc0e
commit d52cbbd51b
8 changed files with 256 additions and 115 deletions

View File

@@ -93,7 +93,7 @@ const phoneNumber = ref('');
const verifyCode = ref('');
const placeholderStyle = ref('font-size:24rpx')
// 是否同意协议
const agreeAgreement = ref(true); // 默认勾选
const agreeAgreement = ref(false); // 默认勾选
// 倒计时(秒)
const countDown = ref(0);
// 定时器
@@ -173,42 +173,50 @@ const handleLogin = () => {
smsCode:'123456',
scene:'login',
}
getLoginBySms(params).then(res =>{
if(res.code === 200){
if(res.data){
uni.setStorageSync('token', res.data.token);
// 存用户ID
if(res.data.userId) {
uni.setStorageSync('userId', res.data.userId);
}
// 存当前绑定的小区ID0 表示未绑定
const currentVillageId = res.data.currentVillageId || 0;
uni.setStorageSync('currentVillageId', currentVillageId);
uni.hideLoading();
uni.showToast({ title: '登录成功', icon: 'success' });
setTimeout(() =>{
uni.switchTab({ url: '/pages/index/index' });
},1500)
}else{
uni.showToast({ title: '登录失败', icon: 'error' });
}
// getLoginBySms(params).then(res =>{
// if(res.code === 200){
// if(res.data){
// uni.setStorageSync('token', res.data.token);
// // 存用户ID
// if(res.data.userId) {
// uni.setStorageSync('userId', res.data.userId);
// }
// // 存当前绑定的小区ID0 表示未绑定
// const currentVillageId = res.data.currentVillageId || 0;
// uni.setStorageSync('currentVillageId', currentVillageId);
// uni.hideLoading();
// uni.showToast({ title: '登录成功', icon: 'success' });
// setTimeout(() =>{
// uni.switchTab({ url: '/pages/index/index' });
// },1500)
// }else{
// uni.showToast({ title: '登录失败', icon: 'error' });
// }
}else{
uni.showToast({ title:'登录失败', icon: 'error' });
}
// }else{
// uni.showToast({ title:'登录失败', icon: 'error' });
// }
}).catch(err => {
uni.showToast({
title: '网络异常,请重试',
icon: 'error'
});
})
// }).catch(err => {
// uni.showToast({
// title: '网络异常,请重试',
// icon: 'error'
// });
// })
// 模拟登录请求
// uni.showLoading({
// title: '登录中...'
// });
uni.showLoading({
title: '登录中...'
});
uni.showToast({
title:"登录成功",
icon:'success'
})
setTimeout(() =>{
uni.switchTab({ url: '/pages/index/index' });
},1500)
uni.hideLoading()
};
// ========== 生命周期 ==========