cart.vue 41 KB

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