cart.vue 41 KB

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