|
@@ -186,71 +186,139 @@ class tpl_group_home
|
|
|
$name = $this->room_info->has_name() ? $this->room_info->name() : "未命名";
|
|
|
$notice = empty($this->room_info->notice()) ? "未设置" : "已设置";
|
|
|
$desc = empty($this->room_info->room_desc()) ? "未设置" : "已设置";
|
|
|
- $level = $this->room_info->level() == 0 ? "未认证" : "已认证";
|
|
|
- $level_sign = $this->room_info->level() == 0 ? 0 : 1;
|
|
|
-
|
|
|
$cnt = $this->mod_room->applyCnts(['room_id'=>$this->room_id,"step"=>0]);
|
|
|
- $apply = $cnt > 0 ? "待处理" . $cnt : "";
|
|
|
+ $apply = $cnt > 0 ? "待处理" . $cnt : "暂无申请";
|
|
|
+
|
|
|
+ $click = false;
|
|
|
+ $level = "已认证";
|
|
|
+ if($this->room_info->level() == 0) {
|
|
|
+ $certs = $this->mod_room->findCert(["room_id"=>$this->room_id]);
|
|
|
+ if(!empty($certs)) {
|
|
|
+ if($certs['cstatus'] == 0) {
|
|
|
+ $level = "待审核";
|
|
|
+ }elseif($certs['cstatus'] == 2 || $certs['cstatus'] == 3){
|
|
|
+ $click = true;
|
|
|
+ $level = "待修改";
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ $click = true;
|
|
|
+ $level = "未认证";
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
- $html .= "<div class=\"weui-cells\">
|
|
|
- <a class=\"weui-cell weui-cell_access\" id='edit_group_name' href=\"javascript:;\">
|
|
|
- <div class=\"weui-cell__bd\">
|
|
|
- <p>群名称</p>
|
|
|
- </div>
|
|
|
- <div class=\"weui-cell__ft\">{$name}</div>
|
|
|
- </a>
|
|
|
-
|
|
|
- <a class=\"weui-cell weui-cell_access\" id=\"edit_group_avatar\" href=\"javascript:;\" onclick='uploader.click()'>
|
|
|
- <div class=\"weui-cell__bd\">
|
|
|
- <p>群头像</p>
|
|
|
- </div>
|
|
|
- <div class=\"weui-cell__ft\">
|
|
|
- <img src='{$avartar}' class='g_avatar' alt=''>
|
|
|
- <input type='file' name='file' enctype='multipart/form-data' id='uploader' style=\"display: none;\">
|
|
|
- </div>
|
|
|
- </a>
|
|
|
-
|
|
|
- <a class=\"weui-cell weui-cell_access\" id=\"group_AC\" href=\"javascript:;\" data-can-cert=\"{$level_sign}\">
|
|
|
- <div class=\"weui-cell__bd\">
|
|
|
- <p>群认证</p>
|
|
|
- </div>
|
|
|
- <div class=\"weui-cell__ft\" >{$level}</div>
|
|
|
- </a>
|
|
|
+
|
|
|
+ $html.= "<div class=\"weui-cells\">";
|
|
|
+ $html.= $this->room_name_btn($click,$name);
|
|
|
+ $html.= $this->room_avatar_btn($avartar);
|
|
|
+ $html.= $this->room_cert_btn($click,$level);
|
|
|
+ $html.= "</div>";
|
|
|
+
|
|
|
+ $html.= $this->room_manager_btn($desc,$notice,$apply,$cnt);
|
|
|
+
|
|
|
+ }
|
|
|
+ echo $html;
|
|
|
+ }
|
|
|
+
|
|
|
+ private function room_name_btn($click,$name)
|
|
|
+ {
|
|
|
+ if($click){
|
|
|
+ $html = "<div class=\"weui-cell weui-cell_access\" id='edit_group_name'>
|
|
|
+ <div class=\"weui-cell__bd\">
|
|
|
+ <p>群名称</p>
|
|
|
+ </div>
|
|
|
+ <div class=\"weui-cell__ft\">{$name}</div>
|
|
|
+ </div>";
|
|
|
+ } else {
|
|
|
+ $html = "<div class=\"weui-cell\">
|
|
|
+ <div class=\"weui-cell__bd\">
|
|
|
+ <p>群名称</p>
|
|
|
+ </div>
|
|
|
+ <div class=\"weui-cell__ft\">{$name}</div>
|
|
|
</div>";
|
|
|
}
|
|
|
+ return $html;
|
|
|
+ }
|
|
|
|
|
|
- if ($this->isManager($this->cur_user)) {
|
|
|
- $html.="<div class=\"weui-cells\">
|
|
|
- <a class=\"weui-cell weui-cell_access\" href=\"javascript:;\" id=\"edit_room_notice\">
|
|
|
+ private function room_avatar_btn($avartar){
|
|
|
+ $html = "<div class=\"weui-cell weui-cell_access\" id=\"edit_group_avatar\" onclick='uploader.click()'>
|
|
|
+ <div class=\"weui-cell__bd\">
|
|
|
+ <p>群头像</p>
|
|
|
+ </div>
|
|
|
+ <div class=\"weui-cell__ft\">
|
|
|
+ <img src='{$avartar}' class='g_avatar' alt=''>
|
|
|
+ <input type='file' name='file' enctype='multipart/form-data' id='uploader' style=\"display: none;\">
|
|
|
+ </div>
|
|
|
+ </div>";
|
|
|
+ return $html;
|
|
|
+ }
|
|
|
+
|
|
|
+ private function room_cert_btn($click,$level)
|
|
|
+ { if(!$this->isManager($this->cur_user)){
|
|
|
+ return "";
|
|
|
+ }
|
|
|
+ if($click){
|
|
|
+ $html = "<div class=\"weui-cell weui-cell_access\" id=\"group_AC\">
|
|
|
+ <div class=\"weui-cell__bd\">
|
|
|
+ <p>群认证</p>
|
|
|
+ </div>
|
|
|
+ <div class=\"weui-cell__ft\">{$level}</div>
|
|
|
+ </div>";
|
|
|
+ }else{
|
|
|
+ $html = "<div class=\"weui-cell\">
|
|
|
+ <div class=\"weui-cell__bd\">
|
|
|
+ <p>群认证</p>
|
|
|
+ </div>
|
|
|
+ <div class=\"weui-cell__ft\">{$level}</div>
|
|
|
+ </div>";
|
|
|
+ }
|
|
|
+ return $html;
|
|
|
+ }
|
|
|
+
|
|
|
+ private function room_manager_btn($desc,$notice,$apply,$cnt){
|
|
|
+ if ($this->isManager($this->cur_user))
|
|
|
+ {
|
|
|
+ $html = "<div class=\"weui-cells\">";
|
|
|
+ $html.= "<div class=\"weui-cell weui-cell_access\" href=\"javascript:;\" id=\"edit_room_notice\">
|
|
|
<div class=\"weui-cell__bd\">
|
|
|
<p>群公告</p>
|
|
|
</div>
|
|
|
<div class=\"weui-cell__ft\" id=\"room-notice-btn\">{$notice}</div>
|
|
|
- </a>
|
|
|
+ </div>
|
|
|
|
|
|
- <a class=\"weui-cell weui-cell_access\" href=\"javascript:;\" id=\"edit_room_desc\">
|
|
|
+ <div class=\"weui-cell weui-cell_access\" href=\"javascript:;\" id=\"edit_room_desc\">
|
|
|
<div class=\"weui-cell__bd\">
|
|
|
<p>群介绍</p>
|
|
|
</div>
|
|
|
<div class=\"weui-cell__ft\" id=\"room-desc-btn\">{$desc}</div>
|
|
|
- </a>
|
|
|
-
|
|
|
- <a class=\"weui-cell weui-cell_access\" href=\"/mobile/index.php?act=member_talk&op=room_apply&talk_id={$this->room_id}\">
|
|
|
+ </div>
|
|
|
+ ";
|
|
|
+
|
|
|
+ if ($cnt > 0)
|
|
|
+ {
|
|
|
+ $html.="
|
|
|
+ <div class=\"weui-cell weui-cell_access\" href=\"/mobile/index.php?act=member_talk&op=room_apply&talk_id={$this->room_id}\">
|
|
|
<div class=\"weui-cell__bd\">
|
|
|
<p>入群申请</p>
|
|
|
- </div>";
|
|
|
- if($cnt > 0) {
|
|
|
- $html.="<div class=\"weui-cell__ft\" id=\"room-apply-btn\" style=\"color: #FF4E4E\">{$apply}</div>
|
|
|
- </a>
|
|
|
- </div>";
|
|
|
- }else {
|
|
|
- $html.="<div class=\"weui-cell__ft\" id=\"room-apply-btn\">{$apply}</div>
|
|
|
- </a>
|
|
|
- </div>";
|
|
|
- }
|
|
|
+ </div>
|
|
|
+ <div class=\"weui-cell__ft\" id=\"room-apply-btn\" style=\"color: #FF4E4E\">{$apply}</div>
|
|
|
+ </div>";
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ $html.="
|
|
|
+ <div class=\"weui-cell weui-cell_access\" href=\"/mobile/index.php?act=member_talk&op=room_apply&talk_id={$this->room_id}\">
|
|
|
+ <div class=\"weui-cell__bd\">
|
|
|
+ <p>入群申请</p>
|
|
|
+ </div>
|
|
|
+ <div class=\"weui-cell__ft\" >{$apply}</div>
|
|
|
+ </div>";
|
|
|
+ }
|
|
|
+ $html .="</div>";
|
|
|
+ }else{
|
|
|
+ $html = "";
|
|
|
}
|
|
|
|
|
|
- echo $html;
|
|
|
+ return $html;
|
|
|
}
|
|
|
|
|
|
public function show_personal_settings()
|
|
@@ -260,23 +328,23 @@ class tpl_group_home
|
|
|
if (!empty($this->participants) && isset($this->participants[$this->cur_user])) {
|
|
|
$html .= "
|
|
|
<div class=\"weui-cells\">
|
|
|
- <a class=\"weui-cell weui-cell_access\" href=\"javascript:;\" id='edit_nickname'>
|
|
|
+ <div class=\"weui-cell weui-cell_access\" href=\"javascript:;\" id='edit_nickname'>
|
|
|
<div class=\"weui-cell__bd\">
|
|
|
<p>我在本群的昵称</p>
|
|
|
</div>
|
|
|
<div class=\"weui-cell__ft group-nickname\">{$this->participants[$this->cur_user]['nickname']}</div>
|
|
|
- </a>
|
|
|
+ </div>
|
|
|
</div>";
|
|
|
}
|
|
|
|
|
|
if ($this->isManager($this->cur_user)) {
|
|
|
$html .= "
|
|
|
<div class=\"weui-cells\">
|
|
|
- <a class=\"weui-cell weui-cell_access\" href=\"javascript:;\" id='change_owner' >
|
|
|
+ <div class=\"weui-cell weui-cell_access\" href=\"javascript:;\" id='change_owner' >
|
|
|
<div class=\"weui-cell__bd\">
|
|
|
<p>转让管理员</p>
|
|
|
</div>
|
|
|
- </a>
|
|
|
+ </div>
|
|
|
</div>";
|
|
|
}
|
|
|
|