_ScenePath.cshtml 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. @using WeOnlineApp.Helpers
  2. @model WeOnlineApp.Models.Play.CampPlayModel
  3. @{
  4. string id = "scene-path";
  5. }
  6. <style>
  7. .path-box {
  8. max-width: 800px;
  9. margin: 0 auto;
  10. }
  11. .path-box .round-box {
  12. --fs: 12px;
  13. --pt: 3px;
  14. --minW: 70px;
  15. }
  16. .path-box .round-box.start {
  17. --color: var(--mc);
  18. }
  19. .path-box .round-box.end {
  20. --color: #ff7c63
  21. }
  22. </style>
  23. @Html.Partial("_Run/_AreaBox", $"情景路径#{id}")
  24. @using (Html.BeginScripts())
  25. {
  26. <script src="~/Content/Js/scene-path.js"></script>
  27. <script id="path-script">
  28. var $scenePathBody = $('#@id .box-body');
  29. function ScenePath() {
  30. $.iwbAjax5({
  31. url: abp.appUrl + 'Query/GetPlayRunningInfo?no=@(Model.Play.Id)',
  32. success: function(res) {
  33. var str = FormatterSingleScenePath(res);
  34. $scenePathBody.html(str);
  35. window.Scroll2Bottom($scenePathBody.closest('.scroll-box'));
  36. }
  37. });
  38. }
  39. iwbHub.client.getRunningChange = function(msg) {
  40. console.log('getRunningChange: ', msg);
  41. if (msg) {
  42. try {
  43. var data = JSON.parse(msg);
  44. if (data) {
  45. ScenePath();
  46. }
  47. } catch (e) {
  48. console.log('getRunningChange: ', e);
  49. }
  50. }
  51. };
  52. </script>
  53. }