cart.vue 43 KB

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