Commit 5c518959 authored by 范雪寒's avatar 范雪寒

feat: 删除掉概率失败

parent f62290f6
...@@ -323,125 +323,74 @@ cc.Class({ ...@@ -323,125 +323,74 @@ cc.Class({
break; break;
case 'PSQS_get_pass_code': case 'PSQS_get_pass_code':
this.showLog('获取验证码: ' + data.phone); this.showLog('获取验证码: ' + data.phone);
if (Math.random() > 0.5) { callback({ success: true });
callback({ success: true });
} else {
callback({ success: false, msg: '请输入正确的手机号码。' });
}
break; break;
case 'PSQS_login': case 'PSQS_login':
this.showLog(`登录/注册: ${data.phone} ${data.code}`); this.showLog(`登录/注册: ${data.phone} ${data.code}`);
const number = Math.random(); callback({
if (number > 0.6) { success: true,
callback({ userInfo: { // userInfo为空时弹出填写用户信息的页面
success: true, phone: 13812345678,
userInfo: { // userInfo为空时弹出填写用户信息的页面 nickName: "小豆梓",
phone: 13812345678, sex: "girl",
nickName: "小豆梓", provice: "辽宁省",
sex: "girl", city: "大连市",
provice: "辽宁省", age: '5~8岁',
city: "大连市", grade: '一年级'
age: '5~8岁', },
grade: '一年级' bookInfo: [{
}, name: "kind_A",
bookInfo: [{ bookList: [{
name: "kind_A", id: 12334,
bookList: [{ coverImg: "http://staging-teach.cdn.ireadabc.com/0d332cb2b167feb4204b1d77a6f02ed6.jpg",
id: 12334, duration: "21:33",
coverImg: "http://staging-teach.cdn.ireadabc.com/0d332cb2b167feb4204b1d77a6f02ed6.jpg", rate: "55%",
duration: "21:33", createDate: "2012-12-21"
rate: "55%",
createDate: "2012-12-21"
}, {
id: 12231,
coverImg: "http://staging-teach.cdn.ireadabc.com/0d332cb2b167feb4204b1d77a6f02ed6.jpg",
duration: "21:33",
readTime: 2,
createDate: "2012-12-21"
}],
}, {
name: "kind_B",
bookList: [{
id: 12235,
coverImg: "http://staging-teach.cdn.ireadabc.com/0d332cb2b167feb4204b1d77a6f02ed6.jpg",
duration: "21:33",
readTime: 1,
createDate: "2012-12-21"
}],
}]
});
} else if (number > 0.3) {
callback({
success: true,
userInfo: null, // userInfo为空时弹出填写用户信息的页面
bookInfo: [{
name: "kind_A",
bookList: [{
id: 12334,
coverImg: "http://staging-teach.cdn.ireadabc.com/0d332cb2b167feb4204b1d77a6f02ed6.jpg",
duration: "21:33",
rate: "55%",
createDate: "2012-12-21"
}, {
id: 12231,
coverImg: "http://staging-teach.cdn.ireadabc.com/0d332cb2b167feb4204b1d77a6f02ed6.jpg",
duration: "21:33",
readTime: 2,
createDate: "2012-12-21"
}],
}, { }, {
name: "kind_B", id: 12231,
bookList: [{ coverImg: "http://staging-teach.cdn.ireadabc.com/0d332cb2b167feb4204b1d77a6f02ed6.jpg",
id: 12235, duration: "21:33",
coverImg: "http://staging-teach.cdn.ireadabc.com/0d332cb2b167feb4204b1d77a6f02ed6.jpg", readTime: 2,
duration: "21:33", createDate: "2012-12-21"
readTime: 1, }],
createDate: "2012-12-21" }, {
}], name: "kind_B",
}] bookList: [{
}); id: 12235,
} else { coverImg: "http://staging-teach.cdn.ireadabc.com/0d332cb2b167feb4204b1d77a6f02ed6.jpg",
callback({ success: false, msg: '验证码错误。' }); duration: "21:33",
} readTime: 1,
createDate: "2012-12-21"
}],
}]
});
break; break;
case 'PSQS_set_user_info': case 'PSQS_set_user_info':
this.showLog(`设置用户信息: ${JSON.stringify(data)}`); this.showLog(`设置用户信息: ${JSON.stringify(data)}`);
if (Math.random() > 0.5) { callback({ success: true });
callback({ success: true });
} else {
callback({ success: false, msg: '错误信息' });
}
break; break;
case 'PSQS_scan_code': case 'PSQS_scan_code':
this.showLog(`扫码`); this.showLog(`扫码`);
if (Math.random() > 0.5) { callback({
callback({ success: true,
success: true, bookInfo: [{
bookInfo: [{ name: "kind_A",
name: "kind_A", bookList: [{
bookList: [{ id: 12334,
id: 12334, coverImg: "http://staging-teach.cdn.ireadabc.com/0d332cb2b167feb4204b1d77a6f02ed6.jpg",
coverImg: "http://staging-teach.cdn.ireadabc.com/0d332cb2b167feb4204b1d77a6f02ed6.jpg", duration: "21:33",
duration: "21:33", rate: "0%",
rate: "0%", createDate: "2012-12-21"
createDate: "2012-12-21" }],
}], }, {
}, { name: "kind_B",
name: "kind_B", bookList: [],
bookList: [], }]
}] });
});
} else {
callback({ success: false, msg: '错误信息' });
}
break; break;
case 'PSQS_read_book': case 'PSQS_read_book':
this.showLog('进入课件: ' + data.bookId); this.showLog('进入课件: ' + data.bookId);
if (Math.random() > 0.5) { callback({ success: true });
callback({ success: true });
} else {
callback({ success: false, msg: '请输入正确的手机号码。' });
}
break; break;
case 'PSQS_get_basic_info': case 'PSQS_get_basic_info':
this.showLog('获取基本信息'); this.showLog('获取基本信息');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment