var yzm = '';
$.post('/login/index',{tel:user,password:pass,vercode:yzm,ajax:1},function(res){
if(res.code==0){
layer.msg('登录成功!',{icon: 6,time: 2000},function(){
//登录成功后的操作
location.reload();
})
}else{
layer.msg(res.msg,{icon:5,time:2000});
var img = '/common/vercode?name=login_vercode&'+Math.random();
$("#login-yzm").attr('src',img);
}
},'json')
return false;
}
function mregister(){
var tel = $("#r-tel").val();
var pass = $("#r-pass").val();
var repass = $("#r-repass").val();
if(tel==''){
layer.alert('手机号不能为空!');return false;
}
if(pass==''){
layer.alert('登录密码不能为空!');return false;
}
if(repass==''){
layer.alert('重复密码不能为空!');return false;
}
if(pass!=repass){
layer.alert('两次密码不同!');return false;
}
var yzm = $("#r-yzm").val();
if(yzm==''){
layer.alert('验证码不能为空!');return false;
}
$.post('/login/register',{tel:tel,repassword:repass,password:pass,vercode:yzm,ajax:1,autologin:1},function(res){
if(res.code==0){
layer.msg(res.msg,{icon: 6,time: 2000},function(){
//登录成功后的操作
window.location.href=res.url;
})
}else{
layer.msg(res.msg,{icon:5,time:2000});
var img = '/common/vercode?name=reg_vercode&'+Math.random();
$("#register-yzm").attr('src',img);
}
},'json')
return false;
}
function sendmsg(){
var star = $("#star").val();
var tid = $("#tid").val();
var aid = $("#aid").val();
var zid = $("#zid").val();
var pid = $("#pid").val();
var content = $("#content").val();
if(content==''){
layer.alert('评论内容不能为空!');
return false;
}
$.post('/comment/index',{star:star,tid:tid,aid:aid,zid:zid,pid:pid,body:content,ajax:1,go:1},function(res){
if(res.code==0){
layer.msg(res.msg,{icon:6,time:2000},function(){
location.reload();
})
}else{
layer.msg(res.msg,{icon:5,time:2000})
}
},'json');
return false;
}
function reply(pid,username){
$("#pid").val(pid);
$("#content").val('[@'+username+']');
$("#content").focus();
}
var page;
if(undefined == page){
page = 1;
}
function getmessagelist(tid,aid,page){
$.ajax({
url:"/comment/getlist",
dataType:"json",
data:{tid:tid,aid:aid,page:page,limit:10},
async:true,
type:"GET",
success:function(r){
if(r.code==0){
var len = r.data.list.length;
var html = '';
if(len>0){
for(var i=0;i
'+rdata.user.username+'
'+ ''+rdata.addtime+''+ ''+rdata.body+ '
'+ '