vue+php实现的微博留言功能示例
本文实例讲述了vue+php实现的微博留言功能。分享给大家供大家参考,具体如下:
html部分:
微博留言 (可按Enter回复)
本文实例讲述了vue+php实现的微博留言功能。分享给大家供大家参考,具体如下:
html部分:
微博留言 (可按Enter回复)
php部分:
0) { echo'[{'.implode('},{',$aResult).'}]'; } else { echo'[]'; } break; case'acc': $id=(int)$_GET['id']; $res=mysql_query("SELECTaccFROMweiboWHEREID={$id}"); $row=mysql_fetch_array($res); $old=(int)$row[0]+1; $sql="UPDATEweiboSETacc={$old}WHEREID={$id}"; mysql_query($sql); echo'{"error":0}'; break; case'ref': $id=(int)$_GET['id']; $res=mysql_query("SELECTrefFROMweiboWHEREID={$id}"); $row=mysql_fetch_array($res); $old=(int)$row[0]+1; $sql="UPDATEweiboSETref={$old}WHEREID={$id}"; mysql_query($sql); echo'{"error":0}'; break; case'del': $id=(int)$_GET['id']; $sql="DELETEFROMweiboWHEREID={$id}"; //echo$sql;exit; mysql_query($sql); echo'{"error":0}'; break; } ?>
CSS部分:
@charset"utf-8";body,ul,ol,li,dl,dt,dd,p,h1,h2,h3,h4,h5,h6,form,fieldset,table,td,img,div{margin:0;padding:0;border:0} body{font-size:12px;font-family:"MicrosoftYaHei"} ul,ol{list-style-type:none} select,input,img,select{vertical-align:middle} a{text-decoration:underline;color:#313030} a{blr:expression(this.onFocus=this.blur())} input,textarea{outline:0;resize:none} a{outline:0} .znsArea{width:755px;overflow:hidden;margin:0auto;font-family:"MicrosoftYaHei"} .commentOn{width:753px;display:block;overflow:hidden;border:#a5bcffsolid1px;background:#f3f8fd;margin-top:25px;font-family:Verdana} .reply{overflow:hidden;padding:10px20px;background:#FFF;border-top:#e9e9e9solid1px;border-bottom:#e9e9e9solid1px} .userInfo{display:block;overflow:hidden;height:25px;border-bottom:#bababasolid1px} .userName{float:left;background:url(../img/userBj.png)leftcenterno-repeat;padding-left:15px;color:#000;font-size:14px;font-weight:bold} .replyTime{float:left;color:#8b8585;line-height:30px;font-size:11px} .replyContent{line-height:24px;font-size:14px;color:#2b2b2b;font-family:"MicrosoftYaHei"} .operation{clear:both;width:100%;height:30px;margin-top:8px} .handle{float:right;padding-top:6px} .handlea{text-decoration:none;float:left;margin-left:12px;background:url(../img/icons.png)00no-repeat;height:18px;line-height:18px;padding-left:20px} .handle.top_icon{background-position:00} .handle.down_icon{background-position:0-17px} .handle.cut{background-position:0-33px} .handlea:active{color:#09F} .noContent{text-align:center;display:block;background:#FFF;font:14px/2.3"MicrosoftYaHei";border-bottom:#e9e9e9solid1px;border-top:#e9e9e9solid1px;color:#999} .takeComment{width:713px;display:block;overflow:hidden;border:#a5bcffsolid1px;background:#f3f8fd;margin-top:25px;font-family:Verdana;padding:15px20px} .takeTextField{width:701px;height:70px;border:#b1b1b1solid1px;clear:both;display:block;margin:10px010px0;line-height:20px;padding:5px;box-shadow:inset005px#DDD;font-family:"MicrosoftYaHei"} .takeSbmComment{display:block;overflow:hidden} .takeSbmCommentspan{float:right;color:#CCC;line-height:37px;padding-right:10px} .inputs{float:right;width:125px;height:37px;border:none0;background:tranparent;background:url(../img/takeSbmComment.png)lefttopno-repeat;cursor:pointer;opacity:.8} .inputs:hover{opacity:1} .inputs:active{opacity:.9} .messList{overflow:hidden} .page{text-align:right;font-size:0;font-family:Verdana;padding:10px16px} .pagea{display:inline-block;height:20px;padding:07px;border:#CCCsolid1px;font:12px/20pxVerdana;text-decoration:none;margin-left:5px;background:#FFF} .pagea:hover{background:#09F;color:#FFF;border-color:#09F} .page.active{background:#CCC} .pagea:active{opacity:.8}
希望本文所述对大家vue.js程序设计有所帮助。