No Description
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_wechat.htm 11KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238
  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. <!-- 操作说明 -->
  19. <div id="explanation" class="explanation" style="color: rgb(44, 188, 163); background-color: rgb(237, 251, 248); margin-bottom: 15px;">
  20. <div id="checkZoom" class="title"><i class="fa fa-lightbulb-o"></i>
  21. <h4 title="提示相关设置操作时应注意的要点">提示</h4>
  22. <span title="收起提示" id="explanationZoom" style="display: block;"></span>
  23. </div>
  24. <ul>
  25. <li>1,微信公众号:登录 <a href="https://mp.weixin.qq.com" target="_blank">微信公众号平台</a>,在“设置与开发->基本配置”里获取AppID、AppSecret的值,设置IP白名单等。配置可通用于消息通知等。<span style="color: red;">(注:必须是已认证的服务号)</span></li>
  26. <!-- <li>2,微站点:微信号、二维码是在微站点开启 <span style="color: red;">强制微信模式</span> 时在PC和移动端展示</li> -->
  27. </ul>
  28. </div>
  29. <div class="flexigrid htitx">
  30. <form class="form-horizontal" id="wechat_post_form" action="{:url('UsersNotice/conf_wechat')}" method="post">
  31. <div class="ncap-form-default" style="position: sticky;">
  32. {notempty name='$ipTips'}
  33. <dl class="row">
  34. <dt class="tit">
  35. <label for="url" style="color: red;">注意事项</label>
  36. </dt>
  37. <dd class="opt">
  38. {$ipTips}
  39. <span class="err"></span>
  40. <p class=""></p>
  41. </dd>
  42. </dl>
  43. {/notempty}
  44. {notempty name='$data.apiurl'}
  45. <!-- <dl class="row">
  46. <dt class="tit">
  47. <label for="url">服务器地址(URL)</label>
  48. </dt>
  49. <dd class="opt">
  50. {$data.apiurl}
  51. <a href="javascript:void(0);" onclick="showtext('apiurl');" class="ncap-btn ncap-btn-green apiurl" data-clipboard-text="{$data.apiurl}">复制URL</a>
  52. <span class="err"></span>
  53. <p class="">请登录微信公众平台-【开发】-【基本配置】 - 写入服务器地址(URL)</p>
  54. </dd>
  55. </dl> -->
  56. {/notempty}
  57. <dl class="row">
  58. <dt class="tit">
  59. <label for="appid"><em id="em_appid" {empty name='$data.appid'}style="display: none;"{/empty}>*</em>AppID</label>
  60. </dt>
  61. <dd class="opt">
  62. <input type="text" name="appid" id="appid" value="{$data.appid|default=''}" class="input-txt" autocomplete="off">
  63. <p class="notic">开发者ID</p>
  64. </dd>
  65. </dl>
  66. <dl class="row">
  67. <dt class="tit">
  68. <label for="appsecret"><em id="em_appsecret" {empty name='$data.appsecret'}style="display: none;"{/empty}>*</em>AppSecret</label>
  69. </dt>
  70. <dd class="opt">
  71. <input type="text" name="appsecret" id="appsecret" value="{$data.appsecret|default=''}" class="input-txt" autocomplete="off">
  72. <p class="notic">开发者密码</p>
  73. </dd>
  74. </dl>
  75. <dl class="row none">
  76. <dt class="tit">
  77. <label for="url"><em id="em_token">*</em>令牌(Token)</label>
  78. </dt>
  79. <dd class="opt">
  80. <input type="text" name="token" placeholder="" value="{$data.token}" id="token" class="input-txt">
  81. <span class="err"></span>
  82. <p class="notic">公众号平台的Token要与这里的Token保持一致,请登录微信公众平台-【开发】-【基本配置】查看</p>
  83. </dd>
  84. </dl>
  85. <dl class="row" {empty name='$data.appid'}style="display: none;"{/empty}>
  86. <dt class="tit">
  87. <label for="title">认证情况</label>
  88. </dt>
  89. <dd class="opt">
  90. {if condition="isset($data['type']) && $data['type'] == 2"}
  91. <font color="green">已认证</font>(必须是服务号)
  92. {else /}
  93. <font color="red">未认证</font>(必须是已认证的服务号)
  94. {/if}
  95. <input type="hidden" name="type" value="{$data.type|default=1}">
  96. <span class="err"></span>
  97. <p class="notic"></p>
  98. </dd>
  99. </dl>
  100. <dl class="row">
  101. <div class="bot" style="padding-bottom:0px;">
  102. <a href="JavaScript:void(0);" onclick="checkForm();" class="ncap-btn-big ncap-btn-green" id="submitBtn">确认提交</a>
  103. &nbsp;<a href="JavaScript:void(0);" onclick="click_to_eyou_1575506523('https://www.eyoucms.com/plus/view.php?aid=10166&origin_eycms=1','微信公众号配置')" style="font-size: 12px;padding-left: 10px;position:absolute;top: 30px">不会配置?</a>
  104. </div>
  105. </dl>
  106. </div>
  107. <div class="" style="position: absolute;top: 0px;left: 750px;">
  108. <dl class="row {empty name='$wechat_qrcodeurl'}none{/empty}" id="dl_wechat_qrcode" style="background: #fff;">
  109. <dd class="opt">
  110. <span id="wechat_span_qrcode"></span>
  111. <div class="ercodepic">
  112. <img id="wechat_img_qrcode" src="__STATIC__/common/images/loading.gif" width="23" height="23" />
  113. </div>
  114. <p class="notic"></p>
  115. </dd>
  116. <dt class="tit" style="text-align: center;line-height: 32px;font-size: 15px;">
  117. <label for="baidu_qrcode">扫码订阅消息推送</label>
  118. </dt>
  119. </dl>
  120. </div>
  121. </form>
  122. </div>
  123. </div>
  124. <script type="text/javascript">
  125. $(function(){
  126. $('#appid, #appsecret').keyup(function(){
  127. var appid = $.trim($('#appid').val());
  128. var appsecret = $.trim($('#appsecret').val());
  129. if (appid != '' || appsecret != '') {
  130. $('#em_appid').show();
  131. $('#em_appsecret').show();
  132. } else {
  133. $('#em_appid').hide();
  134. $('#em_appsecret').hide();
  135. }
  136. });
  137. function ajax_get_wechat_qrcode()
  138. {
  139. var appid = $.trim($('#appid').val());
  140. var appsecret = $.trim($('#appsecret').val());
  141. if (appid != '' && appsecret != '') {
  142. $('#dl_wechat_qrcode').show();
  143. var wechat_qrcodeurl = "{$wechat_qrcodeurl}";
  144. if (wechat_qrcodeurl != '') {
  145. $('#wechat_img_qrcode').attr('src', wechat_qrcodeurl);
  146. setTimeout(function(){
  147. $('#wechat_img_qrcode').attr('width', 122).attr('height', 122);
  148. },100);
  149. }
  150. }
  151. $.ajax({
  152. url: "{:url('UsersNotice/ajax_get_wechat_qrcode', ['_ajax'=>1])}",
  153. type: 'GET',
  154. dataType: 'JSON',
  155. data: {},
  156. success: function (res) {
  157. if (1 == res.code) {
  158. $('#wechat_span_qrcode').hide();
  159. $('#wechat_img_qrcode').attr('src', '');
  160. $('#wechat_img_qrcode').attr('src', res.data.qrcodeurl).attr('width', 122).attr('height', 122).show();
  161. } else {
  162. $('#wechat_span_qrcode').html(res.msg);
  163. $('#wechat_img_qrcode').hide();
  164. return false;
  165. }
  166. },
  167. error: function (e) {
  168. $('#wechat_span_qrcode').html(e.responseText);
  169. $('#wechat_img_qrcode').hide();
  170. return false;
  171. }
  172. });
  173. }
  174. ajax_get_wechat_qrcode();
  175. });
  176. // 判断输入框是否为空
  177. function checkForm(){
  178. var appid = $.trim($('#appid').val());
  179. var appsecret = $.trim($('#appsecret').val());
  180. if (appid != '' || appsecret != '') {
  181. if(appid == ''){
  182. showErrorMsg('AppID不能为空!');
  183. $('input[name=appid]').focus();
  184. return false;
  185. }
  186. if(appsecret == ''){
  187. showErrorMsg('AppSecret不能为空!');
  188. $('input[name=appsecret]').focus();
  189. return false;
  190. }
  191. }
  192. layer_loading('正在处理');
  193. $.ajax({
  194. url: "{:url('UsersNotice/conf_wechat', ['_ajax'=>1])}",
  195. type: 'POST',
  196. dataType: 'JSON',
  197. data: $('#wechat_post_form').serialize(),
  198. success: function (res) {
  199. layer.closeAll();
  200. if (1 == res.code) {
  201. layer.msg(res.msg, {shade: layer_shade, time: 1000}, function(){
  202. window.location.reload();
  203. });
  204. } else {
  205. showErrorAlert(res.msg);
  206. return false;
  207. }
  208. },
  209. error: function (e) {
  210. layer.closeAll();
  211. showErrorAlert(e.responseText);
  212. return false;
  213. }
  214. });
  215. }
  216. // 加载图片显示
  217. function wechat_pic_call_back(fileurl_tmp) {
  218. $("#wechat_pic").val(fileurl_tmp);
  219. $("#img_a_wechat_pic").attr('href', fileurl_tmp);
  220. $("#img_i_wechat_pic").attr('onmouseover', "layer_tips=layer.tips('<img src="+fileurl_tmp+" width=300 height=300>',this,{tips: [1, '#fff']});");
  221. }
  222. </script>
  223. <script type="text/javascript" src="__SKIN__/js/clipboard.min.js"></script>
  224. <script type="text/javascript">
  225. function showtext(classname){
  226. var clipboard1 = new Clipboard("."+classname);clipboard1.on("success", function(e) {layer.msg("复制成功");});clipboard1.on("error", function(e) {layer.msg("复制失败!请手动复制", {icon:2});});
  227. }
  228. </script>
  229. {include file="public/footer" /}