瀏覽代碼

[更新]修改微信菜单小程序支持

Anyon 7 年之前
父節點
當前提交
f22d1a3c40
共有 2 個文件被更改,包括 2 次插入2 次删除
  1. 1 1
      application/wechat/controller/Menu.php
  2. 1 1
      application/wechat/view/menu.index.html

+ 1 - 1
application/wechat/controller/Menu.php

@@ -124,7 +124,7 @@ class Menu extends BasicAdmin {
             empty($row['content']) && $row['content'] = uniqid();
             switch ($row['type']) {
                 case 'miniprogram':
-                    list($row['appid'], $row['pagepath']) = explode(',', $row['content']);
+                    list($row['appid'], $row['pagepath']) = explode(',', $row['content'] . ',');
                     break;
                 case 'view':
                     $row['url'] = preg_match('#^(\w+:)?//#i', $row['content']) ? $row['content'] : url($row['content'], '', true, true);

+ 1 - 1
application/wechat/view/menu.index.html

@@ -239,7 +239,7 @@
                     var html = function () {
                         switch (type) {
                             case 'miniprogram':
-                                var tpl = '<div><div>小程序APPID<input style="display:block;margin-bottom:10px" class="form-control input-sm" value="{appid}" name="appid"/></div>Pagepath<textarea style="resize:none;height:180px;" name="pagepath" class="form-control input-sm">{content}</textarea></div>';
+                                var tpl = '<div><div>小程序APPID<input style="display:block;margin-bottom:10px" class="form-control input-sm" value="{appid}" name="appid"/></div>Pagepath<textarea style="resize:none;height:165px;" name="pagepath" class="form-control input-sm">{content}</textarea></div>';
                                 var _appid = '', _content = '';
                                 if (content.indexOf(',') > 0) {
                                     _appid = content.split(',')[0];