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.

268 lines
8.8 KiB

7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
  1. <!DOCTYPE html><html><head><meta http-equiv="content-type" content="text/html;charset=utf-8"/>
  2. <title>商品详情</title><meta content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=0" name="viewport">
  3. <link href="<?php echo env('APP_URL'); ?>/css/weixin/style.css" type="text/css" rel="stylesheet">
  4. <script type="text/javascript" src="<?php echo env('APP_URL'); ?>/js/jquery.min.js"></script>
  5. <script type="text/javascript" src="<?php echo env('APP_URL'); ?>/js/weixin/mobile.js"></script>
  6. <meta name="keywords" content="关键词"><meta name="description" content="描述"></head><body style="background-color:#f1f1f1;">
  7. <div class="classreturn loginsignup">
  8. <div class="ds-in-bl return"><a href="javascript:history.back(-1);"><img src="<?php echo env('APP_URL'); ?>/images/weixin/return.png" alt="返回"></a></div>
  9. <div class="ds-in-bl tit center"><span>商品详情</span></div>
  10. <div class="ds-in-bl nav_menu"><a href="javascript:void(0);"><img src="<?php echo env('APP_URL'); ?>/images/weixin/class1.png" alt="菜单"></a></div>
  11. </div>
  12. @include('weixin.common.headerNav')
  13. <!--商品详情-start-->
  14. <div class="goods_detail">
  15. <!--顶部滚动广告栏-start-->
  16. <div class="tbanner">
  17. <!-- Swiper -->
  18. <div class="swiper-container">
  19. <div class="swiper-wrapper">
  20. <div class="swiper-slide"><img src="<?php echo $post['goods_img']; ?>" alt=""></div>
  21. </div>
  22. <!-- Add Pagination -->
  23. <div class="swiper-pagination swiper-pagination-white"></div>
  24. </div>
  25. </div>
  26. <link rel="stylesheet" href="<?php echo env('APP_URL'); ?>/css/swiper.min.css">
  27. <style>
  28. .swiper-container{width:100%;height:90vw;}
  29. .swiper-slide{text-align:center;font-size:18px;background:#fff;}
  30. .swiper-slide img{width:100%;height:100vw;}
  31. </style>
  32. <script type="text/javascript" src="<?php echo env('APP_URL'); ?>/js/swiper.min.js"></script>
  33. <script>
  34. //Swiper轮播
  35. var swiper = new Swiper('.swiper-container', {
  36. pagination: '.swiper-pagination',
  37. paginationClickable: true,
  38. autoHeight: true, //enable auto height
  39. slidesPerView: 1,
  40. paginationClickable: true,
  41. spaceBetween: 30,
  42. loop: true,
  43. centeredSlides: true,
  44. autoplay: 3000,
  45. autoplayDisableOnInteraction: false
  46. });
  47. </script>
  48. <!--顶部滚动广告栏-end-->
  49. <div class="goods-header">
  50. <span class="wish-add fr<?php if(isset($post['is_collect']) && $post['is_collect']>=1){echo ' wish-add-activate';} ?>" onclick="collect_goods()">收藏</span><h1 class="title"><?php echo $post['title']; ?></h1>
  51. <div class="goods-price">
  52. <div class="current-price">
  53. <span></span><i class="price"><?php echo $post['price']; ?></i>
  54. </div>
  55. <span class="btn-retail">门店有售</span>
  56. </div>
  57. <div class="stock-detail table-cell">
  58. <dl>
  59. <dt>运费:</dt>
  60. <dd>免运费</dd>
  61. </dl>
  62. <dl>
  63. <dt>库存:</dt>
  64. <dd><?php echo $post['goods_number']; ?></dd>
  65. </dl>
  66. <dl>
  67. <dt>销量:</dt>
  68. <dd><?php echo $post['sale']; ?></dd>
  69. </dl>
  70. </div>
  71. <div class="goods-comment">用户评价<span><?php echo $post['goods_comments_num']; ?>条评价 ></span></div>
  72. </div>
  73. <div class="goods-content">
  74. <div class="module-title">宝贝详情</div>
  75. <div class="module-content"><?php echo $post['body']; ?></div>
  76. </div>
  77. </div>
  78. <!--商品详情-end-->
  79. <!-- 底部弹出层 -->
  80. <div class="pop_box" style="display:none;" id="master">
  81. <div class="goods_info_pop" style="padding-bottom:0px;">
  82. <div class="cart_list" >
  83. <div class="cart_list_info goods_list_item">
  84. <div class="cart_list_img">
  85. <img src="<?php echo $post['goods_img']; ?>" style="width:100%; height:100%;">
  86. </div>
  87. <div class="cart_goods_info">
  88. <div class="cart_list_name">
  89. <div class="cart_detail_gray" style=""><span style="" class="cart_detail_gray_name"><?php echo $post['title']; ?></span></div>
  90. <div class="cart_detail_gray" style="">
  91. <p class="cart_sum" id="total_price1_296"><span class="attr_price"><?php echo $post['price']; ?></span></p>
  92. <p class="goods_type">库存<span class="attr_storage"><?php echo $post['goods_number']; ?></span>件</p>
  93. </div>
  94. </div>
  95. </div> <!--cart_info-->
  96. </div>
  97. </div><!--item-->
  98. <div class="pop_num">
  99. <span>数量</span>
  100. <div class="pop_sum">
  101. <div class="cart_num_control pop_sum">
  102. <input type="button" value="-" class="cart_num_button" onclick="cart_num_sub()">
  103. <input type="text" value="1" class="cart_num_text" id="num">
  104. <input type="button" value="+" class="cart_num_button" onclick="cart_num_add()">
  105. </div>
  106. </div>
  107. </div>
  108. <input type="hidden" id="id" value="<?php echo $post['id']; ?>">
  109. <input type="hidden" id="goods_number" value="<?php echo $post['goods_number']; ?>">
  110. <div class="registered_btn pop_btn confirmBtn" style="display:none;" onclick="dosubmit()">
  111. <input type="hidden" name="cart_type" id="cart_type" value="">
  112. <span>确定</span>
  113. </div>
  114. </div>
  115. <div class="mask" onclick="masterunshow()"></div>
  116. </div>
  117. <script type="text/javascript" src="<?php echo env('APP_URL'); ?>/js/layer/mobile/layer.js"></script>
  118. <script>
  119. function mastershow(confirm)
  120. {
  121. //如果已经选择属性,则弹出确定按钮,否则弹出加入购物车和立即购买按钮
  122. var selectname = $("#selectname").html();
  123. if(selectname||confirm==1||confirm==2){
  124. $("#cart_type").val(confirm);
  125. $(".btnBox").hide();
  126. $(".confirmBtn").show();
  127. }else{
  128. $(".btnBox").show();
  129. $(".confirmBtn").hide();
  130. }
  131. $("#master").show();
  132. }
  133. function masterunshow()
  134. {
  135. $("#master").hide();
  136. }
  137. function cart_num_sub()
  138. {
  139. var num = $('#num').val();
  140. if(num>1)
  141. {
  142. num = parseInt(num)-1;
  143. $('#num').val(num);
  144. }
  145. }
  146. function cart_num_add()
  147. {
  148. var goods_number = $('#goods_number').val();
  149. var num = $('#num').val();
  150. num = parseInt(num)+1;
  151. if(goods_number<num)
  152. {
  153. //提示
  154. layer.open({
  155. content: '库存不足'
  156. ,skin: 'msg'
  157. ,time: 2 //2秒后自动关闭
  158. });
  159. return false;
  160. }
  161. $('#num').val(num);
  162. }
  163. function dosubmit()
  164. {
  165. var url = '<?php echo env('APP_API_URL').'/cart_add'; ?>';
  166. var access_token = '<?php echo $_SESSION['weixin_user_info']['access_token']; ?>';
  167. var cart_type = $("#cart_type").val();
  168. var goods_number = $("#num").val();
  169. var goods_id = $("#id").val();
  170. $.post(url,{access_token:access_token,goods_id:goods_id,goods_number:goods_number},function(res)
  171. {
  172. if(res.code==0)
  173. {
  174. if(cart_type == 2)
  175. {
  176. location.href = '<?php echo substr(route('weixin_cart_checkout',array('ids'=>1)),0,-1); ?>' + res.data;
  177. return false;
  178. }
  179. //提示
  180. layer.open({
  181. content: res.msg
  182. ,skin: 'msg'
  183. ,time: 2 //2秒后自动关闭
  184. });
  185. }
  186. else
  187. {
  188. //提示
  189. layer.open({
  190. content: res.msg
  191. ,skin: 'msg'
  192. ,time: 2 //2秒后自动关闭
  193. });
  194. }
  195. },'json');
  196. $("#master").hide();
  197. }
  198. function collect_goods()
  199. {
  200. var url = '<?php if(isset($post['is_collect']) && $post['is_collect']>=1){echo env('APP_API_URL').'/collect_goods_delete';}else{echo env('APP_API_URL').'/collect_goods_add';} ?>';
  201. var access_token = '<?php echo $_SESSION['weixin_user_info']['access_token']; ?>';
  202. var goods_id = $("#id").val();
  203. $.post(url,{access_token:access_token,goods_id:goods_id},function(res)
  204. {
  205. if(res.code==0)
  206. {
  207. window.location.reload();
  208. }
  209. else
  210. {
  211. }
  212. layer.open({
  213. content: res.msg
  214. ,skin: 'msg'
  215. ,time: 2 //2秒后自动关闭
  216. });
  217. },'json');
  218. }
  219. </script>
  220. <!-- 底部按钮开始 -->
  221. <div class="foohi">
  222. <div class="bottom_tool_black">
  223. <div class="bottom_tool_white">
  224. <ul>
  225. <a href="tel:12345678910"><li>
  226. <img src="<?php echo env('APP_URL'); ?>/images/weixin/goods_ic_kefu.png">
  227. <p>客服</p>
  228. </li></a>
  229. <a href="<?php echo route('weixin_cart'); ?>"><li>
  230. <img src="<?php echo env('APP_URL'); ?>/images/weixin/goods_ic_cart.png">
  231. <p>购物车</p>
  232. </li></a>
  233. </ul>
  234. </div>
  235. <div class="bottom_tool_btn">
  236. <ul>
  237. <a href="javascript:mastershow(1);"><li class="bg_c_yellow">加入购物车</li></a>
  238. <a href="javascript:mastershow(2);"><li class="bg_c_orange">立即购买</li></a>
  239. </ul>
  240. </div>
  241. </div>
  242. </div>
  243. <!-- 底部按钮结束 -->
  244. </body></html>