cart.vue 41 KB

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