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.

44 lines
1.7 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. res.DATA.files = res.DATA.files.sort(function (a, b) {
  15. return a.OrderByValue > b.OrderByValue ? 1 : -1;
  16. })
  17. var oRes = res.DATA.rel[0] || {},
  18. saPhotos = res.DATA.files,
  19. sHtml = $('#temp_photo').render(saPhotos || []);
  20. $('#Title').html(oRes.News_Title).attr('class','orange');
  21. $('#Content').html(oRes.News_Content);
  22. $('.gallery').html(sHtml + '<p class="clear"></p>');
  23. $(".rectThumb").imgLiquid({ fill: true });
  24. }
  25. });
  26. },
  27. init = function () {
  28. var myHelpers = {
  29. setFilePath: function (val) {
  30. val = val || '';
  31. //return 'http://localhost:3466' + '/' + val.replace(/\\/g, "\/");
  32. return gServerUrl + '/' + val.replace(/\\/g, "\/");
  33. },
  34. setFileName: function (val) {
  35. val = val || '';
  36. return val.split('.')[0] || '';
  37. }
  38. };
  39. $.views.helpers(myHelpers);
  40. fnGetNewsTop();
  41. };
  42. init();
  43. });