cart.vue 41 KB

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