cart.vue 42 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552
  1. <template>
  2. <view class="container cart clearfix" v-if="hasLogin" :style="{paddingTop:CustomBar+'px'}">
  3. <headerNavbar :systeminfo='systeminfo' :navbar-data='nvabarData' :headerBtnPosi ="headerBtnPosi" :page='1'></headerNavbar>
  4. <tui-skeleton v-if="skeletonShow" backgroundColor="#fafafa" borderRadius="10rpx" :isLoading ="true" :loadingType="5"></tui-skeleton>
  5. <view class="container-cart-main tui-skeleton" :style="{paddingTop:isshowDelbtn ? '0rpx':'80rpx'}">
  6. <view class="foot-check-delbtn" v-if="!isshowDelbtn && goodsList.length>0" :style="{top:CustomBar+'px'}">
  7. <view class="foot-text">共<text>{{kindCount}}</text>件商品</view>
  8. <view class="delBtn" @tap.stop="showDelManager">删除</view>
  9. </view>
  10. <view v-if="!isEmpty" class="container-cart">
  11. <view class="cart-content" :style="{paddingBottom :isIphoneX ? '130rpx' : '100rpx'}">
  12. <view class="goods-list">
  13. <view v-for="(item, index) in goodsList" :key="index" class="goods-item clearfix">
  14. <view class="shoptitle">
  15. <!--选择商店的全部商品"-->
  16. <view class="checkbox-box" @click.stop="checkShop(item)">
  17. <view class="checkbox iconfont" :class="[item.checked ?'icon-gouxuanl':'icon-weigouxuan']"></view>
  18. </view>
  19. <view v-if="item.promotions" class="floor-item-act">
  20. <view class="floor-tags" @click.stop="clickPopupShow(item,2)">{{item.promotions.name}}</view>
  21. </view>
  22. <view class="text">{{item.name}}</view>
  23. </view>
  24. <view class="productlist">
  25. <view class="goods-pros" v-for="(pros,idx) in item.cartList" :key="idx" >
  26. <view class="goods-pros-t">
  27. <!--选择商品-->
  28. <view class="checkbox-box" @click.stop="ischeck(item,pros)">
  29. <view class="checkbox iconfont" :class="[pros.productsChecked ? 'icon-gouxuanl':'icon-weigouxuan']">
  30. </view>
  31. </view>
  32. <view class="pros-img" @click.stop="navToListPage(pros.productId)">
  33. <image :src="pros.image ? pros.image:''" alt="" />
  34. </view>
  35. <view class="pros-product">
  36. <view class="producttitle" @click.stop="navToListPage(pros.productId)">{{pros.name}}</view>
  37. <view class="productspec">规格:{{pros.unit ? pros.unit : ''}}</view>
  38. <view class="productprice">
  39. <!--使用过滤器对总价改变-->
  40. <view class="price" :class="PromotionsFormat(pros.promotions) ? 'disabled' : ''">
  41. <text>¥</text>
  42. {{ (PromotionsFormat(pros.promotions) ? pros.originalPrice : pros.price) | NumFormat }}
  43. </view>
  44. <view class="count" v-if="pros.validFlag == 2 " :class="[isshowDelbtn ? 'none':'show']">
  45. <text class="count-tips" v-if="pros.number<pros.min">起订量:{{pros.min}}</text>
  46. <text class="count-tips step" v-if="pros.isStep">购买量必须为起订量的整数倍</text>
  47. <view class="number-box">
  48. <view class="iconfont icon-jianhao" @click="changeCountSub(item,pros)"></view>
  49. <input class="btn-input" type="number" maxlength='4' v-model="pros.number" @blur="changeNnmber($event,item,pros)" @focus="changeInput(pros)">
  50. <view class="iconfont icon-jiahao" @click="changeCountAdd(item,pros)"></view>
  51. </view>
  52. </view>
  53. </view>
  54. <view v-show="pros.actStatus==1" class="floor-item-act">
  55. <view v-if="PromotionsFormat(pros.promotions)" class="floor-tags" @click.stop="clickPopupShow(pros,1)">
  56. {{pros.promotions.name}}
  57. <text v-if ="pros.promotions!=null && pros.promotions.type!=3">
  58. :¥{{ pros.promotions == null ? '0.00' : pros.promotions.touchPrice | NumFormat}}
  59. </text>
  60. </view>
  61. <view v-else-if="pros.promotions.type!=3" class="floor-tags" @click.stop="clickPopupShow(pros,2)">{{pros.promotions.name}}</view>
  62. </view>
  63. <view v-if="pros.actStatus == null && pros.ladderFlag == 1" class="floor-item-act">
  64. <view class="floor-tags" @click.stop="clickPopupShow(pros,2)">阶梯价格</view>
  65. </view>
  66. </view>
  67. </view>
  68. </view>
  69. </view>
  70. <view class="goods-pros-b clearfix" :class="[isshowDelbtn ? 'none':'show']" >
  71. <view class="sum-none" v-if="item.reducedPrice>0">
  72. <text class="money-sign">¥</text>
  73. <text class="money">{{ item.totalOriginalPrice | NumFormat }}</text>
  74. <text class="money-reduced"><text class="iconfont icon-biaoqian"></text>减<text>¥{{ item.reducedPrice | NumFormat}}</text></text>
  75. </view>
  76. <view class="sum">合计:<text class="money"><text class="money-sign">¥</text>{{item.totalPrice | NumFormat}}</text></view>
  77. </view>
  78. </view>
  79. </view>
  80. <view class="failure-list" v-if="failureList.length>0">
  81. <view class="failure-title">
  82. <view class="title-txt">失效商品<text>{{failureList.length}}件</text></view>
  83. <view class="title-btn" @click.stop="deletefailureList"><text class="butto">清空失效商品</text></view>
  84. </view>
  85. <view class="productlist">
  86. <view class="goods-pros" v-for="(failure,failureIdx) in failureList" :key="failureIdx" >
  87. <view class="goods-pros-t" @click.stop="failureToProduct(failure)">
  88. <!--选择商品-->
  89. <view class="checkbox-box" @click.stop="ischeckFailure(failure)" v-if="isshowDelbtn">
  90. <button class="checkbox iconfont"
  91. :class="[ failure.productsChecked ? 'icon-gouxuanl':'icon-weigouxuan']">
  92. </button>
  93. </view>
  94. <view class="pros-img">
  95. <image :src="failure.image ? failure.image:''" alt="" />
  96. <text class="img-tip">失效</text>
  97. </view>
  98. <view class="pros-product">
  99. <view class="producttitle">{{failure.name}}</view>
  100. <view class="productspec">规格:{{failure.unit ? failure.unit : ''}}</view>
  101. <view class="productstate">{{failureStateText(failure.status)}}</view>
  102. </view>
  103. <view class="pros-marks" v-if="failure.isFailureLayer"></view>
  104. </view>
  105. </view>
  106. </view>
  107. </view>
  108. </view>
  109. <!-- 脚部菜单 -->
  110. <view class="footer" :style="{paddingBottom :isIphoneX ? '68rpx' : '0rpx'}">
  111. <view class="footer-le">
  112. <view class="foot-check checkbox-box" @tap.stop="checkAll()">
  113. <button class="checkbox iconfont" :class="[isCheckAll?'icon-gouxuan':'icon-weigouxuan']"></button>
  114. <view class="text">全选</view>
  115. </view>
  116. <view class="sum">
  117. <view class="sum-none" v-if="reducedPrice>0">
  118. <text class="money-sign">¥</text>
  119. <text class="money">{{ totalOriginalPrice | NumFormat }}</text>
  120. <text class="money-reduced"><text class="iconfont icon-biaoqian"></text>减<text>¥{{ reducedPrice | NumFormat}}</text></text>
  121. </view>
  122. <view class="sum-price" :class="reducedPrice == 0 ? 'none' : ''">
  123. 总价:<text class="money-sign">¥</text><text class="money">{{allPrice | NumFormat}}</text>
  124. </view>
  125. </view>
  126. </view>
  127. <view v-if="!isshowDelbtn" class="footer-ri" >
  128. <view class="btn hanld-btn" @tap="toConfirmation">去结算({{allCount}})</view>
  129. </view>
  130. <view v-else class="footer-del">
  131. <view class="btn btn-cancel" @tap.stop="hideDelManage">取消</view>
  132. <view class="btn btn-confirm" @tap.stop="deleteList">删除</view>
  133. </view>
  134. </view>
  135. </view>
  136. <view v-else class="cart-content empty">
  137. <view class="empty-container">
  138. <image class="empty-container-image" src="https://img.caimei365.com/group1/M00/03/71/Cmis2F3wna6AWdWzAAGlgAP0das422.png" mode="aspectFit"></image>
  139. <text class="error-text">购物车空空如也,快去商城逛逛吧~</text>
  140. <view class="login-btn" @click="goIndex">去商城</view>
  141. </view>
  142. </view>
  143. </view>
  144. <!-- 促销活动弹窗 -->
  145. <activi-popup :product="handlerPros" :popupShow="popupShow"></activi-popup>
  146. <!-- 透明模态层 -->
  147. <modal-layer v-if='modallayer'></modal-layer>
  148. </view>
  149. </template>
  150. <script>
  151. import authorize from '@/common/config/authorize.js'
  152. import tuiSkeleton from "@/components/tui-skeleton/tui-skeleton"
  153. import tuiLoadmore from "@/components/tui-components/loadmore/loadmore"
  154. import tuiNomore from "@/components/tui-components/nomore/nomore"
  155. import headerNavbar from "@/components/cm-module/headerNavbar/headerNavbar.vue" //顶部自定义胶囊'
  156. import activiPopup from "@/components/cm-module/productDetails/cm-activipopu"
  157. import modalLayer from "@/components/modal-layer"
  158. import { mapState,mapMutations } from 'vuex';
  159. export default{
  160. components:{
  161. tuiSkeleton,
  162. tuiLoadmore,
  163. tuiNomore,
  164. modalLayer,
  165. headerNavbar,
  166. activiPopup
  167. },
  168. data(){
  169. return{
  170. nvabarData: {//顶部自定义导航
  171. showCapsule: 1, // 是否显示左上角图标 1表示显示 0表示不显示,
  172. showSearch: 0,
  173. title: '购物车', // 导航栏 中间的标题
  174. },
  175. headerBtnPosi:this.setHeaderBtnPosi(),//获取设备顶部胶囊高度
  176. systeminfo:this.setSysteminfo(), //获取设备信息
  177. CustomBar:this.CustomBar,// 顶部导航栏高度
  178. isIphoneX:this.$store.state.isIphoneX,
  179. userID:'',
  180. alertType:'',
  181. isStock:'',
  182. popupShow:false,
  183. handlerPros:{},//监听单挑促销商品
  184. failureList:[], //失效商品列表
  185. goodsList:[], //购物车的商品
  186. promotionsList:[],//促销列表
  187. delGoodsList:'',//要删除的商品
  188. setGoodData:'', //确认订单的商品
  189. isCheckAll:false,//是否全选
  190. kindCount:0,//购物车宝贝数量
  191. allPrice:0,//所有价格
  192. totalOriginalPrice:0,//所有原价价
  193. reducedPrice:0,//满减
  194. allCount:0,//被选中的产品数量
  195. isModallayer:false,
  196. skeletonShow:true,
  197. isshowDelbtn:false,
  198. isDisabled: false, // 供应商/店铺全选是否禁用状态
  199. isNoConfim:false,
  200. isEmpty:false,//显示空购物车
  201. scrollHeight: 'auto',
  202. nomoreText: '上拉显示更多',
  203. hasNextPage: false,
  204. loadding: false,
  205. pullUpOn: true,
  206. pullFlag: true,
  207. pageSize: 10,
  208. pageNum: 1,
  209. submitIds:[]
  210. }
  211. },
  212. onLoad(){
  213. this.setScrollHeight();
  214. },
  215. computed: {
  216. ...mapState(['hasLogin','userInfo','isWxAuthorize'])
  217. },
  218. filters:{
  219. NumFormat(value) {//处理金额
  220. return Number(value).toFixed(2);
  221. },
  222. totalprice(val,count){//单件商品的价格 × 数量
  223. return (val * count).toFixed(2)
  224. }
  225. },
  226. methods:{
  227. initData(){
  228. this.isModallayer = false //遮罩层 防止多次点击
  229. this.skeletonShow = true //预加载圆圈
  230. this.isCheckAll=false//是否全选
  231. this.submitIds = []
  232. this.$api.getStorage().then((resolve) => {
  233. this.userID = resolve.userId;
  234. this.initGetCartGoodsList();
  235. })
  236. },
  237. initLogin(){
  238. this.$api.redirectTo('/pages/login/login?type=4')
  239. },
  240. clickPopupShow(pros,type){
  241. this.popupShow = true;
  242. this.handlerPros = pros;
  243. },
  244. setScrollHeight() {
  245. // 窗口高度-footer高度
  246. const {windowHeight, pixelRatio} = uni.getSystemInfoSync();
  247. setTimeout(()=> {
  248. const query = uni.createSelectorQuery().in(this);
  249. query.selectAll('.footer').boundingClientRect();
  250. query.exec(res => {
  251. this.windowHeight = windowHeight;
  252. if(res[0][0]) {
  253. this.scrollHeight = windowHeight - res[0][0].height;
  254. }
  255. })
  256. }, 500)
  257. },
  258. initGetCartGoodsList(){//初始化购物车 index:1
  259. this.ProductService.QueryShoppingCartList({userId:this.userID}).then(response =>{
  260. this.skeletonShow = false
  261. let data = response.data
  262. this.kindCount = data.kindCount
  263. this.promotionsList = data.promotions
  264. this.$store.commit('updateAllNum',data.kindCount)
  265. if( data.list.length > 0 || data.invalid.length > 0){
  266. this.isEmpty =false
  267. }else{
  268. this.isEmpty =true
  269. }
  270. if(data.list && data.list.length > 0 ){
  271. this.goodsList = data.list;
  272. this.goodsList.forEach((item,index) => {
  273. item.cartList.forEach(pros => {
  274. pros.shopID = item.shopID;
  275. pros.isStep = false
  276. if(pros.step === 2){
  277. if(pros.number % pros.min != 0){
  278. pros.number = pros.min
  279. this.totalShopPeice()
  280. this.updateShoppogNum(pros)
  281. }
  282. }
  283. })
  284. })
  285. this.totalShopPeice()
  286. } else {
  287. this.goodsList = [];
  288. }
  289. if( data.invalid && data.invalid.length > 0){
  290. let newFailureList = [],isFailureLayer;
  291. data.invalid.forEach((failure,index) => {
  292. if(failure.status == 1 || failure.status == 2) {
  293. isFailureLayer = true
  294. }else{
  295. isFailureLayer = false
  296. }
  297. newFailureList.push(Object.assign({},failure,{isFailureLayer:isFailureLayer}))
  298. })
  299. this.failureList = newFailureList
  300. } else {
  301. this.failureList = [];
  302. }
  303. }).catch(error =>{
  304. this.$util.msg(error.msg,2000);
  305. })
  306. },
  307. ischeckFailure(failure){
  308. failure.productsChecked = !failure.productsChecked
  309. this.updateCheckAllBtn()
  310. },
  311. ischeck(item,pro){//为未选中的时候改变为true,反之为true
  312. pro.productsChecked = !pro.productsChecked;
  313. if(pro.productsChecked) {
  314. if(!this.submitIds.includes(pro.productID*1)){
  315. this.submitIds.push(pro.productID);
  316. }
  317. } else {
  318. var lent = this.submitIds.indexOf(pro.productID*1);
  319. if(lent >=0 ){
  320. this.submitIds.splice(lent, 1);
  321. }
  322. }
  323. this.updateProductCheckedAllBtn(item);
  324. this.updateCheckAllBtn();
  325. },
  326. updateProductCheckedAllBtn(item) {// 单独每个供应商的勾选判断
  327. let productsList = item.cartList,
  328. productsCheckedLength = 0,
  329. disabledLength = 0;
  330. if(this.isshowDelbtn) {
  331. productsList.forEach(pros => {
  332. if(pros.productsChecked) {
  333. productsCheckedLength++;
  334. }
  335. })
  336. } else {
  337. productsList.forEach(pros => {
  338. if(pros.productsChecked) {
  339. productsCheckedLength++;
  340. }
  341. })
  342. }
  343. item.checked = productsCheckedLength === productsList.length;
  344. },
  345. updateCheckAllBtn() {// 全选勾选判断
  346. let goodsCheckedLength = 0,
  347. goodsList = this.goodsList,
  348. failureList = this.failureList;
  349. goodsList.forEach(item => {
  350. if(item.checked) {
  351. goodsCheckedLength++;
  352. }
  353. })
  354. failureList.forEach(failureItem=>{
  355. if(failureItem.productsChecked){
  356. goodsCheckedLength++;
  357. }
  358. })
  359. if(this.isshowDelbtn){
  360. this.isCheckAll = goodsCheckedLength === goodsList.length + failureList.length;
  361. }else{
  362. this.isCheckAll = goodsCheckedLength === goodsList.length;
  363. }
  364. },
  365. checkShop(item){//与单选商品类似
  366. item.checked = !item.checked;
  367. this.setProductChecked(item);
  368. this.updateCheckAllBtn();
  369. },
  370. setProductChecked(item) {
  371. item.cartList.forEach(pros=>{
  372. if(item.checked) {
  373. pros.productsChecked = true;
  374. if(!this.submitIds.includes(pros.productId*1)){
  375. this.submitIds.push(pros.productId);
  376. }
  377. } else {
  378. pros.productsChecked = false;
  379. var lent = this.submitIds.indexOf(pros.productId*1);
  380. if(lent >=0 ){
  381. this.submitIds.splice(lent, 1);
  382. }
  383. }
  384. })
  385. },
  386. updateBothCheckBtn() {
  387. if(this.isshowDelbtn) {
  388. // 当管理删除按钮出现时,失效的商品可被选择
  389. this.goodsList.forEach((item)=>{
  390. item.checked = this.isCheckAll;
  391. this.setProductChecked(item);
  392. })
  393. //删除按钮 全选包括失效商品勾选
  394. this.failureList.forEach(failureItem=>{
  395. failureItem.productsChecked = this.isCheckAll;
  396. })
  397. } else {
  398. this.goodsList.forEach((item)=>{
  399. item.checked = this.isCheckAll && !item.isDisabled;
  400. this.setProductChecked(item);
  401. })
  402. }
  403. },
  404. checkAll(){//全选方法内调用方法
  405. this.isCheckAll = !this.isCheckAll;
  406. this.updateBothCheckBtn();
  407. },
  408. totalShopPeice(){//每次所属会所下的商品增减重新计算合计价格&减去含有下架的商品
  409. let touchPrice = 0;
  410. let reducedPrice = 0;//商铺合计满减价
  411. this.goodsList.map((item,index)=>{
  412. //计算店铺满减后店铺合计
  413. if(item.promotions && item.promotions.mode == 2){
  414. let prosPrice=0;
  415. let totalOriginalPrice = 0;//商铺合计原价
  416. item.cartList.forEach(pros=>{
  417. prosPrice += pros.price*pros.number
  418. totalOriginalPrice += pros.originalPrice*pros.number
  419. })
  420. if(prosPrice >= item.promotions.touchPrice){
  421. item.totalPrice = prosPrice - item.promotions.reducedPrice
  422. item.reducedPrice = item.promotions.reducedPrice
  423. item.totalOriginalPrice = totalOriginalPrice
  424. }else{
  425. item.reducedPrice = 0 //统计合计价格
  426. item.totalPrice = prosPrice
  427. }
  428. }else{//以下为计算除店铺满减以外的单品满减以及正常商品合计
  429. let _totalPrice = 0;
  430. let _reducedPrice = 0;
  431. let _totalOriginalPrice =0;
  432. item.cartList.forEach(pros=>{
  433. let _price = pros.price*pros.number
  434. _totalOriginalPrice += pros.price*pros.number;
  435. if(pros.promotions && pros.promotions.type != 2 && pros.promotions.mode == 2){
  436. if(_price >= pros.promotions.touchPrice){
  437. _price = _price - pros.promotions.reducedPrice
  438. _reducedPrice += pros.promotions.reducedPrice
  439. }
  440. _totalPrice += _price
  441. }else{
  442. _reducedPrice = 0;
  443. _totalPrice += pros.price*pros.number;
  444. }
  445. })
  446. item.reducedPrice = _reducedPrice
  447. item.totalOriginalPrice = _totalOriginalPrice
  448. item.totalPrice = _totalPrice
  449. }
  450. })
  451. },
  452. totalPeice(){//计算总价格,每次调用此方法,将初始值为0,遍历价格并累加
  453. let totalPrice = 0;
  454. let reducedPrice = 0;
  455. let originalPrice = 0;
  456. this.goodsList.forEach((item,index)=>{
  457. let supplierPrice = 0;
  458. let supplierReducedPrice = 0;
  459. item.totalprice = 0;
  460. item.reducedprice = 0;
  461. item.originalprice = 0;
  462. item.cartList.forEach(pros=>{
  463. if(pros.productsChecked){
  464. supplierPrice += pros.price*pros.number;
  465. // 单品满减
  466. if(pros.promotions && pros.promotions.type*1===1 && pros.promotions.mode*1===2){
  467. // 单品满减-重新计算供应商总价/满减金额
  468. if(pros.price*pros.number >= pros.promotions.touchPrice){
  469. supplierPrice -= pros.promotions.reducedPrice;
  470. supplierReducedPrice += pros.promotions.reducedPrice;
  471. }
  472. }
  473. }
  474. })
  475. // 店铺满减
  476. if(item.promotions && item.promotions.mode*1===2){
  477. // 店铺满减-计算供应商总价/满减金额
  478. if(supplierPrice >= item.promotions.touchPrice){
  479. supplierPrice -= item.promotions.reducedPrice;
  480. supplierReducedPrice += item.promotions.reducedPrice;
  481. }
  482. }
  483. item.totalprice = supplierPrice;
  484. item.reducedprice = supplierReducedPrice;
  485. item.originalprice = (supplierPrice+supplierReducedPrice);
  486. totalPrice += item.totalprice;
  487. reducedPrice += item.reducedprice;
  488. originalPrice += item.originalprice;
  489. })
  490. //总促销计算
  491. this.promotionsList.forEach(promotions =>{
  492. // 凑单满减
  493. if(promotions.mode*1===2 && promotions.type*1===2){
  494. let total = 0;
  495. promotions.productList.forEach(pros=>{
  496. if (this.submitIds.includes(pros.productId*1)){
  497. total += pros.number * pros.price;
  498. }
  499. });
  500. if(total>=promotions.touchPrice){
  501. totalPrice -= promotions.reducedPrice;
  502. reducedPrice += promotions.reducedPrice;
  503. }
  504. }
  505. });
  506. //最后统计商品原价
  507. this.totalOriginalPrice = originalPrice;
  508. //最后满减金额 = 店铺减去金额 + 单品减去金额 + 凑单减去金额
  509. this.reducedPrice = reducedPrice;
  510. //最终合计价格 = 店铺满减合计 + 单品满减 + 正常合计 + 凑单满减
  511. this.allPrice = totalPrice ;
  512. },
  513. totalCount(){//计算总数量
  514. this.allCount = 0
  515. let prosAllCount=0
  516. let validCount = 0
  517. let validList =[];
  518. let productsList =[];
  519. this.goodsList.forEach(item=>{
  520. productsList = item.cartList
  521. productsList.forEach(pros=>{
  522. if(pros.productsChecked){
  523. prosAllCount+=parseInt(pros.number);
  524. this.allCount = prosAllCount
  525. }
  526. })
  527. })
  528. },
  529. changeCountAdd(item,pros){//商品数量加加
  530. if(pros.step === 2){
  531. pros.isStep = false
  532. pros.number += pros.min
  533. this.processActivityPrice(pros)
  534. this.isStock = false
  535. }else{
  536. pros.number++
  537. this.processActivityPrice(pros)
  538. this.isStock = false
  539. }
  540. this.updateShoppogNum(pros)
  541. this.totalShopPeice();
  542. },
  543. changeCountSub(item,pros){//商品数量减减
  544. if(pros.number<=pros.min){
  545. pros.number= pros.min
  546. this.$util.msg(`该商品最小起订量为${pros.min}`,2000);
  547. return
  548. }else{
  549. if(pros.step === 2){
  550. pros.isStep = false
  551. pros.number -= pros.min
  552. }else{
  553. pros.number--
  554. }
  555. this.processActivityPrice(pros)
  556. }
  557. this.updateShoppogNum(pros)
  558. this.totalShopPeice();
  559. },
  560. changeInput(pros){//输入商品数量更新
  561. pros.isStep = false
  562. },
  563. changeNnmber(e,item,pros){//输入商品数量更新
  564. let _value = Number(e.detail.value);
  565. if(!this.$api.isNumber(_value)){
  566. pros.number = pros.min
  567. }else if(_value < pros.min){
  568. this.$util.msg(`该商品最小起订量为${pros.min}`,2000);
  569. pros.number = pros.min
  570. }else if(_value % pros.min != 0){
  571. pros.isStep = true
  572. pros.number = pros.min
  573. }else{
  574. pros.isStep = false
  575. pros.number = e.detail.value
  576. this.processActivityPrice(pros)
  577. }
  578. this.updateShoppogNum(pros)
  579. this.totalShopPeice();
  580. },
  581. processActivityPrice(pros){//单独处理活动价格和阶梯价格
  582. let ladderPriceList = pros.ladderPrices;
  583. if(pros.ladderFlag == '0' || pros.actStatus == 1){
  584. pros.price = pros.price
  585. }else{
  586. ladderPriceList.forEach((item,index)=>{
  587. if(pros.number>=item.buyNum){
  588. pros.price = item.buyPrice
  589. }
  590. })
  591. }
  592. },
  593. updateShoppogNum(pros){//加减购物车商品更新到后台
  594. let params ={userID:this.userID,productID:pros.productId,productCount:pros.number}
  595. this.ProductService.ShoppingCartUpdate(params).then(response =>{
  596. this.isshowDelbtn = false;
  597. this.initGetCartGoodsList();
  598. }).catch(error =>{
  599. this.$util.msg(error.msg,2000);
  600. })
  601. },
  602. toConfirmation(){//跳转确认订单页面
  603. let setGoodsList=[];
  604. this.goodsList.forEach(res=>{
  605. let products = res.cartList
  606. products.forEach(pros=>{
  607. if(pros.productsChecked){
  608. setGoodsList.push(pros.productId)
  609. }
  610. })
  611. })
  612. if(setGoodsList == ''){
  613. this.$util.msg("请先选择结算商品~",2000);
  614. return
  615. }else{
  616. this.isNoConfim = false
  617. this.goodsList.forEach(el=>{
  618. el.cartList.forEach(pros=>{
  619. if(pros.productsChecked){
  620. if(pros.number<pros.min){
  621. this.isNoConfim = true
  622. }
  623. }
  624. })
  625. })
  626. if(this.isNoConfim){
  627. this.$util.modal('','有商品的购买量没达到最小起订量,请修改数量后再次提交结算','去修改','',false,() =>{})
  628. return;
  629. }
  630. let productID = '';
  631. this.goodsList.forEach(el=>{//获取勾选的商品ID拼接字符串逗号隔开,最后一个逗号去掉
  632. el.cartList.forEach(pros=>{
  633. if(pros.productsChecked){
  634. productID += pros.productId+','
  635. }
  636. })
  637. })
  638. let cartPramsData={
  639. allPrice:this.allPrice,
  640. allCount:this.allCount,
  641. productID:productID.substring(0,productID.lastIndexOf(',')),
  642. productCount:''
  643. }
  644. this.$api.navigateTo(`/pages/user/order/create-order?data=${JSON.stringify({data:cartPramsData})}`)
  645. }
  646. },
  647. showDelManager(){//显示删除商品管理
  648. this.isshowDelbtn = true;
  649. if(this.isCheckAll) {
  650. this.updateBothCheckBtn();
  651. } else {
  652. this.goodsList.forEach(item => {
  653. if(item.checked) {
  654. item.cartList.forEach(pros => {
  655. pros.productsChecked = true;
  656. })
  657. }
  658. })
  659. this.updateCheckAllBtn();
  660. }
  661. // 失效也被勾选
  662. this.failureList.forEach(failureItem => {
  663. if(failureItem.isFailureLayer){
  664. failureItem.isFailureLayer = false
  665. }
  666. })
  667. },
  668. hideDelManage(){//隐藏删除商品管理
  669. this.isshowDelbtn = false;
  670. let isFailureLayer,newFailureList =[];
  671. if(this.isCheckAll) {
  672. this.updateBothCheckBtn();
  673. } else {
  674. // 失效商品取消勾选
  675. this.goodsList.forEach(item => {
  676. if(item.isDisabled) {
  677. item.checked = false;
  678. }
  679. item.cartList.forEach(pros => {
  680. if(pros.validFlag == 3) {
  681. pros.productsChecked = false;
  682. }
  683. })
  684. })
  685. this.updateCheckAllBtn();
  686. }
  687. this.failureList.forEach((failure,index) => {
  688. if(failure.failureState == 1 || failure.failureState == 2) {
  689. isFailureLayer = true
  690. }else{
  691. isFailureLayer = false
  692. }
  693. newFailureList.push(Object.assign({},failure,{isFailureLayer:isFailureLayer}))
  694. })
  695. this.failureList = newFailureList;
  696. },
  697. deleteList(){//删除购物车商品
  698. this.delGoodsList=[];
  699. this.goodsList.forEach(delitem=>{
  700. let products = delitem.cartList
  701. products.forEach(pros=>{
  702. if(pros.productsChecked){
  703. this.delGoodsList += pros.productId+','
  704. }
  705. })
  706. })
  707. this.failureList.forEach(failure=>{
  708. if(failure.productsChecked){
  709. this.delGoodsList += failure.productId+','
  710. }
  711. })
  712. if(this.delGoodsList.length == 0){
  713. this.$util.msg("请选择要删除的商品~",2000);
  714. return
  715. }else{
  716. this.$util.modal('','确定删除选中的商品吗?','确定','取消',true,() =>{
  717. this.ProductService.ShoppingCartDelete({userID:this.userID,productIDs:this.delGoodsList}).then(response =>{
  718. this.$util.msg('删除成功',2000);
  719. setTimeout(()=>{
  720. this.isshowDelbtn = false;
  721. this.initGetCartGoodsList();
  722. },2000)
  723. }).catch(error =>{
  724. this.$util.msg(error.msg,2000)
  725. })
  726. })
  727. }
  728. },
  729. deletefailureList(){
  730. this.failureList.forEach(failure=>{ this.delGoodsList += failure.productId+',' })
  731. this.$util.modal('','确定清空全部失效商品吗?','确定','取消',true,() =>{
  732. this.ProductService.ShoppingCartDelete({userID:this.userID,productIDs:this.delGoodsList}).then(response =>{
  733. this.$util.msg('删除成功',2000);
  734. setTimeout(()=>{
  735. this.isshowDelbtn = false;
  736. this.initGetCartGoodsList();
  737. },2000)
  738. }).catch(error =>{
  739. this.$util.msg(error.msg,2000)
  740. })
  741. })
  742. },
  743. goIndex(){
  744. uni.switchTab({
  745. url: '/pages/tabBar/home/index'
  746. });
  747. },
  748. goNavto(url){
  749. uni.navigateTo ({
  750. url
  751. })
  752. },
  753. navToListPage(id){
  754. this.isModallayer = true;
  755. this.$api.navigateTo(`/pages/goods/product?id=${id}`)
  756. },
  757. failureToProduct(failure){
  758. if(failure.status == 1){
  759. this.$util.msg('商品已丢失,不能查看',2000)
  760. return
  761. }else if(failure.status == 2){
  762. this.$util.msg('商品已停售,不能查看',2000)
  763. return
  764. }else{
  765. this.isModallayer = true;
  766. this.$api.navigateTo(`/pages/goods/product?id=${failure.productId}`)
  767. }
  768. },
  769. failureStateText(state){
  770. let stateText = '',
  771. stateTextObject={
  772. 1:'商品已丢失',
  773. 2:'商品已停售',
  774. 3:'商品已下架',
  775. 4:'商品已售罄',
  776. 5:'价格仅会员可见,您不能购买',
  777. 6:'未公开价格',
  778. 7:'库存不足'
  779. }
  780. Object.keys(stateTextObject).forEach(key => {
  781. if(key == state){
  782. stateText = stateTextObject[key]
  783. }
  784. })
  785. return stateText;
  786. },
  787. setHeaderBtnPosi(){
  788. // 获得胶囊按钮位置信息
  789. let headerBtnPosi = uni.getMenuButtonBoundingClientRect();
  790. return headerBtnPosi
  791. },
  792. setSysteminfo(){
  793. let systeminfo;
  794. uni.getSystemInfo({ // 获取设备信息
  795. success: (res) => {
  796. systeminfo = res
  797. },
  798. })
  799. return systeminfo
  800. },
  801. PromotionsFormat(promo){//促销活动类型数据处理
  802. if(promo!=null){
  803. if(promo.type == 1 && promo.mode == 1){
  804. return true
  805. }else{
  806. return false
  807. }
  808. }
  809. return false
  810. }
  811. },
  812. watch:{//深度监听所有数据,每次改变重新计算总价和总数
  813. goodsList:{
  814. deep:true,
  815. handler(val,oldval){
  816. this.totalPeice()
  817. this.totalCount()
  818. }
  819. }
  820. },
  821. onPullDownRefresh() {//下拉刷新
  822. this.initGetCartGoodsList()
  823. uni.stopPullDownRefresh()
  824. },
  825. onShow(){
  826. if(this.hasLogin){
  827. this.initData()
  828. }else{
  829. this.initLogin()
  830. }
  831. },
  832. }
  833. </script>
  834. <style lang="scss">
  835. page{
  836. background: #f7f7f7;
  837. height: auto;
  838. }
  839. .cart-content{
  840. position: relative;
  841. }
  842. .container-cart-main.none{
  843. display: none;
  844. }
  845. .container-cart-main.show{
  846. display: block;
  847. }
  848. .cart-content.empty.none{
  849. display: none;
  850. }
  851. .cart-content.empty.show{
  852. display: block;
  853. }
  854. .container-cart.show{
  855. display: block;
  856. }
  857. .container-cart.none{
  858. display: none;
  859. }
  860. .empty-container.none{
  861. display: none;
  862. }
  863. .empty-container.show{
  864. display: flex;
  865. }
  866. .foot-check-delbtn{
  867. width: 100%;
  868. height: 80rpx;
  869. position: fixed;
  870. top: 0;
  871. left: 0;
  872. box-sizing: border-box;
  873. padding: 15rpx 24rpx;
  874. background-color: #F7F7F7;
  875. z-index: 990;
  876. .foot-text{
  877. font-size: $font-size-26;
  878. height: 50rpx;
  879. line-height: 50rpx;
  880. color: $text-color;
  881. float: left;
  882. padding-left: 10rpx;
  883. text{
  884. color: $color-system;
  885. margin: 0 6rpx;
  886. }
  887. }
  888. .delBtn{
  889. width: 100rpx;
  890. display: inline-block;
  891. padding: 0 15rpx;
  892. font-size: $font-size-26;
  893. height: 50rpx;
  894. line-height: 50rpx;
  895. border-radius: 30rpx;
  896. background:#FFFFFF;
  897. border: 1px solid #C9C9C9;
  898. color: #E15616;
  899. float: right;
  900. text-align: center;
  901. &.none{
  902. display: none;
  903. }
  904. }
  905. }
  906. .checkbox-box{
  907. display: flex;
  908. align-items: center;
  909. .checkbox{
  910. display: flex;
  911. margin: 0;
  912. padding: 0;
  913. display: flex;
  914. flex-direction: column;
  915. align-items: center;
  916. box-sizing: border-box;
  917. text-align: center;
  918. text-decoration: none;
  919. border-radius: 0;
  920. -webkit-tap-highlight-color: transparent;
  921. overflow: hidden;
  922. background-color:#FFFFFF;
  923. font-size: 36rpx;
  924. color:$color-system;
  925. }
  926. &.disabled{
  927. .checkbox{
  928. color:#999999
  929. }
  930. }
  931. .text{
  932. font-size: $font-size-24;
  933. margin-left: 10rpx;
  934. }
  935. }
  936. .goods-list{
  937. width: 100%;
  938. height: auto;
  939. background-color: #F7F7F7;
  940. .goods-item{
  941. width: 702rpx;
  942. padding: 0 24rpx;
  943. background: #FFFFFF;
  944. margin-bottom: 24rpx;
  945. }
  946. .shoptitle{
  947. display: flex;
  948. align-items: center;
  949. height: 80rpx;
  950. line-height: 80rpx;
  951. .checkbox-box{
  952. padding: 10rpx;
  953. }
  954. .text{
  955. width: 450rpx;
  956. display: block;
  957. overflow: hidden;
  958. text-overflow:ellipsis;
  959. white-space: nowrap;
  960. margin-left: 20rpx;
  961. font-size: $font-size-28;
  962. color: $text-color;
  963. text-align: left;
  964. font-weight: bold;
  965. }
  966. .floor-item-act{
  967. height: 56rpx;
  968. text-align: center;
  969. box-sizing: border-box;
  970. float: left;
  971. padding:10rpx 0;
  972. margin-left: 20rpx;
  973. .floor-tags{
  974. height: 28rpx;
  975. border-radius: 6rpx;
  976. background-color: #FFFFFF;
  977. line-height: 28rpx;
  978. color: $color-system;
  979. text-align: center;
  980. display: inline-block;
  981. padding:0 16rpx;
  982. font-size: $font-size-20;
  983. border: 1px solid #E15616;
  984. float: right;
  985. }
  986. }
  987. }
  988. .goods-pros{
  989. width: 100%;
  990. height: auto;
  991. }
  992. .goods-pros-t{
  993. display: flex;
  994. align-items: center;
  995. width: 100%;
  996. height: 210rpx;
  997. padding:0 0 20rpx 0;
  998. .checkbox-box{
  999. padding: 10rpx;
  1000. }
  1001. .pros-img{
  1002. width: 210rpx;
  1003. height: 100%;
  1004. border-radius: 10rpx;
  1005. margin:0 20rpx;
  1006. border:1px solid #f3f3f3;
  1007. image{
  1008. width: 100%;
  1009. height: 100%;
  1010. border-radius: 10rpx;
  1011. }
  1012. }
  1013. }
  1014. .goods-pros-b{
  1015. width:100%;
  1016. height: auto;
  1017. padding:0 0 24rpx 0;
  1018. box-sizing: border-box;
  1019. &.show{
  1020. display: block;
  1021. }
  1022. &.none{
  1023. display: none;
  1024. }
  1025. .sum-none{
  1026. width: 100%;
  1027. height: 40rpx;
  1028. line-height: 40rpx;
  1029. color: $text-color;
  1030. float: left;
  1031. text-align: right;
  1032. .money{
  1033. font-size: $font-size-24;
  1034. color: #999999;
  1035. text-decoration: line-through;
  1036. }
  1037. .money-sign{
  1038. font-size: $font-size-24;
  1039. color: #999999;
  1040. text-decoration: line-through;
  1041. }
  1042. .money-reduced{
  1043. margin-left: 10rpx;
  1044. font-size: $font-size-24;
  1045. color: $color-system;
  1046. }
  1047. }
  1048. .sum{
  1049. width: 100%;
  1050. height: 40rpx;
  1051. font-size: $font-size-28;
  1052. line-height: 40rpx;
  1053. color: $text-color;
  1054. float: left;
  1055. display: flex;
  1056. justify-content: flex-end;
  1057. .money{
  1058. color: #FF2A2A;
  1059. font-size: $font-size-28;
  1060. }
  1061. .money-sign{
  1062. font-size: $font-size-24;
  1063. color: #FF2A2A;
  1064. }
  1065. }
  1066. }
  1067. .pros-product{
  1068. width: 402rpx;
  1069. height: 100%;
  1070. line-height: 36rpx;
  1071. font-size: $font-size-28;
  1072. position: relative;
  1073. .producttitle{
  1074. width: 100%;
  1075. display: inline-block;
  1076. height: auto;
  1077. text-overflow:ellipsis;
  1078. display: -webkit-box;
  1079. word-break: break-all;
  1080. -webkit-box-orient: vertical;
  1081. -webkit-line-clamp: 2;
  1082. overflow: hidden;
  1083. margin-bottom: 8rpx;
  1084. .no-text{
  1085. display: inline-block;
  1086. height:36rpx;
  1087. padding: 0 12rpx;
  1088. line-height: 36rpx;
  1089. background:linear-gradient(315deg,rgba(231,0,0,1) 0%,rgba(255,104,1,1) 100%);
  1090. border-radius:18rpx;
  1091. text-align: center;
  1092. color: #FFFFFF;
  1093. font-size:$font-size-28;
  1094. margin-right: 24rpx;
  1095. }
  1096. }
  1097. .productspec{
  1098. height: 36rpx;
  1099. color: #999999;
  1100. font-size: $font-size-26;
  1101. }
  1102. .productprice{
  1103. width: 100%;
  1104. height: 48rpx;
  1105. margin: 10rpx 0 0 0;
  1106. .price{
  1107. line-height: 48rpx;
  1108. font-size: $font-size-28;
  1109. width: 48%;
  1110. color: #FF2A2A;
  1111. float: left;
  1112. &.disabled{
  1113. color: #999999;
  1114. text-decoration: line-through;
  1115. }
  1116. .money-sign{
  1117. font-size: $font-size-24;
  1118. color: #FF2A2A;
  1119. }
  1120. }
  1121. .count{
  1122. height: 100%;
  1123. float: right;
  1124. position: relative;
  1125. &.show{
  1126. display: block;
  1127. }
  1128. &.none{
  1129. display: none;
  1130. }
  1131. .count-tips{
  1132. width: auto;
  1133. display: inline-block;
  1134. padding: 0 15rpx;
  1135. line-height: 44rpx;
  1136. height: 44rpx;
  1137. border-radius: 22rpx;
  1138. background: $btn-confirm;
  1139. font-size: $font-size-24;
  1140. text-align: center;
  1141. color: #FFFFFF;
  1142. position: absolute;
  1143. top:-60rpx;
  1144. left: -5rpx;
  1145. z-index: 5;
  1146. &.step{
  1147. left:-217rpx
  1148. }
  1149. &::before{
  1150. content: "";
  1151. position: absolute;
  1152. bottom: -30rpx;
  1153. right: 15rpx;
  1154. z-index:1;
  1155. width: 0;
  1156. height: 0;
  1157. border-width: 18rpx;
  1158. border-style: solid;
  1159. border-color:$color-system transparent transparent transparent;
  1160. }
  1161. }
  1162. .number-box{
  1163. display: flex;
  1164. justify-content: center;
  1165. align-items: center;
  1166. border: 2rpx solid #ffe6dc;
  1167. border-radius: 30rpx;
  1168. .iconfont{
  1169. font-size: $font-size-24;
  1170. padding:0 18rpx;
  1171. color: #999999;
  1172. text-align: center;
  1173. line-height: 48rpx;
  1174. font-weight: bold;
  1175. background: #fef6f3;
  1176. &.icon-jianhao{
  1177. border-radius: 30rpx 0 0 30rpx;
  1178. }
  1179. &.icon-jiahao{
  1180. border-radius: 0 30rpx 30rpx 0;
  1181. }
  1182. }
  1183. .btn-input{
  1184. width: 62rpx;
  1185. height: 48rpx;
  1186. line-height: 48rpx;
  1187. background: #fff;
  1188. border-radius: 4rpx;
  1189. text-align: center;
  1190. font-size: $font-size-24;
  1191. }
  1192. }
  1193. .uni-numbox{
  1194. position: absolute;
  1195. left: 45rpx;
  1196. bottom: 0;
  1197. .uni-numbox-minus, .uni-numbox-plus{
  1198. width: 50rpx;
  1199. line-height: 40rpx;
  1200. }
  1201. .uni-numbox-value {
  1202. font-size: $font-size-28;
  1203. width: 60rpx;
  1204. }
  1205. }
  1206. }
  1207. }
  1208. .floor-item-act{
  1209. width: 100%;
  1210. height: 56rpx;
  1211. text-align: center;
  1212. box-sizing: border-box;
  1213. float: left;
  1214. padding:0 0 10rpx 0;
  1215. margin-left: 10rpx;
  1216. .floor-tags{
  1217. height: 28rpx;
  1218. border-radius: 6rpx;
  1219. background-color: #FFFFFF;
  1220. line-height: 28rpx;
  1221. color: $color-system;
  1222. text-align: center;
  1223. display: inline-block;
  1224. padding:0 16rpx;
  1225. font-size: $font-size-20;
  1226. border: 1px solid #E15616;
  1227. float: left;
  1228. }
  1229. }
  1230. }
  1231. }
  1232. .failure-list{
  1233. width: 702rpx;
  1234. height: auto;
  1235. padding: 0 24rpx;
  1236. margin-top: 20rpx;
  1237. background: #FFFFFF;
  1238. .failure-title{
  1239. width: 100%;
  1240. height: 80rpx;
  1241. line-height: 80rpx;
  1242. font-size: $font-size-28;
  1243. border-bottom: 1px solid #EBEBEB;
  1244. .title-txt{
  1245. float: left;
  1246. color: $text-color;
  1247. text-align: left;
  1248. }
  1249. .title-btn{
  1250. float: right;
  1251. color: $color-system;
  1252. text-align: right;
  1253. line-height: 80rpx;
  1254. .butto{
  1255. display: inline-block;
  1256. padding: 0 15rpx;
  1257. font-size: $font-size-26;
  1258. height: 50rpx;
  1259. line-height: 50rpx;
  1260. border-radius: 30rpx;
  1261. background:#FFFFFF;
  1262. // border: 1px solid #C9C9C9;
  1263. // color: #999999;
  1264. margin-top: 15rpx;
  1265. }
  1266. }
  1267. }
  1268. .productlist{
  1269. padding-top: 10rpx;
  1270. .goods-pros{
  1271. width: 100%;
  1272. height: auto;
  1273. padding: 20rpx 0;
  1274. }
  1275. .goods-pros-t{
  1276. display: flex;
  1277. align-items: center;
  1278. width: 100%;
  1279. height: 210rpx;
  1280. position: relative;
  1281. .checkbox-box{
  1282. padding: 10rpx;
  1283. }
  1284. .pros-img{
  1285. width: 210rpx;
  1286. height: 100%;
  1287. border-radius: 10rpx;
  1288. margin:0 20rpx;
  1289. border:1px solid #f3f3f3;
  1290. position: relative;
  1291. .img-tip{
  1292. display: block;
  1293. width: 72rpx;
  1294. height: 36rpx;
  1295. line-height: 36rpx;
  1296. font-size: $font-size-24;
  1297. text-align: center;
  1298. color: #FFFFFF;
  1299. border-radius: 10rpx 0 10rpx 0;
  1300. background:linear-gradient(34deg,rgba(255,149,42,1) 0%,rgba(225,86,22,1) 100%);
  1301. position: absolute;
  1302. left: 0;
  1303. top: 0;
  1304. }
  1305. image{
  1306. width: 100%;
  1307. height: 100%;
  1308. border-radius: 10rpx;
  1309. }
  1310. }
  1311. .pros-marks{
  1312. width: 730rpx;
  1313. height: 250rpx;
  1314. z-index: 90;
  1315. background: rgba(0,0,0,.05);
  1316. position: absolute;
  1317. left:-20rpx;
  1318. top: -20rpx;
  1319. }
  1320. }
  1321. .goods-pros-b{
  1322. width:622rpx;
  1323. margin-left: 84rpx;
  1324. height: 40rpx;
  1325. padding:0 0 26rpx 0;
  1326. // border-top: 1px solid #EBEBEB;
  1327. &.show{
  1328. display: block;
  1329. }
  1330. &.none{
  1331. display: none;
  1332. }
  1333. .sum{
  1334. font-size: $font-size-28;
  1335. line-height: 40rpx;
  1336. color: $text-color;
  1337. display: flex;
  1338. justify-content: flex-end;
  1339. .money{
  1340. color: #FF2A2A;
  1341. font-size: $font-size-28;
  1342. }
  1343. .money-sign{
  1344. font-size: $font-size-24;
  1345. color: #FF2A2A;
  1346. }
  1347. }
  1348. }
  1349. .pros-product{
  1350. width: 402rpx;
  1351. height: 100%;
  1352. line-height: 36rpx;
  1353. font-size: $font-size-28;
  1354. position: relative;
  1355. .producttitle{
  1356. width: 100%;
  1357. display: inline-block;
  1358. height: auto;
  1359. text-overflow:ellipsis;
  1360. display: -webkit-box;
  1361. word-break: break-all;
  1362. -webkit-box-orient: vertical;
  1363. -webkit-line-clamp: 2;
  1364. overflow: hidden;
  1365. margin-bottom: 8rpx;
  1366. .no-text{
  1367. display: inline-block;
  1368. height:36rpx;
  1369. padding: 0 12rpx;
  1370. line-height: 36rpx;
  1371. background:linear-gradient(315deg,rgba(231,0,0,1) 0%,rgba(255,104,1,1) 100%);
  1372. border-radius:18rpx;
  1373. text-align: center;
  1374. color: #FFFFFF;
  1375. font-size: $font-size-28;
  1376. margin-right: 24rpx;
  1377. }
  1378. }
  1379. .productspec{
  1380. height: 36rpx;
  1381. color: #999999;
  1382. font-size: $font-size-26;
  1383. }
  1384. .productstate{
  1385. font-size: $font-size-28;
  1386. height: 44rpx;
  1387. color: #FF2A2A;
  1388. position: absolute;
  1389. bottom: 0;
  1390. left: 0;
  1391. }
  1392. }
  1393. }
  1394. }
  1395. .footer{
  1396. width: 100%;
  1397. background-color: #FFFFFF;
  1398. height: 110rpx;
  1399. position: fixed;
  1400. bottom: 0rpx;
  1401. z-index: 100;
  1402. .footer-le{
  1403. width: 520rpx;
  1404. height: 100%;
  1405. padding:0 24rpx;
  1406. float: left;
  1407. box-sizing: border-box;
  1408. float: left;
  1409. .foot-check{
  1410. width: 100rpx;
  1411. float: left;
  1412. line-height: 110rpx;
  1413. font-size: $font-size-24;
  1414. .checkbox{
  1415. width: 40rpx;
  1416. text-align: center;
  1417. }
  1418. .text{
  1419. width: 60rpx;
  1420. float: right;
  1421. }
  1422. }
  1423. .sum{
  1424. width: 360rpx;
  1425. height: 110rpx;
  1426. float: right;
  1427. box-sizing: border-box;
  1428. padding: 10rpx;
  1429. .sum-none{
  1430. width: 100%;
  1431. height: 45rpx;
  1432. line-height: 45rpx;
  1433. color: $text-color;
  1434. float: left;
  1435. text-align: right;
  1436. .money{
  1437. font-size: $font-size-24;
  1438. color: #999999;
  1439. text-decoration: line-through;
  1440. }
  1441. .money-sign{
  1442. font-size: $font-size-24;
  1443. color: #999999;
  1444. text-decoration: line-through;
  1445. }
  1446. .money-reduced{
  1447. margin-left: 10rpx;
  1448. font-size: $font-size-24;
  1449. color: $color-system;
  1450. }
  1451. }
  1452. .sum-price{
  1453. text-align: right;
  1454. width: 100%;
  1455. height: 45rpx;
  1456. line-height: 45rpx;
  1457. font-size: $font-size-30;
  1458. color: $text-color;
  1459. float: left;
  1460. font-weight: normal;
  1461. &.none{
  1462. height: 90rpx;
  1463. line-height: 90rpx;
  1464. }
  1465. .money{
  1466. color: #FF2A2A;
  1467. }
  1468. .money-sign{
  1469. font-size: $font-size-24;
  1470. color: #FF2A2A;
  1471. }
  1472. }
  1473. }
  1474. }
  1475. .footer-ri{
  1476. width: 230rpx;
  1477. height: 100%;
  1478. float: right;
  1479. display: flex;
  1480. justify-content: space-between;
  1481. align-items: center;
  1482. z-index: 999;
  1483. box-sizing: border-box;
  1484. padding: 13rpx 15rpx;
  1485. &.none{
  1486. display: none;
  1487. }
  1488. .btn{
  1489. width: 200rpx;
  1490. height: 100%;
  1491. background:linear-gradient(135deg,rgba(242,143,49,1) 0%,rgba(225,86,22,1) 100%);
  1492. font-size: $font-size-28;
  1493. line-height: 84rpx;
  1494. color: #FFFFFF;
  1495. display: flex;
  1496. border-radius: 42rpx;
  1497. justify-content: center;
  1498. align-items: center;
  1499. }
  1500. }
  1501. .footer-del{
  1502. width: 400rpx;
  1503. height: 110rpx;
  1504. position: absolute;
  1505. padding-left: 200rpx;
  1506. background: #FFFFFF;
  1507. right: 0;
  1508. top: 0;
  1509. z-index: 1000;
  1510. &.show{
  1511. animation: showDelbtn 0s linear both;
  1512. }
  1513. &.none{
  1514. animation: hideDelbtn 0s linear both;
  1515. }
  1516. .btn{
  1517. width: 50%;
  1518. height: 100%;
  1519. line-height: 110rpx;
  1520. font-size: $font-size-28;
  1521. color: #FFFFFF;
  1522. text-align: center;
  1523. float: left;
  1524. }
  1525. .btn.btn-cancel{
  1526. background:#EEC1AB;
  1527. }
  1528. .btn.btn-confirm{
  1529. background:#FF2A2A;
  1530. }
  1531. @keyframes showDelbtn {
  1532. 0% {
  1533. transform: translateX(0);
  1534. }
  1535. 100% {
  1536. transform: translateX(-100%);
  1537. }
  1538. }
  1539. @keyframes hideDelbtn {
  1540. 0% {
  1541. transform: translateX(-100%);
  1542. }
  1543. 100% {
  1544. transform: translateX(0);
  1545. }
  1546. }
  1547. }
  1548. }
  1549. </style>