DIV CSS 佈局教程網

 DIV+CSS佈局教程網 >> 網頁腳本 >> JavaScript入門知識 >> 關於JavaScript >> JSON字符串轉JSON對象
JSON字符串轉JSON對象
編輯:關於JavaScript     

適用酒店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);
    });

以上所述就是本文的全部內容了,希望大家能夠喜歡。

XML學習教程| jQuery入門知識| AJAX入門| Dreamweaver教程| Fireworks入門知識| SEO技巧| SEO優化集錦|
Copyright © DIV+CSS佈局教程網 All Rights Reserved