detail.html 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. {include file="../application/h5/view/wx_book_dinner/header.html"}
  2. <style>
  3. .text-center {
  4. text-align: center;
  5. }
  6. .slide{
  7. position: relative !important;
  8. max-width: auto !important;
  9. overflow: hidden !important;
  10. margin: 0px auto !important;
  11. }
  12. .slide:after{
  13. content: '';
  14. display: block;
  15. width: 100%;
  16. padding-top: 100%;
  17. }
  18. /* img {
  19. display: block !important;
  20. max-width: 100% !important;
  21. height: auto !important;
  22. }*/
  23. .slide li img{
  24. position: absolute;
  25. left: 0;
  26. top: 0;
  27. max-width: 100%;
  28. height: auto;
  29. border: none;
  30. }
  31. .weui_btn:after {
  32. width: 100%;
  33. height: 100%;
  34. }
  35. </style>
  36. <div class="weui-header bg-blue">
  37. <div class="weui-header-left"> <a class="icon icon-109 f-white close-popup close-pop" href="{:url('index')}?t={$t}">返回</a> </div>
  38. <h1 class="weui-header-title">{$info.name}</h1>
  39. <div class="weui-header-right"></div>
  40. </div>
  41. {if $info.imgs}
  42. <div class="slide" id="slide2" style="max-width: 100% !important;">
  43. <ul>
  44. <li>
  45. {foreach $info.imgs as $key => $value}
  46. <a href="#">
  47. <img src="{$value}" data-src="{$value}">
  48. </a>
  49. {/foreach}
  50. </li>
  51. </ul>
  52. <div class="dot">
  53. {foreach $info.imgs as $key => $value}
  54. <span></span>
  55. {/foreach}
  56. </div>
  57. </div>
  58. {else}
  59. {foreach $info.imgs as $key => $value}
  60. <img src="{$value}" data-src="{$value}" alt="" style="display:block;width: 100%;height: auto;"/>
  61. {/foreach}
  62. {/if}
  63. <div class="weui-weixin-page" style="margin-bottom: 50px;">
  64. <h3 class="weui-weixin-title">{$info.name}</h3>
  65. <h5 style="color: #ff0000;">¥{$info.money}</h5>
  66. <div class="weui-weixin-content">
  67. <p>{$info.content}
  68. </div>
  69. <div class="weui-weixin-tools" style="position: fixed;bottom: 0px;right:0px;left:0px;background: #f0f0f0; width: 100%;text-align:center;"><!--工具条-->
  70. <a href="javascript:void(0);" onclick="javascript:addCart_Detail('{$info.id}');return false;" class="weui_btn bg-orange-b weui_btn_inline close-popup close-pop" style="width: 90%;margin-bottom: 5px;">加入购物车</a>
  71. </div>
  72. </div>
  73. <script src="/static/mobile/weui/swipe.js"></script>
  74. <script type="text/javascript">
  75. $('#slide2').swipeSlide({
  76. autoSwipe:true,//自动切换默认是
  77. speed:3000,//速度默认4000
  78. continuousScroll:true,//默认否
  79. transitionType:'cubic-bezier(0.22, 0.69, 0.72, 0.88)',//过渡动画linear/ease/ease-in/ease-out/ease-in-out/cubic-bezier
  80. lazyLoad:true,//懒加载默认否
  81. firstCallback : function(i,sum,me){
  82. me.find('.dot').children().first().addClass('cur');
  83. },
  84. callback : function(i,sum,me){
  85. me.find('.dot').children().eq(i).addClass('cur').siblings().removeClass('cur');
  86. }
  87. });
  88. function addCart_Detail(DinnerId){
  89. var url = "addCart?id="+DinnerId;
  90. get_data(url,function (result) {
  91. if(result.code==0){
  92. $('#badgecart').html(result.data.count);
  93. $('#badgecart').show();
  94. window.location.href = "index?t={$t}";
  95. // window.history.go(-1);
  96. }else{
  97. $.alert(result.message);
  98. }
  99. });
  100. }
  101. </script>