cart.vue 43 KB

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