pro_detail.html 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="user-scalable=no, initial-scale=1.0, maximum-scale=1.0" />
  6. <meta name="apple-mobile-web-app-capable" content="yes" />
  7. <meta name="apple-mobile-web-app-status-bar-style" content="black" />
  8. <title>产品详情</title>
  9. <style>
  10. #head{
  11. width:100%;
  12. height: 22rem;
  13. background: #fff;
  14. }
  15. #head ul>li img{
  16. width: 100%;
  17. height: 15.6rem;
  18. }
  19. #head ul>li p{
  20. width: 23rem;
  21. color: #666;
  22. margin: 0.4rem auto 0 auto;
  23. display: -webkit-box;
  24. overflow: hidden;
  25. white-space: normal!important;
  26. text-overflow: ellipsis;
  27. word-wrap: break-word;
  28. -webkit-line-clamp: 2;
  29. -webkit-box-orient: vertical;
  30. height: 3.3rem;
  31. font-size: 1.1rem;
  32. }
  33. #head ul>li span{
  34. font-size: 1.1rem;
  35. color: #ef3c29;
  36. }
  37. .money{
  38. width: 23.5rem;
  39. margin: 0 auto;
  40. display: block;
  41. height: 3rem;
  42. line-height: 3rem;
  43. }
  44. #head{
  45. /*box-shadow: 0 1px 4px rgba(55, 55, 55, 0.1);*/
  46. padding-bottom: 0.5rem;
  47. }
  48. #detail{
  49. height: 23rem;
  50. margin-top: 0.5rem;
  51. /*box-shadow: 0 1px 4px rgba(55, 55, 55, 0.1);*/
  52. background: #fff;
  53. padding: 0 1rem;
  54. }
  55. .detail{
  56. width:100%;
  57. margin-top:0.8rem;
  58. position:relative;
  59. margin-bottom: 2rem;
  60. padding: 2.6rem 0;
  61. }
  62. #detail .bord{
  63. padding:0.6rem 0;
  64. border-bottom: 1px solid #eee;
  65. }
  66. #detail .bord span{
  67. font-size: 0.9rem;
  68. color:#666;
  69. }
  70. .detail .hode{
  71. padding: 0.8rem 0;
  72. text-align: center
  73. }
  74. .detail .hode h2{
  75. font-size: 1.6rem;
  76. color: #0079c6;
  77. }
  78. .detail .ban{
  79. padding:0 0.4rem;
  80. }
  81. .detail .ban img{
  82. width:100%;
  83. height:11.6rem;
  84. }
  85. .car .gine{
  86. width: 3rem;
  87. height: 3em;
  88. position: fixed;
  89. bottom: 4rem;
  90. right: 1.5rem;
  91. }
  92. .car .number{
  93. width: 1.3rem;
  94. height: 1.3rem;
  95. border-radius: 1rem;
  96. background: #ef3c29;
  97. color: #fff;
  98. font-size: 0.9rem;
  99. position: fixed;
  100. bottom: 6rem;
  101. right: 1.1rem;
  102. text-align: center;
  103. line-height: 1.3rem;
  104. }
  105. .last{
  106. width: 100%;
  107. overflow: hidden;
  108. position: fixed;
  109. bottom: 0;
  110. box-shadow: 0 1px 4px rgba(55, 55, 55, 0.1);
  111. }
  112. .last span{
  113. float: left;
  114. width: 50%;
  115. height: 3rem;
  116. line-height: 3rem;
  117. text-align: center;
  118. background: #525d63;
  119. font-size: 0.9rem;
  120. color: #fff;
  121. display: inline-block;
  122. }
  123. .last .btd{
  124. background:#ef3c29
  125. }
  126. .buyselect .deth em{
  127. font-size: 1.1rem;
  128. position: absolute;
  129. top:0.3rem;
  130. }
  131. .buyselect{
  132. width: 100%;
  133. position: relative;
  134. overflow: hidden;
  135. text-align: center;
  136. padding: 2rem 0;
  137. border-bottom: 1px solid #efefef;
  138. background: #fefefe;
  139. }
  140. .buyselect .deth{
  141. font-size: 1.2rem;
  142. color: #eb3e2d;
  143. margin-left: 8rem;
  144. margin-top: -1.4rem;
  145. float: left;
  146. }
  147. .buyselect s{
  148. font-size: 0.9rem;
  149. color: #a6aaa9;
  150. }
  151. .buyselect .btn{
  152. width: 1.5rem;
  153. height: 1.5rem;
  154. position: absolute;
  155. top: 0.5rem;
  156. left: 22.4rem;
  157. }
  158. .list{
  159. width: 100%;
  160. padding: 0.6rem;
  161. overflow: hidden;
  162. background: #fff;
  163. line-height: 1.8rem;
  164. }
  165. .list span{
  166. font-size: 0.9rem;
  167. color: #686868;
  168. float: left;
  169. line-height: 2.24rem;
  170. }
  171. .list .mone{
  172. float: right;
  173. }
  174. .list .mone input{
  175. width: 1.8rem;
  176. height: 1.8rem;
  177. margin: 0 0.4rem;
  178. border: none;
  179. outline: none;
  180. background: #efefef;
  181. }
  182. .list .mone strong{
  183. color:#686868;
  184. line-height: 1.8rem;
  185. }
  186. .buyCon,.addCon{
  187. width: 100%;
  188. position: fixed;
  189. bottom: -20rem;
  190. }
  191. .buyCon .btd,.addCon .btd{
  192. width: 6rem;
  193. height: 6rem;
  194. position: absolute;
  195. top: -2.4rem;
  196. left: 0.5rem;
  197. z-index: 1;
  198. box-shadow: 0 1px 8px rgba(55, 55, 55, 0.1);
  199. }
  200. .swiper-container{
  201. height: 15.6rem;
  202. }
  203. .fox{
  204. background: #eb3e2d;
  205. text-align: center;
  206. font-size: 0.9rem;
  207. height: 3rem;
  208. line-height: 3rem;
  209. color: #fff;
  210. width: 100%;
  211. display: inline-block;
  212. border:none;
  213. }
  214. .quantity {
  215. display: inline-block;
  216. width: 6.86rem;
  217. height: 2.24rem;
  218. background-color: #F5F5F5;
  219. float: right!important;
  220. border: 1px solid #ccc;
  221. text-align: center;
  222. line-height: 2.24rem;
  223. font-size: 1.09rem;
  224. border-radius: 0.08rem;
  225. }
  226. .quantity em:first-child {
  227. border-right: 1px solid #ccc;
  228. background: url('/static/images/minus1.svg') no-repeat center center;
  229. background-size: 1.51rem 1.51rem;
  230. background-color: #fff;
  231. /* background-size: contain; */
  232. float: left;
  233. cursor: pointer;
  234. background-size: 50% 100%;
  235. display: inline-block;
  236. width: 2.18rem;
  237. height: 100%;
  238. font-size: 1.09rem;
  239. letter-spacing: -0.06rem;
  240. color: #ff0000;
  241. justify-content: center;
  242. align-items: center;
  243. }
  244. .quantity em:last-child {
  245. border-left: 1px solid #ccc;
  246. background: url('/static/images/plus1.svg') no-repeat center center;
  247. background-size: 1.51rem 1.51rem;
  248. background-color: #fff;
  249. float: right;
  250. cursor: pointer;
  251. background-size: 50% 100%;
  252. display: inline-block;
  253. width: 2.18rem;
  254. height: 100%;
  255. font-size: 1.09rem;
  256. letter-spacing: -0.06rem;
  257. color: #ff0000;
  258. justify-content: center;
  259. align-items: center;
  260. }
  261. #detail .detail *{
  262. max-width: 100%;
  263. color: #666;
  264. }
  265. .weaper{
  266. box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
  267. }
  268. </style>
  269. <script src="http://lib.sinaapp.com/js/jquery/1.9.1/jquery-1.9.1.min.js"></script>
  270. <script src="/static/js/common.js"></script>
  271. <link href="/static/css/swipe.css" type="text/css" rel="stylesheet">
  272. <link href="/static/css/style.css" type="text/css" rel="stylesheet">
  273. </head>
  274. <body style="background:#f5f5f5">
  275. <div class="dialog" style="width: 25rem;height: 42rem;position: fixed;top: 0; background: rgba(0,0,0,0.2);display: none"></div>
  276. <!--<img src="images/1商品详情信息介绍-ok.png" style="" class="backg">-->
  277. <div class="a"></div>
  278. <div id="head">
  279. <ul>
  280. <li>
  281. <div class="swiper-container">
  282. <div class="swiper-wrapper">
  283. {if !empty($product['images'])}
  284. {foreach $product['images'] as $img}
  285. <div class="swiper-slide"><img src="{$host}{$img}" width="100%" height="300"/></div>
  286. {/foreach}
  287. {/if}
  288. </div>
  289. <div class="swiper-pagination"></div>
  290. </div>
  291. <script src="/static/js/swipe.js"></script>
  292. <script>
  293. var swiper = new Swiper('.swiper-container', {
  294. pagination: '.swiper-pagination',
  295. paginationClickable: true
  296. });
  297. </script>
  298. <input type="hidden" value="{$product.product_no}" id="product_no"/>
  299. <p>
  300. {if !empty($product.type_name)}
  301. 【{$product.type_name}】
  302. {/if}
  303. {$product.product_name}</p>
  304. <span class="money">¥<em>{$product.sales_price}</em></span>
  305. </li>
  306. </ul>
  307. </div>
  308. <div id="detail">
  309. <div class="bord"><span>商品详情</span></div>
  310. <div class="detail">
  311. {$product.describe}
  312. </div>
  313. </div>
  314. <div class="car">
  315. <img src="/static/images/timg22.png" alt="" class="gine"/>
  316. {if !empty($car_sum)}
  317. <span class="numbers number">{$car_sum}</span>
  318. {else}
  319. <span class="numbers"></span>
  320. {/if}
  321. </div>
  322. <p class="last">
  323. <span class="wera add addCar">加入购物车</span>
  324. <span class="btd wera addOrder">立即购买</span>
  325. </p>
  326. <div class="weaper hod buyCon">
  327. <img src="{$host}{$product.images.0}" alt="" class="btd"/>
  328. <input type="hidden" value="{$product.sales_price}" class="danjia">
  329. <div class="buyselect">
  330. <sapn class="deth">
  331. <em style="width: 5rem;
  332. display: block;
  333. text-align: left;">¥<span class="price">{$product.sales_price}</span></em>
  334. </sapn>
  335. <img src="/static/images/timg23.png" alt="" class="btn close"/>
  336. </div>
  337. <div class="list">
  338. <span style="font-size: 0.9;color:#666;">数量</span>
  339. <span class="quantity">
  340. <em class="minus"></em>
  341. <i class="chooseNum">1</i>
  342. <em class="addNum"></em>
  343. </span>
  344. </div>
  345. <input type="button" class="fox" id="addOrder" value="立即下单" />
  346. </div>
  347. <div class="weaper hod addCon">
  348. <img src="{$host}{$product.images.0}" alt="" class="btd"/>
  349. <div class="buyselect">
  350. <sapn class="deth">
  351. <em style="width: 5rem;
  352. display: block;
  353. text-align: left;">¥{$product.sales_price}</em>
  354. </sapn>
  355. <img src="/static/images/timg23.png" alt="" class="btn close"/>
  356. </div>
  357. <div class="list">
  358. <span>数量</span>
  359. <span class="quantity">
  360. <em class="minus"></em>
  361. <i class="chooseNum">1</i>
  362. <em class="addNum"></em>
  363. </span>
  364. </div>
  365. <input type="button" class=" fox" id="addCar" value="添加到购物车"/>
  366. </div>
  367. <input type="hidden" value="{$doctor_no}" class="doctor">
  368. <input type="hidden" value="{$product.product_id}" class="product">
  369. </body>
  370. <script src="/static/layer/layer.js"></script>
  371. <script>
  372. $(function(){
  373. //进入购物车
  374. $('.gine').click(function () {
  375. window.location.href="{:url('/index/order/car')}";
  376. });
  377. //加入购物车
  378. $(".addCar").click(function(){
  379. $('.dialog').show();
  380. $(".addCon").animate({bottom:"0rem"})
  381. });
  382. //下订单
  383. $(".addOrder").click(function(){
  384. $('.dialog').show();
  385. $(".buyCon").animate({bottom:"0rem"})
  386. });
  387. //减少数量
  388. $(".minus").click(function(){
  389. var num = parseInt($(this).siblings(".chooseNum").html());
  390. if(num>1){
  391. num--;
  392. $(this).siblings(".chooseNum").html(num);
  393. }
  394. });
  395. //增加数量
  396. $(".addNum").click(function(){
  397. var num = parseInt($(this).siblings(".chooseNum").html())+1;
  398. $(this).siblings(".chooseNum").html(num);
  399. });
  400. //关闭
  401. $(".close").click(function(){
  402. $('.dialog').hide();
  403. $(this).parent().parent().animate({bottom:"-17.5rem"})
  404. })
  405. })
  406. //添加到购物车
  407. var doctor_no = $('.doctor').val();
  408. $('#addCar').click(function(){
  409. var num = $(this).parent().find('.chooseNum').html();
  410. $(this).parent().animate({bottom:"-17.5rem"})
  411. var product_no = $('#product_no').val();
  412. $('.dialog').hide();
  413. $.ajax({
  414. url: '/index/index/addCar',
  415. type: 'post',
  416. async:false,
  417. data:{product_no:product_no,num:num,doctor_no:doctor_no},
  418. dataType:'json',
  419. success: function (res) {
  420. layer.msg(res.msg);
  421. $('.car .numbers').html(res.data.car_sum);
  422. $('.car .numbers').addClass('number');
  423. }
  424. });
  425. });
  426. // $('.addNum').click(function () {
  427. // col();
  428. // })
  429. // $('.minus').click(function () {
  430. // col();
  431. // })
  432. // function col(){
  433. // var num = $(this).parent().find('strong').html();
  434. // var danjia = $('.danjia').val();
  435. // $('.price').html(danjia*num);
  436. // }
  437. // 直接购买
  438. $('#addOrder').click(function () {
  439. var num = $(this).parent().find('.chooseNum').html();
  440. var id = $('.product').val();
  441. var price = $('.danjia').val();
  442. var arr = new Array();
  443. arr[id] = num+"/"+doctor_no+"/"+price;
  444. var total_price = price*num;
  445. $.ajax({
  446. url: '/index/OrderInterfaces/insertOrder',
  447. type: 'GET',
  448. async:false,
  449. data:{total_price:total_price,arr:arr,count:num},
  450. dataType:'json',
  451. success: function (res){
  452. if(res.code == 200){
  453. window.location.href="{:url('/index/order/orderDetail')}";//订单详情页面
  454. }else{
  455. layer.msg(res.msg);
  456. }
  457. }
  458. });
  459. })
  460. </script>
  461. </html>