JSON字符串转JSON对象


Posted in Javascript onJuly 31, 2015

适用酒店O2O菜单

var stri = [
    //会员中心
    { "menucode": 1, "menuname": "会员中心", },
    { "menucode": 1, "name": "会员查询", "perm_id": 1, SubsMenu: [{ "perm_id": 1, "menueurl": "Customer/Index", "menuename": "会员查询" }] },
  { "menucode": 1, "name": "签到送积分", "perm_id": 4, SubsMenu: [{ "perm_id": 4, "menueurl": "IntegralPoints/set", "menuename": "签到送积分" }] },
  { "menucode": 1, "name": "会员等级设置", "perm_id": 5, SubsMenu: [{ "perm_id": 5, "menueurl": "Level/set", "menuename": "会员等级设置" }] },
  { "menucode": 1, "name": "储值管理", "perm_id": 9, SubsMenu: [{ "perm_id": 9, "menueurl": "StoredPackages/List", "menuename": "储值管理" }] },
  { "menucode": 1, "name": "会员俱乐部", "perm_id": 60, SubsMenu: [{ "perm_id": 60, "menueurl": "Hotel/HeikahuiIntroduce", "menuename": "会员俱乐部" }] },
    //订单中心
    { "menucode": 2, "menuname": "订单中心", },
    { "menucode": 2, "name": "客房订单", "perm_id": 10, SubsMenu: [{ "perm_id": 10, "menueurl": "Order/Index", "menuename": "客房订单" }] },
  { "menucode": 2, "name": "餐饮订单", "perm_id": 11, SubsMenu: [{ "perm_id": 11, "menueurl": "Order/Index", "menuename": "餐饮订单" }] },
  { "menucode": 2, "name": "团购订单", "perm_id": 13, SubsMenu: [{ "perm_id": 13, "menueurl": "OrderGrouponInfo/Index", "menuename": "团购订单" }] },
  { "menucode": 2, "name": "休闲娱乐订单", "perm_id": 15, SubsMenu: [{ "perm_id": 15, "menueurl": "Order/Index", "menuename": "休闲娱乐订单" }] },
  { "menucode": 2, "name": "会议会宴询问", "perm_id": 16, SubsMenu: [{ "perm_id": 16, "menueurl": "ConferenceRoom/AskList", "menuename": "会议会宴询问" }] },
  { "menucode": 2, "name": "备注预选", "perm_id": 17, SubsMenu: [{ "perm_id": 17, "menueurl": "RemarkPreselection/List", "menuename": "备注预选" }] },
  { "menucode": 2, "name": "二维码收款", "perm_id": 61, SubsMenu: [{ "perm_id": 61, "menueurl": "Receivables/Index", "menuename": "二维码收款" }] },
    //客房中心
    { "menucode": 3, "menuname": "客房中心", },
    { "menucode": 3, "name": "客房促销", "perm_id": 18, SubsMenu: [{ "perm_id": 18, "menueurl": "Promotion/List", "menuename": "客房促销" }] },
  { "menucode": 3, "name": "新闻与优惠", "perm_id": 23, SubsMenu: [{ "perm_id": 23, "menueurl": "NewGraphic/Index", "menuename": "客房促销" }] },
  { "menucode": 3, "name": "优惠券", "perm_id": 8, SubsMenu: [{ "perm_id": 8, "menueurl": "Coupon/List", "menuename": "优惠券" }] },
  { "menucode": 3, "name": "优惠券销售", "perm_id": 58, SubsMenu: [{ "perm_id": 58, "menueurl": "CouponSale/List1", "menuename": "优惠券销售" }] },
  { "menucode": 3, "name": "扫码送优惠券", "perm_id": 58, SubsMenu: [{ "perm_id": 58, "menueurl": "Code/ScanCode", "menuename": "扫码送优惠券" }] },
  { "menucode": 3, "name": "积分兑换记录", "perm_id": 3, SubsMenu: [{ "perm_id": 3, "menueurl": "Gift/Handle", "menuename": "积分兑换记录" }] },
  { "menucode": 3, "name": "兑换礼品维护", "perm_id": 2, SubsMenu: [{ "perm_id": 2, "menueurl": "Gift/GiftLIst", "menuename": "兑换礼品维护" }] },
    //微信
    { "menucode": 4, "menuname": "微信", },
    { "menucode": 4, "name": "微信客服", "perm_id": 24, SubsMenu: [{ "perm_id": 24, "menueurl": "Admin/Index", "menuename": "微信客服" }] },
  { "menucode": 4, "name": "微信粉丝分组", "perm_id": 24, SubsMenu: [{ "perm_id": 24, "menueurl": "CustomGroup/Index", "menuename": "微信粉丝分组" }] },
  { "menucode": 4, "name": "微信二维码", "perm_id": 25, SubsMenu: [{ "perm_id": 25, "menueurl": "Code/Index", "menuename": "微信二维码" }] },
  { "menucode": 4, "name": "微信自动回复", "perm_id": 27, SubsMenu: [{ "perm_id": 27, "menueurl": "KeyForHotel/Index", "menuename": "微信自动回复" }] },
  { "menucode": 4, "name": "微信菜单", "perm_id": 28, SubsMenu: [{ "perm_id": 28, "menueurl": "Menu/Index", "menuename": "微信菜单" }] },
  { "menucode": 4, "name": "微信消息", "perm_id": 29, SubsMenu: [{ "perm_id": 29, "menueurl": "Message/Index", "menuename": "微信消息" }] },
  { "menucode": 4, "name": "微信关注设置", "perm_id": 22, SubsMenu: [{ "perm_id": 22, "menueurl": "FirstConcern/Index", "menuename": "微信关注设置" }] },
    //高级功能
    { "menucode": 5, "menuname": "高级功能", },
    { "menucode": 5, "name": "游戏设置", "perm_id": 30, SubsMenu: [{ "perm_id": 30, "menueurl": "Games/GameNew", "menuename": "游戏设置" }] },
  { "menucode": 5, "name": "微上墙", "perm_id": 31, SubsMenu: [{ "perm_id": 31, "menueurl": "WeChatWall/Index", "menuename": "微上墙" }] },
  { "menucode": 5, "name": "酒店团购", "perm_id": 32, SubsMenu: [{ "perm_id": 32, "menueurl": "HotelGroupon/Index", "menuename": "酒店团购" }] },
  { "menucode": 5, "name": "微请帖", "perm_id": 33, SubsMenu: [{ "perm_id": 33, "menueurl": "WeInvitation/Index", "menuename": "微请帖" }] },
  { "menucode": 5, "name": "投票调查", "perm_id": 19, SubsMenu: [{ "perm_id": 19, "menueurl": "Vote/Index", "menuename": "投票调查" }] },
  { "menucode": 5, "name": "调查问卷", "perm_id": 20, SubsMenu: [{ "perm_id": 20, "menueurl": "Survey/Index", "menuename": "调查问卷" }] },
  { "menucode": 5, "name": "分享", "perm_id": 66, SubsMenu: [{ "perm_id": 66, "menueurl": "Vote/ShareVote", "menuename": "调查问卷" }] },
    //酒店中心
    { "menucode": 6, "menuname": "酒店中心", },
  { "menucode": 6, "name": "酒店信息", "perm_id": 34, SubsMenu: [{ "perm_id": 34, "menueurl": "Hotel/HotelMessage", "menuename": "酒店信息" }] },
  { "menucode": 6, "name": "酒店介绍", "perm_id": 62, SubsMenu: [{ "perm_id": 62, "menueurl": "Hotel/HotelIntroduce", "menuename": "酒店介绍" }] },
  { "menucode": 6, "name": "酒店设施", "perm_id": 41, SubsMenu: [{ "perm_id": 41, "menueurl": "Hotel/HotelFacilities", "menuename": "酒店设施" }] },
  { "menucode": 6, "name": "酒店图片上传", "perm_id": 35, SubsMenu: [{ "perm_id": 35, "menueurl": "HotelImg_Add/Hotel", "menuename": "酒店图片上传" }] },
  { "menucode": 6, "name": "客房信息", "perm_id": 36, SubsMenu: [{ "perm_id": 36, "menueurl": "House/List", "menuename": "客房信息" }] },
  { "menucode": 6, "name": "客房价格日历", "perm_id": 37, SubsMenu: [{ "perm_id": 37, "menueurl": "RoomCalendaPrice/Index", "menuename": "客房价格日历" }] },
  { "menucode": 6, "name": "餐厅信息", "perm_id": 38, SubsMenu: [{ "perm_id": 38, "menueurl": "Restaurant/List", "menuename": "餐厅信息" }] },
  { "menucode": 6, "name": "休闲娱乐", "perm_id": 39, SubsMenu: [{ "perm_id": 39, "menueurl": "Entertainment/List", "menuename": "休闲娱乐" }] },
  { "menucode": 6, "name": "会议宴会", "perm_id": 40, SubsMenu: [{ "perm_id": 40, "menueurl": "ConferenceRoom/List", "menuename": "会议宴会" }] },
  { "menucode": 6, "name": "周边指南", "perm_id": 42, SubsMenu: [{ "perm_id": 42, "menueurl": "HotelRegional/List", "menuename": "周边指南" }] },
  { "menucode": 6, "name": "酒店WiFi", "perm_id": 43, SubsMenu: [{ "perm_id": 43, "menueurl": "WifiManager/Index", "menuename": "酒店WiFi" }] },
  { "menucode": 6, "name": "问答", "perm_id": 6, SubsMenu: [{ "perm_id": 6, "menueurl": "Ask/List", "menuename": "问答" }] },
  { "menucode": 6, "name": "留言板/建议", "perm_id": 7, SubsMenu: [{ "perm_id": 7, "menueurl": "Messages/List", "menuename": "留言板/建议" }] },
    //数据分析
    { "menucode": 7, "menuname": "数据分析", },
    { "menucode": 7, "name": "订单统计分析", "perm_id": 67, SubsMenu: [{ "perm_id": 67, "menueurl": "Report/OrderSummary", "menuename": "订单统计分析" }] },
  { "menucode": 7, "name": "餐饮订单分析", "perm_id": 65, SubsMenu: [{ "perm_id": 65, "menueurl": "Report/RestaurantOrder", "menuename": "餐饮订单分析" }] },
  { "menucode": 7, "name": "订单支付统计", "perm_id": 68, SubsMenu: [{ "perm_id": 68, "menueurl": "Report/OrderPaySummary", "menuename": "订单支付统计" }] },
  { "menucode": 7, "name": "扫码支付统计", "perm_id": 69, SubsMenu: [{ "perm_id": 69, "menueurl": "Report/ScanCodePaySummary", "menuename": "扫码支付统计" }] },
  { "menucode": 7, "name": "现金账户统计", "perm_id": 70, SubsMenu: [{ "perm_id": 70, "menueurl": "Report/CashAccountSummary", "menuename": "现金账户统计" }] },
  { "menucode": 7, "name": "优惠券使用统计", "perm_id": 71, SubsMenu: [{ "perm_id": 71, "menueurl": "Report/CouponUseSummary", "menuename": "优惠券使用统计" }] },
  { "menucode": 7, "name": "积分统计", "perm_id": 72, SubsMenu: [{ "perm_id": 72, "menueurl": "Report/PointsSummary", "menuename": "积分统计" }] },
    //财务对账
    { "menucode": 9, "menuname": "财务对账", },
    { "menucode": 9, "name": "对账单查询", "perm_id": 57, SubsMenu: [{ "perm_id": 57, "menueurl": "PayAccountStateMent/Index", "menuename": "对账单查询" }] },
    //系统设置
    { "menucode": 8, "name": "系统设置", },
    { "menucode": 8, "name": "管理员管理", "perm_id": 51, SubsMenu: [{ "perm_id": 51, "menueurl": "SystemSet/UserManage", "menuename": "管理员管理" }] },
  { "menucode": 8, "name": "密码更改", "perm_id": 52, SubsMenu: [{ "perm_id": 52, "menueurl": "SystemSet/PassWordChange", "menuename": "密码更改" }] },
  { "menucode": 8, "name": "系统通知设置", "perm_id": 53, SubsMenu: [{ "perm_id": 53, "menueurl": "NotifySetting/Index", "menuename": "系统通知设置" }] },
  { "menucode": 8, "name": "订单确认设置", "perm_id": 73, SubsMenu: [{ "perm_id": 73, "menueurl": "OrderConfirm/Index", "menuename": "订单确认设置" }] },
  { "menucode": 8, "name": "酒店常用设置", "perm_id": 54, SubsMenu: [{ "perm_id": 54, "menueurl": "CommonTools/Index", "menuename": "酒店常用设置" }] },
  { "menucode": 8, "name": "积分抵扣", "perm_id": 54, SubsMenu: [{ "perm_id": 54, "menueurl": "PointDiscount/Index", "menuename": "积分抵扣" }] },
  { "menucode": 8, "name": "酒店模板设置", "perm_id": 63, SubsMenu: [{ "perm_id": 63, "menueurl": "SettingHotelTheme/Hotel", "menuename": "酒店模板设置" }] },
  { "menucode": 8, "name": "酒店排序", "perm_id": 64, SubsMenu: [{ "perm_id": 63, "menueurl": "HotelIndex/Index", "menuename": "酒店排序" }] },
  { "menucode": 8, "name": "语音提示", "perm_id": 55, SubsMenu: [{ "perm_id": 63, "menueurl": "VoiceUpLoad/Index", "menuename": "语音提示" }] }
  ]
  var myE = eval(stri);
  $(document).ready(function () {
    Menue('@dealer.clding.com.Utility.LoginInfo.PermIDs');
  });
  function Menue(perids) {
    $.each(myE, function (key, value) {
      $('.dl1').append("<dt class=\"dt1\" style=\"cursor: pointer;\" onclick=\"menuShow(this)\" menucode=\"" + myE[key].menucode + "\"><span>" + myE[key].menuname + "</span><i class=\"i02\"></i></dt>");
      //<dd class=\"dd1\"><a href=" + myE[key].menueurl + ">" + myE[key].menuname + "\"</a></dd>"
      alert(myE[key].menuname);
    });

以上所述就是本文的全部内容了,希望大家能够喜欢。

Javascript 相关文章推荐
JS array 数组详解
Mar 22 Javascript
js下获得客户端操作系统的函数代码(1:vista,2:windows7,3:2000,4:xp,5:2003,6:2008)
Oct 31 Javascript
原生JS操作网页给p元素添加onclick事件及表格隔行变色
Dec 01 Javascript
JavaScript开发者必备的10个Sublime Text插件
Feb 27 Javascript
vue-router实现组件间的跳转(参数传递)
Nov 07 Javascript
element 结合vue 在表单验证时有值却提示错误的解决办法
Jan 22 Javascript
详解React开发必不可少的eslint配置
Feb 05 Javascript
浅谈使用mpvue开发小程序需要注意和了解的知识点
May 23 Javascript
node跨域转发 express+http-proxy-middleware的使用
May 31 Javascript
解决vue的 v-for 循环中图片加载路径问题
Sep 03 Javascript
tracking.js页面人脸识别插件使用方法
Apr 16 Javascript
JS前端使用canvas实现物体的点选示例
Aug 05 Javascript
javascript实现简单的页面右下角提示信息框
Jul 31 #Javascript
JavaScript实现快速排序的方法
Jul 31 #Javascript
javascript常用正则表达式汇总
Jul 31 #Javascript
轻量级网页遮罩层jQuery插件用法实例
Jul 31 #Javascript
js实时获取并显示当前时间的方法
Jul 31 #Javascript
Javascript实现的Map集合工具类完整实例
Jul 31 #Javascript
JS特效实现图片自动播放并可控的效果
Jul 31 #Javascript
You might like
解析PHP可变函数的经典用法
2013/06/20 PHP
php提交表单发送邮件的方法
2015/03/20 PHP
PHP连接MySQL进行增、删、改、查操作
2017/02/19 PHP
一个加密JavaScript的开源工具PACKER2.0.2
2006/11/04 Javascript
动态样式类封装JS代码
2009/09/02 Javascript
Array.prototype.slice 使用扩展
2010/06/09 Javascript
基于jquery的让textarea自适应高度的插件
2010/08/03 Javascript
jquery 学习之二 属性相关
2010/11/23 Javascript
javascript for循环从入门到偏门(效率优化+奇特用法)
2012/08/01 Javascript
JavaScript中把数字转换为字符串的程序代码
2013/06/19 Javascript
jquery.idTabs 选项卡使用示例代码
2014/09/03 Javascript
Angular directive递归实现目录树结构代码实例
2017/05/05 Javascript
js实现数字递增特效【仿支付宝我的财富】
2017/05/05 Javascript
jquery实现下拉菜单的手风琴效果
2017/07/23 jQuery
深入理解vue.js中$watch的oldvalue与newValue
2017/08/07 Javascript
详解webpack + react + react-router 如何实现懒加载
2017/11/20 Javascript
详解小程序退出页面时清除定时器
2019/04/28 Javascript
ES6 async、await的基本使用方法示例
2020/06/06 Javascript
[01:43]3.19DOTA2发布会 三代刀塔人第三代
2014/03/25 DOTA
[01:23]一分钟告诉你 DOTA2为什么叫信仰2
2014/06/20 DOTA
[56:45]DOTA2上海特级锦标赛D组小组赛#1 EG VS COL第一局
2016/02/28 DOTA
[04:14]从西雅图到上海——玩家自制DOTA2主题歌曲应援TI9
2019/07/11 DOTA
python列出目录下指定文件与子目录的方法
2015/07/03 Python
详解Python3 中hasattr()、getattr()、setattr()、delattr()函数及示例代码数
2018/04/18 Python
python使用numpy读取、保存txt数据的实例
2018/10/14 Python
详解Python的爬虫框架 Scrapy
2020/08/03 Python
手把手教你用纯css3实现轮播图效果实例
2017/05/04 HTML / CSS
英国家电直销:Appliances Direct
2016/09/22 全球购物
德国购买健身器材:AsVIVA
2017/08/09 全球购物
怎样写好创业计划书的内容
2014/02/06 职场文书
公司副总经理任命书
2014/06/05 职场文书
考研英语复习计划
2015/01/19 职场文书
学生会个人总结范文
2015/02/15 职场文书
2015年小学教科研工作总结
2015/07/20 职场文书
导游词之上饶龟峰
2019/10/25 职场文书
详解Spring Boot使用系统参数表提升系统的灵活性
2021/06/30 Java/Android