cart.vue 43 KB

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