cart.html 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815
  1. <!DOCTYPE html>
  2. <html class="">
  3. <!--STATUS OK-->
  4. <head>
  5. <meta name="referrer" content="always" />
  6. <meta charset='utf-8' />
  7. <meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
  8. <meta http-equiv="x-dns-prefetch-control" content="on">
  9. <meta name="description" content="">
  10. <meta name="format-detection" content="telephone=no" />
  11. <link rel="stylesheet" type="text/css" href="../css/api.css" />
  12. <link rel="stylesheet" type="text/css" href="../css/aui-win.css" />
  13. <link rel="stylesheet" type="text/css" href="css/vant-ui.css" />
  14. <link rel="stylesheet" type="text/css" href="css/iconfont.css">
  15. <link rel="stylesheet" type="text/css" href="css/main.css" />
  16. <link rel="stylesheet" type="text/css" href="css/countdown.css"/>
  17. <script type="text/javascript" src="../script/aui-tab.js"></script>
  18. <script src="js/vue.js"></script>
  19. <script src="js/vant-ui.js"></script>
  20. <script src="js/main.js"></script>
  21. <script src="js/countdown.js"></script>
  22. <title></title>
  23. </head>
  24. <style>
  25. .box-main {
  26. position: relative;
  27. top: -4rem;
  28. padding-top: .5rem;
  29. }
  30. .aui-bar {
  31. text-align: center;
  32. height: 1.5rem;
  33. }
  34. .card {
  35. display: flex;
  36. justify-content: center;
  37. margin-bottom: 2rem;
  38. }
  39. .card-list {
  40. width: 7rem;
  41. background-color: #fff;
  42. border-radius: .3rem;
  43. display: flex;
  44. flex-direction: column;
  45. }
  46. .card-box {
  47. display: flex;
  48. flex-direction: row;
  49. justify-content: space-between;
  50. /* border-bottom: 1px solid #F1F1F1; */
  51. margin: 0 .2rem;
  52. padding: .2rem 0;
  53. }
  54. .card-group {
  55. display: flex;
  56. flex-direction: row;
  57. justify-content: space-between;
  58. border-bottom: 1px solid #F1F1F1;
  59. margin: 0 .2rem;
  60. padding: .2rem 0;
  61. }
  62. .card-group .times{
  63. display: flex;
  64. align-items: center;
  65. color: #fb5609;
  66. font-size: .23rem;
  67. flex-direction: row;
  68. }
  69. .card-box:last-child {
  70. border-bottom: 0px solid #F1F1F1;
  71. }
  72. .card-list-left {
  73. display: flex;
  74. flex-direction: row;
  75. }
  76. .card-check {
  77. display: flex;
  78. align-items: center;
  79. margin: 0 .2rem;
  80. }
  81. .card-logo {
  82. margin-right :.2rem;
  83. display: flex;
  84. align-items:center;
  85. }
  86. .card-img {
  87. margin: .2rem .2rem .2rem 0rem;
  88. }
  89. .card-text {
  90. display: flex;
  91. flex-direction: column;
  92. justify-content: space-between;
  93. margin: .2rem 0;
  94. }
  95. .card-title {
  96. width: 3.5rem;
  97. }
  98. .card-title-p {
  99. font-size: .3rem;
  100. display: -webkit-box;
  101. -webkit-box-orient: vertical;
  102. -webkit-line-clamp: 2;
  103. overflow: hidden;
  104. }
  105. .xiangou{
  106. display: flex;
  107. flex-direction: row;
  108. }
  109. .xiangou .title{
  110. font-size: .23rem;
  111. margin-right: .2rem;
  112. margin-left: .2rem;
  113. color: #797979;
  114. }
  115. .shop-add-left {
  116. display: flex;
  117. font-size: .28rem;
  118. flex-direction: row;
  119. justify-content: space-between;
  120. }
  121. .shop-add-left input {
  122. width: .6rem;
  123. border: 1px solid rgba(229, 229, 229, 1);
  124. text-align: center;
  125. }
  126. .shop-add-left .qty{
  127. display: flex;
  128. align-items:center;
  129. }
  130. .price{
  131. color: #fb5609;
  132. font-size:.4rem;
  133. }
  134. .price .icon{
  135. font-size: .25rem;
  136. }
  137. .but-sub {
  138. border-top: 1px solid rgba(229, 229, 229, 1);
  139. border-left: 1px solid rgba(229, 229, 229, 1);
  140. border-bottom: 1px solid rgba(229, 229, 229, 1);
  141. width: .45rem;
  142. text-align: center;
  143. border-top-left-radius: .05rem;
  144. border-bottom-left-radius: .05rem;
  145. }
  146. .but-add {
  147. border-top: 1px solid rgba(229, 229, 229, 1);
  148. border-right: 1px solid rgba(229, 229, 229, 1);
  149. border-bottom: 1px solid rgba(229, 229, 229, 1);
  150. width: .45rem;
  151. text-align: center;
  152. border-top-right-radius: .05rem;
  153. border-bottom-right-radius: .05rem;
  154. }
  155. .card-del {
  156. margin: .3rem;
  157. width: .3rem;
  158. height: .3rem;
  159. }
  160. .card-del img {
  161. width: .3rem;
  162. height: .3rem;
  163. }
  164. .settle {
  165. position: absolute;
  166. bottom: 0;
  167. background-color: #fff;
  168. width: 100%
  169. }
  170. .settle-main {
  171. display: flex;
  172. justify-content: space-between;
  173. margin: .15rem 0;
  174. }
  175. .settle-left {
  176. margin: 0 .2rem;
  177. display: flex;
  178. flex-direction: row;
  179. }
  180. .settle-right {
  181. display: flex;
  182. flex-direction: row;
  183. }
  184. .settle-compute {
  185. color: rgba(0, 159, 233, 1);
  186. display: flex;
  187. align-items: center;
  188. margin: 0 .2rem;
  189. }
  190. .settle-button {
  191. display: flex;
  192. justify-content: center;
  193. align-items: center;
  194. background-color: rgba(0, 158, 232, 1);
  195. border-radius: .5rem;
  196. height: .6rem;
  197. width: 2rem;
  198. color: #fff;
  199. margin: 0 .2rem;
  200. }
  201. .color-c2c2c2 {
  202. background-color: #C2C2C2;
  203. }
  204. .settle-check {
  205. display: flex;
  206. align-items: center;
  207. }
  208. .check-text {
  209. margin-left: .2rem;
  210. display: flex;
  211. align-items: center;
  212. color: rgba(102, 102, 102, 1);
  213. }
  214. .buttom-buy {
  215. background-color: #E01212;
  216. color: #ffffff;
  217. display: flex;
  218. justify-content: center;
  219. align-items: center;
  220. border-radius: 1rem;
  221. width: 70%;
  222. height: .7rem;
  223. }
  224. .upwarp-nodata {
  225. display: none !important;
  226. }
  227. .mescroll {
  228. position: relative;
  229. height: 85%;
  230. }
  231. .whitebar{
  232. background-color:#ffffff !important;
  233. color: #333333;
  234. }
  235. </style>
  236. <body>
  237. <div id="app" style="background-color:#F5F5F5" v-cloak>
  238. <header class="aui-bar aui-bar-nav " id="aui-header" style="background-color:#ffffff !important;color: #333333">
  239. <div>
  240. <div class="aui-title" id="aui-title">
  241. 购物车
  242. </div>
  243. <!-- <div
  244. style="display:flex;justify-content:flex-end;font-size:.3rem;align-items:center;margin-right:.2rem;">
  245. <div v-on:click="setEdit" v-show="inEdit">
  246. 编辑
  247. </div>
  248. <div v-on:click="getEdit" v-show="outEdit">
  249. 完成
  250. </div>
  251. </div> -->
  252. <!-- <div v-on:click="getEdit" v-show="outEdit" style="display:flex;justify-content:flex-end;font-size:.3rem;align-item:center;margin-right:.2rem;">
  253. 完成
  254. </div> -->
  255. </div>
  256. </header>
  257. <div class="banner" style="background-image: none !important">
  258. </div>
  259. <div class="box-main mescroll-touch-y mescroll" id="mescroll">
  260. <div class="card-main">
  261. <div class="card">
  262. <div class="card-list" v-show="Shopcarts.length > 0">
  263. <div class="card-group">
  264. <div class="card-list-left">
  265. <div class="card-check">
  266. <van-checkbox></van-checkbox>
  267. </div>
  268. <div class="card-logo " >
  269. <img src="image/factory_logo.png" style="height:.28rem;width:.36rem"/>
  270. </div>
  271. <div class="card-title" style="width: 2rem !important">
  272. <p class="card-title-p"> 工厂直营</p>
  273. </div>
  274. </div>
  275. <div class="times">
  276. <div> 距离结束</div>
  277. <div id="time"></div>
  278. </div>
  279. </div>
  280. <div class="card-box" v-for="(item,index) in Shopcarts" :key="index" >
  281. <div class="card-list-left">
  282. <div class="card-check">
  283. <span>
  284. <van-checkbox v-model="item.checked" v-on:change="numCheck(item)">
  285. </van-checkbox>
  286. </span>
  287. </div>
  288. <div class="card-img" v-on:click="showdetail(item)" >
  289. <img src="image/cart_goods.png"
  290. style="width:2rem;height:2rem">
  291. <!-- <img v-if="item.productImage==null" src="img/nothing.png"
  292. style="width:1.8rem;height:1.8rem">
  293. <img v-else :src="item.productImage" style="width:1.8rem;height:1.8rem"> -->
  294. </div>
  295. <div class="card-text" >
  296. <div class="card-title" v-on:click="showdetail(item)">
  297. <p class="card-title-p">{{ item.maktx }}</p>
  298. </div>
  299. <div class="xiangou" v-on:click="showdetail(item)">
  300. <div>
  301. <img src="image/xiangou.png" style="height:.25rem;width:.25rem">
  302. </div>
  303. <div class="title">限购5件</div>
  304. <div><img src="image/coupon.png" style="height: .3rem;width:1.3rems"></div>
  305. </div>
  306. <div class="shop-add-left">
  307. <div class="price" v-on:click="showdetail(item)">
  308. <span class="icon">¥</span>240.88
  309. </div>
  310. <div>
  311. <van-stepper v-model="item.purchaseNumber" input-width=".6rem" button-size=".4rem"
  312. integer min="0" max="999" v-on:change="inputNum(item)" />
  313. </div>
  314. </div>
  315. </div>
  316. </div>
  317. </div>
  318. <div v-show="Shopcarts.length == 0" style="text-align:center">
  319. <img src="./image/noData.png" style="margin:2rem auto" />
  320. </div>
  321. </div>
  322. </div>
  323. </div>
  324. <div class="settle">
  325. <div class="settle-main">
  326. <div class="settle-left">
  327. <div class="settle-check">
  328. <van-checkbox v-model="allCheck" v-on:click="changeAllCheck"></van-checkbox>
  329. </div>
  330. <div class="check-text">
  331. 全选
  332. </div>
  333. </div>
  334. <div class="settle-right">
  335. <div class="settle-compute" ref="updateTotal">
  336. 总计: {{totalSumAll}}
  337. </div>
  338. <div class="settle-button" v-show="inEdit" v-on:click="showPopup">
  339. 提交订单
  340. </div>
  341. <!-- <div class="settle-button color-c2c2c2" v-show="outEdit" v-on:click="allDelCart()">
  342. 删除
  343. </div> -->
  344. </div>
  345. </div>
  346. </div>
  347. <!-- <van-popup v-model="show" closeable position="bottom" :style="{ height: '40%' }">
  348. <div style="display:flex;justisfy-content:center;margin-top:.8rem;color:#ccc">
  349. 暂无收货地址
  350. </div>
  351. <div style="display:flex;justify-content:center;margin-top:.8rem;color:#00a0ea" v-on:click="goaddress">
  352. 点击去添加
  353. </div>
  354. <div style="position: fixed;bottom: .2rem;width:100%;display:flex;justify-content:center">
  355. <div class="buttom-buy" v-on:click="addOrder">
  356. 立即下单
  357. </div>
  358. </div>
  359. </van-popup> -->
  360. </div>
  361. </body>
  362. <link rel="stylesheet" href="./mescroll/mescroll.min.css">
  363. <script type="text/javascript" src="./js/qrcode.min.js"></script>
  364. <script type="text/javascript" src="../script/aui-scroll.js"></script>
  365. <script type="text/javascript" src="./mescroll/mescroll.min.js"></script>
  366. <script type="text/javascript" src="../script/api.js"></script>
  367. <script type="text/javascript" src="../script/httpRequest.js"></script>
  368. <script type="text/javascript" src="../script/vue_plugins.js"></script>
  369. <script type="text/javascript">
  370. apiready = function () {
  371. api.parseTapmode();
  372. var header = $api.byId('aui-header');
  373. $api.fixStatusBar(header);
  374. // api.addEventListener({
  375. // name:'resume'
  376. // },function(ret,err){
  377. // alert('已转到前台,需要刷新列表和爆款时间');
  378. // });
  379. new Vue({
  380. el: '#app',
  381. data: {
  382. checkBox: [],
  383. inEdit: true,
  384. outEdit: false,
  385. Shopcarts: [],
  386. total: '',
  387. allCheck: false,
  388. current: 1,
  389. size: 10,
  390. frist: 1,
  391. totalPages: 1,
  392. hasOther: false,
  393. mescroll: '',
  394. show: false,
  395. addresslist: [],
  396. radio: '',
  397. },
  398. methods: {
  399. init: function () {
  400. this.userId = $api.getStorage('userid');
  401. // this.storeId = $api.getStorage('userid');
  402. this.loginId = $api.getStorage('loginid');
  403. this.status = $api.getStorage('status');
  404. this.getShopCart();
  405. var _this = this;
  406. this.addEvent("refreshshopcart", function () {
  407. _this.getShopCart();
  408. _this.show = false;
  409. });
  410. },
  411. configs: function () {
  412. var _this = this;
  413. this.frist = 2;
  414. this.configDownAndPull("mescroll", function (mescroll) {
  415. _this.mescroll = mescroll;
  416. _this.current = 1;
  417. _this.getShopCart(mescroll);
  418. }, function (mescroll) {
  419. if (_this.current < _this.totalPages) {
  420. _this.current = _this.current + 1;
  421. _this.getShopCart(mescroll, 1);
  422. } else {
  423. mescroll.endSuccess(_this.size, false);
  424. }
  425. })
  426. },
  427. addMore: function () {
  428. var _this = this;
  429. if (_this.current < _this.totalPages) {
  430. _this.current = _this.current + 1;
  431. _this.getCouponList(_this.mescroll, 1);
  432. } else {
  433. _this.hasOther = true;
  434. }
  435. },
  436. /**
  437. * 删除购物车中的物料
  438. */
  439. delCarMatax: function (id) {
  440. var url = "delCarMataxU", _this = this;
  441. var data = {
  442. "id": id,
  443. "url": "json",
  444. "type": "body"
  445. }
  446. this.$post(url, data, function (ret) {
  447. if (ret.code == 0 || ret.code == '0') {
  448. api.toast({
  449. msg: '删除成功',
  450. });
  451. setTimeout(function () {
  452. _this.getShopCart();
  453. }, 500)
  454. }
  455. })
  456. },
  457. showdetail:function(item){
  458. this.goWin("product", "product.html");
  459. },
  460. inputNum: function (item) {
  461. if (item.purchaseNumber==0){
  462. this.delCarMatax(item.id);
  463. }
  464. else if (item.purchaseNumber != '') {
  465. var data = {
  466. "url": "json",
  467. "type": "body",
  468. "id": item.id,
  469. "purchaseNumber": item.purchaseNumber
  470. }
  471. _this = this,
  472. url = "updateCarNum";
  473. this.$post(url, data, function (ret) { })
  474. }
  475. },
  476. setEdit: function () {
  477. if (this.inEdit) {
  478. this.inEdit = false;
  479. this.outEdit = true;
  480. } else {
  481. this.inEdit = true;
  482. this.outEdit = false;
  483. }
  484. },
  485. getEdit: function () {
  486. if (this.outEdit) {
  487. this.outEdit = false;
  488. this.inEdit = true;
  489. } else {
  490. this.inEdit = false;
  491. this.outEdit = true;
  492. }
  493. },
  494. getShopCart: function (mescroll) {
  495. var url = "getCarListU",
  496. _this = this,
  497. data = {
  498. "storeId": this.userId,
  499. "url": "json",
  500. "type": "body"
  501. };
  502. setTimeout(function () {
  503. if (mescroll) {
  504. mescroll.endSuccess();
  505. }
  506. }, 1000);
  507. //console.log(JSON.stringify(data));
  508. this.$post(url, data, function (ret) {
  509. if (ret.code == 0 || ret.code == '0') {
  510. ret.data.map(function (store, index) {
  511. store.checked = false;
  512. })
  513. _this.Shopcarts = _this.current == 1 ? ret.data : _this.Shopcarts.concat(ret.data);
  514. // console.log(JSON.stringify(ret.data));
  515. _this.totalPages = ret.data.pages;
  516. if (mescroll) {
  517. mescroll.endSuccess(_this.size, true)
  518. }
  519. if (_this.frist == 1) {
  520. _this.$nextTick(function () {
  521. _this.configs();
  522. })
  523. }
  524. }
  525. })
  526. },
  527. changeAllCheck: function () {
  528. if (this.allCheck == false) {
  529. this.Shopcarts.map(function (cart, index) {
  530. cart.checked = false;
  531. })
  532. } else {
  533. this.Shopcarts.map(function (cart, index) {
  534. cart.checked = true;
  535. })
  536. }
  537. },
  538. numCheck: function (item) {
  539. var i = 0;
  540. this.Shopcarts.forEach(function (item) {
  541. if (item.checked === true) i++
  542. })
  543. if (i != this.Shopcarts.length) {
  544. this.allCheck = false
  545. } else {
  546. this.allCheck = true
  547. }
  548. },
  549. delCart: function (item) {
  550. var arr = [];
  551. var add = item.mainId;
  552. arr.push(add);
  553. var data = {
  554. "url": "json",
  555. "type": "body",
  556. "ids": arr,
  557. },
  558. _this = this,
  559. url = "delCart";
  560. _this.showModal('温馨提示', '是否确认删除?', ["取消", "确认"], function (res) {
  561. if (res == 2) {
  562. _this.$post(url, data, function (ret) {
  563. if (ret.code == 0 || ret.code == '0') {
  564. _this.showToast("已成功删除")
  565. } else {
  566. _this.showToast("删除失败")
  567. }
  568. setTimeout(function () {
  569. _this.getShopCart();
  570. }, 200)
  571. })
  572. }
  573. })
  574. },
  575. showPopup: function () {
  576. var count = 0, price = 0, hasChoose = new Array();
  577. this.Shopcarts.map(function (cart, index) {
  578. if (cart.checked == true) {
  579. price = price + (parseInt(cart.purchaseNumber) ? parseInt(cart.purchaseNumber) : 0) * 1;
  580. count = count + (parseInt(cart.purchaseNumber) ? parseInt(cart.purchaseNumber) : 0);
  581. hasChoose.push({
  582. "id": cart.id,
  583. "storeId": cart.storeId,
  584. "purchaseNumber": cart.purchaseNumber,
  585. "cartType": cart.cartType,
  586. "kunnr": cart.kunnr,
  587. "matnr": cart.matnr,
  588. "maktx": cart.maktx,
  589. "brand": cart.brand,
  590. "spec": cart.spec,
  591. "pattern": cart.pattern
  592. });
  593. }
  594. })
  595. if (hasChoose.length == 0) {
  596. api.toast({ msg: '至少选择一件商品' });
  597. return;
  598. }
  599. this.goWin("confirmOrder", "confirmOrderInfo_win.html",{
  600. data: hasChoose
  601. } );
  602. // this.show = true;
  603. // var data = {
  604. // "url": "json",
  605. // "type": "body",
  606. // "storeId": this.storeId,
  607. // "addressType": "1",
  608. // "isDel": 0
  609. // },
  610. // _this = this,
  611. // url = "getReceiptAddress";
  612. // this.$post(url, data, function (ret) {
  613. // if (ret.code == 0 || ret.code == '0') {
  614. // _this.addresslist = ret.list;
  615. // for (var i = 0; i < _this.addresslist.length; i++) {
  616. // if (_this.addresslist[i].beDefault == 1) {
  617. // _this.radio = _this.addresslist[i].mainId
  618. // } else {
  619. // _this.radio = _this.addresslist[0].mainId
  620. // }
  621. // }
  622. // }
  623. // })
  624. },
  625. addOrder: function () {
  626. var hasChoose = [];
  627. this.Shopcarts.map(function (cart, index) {
  628. if (cart.checked == true) {
  629. hasChoose.push({
  630. "mainId": cart.mainId,
  631. "productId": cart.productId,
  632. "storeId": cart.storeId,
  633. "cartQty": cart.cartQty,
  634. "cartType": cart.cartType,
  635. "status": cart.status,
  636. "productIntroduction": cart.productIntroduction,
  637. "brand": cart.brand,
  638. "spec": cart.spec,
  639. "pattern": cart.pattern,
  640. "createTime": cart.createTime,
  641. "productPrice": cart.productPrice,
  642. "isDelete": cart.isDelete,
  643. "productImage": cart.productImage,
  644. "size": null,
  645. "current": null
  646. });
  647. }
  648. })
  649. if (this.radio == "") {
  650. this.showToast('请选择收货地址');
  651. return;
  652. }
  653. var data = {
  654. "url": "json",
  655. "type": "body",
  656. "bizIntegralCartDtoList": hasChoose,
  657. "shopId": this.storeId,
  658. "receiptAddressId": this.radio
  659. },
  660. _this = this,
  661. url = "addOrder";
  662. _this.showModal('温馨提示', '是否确认下单?', ["取消", "确认"], function (res) {
  663. if (res == 2) {
  664. _this.$post(url, data, function (ret) {
  665. if (ret.code == 0 || ret.code == '0') {
  666. if (!ret.message) {
  667. _this.showToast("成功下单")
  668. _this.allCheck = false;
  669. _this.show = false;
  670. setTimeout(function () {
  671. _this.goWin('annal', 'annal_win.html');
  672. }, 1000);
  673. } else {
  674. api.toast({
  675. msg: ret.message
  676. });
  677. _this.allCheck = false;
  678. _this.show = false;
  679. return
  680. }
  681. } else {
  682. _this.showToast("下单失败")
  683. }
  684. setTimeout(function () {
  685. _this.getShopCart();
  686. }, 200)
  687. })
  688. } else {
  689. _this.show = false;
  690. }
  691. })
  692. },
  693. allDelCart: function () {
  694. var arr = [];
  695. this.Shopcarts.map(function (cart, index) {
  696. if (cart.checked == true) {
  697. arr.push(cart.mainId);
  698. }
  699. })
  700. if (arr.length == 0) {
  701. this.showToast('至少选择一件商品');
  702. return;
  703. }
  704. var data = {
  705. "url": "json",
  706. "type": "body",
  707. "ids": arr,
  708. },
  709. _this = this,
  710. url = "delCart";
  711. _this.showModal('温馨提示', '是否确认删除?', ["取消", "确认"], function (res) {
  712. if (res == 2) {
  713. _this.$post(url, data, function (ret) {
  714. if (ret.code == 0 || ret.code == '0') {
  715. _this.showToast("已成功删除")
  716. _this.allCheck = false
  717. } else {
  718. _this.showToast("删除失败")
  719. }
  720. setTimeout(function () {
  721. _this.getShopCart();
  722. _this.current = 1;
  723. }, 200)
  724. })
  725. }
  726. })
  727. },
  728. downTime:function(){
  729. var o = {
  730. el : 'time',
  731. st : 0,
  732. ed : 5400000,
  733. hh: 'hh',
  734. mm: 'mm',
  735. ss: 'ss',
  736. ms: 'ms'
  737. }
  738. var d = new countdown(o);
  739. d.downsElement();
  740. }
  741. },
  742. watch: {
  743. },
  744. computed: {
  745. totalSumAll: function () {
  746. var totalSumAll = 0;
  747. // this.Shopcarts.map(function (cart, index) {
  748. // if (cart.checked == true) {
  749. // totalSumAll += cart.productPrice * Number(cart.cartQty)
  750. // }
  751. // })
  752. return totalSumAll
  753. },
  754. },
  755. mounted: function () {
  756. this.init();
  757. // this.downTime();
  758. }
  759. })
  760. }
  761. </script>
  762. </html>