cart.vue 41 KB

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