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

edit_wechat.html 10KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262
  1. {layout name="layout2" /}
  2. <style>
  3. .pay-li {
  4. float: left;
  5. opacity: 1;
  6. position: relative;
  7. }
  8. .pay-img {
  9. width: 80px;
  10. height: 80px;
  11. padding: 4px;
  12. }
  13. .pay-img-del-x {
  14. position: absolute;
  15. z-index: 100;
  16. top: -4px;
  17. right: -2px;
  18. width: 20px;
  19. height: 20px;
  20. font-size: 16px;
  21. line-height: 16px;
  22. color: #fff;
  23. text-align: center;
  24. cursor: pointer;
  25. background: hsla(0, 0%, 60%, .6);
  26. border-radius: 10px;
  27. }
  28. .upload-cert-a{
  29. cursor: pointer;
  30. position: absolute;
  31. z-index: 100;
  32. top: 58px;
  33. right: -10%;
  34. width: 100px;
  35. height: 20px;
  36. font-size: 8px;
  37. line-height: 16px;
  38. text-align: center;
  39. border-radius: 10px;
  40. color: #4e8bff;
  41. }
  42. .upload-cert-a:hover {
  43. color: #0641cb;
  44. }
  45. .pay-cert{
  46. height:80px;line-height:80px
  47. }
  48. .cert-add,.key-add{
  49. height: 80px;
  50. width: 80px;
  51. float: left;
  52. opacity: 1;
  53. position: relative;
  54. border:1px dashed #a0a0a0;
  55. background-image:url('/static/common/image/default/add_file.png');
  56. background-repeat: no-repeat;
  57. background-position: 50% 35%;
  58. background-size:40px 40px;
  59. margin: 4px;
  60. text-align: center;
  61. }
  62. </style>
  63. <div class="layui-form" lay-filter="layuiadmin-form" id="layuiadmin-form" style="padding: 20px 30px 0 0;">
  64. <!--支付简称-->
  65. <div class="layui-form-item">
  66. <label class="layui-form-label">支付简称:</label>
  67. <div class="layui-input-block">
  68. <div class="layui-col-md4">
  69. <input type="text" name="short_name" value="{$info.short_name | default = ''}" lay-verify="check_required" lay-verType="tips" autocomplete="off" class="layui-input">
  70. <div class="layui-form-mid layui-word-aux">会员在商城看见的支付名称</div>
  71. </div>
  72. </div>
  73. </div>
  74. <div class="layui-form-item">
  75. <label class="layui-form-label">商户API密钥:</label>
  76. <div class="layui-input-block">
  77. <div class="layui-col-md4">
  78. <input type="text" name="pay_sign_key" value="{$info.config.pay_sign_key | default = ''}" lay-verify="check_required" lay-verType="tips" autocomplete="off" class="layui-input">
  79. <div class="layui-form-mid layui-word-aux">微信支付商户API密钥(paySignKey)</div>
  80. </div>
  81. </div>
  82. </div>
  83. <div class="layui-form-item">
  84. <label class="layui-form-label">微信支付商户号:</label>
  85. <div class="layui-input-block">
  86. <div class="layui-col-md4">
  87. <input type="text" name="mch_id" value="{$info.config.mch_id | default = ''}" lay-verify="check_required" lay-verType="tips" autocomplete="off" class="layui-input">
  88. <div class="layui-form-mid layui-word-aux">微信支付商户号(MCHID)</div>
  89. </div>
  90. </div>
  91. </div>
  92. <!--支付图标-->
  93. <div class="layui-form-item">
  94. <label class="layui-form-label">支付图标</label>
  95. <div class="layui-input-inline">
  96. <div class="like-upload-image">
  97. {if $info.image}
  98. <div class="upload-image-div">
  99. <img src="{$info.image}" alt="img">
  100. <input type="hidden" name="image" value="{$info.image}">
  101. <div class="del-upload-btn">x</div>
  102. </div>
  103. <div class="upload-image-elem" style="display:none;"><a class="add-upload-image"> + 添加图片</a></div>
  104. {else}
  105. <div class="upload-image-elem"><a class="add-upload-image"> + 添加图片</a></div>
  106. {/if}
  107. </div>
  108. </div>
  109. <div class="layui-form-item">
  110. <label class="layui-form-label"></label>
  111. <label class=" layui-form-mid layui-word-aux">支付方式图标。建议尺寸:宽100px*高100px,jpg,jpeg,png格式</label>
  112. </div>
  113. </div>
  114. <!--支付证书-->
  115. <div class="layui-form-item">
  116. <label class="layui-form-label">支付证书:</label>
  117. <div class="layui-inline">
  118. <div class="pay-cert" id="kkk">
  119. <input class="text" type="hidden" name="apiclient_cert" value="{$info.config.apiclient_cert | default = ''}" >
  120. {if !empty($info.config.apiclient_cert)}
  121. <div class="cert-add" style="display: none;cursor: pointer;">
  122. <a class="upload-cert-a">+ 添加文件</a>
  123. </div>
  124. <div class="pay-li">
  125. <img class="pay-img" src="/static/common/image/default/upload.png">
  126. <a class="pay-img-del-x" style="display: none">x</a>
  127. </div>
  128. {else/}
  129. <div class="cert-add" style="cursor: pointer;">
  130. <a class="upload-cert-a">+ 添加文件</a>
  131. </div>
  132. {/if}
  133. </div>
  134. <div class=" layui-form-mid layui-word-aux">
  135. 微信支付证书(apiclient_cert.pem),前往微信商家平台下载,文件名一般为apiclient_cert.pem
  136. </div>
  137. </div>
  138. </div>
  139. <!--支付证书密钥-->
  140. <div class="layui-form-item">
  141. <label class="layui-form-label">支付证书密钥:</label>
  142. <div class="layui-inline">
  143. <div class="pay-cert">
  144. <input class="text" type="hidden" name="apiclient_key" value="{$info.config.apiclient_key | default = ''}" >
  145. {if !empty($info.config.apiclient_key)}
  146. <div class="key-add" style="display: none;cursor: pointer;">
  147. <a class="upload-cert-a">+ 添加文件</a>
  148. </div>
  149. <div class="pay-li">
  150. <img class="pay-img" src="/static/common/image/default/upload.png">
  151. <a class="pay-img-del-x" style="display: none">x</a>
  152. </div>
  153. {else/}
  154. <div class="key-add" style="cursor: pointer;">
  155. <a class="upload-cert-a">+ 添加文件</a>
  156. </div>
  157. {/if}
  158. </div>
  159. <div class=" layui-form-mid layui-word-aux">
  160. 微信支付证书密钥(apiclient_key.pem),前往微信商家平台下载。文件名一般为apiclient_key.pem
  161. </div>
  162. </div>
  163. </div>
  164. <!--支付授权目录-->
  165. <div class="layui-form-item">
  166. <label class="layui-form-label" >支付授权目录:</label>
  167. <div class="layui-input-block">
  168. <div class="layui-col-md4">
  169. <input type="text" value="{$domain}/" autocomplete="off" class="layui-input">
  170. </div>
  171. <button type="button" class="layui-btn layui-btn-primary layui-btn-sm copy" >复制</button>
  172. </div>
  173. <div class="layui-form-item">
  174. <label class="layui-form-label"></label>
  175. <label class="layui-form-mid layui-word-aux">支付授权目录仅供参考,请根据微信支付的系统提示进行设置</label>
  176. </div>
  177. </div>
  178. <!--排序-->
  179. <div class="layui-form-item">
  180. <label class="layui-form-label">排序</label>
  181. <div class="layui-input-block">
  182. <div class="layui-col-md4">
  183. <input type="number" name="sort" value="{$info.sort | default = ''}" class="layui-input" >
  184. <div class=" layui-form-mid layui-word-aux">排序越小越前</div>
  185. </div>
  186. </div>
  187. </div>
  188. <!--状态-->
  189. <div class="layui-form-item">
  190. <label class="layui-form-label">状态:</label>
  191. <div class="layui-input-block">
  192. <input type="radio" name="status" value=1 title="启用"{if condition="$info.status eq 1" }checked{/if}>
  193. <input type="radio" name="status" value=0 title="关闭" {if condition="$info.status eq 0" }checked{/if}>
  194. </div>
  195. </div>
  196. <div class="layui-form-item layui-hide">
  197. <input type="button" lay-submit lay-filter="edit-submit" id="edit-submit" value="确认">
  198. </div>
  199. </div>
  200. </div>
  201. <script>
  202. layui.use(['form'], function(){
  203. var $ = layui.$
  204. ,form = layui.form;
  205. like.delUpload();
  206. $(document).on("click", ".add-upload-image", function () {
  207. like.imageUpload({
  208. limit: 1,
  209. field: "image",
  210. that: $(this)
  211. });
  212. });
  213. //删除图片/证书
  214. $(document).on('click', '.pay-img-del-x', function () {
  215. $(this).parent().siblings('input').val('');
  216. $(this).parent().siblings().css('display','block');
  217. $(this).parent().remove();
  218. });
  219. form.verify({
  220. check_required: function (value, item) {
  221. var status = $('input[name="status"]:checked').val();
  222. value = value.trim();
  223. if (status == 1 && value.length == 0) {
  224. return '请填写完整';
  225. }
  226. }
  227. });
  228. //==========================================上传证书start=========================================================
  229. like.certUpload('.cert-add', '{:url("file/other")}?local=1&sub_dir=cert', '{$storageUrl}');
  230. like.certUpload('.key-add', '{:url("file/other")}?local=1&sub_dir=cert', '{$storageUrl}');
  231. //==========================================上传证书end===========================================================
  232. // 删除按钮的显示与隐藏
  233. $(document).on('mouseover', '.pay-img', function () {
  234. $(this).next().show();
  235. });
  236. $(document).on('mouseout', '.pay-img', function () {
  237. $(this).next().hide();
  238. });
  239. $(document).on('mouseover', '.pay-img-del-x', function () {
  240. $(this).show();
  241. });
  242. $(document).on('mouseout', '.pay-img-del-x', function () {
  243. $(this).hide();
  244. });
  245. })
  246. </script>