SoFunction
Updated on 2025-04-03

JSON string to JSON object

Applicable hotel O2O menu

var stri = [
    //Member Center    { "menucode": 1, "menuname": "Member Center", },
    { "menucode": 1, "name": "Member Query", "perm_id": 1, SubsMenu: [{ "perm_id": 1, "menueurl": "Customer/Index", "menuename": "Member Query" }] },
  { "menucode": 1, "name": "Sign in and get points", "perm_id": 4, SubsMenu: [{ "perm_id": 4, "menueurl": "IntegralPoints/set", "menuename": "Sign in and get points" }] },
  { "menucode": 1, "name": "Member level settings", "perm_id": 5, SubsMenu: [{ "perm_id": 5, "menueurl": "Level/set", "menuename": "Member level settings" }] },
  { "menucode": 1, "name": "Stored Value Management", "perm_id": 9, SubsMenu: [{ "perm_id": 9, "menueurl": "StoredPackages/List", "menuename": "Stored Value Management" }] },
  { "menucode": 1, "name": "Member Club", "perm_id": 60, SubsMenu: [{ "perm_id": 60, "menueurl": "Hotel/HeikahuiIntroduce", "menuename": "Member Club" }] },
    //Order Center    { "menucode": 2, "menuname": "Order Center", },
    { "menucode": 2, "name": "Room Order", "perm_id": 10, SubsMenu: [{ "perm_id": 10, "menueurl": "Order/Index", "menuename": "Room Order" }] },
  { "menucode": 2, "name": "Cooking Order", "perm_id": 11, SubsMenu: [{ "perm_id": 11, "menueurl": "Order/Index", "menuename": "Cooking Order" }] },
  { "menucode": 2, "name": "Group Purchase Order", "perm_id": 13, SubsMenu: [{ "perm_id": 13, "menueurl": "OrderGrouponInfo/Index", "menuename": "Group Purchase Order" }] },
  { "menucode": 2, "name": "Caring Order", "perm_id": 15, SubsMenu: [{ "perm_id": 15, "menueurl": "Order/Index", "menuename": "Caring Order" }] },
  { "menucode": 2, "name": "Conference Banquet Inquiry", "perm_id": 16, SubsMenu: [{ "perm_id": 16, "menueurl": "ConferenceRoom/AskList", "menuename": "Conference Banquet Inquiry" }] },
  { "menucode": 2, "name": "Remarks Pre-selected", "perm_id": 17, SubsMenu: [{ "perm_id": 17, "menueurl": "RemarkPreselection/List", "menuename": "Remarks Pre-selected" }] },
  { "menucode": 2, "name": "QR code collection", "perm_id": 61, SubsMenu: [{ "perm_id": 61, "menueurl": "Receivables/Index", "menuename": "QR code collection" }] },
    // Room Center    { "menucode": 3, "menuname": "Room Center", },
    { "menucode": 3, "name": "Room Promotion", "perm_id": 18, SubsMenu: [{ "perm_id": 18, "menueurl": "Promotion/List", "menuename": "Room Promotion" }] },
  { "menucode": 3, "name": "News and Offers", "perm_id": 23, SubsMenu: [{ "perm_id": 23, "menueurl": "NewGraphic/Index", "menuename": "Room Promotion" }] },
  { "menucode": 3, "name": "Coupon", "perm_id": 8, SubsMenu: [{ "perm_id": 8, "menueurl": "Coupon/List", "menuename": "Coupon" }] },
  { "menucode": 3, "name": "Coupon Sales", "perm_id": 58, SubsMenu: [{ "perm_id": 58, "menueurl": "CouponSale/List1", "menuename": "Coupon Sales" }] },
  { "menucode": 3, "name": "Scan the QR code to get coupons", "perm_id": 58, SubsMenu: [{ "perm_id": 58, "menueurl": "Code/ScanCode", "menuename": "Scan the QR code to get coupons" }] },
  { "menucode": 3, "name": "Points redemption record", "perm_id": 3, SubsMenu: [{ "perm_id": 3, "menueurl": "Gift/Handle", "menuename": "Points redemption record" }] },
  { "menucode": 3, "name": "Rendering for gift maintenance", "perm_id": 2, SubsMenu: [{ "perm_id": 2, "menueurl": "Gift/GiftLIst", "menuename": "Rendering for gift maintenance" }] },
    //WeChat    { "menucode": 4, "menuname": "WeChat", },
    { "menucode": 4, "name": "WeChat Customer Service", "perm_id": 24, SubsMenu: [{ "perm_id": 24, "menueurl": "Admin/Index", "menuename": "WeChat Customer Service" }] },
  { "menucode": 4, "name": "WeChat Fan Group", "perm_id": 24, SubsMenu: [{ "perm_id": 24, "menueurl": "CustomGroup/Index", "menuename": "WeChat Fan Group" }] },
  { "menucode": 4, "name": "WeChat QR Code", "perm_id": 25, SubsMenu: [{ "perm_id": 25, "menueurl": "Code/Index", "menuename": "WeChat QR Code" }] },
  { "menucode": 4, "name": "WeChat's automatic reply", "perm_id": 27, SubsMenu: [{ "perm_id": 27, "menueurl": "KeyForHotel/Index", "menuename": "WeChat's automatic reply" }] },
  { "menucode": 4, "name": "WeChat Menu", "perm_id": 28, SubsMenu: [{ "perm_id": 28, "menueurl": "Menu/Index", "menuename": "WeChat Menu" }] },
  { "menucode": 4, "name": "WeChat Message", "perm_id": 29, SubsMenu: [{ "perm_id": 29, "menueurl": "Message/Index", "menuename": "WeChat Message" }] },
  { "menucode": 4, "name": "WeChat Follow Settings", "perm_id": 22, SubsMenu: [{ "perm_id": 22, "menueurl": "FirstConcern/Index", "menuename": "WeChat Follow Settings" }] },
    //Advanced Features    { "menucode": 5, "menuname": "Advanced Features", },
    { "menucode": 5, "name": "Game Settings", "perm_id": 30, SubsMenu: [{ "perm_id": 30, "menueurl": "Games/GameNew", "menuename": "Game Settings" }] },
  { "menucode": 5, "name": "Micro-on-the-wall", "perm_id": 31, SubsMenu: [{ "perm_id": 31, "menueurl": "WeChatWall/Index", "menuename": "Micro-on-the-wall" }] },
  { "menucode": 5, "name": "Hotel Group Purchase", "perm_id": 32, SubsMenu: [{ "perm_id": 32, "menueurl": "HotelGroupon/Index", "menuename": "Hotel Group Purchase" }] },
  { "menucode": 5, "name": "Micro Invitation", "perm_id": 33, SubsMenu: [{ "perm_id": 33, "menueurl": "WeInvitation/Index", "menuename": "Micro Invitation" }] },
  { "menucode": 5, "name": "Voting Investigation", "perm_id": 19, SubsMenu: [{ "perm_id": 19, "menueurl": "Vote/Index", "menuename": "Voting Investigation" }] },
  { "menucode": 5, "name": "Query", "perm_id": 20, SubsMenu: [{ "perm_id": 20, "menueurl": "Survey/Index", "menuename": "Query" }] },
  { "menucode": 5, "name": "share", "perm_id": 66, SubsMenu: [{ "perm_id": 66, "menueurl": "Vote/ShareVote", "menuename": "Query" }] },
    //Hotel Center    { "menucode": 6, "menuname": "Hotel Center", },
  { "menucode": 6, "name": "Hotel Information", "perm_id": 34, SubsMenu: [{ "perm_id": 34, "menueurl": "Hotel/HotelMessage", "menuename": "Hotel Information" }] },
  { "menucode": 6, "name": "Hotel Introduction", "perm_id": 62, SubsMenu: [{ "perm_id": 62, "menueurl": "Hotel/HotelIntroduce", "menuename": "Hotel Introduction" }] },
  { "menucode": 6, "name": "Hotel Facilities", "perm_id": 41, SubsMenu: [{ "perm_id": 41, "menueurl": "Hotel/HotelFacilities", "menuename": "Hotel Facilities" }] },
  { "menucode": 6, "name": "Hotel Picture Upload", "perm_id": 35, SubsMenu: [{ "perm_id": 35, "menueurl": "HotelImg_Add/Hotel", "menuename": "Hotel Picture Upload" }] },
  { "menucode": 6, "name": "Room Information", "perm_id": 36, SubsMenu: [{ "perm_id": 36, "menueurl": "House/List", "menuename": "Room Information" }] },
  { "menucode": 6, "name": "Rest Calendar for Rooms", "perm_id": 37, SubsMenu: [{ "perm_id": 37, "menueurl": "RoomCalendaPrice/Index", "menuename": "Rest Calendar for Rooms" }] },
  { "menucode": 6, "name": "Restaurant Information", "perm_id": 38, SubsMenu: [{ "perm_id": 38, "menueurl": "Restaurant/List", "menuename": "Restaurant Information" }] },
  { "menucode": 6, "name": "Lucky and entertainment", "perm_id": 39, SubsMenu: [{ "perm_id": 39, "menueurl": "Entertainment/List", "menuename": "Lucky and entertainment" }] },
  { "menucode": 6, "name": "Conference Banquet", "perm_id": 40, SubsMenu: [{ "perm_id": 40, "menueurl": "ConferenceRoom/List", "menuename": "Conference Banquet" }] },
  { "menucode": 6, "name": "Peripheral Guide", "perm_id": 42, SubsMenu: [{ "perm_id": 42, "menueurl": "HotelRegional/List", "menuename": "Peripheral Guide" }] },
  { "menucode": 6, "name": "Hotel WiFi", "perm_id": 43, SubsMenu: [{ "perm_id": 43, "menueurl": "WifiManager/Index", "menuename": "Hotel WiFi" }] },
  { "menucode": 6, "name": "Q&A", "perm_id": 6, SubsMenu: [{ "perm_id": 6, "menueurl": "Ask/List", "menuename": "Q&A" }] },
  { "menucode": 6, "name": "Message Board/Suggestions", "perm_id": 7, SubsMenu: [{ "perm_id": 7, "menueurl": "Messages/List", "menuename": "Message Board/Suggestions" }] },
    //Data analysis    { "menucode": 7, "menuname": "Data Analysis", },
    { "menucode": 7, "name": "Order Statistical Analysis", "perm_id": 67, SubsMenu: [{ "perm_id": 67, "menueurl": "Report/OrderSummary", "menuename": "Order Statistical Analysis" }] },
  { "menucode": 7, "name": "Cooking Order Analysis", "perm_id": 65, SubsMenu: [{ "perm_id": 65, "menueurl": "Report/RestaurantOrder", "menuename": "Cooking Order Analysis" }] },
  { "menucode": 7, "name": "Order Payment Statistics", "perm_id": 68, SubsMenu: [{ "perm_id": 68, "menueurl": "Report/OrderPaySummary", "menuename": "Order Payment Statistics" }] },
  { "menucode": 7, "name": "Scan the QR code to pay statistics", "perm_id": 69, SubsMenu: [{ "perm_id": 69, "menueurl": "Report/ScanCodePaySummary", "menuename": "Scan the QR code to pay statistics" }] },
  { "menucode": 7, "name": "Cash Account Statistics", "perm_id": 70, SubsMenu: [{ "perm_id": 70, "menueurl": "Report/CashAccountSummary", "menuename": "Cash Account Statistics" }] },
  { "menucode": 7, "name": "Coupon usage statistics", "perm_id": 71, SubsMenu: [{ "perm_id": 71, "menueurl": "Report/CouponUseSummary", "menuename": "Coupon usage statistics" }] },
  { "menucode": 7, "name": "Point Statistics", "perm_id": 72, SubsMenu: [{ "perm_id": 72, "menueurl": "Report/PointsSummary", "menuename": "Point Statistics" }] },
    //Financial reconciliation    { "menucode": 9, "menuname": "Financial Reconciliation", },
    { "menucode": 9, "name": "Search for Statement", "perm_id": 57, SubsMenu: [{ "perm_id": 57, "menueurl": "PayAccountStateMent/Index", "menuename": "Search for Statement" }] },
    //System settings    { "menucode": 8, "name": "System Settings", },
    { "menucode": 8, "name": "Administrator Management", "perm_id": 51, SubsMenu: [{ "perm_id": 51, "menueurl": "SystemSet/UserManage", "menuename": "Administrator Management" }] },
  { "menucode": 8, "name": "Password Change", "perm_id": 52, SubsMenu: [{ "perm_id": 52, "menueurl": "SystemSet/PassWordChange", "menuename": "Password Change" }] },
  { "menucode": 8, "name": "System Notification Settings", "perm_id": 53, SubsMenu: [{ "perm_id": 53, "menueurl": "NotifySetting/Index", "menuename": "System Notification Settings" }] },
  { "menucode": 8, "name": "Order Confirmation Settings", "perm_id": 73, SubsMenu: [{ "perm_id": 73, "menueurl": "OrderConfirm/Index", "menuename": "Order Confirmation Settings" }] },
  { "menucode": 8, "name": "Frequently used hotel settings", "perm_id": 54, SubsMenu: [{ "perm_id": 54, "menueurl": "CommonTools/Index", "menuename": "Frequently used hotel settings" }] },
  { "menucode": 8, "name": "Points Deduction", "perm_id": 54, SubsMenu: [{ "perm_id": 54, "menueurl": "PointDiscount/Index", "menuename": "Points Deduction" }] },
  { "menucode": 8, "name": "Hotel Template Settings", "perm_id": 63, SubsMenu: [{ "perm_id": 63, "menueurl": "SettingHotelTheme/Hotel", "menuename": "Hotel Template Settings" }] },
  { "menucode": 8, "name": "Hotel Sort", "perm_id": 64, SubsMenu: [{ "perm_id": 63, "menueurl": "HotelIndex/Index", "menuename": "Hotel Sort" }] },
  { "menucode": 8, "name": "Voice prompt", "perm_id": 55, SubsMenu: [{ "perm_id": 63, "menueurl": "VoiceUpLoad/Index", "menuename": "Voice prompt" }] }
  ]
  var myE = eval(stri);
  $(document).ready(function () {
    Menue('@');
  });
  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);
    });

The above is the entire content of this article, I hope you like it.