123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221 |
- <!doctype html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0">
- <title>好友申请</title>
- <link type="text/css" rel="stylesheet"
- href="<?php echo RESOURCE_SITE_URL; ?>/mobile/talk/css/weui.css?<?php echo bonus_version(); ?>"/>
- <link rel="stylesheet"
- href="https://cdn.bootcss.com/jquery-weui/1.2.0/css/jquery-weui.min.css?<?php echo bonus_version(); ?>">
- <link type="text/css" rel="stylesheet"
- href="<?php echo RESOURCE_SITE_URL; ?>/mobile/talk/css/homepage.css?<?php echo bonus_version(); ?>"/>
- <style type="text/css">
- .join_item_btn {
- margin-top: 62px;
- background: transparent;
- }
- </style>
- </head>
- <body>
- <div id = "page1" class="show-page">
- <div class="weui-cells__title">申请信息</div>
- <div class="weui-cells weui-cells_form">
- <div class="weui-cell">
- <div class="weui-cell__bd">
- <textarea class="weui-textarea" placeholder="我是..." rows="3" id="add-group-msg"></textarea>
- <div class="weui-textarea-counter"><span>0</span>/30</div>
- </div>
- </div>
- </div>
- <div class="weui-cells__tips">加群成功后,个人介绍将展示群友。</div>
- <div class="join_item_btn">
- <div class="quit" id="add-group-btn">
- <a href="javascript:void(0);" class="weui-btn weui-btn_primary">发送</a>
- </div>
- </div>
- </div>
- <div id = "page2" class="show-page">
- <div class="weui-cells__title">申请信息</div>
- <div class="weui-cells weui-cells_form">
- <div class="weui-cell">
- <div class="weui-cell__bd">
- <textarea class="weui-textarea" placeholder="我是..." rows="3" id="add-friends-msg"></textarea>
- <div class="weui-textarea-counter"><span>0</span>/30</div>
- </div>
- </div>
- </div>
- <div class="weui-cells__tips">你需要发送验证申请,等待对方通过</div>
- <div class="join_item_btn">
- <div class="quit" id="add-friends-btn">
- <a href="javascript:void(0);" class="weui-btn weui-btn_primary">发送</a>
- </div>
- </div>
- </div>
- <div id = "page3" class="show-page">
- <div class="weui-cells__title">群公告</div>
- <div class="weui-cells weui-cells_form">
- <div class="weui-cell">
- <div class="weui-cell__bd">
- <?php if($output['ajax_param']['isManager'] > 0) { ?>
- <textarea class="weui-textarea" placeholder="请编辑群公告" rows="12" id="edit-notice-msg"></textarea>
- <div class="weui-textarea-counter"><span>0</span>/250</div>
- <?php } else {
- echo "<div style='min-height:250px'>".$output['ajax_param']['notice']."</div>";
- } ?>
- </div>
- </div>
- </div>
- <div class="weui-cells__tips"></div>
- <?php if($output['ajax_param']['isManager'] > 0) { ?>
- <div class="join_item_btn">
- <div class="quit" id="edit-notice-btn">
- <a href="javascript:void(0);" class="weui-btn weui-btn_primary">确认</a>
- </div>
- </div>
- <?php } ?>
- </div>
- <script src="https://cdn.bootcss.com/jquery/1.11.0/jquery.min.js?<?php echo bonus_version(); ?>"></script>
- <script src="https://cdn.bootcss.com/jquery-weui/1.2.0/js/jquery-weui.min.js?<?php echo bonus_version(); ?>"></script>
- <script type="text/javascript">
- $(function () {
- var _type = parseInt(<?php echo $output['ajax_param']['type'] ?>);
- var letter_max = 0;
- var show_page = function (_type) {
- $(".show-page").hide();
- switch (_type) {
- case 1:$("#page1").show();letter_max=30;break;
- case 2:$("#page2").show();letter_max=30;break;
- case 3:$("#page3").show();letter_max=250;break;
- default:
- }
- }
- show_page(_type);
- $("#add-group-btn").click(function () {
- var _href = "/mobile/index.php?act=member_talk&op=send_apply";
- var input = $("#add-group-msg").val();
- var talk_id = "<?php echo $output['ajax_param']['talk_id'] ?>";
- if (input && input.trim().length <= 30) {
- $.showLoading();
- $.get(_href, {
- apply:1,
- msg :input,
- room_id: talk_id,
- client_type: 'ajax'
- }, function (res) {
- $.hideLoading();
- var result = JSON.parse(res);
- console.log(result);
- if (result.code != 200) {
- $.alert(result.message);
- return;
- }
- $.toast('发送成功',500);
- setTimeout(function () {
- window.history.back();
- },1000)
- });
- }
- else {
- $.alert('入群申请最长不得超过30个字符');
- }
- });
- $("#add-friends-btn").click(function () {
- var _href = "/mobile/index.php?act=member_talk&op=add_friends";
- var input = $("#add-friends-msg").val();
- var talk_id = "<?php echo $output['ajax_param']['talk_id'] ?>";
- if (input && input.trim().length <= 30) {
- $.showLoading();
- $.get(_href, {
- msg :input,
- user: talk_id,
- client_type: 'ajax'
- }, function (res) {
- $.hideLoading();
- var result = JSON.parse(res);
- console.log(result);
- if (result.code != 200) {
- $.alert(result.message);
- return;
- }
- $.toast('发送成功',500);
- setTimeout(function () {
- window.history.back();
- },1000)
- });
- }
- else {
- $.alert('自我介绍最长不得超过30个字符');
- }
- });
-
- $("#edit-notice-btn").click(function () {
- var _href = "/mobile/index.php?act=member_talk&op=change_room_notice";
- var input = $("#edit-notice-msg").val();
- var talk_id = "<?php echo $output['ajax_param']['talk_id'] ?>";
- if (input && input.trim().length <= 250) {
- $.showLoading();
- $.get(_href,
- {
- room_notice: input,
- room_id: talk_id,
- client_type: 'ajax'
- }, function (res) {
- $.hideLoading();
- var result = JSON.parse(res);
- if (result.code != 200) {
- $.alert(result.message);
- return;
- }
- $.toast('修改成功',500);
- setTimeout(function () {
- window.history.back();
- },1000)
- });
- }
- else {
- $.alert('群公告不得超过250个字符');
- }
- });
- $("textarea").on('input',function () {
- var input = $(this).val();
- var _length = input.trim().length;
- $(this).siblings("div").find('span').text(_length);
- if(_length >= letter_max){
- var input = input.substr(0,letter_max-1);
- $(this).val(input);
- $(this).siblings("div").find('span').text(letter_max);
- $(this).siblings("div").find('span').css("color","red");
- }
- })
- $("textarea").on('change',function () {
- var input = $(this).val();
- var _length = input.trim().length;
- $(this).siblings("div").find('span').text(_length);
- if(_length >= letter_max){
- var input = input.substr(0,letter_max-1);
- $(this).val(input);
- $(this).siblings("div").find('span').text(letter_max);
- $(this).siblings("div").find('span').css("color","red");
- }
- })
- })
- </script>
- </body>
- </html>
|