cart.vue 42 KB

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