huangdong 6 years atrás
parent
commit
b720e98a43
2 changed files with 53 additions and 8 deletions
  1. 39 1
      data/resource/mobile/talk/js/room_apply.js
  2. 14 7
      mobile/control/member_talk.php

+ 39 - 1
data/resource/mobile/talk/js/room_apply.js

@@ -144,11 +144,49 @@ $(function () {
     $(document).on('click','.refusal_btn',function(){
         var apply_id = $(this).attr('data-apply-id');
         console.log(apply_id);
+        $.showLoading();
+        var _self = $(this);
+        $.get("/mobile/index.php", {
+            act: "member_talk",
+            op: "pass_apply",
+            apply_id: apply_id,
+            step:2,
+            client_type: "ajax",
+        }, function (res) {
+            $.hideLoading();
+            var data = JSON.parse(res);
+            if (data.code != 200) {
+                $.alert(data.message);
+                return;
+            }
+
+            _self.parent().parent().append("<div class=\"weui-cell__ft\"><span class=\"state\">已拒绝</span></div>");
+            _self.parent().remove();
+            $.toast('操作成功',1000);
+        })
     });
 
     $(document).on('click','.agree_btn',function(){
         var apply_id = $(this).attr('data-apply-id');
         console.log(apply_id);
+        $.showLoading();
+        var _self = $(this);
+        $.get("/mobile/index.php", {
+            act: "member_talk",
+            op: "pass_apply",
+            apply_id: apply_id,
+            step:1,
+            client_type: "ajax",
+        }, function (res) {
+            $.hideLoading();
+            var data = JSON.parse(res);
+            if (data.code != 200) {
+                $.alert(data.message);
+                return;
+            }
+            _self.parent().parent().append("<div class=\"weui-cell__ft\"><span class=\"state\">已接受</span></div>");
+            _self.parent().remove();
+            $.toast('操作成功',1000);
+        })
     });
-
 });

+ 14 - 7
mobile/control/member_talk.php

@@ -687,21 +687,28 @@ class member_talkControl extends mbMemberControl
 
     public function change_passwdOp(){
         $room_id = intval($_GET['room_id']);
+        $use_pass = intval($_GET['use_pass']);
         if($room_id <= 0) {
             return self::outerr(errcode::ErrParamter);
         }
 
-        $passwd = strtolower(trim($_GET['passwd']));
+        if($use_pass)
+        {
+            $passwd = strtolower(trim($_GET['passwd']));
 
-        if (!preg_match("/^[a-z0-9]+$/u", $passwd)) {
-            return self::outerr(errcode::ErrParamter,"密码只能包含英文字母或数字,不区分大小写");
-        }
+            $len = strlen($passwd);
+            if($len <=0 || $len >8) {
+                return self::outerr(errcode::ErrParamter,"密码不能为空或超过8个字符");
+            }
 
-        $len = strlen($passwd);
-        if($len <=0 || $len >8) {
-            return self::outerr(errcode::ErrParamter,"密码不能为空或超过8个字符");
+            if (!preg_match("/^[a-z0-9]+$/u", $passwd)) {
+                return self::outerr(errcode::ErrParamter,"密码只能包含英文字母或数字,不区分大小写");
+            }
+        }else{
+            $passwd = "";
         }
 
+
         $mod_room = Model('room');
         $item = $mod_room->getRoom($room_id);
         if(empty($item)) {