pro-list.html 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1, user-scalable=no">
  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. <link rel="stylesheet" type="text/css" href="css/mui.min.css" />
  10. <link rel="stylesheet" type="text/css" href="css/iconfont.css" />
  11. <link rel="stylesheet" type="text/css" href="css/main.css" />
  12. <style>
  13. .my-picker {max-height: 100%;background-color: rgba(0, 0, 0, .5);}
  14. .my-btn-buy-know {width: 50%;border-radius: 0;bottom: 0;height: 50px;border: 1px solid #727171;position: fixed;right: 0;}
  15. .my-btn-buy-cancel {width: 50%;border-radius: 0;bottom: 0;height: 50px;border: 0;border-top: 1px solid #ccc;position: fixed;left: 0;}
  16. </style>
  17. </head>
  18. <body>
  19. <header class="mui-bar mui-bar-nav">
  20. <div id="pro-menu" class="mui-segmented-control">
  21. <!--<a class="mui-control-item mui-active" href="#item1">净水机</a>
  22. <a class="mui-control-item" href="#item2">冲奶机</a>
  23. <a class="mui-control-item" href="#item3">电动牙刷</a>-->
  24. </div>
  25. </header>
  26. <footer class="mui-bar mui-bar-tab" id="footer-bar-tab">
  27. <a class="mui-tab-item ">
  28. <span class="iconfont">
  29. <svg class="icon" aria-hidden="true">
  30. <use xlink:href="#icon-kang-hui"></use>
  31. </svg>
  32. </span>
  33. <span class="mui-tab-label" >首页</span>
  34. </a>
  35. <a class="mui-tab-item">
  36. <span class="iconfont" >
  37. <svg class="icon" aria-hidden="true">
  38. <use xlink:href="#icon-ji-hui"></use>
  39. </svg>
  40. </span>
  41. <span class="mui-tab-label">购物车</span>
  42. </a>
  43. <a class="mui-tab-item">
  44. <span class="iconfont">
  45. <svg class="icon" aria-hidden="true">
  46. <use xlink:href="#icon-yi-hui1"></use>
  47. </svg>
  48. </span>
  49. <span class="mui-tab-label">订单</span>
  50. </a>
  51. <a class="mui-tab-item">
  52. <span class="iconfont">
  53. <svg class="icon" aria-hidden="true">
  54. <use xlink:href="#icon-qing-hui"></use>
  55. </svg>
  56. </span>
  57. <span class="mui-tab-label">我的</span>
  58. </a>
  59. </footer>
  60. <div class="mui-content">
  61. <!--<div class="index-title">
  62. <strong>选购</strong>
  63. </div>-->
  64. <div id="item1" class="mui-control-content mui-active">
  65. <ul class="pro-table-pull">
  66. <!--产品列表区域-->
  67. </ul>
  68. <!--<div class="index-title">
  69. <strong>配件选购</strong>
  70. </div>-->
  71. <!--<ul class="mui-table-view mui-grid-view my-view-no" style="padding-bottom: 0;">
  72. <li class="mui-table-view-cell mui-media mui-col-xs-5">
  73. <a href="#"><img class="mui-media-object" src="images/chanpin-2.jpg"></a>
  74. </li>
  75. <li class="mui-table-view-cell mui-media mui-col-xs-7">
  76. <a>
  77. <div class="pro-tit">Aiberle智能净水机滤芯配件 t1、t2、t3、t4</div>
  78. <h6 class="mui-text-left">4级ro净化、只喝净水</h6>
  79. <p class="pro-price">¥79.00~320.00</p>
  80. <div class="mui-text-right">
  81. <span class="add-cart"><span class="iconfont icon-gouwuche"></span></span>
  82. <button type="button" class="btn-buy-now">立即购买</button>
  83. </div>
  84. </a>
  85. </li>
  86. <li class="mui-table-view-cell mui-media mui-col-xs-5">
  87. <a href="#"><img class="mui-media-object" src="images/chanpin-3.jpg"></a>
  88. </li>
  89. <li class="mui-table-view-cell mui-media mui-col-xs-7">
  90. <a>
  91. <div class="pro-tit">Aiberle智能净水机水箱配件</div>
  92. <h6 class="mui-text-left">优质安全材质,放心使用</h6>
  93. <p class="pro-price">¥99.00</p>
  94. <div class="mui-text-right">
  95. <span class="add-cart"><span class="iconfont icon-gouwuche"></span></span>
  96. <button type="button" class="btn-buy-now">立即购买</button>
  97. </div>
  98. </a>
  99. </li>
  100. </ul>-->
  101. </div>
  102. <div id="product-type">
  103. </div>
  104. <!--<div id="item2" class="mui-control-content">
  105. <ul class="pro-table-pull">
  106. </ul>
  107. </div>
  108. <div id="item3" class="mui-control-content">
  109. <ul class="pro-table-pull">
  110. </ul>
  111. </div>
  112. <div id="item4" class="mui-control-content">
  113. <ul class="pro-table-pull">
  114. </ul>
  115. </div>
  116. <div id="item5" class="mui-control-content">
  117. <ul class="pro-table-pull">
  118. </ul>
  119. </div>
  120. <div id="item6" class="mui-control-content">
  121. <ul class="pro-table-pull">
  122. </ul>
  123. </div>
  124. <div id="item7" class="mui-control-content">
  125. <ul class="pro-table-pull">
  126. </ul>
  127. </div>
  128. <div id="item10" class="mui-control-content">
  129. <ul class="pro-table-pull">
  130. </ul>
  131. </div>
  132. <div id="item11" class="mui-control-content">
  133. <ul class="pro-table-pull">
  134. </ul>
  135. </div>-->
  136. </div>
  137. <!-- 加载ing -->
  138. <div class="loading covers">
  139. <div class="loading-bj"></div>
  140. <p>加载中...</p>
  141. </div>
  142. <!-- 加载ing END -->
  143. <script src="js/mui.min.js"></script>
  144. <script src="js/jquery-2.1.1.min.js"></script>
  145. <script src="js/main.js"></script>
  146. <script src="js/wechat-utils-1.0.js"></script>
  147. <script src="js/iconfont.js"></script>
  148. <script>
  149. var search_data = null,
  150. typeId = '';
  151. if(!window.sessionStorage) {
  152. mui.alert("您的浏览器不支持sessionStorage");
  153. } else {
  154. //读取上一个页面带过来的sessionStorage
  155. search_data = JSON.parse(sessionStorage.getItem('search_data'));
  156. if(search_data != null) {
  157. typeId = search_data.text[0].typeId; //如果不为空就赋值給typeId(产品类型id)
  158. //$('#item'+typeId+']').addClass("mui-active").siblings().removeClass("mui-active");
  159. } else {
  160. typeId = getParam("productId");
  161. }
  162. }
  163. var mao = getParam("childTypeId"),
  164. maodian = '';
  165. mui.ready(function() {
  166. //页面首次加载区分
  167. if(typeId != '') {
  168. getProlist(typeId, null);
  169. } else {
  170. getProlist(null, null);
  171. }
  172. $(".loading").hide().css("opacity", "0"); //页面加载完成,隐藏loading
  173. });
  174. //查询产品列表(items代表显示类型)(load值为null代表没有从其他页面带参数,并且是首次加载,其他值代表选中的区域)
  175. function getProlist(items, load) {
  176. console.log(items, load);
  177. var parameter = {};
  178. if(items != null) {
  179. parameter["typeId"] = items;
  180. parameter["pageSize"] = 100;
  181. parameter["pageNO"] = 1;
  182. }
  183. $.ajax(base_path + '/wechat/product/productIndex?dates=' + new Date().getTime(), {
  184. data: parameter,
  185. dataType: 'json',
  186. xhrFields: {
  187. withCredentials: true
  188. },
  189. crossDomain: true,
  190. type: 'post',
  191. timeout: 15000,
  192. success: function(dt) {
  193. if(dt.isRedirect) {
  194. location.href = dt.redirectURL;
  195. } else {
  196. console.log(dt)
  197. if(dt.status) {
  198. var productTypeList = dt.data.productTypeList;
  199. var typeHtml = '';
  200. for(var k = 0; k < productTypeList.length; k++) {
  201. var typeId = productTypeList[k].typeId;
  202. typeHtml += '<div id="item' + typeId + '" class="mui-control-content">';
  203. typeHtml += '<ul class="pro-table-pull">';
  204. typeHtml += '</ul>';
  205. typeHtml += '</div>';
  206. }
  207. $("#product-type").html(typeHtml);
  208. var menu_data = dt.data.productTypeList;
  209. if(load == null) {
  210. var table = document.body.querySelector("#pro-menu");
  211. mui(menu_data).each(function(index) {
  212. var li = document.createElement('a');
  213. if(items != null) {
  214. if(items == this.typeId) {
  215. li.className = 'mui-control-item mui-active';
  216. } else {
  217. li.className = 'mui-control-item';
  218. }
  219. } else {
  220. if(index == 0) {
  221. li.className = 'mui-control-item mui-active';
  222. } else {
  223. li.className = 'mui-control-item';
  224. }
  225. }
  226. li.setAttribute("name", this.typeId);
  227. li.setAttribute("href", "#item" + (index + 1));
  228. li.innerHTML = this.typeName;
  229. table.appendChild(li);
  230. });
  231. }
  232. var pro_list = dt.data.productList;
  233. if(items == null) {
  234. items = 1
  235. }
  236. $(".mui-control-content").removeClass("mui-active");
  237. var table1 = document.body.querySelector('#item' + items + ' .pro-table-pull');
  238. $("#item" + items).addClass("mui-active");
  239. if(load != null) {
  240. document.body.querySelector(load + " .pro-table-pull");
  241. table1.innerHTML = '';
  242. }
  243. var n = '';
  244. mui(pro_list).each(function(index) {
  245. // var div = document.createElement('div');
  246. // div.className = 'index-title';
  247. // div.innerHTML = '<strong>' + this.productChildTypeName + '</strong>';
  248. // if(index == 0) {
  249. // table1.appendChild(div);
  250. // }
  251. // if(n != '' && this.productChildTypeName != n) {
  252. // table1.appendChild(div);
  253. // }
  254. n = this.productChildTypeName;
  255. var li = document.createElement('li');
  256. li.setAttribute("name", this.productId);
  257. li.setAttribute("class", "product-id");
  258. var zen = '';
  259. console.log(this.productColorList)
  260. if(this.productColorList.length > 0) {
  261. $.each(this.productColorList[0].salesUserGiftList, function() {
  262. zen += this.giftName + "、"
  263. });
  264. }
  265. if(zen != '') {
  266. zen = '<div class="index-title"><p><span class="iconfont icon-liwu"></span>' + zen.substring(0, zen.length - 1) + '</p></div>';
  267. }
  268. if(mao != null && mao == this.productChildType) {
  269. li.setAttribute("id", "mao-" + this.productId);
  270. maodian = this.productId;
  271. mao = null;
  272. }
  273. var c = 'FFF',
  274. cList = '';
  275. mui(this.productColorList).each(function(index) {
  276. if(typeof(this.colorCode) != "undefined") {
  277. c = this.colorCode;
  278. }
  279. cList += '<i style="width:12px;height:12px;box-shadow: 0 0 1px rgba(0,0,0,.85);background:#' + c + ';display: inline-block;border-radius: 10px;margin: 0 3px 0 10px;"></i>';
  280. });
  281. if(this.productColorList != null && this.productColorList.length > 0){
  282. li.innerHTML = '<ul class="mui-table-view mui-grid-view my-view-no" style="padding-bottom: 0;"><li class="mui-table-view-cell mui-media mui-col-xs-5 mui-text-left"><a><img style="background-color: #eff6f6;" class="mui-media-object to-product" src="' + this.productParameterImg + '"></a></li><li class="mui-table-view-cell mui-media mui-col-xs-7"><a><div class="pro-tit to-product" >' + this.productName + '</div><h6 class="mui-text-left" style="white-space: pre-wrap;">' + this.productColorDes + '</h6><p class="pro-price"><span style="float:left;">¥' + accDiv(this.productColorList[0].colorDiscount,100) + '</span>'+cList+'</p><div class="mui-text-right"><span class="add-cart" name="' + this.productId + '" cartIsSource="1"><span class="iconfont icon-gouwuche"></span></span><button type="button" class="btn-buy-now" name="' + this.productId + '" cartIsSource="1">立即购买</button></div></a></li></ul>' + zen;
  283. table1.appendChild(li);
  284. }
  285. });
  286. if(maodian != '') {
  287. var t = $('#mao-' + maodian).offset().top;
  288. if(t > 300) {
  289. $(window).scrollTop(t, 500);
  290. }
  291. maodian = '';
  292. }
  293. } else {
  294. mui.alert("获取商品菜单失败!");
  295. }
  296. }
  297. },
  298. error: function(xhr, type, errorThrown) {
  299. console.log(xhr);
  300. mui.alert("获取商品菜单失败!网络错误");
  301. }
  302. });
  303. }
  304. //头部菜单点击事件
  305. $(document).on('tap', '#pro-menu .mui-control-item', function() {
  306. var th = $(this);
  307. if(!window.sessionStorage) {
  308. mui.alert("您的浏览器不支持sessionStorage");
  309. } else {
  310. //如果点击头部的菜单,则删除其他页面带过来的sessionStorage
  311. sessionStorage.removeItem('search_data');
  312. }
  313. //根据类型获取产品列表
  314. getProlist(th.attr("name"), th.attr("href"));
  315. var oldUrl = location.href; //原浏览器地址
  316. var newUrl = jsUrlHelper.delUrlParam(oldUrl, "childTypeId"); //删除url中的子类型参数
  317. newUrl = jsUrlHelper.putUrlParam(newUrl, 'productId', th.attr("name")); //修改url中的productId参数
  318. history.pushState(oldUrl, '产品类型', newUrl); //无刷新删除修改url地址参数
  319. console.log("url历史操作" + history.length + "次"); //获取历史操作过url地址几次
  320. mao = null;
  321. });
  322. //监听浏览器前进后退
  323. window.addEventListener("popstate", function() {
  324. var currentState = history.state;
  325. //根据类型获取产品列表
  326. mao = getParam("childTypeId"), ref = '';
  327. $.each($("#pro-menu .mui-control-item"), function() {
  328. if($(this).attr("name") == getParam("productId")) {
  329. ref = $(this).attr("href");
  330. $(this).addClass("mui-active");
  331. } else {
  332. $(this).removeClass("mui-active");
  333. }
  334. })
  335. getProlist(getParam("productId"), ref);
  336. });
  337. var count = 0; //统计所有产品加减,数量默认0,当count<1的时候设置(结算)按钮失效
  338. //购物车数量加
  339. $(document).on('tap', '.mui-btn-numbox-plus', function() {
  340. ++count; //产品总数量
  341. var th = $(this);
  342. var val = mui(th.parent()[0]).numbox().getValue(); //获取当前产品数量
  343. var parameter = {}; //ajax参数json集合
  344. if(typeof(th.attr("productid")) != "undefined") {
  345. parameter["productId"] = th.attr("productid"); //产品id
  346. if(typeof(th.attr("colorid")) != "undefined") {
  347. parameter["productColorId"] = th.attr("colorid"); //颜色id
  348. parameter["cartNum"] = 1; //需要减的产品数量,每次都是1
  349. $.ajax(base_path + '/wechat/cart/addProductToCart?dates=' + new Date().getTime(), {
  350. data: parameter,
  351. dataType: 'json',
  352. xhrFields: {
  353. withCredentials: true
  354. },
  355. crossDomain: true,
  356. type: 'post',
  357. timeout: 15000,
  358. success: function(dt) {
  359. if(dt.isRedirect) {
  360. location.href = dt.redirectURL;
  361. } else {
  362. if(dt.status) {
  363. th.parent().attr("cartid", dt.data);
  364. console.log("增加数量成功!");
  365. } else {
  366. mui.alert("增加数量失败!");
  367. }
  368. }
  369. },
  370. error: function(xhr, type, errorThrown) {
  371. console.log(xhr);
  372. mui.alert("增加数量失败!网络错误");
  373. }
  374. });
  375. } else {
  376. mui.alert("没有获取到产品颜色id");
  377. }
  378. } else {
  379. mui.alert("没有获取到产品id");
  380. }
  381. });
  382. //购物车数量减
  383. $(document).on('tap', '.mui-btn-numbox-minus', function() {
  384. --count; //产品总数量
  385. var th = $(this);
  386. var val = mui(th.parent()[0]).numbox().getValue(); //获取当前产品数量
  387. if(val == 0) {
  388. th.parent().removeAttr("cartid");
  389. }
  390. var parameter = {}; //ajax参数json集合
  391. if(typeof(th.attr("colorid")) != "undefined") {
  392. parameter["productColorId"] = th.attr("colorid"); //产品颜色id
  393. parameter["cartNum"] = 1; //需要减的产品数量,每次都是1
  394. $.ajax(base_path + '/wechat/cart/deleteCart?dates=' + new Date().getTime(), {
  395. data: parameter,
  396. dataType: 'json',
  397. xhrFields: {
  398. withCredentials: true
  399. },
  400. crossDomain: true,
  401. type: 'get', //减少数量后台限制用get
  402. timeout: 15000,
  403. success: function(dt) {
  404. if(dt.isRedirect) {
  405. location.href = dt.redirectURL;
  406. } else {
  407. if(dt.status) {
  408. console.log("减少数量数量成功!");
  409. } else {
  410. mui.alert("减少数量数量失败!");
  411. }
  412. }
  413. },
  414. error: function(xhr, type, errorThrown) {
  415. console.log(xhr);
  416. mui.alert("减少数量失败!网络错误");
  417. }
  418. });
  419. } else {
  420. mui.alert("没有获取到产品颜色id");
  421. }
  422. });
  423. //立即购买-购物车按钮 获取颜色列表
  424. $(document).on('tap', '.add-cart,.btn-buy-now', function() {
  425. count = 0;
  426. var th = $(this);
  427. //mask.show(); //显示遮罩层
  428. //在body尾部增加-产品颜色列表父级ul
  429. $("body").append('<div id="scroll" class="mui-scroll-wrapper my-picker"><div class="mui-scroll" style="top: 0;background-color: #fff;min-height: 100%;"><br/><ul class="mui-table-view mui-table-view-striped mui-table-view-condensed my-grid-view-no" style="margin-bottom: 50px;"></ul><button class="mui-btn my-btn-buy-cancel">取消</button><button class="mui-btn my-btn-buy-know" disabled="disabled">确定</button></div></div>');
  430. $.ajax(base_path + '/wechat/product/selectProductColor?dates=' + new Date().getTime(), {
  431. data: {
  432. "productId": th.attr("name") //productId产品id
  433. },
  434. dataType: 'json',
  435. xhrFields: {
  436. withCredentials: true
  437. },
  438. crossDomain: true,
  439. type: 'post',
  440. timeout: 15000,
  441. success: function(dt) {
  442. if(dt.isRedirect) {
  443. location.href = dt.redirectURL;
  444. } else {
  445. if(dt.status) {
  446. console.log(dt)
  447. var data = dt.data.productColorList;
  448. var table = document.body.querySelector('.my-picker .mui-table-view'); //产品颜色列表父级ul
  449. table.innerHTML = '';
  450. //循环遍历产品颜色数组
  451. mui(data).each(function(index) {
  452. var li = document.createElement('li'); //创建li标签
  453. li.className = 'my-table-view-cell'; //給li标签设置className
  454. if(typeof(this.cartNum) != "undefined") {
  455. count += parseInt(this.cartNum);
  456. } else {
  457. this.cartNum = 0;
  458. }
  459. li.innerHTML = '<div class="mui-table" ><div class="mui-table-cell mui-col-xs-3"><img style="background-color: #eff6f6;" class="my-media-object" src="' + this.colorProductPic + '" /></div><div class="mui-table-cell table-middle mui-col-xs-5">' + this.colorName + '<h6>' + this.colorDesc + '</h6><div style="color: #ff3b3b;">¥' + accDiv(this.colorDiscount, 100) + '</div></div><div class="mui-table-cell table-middle mui-col-xs-4"><div class="mui-numbox" data-numbox-min="0" data-numbox-max="99" cartid="' + this.cartId + '"><button class="mui-btn mui-btn-numbox-minus" type="button" productid="' + this.colorProductId + '" colorid="' + this.colorId + '">-</button><input class="mui-input-numbox" type="number" value="' + this.cartNum + '" readonly="readonly"/><button class="mui-btn mui-btn-numbox-plus" type="button" productid="' + this.colorProductId + '" colorid="' + this.colorId + '">+</button></div></div></div>';
  460. table.appendChild(li); //将li标签加入到-产品颜色列表父级ul
  461. });
  462. $(".my-picker").addClass("active"); //显示产品颜色加减数量列表
  463. // if(count > 0) {
  464. $(".my-btn-buy-know").removeAttr("disabled"); //激活结算按钮
  465. // }
  466. if(th.hasClass("add-cart")) {
  467. $(".my-btn-buy-know").attr("cart", "cart");
  468. }
  469. mui(".mui-numbox").numbox(); //激活加减按钮组合
  470. mui('#scroll').scroll();
  471. } else {
  472. mui.alert("获取数据失败!");
  473. }
  474. }
  475. },
  476. error: function(xhr, type, errorThrown) {
  477. console.log(xhr);
  478. mui.alert("获取数据失败!网络错误");
  479. }
  480. });
  481. mui('#scroll').scroll({
  482. indicators: true, //是否显示滚动条
  483. bounce: false //是否启用回弹
  484. });
  485. });
  486. $(document).on('tap', '.my-btn-buy-cancel', function() {
  487. //$(".mui-backdrop").css("opacity", 0).remove(); //移除遮罩层
  488. $(".my-picker").removeClass("active");
  489. setTimeout(function() {
  490. $(".my-picker").remove(); //移除选择颜色列表
  491. }, 500);
  492. });
  493. //确定事件
  494. $(document).on('tap', '.my-btn-buy-know', function() {
  495. //判断是点立即购买还是加入购物车的
  496. var cartidList = ''; //购物项id集合
  497. if($(this).attr("cart") == "cart") {
  498. if(count > 0) {
  499. //$(".mui-backdrop").css("opacity", 0).remove(); //移除遮罩层
  500. $(".my-picker").removeClass("active");
  501. setTimeout(function() {
  502. $(".my-picker").remove(); //移除选择颜色列表
  503. }, 500);
  504. mui.toast("加入购物车成功!");
  505. }else{
  506. mui.toast("请选择数量")
  507. }
  508. } else {
  509. $.each($(".my-picker .mui-numbox"), function(index) {
  510. var th = $(this);
  511. if(th.attr("cartid") != "undefined") {
  512. if(cartidList == '') {
  513. cartidList += th.attr("cartid");
  514. } else {
  515. cartidList += '-' + th.attr("cartid");
  516. }
  517. }
  518. });
  519. if(cartidList != "undefined" && count > 0) {
  520. $(".my-btn-buy-know").removeAttr("disabled"); //激活结算按钮
  521. if(!window.sessionStorage) {
  522. mui.alert("您的浏览器不支持sessionStorage");
  523. } else {
  524. //自定义json数据
  525. var obj = {
  526. text: [cartidList]
  527. };
  528. //json格式化插入 购物项id集合
  529. sessionStorage.setItem('pay_data', JSON.stringify(obj));
  530. location.href = 'clearing.html'; //跳转结算页面
  531. }
  532. } else {
  533. mui.toast("请选择数量")
  534. }
  535. }
  536. });
  537. //产品详情
  538. $(document).on('tap', '.to-product', function() {
  539. var productId = $(this).parents(".product-id").attr("name");
  540. location.href = 'pro-details.html?productId=' + productId;
  541. });
  542. </script>
  543. </body>
  544. </html>