Ingen beskrivning
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 19KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376
  1. {include file="public/layout" /}
  2. <body class="bodystyle" style="overflow-y: scroll;min-width:auto;">
  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. <div class="page min-hg-c-i" style="min-width: auto;box-shadow:none;">
  7. {include file="canal/bar" /}
  8. <!-- 操作说明 -->
  9. <div id="explanation" class="explanation" style="color: rgb(44, 188, 163); background-color: rgb(237, 251, 248); margin-bottom: 15px;">
  10. <div id="checkZoom" class="title"><i class="fa fa-lightbulb-o"></i>
  11. <h4 title="提示相关设置操作时应注意的要点">提示</h4>
  12. <span title="收起提示" id="explanationZoom" style="display: block;"></span>
  13. </div>
  14. <ul>
  15. <li>1,微信公众号:登录 <a href="https://mp.weixin.qq.com" target="_blank">微信公众号平台</a>,在“设置与开发->基本配置”里获取AppID、AppSecret的值,设置IP白名单等。配置可通用于微站点、或云插件库里的微信公众号插件。<span style="color: red;">(注:订阅号不支持登录与支付)</span></li>
  16. <li>2,微站点:微信号、二维码是在微站点开启 <span style="color: red;">强制微信模式</span> 时在PC和移动端展示</li>
  17. </ul>
  18. </div>
  19. <div class="flexigrid htitx">
  20. <form class="form-horizontal" id="post_form" action="{:url('Canal/conf_wechat')}" method="post">
  21. <div class="hDiv">
  22. <div class="hDivBox">
  23. <table cellspacing="0" cellpadding="0" style="width: 100%">
  24. <thead>
  25. <tr>
  26. <th class="sign w10" axis="col0">
  27. <div class="tc"></div>
  28. </th>
  29. <th abbr="article_title" axis="col3" class="w10">
  30. <div class="tc">微信公众号</div>
  31. </th>
  32. <th abbr="ac_id" axis="col4">
  33. <div class=""></div>
  34. </th>
  35. </tr>
  36. </thead>
  37. </table>
  38. </div>
  39. </div>
  40. <div class="ncap-form-default">
  41. <dl class="row">
  42. <dt class="tit">
  43. <label for="appid"><em id="em_appid" {empty name='$data.appid'}style="display: none;"{/empty}>*</em>AppID</label>
  44. </dt>
  45. <dd class="opt">
  46. <input type="text" name="appid" id="appid" value="{$data.appid|default=''}" class="input-txt" autocomplete="off">
  47. <p class="notic">开发者ID</p>
  48. </dd>
  49. </dl>
  50. <dl class="row">
  51. <dt class="tit">
  52. <label for="appsecret"><em id="em_appsecret" {empty name='$data.appsecret'}style="display: none;"{/empty}>*</em>AppSecret</label>
  53. </dt>
  54. <dd class="opt">
  55. <input type="text" name="appsecret" id="appsecret" value="{$data.appsecret|default=''}" class="input-txt" autocomplete="off">
  56. <p class="notic">开发者密码</p>
  57. </dd>
  58. </dl>
  59. {notempty name='$ipTips'}
  60. <dl class="row">
  61. <dt class="tit">
  62. <label for="url">注意事项</label>
  63. </dt>
  64. <dd class="opt">
  65. {$ipTips}
  66. <span class="err"></span>
  67. <p class=""></p>
  68. </dd>
  69. </dl>
  70. {/notempty}
  71. <!-- <dl class="row">
  72. <dt class="tit">
  73. <label for="wechat_name">微信号</label>
  74. </dt>
  75. <dd class="opt">
  76. <input type="text" name="wechat_name" id="wechat_name" value="{$data.wechat_name|default=''}" class="input-txt" autocomplete="off">
  77. <p class="notic"></p>
  78. </dd>
  79. </dl>
  80. <dl class="row">
  81. <dt class="tit">
  82. <label for="wechat_pic">二维码</label>
  83. </dt>
  84. <dd class="opt">
  85. <div class="input-file-show">
  86. <span class="show">
  87. <a id="img_a_wechat_pic" class="nyroModal" rel="gal" href="{$data.wechat_pic|default='javascript:void(0);'}?t={php}echo time();{/php}" target="_blank">
  88. <i id="img_i_wechat_pic" class="fa fa-picture-o" {notempty name="$data.wechat_pic"}onmouseover="layer_tips=layer.tips('<img src={$data.wechat_pic|default=''}?t={php}echo time();{/php} width=300 height=300>',this,{tips: [1, '#fff']});"{/notempty} onmouseout="layer.close(layer_tips);"></i>
  89. </a>
  90. </span>
  91. <span class="type-file-box">
  92. <input type="text" id="wechat_pic" name="wechat_pic" value="{$data.wechat_pic|default=''}" class="type-file-text" autocomplete="off">
  93. <input type="button" name="button" id="button1" value="选择上传..." class="type-file-button">
  94. <input class="type-file-file" onclick="GetUploadify(1, '', 'allimg', 'wechat_pic_call_back')" size="30" hidefocus="true" nc_type="change_site_logo" title="点击前方预览图可查看大图,点击按钮选择文件并提交表单后上传生效">
  95. </span>
  96. </div>
  97. <span class="err"></span>
  98. <p class="notic"></p>
  99. </dd>
  100. </dl> -->
  101. <dl class="row">
  102. <div class="bot" style="padding-bottom:0px;">
  103. <a href="JavaScript:void(0);" onclick="checkForm();" class="ncap-btn-big ncap-btn-green" id="submitBtn">确认提交</a>
  104. &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>
  105. </div>
  106. </dl>
  107. </div>
  108. </form>
  109. </div>
  110. <script type="text/javascript">
  111. $(function(){
  112. $('#appid, #appsecret').keyup(function(){
  113. var appid = $.trim($('#appid').val());
  114. var appsecret = $.trim($('#appsecret').val());
  115. if (appid != '' || appsecret != '') {
  116. $('#em_appid').show();
  117. $('#em_appsecret').show();
  118. } else {
  119. $('#em_appid').hide();
  120. $('#em_appsecret').hide();
  121. }
  122. });
  123. });
  124. // 判断输入框是否为空
  125. function checkForm(){
  126. var appid = $.trim($('#appid').val());
  127. var appsecret = $.trim($('#appsecret').val());
  128. if (appid != '' || appsecret != '') {
  129. if(appid == ''){
  130. showErrorMsg('AppID不能为空!');
  131. $('input[name=appid]').focus();
  132. return false;
  133. }
  134. if(appsecret == ''){
  135. showErrorMsg('AppSecret不能为空!');
  136. $('input[name=appsecret]').focus();
  137. return false;
  138. }
  139. }
  140. layer_loading('正在处理');
  141. $.ajax({
  142. url: "{:url('Canal/conf_wechat', ['_ajax'=>1])}",
  143. type: 'POST',
  144. dataType: 'JSON',
  145. data: $('#post_form').serialize(),
  146. success: function (res) {
  147. layer.closeAll();
  148. if (1 == res.code) {
  149. layer.msg(res.msg, {shade: layer_shade, time: 1000}, function(){
  150. window.location.reload();
  151. });
  152. } else {
  153. showErrorAlert(res.msg);
  154. return false;
  155. }
  156. },
  157. error: function (e) {
  158. layer.closeAll();
  159. showErrorAlert(e.responseText);
  160. return false;
  161. }
  162. });
  163. }
  164. // 加载图片显示
  165. function wechat_pic_call_back(fileurl_tmp) {
  166. $("#wechat_pic").val(fileurl_tmp);
  167. $("#img_a_wechat_pic").attr('href', fileurl_tmp);
  168. $("#img_i_wechat_pic").attr('onmouseover', "layer_tips=layer.tips('<img src="+fileurl_tmp+" width=300 height=300>',this,{tips: [1, '#fff']});");
  169. }
  170. </script>
  171. <div class="flexigrid htitx">
  172. <form class="form-horizontal" id="postMicrosite" method="post">
  173. <div class="hDiv">
  174. <div class="hDivBox">
  175. <table cellspacing="0" cellpadding="0" style="width: 100%">
  176. <thead>
  177. <tr>
  178. <th class="sign w10" axis="col0">
  179. <div class="tc"></div>
  180. </th>
  181. <th abbr="article_title" axis="col3" class="w10">
  182. <div class="tc">微站点</div>
  183. </th>
  184. <th abbr="ac_id" axis="col4">
  185. <div class=""></div>
  186. </th>
  187. </tr>
  188. </thead>
  189. </table>
  190. </div>
  191. </div>
  192. <div class="ncap-form-default" style="position: sticky;">
  193. <dl class="row">
  194. <dt class="tit">
  195. <label>微站点模式</label>
  196. <input type="hidden" id="shop_micro" value="{$usersConfig.shop_micro|default=0}">
  197. </dt>
  198. <dd class="opt" style="line-height: 30px;">
  199. <label>
  200. <input type="radio" name="shop[shop_micro]" id="shop_micro1" value="1" {if condition="isset($usersConfig.shop_micro) && $usersConfig.shop_micro == 1"} checked="checked" {/if} onclick="DetectConfig(1);"/>开启
  201. </label>
  202. &nbsp;&nbsp;&nbsp;
  203. <label>
  204. <input type="radio" name="shop[shop_micro]" id="shop_micro0" value="0" {if condition="empty($usersConfig.shop_micro)"} checked="checked" {/if}/>关闭
  205. </label>
  206. &nbsp;&nbsp;&nbsp;
  207. <p class="notic">开启后,在微信里访问不需要注册或登录,需要先配置下方微信参数</p>
  208. </dd>
  209. </dl>
  210. <dl class="row">
  211. <dt class="tit">
  212. <label>强制微信模式</label>
  213. <input type="hidden" id="shop_force_use_wechat" value="{$usersConfig.shop_force_use_wechat|default=0}">
  214. </dt>
  215. <dd class="opt" style="line-height: 30px;">
  216. <label>
  217. <input type="radio" name="shop[shop_force_use_wechat]" id="shop_force_use_wechat1" value="1" {if condition="isset($usersConfig.shop_force_use_wechat) && $usersConfig.shop_force_use_wechat == 1"} checked="checked" {/if} onclick="DetectConfig(2);"/>开启
  218. </label>
  219. &nbsp;&nbsp;&nbsp;
  220. <label>
  221. <input type="radio" name="shop[shop_force_use_wechat]" id="shop_force_use_wechat0" value="0" {if condition="empty($usersConfig.shop_force_use_wechat)"} checked="checked" {/if} onclick="DetectConfig(3);"/>关闭
  222. </label>
  223. &nbsp;&nbsp;&nbsp;
  224. <p class="notic">开启后,只能在微信内访问,需要先开启微站点模式</p>
  225. </dd>
  226. </dl>
  227. <dl class="row">
  228. <dt class="tit">
  229. <label for="wechat_name">微信号</label>
  230. </dt>
  231. <dd class="opt">
  232. <input type="text" name="login[wechat_name]" id="wechat_name" value="{$login.wechat_name|default=''}" class="input-txt">
  233. <p class="notic"></p>
  234. </dd>
  235. </dl>
  236. <dl class="row">
  237. <dt class="tit">
  238. <label for="wechat_pic">二维码</label>
  239. </dt>
  240. <dd class="opt">
  241. <div class="input-file-show">
  242. <span class="show">
  243. <a id="img_a_wechat_pic" class="nyroModal" rel="gal" href="{$login.wechat_pic|default='javascript:void(0);'}?t={php}echo time();{/php}" target="_blank">
  244. <i id="img_i_wechat_pic" class="fa fa-picture-o" {notempty name="$login.wechat_pic"}onmouseover="layer_tips=layer.tips('<img src={$login.wechat_pic|default=''}?t={php}echo time();{/php} width=300 height=300>',this,{tips: [1, '#fff']});"{/notempty} onmouseout="layer.close(layer_tips);"></i>
  245. </a>
  246. </span>
  247. <span class="type-file-box">
  248. <input type="text" id="wechat_pic" name="login[wechat_pic]" value="{$login.wechat_pic|default=''}" class="type-file-text" autocomplete="off">
  249. <input type="button" name="button" id="button1" value="选择上传..." class="type-file-button">
  250. <input class="type-file-file" onclick="GetUploadify(1, '', 'allimg', 'wechat_pic_call_back')" size="30" hidefocus="true" nc_type="change_site_logo" title="点击前方预览图可查看大图,点击按钮选择文件并提交表单后上传生效">
  251. </span>
  252. </div>
  253. <span class="err"></span>
  254. <p class="notic"></p>
  255. </dd>
  256. </dl>
  257. <dl class="row">
  258. <div class="bot" style="padding-bottom:0px;">
  259. <input type="hidden" id="WX_appid" value="{$login.appid|default=''}">
  260. <a href="JavaScript:void(0);" onclick="submit_microsite();" class="ncap-btn-big ncap-btn-green">确认提交</a>
  261. </div>
  262. </dl>
  263. </div>
  264. <div class="" style="position: absolute;top: 38px;left: 750px;">
  265. <dl class="" style="background: #fff;">
  266. <div class="">
  267. <img src="__STATIC__/admin/images/wzd-shili.jpg" width="278" height="195" />
  268. </div>
  269. <div style="text-align: center;line-height: 32px;font-size: 16px;">PC效果演示</div>
  270. </dl>
  271. </div>
  272. </form>
  273. </div>
  274. <script type="text/javascript">
  275. $(function(){
  276. //操作提示缩放动画
  277. $("#microsite_checkZoom").toggle(
  278. function() {
  279. $("#microsite_explanation").animate({
  280. color: "#FFF",
  281. backgroundColor: "#4FD6BE",
  282. width: "80",
  283. height: "20",
  284. },300);
  285. $("#microsite_explanationZoom").hide();
  286. },
  287. function() {
  288. $("#microsite_explanation").animate({
  289. color: "#2CBCA3",
  290. backgroundColor: "#EDFBF8",
  291. width: "99%",
  292. height: "20",
  293. },300,function() {
  294. $(this).css('height', '100%');
  295. });
  296. $("#microsite_explanationZoom").show();
  297. }
  298. );
  299. })
  300. // 提交
  301. function submit_microsite(){
  302. layer_loading("正在处理");
  303. $.ajax({
  304. url: "{:url('System/microsite', ['_ajax'=>1])}",
  305. type: 'POST',
  306. dataType: 'JSON',
  307. data: $('#postMicrosite').serialize(),
  308. success: function(res){
  309. layer.closeAll();
  310. if (1 == res.code) {
  311. layer.msg(res.msg, {shade: 0.1, time: 1000}, function(){
  312. window.location.reload();
  313. });
  314. } else {
  315. var icon = 2;
  316. try{
  317. if (res.data.icon) {
  318. icon = res.data.icon;
  319. }
  320. }catch(e){}
  321. showErrorAlert(res.msg, icon);
  322. return false;
  323. }
  324. },
  325. error: function(e){
  326. layer.closeAll();
  327. showErrorMsg(e.responseText);
  328. return false;
  329. }
  330. });
  331. }
  332. // 检测是否配置微信参数
  333. function DetectConfig(type) {
  334. if (3 == type) {
  335. $('#shop_micro0').removeAttr("disabled");
  336. return false;
  337. }
  338. var WX_appid = $('#WX_appid');
  339. if (!WX_appid.val() || '' == WX_appid.val()) {
  340. if (1 == type) {
  341. $("#shop_micro0").click();
  342. } else if (2 == type) {
  343. $("#shop_force_use_wechat0").click();
  344. }
  345. showErrorAlert('请先完善微信公众号配置');
  346. return false;
  347. }
  348. if (2 == type) {
  349. // 设置微信端开启
  350. $("#shop_force_use_wechat1, #shop_micro1").attr('checked', true);
  351. $('#shop_micro0').attr("disabled", "disabled");
  352. }
  353. }
  354. // 加载图片显示
  355. function wechat_pic_call_back(fileurl_tmp) {
  356. $("#wechat_pic").val(fileurl_tmp);
  357. $("#img_a_wechat_pic").attr('href', fileurl_tmp);
  358. $("#img_i_wechat_pic").attr('onmouseover', "layer_tips=layer.tips('<img src="+fileurl_tmp+" width=300 height=300>',this,{tips: [1, '#fff']});");
  359. }
  360. </script>
  361. </div>
  362. {include file="public/footer" /}