对接活动实况接口;注掉登录接口代码
This commit is contained in:
@@ -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);
|
||||
}
|
||||
// 存当前绑定的小区ID,0 表示未绑定
|
||||
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);
|
||||
// }
|
||||
// // 存当前绑定的小区ID,0 表示未绑定
|
||||
// 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()
|
||||
};
|
||||
|
||||
// ========== 生命周期 ==========
|
||||
|
||||
Reference in New Issue
Block a user