You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

41 lines
1.4 KiB

2 years ago
  1. $(function () {
  2. 'use strict';
  3. var sLang = $('[http-equiv="content-language"]').attr('content') || 'zh',
  4. sId = getUrlParam('id') || '1',
  5. /*
  6. * 目的 抓去服務花絮前n筆
  7. */
  8. fnGetNewsTop = function () {
  9. return g_api.ConnectLite(Service.apiwebcom, ComFn.GetNewsInfo, {
  10. Id: sId,
  11. IncludeFiles: true
  12. }, function (res) {
  13. if (res.RESULT) {
  14. var oRes = res.DATA.rel[0] || {},
  15. saPhotos = res.DATA.files,
  16. sHtml = $('#temp_photo').render(saPhotos || []);
  17. $('#Title').html(oRes.News_Title);
  18. $('#Content').html(oRes.News_Content);
  19. $('.gallery').html(sHtml + '<p class="clear"></p>');
  20. $(".rectThumb").imgLiquid({ fill: true });
  21. }
  22. });
  23. },
  24. init = function () {
  25. var myHelpers = {
  26. setFilePath: function (val) {
  27. val = val || '';
  28. return gServerUrl + '/' + val.replace(/\\/g, "\/");
  29. },
  30. setFileName: function (val) {
  31. val = val || '';
  32. return val.split('.')[0] || '';
  33. }
  34. };
  35. $.views.helpers(myHelpers);
  36. fnGetNewsTop();
  37. };
  38. init();
  39. });