message.php 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. <?php
  2. /*
  3. |--------------------------------------------------------------------------
  4. | home
  5. |--------------------------------------------------------------------------
  6. */
  7. $view
  8. # 初始化几个js变量
  9. ->fetch(array('script', 0), 'var config={};config.host="'.Dever::url('').'";config.type="<{Dever\Routing\Uri::$type}>";config.current="<{Dever::url()}>";config.upload="<{Dever::$global.host.upload}>";config.assets="<{Dever::$global.host.core}>";')
  10. ->loop
  11. (
  12. '.ds-comments',
  13. 'weixin/chat.usermsg',
  14. array
  15. (
  16. '.ds-avatar' => array
  17. (
  18. 'a|0' => array
  19. (
  20. 'title' => '<{$v.name}>',
  21. ),
  22. 'img|0' => array
  23. (
  24. 'src' => '<{$v.avatar}>',
  25. 'alt' => '<{$v.name}>',
  26. ),
  27. ),
  28. '.ds-comment-body' => array
  29. (
  30. 'a|0' => array
  31. (
  32. 'html' => '<{$v.name}>',
  33. ),
  34. 'p|0' => array
  35. (
  36. 'html' => '<{$v.content}>',
  37. ),
  38. '.ds-time' => array
  39. (
  40. 'html' => '[<{$v.type}>] <{$v.time}>',
  41. ),
  42. ),
  43. '#ds-ctx' => array
  44. (
  45. 'li' => array
  46. (
  47. # 数据处理
  48. '{data}' => '$v.child',
  49. '.ds-avatar' => array
  50. (
  51. 'a|0' => array
  52. (
  53. 'title' => '<{$vi.name}>',
  54. ),
  55. 'img|0' => array
  56. (
  57. 'src' => '<{$vi.avatar}>',
  58. 'alt' => '<{$vi.name}>',
  59. ),
  60. ),
  61. '.ds-ctx-body' => array
  62. (
  63. 'a|0' => array
  64. (
  65. 'html' => '<{$vi.name}>',
  66. ),
  67. '.ds-ctx-content' => array
  68. (
  69. 'html' => '<{$vi.info}>',
  70. ),
  71. '.ds-time' => array
  72. (
  73. 'html' => '<{$vi.time}> [<{$vi.status}>]',
  74. ),
  75. ),
  76. ),
  77. ),
  78. )
  79. )
  80. ->fetch('#account', 'weixin/chat.info#account')
  81. ->fetch('#user', '<{Dever::total("current")}>')
  82. ->fetch('#id@value', 'weixin/chat.info#id')
  83. # 分页
  84. ->fetch('#page','<{Dever::page("current")}>')
  85. ->fetch('.ds-replybox img@src', 'weixin/chat.info#avatar')
  86. ->fetch('.ds-replybox img@alt', 'weixin/chat.info#name')
  87. # 定义尾部
  88. ->fetch('#footer', '<{Dever::$global["base"]["copyright"]}>')
  89. # display
  90. ->display();