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