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.
1 lines
29 KiB
1 lines
29 KiB
{"version":3,"sources":["uni-app:///main.js","webpack:///D:/Documents/high-mini/pages/tabBar/cart/cart.vue?c15b","webpack:///D:/Documents/high-mini/pages/tabBar/cart/cart.vue?6a04","webpack:///D:/Documents/high-mini/pages/tabBar/cart/cart.vue?f8bc","webpack:///D:/Documents/high-mini/pages/tabBar/cart/cart.vue?93b8","uni-app:///pages/tabBar/cart/cart.vue","webpack:///D:/Documents/high-mini/pages/tabBar/cart/cart.vue?d77b","webpack:///D:/Documents/high-mini/pages/tabBar/cart/cart.vue?3687"],"names":["createPage","Page"],"mappings":";;;;;;;;;;kDAAA;AACA;AACA,gG;AACAA,UAAU,CAACC,aAAD,CAAV,C;;;;;;;;;;;;;ACHA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAiH;AACjH;AACwD;AACL;AACc;;;AAGjE;AAC+L;AAC/L,gBAAgB,wMAAU;AAC1B,EAAE,0EAAM;AACR,EAAE,+EAAM;AACR,EAAE,wFAAe;AACjB;AACA;AACA;AACA;AACA;AACA,EAAE,mFAAU;AACZ;AACA;;AAEA;AACe,gF;;;;;;;;;;;;ACvBf;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;;;;;;;;;;;ACAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;ACRA;AAAA;AAAA;AAAA;AAAguB,CAAgB,qvBAAG,EAAC,C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACsEpvB;AACA,MADA,kBACA;AACA;AACA,sBADA;AAEA,6BAFA;AAGA,qBAHA;AAIA,qBAJA;AAKA,sBALA;AAMA,sBANA;AAOA,0BAPA;AAQA;AACA,wHADA;AAEA,wHAFA;AAGA,0HAHA;AAIA,0HAJA;AAKA,yHALA,CARA;;AAeA;AACA,oBAhBA;AAiBA,oBAjBA;AAkBA,mBAlBA;;AAoBA,GAtBA;AAuBA,cAvBA,wBAuBA,CAvBA,EAuBA;AACA;AACA;AACA;AACA;AACA,GA5BA;AA6BA;AACA,mBA9BA,+BA8BA;AACA;AACA;AACA,KAFA,EAEA,IAFA;AAGA,GAlCA;AAmCA,QAnCA,oBAmCA;AACA;;;;;;;;AAQA,GA5CA;AA6CA;AACA;AACA,aAFA,qBAEA,KAFA,EAEA;AACA;;;;;;AAMA;AACA,yBARA,CAQA;AACA;AACA;AACA;AACA;AACA,sCADA,CACA;AACA,wBAFA,CAEA;AACA,gBAHA,CAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAxBA;AAyBA;AACA,cA1BA,sBA0BA,KA1BA,EA0BA,KA1BA,EA0BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KApCA;AAqCA,aArCA,qBAqCA,KArCA,EAqCA,KArCA,EAqCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAHA,MAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAFA,EAEA,GAFA;AAGA;AACA;AACA,KApEA;AAqEA,YArEA,oBAqEA,KArEA,EAqEA,MArEA,EAqEA;AACA;AACA;AACA,KAxEA;AAyEA;;;AAGA;AACA,WA7EA,mBA6EA,CA7EA,EA6EA;AACA;AACA;AACA,gCADA;;AAGA,KAlFA;AAmFA;AACA,kBApFA,4BAoFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BADA;AAEA,sBAFA;;AAIA;AACA;AACA;AACA,sBADA;AAEA,qBAFA;AAGA;AACA;AACA,2CADA;;AAGA,SAPA;;AASA,KA5GA;AA6GA;AACA,eA9GA,uBA8GA,EA9GA,EA8GA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KA1HA;AA2HA;AACA,cA5HA,wBA4HA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KArIA;AAsIA;AACA,YAvIA,oBAuIA,KAvIA,EAuIA;AACA;AACA;AACA;AACA;AACA;AACA,KA7IA;AA8IA;AACA,aA/IA,uBA+IA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAzJA;AA0JA;AACA,OA3JA,eA2JA,KA3JA,EA2JA;AACA;AACA;AACA;AACA;AACA;AACA,KAjKA;AAkKA;AACA,OAnKA,eAmKA,KAnKA,EAmKA;AACA;AACA;AACA,KAtKA;AAuKA;AACA,OAxKA,eAwKA,CAxKA,EAwKA,KAxKA,EAwKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAFA,MAEA;AACA;AACA;AACA;AACA;AACA;AACA,KArLA;AAsLA,WAtLA,qBAsLA;AACA;AACA,KAxLA,EA7CA,E;;;;;;;;;;;;;ACtEA;AAAA;AAAA;AAAA;AAA00C,CAAgB,2yCAAG,EAAC,C;;;;;;;;;;;ACA91C;AACA,OAAO,KAAU,EAAE,kBAKd","file":"pages/tabBar/cart/cart.js","sourcesContent":["import 'uni-pages';\nimport Vue from 'vue'\nimport Page from './pages/tabBar/cart/cart.vue'\ncreatePage(Page)","import { render, staticRenderFns, recyclableRender, components } from \"./cart.vue?vue&type=template&id=7f17b197&\"\nvar renderjs\nimport script from \"./cart.vue?vue&type=script&lang=js&\"\nexport * from \"./cart.vue?vue&type=script&lang=js&\"\nimport style0 from \"./cart.vue?vue&type=style&index=0&lang=scss&\"\n\n\n/* normalize component */\nimport normalizer from \"!E:\\\\hBuilderX\\\\HBuilderXv3.0.5.20210107\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\vue-loader\\\\lib\\\\runtime\\\\componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null,\n false,\n components,\n renderjs\n)\n\ncomponent.options.__file = \"pages/tabBar/cart/cart.vue\"\nexport default component.exports","export * from \"-!E:\\\\hBuilderX\\\\HBuilderXv3.0.5.20210107\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\vue-loader\\\\lib\\\\loaders\\\\templateLoader.js??vue-loader-options!E:\\\\hBuilderX\\\\HBuilderXv3.0.5.20210107\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\webpack-preprocess-loader\\\\index.js??ref--16-0!E:\\\\hBuilderX\\\\HBuilderXv3.0.5.20210107\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\webpack-uni-mp-loader\\\\lib\\\\template.js!E:\\\\hBuilderX\\\\HBuilderXv3.0.5.20210107\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\webpack-uni-app-loader\\\\page-meta.js!E:\\\\hBuilderX\\\\HBuilderXv3.0.5.20210107\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\vue-loader\\\\lib\\\\index.js??vue-loader-options!E:\\\\hBuilderX\\\\HBuilderXv3.0.5.20210107\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\webpack-uni-mp-loader\\\\lib\\\\style.js!./cart.vue?vue&type=template&id=7f17b197&\"","var components\nvar render = function() {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n}\nvar recyclableRender = false\nvar staticRenderFns = []\nrender._withStripped = true\n\nexport { render, staticRenderFns, recyclableRender, components }","import mod from \"-!E:\\\\hBuilderX\\\\HBuilderXv3.0.5.20210107\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\babel-loader\\\\lib\\\\index.js!E:\\\\hBuilderX\\\\HBuilderXv3.0.5.20210107\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\webpack-preprocess-loader\\\\index.js??ref--12-1!E:\\\\hBuilderX\\\\HBuilderXv3.0.5.20210107\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\webpack-uni-mp-loader\\\\lib\\\\script.js!E:\\\\hBuilderX\\\\HBuilderXv3.0.5.20210107\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\vue-loader\\\\lib\\\\index.js??vue-loader-options!E:\\\\hBuilderX\\\\HBuilderXv3.0.5.20210107\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\webpack-uni-mp-loader\\\\lib\\\\style.js!./cart.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!E:\\\\hBuilderX\\\\HBuilderXv3.0.5.20210107\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\babel-loader\\\\lib\\\\index.js!E:\\\\hBuilderX\\\\HBuilderXv3.0.5.20210107\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\webpack-preprocess-loader\\\\index.js??ref--12-1!E:\\\\hBuilderX\\\\HBuilderXv3.0.5.20210107\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\webpack-uni-mp-loader\\\\lib\\\\script.js!E:\\\\hBuilderX\\\\HBuilderXv3.0.5.20210107\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\vue-loader\\\\lib\\\\index.js??vue-loader-options!E:\\\\hBuilderX\\\\HBuilderXv3.0.5.20210107\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\webpack-uni-mp-loader\\\\lib\\\\style.js!./cart.vue?vue&type=script&lang=js&\"","<template>\r\n\t<view>\r\n\t\t<view v-if=\"showHeader\" class=\"status\" :style=\"{position:headerPosition,top:statusTop}\"></view>\r\n\t\t<view v-if=\"showHeader\" class=\"header\" :style=\"{position:headerPosition,top:headerTop}\">\r\n\t\t\t<view class=\"title\">购物车</view>\r\n\t\t</view>\r\n\t\t<!-- 占位 -->\r\n\t\t<view v-if=\"showHeader\" class=\"place\"></view>\r\n\t\t<!-- 商品列表 -->\r\n\t\t<view class=\"goods-list\">\r\n\t\t\t<view class=\"tis\" v-if=\"goodsList.length==0\">购物车是空的哦~</view>\r\n <view class=\"row\" v-for=\"(row,index) in goodsList\" :key=\"index\" >\r\n\t\t\t\t<!-- 删除按钮 -->\r\n\t\t\t\t<view class=\"menu\" @tap.stop=\"deleteGoods(row.id)\">\r\n\t\t\t\t\t<view class=\"icon shanchu\"></view>\r\n\t\t\t\t</view>\r\n\t\t\t\t<!-- 商品 -->\r\n\t\t\t\t<view class=\"carrier\" :class=\"[theIndex==index?'open':oldIndex==index?'close':'']\" @touchstart=\"touchStart(index,$event)\" @touchmove=\"touchMove(index,$event)\" @touchend=\"touchEnd(index,$event)\">\r\n\t\t\t\t\t<!-- checkbox -->\r\n\t\t\t\t\t<view class=\"checkbox-box\" @tap=\"selected(index)\">\r\n\t\t\t\t\t\t<view class=\"checkbox\">\r\n\t\t\t\t\t\t\t<view :class=\"[row.selected?'on':'']\"></view>\r\n\t\t\t\t\t\t</view>\r\n\t\t\t\t\t</view>\r\n\t\t\t\t\t<!-- 商品信息 -->\r\n\t\t\t\t\t<view class=\"goods-info\" @tap=\"toGoods(row)\">\r\n\t\t\t\t\t\t<view class=\"img\">\r\n\t\t\t\t\t\t\t<image :src=\"row.img\"></image>\r\n\t\t\t\t\t\t</view>\r\n\t\t\t\t\t\t<view class=\"info\">\r\n\t\t\t\t\t\t\t<view class=\"title\">{{row.name}}</view>\r\n\t\t\t\t\t\t\t<view class=\"spec\">{{row.spec}}</view>\r\n\t\t\t\t\t\t\t<view class=\"price-number\">\r\n\t\t\t\t\t\t\t\t<view class=\"price\">¥{{row.price}}</view>\r\n\t\t\t\t\t\t\t\t<view class=\"number\">\r\n\t\t\t\t\t\t\t\t\t<view class=\"sub\" @tap.stop=\"sub(index)\">\r\n\t\t\t\t\t\t\t\t\t\t<view class=\"icon jian\"></view>\r\n\t\t\t\t\t\t\t\t\t</view>\r\n\t\t\t\t\t\t\t\t\t<view class=\"input\" @tap.stop=\"discard\">\r\n\t\t\t\t\t\t\t\t\t\t<input type=\"number\" v-model=\"row.number\" @input=\"sum($event,index)\" />\r\n\t\t\t\t\t\t\t\t\t</view>\r\n\t\t\t\t\t\t\t\t\t<view class=\"add\" @tap.stop=\"add(index)\">\r\n\t\t\t\t\t\t\t\t\t\t<view class=\"icon jia\"></view>\r\n\t\t\t\t\t\t\t\t\t</view>\r\n\t\t\t\t\t\t\t\t</view>\r\n\t\t\t\t\t\t\t</view>\r\n\t\t\t\t\t\t</view>\r\n\t\t\t\t\t</view>\r\n\t\t\t\t</view>\r\n\t\t\t</view>\r\n </view>\r\n\t\t<!-- 脚部菜单 -->\r\n\t\t<view class=\"footer\" :style=\"{bottom:footerbottom}\">\r\n\t\t\t<view class=\"checkbox-box\" @tap=\"allSelect\">\r\n\t\t\t\t<view class=\"checkbox\">\r\n\t\t\t\t\t<view :class=\"[isAllselected?'on':'']\"></view>\r\n\t\t\t\t</view>\r\n\t\t\t\t<view class=\"text\">全选</view>\r\n\t\t\t</view>\r\n\t\t\t<view class=\"delBtn\" @tap=\"deleteList\" v-if=\"selectedList.length>0\">删除</view>\r\n\t\t\t<view class=\"settlement\">\r\n\t\t\t\t<view class=\"sum\">合计:<view class=\"money\">¥{{sumPrice}}</view></view>\r\n\t\t\t\t<view class=\"btn\" @tap=\"toConfirmation\">结算({{selectedList.length}})</view>\r\n\t\t\t</view>\r\n\t\t</view>\r\n\t</view>\r\n</template>\r\n\r\n<script>\r\n\r\n\texport default {\r\n\t\tdata() {\r\n\t\t\treturn {\r\n\t\t\t\tsumPrice:'0.00',\r\n\t\t\t\theaderPosition:\"fixed\",\r\n\t\t\t\theaderTop:null,\r\n\t\t\t\tstatusTop:null,\r\n\t\t\t\tshowHeader:true,\r\n\t\t\t\tselectedList:[],\r\n\t\t\t\tisAllselected:false,\r\n\t\t\t\tgoodsList:[\r\n\t\t\t\t\t{id:1,img:'/static/img/banner1.png',name:'100元卡券',spec:'规格:S码',price:127.5,number:1,selected:false},\r\n\t\t\t\t\t{id:2,img:'/static/img/banner1.png',name:'200元卡券',spec:'规格:S码',price:127.5,number:1,selected:false},\r\n\t\t\t\t\t{id:3,img:'/static/img/banner1.png',name:'150中石化卡券',spec:'规格:S码',price:127.5,number:1,selected:false},\r\n\t\t\t\t\t{id:4,img:'/static/img/banner1.png',name:'200中石化卡券',spec:'规格:S码',price:127.5,number:1,selected:false},\r\n\t\t\t\t\t{id:5,img:'/static/img/banner1.png',name:'100其他卡券',spec:'规格:S码',price:127.5,number:1,selected:false}\r\n\t\t\t\t],\r\n\t\t\t\t//控制滑动效果\r\n\t\t\t\ttheIndex:null,\r\n\t\t\t\toldIndex:null,\r\n\t\t\t\tisStop:false\r\n\t\t\t}\r\n\t\t},\r\n\t\tonPageScroll(e){\r\n\t\t\t//兼容iOS端下拉时顶部漂移\r\n\t\t\tthis.headerPosition = e.scrollTop>=0?\"fixed\":\"absolute\";\r\n\t\t\tthis.headerTop = e.scrollTop>=0?null:0;\r\n\t\t\tthis.statusTop = e.scrollTop>=0?null:-this.statusHeight+'px';\r\n\t\t},\r\n\t\t//下拉刷新,需要自己在page.json文件中配置开启页面下拉刷新 \"enablePullDownRefresh\": true\r\n\t\tonPullDownRefresh() {\r\n\t\t setTimeout(function () {\r\n\t\t uni.stopPullDownRefresh();\r\n\t\t }, 1000);\r\n\t\t},\r\n\t\tonLoad() {\r\n\t\t\t//兼容H5下结算条位置\r\n\t\t\t// #ifdef H5\r\n\t\t\t\tthis.footerbottom = document.getElementsByTagName('uni-tabbar')[0].offsetHeight+'px';\r\n\t\t\t// #endif\r\n\t\t\t// #ifdef APP-PLUS\r\n\t\t\tthis.showHeader = false;\r\n\t\t\tthis.statusHeight = plus.navigator.getStatusbarHeight();\r\n\t\t\t// #endif\r\n\t\t},\r\n\t\tmethods: {\r\n\t\t\t//加入商品 参数 goods:商品数据\r\n\t\t\tjoinGoods(goods){\r\n\t\t\t\t/*\r\n\t\t\t\t* 这里只是展示一种添加逻辑,模板并没有做从其他页面加入商品到购物车的具体动作,\r\n\t\t\t\t* 在实际应用上,前端并不会直接插入记录到goodsList这一个动作,一般是更新列表和本地列表缓存。\r\n\t\t\t\t* 一般商城购物车的增删改动作是由后端来完成的,\r\n\t\t\t\t* 后端记录后返回前端更新前端缓存\r\n\t\t\t\t*/\r\n\t\t\t\tlet len = this.goodsList.length;\r\n\t\t\t\tlet isFind = false;//是否找到ID一样的商品\r\n\t\t\t\tfor(let i=0;i<len;i++){\r\n\t\t\t\t\tlet row = this.goodsList[i];\r\n\t\t\t\t\tif(row.id==goods.id )\r\n\t\t\t\t\t{\t//找到商品一样的商品\r\n\t\t\t\t\t\tthis.goodsList[i].number++;//数量自增\r\n\t\t\t\t\t\tisFind = true;//找到一样的商品\r\n\t\t\t\t\t\tbreak;//跳出循环\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif(!isFind){\r\n\t\t\t\t\t//没有找到一样的商品,新增一行到购物车商品列表头部\r\n\t\t\t\t\tthis.goodsList[i].unshift(goods);\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\t//控制左滑删除效果-begin\r\n\t\t\ttouchStart(index,event){\r\n\t\t\t\t//多点触控不触发\r\n\t\t\t\tif(event.touches.length>1){\r\n\t\t\t\t\tthis.isStop = true;\r\n\t\t\t\t\treturn ;\r\n\t\t\t\t}\r\n\t\t\t\tthis.oldIndex = this.theIndex;\r\n\t\t\t\tthis.theIndex = null;\r\n\t\t\t\t//初始坐标\r\n\t\t\t\tthis.initXY = [event.touches[0].pageX,event.touches[0].pageY];\r\n\t\t\t},\r\n\t\t\ttouchMove(index,event){\r\n\t\t\t\t//多点触控不触发\r\n\t\t\t\tif(event.touches.length>1){\r\n\t\t\t\t\tthis.isStop = true;\r\n\t\t\t\t\treturn ;\r\n\t\t\t\t}\r\n\t\t\t\tlet moveX = event.touches[0].pageX - this.initXY[0];\r\n\t\t\t\tlet moveY = event.touches[0].pageY - this.initXY[1];\r\n\t\t\t\t\r\n\t\t\t\tif(this.isStop||Math.abs(moveX)<5){\r\n\t\t\t\t\treturn ;\r\n\t\t\t\t}\r\n\t\t\t\tif (Math.abs(moveY) > Math.abs(moveX)){\r\n\t\t\t\t\t// 竖向滑动-不触发左滑效果\r\n\t\t\t\t\tthis.isStop = true;\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(moveX<0){\r\n\t\t\t\t\tthis.theIndex = index;\r\n\t\t\t\t\tthis.isStop = true;\r\n\t\t\t\t}else if(moveX>0){\r\n\t\t\t\t\tif(this.theIndex!=null&&this.oldIndex==this.theIndex){\r\n\t\t\t\t\t\tthis.oldIndex = index;\r\n\t\t\t\t\t\tthis.theIndex = null;\r\n\t\t\t\t\t\tthis.isStop = true;\r\n\t\t\t\t\t\tsetTimeout(()=>{\r\n\t\t\t\t\t\t\tthis.oldIndex = null;\r\n\t\t\t\t\t\t},150)\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\ttouchEnd(index,$event){\r\n\t\t\t\t//结束禁止触发效果\r\n\t\t\t\tthis.isStop = false;\r\n\t\t\t},\r\n\t\t\t//控制左滑删除效果-end\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t//商品跳转\r\n\t\t\ttoGoods(e){\r\n\t\t\t\tuni.showToast({title: '商品'+e.id,icon:\"none\"});\r\n\t\t\t\tuni.navigateTo({\r\n\t\t\t\t\turl: '../../goods/goods' \r\n\t\t\t\t});\r\n\t\t\t},\r\n\t\t\t//跳转确认订单页面\r\n\t\t\ttoConfirmation(){\r\n\t\t\t\tlet tmpList=[];\r\n\t\t\t\tlet len = this.goodsList.length;\r\n\t\t\t\tfor(let i=0;i<len;i++){\r\n\t\t\t\t\tif(this.goodsList[i].selected) {\r\n\t\t\t\t\t\ttmpList.push(this.goodsList[i]);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif(tmpList.length<1){\r\n\t\t\t\t\tuni.showToast({\r\n\t\t\t\t\t\ttitle:'请选择商品结算',\r\n\t\t\t\t\t\ticon:'none'\r\n\t\t\t\t\t});\r\n\t\t\t\t\treturn ;\r\n\t\t\t\t}\r\n\t\t\t\tuni.setStorage({\r\n\t\t\t\t\tkey:'buylist',\r\n\t\t\t\t\tdata:tmpList,\r\n\t\t\t\t\tsuccess: () => {\r\n\t\t\t\t\t\tuni.navigateTo({\r\n\t\t\t\t\t\t\turl:'../../order/confirmation'\r\n\t\t\t\t\t\t})\r\n\t\t\t\t\t}\r\n\t\t\t\t})\r\n\t\t\t},\r\n\t\t\t//删除商品\r\n\t\t\tdeleteGoods(id){\r\n\t\t\t\tlet len = this.goodsList.length;\r\n\t\t\t\tfor(let i=0;i<len;i++){\r\n\t\t\t\t\tif(id==this.goodsList[i].id){\r\n\t\t\t\t\t\tthis.goodsList.splice(i, 1);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tthis.selectedList.splice(this.selectedList.indexOf(id), 1);\r\n\t\t\t\tthis.sum();\r\n\t\t\t\tthis.oldIndex = null;\r\n\t\t\t\tthis.theIndex = null;\r\n\t\t\t},\r\n\t\t\t// 删除商品s\r\n\t\t\tdeleteList(){\r\n\t\t\t\tlet len = this.selectedList.length;\r\n\t\t\t\twhile (this.selectedList.length>0)\r\n\t\t\t\t{\r\n\t\t\t\t\tthis.deleteGoods(this.selectedList[0]);\r\n\t\t\t\t}\r\n\t\t\t\tthis.selectedList = [];\r\n\t\t\t\tthis.isAllselected = this.selectedList.length == this.goodsList.length && this.goodsList.length>0;\r\n\t\t\t\tthis.sum();\r\n\t\t\t},\r\n\t\t\t// 选中商品\r\n\t\t\tselected(index){\r\n\t\t\t\tthis.goodsList[index].selected = this.goodsList[index].selected?false:true;\r\n\t\t\t\tlet i = this.selectedList.indexOf(this.goodsList[index].id);\r\n\t\t\t\ti>-1?this.selectedList.splice(i, 1):this.selectedList.push(this.goodsList[index].id);\r\n\t\t\t\tthis.isAllselected = this.selectedList.length == this.goodsList.length;\r\n\t\t\t\tthis.sum();\r\n\t\t\t},\r\n\t\t\t//全选\r\n\t\t\tallSelect(){\r\n\t\t\t\tlet len = this.goodsList.length;\r\n\t\t\t\tlet arr = [];\r\n\t\t\t\tfor(let i=0;i<len;i++){\r\n\t\t\t\t\tthis.goodsList[i].selected = this.isAllselected? false : true;\r\n\t\t\t\t\tarr.push(this.goodsList[i].id);\r\n\t\t\t\t}\r\n\t\t\t\tthis.selectedList = this.isAllselected?[]:arr;\r\n\t\t\t\tthis.isAllselected = this.isAllselected||this.goodsList.length==0?false : true;\r\n\t\t\t\tthis.sum();\r\n\t\t\t},\r\n\t\t\t// 减少数量\r\n\t\t\tsub(index){\r\n\t\t\t\tif(this.goodsList[index].number<=1){\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\tthis.goodsList[index].number--;\r\n\t\t\t\tthis.sum();\r\n\t\t\t},\r\n\t\t\t// 增加数量\r\n\t\t\tadd(index){\r\n\t\t\t\tthis.goodsList[index].number++;\r\n\t\t\t\tthis.sum();\r\n\t\t\t},\r\n\t\t\t// 合计\r\n\t\t\tsum(e,index){\r\n\t\t\t\tthis.sumPrice=0;\r\n\t\t\t\tlet len = this.goodsList.length;\r\n\t\t\t\tfor(let i=0;i<len;i++){\r\n\t\t\t\t\tif(this.goodsList[i].selected) {\r\n\t\t\t\t\t\tif(e && i==index){\r\n\t\t\t\t\t\t\tthis.sumPrice = this.sumPrice + (e.detail.value*this.goodsList[i].price);\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tthis.sumPrice = this.sumPrice + (this.goodsList[i].number*this.goodsList[i].price);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tthis.sumPrice = this.sumPrice.toFixed(2);\r\n\t\t\t},\r\n\t\t\tdiscard() {\r\n\t\t\t\t//丢弃\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t\r\n\t\t}\r\n\t}\r\n</script>\r\n<style lang=\"scss\">\r\n\tpage{position: relative;background-color: #fff;}\r\n\t.checkbox-box{\r\n\t\tdisplay: flex;\r\n\t\talign-items: center;\r\n\t\t.checkbox{\r\n\t\t\twidth: 35upx;\r\n\t\t\theight: 35upx;\r\n\t\t\tborder-radius: 100%;\r\n\t\t\tborder: solid 2upx #f06c7a;\r\n\t\t\tdisplay: flex;\r\n\t\t\tjustify-content: center;\r\n\t\t\talign-items: center;\r\n\t\t\t.on{\r\n\t\t\t\twidth: 25upx;\r\n\t\t\t\theight: 25upx;\r\n\t\t\t\tborder-radius: 100%;\r\n\t\t\t\tbackground-color: #f06c7a;\r\n\t\t\t}\r\n\t\t}\r\n\t\t.text{\r\n\t\t\tfont-size: 28upx;\r\n\t\t\tmargin-left: 10upx;\r\n\t\t}\r\n\t}\r\n.status {\r\n\t\twidth: 100%;\r\n\t\theight: 0;\r\n\t\tposition: fixed;\r\n\t\tz-index: 10;\r\n\t\tbackground-color: #fff;\r\n\t\ttop: 0;\r\n\t\t/* #ifdef APP-PLUS */\r\n\t\theight: var(--status-bar-height);//覆盖样式\r\n\t\t/* #endif */\r\n\t}\r\n\r\n\t.header{\r\n\t\twidth: 92%;\r\n\t\tpadding: 0 4%;\r\n\t\theight: 100upx;\r\n\t\tdisplay: flex;\r\n\t\talign-items: center;\r\n\t\tposition: fixed;\r\n\t\ttop: 0;\r\n\t\tz-index: 10;\r\n\t\tbackground-color: #fff;\r\n\t\t/* #ifdef APP-PLUS */\r\n\t\ttop: var(--status-bar-height);\r\n\t\t/* #endif */\r\n\t\t.title{\r\n\t\t\tfont-size: 36upx;\r\n\t\t}\r\n\t\t\r\n\t}\r\n\t.place{\r\n\t\t\r\n\t\tbackground-color: #ffffff;\r\n\t\theight: 100upx;\r\n\t\t/* #ifdef APP-PLUS */\r\n\t\tmargin-top: var(--status-bar-height);\r\n\t\t/* #endif */\r\n\t}\r\n\t.goods-list{\r\n\t\twidth: 100%;\r\n\t\tpadding: 20upx 0 120upx 0;\r\n\t\t.tis{\r\n\t\t\twidth: 100%;\r\n\t\t\theight: 60upx;\r\n\t\t\tdisplay: flex;\r\n\t\t\tjustify-content: center;\r\n\t\t\talign-items: center;\r\n\t\t\tfont-size: 32upx;\r\n\t\t}\r\n\t\t.row{\r\n\t\t\twidth: calc(92%);\r\n\t\t\theight: calc(22vw + 40upx); \r\n\t\t\tmargin: 20upx auto;\r\n\t\t\t\r\n\t\t\tborder-radius: 15upx;\r\n\t\t\tbox-shadow: 0upx 5upx 20upx rgba(0,0,0,0.1);\r\n\t\t\tdisplay: flex;\r\n\t\t\talign-items: center;\r\n\t\t\tposition: relative;\r\n\t\t\toverflow: hidden;\r\n\t\t\tz-index: 4;\r\n\t\t\tborder: 0;\r\n\t\t\t.menu{\r\n\t\t\t\t.icon{\r\n\t\t\t\t\tcolor: #fff;\r\n\t\t\t\t\t// font-size: 25upx;\r\n\t\t\t\t}\r\n\t\t\t\tposition: absolute;\r\n\t\t\t\twidth: 30%;\r\n\t\t\t\theight: 100%;\r\n\t\t\t\tright: 0;\r\n\t\t\t\tdisplay: flex;\r\n\t\t\t\tjustify-content: center;\r\n\t\t\t\talign-items: center;\r\n\t\t\t\tbackground-color: red;\r\n\t\t\t\tcolor: #fff;\r\n\t\t\t\tz-index: 2;\r\n\t\t\t}\r\n\t\t\t.carrier{\r\n\t\t\t\t@keyframes showMenu {\r\n\t\t\t\t\t0% {transform: translateX(0);}100% {transform: translateX(-30%);}\r\n\t\t\t\t}\r\n\t\t\t\t@keyframes closeMenu {\r\n\t\t\t\t\t0% {transform: translateX(-30%);}100% {transform: translateX(0);}\r\n\t\t\t\t}\r\n\t\t\t\t&.open{\r\n\t\t\t\t\tanimation: showMenu 0.25s linear both;\r\n\t\t\t\t}\r\n\t\t\t\t&.close{\r\n\t\t\t\t\tanimation: closeMenu 0.15s linear both;\r\n\t\t\t\t}\r\n\t\t\t\tbackground-color: #fff;\r\n\t\t\t\t.checkbox-box{\r\n\t\t\t\t\tpadding-left: 20upx;\r\n\t\t\t\t\tflex-shrink: 0;\r\n\t\t\t\t\theight: 22vw;\r\n\t\t\t\t\tmargin-right: 20upx;\r\n\t\t\t\t}\r\n\t\t\t\tposition: absolute;\r\n\t\t\t\twidth: 100%;\r\n\t\t\t\tpadding: 0 0;\r\n\t\t\t\theight: 100%;\r\n\t\t\t\tz-index: 3;\r\n\t\t\t\tdisplay: flex;\r\n\t\t\t\talign-items: center;\r\n\r\n\t\t\t\t.goods-info{\r\n\t\t\t\t\twidth: 100%;\r\n\t\t\t\t\tdisplay: flex;\r\n\t\t\t\t\tpadding-right: 20upx;\r\n\t\t\t\t\t.img{\r\n\t\t\t\t\t\twidth: 22vw;\r\n\t\t\t\t\t\theight: 22vw;\r\n\t\t\t\t\t\tborder-radius: 10upx;\r\n\t\t\t\t\t\toverflow: hidden;\r\n\t\t\t\t\t\tflex-shrink: 0;\r\n\t\t\t\t\t\tmargin-right: 10upx;\r\n\t\t\t\t\t\timage{\r\n\t\t\t\t\t\t\twidth: 22vw;\r\n\t\t\t\t\t\t\theight: 22vw;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t.info{\r\n\t\t\t\t\t\twidth: 100%;\r\n\t\t\t\t\t\theight: 22vw;\r\n\t\t\t\t\t\toverflow: hidden;\r\n\t\t\t\t\t\tdisplay: flex;\r\n\t\t\t\t\t\tflex-wrap: wrap;\r\n\t\t\t\t\t\tposition: relative;\r\n\t\t\t\t\t\t.title{\r\n\t\t\t\t\t\t\twidth: 100%;\r\n\t\t\t\t\t\t\tfont-size: 28upx;\r\n\t\t\t\t\t\t\tdisplay: -webkit-box;\r\n\t\t\t\t\t\t\t-webkit-box-orient: vertical;\r\n\t\t\t\t\t\t\t-webkit-line-clamp: 2;\r\n\t\t\t\t\t\t\t// text-align: justify;\r\n\t\t\t\t\t\t\toverflow: hidden;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t.spec{\r\n\t\t\t\t\t\t\tfont-size: 20upx;\r\n\t\t\t\t\t\t\tbackground-color: #f3f3f3;\r\n\t\t\t\t\t\t\tcolor: #a7a7a7;\r\n\t\t\t\t\t\t\theight: 30upx;\r\n\t\t\t\t\t\t\tdisplay: flex;\r\n\t\t\t\t\t\t\talign-items: center;\r\n\t\t\t\t\t\t\tpadding: 0 10upx;\r\n\t\t\t\t\t\t\tborder-radius: 15upx;\r\n\t\t\t\t\t\t\tmargin-bottom: 20vw;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t.price-number{\r\n\t\t\t\t\t\t\tposition: absolute;\r\n\t\t\t\t\t\t\twidth: 100%;\r\n\t\t\t\t\t\t\tbottom: 0upx;\r\n\t\t\t\t\t\t\tdisplay: flex;\r\n\t\t\t\t\t\t\tjustify-content: space-between;\r\n\t\t\t\t\t\t\talign-items: flex-end;\r\n\t\t\t\t\t\t\tfont-size: 28upx;\r\n\t\t\t\t\t\t\theight: 60upx;\r\n\t\t\t\t\t\t\t.price{\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t.number{\r\n\t\t\t\t\t\t\t\tdisplay: flex;\r\n\t\t\t\t\t\t\t\tjustify-content: center;\r\n\t\t\t\t\t\t\t\talign-items: flex-end;\r\n\t\t\t\t\t\t\t\t.input{\r\n\t\t\t\t\t\t\t\t\twidth: 60upx;\r\n\t\t\t\t\t\t\t\t\theight: 60upx;\r\n\t\t\t\t\t\t\t\t\tmargin: 0 10upx;\r\n\t\t\t\t\t\t\t\t\tbackground-color: #f3f3f3;\r\n\t\t\t\t\t\t\t\t\tinput{\r\n\t\t\t\t\t\t\t\t\t\twidth: 60upx;\r\n\t\t\t\t\t\t\t\t\t\theight: 60upx;\r\n\t\t\t\t\t\t\t\t\t\tdisplay: flex;\r\n\t\t\t\t\t\t\t\t\t\tjustify-content: center;\r\n\t\t\t\t\t\t\t\t\t\talign-items: center;\r\n\t\t\t\t\t\t\t\t\t\ttext-align: center;\r\n\t\t\t\t\t\t\t\t\t\tfont-size: 26upx;\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t.sub ,.add{\r\n\t\t\t\t\t\t\t\t\twidth: 45upx;\r\n\t\t\t\t\t\t\t\t\theight: 45upx;\r\n\t\t\t\t\t\t\t\t\tbackground-color: #f3f3f3;\r\n\t\t\t\t\t\t\t\t\tborder-radius: 5upx;\r\n\t\t\t\t\t\t\t\t\t.icon{\r\n\t\t\t\t\t\t\t\t\t\tfont-size: 22upx;\r\n\t\t\t\t\t\t\t\t\t\twidth: 45upx;\r\n\t\t\t\t\t\t\t\t\t\theight: 45upx;\r\n\t\t\t\t\t\t\t\t\t\tdisplay: flex;\r\n\t\t\t\t\t\t\t\t\t\tjustify-content: center;\r\n\t\t\t\t\t\t\t\t\t\talign-items: center;\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t.footer{\r\n\t\twidth: 92%;\r\n\t\tpadding: 0 4%;\r\n\t\tbackground-color: #fbfbfb;\r\n\t\theight: 100upx;\r\n\t\tdisplay: flex;\r\n\t\tjustify-content: space-between;\r\n\t\talign-items: center;\r\n\t\tfont-size: 28upx;\r\n\t\tposition: fixed;\r\n\t\tbottom: 0upx;\r\n\t\tz-index: 5;\r\n\t\t.delBtn{\r\n\t\t\tborder: solid 1upx #f06c7a;\r\n\t\t\tcolor: #f06c7a;\r\n\t\t\tpadding: 0 30upx;\r\n\t\t\theight: 50upx;\r\n\t\t\tborder-radius: 30upx;\r\n\t\t\tdisplay: flex;\r\n\t\t\tjustify-content: center;\r\n\t\t\talign-items: center;\r\n\t\t}\r\n\t\t.settlement{\r\n\t\t\twidth: 60%;\r\n\t\t\tdisplay: flex;\r\n\t\t\tjustify-content: flex-end;\r\n\t\t\talign-items: center;\r\n\t\t\t.sum{\r\n\t\t\t\twidth: 50%;\r\n\t\t\t\tfont-size: 28upx;\r\n\t\t\t\tmargin-right: 10upx;\r\n\t\t\t\tdisplay: flex;\r\n\t\t\t\tjustify-content: flex-end;\r\n\t\t\t\t.money{\r\n\t\t\t\t\tfont-weight: 600;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t.btn{\r\n\t\t\t\tpadding: 0 30upx;\r\n\t\t\t\theight: 50upx;\r\n\t\t\t\tbackground-color: #f06c7a;\r\n\t\t\t\tcolor: #fff;\r\n\t\t\t\tdisplay: flex;\r\n\t\t\t\tjustify-content: center;\r\n\t\t\t\talign-items: center;\r\n\t\t\t\t\r\n\t\t\t\tborder-radius: 30upx;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n</style>\n","import mod from \"-!E:\\\\hBuilderX\\\\HBuilderXv3.0.5.20210107\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\mini-css-extract-plugin\\\\dist\\\\loader.js??ref--8-oneOf-1-0!E:\\\\hBuilderX\\\\HBuilderXv3.0.5.20210107\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\css-loader\\\\dist\\\\cjs.js??ref--8-oneOf-1-1!E:\\\\hBuilderX\\\\HBuilderXv3.0.5.20210107\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\vue-loader\\\\lib\\\\loaders\\\\stylePostLoader.js!E:\\\\hBuilderX\\\\HBuilderXv3.0.5.20210107\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\webpack-preprocess-loader\\\\index.js??ref--8-oneOf-1-2!E:\\\\hBuilderX\\\\HBuilderXv3.0.5.20210107\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\postcss-loader\\\\src\\\\index.js??ref--8-oneOf-1-3!E:\\\\hBuilderX\\\\HBuilderXv3.0.5.20210107\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\sass-loader\\\\dist\\\\cjs.js??ref--8-oneOf-1-4!E:\\\\hBuilderX\\\\HBuilderXv3.0.5.20210107\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\webpack-preprocess-loader\\\\index.js??ref--8-oneOf-1-5!E:\\\\hBuilderX\\\\HBuilderXv3.0.5.20210107\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\vue-loader\\\\lib\\\\index.js??vue-loader-options!E:\\\\hBuilderX\\\\HBuilderXv3.0.5.20210107\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\webpack-uni-mp-loader\\\\lib\\\\style.js!./cart.vue?vue&type=style&index=0&lang=scss&\"; export default mod; export * from \"-!E:\\\\hBuilderX\\\\HBuilderXv3.0.5.20210107\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\mini-css-extract-plugin\\\\dist\\\\loader.js??ref--8-oneOf-1-0!E:\\\\hBuilderX\\\\HBuilderXv3.0.5.20210107\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\css-loader\\\\dist\\\\cjs.js??ref--8-oneOf-1-1!E:\\\\hBuilderX\\\\HBuilderXv3.0.5.20210107\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\vue-loader\\\\lib\\\\loaders\\\\stylePostLoader.js!E:\\\\hBuilderX\\\\HBuilderXv3.0.5.20210107\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\webpack-preprocess-loader\\\\index.js??ref--8-oneOf-1-2!E:\\\\hBuilderX\\\\HBuilderXv3.0.5.20210107\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\postcss-loader\\\\src\\\\index.js??ref--8-oneOf-1-3!E:\\\\hBuilderX\\\\HBuilderXv3.0.5.20210107\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\sass-loader\\\\dist\\\\cjs.js??ref--8-oneOf-1-4!E:\\\\hBuilderX\\\\HBuilderXv3.0.5.20210107\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\webpack-preprocess-loader\\\\index.js??ref--8-oneOf-1-5!E:\\\\hBuilderX\\\\HBuilderXv3.0.5.20210107\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\vue-loader\\\\lib\\\\index.js??vue-loader-options!E:\\\\hBuilderX\\\\HBuilderXv3.0.5.20210107\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\webpack-uni-mp-loader\\\\lib\\\\style.js!./cart.vue?vue&type=style&index=0&lang=scss&\"","// extracted by mini-css-extract-plugin\n if(module.hot) {\n // 1618123405851\n var cssReload = require(\"E:/hBuilderX/HBuilderXv3.0.5.20210107/plugins/uniapp-cli/node_modules/mini-css-extract-plugin/dist/hmr/hotModuleReplacement.js\")(module.id, {\"hmr\":true,\"publicPath\":\"../../\",\"locals\":false});\n module.hot.dispose(cssReload);\n module.hot.accept(undefined, cssReload);\n }\n "],"sourceRoot":""} |