cart.vue 41 KB

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