cart.vue 42 KB

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