cart.vue 43 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554
  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. console.log('111111111111')
  748. this.isModallayer = true;
  749. this.$api.navigateTo(`/pages/goods/product?id=${id}`)
  750. },
  751. failureToProduct(failure){
  752. if(failure.status == 1){
  753. this.$util.msg('商品已丢失,不能查看',2000)
  754. return
  755. }else if(failure.status == 2){
  756. this.$util.msg('商品已停售,不能查看',2000)
  757. return
  758. }else{
  759. this.isModallayer = true;
  760. this.$api.navigateTo(`/pages/goods/product?id=${failure.productId}`)
  761. }
  762. },
  763. failureStateText(state){
  764. let stateText = '',
  765. stateTextObject={
  766. 1:'商品已丢失',
  767. 2:'商品已停售',
  768. 3:'商品已下架',
  769. 4:'商品已售罄',
  770. 5:'价格仅会员可见,您不能购买',
  771. 6:'未公开价格',
  772. 7:'库存不足'
  773. }
  774. Object.keys(stateTextObject).forEach(key => {
  775. if(key == state){
  776. stateText = stateTextObject[key]
  777. }
  778. })
  779. return stateText;
  780. },
  781. setHeaderBtnPosi(){
  782. // 获得胶囊按钮位置信息
  783. let headerBtnPosi = uni.getMenuButtonBoundingClientRect();
  784. return headerBtnPosi
  785. },
  786. setSysteminfo(){
  787. let systeminfo;
  788. uni.getSystemInfo({ // 获取设备信息
  789. success: (res) => {
  790. systeminfo = res
  791. },
  792. })
  793. return systeminfo
  794. },
  795. PromotionsFormat(promo){//促销活动类型数据处理
  796. if(promo!=null){
  797. if(promo.type == 1 && promo.mode == 1){
  798. return true
  799. }else{
  800. return false
  801. }
  802. }
  803. return false
  804. }
  805. },
  806. watch:{//深度监听所有数据,每次改变重新计算总价和总数
  807. goodsList:{
  808. deep:true,
  809. handler(val,oldval){
  810. this.totalPeice()
  811. this.totalCount()
  812. }
  813. }
  814. },
  815. onPullDownRefresh() {//下拉刷新
  816. this.initGetCartGoodsList()
  817. uni.stopPullDownRefresh()
  818. },
  819. onShow(){
  820. if(this.hasLogin){
  821. this.initData()
  822. }else{
  823. this.initLogin()
  824. }
  825. },
  826. }
  827. </script>
  828. <style lang="scss">
  829. page{
  830. background: #f7f7f7;
  831. height: auto;
  832. }
  833. .cart-content{
  834. position: relative;
  835. }
  836. .container-cart-main.none{
  837. display: none;
  838. }
  839. .container-cart-main.show{
  840. display: block;
  841. }
  842. .cart-content.empty.none{
  843. display: none;
  844. }
  845. .cart-content.empty.show{
  846. display: block;
  847. }
  848. .container-cart.show{
  849. display: block;
  850. }
  851. .container-cart.none{
  852. display: none;
  853. }
  854. .empty-container.none{
  855. display: none;
  856. }
  857. .empty-container.show{
  858. display: flex;
  859. }
  860. .foot-check-delbtn{
  861. width: 100%;
  862. height: 80rpx;
  863. position: fixed;
  864. top: 0;
  865. left: 0;
  866. box-sizing: border-box;
  867. padding: 15rpx 24rpx;
  868. background-color: #F7F7F7;
  869. z-index: 990;
  870. .foot-text{
  871. font-size: $font-size-26;
  872. height: 50rpx;
  873. line-height: 50rpx;
  874. color:#666666;
  875. float: left;
  876. padding-left: 10rpx;
  877. text{
  878. margin: 0 6rpx;
  879. }
  880. }
  881. .delBtn{
  882. width: 100rpx;
  883. display: inline-block;
  884. padding: 0 15rpx;
  885. font-size: $font-size-26;
  886. height: 50rpx;
  887. line-height: 50rpx;
  888. border-radius: 30rpx;
  889. background:#FFFFFF;
  890. border: 1px solid #e15616;
  891. color: #E15616;
  892. float: right;
  893. text-align: center;
  894. &.none{
  895. display: none;
  896. }
  897. }
  898. }
  899. .checkbox-box{
  900. display: flex;
  901. align-items: center;
  902. .checkbox{
  903. display: flex;
  904. margin: 0;
  905. padding: 5rpx;
  906. display: flex;
  907. flex-direction: column;
  908. align-items: center;
  909. box-sizing: border-box;
  910. text-align: center;
  911. text-decoration: none;
  912. border-radius: 0;
  913. -webkit-tap-highlight-color: transparent;
  914. overflow: hidden;
  915. background-color:#FFFFFF;
  916. font-size: 36rpx;
  917. color:#999999;
  918. &.icon-yixuanze{
  919. color: $color-system;
  920. }
  921. }
  922. &.disabled{
  923. .checkbox{
  924. color:#999999
  925. }
  926. }
  927. .text{
  928. font-size: $font-size-24;
  929. margin-left: 10rpx;
  930. }
  931. }
  932. .goods-list{
  933. width: 100%;
  934. height: auto;
  935. background-color: #F7F7F7;
  936. .goods-item{
  937. width: 702rpx;
  938. padding: 0 24rpx;
  939. background: #FFFFFF;
  940. margin-bottom: 24rpx;
  941. }
  942. .shoptitle{
  943. display: flex;
  944. align-items: center;
  945. height: 80rpx;
  946. line-height: 80rpx;
  947. .checkbox-box{
  948. padding: 10rpx;
  949. }
  950. .text{
  951. width: 450rpx;
  952. display: block;
  953. overflow: hidden;
  954. text-overflow:ellipsis;
  955. white-space: nowrap;
  956. margin-left: 20rpx;
  957. font-size: $font-size-28;
  958. color: $text-color;
  959. text-align: left;
  960. font-weight: bold;
  961. }
  962. .floor-item-act{
  963. height: 56rpx;
  964. text-align: center;
  965. box-sizing: border-box;
  966. float: left;
  967. padding:10rpx 0;
  968. margin-left: 20rpx;
  969. .floor-tags{
  970. height: 28rpx;
  971. border-radius: 6rpx;
  972. background-color: #FFFFFF;
  973. line-height: 28rpx;
  974. color: $color-system;
  975. text-align: center;
  976. display: inline-block;
  977. padding:0 16rpx;
  978. font-size: $font-size-20;
  979. border: 1px solid #E15616;
  980. float: right;
  981. }
  982. }
  983. }
  984. .goods-pros{
  985. width: 100%;
  986. height: auto;
  987. margin-bottom: 20rpx;
  988. }
  989. .goods-pros-t{
  990. display: flex;
  991. align-items: center;
  992. width: 100%;
  993. height: 210rpx;
  994. padding:0 0 26rpx 0;
  995. .checkbox-box{
  996. padding: 10rpx;
  997. }
  998. .pros-img{
  999. width: 210rpx;
  1000. height: 100%;
  1001. border-radius: 10rpx;
  1002. margin:0 20rpx;
  1003. border:1px solid #f3f3f3;
  1004. image{
  1005. width: 100%;
  1006. height: 100%;
  1007. border-radius: 10rpx;
  1008. }
  1009. }
  1010. }
  1011. .goods-pros-b{
  1012. width:100%;
  1013. height: auto;
  1014. padding:0 0 24rpx 0;
  1015. box-sizing: border-box;
  1016. &.show{
  1017. display: block;
  1018. }
  1019. &.none{
  1020. display: none;
  1021. }
  1022. .sum-none{
  1023. width: 100%;
  1024. height: 48rpx;
  1025. line-height: 48rpx;
  1026. color: $text-color;
  1027. float: left;
  1028. text-align: right;
  1029. .money{
  1030. font-size: $font-size-26;
  1031. color: #999999;
  1032. text-decoration: line-through;
  1033. }
  1034. .money-sign{
  1035. font-size: $font-size-26;
  1036. color: #999999;
  1037. text-decoration: line-through;
  1038. }
  1039. .money-reduced{
  1040. margin-left: 10rpx;
  1041. font-size: $font-size-26;
  1042. color: $color-system;
  1043. .iconfont{
  1044. font-size: $font-size-34;
  1045. }
  1046. }
  1047. }
  1048. .sum{
  1049. width: 100%;
  1050. height: 40rpx;
  1051. font-size: $font-size-26;
  1052. line-height: 40rpx;
  1053. color: $text-color;
  1054. float: left;
  1055. display: flex;
  1056. justify-content: flex-end;
  1057. font-weight: bold;
  1058. .money{
  1059. color: #FF2A2A;
  1060. font-size: $font-size-26;
  1061. }
  1062. .money-sign{
  1063. font-size: $font-size-24;
  1064. color: #FF2A2A;
  1065. }
  1066. }
  1067. }
  1068. .pros-product{
  1069. width: 416rpx;
  1070. height: 100%;
  1071. line-height: 36rpx;
  1072. font-size: $font-size-28;
  1073. position: relative;
  1074. .producttitle{
  1075. width: 100%;
  1076. display: inline-block;
  1077. height: auto;
  1078. text-overflow:ellipsis;
  1079. display: -webkit-box;
  1080. word-break: break-all;
  1081. -webkit-box-orient: vertical;
  1082. -webkit-line-clamp: 2;
  1083. overflow: hidden;
  1084. margin-bottom: 15rpx;
  1085. .no-text{
  1086. display: inline-block;
  1087. height:36rpx;
  1088. padding: 0 12rpx;
  1089. line-height: 36rpx;
  1090. background:linear-gradient(315deg,rgba(231,0,0,1) 0%,rgba(255,104,1,1) 100%);
  1091. border-radius:18rpx;
  1092. text-align: center;
  1093. color: #FFFFFF;
  1094. font-size:$font-size-28;
  1095. margin-right: 24rpx;
  1096. }
  1097. }
  1098. .productspec{
  1099. height: 36rpx;
  1100. color: #999999;
  1101. font-size: $font-size-26;
  1102. }
  1103. .productprice{
  1104. width: 100%;
  1105. height: 48rpx;
  1106. margin: 30rpx 0 0 0;
  1107. .price{
  1108. line-height: 48rpx;
  1109. font-size: $font-size-26;
  1110. width: 48%;
  1111. color: #FF2A2A;
  1112. float: left;
  1113. font-weight: bold;
  1114. &.disabled{
  1115. color: #999999;
  1116. text-decoration: line-through;
  1117. }
  1118. .money-sign{
  1119. font-size: $font-size-24;
  1120. color: #FF2A2A;
  1121. }
  1122. }
  1123. .count{
  1124. height: 100%;
  1125. float: right;
  1126. position: relative;
  1127. &.show{
  1128. display: block;
  1129. }
  1130. &.none{
  1131. display: none;
  1132. }
  1133. .count-tips{
  1134. width: auto;
  1135. display: inline-block;
  1136. padding: 0 15rpx;
  1137. line-height: 44rpx;
  1138. height: 44rpx;
  1139. border-radius: 22rpx;
  1140. background: $btn-confirm;
  1141. font-size: $font-size-24;
  1142. text-align: center;
  1143. color: #FFFFFF;
  1144. position: absolute;
  1145. top:-60rpx;
  1146. left: -5rpx;
  1147. z-index: 5;
  1148. &.step{
  1149. left:-217rpx
  1150. }
  1151. &::before{
  1152. content: "";
  1153. position: absolute;
  1154. bottom: -30rpx;
  1155. right: 15rpx;
  1156. z-index:1;
  1157. width: 0;
  1158. height: 0;
  1159. border-width: 18rpx;
  1160. border-style: solid;
  1161. border-color:$color-system transparent transparent transparent;
  1162. }
  1163. }
  1164. .number-box{
  1165. display: flex;
  1166. justify-content: center;
  1167. align-items: center;
  1168. border: 2rpx solid #ffe6dc;
  1169. border-radius: 30rpx;
  1170. .iconfont{
  1171. font-size: $font-size-24;
  1172. padding:0 18rpx;
  1173. color: #999999;
  1174. text-align: center;
  1175. line-height: 48rpx;
  1176. font-weight: bold;
  1177. background: #fef6f3;
  1178. &.icon-jianhao{
  1179. border-radius: 30rpx 0 0 30rpx;
  1180. }
  1181. &.icon-jiahao{
  1182. border-radius: 0 30rpx 30rpx 0;
  1183. }
  1184. }
  1185. .btn-input{
  1186. width: 62rpx;
  1187. height: 48rpx;
  1188. line-height: 48rpx;
  1189. background: #fff;
  1190. border-radius: 4rpx;
  1191. text-align: center;
  1192. font-size: $font-size-24;
  1193. }
  1194. }
  1195. .uni-numbox{
  1196. position: absolute;
  1197. left: 45rpx;
  1198. bottom: 0;
  1199. .uni-numbox-minus, .uni-numbox-plus{
  1200. width: 50rpx;
  1201. line-height: 40rpx;
  1202. }
  1203. .uni-numbox-value {
  1204. font-size: $font-size-28;
  1205. width: 60rpx;
  1206. }
  1207. }
  1208. }
  1209. }
  1210. .floor-item-act{
  1211. width: 100%;
  1212. height: 56rpx;
  1213. text-align: center;
  1214. box-sizing: border-box;
  1215. float: left;
  1216. padding:0 0 10rpx 0;
  1217. margin-left: 10rpx;
  1218. .floor-tags{
  1219. height: 28rpx;
  1220. border-radius: 6rpx;
  1221. background-color: #FFFFFF;
  1222. line-height: 28rpx;
  1223. color: $color-system;
  1224. text-align: center;
  1225. display: inline-block;
  1226. padding:0 16rpx;
  1227. font-size: $font-size-20;
  1228. border: 1px solid #E15616;
  1229. float: left;
  1230. }
  1231. }
  1232. }
  1233. }
  1234. .failure-list{
  1235. width: 702rpx;
  1236. height: auto;
  1237. padding: 0 24rpx;
  1238. margin-top: 20rpx;
  1239. background: #FFFFFF;
  1240. .failure-title{
  1241. width: 100%;
  1242. height: 82rpx;
  1243. line-height: 82rpx;
  1244. font-size: $font-size-28;
  1245. border-bottom: 1px solid #EBEBEB;
  1246. .title-txt{
  1247. float: left;
  1248. color:#666666;
  1249. text-align: left;
  1250. }
  1251. .title-btn{
  1252. float: right;
  1253. color: $color-system;
  1254. text-align: right;
  1255. line-height: 80rpx;
  1256. .butto{
  1257. display: inline-block;
  1258. padding: 0 15rpx;
  1259. font-size: $font-size-26;
  1260. height: 50rpx;
  1261. line-height: 50rpx;
  1262. border-radius: 30rpx;
  1263. background:#FFFFFF;
  1264. // border: 1px solid #C9C9C9;
  1265. // color: #999999;
  1266. margin-top: 15rpx;
  1267. }
  1268. }
  1269. }
  1270. .productlist{
  1271. padding-top: 10rpx;
  1272. .goods-pros{
  1273. width: 100%;
  1274. height: auto;
  1275. padding: 20rpx 0;
  1276. }
  1277. .goods-pros-t{
  1278. display: flex;
  1279. align-items: center;
  1280. width: 100%;
  1281. height: 210rpx;
  1282. position: relative;
  1283. .img-tip{
  1284. display: block;
  1285. width: 72rpx;
  1286. height: 36rpx;
  1287. line-height: 36rpx;
  1288. font-size: $font-size-24;
  1289. text-align: center;
  1290. color: #FFFFFF;
  1291. border-radius: 24rpx;
  1292. background:rgba(51,51,51,0.3);
  1293. // position: absolute;
  1294. // left: 0;
  1295. // top: 0;
  1296. }
  1297. .checkbox-box{
  1298. padding: 10rpx;
  1299. }
  1300. .pros-img{
  1301. width: 180rpx;
  1302. height: 100%;
  1303. border-radius: 10rpx;
  1304. margin:0 20rpx;
  1305. border:1px solid #f3f3f3;
  1306. position: relative;
  1307. image{
  1308. width: 100%;
  1309. height: 100%;
  1310. border-radius: 10rpx;
  1311. }
  1312. }
  1313. .pros-marks{
  1314. width: 730rpx; height: 250rpx;
  1315. z-index: 90;
  1316. background: rgba(0,0,0,.05);
  1317. position: absolute;
  1318. left:-20rpx;
  1319. top: -20rpx;
  1320. }
  1321. }
  1322. .goods-pros-b{
  1323. width:622rpx;
  1324. margin-left: 84rpx;
  1325. height: 40rpx;
  1326. padding:0 0 26rpx 0;
  1327. // border-top: 1px solid #EBEBEB;
  1328. &.show{
  1329. display: block;
  1330. }
  1331. &.none{
  1332. display: none;
  1333. }
  1334. .sum{
  1335. font-size: $font-size-28;
  1336. line-height: 40rpx;
  1337. color: $text-color;
  1338. display: flex;
  1339. justify-content: flex-end;
  1340. .money{
  1341. color: #FF2A2A;
  1342. font-size: $font-size-28;
  1343. }
  1344. .money-sign{
  1345. font-size: $font-size-24;
  1346. color: #FF2A2A;
  1347. }
  1348. }
  1349. }
  1350. .pros-product{
  1351. width: 402rpx;
  1352. height: 100%;
  1353. line-height: 36rpx;
  1354. font-size: $font-size-28;
  1355. position: relative;
  1356. .producttitle{
  1357. width: 100%;
  1358. display: inline-block;
  1359. height: auto;
  1360. text-overflow:ellipsis;
  1361. display: -webkit-box;
  1362. word-break: break-all;
  1363. -webkit-box-orient: vertical;
  1364. -webkit-line-clamp: 2;
  1365. overflow: hidden;
  1366. margin-bottom: 8rpx;
  1367. .no-text{
  1368. display: inline-block;
  1369. height:36rpx;
  1370. padding: 0 12rpx;
  1371. line-height: 36rpx;
  1372. background:linear-gradient(315deg,rgba(231,0,0,1) 0%,rgba(255,104,1,1) 100%);
  1373. border-radius:18rpx;
  1374. text-align: center;
  1375. color: #FFFFFF;
  1376. font-size: $font-size-28;
  1377. margin-right: 24rpx;
  1378. }
  1379. }
  1380. .productspec{
  1381. height: 36rpx;
  1382. color: #999999;
  1383. font-size: $font-size-26;
  1384. margin-top: 20rpx;
  1385. }
  1386. .productstate{
  1387. font-size: $font-size-28;
  1388. height: 44rpx;
  1389. color: #FF2A2A;
  1390. position: absolute;
  1391. bottom: 0;
  1392. left: 0;
  1393. }
  1394. }
  1395. }
  1396. }
  1397. .footer{
  1398. width: 100%;
  1399. background-color: #FFFFFF;
  1400. height: 110rpx;
  1401. position: fixed;
  1402. bottom: 0rpx;
  1403. z-index: 100;
  1404. .footer-le{
  1405. width: 520rpx;
  1406. height: 100%;
  1407. padding:0 24rpx;
  1408. float: left;
  1409. box-sizing: border-box;
  1410. .foot-check{
  1411. width: 100rpx;
  1412. float: left;
  1413. line-height: 110rpx;
  1414. font-size: $font-size-24;
  1415. .checkbox{
  1416. width: 40rpx;
  1417. text-align: center;
  1418. }
  1419. .text{
  1420. width: 60rpx;
  1421. float: right;
  1422. }
  1423. }
  1424. .sum{
  1425. width: 360rpx;
  1426. height: 110rpx;
  1427. float: right;
  1428. box-sizing: border-box;
  1429. padding: 10rpx;
  1430. .sum-none{
  1431. width: 100%;
  1432. height: 45rpx;
  1433. line-height: 45rpx;
  1434. color: $text-color;
  1435. float: left;
  1436. text-align: right;
  1437. .money{
  1438. font-size: $font-size-24;
  1439. color: #999999;
  1440. text-decoration: line-through;
  1441. }
  1442. .money-sign{
  1443. font-size: $font-size-24;
  1444. color: #999999;
  1445. text-decoration: line-through;
  1446. }
  1447. .money-reduced{
  1448. margin-left: 10rpx;
  1449. font-size: $font-size-24;
  1450. color: $color-system;
  1451. }
  1452. }
  1453. .sum-price{
  1454. text-align: right;
  1455. width: 100%;
  1456. height: 45rpx;
  1457. line-height: 45rpx;
  1458. font-size: $font-size-30;
  1459. color: $text-color;
  1460. float: left;
  1461. font-weight: normal;
  1462. &.none{
  1463. height: 90rpx;
  1464. line-height: 90rpx;
  1465. }
  1466. .money{
  1467. color: #FF2A2A;
  1468. }
  1469. .money-sign{
  1470. font-size: $font-size-24;
  1471. color: #FF2A2A;
  1472. }
  1473. }
  1474. }
  1475. }
  1476. .footer-ri{
  1477. width: 230rpx;
  1478. height: 100%;
  1479. float: right;
  1480. display: flex;
  1481. justify-content: space-between;
  1482. align-items: center;
  1483. z-index: 999;
  1484. box-sizing: border-box;
  1485. padding: 13rpx 15rpx;
  1486. &.none{
  1487. display: none;
  1488. }
  1489. .btn{
  1490. width: 200rpx;
  1491. height: 100%;
  1492. background:linear-gradient(135deg,rgba(242,143,49,1) 0%,rgba(225,86,22,1) 100%);
  1493. font-size: $font-size-28;
  1494. line-height: 84rpx;
  1495. color: #FFFFFF;
  1496. display: flex;
  1497. border-radius: 42rpx;
  1498. justify-content: center;
  1499. align-items: center;
  1500. }
  1501. }
  1502. .footer-del{
  1503. width: 400rpx;
  1504. height: 110rpx;
  1505. position: absolute;
  1506. padding-left: 200rpx;
  1507. background: #FFFFFF;
  1508. right: 0;
  1509. top: 0;
  1510. z-index: 1000;
  1511. &.show{
  1512. animation: showDelbtn 0s linear both;
  1513. }
  1514. &.none{
  1515. animation: hideDelbtn 0s linear both;
  1516. }
  1517. .btn{
  1518. width: 50%;
  1519. height: 100%;
  1520. line-height: 110rpx;
  1521. font-size: $font-size-28;
  1522. color: #FFFFFF;
  1523. text-align: center;
  1524. float: left;
  1525. }
  1526. .btn.btn-cancel{
  1527. background:#EEC1AB;
  1528. }
  1529. .btn.btn-confirm{
  1530. background:#FF2A2A;
  1531. }
  1532. @keyframes showDelbtn {
  1533. 0% {
  1534. transform: translateX(0);
  1535. }
  1536. 100% {
  1537. transform: translateX(-100%);
  1538. }
  1539. }
  1540. @keyframes hideDelbtn {
  1541. 0% {
  1542. transform: translateX(-100%);
  1543. }
  1544. 100% {
  1545. transform: translateX(0);
  1546. }
  1547. }
  1548. }
  1549. }
  1550. </style>