cart.vue 42 KB

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