index.html 4.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <!DOCTYPE HTML>
  2. <html lang="zh-CN">
  3. <head>
  4. <title>Json格式化查看工具</title>
  5. <meta charset="UTF-8">
  6. <link rel="stylesheet" href="index.css" />
  7. <script type="text/javascript" src="../static/vendor/vue/vue.js"></script>
  8. <script src="../static/vendor/require/require.js"></script>
  9. </head>
  10. <body>
  11. <div class="wrapper wp-json" id="pageContainer">
  12. <div class="panel panel-default" style="margin-bottom: 0px;">
  13. <div class="panel-heading">
  14. <h3 class="panel-title">
  15. <a href="http://www.baidufe.com/fehelper/feedback.html" target="_blank" class="x-a-high">
  16. <img src="../static/img/fe-16.png" alt="fehelper"/> FeHelper</a>:JSON格式化查看
  17. <span class="x-xdemo" ref="demoLink1" @click="jsonSource=$refs.demoBox.value">示例1:JSON片段</span>
  18. <a class="x-xdemo" href="https://www.sojson.com/open/api/weather/json.shtml?city=%E5%8C%97%E4%BA%AC" target="_blank">示例2:在线JSON-1</a>
  19. <a class="x-xdemo" href="https://suggest.taobao.com/sug?code=utf-8&q=iphonex&callback=thisIsACallbackFunction" target="_blank">示例3:在线JSON-2</a></h3>
  20. </div>
  21. </div>
  22. <div class="panel-body mod-json">
  23. <div class="row panel-txt">
  24. <textarea class="form-control mod-textarea" id="jsonSource" placeholder="在这里粘贴您需要进行格式化的JSON代码" ref="jsonBox" v-model="jsonSource" @input="format"></textarea>
  25. <div><button id="btnFormat" class="btn btn-primary ui-mt-10" @click="format">格式化</button><span id="errorMsg" v-html="errorMsg"></span></div>
  26. </div>
  27. <div class="row rst-item" id="modJsonResult">
  28. <div id="formattingMsg">
  29. <svg id="spinner" width="16" height="16" viewBox="0 0 300 300" xmlns="http://www.w3.org/2000/svg" version="1.1">
  30. <path d="M 150,0 a 150,150 0 0,1 106.066,256.066 l -35.355,-35.355 a -100,-100 0 0,0 -70.711,-170.711 z" fill="#3d7fe6"></path>
  31. </svg>
  32. 加载中...
  33. </div>
  34. <div id="jfCallbackName_start" class="callback-name">{{jfCallbackName_start}}</div>
  35. <div id="jfContent" v-html="resultContent"></div>
  36. <pre id="jfContent_pre"></pre>
  37. <div id="jfCallbackName_end" class="callback-name">{{jfCallbackName_end}}</div>
  38. </div>
  39. </div>
  40. <textarea name="demo" id="demo" cols="30" rows="10" class="hide" ref="demoBox">{date:"20180322",message:"Success !",status:200,city:"北京",count:632,data:{shidu:"34%",pm25:73,pm10:91,quality:"良",wendu:"5",ganmao:"极少数敏感人群应减少户外活动",yesterday:{date:"21日星期三",sunrise:"06:19",high:"高温 11.0℃",low:"低温 1.0℃",sunset:"18:26",aqi:85,fx:"南风",fl:"<3级",type:"多云",notice:"阴晴之间,谨防紫外线侵扰"},forecast:[{date:"22日星期四",sunrise:"06:17",high:"高温 17.0℃",low:"低温 1.0℃",sunset:"18:27",aqi:98,fx:"西南风",fl:"<3级",type:"晴",notice:"愿你拥有比阳光明媚的心情"},{date:"23日星期五",sunrise:"06:16",high:"高温 18.0℃",low:"低温 5.0℃",sunset:"18:28",aqi:118,fx:"无持续风向",fl:"<3级",type:"多云",notice:"阴晴之间,谨防紫外线侵扰"},{date:"24日星期六",sunrise:"06:14",high:"高温 21.0℃",low:"低温 7.0℃",sunset:"18:29",aqi:52,fx:"西南风",fl:"<3级",type:"晴",notice:"愿你拥有比阳光明媚的心情"},{date:"25日星期日",sunrise:"06:13",high:"高温 22.0℃",low:"低温 7.0℃",sunset:"18:30",aqi:71,fx:"西南风",fl:"<3级",type:"晴",notice:"愿你拥有比阳光明媚的心情"},{date:"26日星期一",sunrise:"06:11",high:"高温 21.0℃",low:"低温 8.0℃",sunset:"18:31",aqi:97,fx:"西南风",fl:"<3级",type:"多云",notice:"阴晴之间,谨防紫外线侵扰"}]}};</textarea>
  41. </div>
  42. <script src="index.js"></script>
  43. </body>
  44. </html>