설명 없음
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

conf_sms.htm 10KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226
  1. {include file="public/layout" /}
  2. <body class="eyou_body_xin">
  3. <div id="toolTipLayer" style="position: absolute; z-index: 9999; display: none; visibility: visible; left: 95px; top: 573px;"></div>
  4. <div id="append_parent"></div>
  5. <div id="ajaxwaitid"></div>
  6. {include file="notice/left" /}
  7. <div id="geduan_div" class="h10"></div>
  8. <div class="page" style="min-width:auto;margin-left:115px;padding-bottom: 15px;">
  9. <div class="fixed-bar">
  10. <div class="item-title">
  11. <a class="back_xin" href="{:url('Weapp/index')}" title="返回"><i class="iconfont e-fanhui"></i></a>
  12. <div class="subject">
  13. <h3>短信配置</h3>
  14. <h5></h5>
  15. </div>
  16. </div>
  17. </div>
  18. <form class="form-horizontal" id="postSmsForm" method="post">
  19. <div class="ncap-form-default flexigrid htitx">
  20. <dl class="row">
  21. <dt class="tit">
  22. <label for="sms_type">短信平台</label>
  23. </dt>
  24. <dd class="opt">
  25. <label class="curpoin"><input type="radio" name="sms_type" value="1" onclick="changeSmsType(this);" {if condition="empty($sms.sms_type) || $sms.sms_type eq 1"}checked="checked"{/if}>阿里云短信</label>
  26. &nbsp;&nbsp;
  27. <label class="curpoin"><input type="radio" name="sms_type" value="2" onclick="changeSmsType(this);" {if condition="isset($sms.sms_type) && $sms.sms_type eq 2"}checked="checked"{/if}>腾讯云短信</label>
  28. <input type="hidden" id="old_sms_type" value="{if condition="empty($sms.sms_type) || $sms.sms_type eq 1"}1{else /}2{/if}">
  29. <p class="notic"></p>
  30. </dd>
  31. </dl>
  32. <dl class="row" id="sms_appkey_1" style="display: {if condition="!isset($sms.sms_type) || $sms.sms_type eq 1"} block{else /}none{/if};" >
  33. <dt class="tit">
  34. <em>*</em>
  35. <label for="sms_appkey">平台appkey</label>
  36. </dt>
  37. <dd class="opt">
  38. <input id="sms_appkey" name="sms_appkey" value="{$sms.sms_appkey|default=''}" class="input-txt" type="text" autocomplete="off" />
  39. <p class="notic"></p>
  40. </dd>
  41. </dl>
  42. <dl class="row" id="sms_secretkey_1" style="display: {if condition="!isset($sms.sms_type) || $sms.sms_type eq 1"} block{else /}none{/if};">
  43. <dt class="tit">
  44. <em>*</em>
  45. <label for="sms_secretkey">平台secretKey</label>
  46. </dt>
  47. <dd class="opt">
  48. <input id="sms_secretkey" name="sms_secretkey" value="{$sms.sms_secretkey|default=''}" class="input-txt" type="text" autocomplete="off" />
  49. <p class="notic"></p>
  50. </dd>
  51. </dl>
  52. <dl class="row" id="sms_secretkey_2" style="display: {if condition="!isset($sms.sms_type) || $sms.sms_type eq 2"} block{else /}none{/if};">
  53. <dt class="tit">
  54. <em>*</em>
  55. <label for="sms_appid_tx">平台appid</label>
  56. </dt>
  57. <dd class="opt">
  58. <input id="sms_appid_tx" name="sms_appid_tx" value="{$sms.sms_appid_tx|default=''}" class="input-txt" type="text" autocomplete="off" />
  59. <p class="notic"></p>
  60. </dd>
  61. </dl>
  62. <dl class="row" id="sms_appkey_2" style="display: {if condition="!isset($sms.sms_type) || $sms.sms_type eq 2"} block{else /}none{/if};">
  63. <dt class="tit">
  64. <em>*</em>
  65. <label for="sms_appkey_tx">平台appkey</label>
  66. </dt>
  67. <dd class="opt">
  68. <input id="sms_appkey_tx" name="sms_appkey_tx" value="{$sms.sms_appkey_tx|default=''}" class="input-txt" type="text" autocomplete="off" />
  69. <p class="notic"></p>
  70. </dd>
  71. </dl>
  72. <dl class="row">
  73. <dt class="tit"><em>*</em>管理员手机号</dt>
  74. <dd class="opt">
  75. <input value="{$sms.sms_test_mobile|default=''}" name="sms_test_mobile" id="sms_test_mobile" placeholder="多个手机号码可以用逗号隔开" class="input-txt" type="text" onkeyup="this.value=this.value.replace(/,/g,',');" onpaste="this.value=this.value.replace(/,/g,',')" autocomplete="off">
  76. <input value="测试发送" class="input-btn" onclick="sendMobile();" type="button">
  77. <p class="notic">多个手机号码可以用逗号隔开</p>
  78. </dd>
  79. </dl>
  80. <dl class="row">
  81. <div class="bot" style="padding-bottom:0px;">
  82. <a href="JavaScript:void(0);" onclick="submit_sms();" class="ncap-btn-big ncap-btn-green">确认提交</a>
  83. &nbsp;
  84. <a href="JavaScript:void(0);" onclick="openArticle()" style="font-size: 12px;padding-left: 10px;position:absolute;top: 30px">不会配置?</a>
  85. </div>
  86. </dl>
  87. </div>
  88. </form>
  89. </div>
  90. <script type="text/javascript">
  91. var parentObj = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
  92. function submit_sms(){
  93. var sms_type = $("#old_sms_type").val();
  94. if (sms_type == 1) {
  95. if ($('#postSmsForm input[name="sms_appkey"]').val() == '') {
  96. showErrorMsg('请填写短信平台[appkey]');
  97. $('#postSmsForm input[name=sms_appkey]').focus();
  98. return false;
  99. }
  100. if ($('#postSmsForm input[name="sms_secretkey"]').val() == '') {
  101. showErrorMsg('请填写短信平台[secretKey]');
  102. $('#postSmsForm input[name=sms_secretkey]').focus();
  103. return false;
  104. }
  105. }else{
  106. if ($('#postSmsForm input[name="sms_appkey_tx"]').val() == '') {
  107. showErrorMsg('请填写短信平台[appkey]');
  108. $('#postSmsForm input[name=sms_appkey_tx]').focus();
  109. return false;
  110. }
  111. if ($('#postSmsForm input[name="sms_appid_tx"]').val() == '') {
  112. showErrorMsg('请填写短信平台[appid]');
  113. $('#postSmsForm input[name=sms_appid_tx]').focus();
  114. return false;
  115. }
  116. }
  117. var mobile = $('#sms_test_mobile').val();
  118. if (mobile == '') {
  119. showErrorMsg('接收的手机号码不能为空!');
  120. $('#postSmsForm input[name=sms_test_mobile]').focus();
  121. return false;
  122. }
  123. layer_loading("正在处理");
  124. $.ajax({
  125. url: "{:url('UsersNotice/conf_sms', ['_ajax'=>1])}",
  126. type: 'POST',
  127. dataType: 'JSON',
  128. data: $('#postSmsForm').serialize(),
  129. success: function(res){
  130. layer.closeAll();
  131. if (1 == res.code) {
  132. layer.msg(res.msg, {shade: 0.1, time: 1000}, function(){
  133. window.location.reload();
  134. });
  135. } else {
  136. var icon = 5;
  137. try{
  138. if (res.data.icon) {
  139. icon = res.data.icon;
  140. }
  141. }catch(e){}
  142. showErrorAlert(res.msg, icon);
  143. }
  144. },
  145. error: function(e){
  146. layer.closeAll();
  147. showErrorAlert(e.responseText);
  148. }
  149. });
  150. }
  151. function sendMobile() {
  152. var sms_type = $("#old_sms_type").val();
  153. if (sms_type == 1) {
  154. if ($('#postSmsForm input[name="sms_appkey"]').val() == '') {
  155. showErrorMsg('请填写短信平台[appkey]!');
  156. $('#postSmsForm input[name=sms_appkey]').focus();
  157. return false;
  158. }
  159. if ($('#postSmsForm input[name="sms_secretkey"]').val() == '') {
  160. showErrorMsg('请填写短信平台[secretKey]!');
  161. $('#postSmsForm input[name=sms_secretkey]').focus();
  162. return false;
  163. }
  164. }else{
  165. if ($('#postSmsForm input[name="sms_appkey_tx"]').val() == '') {
  166. showErrorMsg('请填写短信平台[appkey]!');
  167. $('#postSmsForm input[name=sms_appkey_tx]').focus();
  168. return false;
  169. }
  170. if ($('#postSmsForm input[name="sms_appid_tx"]').val() == '') {
  171. showErrorMsg('请填写短信平台[appid]!');
  172. $('#postSmsForm input[name=sms_appid_tx]').focus();
  173. return false;
  174. }
  175. }
  176. var mobile = $('#sms_test_mobile').val();
  177. if (mobile == '') {
  178. showErrorMsg('接收的手机号码不能为空!');
  179. $('#postSmsForm input[name=sms_test_mobile]').focus();
  180. return false;
  181. }
  182. var loading = layer_loading('发送中');
  183. $.ajax({
  184. type: "post",
  185. data: $('#postSmsForm').serialize(),
  186. dataType: 'json',
  187. url: "{:url('UsersNotice/send_mobile')}",
  188. success: function (res) {
  189. layer.closeAll();
  190. if (res.code == 1) {
  191. layer.msg('发送成功', {icon: 1, time:1000});
  192. } else {
  193. showErrorAlert(res.msg);
  194. }
  195. },
  196. error: function(e){
  197. layer.closeAll();
  198. showErrorAlert(e.responseText);
  199. }
  200. })
  201. }
  202. function changeSmsType(obj) {
  203. var new_sms_type = $("input[name=sms_type]:checked").val();
  204. var old_sms_type = $("#old_sms_type").val();
  205. if (new_sms_type) {
  206. $("#sms_appkey_"+old_sms_type).hide();
  207. $("#sms_secretkey_"+old_sms_type).hide();
  208. $("#sms_appkey_"+new_sms_type).show();
  209. $("#sms_secretkey_"+new_sms_type).show();
  210. $("#old_sms_type").val(new_sms_type);
  211. }
  212. }
  213. function openArticle() {
  214. var new_sms_type = $("input[name=sms_type]:checked").val();
  215. var aid = new_sms_type == 1?8754:11143;
  216. click_to_eyou_1575506523('https://www.eyoucms.com/plus/view.php?aid='+aid+'&origin_eycms=1','短信配置教程');
  217. }
  218. </script>
  219. {include file="public/footer" /}