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