cart.vue 42 KB

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