cart.vue 42 KB

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