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

set_mnp.html 18KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338
  1. {layout name="layout1" /}
  2. <style>
  3. .layui-form-label {
  4. width: 156px;
  5. }
  6. .tips {
  7. color: red;
  8. }
  9. .copy {
  10. margin-left: 10px;
  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-header" style="margin-top: 20px">小程序配置</div>-->
  33. <div class="layui-card-body" pad15>
  34. <div class="layui-form" lay-filter="">
  35. <!-- 微信小程序-->
  36. <div class="layui-form-item div-flex">
  37. <fieldset class="layui-elem-field layui-field-title">
  38. <legend>微信小程序</legend>
  39. </fieldset>
  40. </div>
  41. <div class="layui-form-item">
  42. <label class="layui-form-label">小程序名称:</label>
  43. <div class="layui-input-inline">
  44. <input type="text" name="name" value="{$mnp.name}" class="layui-input" autocomnplete="off">
  45. </div>
  46. </div>
  47. <div class="layui-form-item">
  48. <label class="layui-form-label">原始ID:</label>
  49. <div class="layui-input-inline">
  50. <input type="text" name="original_id" value="{$mnp.original_id}" class="layui-input"
  51. autocomnplete="off">
  52. </div>
  53. </div>
  54. <div class="layui-form-item">
  55. <label class="layui-form-label">小程序码:</label>
  56. <div class="layui-input-block">
  57. <div class="like-upload-image">
  58. {if $mnp.qr_code}
  59. <div class="upload-image-div">
  60. <img src="{$mnp.qr_code}" alt="img">
  61. <input type="hidden" name="bg_image" value="{$mnp.qr_code}">
  62. <div class="del-upload-btn">x</div>
  63. </div>
  64. <div class="upload-image-elem" style="display:none;"><a class="add-upload-image"
  65. id="qrcode"> + 添加图片</a></div>
  66. {else}
  67. <div class="upload-image-elem"><a class="add-upload-image" id="qrcode"> + 添加图片</a></div>
  68. {/if}
  69. </div>
  70. </div>
  71. </div>
  72. <div class="layui-form-item">
  73. <label class="layui-form-label"></label>
  74. <span style="color: #a3a3a3;font-size: 9px">建议尺寸:宽400px*高400px。jpg,jpeg,png格式</span>
  75. </div>
  76. <div class="layui-form-item">
  77. <label class="layui-form-label">发货信息管理:</label>
  78. <div class="layui-input-block">
  79. <input type="radio" name="express_send_sync" value="1" title="开启" {if $mnp.express_send_sync== 1} checked {/if} >
  80. <input type="radio" name="express_send_sync" value="0" title="关闭" {if $mnp.express_send_sync== 0} checked {/if} >
  81. </div>
  82. </div>
  83. <div class="layui-form-item">
  84. <label class="layui-form-label"></label>
  85. <span style="color: #a3a3a3;font-size: 9px">小程序有订单发货管理时,请打开此开关,否则会导致订单资金冻结</span>
  86. </div>
  87. <!-- 开发者ID-->
  88. <div class="layui-form-item div-flex">
  89. <fieldset class="layui-elem-field layui-field-title">
  90. <legend>开发者ID</legend>
  91. </fieldset>
  92. </div>
  93. <div class="layui-form-item">
  94. <label class="layui-form-label"><span class="tips">*</span>AppID:</label>
  95. <div class="layui-input-inline">
  96. <input type="text" name="app_id" value="{$mnp.app_id}" autocomplete="off" lay-verify="required"
  97. lay-verType="tips"
  98. class="layui-input">
  99. </div>
  100. </div>
  101. <div class="layui-form-item">
  102. <label class="layui-form-label"><span class="tips">*</span>AppSecret:</label>
  103. <div class="layui-input-inline">
  104. <input type="text" name="app_secret" value="{$mnp.app_secret}" lay-verify="required"
  105. lay-verType="tips" autocomnplete="off" class="layui-input">
  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">小程序账号登录微信公众平台,点击开发>开发设置->开发者ID,设置AppID和AppSecret</span>
  111. </div>
  112. <!-- 服务器域名-->
  113. <div class="layui-form-item div-flex">
  114. <fieldset class="layui-elem-field layui-field-title">
  115. <legend>服务器域名</legend>
  116. </fieldset>
  117. </div>
  118. <div class="layui-form-item">
  119. <label class="layui-form-label">request合法域名:</label>
  120. <div class="layui-input-inline">
  121. <input type="text" name="request_domain" readonly="readonly" value="{$mnp.request_domain}"
  122. class="layui-input">
  123. <button type="button" class="layui-btn layui-btn-primary layui-btn-sm copy">复制</button>
  124. </div>
  125. </div>
  126. <div class="layui-form-item">
  127. <label class="layui-form-label"></label>
  128. <span style="color: #a3a3a3;font-size: 9px">小程序账号登录微信公众平台,点击开发>开发设置->服务器域名,填写https协议域名</span>
  129. </div>
  130. <div class="layui-form-item">
  131. <label class="layui-form-label">socket合法域名:</label>
  132. <div class="layui-input-inline">
  133. <input type="text" name="socket_domain" readonly="readonly" value="{$mnp.socket_domain}"
  134. class="layui-input">
  135. <button type="button" class="layui-btn layui-btn-primary layui-btn-sm copy">复制</button>
  136. </div>
  137. </div>
  138. <div class="layui-form-item">
  139. <label class="layui-form-label"></label>
  140. <span style="color: #a3a3a3;font-size: 9px">小程序账号登录微信公众平台,点击开发>开发设置->服务器域名,填写wss协议域名</span>
  141. </div>
  142. <div class="layui-form-item">
  143. <label class="layui-form-label">uploadFile合法域名:</label>
  144. <div class="layui-input-inline">
  145. <input type="text" name="uploadfile_domain" readonly="readonly" value="{$mnp.uploadfile_domain}"
  146. class="layui-input">
  147. <button type="button" class="layui-btn layui-btn-primary layui-btn-sm copy">复制</button>
  148. </div>
  149. </div>
  150. <div class="layui-form-item">
  151. <label class="layui-form-label"></label>
  152. <span style="color: #a3a3a3;font-size: 9px">小程序账号登录微信公众平台,点击开发>开发设置->服务器域名,填写https协议域名</span>
  153. </div>
  154. <div class="layui-form-item">
  155. <label class="layui-form-label">downloadFile合法域名:</label>
  156. <div class="layui-input-inline">
  157. <input type="text" name="downloadfile_domain" readonly="readonly"
  158. value="{$mnp.downloadfile_domain}"
  159. class="layui-input">
  160. <button type="button" class="layui-btn layui-btn-primary layui-btn-sm copy">复制</button>
  161. </div>
  162. </div>
  163. <div class="layui-form-item">
  164. <label class="layui-form-label"></label>
  165. <span style="color: #a3a3a3;font-size: 9px">小程序账号登录微信公众平台,点击开发>开发设置->服务器域名,填写https协议域名</span>
  166. </div>
  167. <div class="layui-form-item">
  168. <label class="layui-form-label">udp合法域名:</label>
  169. <div class="layui-input-inline">
  170. <input type="text" name="udp_domain" readonly="readonly" value="{$mnp.udp_domain}"
  171. class="layui-input">
  172. <button type="button" class="layui-btn layui-btn-primary layui-btn-sm copy">复制</button>
  173. </div>
  174. </div>
  175. <div class="layui-form-item">
  176. <label class="layui-form-label">tcp合法域名:</label>
  177. <div class="layui-input-inline">
  178. <input type="text" name="tcp_domain" readonly="readonly" value="{$mnp.tcp_domain}" class="layui-input">
  179. <button type="button" class="layui-btn layui-btn-primary layui-btn-sm copy" >复制</button>
  180. </div>
  181. </div>
  182. <div class="layui-form-item">
  183. <label class="layui-form-label"></label>
  184. <span style="color: #a3a3a3;font-size: 9px">小程序账号登录微信公众平台,点击开发>开发设置->服务器域名,填写udp协议域名</span>
  185. </div>
  186. <!-- 业务域名-->
  187. <div class="layui-form-item div-flex">
  188. <fieldset class="layui-elem-field layui-field-title">
  189. <legend>业务域名</legend>
  190. </fieldset>
  191. </div>
  192. <div class="layui-form-item">
  193. <label class="layui-form-label">业务域名:</label>
  194. <div class="layui-input-inline">
  195. <input type="text" readonly="readonly" value="{$mnp.business_domain}" class="layui-input">
  196. <button type="button" class="layui-btn layui-btn-primary layui-btn-sm copy">复制</button>
  197. </div>
  198. </div>
  199. <div class="layui-form-item">
  200. <label class="layui-form-label"></label>
  201. <span style="color: #a3a3a3;font-size: 9px">小程序账号登录微信公众平台,点击开发>开发设置->业务域名,填写业务域名</span>
  202. </div>
  203. <!-- 消息推送-->
  204. <div class="layui-form-item div-flex">
  205. <fieldset class="layui-elem-field layui-field-title">
  206. <legend>消息推送</legend>
  207. </fieldset>
  208. </div>
  209. <div class="layui-form-item">
  210. <label class="layui-form-label">URL:</label>
  211. <div class="layui-input-inline">
  212. <input type="text" name="url" readonly="readonly" value="{$mnp.url}" class="layui-input"
  213. autocomplete="off">
  214. <button type="button" class="layui-btn layui-btn-primary layui-btn-sm copy">复制</button>
  215. </div>
  216. </div>
  217. <div class="layui-form-item">
  218. <label class="layui-form-label"></label>
  219. <span style="color: #a3a3a3;font-size: 9px">小程序账号登录微信公众平台,点击开发>开发设置>消息推送配置,填写服务器地址(URL)</span>
  220. </div>
  221. <div class="layui-form-item">
  222. <label class="layui-form-label">Token:</label>
  223. <div class="layui-input-inline">
  224. <input type="text" name="token" value="{$mnp.token}" autocomnplete="off" class="layui-input">
  225. <button type="button" class="layui-btn layui-btn-primary layui-btn-sm copy">复制</button>
  226. </div>
  227. </div>
  228. <div class="layui-form-item">
  229. <label class="layui-form-label"></label>
  230. <span style="color: #a3a3a3;font-size: 9px">小程序账号登录微信公众平台,点击开发>开发设置>消息推送配置,设置令牌Token。不填默认为“LikeMall”</span>
  231. </div>
  232. <div class="layui-form-item">
  233. <label class="layui-form-label">EncodingAESKey:</label>
  234. <div class="layui-input-inline">
  235. <input type="text" name="encoding_ses_key" value="{$mnp.encoding_ses_key}" autocomnplete="off"
  236. class="layui-input">
  237. <button type="button" class="layui-btn layui-btn-primary layui-btn-sm copy">复制</button>
  238. </div>
  239. </div>
  240. <div class="layui-form-item">
  241. <label class="layui-form-label"></label>
  242. <span style="color: #a3a3a3;font-size: 9px">消息加密密钥由43位字符组成,字符范围为A-Z,a-z,0-9</span>
  243. </div>
  244. <div class="layui-form-item">
  245. <label class="layui-form-label">消息加密方式:</label>
  246. <div class="layui-input-block">
  247. <input type="radio" name="encryption_type" {if $mnp.encryption_type== 1} checked {/if} value="1"
  248. title="明文模式(不使用消息体加解密功能,安全系数较低)" />
  249. </div>
  250. <div class="layui-input-block">
  251. <input type="radio" name="encryption_type" {if $mnp.encryption_type== 2} checked {/if} value="2"
  252. title="兼容模式(明文、密文将共存,方便开发者调试和维护)" >
  253. </div>
  254. <div class="layui-input-block" style="margin-left: 186px">
  255. <input type="radio" name="encryption_type" {if $mnp.encryption_type== 3} checked {/if} value="3"
  256. title="安全模式(推荐)(消息包为纯密文,需要开发者加密和解密,安全系数高)" >
  257. </div>
  258. </div>
  259. <div class="layui-form-item">
  260. <label class="layui-form-label">数据格式:</label>
  261. <div class="layui-input-block">
  262. <input type="radio" name="data_type" value="1" title="JSON" {if $mnp.data_type== 1} checked {/if}
  263. >
  264. <input type="radio" name="data_type" value="2" title="XML" {if $mnp.data_type== 2} checked {/if}
  265. >
  266. </div>
  267. </div>
  268. <div class="layui-form-item">
  269. <div class="layui-input-block">
  270. <button class="layui-btn {$view_theme_color}" lay-submit lay-filter="setmnp">确定</button>
  271. </div>
  272. </div>
  273. </div>
  274. </div>
  275. </div>
  276. </div>
  277. </div>
  278. </div>
  279. <script>
  280. layui.config({
  281. version: "{$front_version}",
  282. base: '/static/lib/' //静态资源所在路径
  283. }).use(['form'], function () {
  284. var $ = layui.$, form = layui.form;
  285. // 小程序码图片
  286. $(document).on("click", "#qrcode", function () {
  287. like.imageUpload({
  288. limit: 1,
  289. field: "qr_code",
  290. that: $(this)
  291. });
  292. })
  293. // 删除图片
  294. like.delUpload();
  295. //显示图片
  296. $(document).on('click', 'img', function () {
  297. var image = $(this).attr('src');
  298. like.showImg(image, 600);
  299. });
  300. //复制
  301. $(document).on('click', '.copy', function () {
  302. var copyText = $(this).prev()
  303. copyText.select()
  304. document.execCommand("Copy");
  305. })
  306. form.on('submit(setmnp)', function (data) {
  307. like.ajax({
  308. url: '{:url("wechat.mnp/setMnp")}' //实际使用请改成服务端真实接口
  309. , data: data.field
  310. , type: 'post'
  311. , success: function (res) {
  312. if (res.code == 1) {
  313. layer.msg(res.msg, {
  314. offset: '15px'
  315. , icon: 1
  316. , time: 1000
  317. });
  318. }
  319. }
  320. });
  321. });
  322. });
  323. </script>