show.html 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439
  1. {layout name="common/layout" /}
  2. <style>
  3. html, body {
  4. background: #fff;
  5. }
  6. .swiper-container {
  7. width: 100%;
  8. height: 100%;
  9. margin-left: auto;
  10. margin-right: auto;
  11. }
  12. .swiper-slide {
  13. background-size: cover;
  14. background-position: center;
  15. }
  16. .gallery-top {
  17. height: 100%;
  18. width: 100%;
  19. }
  20. .gallery-thumbs {
  21. height: 70px;
  22. box-sizing: border-box;
  23. margin-top: 10px;
  24. }
  25. .gallery-thumbs .swiper-slide {
  26. width: 70px;
  27. height: 70px;
  28. opacity: 0.8;
  29. margin-right: 8px;
  30. }
  31. .gallery-thumbs .swiper-slide {
  32. border: 1px solid #ebebeb;
  33. padding: 1px;
  34. }
  35. .gallery-thumbs .swiper-slide:hover {
  36. cursor: pointer;
  37. }
  38. .gallery-thumbs .swiper-slide-thumb-active {
  39. opacity: 1;
  40. border: 1px solid #333;
  41. }
  42. .swiper-button-prev, .swiper-button-next {
  43. opacity: 0;
  44. }
  45. .embed-responsive-item:hover .swiper-button-prev, .embed-responsive-item:hover .swiper-button-next {
  46. opacity: 0.6;
  47. }
  48. #detail img {
  49. max-width: 100%;
  50. }
  51. .product-cart-btn .btn {
  52. width: 120px;
  53. }
  54. .goods-spec-text li {
  55. position: relative;
  56. overflow: hidden;
  57. }
  58. .goods-spec-text li a {
  59. display: block;
  60. margin: 0;
  61. padding: 5px 15px;
  62. height: 35px;
  63. font-size: .9em;
  64. line-height: 23px;
  65. color: #666;
  66. border: 1px solid #ccc;
  67. cursor: pointer;
  68. overflow: hidden;
  69. position: relative;
  70. }
  71. .goods-spec-text li a img {
  72. width: 20px;
  73. height: 20px;
  74. }
  75. .goods-spec-text li a:hover {
  76. border-color: #007bff;
  77. text-decoration: none;
  78. }
  79. .goods-spec-text li.selected a {
  80. border-color: #007bff;
  81. }
  82. .goods-spec-text li.disabled a {
  83. border-color: #ddd;
  84. color: rgba(0, 0, 0, .3);
  85. background-color: #f7f7f7;
  86. }
  87. .goods-spec-text li.selected a:after,
  88. .goods-spec-text li.selected a:before {
  89. position: absolute;
  90. right: 0;
  91. bottom: 0;
  92. content: "";
  93. }
  94. .goods-spec-text li.selected a:before {
  95. width: 0;
  96. height: 0;
  97. right: -11px;
  98. line-height: 0;
  99. border: 11px solid #fff;
  100. border-bottom: 11px solid #007bff;
  101. }
  102. .goods-spec-text li.selected a:after {
  103. width: 10px;
  104. height: 10px;
  105. background: url(__ADDON__/img/check.png) no-repeat 100% 100%;
  106. background-size: 6px auto;
  107. }
  108. .goods-spec-text li.selected i {
  109. display: block;
  110. }
  111. .coupon {
  112. display: flex;
  113. justify-content: space-between;
  114. }
  115. .coupon .left {
  116. width: 80px;
  117. }
  118. .coupon .right {
  119. flex: 1;
  120. color: #999;
  121. }
  122. .coupon .item {
  123. padding-bottom: 10px;
  124. display: inline-block;
  125. margin-right: 5px;
  126. }
  127. .coupon .item a:hover {
  128. text-decoration: none;
  129. }
  130. .coupon .item .coupon-text {
  131. padding: 1px 10px;
  132. border: 1px solid #ff464e;
  133. color: #ff464e;
  134. position: relative;
  135. font-size: 12px;
  136. }
  137. .coupon .item .coupon-text::before,
  138. .coupon .item .coupon-text::after {
  139. content: ' ';
  140. position: absolute;
  141. width: 6px;
  142. height: 8px;
  143. border-radius: 10px;
  144. border: 1px solid #ff464e;
  145. background-color: #fff;
  146. bottom: 50%;
  147. margin-bottom: -4px;
  148. }
  149. .coupon .item .coupon-text::before {
  150. left: -2px;
  151. border-left-color: #fff;
  152. }
  153. .coupon .item .coupon-text::after {
  154. border-right-color: #fff;
  155. right: -2px;
  156. }
  157. .guarantee {
  158. display: flex;
  159. margin-bottom: 20px;
  160. }
  161. .guarantee img {
  162. width: 50px;
  163. height: 50px;
  164. }
  165. </style>
  166. <div class="bg-gray hidden-xs" style="background:#f4f4f4;">
  167. <div class="container">
  168. <ol class="breadcrumb bg-gray mb-0 py-2">
  169. <!-- S 面包屑导航 -->
  170. {shop:breadcrumb id="item"}
  171. <li><a href="{$item.url|htmlentities}">{$item.name|htmlentities}</a></li>
  172. {/shop:breadcrumb}
  173. <!-- E 面包屑导航 -->
  174. <li>商品详情</li>
  175. </ol>
  176. </div>
  177. </div>
  178. <div class="container" id="content-container">
  179. <div class="row" style="margin-bottom:60px;">
  180. <div class="col-md-5">
  181. <div class="product-gallery">
  182. <div class="embed-responsive embed-responsive-square">
  183. <div class="embed-responsive-item">
  184. <div class="swiper-container gallery-top">
  185. <div class="swiper-wrapper">
  186. {foreach name="__goods__.images" id="image"}
  187. <div class="swiper-slide" style="background-image:url({$image|cdnurl|htmlentities})"></div>
  188. {/foreach}
  189. </div>
  190. </div>
  191. </div>
  192. </div>
  193. <div class="swiper-container gallery-thumbs">
  194. <div class="swiper-wrapper">
  195. {foreach name="__goods__.images" id="image"}
  196. <div class="swiper-slide" style="background-image:url({$image|cdnurl|htmlentities})"></div>
  197. {/foreach}
  198. </div>
  199. </div>
  200. <div class="my-2 text-muted" style="font-size:12px;">
  201. <a href="javascript:" class="btn-collect text-muted mr-1" data-id="{$__goods__.id|htmlentities}"><i class="fa fa-heart"></i> <span>收藏</span></a>
  202. <a href="javascript:" class="btn-share text-muted" data-image="{$__goods__.image|htmlentities}"><i class="fa fa-share-alt"></i> 分享</a>
  203. </div>
  204. </div>
  205. </div>
  206. <div class="col-md-7">
  207. <form action="{:addon_url('shop/checkout/index')}" method="post">
  208. <input type="hidden" name="ids" value="{$__goods__.id|htmlentities}"/>
  209. <input type="hidden" name="sku" value=""/>
  210. <input type="hidden" name="skuId" value=""/>
  211. <input type="hidden" name="spectype" value="{:$__goods__.spectype}"/>
  212. <input type="hidden" name="sceneval" value="2"/>
  213. <h1 style="font-size:22px;color:#444;line-height: 1.5;">{$__goods__.title|htmlentities}</h1>
  214. <div class="text-danger my-2">{$__goods__.subtitle|htmlentities}</div>
  215. <div class="mb-3">
  216. <div class="bg-gray p-3" style="background:#f4f4f4;font-size:24px;">
  217. <span style="color:red;">
  218. ¥<span class="goods-price">{$__goods__.price|htmlentities}</span>
  219. </span>
  220. <small style="font-size:.6em;margin-left:5px;">
  221. <del>市场价 ¥<span class="goods-marketprice">{$__goods__.marketprice|htmlentities}</span></del>
  222. </small>
  223. </div>
  224. </div>
  225. {if !empty($couponList)}
  226. <div class="variations mt-4 mb-3">
  227. <div class="tr-item">
  228. <div class="label">优惠券</div>
  229. <div class="value coupon">
  230. {foreach name="couponList" item="item"}
  231. <div class="item">
  232. <a href="{$item.url|htmlentities}">
  233. <span class="coupon-text">
  234. 满{$item['result_data']['money']}元{eq name="item.result" value="1"}减{else/}打{/eq}{$item['result_data']['number']}{eq name="item.result" value="1"}元{else/}折{/eq}
  235. </span>
  236. </a>
  237. </div>
  238. {/foreach}
  239. </div>
  240. </div>
  241. </div>
  242. {/if}
  243. <div class="variations mb-0" cellspacing="0">
  244. <!--规格属性-->
  245. {foreach name="__goods__.sku_spec" id="spec"}
  246. <div class="tr-item">
  247. <div class="label">{$spec.title|htmlentities}</div>
  248. <div class="value">
  249. <div class="goods-spec">
  250. <ul class="list-inline goods-spec-text">
  251. {foreach name="spec.sku_value" id="attr"}
  252. <li data-id="{$attr.id|htmlentities}"><a href="javascript:;" title="{$attr.title|htmlentities}">{$attr.title|htmlentities}</a></li>
  253. {/foreach}
  254. </ul>
  255. </div>
  256. </div>
  257. </div>
  258. {/foreach}
  259. <!--规格属性-->
  260. </div>
  261. <div class="variations mt-1 mb-0">
  262. <div class="tr-item mb-3">
  263. <div class="label">库存</div>
  264. <div class="value text-muted">
  265. <span class="goods-stocks">{$__goods__.stocks|htmlentities}</span> 件
  266. </div>
  267. </div>
  268. </div>
  269. <div class="variations mt-1 mb-0">
  270. <div class="tr-item">
  271. <div class="label">数量</div>
  272. <div class="value">
  273. <div class="quantity" data-id="">
  274. <div class="quantity-down">-</div>
  275. <input type="text" class="quantity-text" step="1" min="1" max="" name="quantity" data-stocks="{$__goods__.stocks|htmlentities}" value="1" title="数量" size="4" inputmode="numeric">
  276. <div class="quantity-up">+</div>
  277. </div>
  278. </div>
  279. </div>
  280. </div>
  281. <div class="product-cart-btn mt-3">
  282. <button type="button" name="checkout" class="btn btn-buynow btn-primary btn-lg" data-id="{$__goods__.id|htmlentities}" data-sku-id="">立即购买</button>
  283. <button type="button" name="cart" class="btn btn-cart btn-outline-primary btn-lg" data-id="{$__goods__.id|htmlentities}" data-sku-id=""><i class="fa fa-shopping-cart"></i> 加入购物车</button>
  284. </div>
  285. </form>
  286. </div>
  287. </div>
  288. <div class="row">
  289. <div class="col-xs-3 hidden-xs">
  290. <div class="panel panel-default panel-border" id="recommend-goods">
  291. <div class="panel-heading">
  292. <h3 class="panel-title">推荐商品</h3>
  293. </div>
  294. <div class="panel-body">
  295. {shop:goodslist flag="recommend" id="goods" row="5"}
  296. <div class="media">
  297. <div class="media-left">
  298. <a href="{$goods.url|htmlentities}">
  299. <img class="media-object" src="{$goods.image|cdnurl|htmlentities}" width="70">
  300. </a>
  301. </div>
  302. <div class="media-body">
  303. <div class="mb-5">
  304. <a href="{$goods.url|htmlentities}">{$goods.title|htmlentities}</a>
  305. </div>
  306. <div class="mb-5">
  307. {include file="common/rating" star="goods['star']" /}
  308. </div>
  309. <div class="price font-16">
  310. <span class="text-danger">¥{$goods.price|htmlentities}</span>
  311. <span class="price-sale text-muted small"><del>¥{$goods.marketprice|htmlentities}</del></span>
  312. </div>
  313. </div>
  314. </div>
  315. {/shop:goodslist}
  316. </div>
  317. </div>
  318. <div class="panel panel-default panel-border" id="hot-goods">
  319. <div class="panel-heading">
  320. <h3 class="panel-title">热门商品</h3>
  321. </div>
  322. <div class="panel-body">
  323. {shop:goodslist flag="hot" id="goods" row="5"}
  324. <div class="media">
  325. <div class="media-left">
  326. <a href="{$goods.url|htmlentities}">
  327. <img class="media-object" src="{$goods.image|cdnurl|htmlentities}" width="70">
  328. </a>
  329. </div>
  330. <div class="media-body">
  331. <div class="mb-5">
  332. <a href="{$goods.url|htmlentities}">{$goods.title|htmlentities}</a>
  333. </div>
  334. <div class="mb-5">
  335. {include file="common/rating" star="goods['star']" /}
  336. </div>
  337. <div class="price font-16">
  338. <span class="text-danger">¥{$goods.price|htmlentities}</span>
  339. <span class="price-sale text-muted small"><del>¥{$goods.marketprice|htmlentities}</del></span>
  340. </div>
  341. </div>
  342. </div>
  343. {/shop:goodslist}
  344. </div>
  345. </div>
  346. </div>
  347. <div class="col-xs-12 col-sm-9">
  348. <ul class="nav nav-tabs nav-product" style="margin-bottom: 15px;">
  349. <li class="active"><a href="#detail" data-toggle="tab">商品详情</a></li>
  350. <li><a href="#comment" data-toggle="tab">商品评价 ({$__goods__.comments|htmlentities})</a></li>
  351. <li><a href="#guarantee" data-toggle="tab">专享服务</a></li>
  352. </ul>
  353. <div id="myTabContent" class="tab-content">
  354. <div class="tab-pane fade active in" id="detail">
  355. <div class="detail-content clearfix z-have-detail-nav" data-name="z-have-detail-nav">
  356. {if !empty($attributes)}
  357. <div class="row" style="margin-bottom: 10px;">
  358. {foreach name="attributes" item="item"}
  359. {php}$values=array_column($item['attribute_value'],'name'){/php}
  360. <div class="col-xs-4 pb-2">{$item.name|htmlentities}:{php}echo implode(',',$values);{/php}</div>
  361. {/foreach}
  362. </div>
  363. {/if}
  364. <div class="detail-content-wrap">
  365. {$__goods__.content}
  366. </div>
  367. </div>
  368. </div>
  369. <div class="tab-pane fade" id="comment">
  370. {include file="common/comment" /}
  371. </div>
  372. <div class="tab-pane fade" id="guarantee">
  373. {foreach name="guarantee" item="item" empty="暂时没有数据" }
  374. <div class="guarantee">
  375. <img src="{$item.image|htmlentities}">
  376. <div class="ml-3">
  377. <div style="font-weight: bold;">{$item.name|htmlentities}</div>
  378. <div class="pt-1">{$item.intro|htmlentities}</div>
  379. </div>
  380. </div>
  381. {/foreach}
  382. </div>
  383. </div>
  384. </div>
  385. </div>
  386. </div>
  387. <!--@formatter:off-->
  388. <script type="text/javascript">
  389. var GOODS = {
  390. "id": "{$__goods__.id|htmlentities}",
  391. "title": "{$__goods__.title|htmlentities}",
  392. "image": "{$__goods__.image|cdnurl|htmlentities}",
  393. "marketprice": "{$__goods__.marketprice|htmlentities}",
  394. "price": "{$__goods__.price|htmlentities}",
  395. "stocks": "{$__goods__.stocks|htmlentities}",
  396. "pricelist": {$priceList|json_encode}
  397. };
  398. </script>
  399. <!--@formatter:on-->
  400. <script data-render="script" src="__ADDON__/js/goods.js?v={$site.version|htmlentities}"></script>