截流自动化的商城平台
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.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244
  1. {layout name="layout1" /}
  2. <style>
  3. .layui-form-label {
  4. width: 120px;
  5. }
  6. .copy{
  7. margin-left: 10px;
  8. }
  9. .tips{
  10. color: red;
  11. }
  12. .layui-form-item .layui-input-inline{
  13. width: 410px;
  14. }
  15. .layui-input{
  16. display: inline-block;
  17. width: 80%;
  18. }
  19. </style>
  20. <div class="wrapper">
  21. <div class="layui-card">
  22. <div class="layui-card-body">
  23. <div class="layui-collapse like-layui-collapse" lay-accordion="" style="border:1px dashed #c4c4c4">
  24. <div class="layui-colla-item">
  25. <h2 class="layui-colla-title like-layui-colla-title" style="background-color: #fff">操作提示</h2>
  26. <div class="layui-colla-content layui-show">
  27. *填写微信公众号开发配置,请前往微信公众平台申请服务号并完成认证。
  28. </div>
  29. </div>
  30. </div>
  31. </div>
  32. <div class="layui-card-body" pad15>
  33. <div class="layui-form" lay-filter="">
  34. <!-- 微信公众号-->
  35. <div class="layui-form-item div-flex">
  36. <fieldset class="layui-elem-field layui-field-title">
  37. <legend>微信公众号</legend>
  38. </fieldset>
  39. </div>
  40. <div class="layui-form-item">
  41. <label class="layui-form-label">公众号名称:</label>
  42. <div class="layui-input-inline">
  43. <input type="text" name="name" value="{$oa.name}" class="layui-input">
  44. </div>
  45. </div>
  46. <div class="layui-form-item">
  47. <label class="layui-form-label">原始ID:</label>
  48. <div class="layui-input-inline">
  49. <input type="text" name="original_id" value="{$oa.original_id}" autocomplete="off" class="layui-input">
  50. </div>
  51. </div>
  52. <div class="layui-form-item">
  53. <label class="layui-form-label">公众号二维码:</label>
  54. <div class="layui-input-block">
  55. <div class="like-upload-image">
  56. {if $oa.qr_code}
  57. <div class="upload-image-div">
  58. <img src="{$oa.qr_code}" alt="img">
  59. <input type="hidden" name="qr_code" value="{$oa.qr_code}">
  60. <div class="del-upload-btn">x</div>
  61. </div>
  62. <div class="upload-image-elem" style="display:none;"><a class="add-upload-image" id="qrimage"> + 添加图片</a></div>
  63. {else}
  64. <div class="upload-image-elem"><a class="add-upload-image" id="qrimage"> + 添加图片</a></div>
  65. {/if}
  66. </div>
  67. </div>
  68. </div>
  69. <div class="layui-form-item">
  70. <label class="layui-form-label"></label>
  71. <span style="color: #a3a3a3;font-size: 9px">建议尺寸:宽400px*高400px。jpg,jpeg,png格式</span>
  72. </div>
  73. <!-- 公众号开发者信息-->
  74. <div class="layui-form-item div-flex">
  75. <fieldset class="layui-elem-field layui-field-title">
  76. <legend>公众号开发者信息</legend>
  77. </fieldset>
  78. </div>
  79. <div class="layui-form-item">
  80. <label class="layui-form-label"><span class="tips">*</span>AppID:</label>
  81. <div class="layui-input-inline">
  82. <input type="text" name="app_id" value="{$oa.app_id}" lay-verify="required" lay-verType="tips" class="layui-input">
  83. </div>
  84. </div>
  85. <div class="layui-form-item">
  86. <label class="layui-form-label"><span class="tips">*</span>AppSecret:</label>
  87. <div class="layui-input-inline">
  88. <input type="text" name="app_secret" value="{$oa.app_secret}" lay-verify="required" lay-verType="tips" autocomplete="off" class="layui-input">
  89. </div>
  90. </div>
  91. <div class="layui-form-item">
  92. <label class="layui-form-label"></label>
  93. <span style="color: #a3a3a3;font-size: 9px">登录微信公众平台,点击开发>基本配置>公众号开发信息,设置AppID和AppSecret</span>
  94. </div>
  95. <!-- 服务器配置-->
  96. <div class="layui-form-item div-flex">
  97. <fieldset class="layui-elem-field layui-field-title">
  98. <legend>服务器配置</legend>
  99. </fieldset>
  100. </div>
  101. <div class="layui-form-item">
  102. <label class="layui-form-label">URL:</label>
  103. <div class="layui-input-inline">
  104. <input type="text" value="{$oa.url}" readonly="readonly" class="layui-input">
  105. <button type="button" class="layui-btn layui-btn-primary layui-btn-sm copy" >复制</button>
  106. </div>
  107. </div>
  108. <div class="layui-form-item">
  109. <label class="layui-form-label"></label>
  110. <span style="color: #a3a3a3;font-size: 9px">登录微信公众平台,点击开发>基本配置>服务器配置,填写服务器地址(URL)</span>
  111. </div>
  112. <div class="layui-form-item">
  113. <label class="layui-form-label">Token:</label>
  114. <div class="layui-input-inline">
  115. <input type="text" name="token" value="{$oa.token}" autocomplete="off" class="layui-input">
  116. <button type="button" class="layui-btn layui-btn-primary layui-btn-sm copy " >复制</button>
  117. </div>
  118. </div>
  119. <div class="layui-form-item">
  120. <label class="layui-form-label"></label>
  121. <span style="color: #a3a3a3;font-size: 9px">登录微信公众平台,点击开发>基本配置>服务器配置,设置令牌Token。不填默认为“LikeMall”</span>
  122. </div>
  123. <div class="layui-form-item">
  124. <label class="layui-form-label">EncodingAESKey:</label>
  125. <div class="layui-input-inline">
  126. <input type="text" name="encoding_ses_key" value="{$oa.encoding_ses_key}" autocomplete="off" class="layui-input">
  127. <button type="button" class="layui-btn layui-btn-primary layui-btn-sm copy" >复制</button>
  128. </div>
  129. </div>
  130. <div class="layui-form-item">
  131. <label class="layui-form-label"></label>
  132. <span style="color: #a3a3a3;font-size: 9px">消息加密密钥由43位字符组成,字符范围为A-Z,a-z,0-9</span>
  133. </div>
  134. <div class="layui-form-item">
  135. <label class="layui-form-label">消息加密方式:</label>
  136. <div class="layui-input-block">
  137. <input type="radio" name="encryption_type" value="1" title="明文模式(不使用消息体加解密功能,安全系数较低)"{if $oa.encryption_type == 1} checked {/if} >
  138. </div>
  139. <div class="layui-input-block">
  140. <input type="radio" name="encryption_type" value="2" title="兼容模式(明文、密文将共存,方便开发者调试和维护)" {if $oa.encryption_type == 2} checked {/if} >
  141. </div>
  142. <div class="layui-input-block" style="margin-left: 150px">
  143. <input type="radio" name="encryption_type" value="3" title="安全模式(推荐)(消息包为纯密文,需要开发者加密和解密,安全系数高)" {if $oa.encryption_type == 3} checked {/if} >
  144. </div>
  145. </div>
  146. <!-- 功能设置-->
  147. <div class="layui-form-item div-flex">
  148. <fieldset class="layui-elem-field layui-field-title">
  149. <legend>功能设置</legend>
  150. </fieldset>
  151. </div>
  152. <div class="layui-form-item">
  153. <label class="layui-form-label">业务域名:</label>
  154. <div class="layui-input-inline">
  155. <input type="text" readonly="readonly" value="{$oa.business_domain}" class="layui-input">
  156. <button type="button" class="layui-btn layui-btn-primary layui-btn-sm copy" >复制</button>
  157. </div>
  158. </div>
  159. <div class="layui-form-item">
  160. <label class="layui-form-label"></label>
  161. <span style="color: #a3a3a3;font-size: 9px">登录微信公众平台,点击设置>公众号设置>功能设置,填写业务域名</span>
  162. </div>
  163. <div class="layui-form-item">
  164. <label class="layui-form-label">JS接口安全域名:</label>
  165. <div class="layui-input-inline">
  166. <input type="text" readonly="readonly" value="{$oa.safety_domain}" class="layui-input">
  167. <button type="button" class="layui-btn layui-btn-primary layui-btn-sm copy" >复制</button>
  168. </div>
  169. </div>
  170. <div class="layui-form-item">
  171. <label class="layui-form-label"></label>
  172. <span style="color: #a3a3a3;font-size: 9px">登录微信公众平台,点击设置>公众号设置>功能设置,填写JS接口安全域名</span>
  173. </div>
  174. <div class="layui-form-item">
  175. <label class="layui-form-label">网页授权域名:</label>
  176. <div class="layui-input-inline">
  177. <input type="text" readonly="readonly" value="{$oa.auth_domain}" class="layui-input">
  178. <button type="button" class="layui-btn layui-btn-primary layui-btn-sm copy" >复制</button>
  179. </div>
  180. </div>
  181. <div class="layui-form-item">
  182. <label class="layui-form-label"></label>
  183. <span style="color: #a3a3a3;font-size: 9px">登录微信公众平台,点击设置>公众号设置>功能设置,填写网页授权域名</span>
  184. </div>
  185. <div class="layui-form-item">
  186. <div class="layui-input-inline" style="text-align: center;width: 560px">
  187. <button class="layui-btn {$view_theme_color}" lay-submit lay-filter="setoa">确定</button>
  188. </div>
  189. </div>
  190. </div>
  191. </div>
  192. </div>
  193. </div>
  194. <script>
  195. layui.config({
  196. version:"{$front_version}",
  197. base: '/static/lib/' //静态资源所在路径
  198. }).use(['form'], function () {
  199. var $ = layui.$, form = layui.form
  200. // 图片上传
  201. $(document).on("click", "#qrimage", function () {
  202. like.imageUpload({
  203. limit: 1,
  204. field: "qr_code",
  205. that: $(this)
  206. });
  207. })
  208. // 删除图片
  209. like.delUpload();
  210. // 放大图片
  211. $(document).on('click', 'img', function () {
  212. var image = $(this).attr('src');
  213. like.showImg(image,600);
  214. });
  215. //复制
  216. $(document).on('click','.copy',function () {
  217. var copyText = $(this).prev()
  218. copyText.select()
  219. document.execCommand("Copy");
  220. })
  221. // 提交表单
  222. form.on('submit(setoa)', function (data) {
  223. like.ajax({
  224. url: '{:url("wechat.oa/setOa")}' //实际使用请改成服务端真实接口
  225. , data: data.field
  226. , type: 'post'
  227. , success: function (res) {
  228. if (res.code == 1) {
  229. layer.msg(res.msg, {
  230. offset: '15px'
  231. , icon: 1
  232. , time: 1000
  233. });
  234. }
  235. }
  236. });
  237. });
  238. });
  239. </script>