theme.html 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. {extend name="default/base/base_seller" /}
  2. {block name="seller_main"}
  3. <div class="dssc-store-templet">
  4. <dl class="current-style">
  5. <dt class="templet-thumb"><img src="{$curr_theme.curr_image}" id="current_theme_img" /></dt>
  6. <dd>{$Think.lang.store_theme_tpl_name}{$Think.lang.ds_colon}<strong id="current_template">{$curr_theme.curr_name}</strong></dd>
  7. <dd>{$Think.lang.store_theme_style_name}{$Think.lang.ds_colon}<strong id="current_style">{$curr_theme.curr_truename}</strong></dd>
  8. <dd>{$Think.lang.store_create_store_name}{$Think.lang.ds_colon}<strong>{$store_info.store_name}</strong></dd>
  9. <dd><a href="{:url('Store/index',['store_id'=>$store_info.store_id])}" class="dssc-btn">{$Think.lang.store_theme_homepage}</a></dd>
  10. </dl>
  11. <h3>{$Think.lang.store_theme_valid}</h3>
  12. <div class="templet-list">
  13. <ul>
  14. {foreach name="theme_list" item="theme"}
  15. <li>
  16. <dl>
  17. <dt><a href="javascript:void(0)" onclick="preview_theme('{$theme.name}');"><img id="themeimg_{$theme.name}" src="{$theme.image}"></a></dt>
  18. <dd>{$Think.lang.store_theme_tpl_name1}{$Think.lang.ds_colon}{$theme.name}</dd>
  19. <dd>{$Think.lang.store_theme_style_name1}{$Think.lang.ds_colon}{$theme.truename}</dd>
  20. <dd class="btn"> <a href="javascript:void(0)" onclick=" use_theme('{$theme.name}', '{$theme.truename}');" class="dssc-btn"><i class="iconfont">&#xe734;</i>{$Think.lang.store_theme_use}</a> <a href="javascript:preview_theme('{$theme.name}');" class="dssc-btn"><i class="iconfont">&#xe718;</i>{$Think.lang.store_theme_preview}</a> </dd>
  21. </dl>
  22. </li>
  23. {/foreach}
  24. </ul>
  25. </div>
  26. </div>
  27. <script>
  28. function use_theme(style, truename) {
  29. ds_ajaxget("{:url('Sellersetting/set_theme')}" + '?style_name=' + style);
  30. }
  31. </script>
  32. <script>
  33. var curr_template_name = '{$curr_theme.curr_name}';
  34. var curr_style_name = '{$curr_theme.curr_name}';
  35. var preview_img = new Image();
  36. preview_img.onload = function () {
  37. var d = DialogManager.get('preview_image');
  38. if (!d)
  39. {
  40. return;
  41. }
  42. if (d.getStatus() != 'loading')
  43. {
  44. return;
  45. }
  46. d.setWidth(this.width + 50);
  47. d.setPosition('center');
  48. d.setContents($('<img src="' + this.src + '" alt="" />'));
  49. ScreenLocker.lock();
  50. };
  51. preview_img.onerror = function () {
  52. layer.msg('{$Think.lang.store_theme_load_preview_fail}');
  53. DialogManager.close('preview_image');
  54. };
  55. function preview_theme(style_name) {
  56. var screenshot = '{$Think.BASE_SITE_ROOT}/static/home/default/store/styles/' + style_name + '/screenshot.jpg';
  57. var d = DialogManager.create('preview_image');
  58. d.setTitle('{$Think.lang.store_theme_effect_preview}');
  59. d.setContents('loading', {'text': '{$Think.lang.store_theme_loading1}...'});
  60. d.setWidth(270);
  61. d.show('center');
  62. preview_img.src = screenshot;
  63. }
  64. </script>
  65. {/block}