cart.vue 38 KB

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