cart.vue 43 KB

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