cart.vue 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923
  1. <template>
  2. <view class="container cart clearfix">
  3. <tui-skeleton v-if="skeletonShow" backgroundColor="#fafafa" borderRadius="10rpx" :isLoading ="true" :loadingType="9"></tui-skeleton>
  4. <view class="container-cart-main tui-skeleton">
  5. <view v-if="!isEmpty" class="container-cart">
  6. <scroll-view class="cart-content" scroll-y @scrolltolower="toLower">
  7. <view class="goods-list">
  8. <view v-for="(item, index) in goodsList" :key="index" class="goods-item">
  9. <view class="shoptitle">
  10. <!--选择商店的全部商品 :disabled="isNnder"-->
  11. <view class="checkbox-box">
  12. <button class="checkbox iconfont"
  13. :class="[item.checked ?'icon-gouxuanl':'icon-weigouxuan']"
  14. @click.stop="checkShop(item)">
  15. </button>
  16. </view>
  17. <view class="text">{{item.name}}</view>
  18. </view>
  19. <view class="productlist">
  20. <view class="goods-pros"
  21. v-for="(pros,idx) in item.productsList"
  22. :key="idx"
  23. >
  24. <view class="goods-pros-t">
  25. <!--选择商品-->
  26. <view class="checkbox-box">
  27. <button class="checkbox iconfont"
  28. :class="[pros.productsChecked ?'icon-gouxuanl':'icon-weigouxuan']"
  29. @click.stop="ischeck(item,pros,idx)">
  30. </button>
  31. </view>
  32. <view class="pros-img" @click.stop="navToListPage(pros.productID)"><image :src="pros.mainImage ? pros.mainImage :''" alt="" /></view>
  33. <view class="pros-product">
  34. <view class="producttitle" @click.stop="navToListPage(pros.id)" >
  35. {{pros.name}}
  36. </view>
  37. <view class="productspec">规格:{{pros.unit ? pros.unit : ''}}</view>
  38. <view class="productprice">
  39. <!--使用过滤器对总价改变-->
  40. <view class="price"><text>¥</text>
  41. {{pros.retailPrice ? pros.retailPrice.toFixed(2) : ''}}
  42. </view>
  43. <view class="count" :class="[isshowDelbtn ? 'none':'show']">
  44. <view class="number-box">
  45. <view class="iconfont icon-jianhao" @click="changeCountSub(item,pros)"></view>
  46. <input class="btn-input" type="number" maxlength='4' v-model="pros.productCount" @blur="changeNnmber($event,item,pros)">
  47. <view class="iconfont icon-jiahao" @click="changeCountAdd(item,pros)"></view>
  48. </view>
  49. </view>
  50. </view>
  51. </view>
  52. </view>
  53. </view>
  54. </view>
  55. <view class="goods-pros-b" :class="[isshowDelbtn ? 'none':'show']" >
  56. <view class="sum">合计:<text class="money"><text class="money-sign">¥</text>{{item.totalPrice.toFixed(2)}}</text></view>
  57. </view>
  58. </view>
  59. </view>
  60. <!--加载loadding-->
  61. <tui-loadmore :visible="loadding" :index="3" type="black"></tui-loadmore>
  62. <tui-nomore :visible="!pullUpOn" bgcolor="#F7F7F7" :text='nomoreText'></tui-nomore>
  63. <!--加载loadding-->
  64. </scroll-view>
  65. <!-- 脚部菜单 -->
  66. <view class="footer">
  67. <view class="footer-le">
  68. <view class="foot-check checkbox-box" @tap.stop="checkAll()">
  69. <button class="checkbox iconfont" :class="[isCheckAll?'icon-gouxuan':'icon-weigouxuan']"></button>
  70. <view class="text">全选</view>
  71. </view>
  72. <view class="foot-check-delbtn">
  73. <button class="delBtn" @tap.stop="showDelManager">删除</button>
  74. </view>
  75. <view class="sum">总价:<text class="money-sign">¥</text><text class="money">{{allPrice.toFixed(2)}}</text></view>
  76. </view>
  77. <view v-if="!isshowDelbtn" class="footer-ri" >
  78. <view class="btn" @tap="toConfirmation">去结算({{allCount}})</view>
  79. </view>
  80. <view v-else class="footer-del">
  81. <view class="btn btn-cancel" @tap.stop="hideDelManage">取消</view>
  82. <view class="btn btn-confirm" @tap.stop="deleteList">删除</view>
  83. </view>
  84. </view>
  85. </view>
  86. <view v-if="isEmpty" class="cart-content empty">
  87. <view class="empty-container">
  88. <image class="empty-container-image" src="https://img.caimei365.com/group1/M00/03/71/Cmis2F3wna6AWdWzAAGlgAP0das422.png" mode="aspectFit"></image>
  89. <text class="error-text">购物车空空如也~</text>
  90. </view>
  91. </view>
  92. </view>
  93. <!-- 透明模态层 -->
  94. <modal-layer v-if='modallayer'></modal-layer>
  95. </view>
  96. </template>
  97. <script>
  98. import tuiSkeleton from "@/components/tui-skeleton/tui-skeleton"
  99. import tuiLoadmore from "@/components/tui-components/loadmore/loadmore"
  100. import tuiNomore from "@/components/tui-components/nomore/nomore"
  101. import modalLayer from "@/components/modal-layer"
  102. import { mapState,mapMutations } from 'vuex';
  103. import { getSellerShoppingInfo,sellerAddProductNum, deleteSellerCart } from "@/api/seller.js"
  104. export default{
  105. components:{
  106. tuiSkeleton,
  107. tuiLoadmore,
  108. tuiNomore,
  109. modalLayer
  110. },
  111. data(){
  112. return{
  113. clubId:'', //机构ID
  114. serviceProviderId:'',//协销ID
  115. isStock:'',
  116. goodsList:[], //购物车的商品
  117. delGoodsList:'',//要删除的商品
  118. setGoodData:'', //确认订单的商品
  119. isCheckAll:false,//是否全选
  120. allPrice:0,//所有价格
  121. allCount:0,//被选中的产品数量
  122. isNnder:true,
  123. isModallayer:false,
  124. skeletonShow:true,
  125. isshowDelbtn:false,
  126. isDisabled: false, // 供应商/店铺全选是否禁用状态
  127. isEmpty:false,//显示空购物车
  128. scrollHeight: 'auto',
  129. nomoreText: '上拉显示更多',
  130. hasNextPage: false,
  131. loadding: false,
  132. pullUpOn: true,
  133. pullFlag: true,
  134. pageSize: 10,
  135. pageNum: 1,
  136. }
  137. },
  138. onLoad(){
  139. this.$api.getComStorage('orderUserInfo').then((resolve) =>{
  140. this.clubId = resolve.clubID
  141. })
  142. this.setScrollHeight();
  143. this.initData()
  144. },
  145. computed: {
  146. ...mapState(['hasLogin','userInfo'])
  147. },
  148. filters:{//单件商品的价格 × 数量
  149. totalprice(val,count){
  150. return (val * count).toFixed(2)
  151. }
  152. },
  153. methods:{
  154. initData(){
  155. this.isModallayer = false //遮罩层 防止多次点击
  156. this.skeletonShow = true //预加载圆圈
  157. this.isCheckAll=false//是否全选
  158. this.$api.getStorage().then((resolve) => {
  159. this.serviceProviderId = resolve.serviceProviderID;
  160. this.initGetCartGoodsList();
  161. })
  162. },
  163. initLogin(){
  164. this.$api.redirectTo('/pages/login/login-accont?type=4')
  165. },
  166. setScrollHeight() {
  167. // 窗口高度-footer高度
  168. const {windowHeight, pixelRatio} = uni.getSystemInfoSync();
  169. setTimeout(()=> {
  170. const query = uni.createSelectorQuery().in(this);
  171. query.selectAll('.footer').boundingClientRect();
  172. query.exec(res => {
  173. this.windowHeight = windowHeight;
  174. if(res[0][0]) {
  175. this.scrollHeight = windowHeight - res[0][0].height;
  176. }
  177. })
  178. }, 500)
  179. },
  180. initGetCartGoodsList(){//初始化购物车 index:1
  181. let params = {clubId:this.clubId,serviceProviderId:this.serviceProviderId,pageNum:1,pageSize:this.pageSize}
  182. getSellerShoppingInfo(params).then(response =>{
  183. this.skeletonShow = false
  184. this.$store.commit('updateAllNum',response.data.cartQuantity)
  185. const resultsData = response.data.pageDate;
  186. if(resultsData.results&&resultsData.results.length > 0){
  187. this.isEmpty =false
  188. this.hasNextPage = resultsData.hasNextPage;
  189. this.goodsList = resultsData.results;
  190. this.goodsList.forEach((item,index) => {
  191. let productsListLength = item.productsList.length,
  192. invalidLength = 0;
  193. item.productsList.forEach(pros => {
  194. pros.shopID = item.shopID;
  195. })
  196. })
  197. this.pullFlag = false;
  198. setTimeout(()=>{this.pullFlag = true;},500)
  199. if(this.hasNextPage){
  200. this.pullUpOn = false
  201. this.nomoreText = '上拉显示更多'
  202. }else{
  203. if(this.goodsList.length < 4){
  204. this.pullUpOn = true
  205. }else{
  206. this.pullUpOn = false
  207. this.nomoreText = '已至底部'
  208. }
  209. }
  210. } else {
  211. this.goodsList = [];
  212. this.isEmpty =true
  213. }
  214. }).catch(response =>{
  215. this.$util.msg(response.msg,2000);
  216. })
  217. },
  218. getOnReachBottomData(){//上拉加载
  219. this.pageNum+=1
  220. let params = {clubId:this.clubId,serviceProviderId:this.serviceProviderId,pageNum:this.pageNum,pageSize:this.pageSize}
  221. getSellerShoppingInfo(params).then(response =>{
  222. let resultsData = response.data.pageDate
  223. this.hasNextPage = resultsData.hasNextPage;
  224. this.goodsList = this.goodsList.concat(resultsData.results)
  225. this.pullFlag = false;// 防上拉暴滑
  226. setTimeout(()=>{this.pullFlag = true;},500)
  227. if(this.hasNextPage){
  228. this.pullUpOn = false
  229. this.nomoreText = '上拉显示更多'
  230. }else{
  231. this.loadding = false
  232. this.pullUpOn = false
  233. this.nomoreText = '已至底部'
  234. }
  235. }).catch(response =>{
  236. this.$util.msg(response.msg,2000);
  237. })
  238. },
  239. ischeck(item,pro){//为未选中的时候改变为true,反之为true
  240. pro.productsChecked = !pro.productsChecked;
  241. this.updateProductCheckedAllBtn(item);
  242. this.updateCheckAllBtn();
  243. },
  244. updateProductCheckedAllBtn(item) {// 单独每个供应商的勾选判断
  245. let productsList = item.productsList,
  246. productsCheckedLength = 0,
  247. disabledLength = 0;
  248. if(this.isshowDelbtn) {
  249. productsList.forEach(pros => {
  250. if(pros.productsChecked) {
  251. productsCheckedLength++;
  252. }
  253. })
  254. } else {
  255. productsList.forEach(pros => {
  256. if(pros.productsChecked) {
  257. productsCheckedLength++;
  258. }
  259. })
  260. }
  261. item.checked = productsCheckedLength === productsList.length - disabledLength;
  262. },
  263. updateCheckAllBtn() {// 全选勾选判断
  264. let goodsCheckedLength = 0,
  265. disabledListLength = 0,
  266. goodsList = this.goodsList;
  267. goodsList.forEach(item => {
  268. if(item.checked) {
  269. goodsCheckedLength++;
  270. }
  271. })
  272. this.isCheckAll = goodsCheckedLength === goodsList.length - disabledListLength;
  273. },
  274. checkShop(item){//与单选商品类似
  275. item.checked = !item.checked;
  276. this.setProductChecked(item);
  277. this.updateCheckAllBtn();
  278. },
  279. setProductChecked(item) {
  280. let products = item.productsList;
  281. products.forEach(pros=>{
  282. if(item.checked) {
  283. // 有效
  284. this.isNnder = false;
  285. pros.productsChecked = true;
  286. } else {
  287. pros.productsChecked = false;
  288. }
  289. })
  290. },
  291. updateBothCheckBtn() {
  292. if(this.isshowDelbtn) {
  293. // 当管理删除按钮出现时,失效的商品可被选择
  294. this.goodsList.forEach((item)=>{
  295. item.checked = this.isCheckAll;
  296. this.setProductChecked(item);
  297. })
  298. } else {
  299. this.goodsList.forEach((item)=>{
  300. item.checked = this.isCheckAll;
  301. this.setProductChecked(item);
  302. })
  303. }
  304. },
  305. checkAll(){//全选方法内调用方法
  306. this.isCheckAll = !this.isCheckAll;
  307. this.updateBothCheckBtn();
  308. },
  309. totalShopPeice(){//每次所属会所下的商品增减重新计算合计价格&减去含有下架的商品
  310. let prosPrice=0;
  311. let validPrice =0;
  312. let validList=[];
  313. let productsList=[];
  314. this.goodsList.map((item,index)=>{
  315. productsList=item.productsList;
  316. prosPrice=productsList.reduce((p,e)=>p+e.retailPrice*e.productCount,0);
  317. productsList.forEach(pros =>{
  318. item.totalPrice = prosPrice
  319. })
  320. })
  321. },
  322. totalPeice(){ //计算总价格,每次调用此方法,将初始值为0,遍历价格并累加
  323. this.allPrice = 0
  324. let prosPrice=0;
  325. let validPrice=0;
  326. let validList =[];
  327. let productsList =[];
  328. this.goodsList.forEach((item,index)=>{
  329. productsList=item.productsList;
  330. productsList.forEach(pros=>{
  331. if(pros.productsChecked){
  332. prosPrice+=pros.retailPrice*pros.productCount;
  333. this.allPrice = prosPrice
  334. }
  335. })
  336. })
  337. },
  338. totalCount(){//计算总数量
  339. this.allCount = 0
  340. let prosAllCount=0
  341. let validCount = 0
  342. let validList =[];
  343. let productsList =[];
  344. this.goodsList.forEach(item=>{
  345. productsList = item.productsList
  346. productsList.forEach(pros=>{
  347. if(pros.productsChecked){
  348. prosAllCount+=parseInt(pros.productCount);
  349. this.allCount = prosAllCount
  350. }
  351. })
  352. })
  353. },
  354. changeCountAdd(item,pros){//商品数量加加
  355. if(pros.productCount>=pros.stock){
  356. pros.productCount= pros.stock
  357. this.isStock =true
  358. return
  359. }else{
  360. pros.productCount++
  361. this.processActivityPrice(pros)
  362. this.isStock =false
  363. }
  364. this.updateShoppogNum(pros)
  365. this.totalShopPeice();
  366. },
  367. changeCountSub(item,pros){//商品数量减减
  368. if(pros.productCount<=pros.minBuyNumber){
  369. pros.productCount= pros.minBuyNumber
  370. this.$util.msg(`该商品最小起订量为${pros.minBuyNumber}`,2000);
  371. return
  372. }else{
  373. pros.productCount--
  374. this.processActivityPrice(pros)
  375. }
  376. this.updateShoppogNum(pros)
  377. this.totalShopPeice();
  378. },
  379. changeNnmber(e,item,pros){//输入商品数量更新
  380. let _value = e.detail.value;
  381. if(!this.$api.isNumber(_value)){
  382. pros.productCount = pros.minBuyNumber
  383. }else if(_value < pros.minBuyNumber){
  384. this.$util.msg(`该商品最小起订量为${pros.minBuyNumber}`,2000);
  385. pros.productCount = pros.minBuyNumber
  386. }else{
  387. pros.productCount = e.detail.value
  388. this.processActivityPrice(pros)
  389. }
  390. this.updateShoppogNum(pros)
  391. this.totalShopPeice();
  392. },
  393. processActivityPrice(pros){//单独处理活动价格和阶梯价格
  394. let ladderPriceList = pros.ladderPriceList;
  395. if(pros.ladderPriceFlag == '0' || pros.actFlag == 1){
  396. pros.retailPrice = pros.retailPrice
  397. }else{
  398. ladderPriceList.forEach((item,index)=>{
  399. if(pros.productCount>=item.buyNum){
  400. pros.retailPrice = item.buyPrice
  401. }
  402. })
  403. }
  404. },
  405. updateShoppogNum(pros){//加减购物车商品更新到后台
  406. let params ={id:pros.sellerCartId,productID:pros.productID,num:pros.productCount}
  407. sellerAddProductNum(params).then(response =>{
  408. this.isshowDelbtn = false;
  409. this.initGetCartGoodsList();
  410. }).catch(response =>{
  411. this.$util.msg(response.msg,2000);
  412. })
  413. },
  414. toConfirmation(){//跳转确认订单页面
  415. let setGoodsList=[];
  416. this.goodsList.forEach(res=>{
  417. let products = res.productsList
  418. products.forEach(pros=>{
  419. if(pros.productsChecked){
  420. setGoodsList.push(pros.productID)
  421. }
  422. })
  423. })
  424. if(setGoodsList == ''){
  425. this.$util.msg("请先选择结算商品~",2000);
  426. return
  427. }else{
  428. /**
  429. * @获取勾选的商品ID拼接字符串逗号隔开,最后一个逗号去掉
  430. * @获取勾选的商品分类ID拼接字符串格式逗号隔开,最后一个逗号去掉
  431. */
  432. let productID = '';
  433. this.goodsList.forEach(el=>{
  434. el.productsList.forEach(pros=>{
  435. if(pros.productsChecked){
  436. productID += pros.productID+','
  437. }
  438. })
  439. })
  440. let cartPramsData={
  441. clubId:this.clubId,
  442. allPrice:this.allPrice,
  443. allCount:this.allCount,
  444. productID:productID.substring(0,productID.lastIndexOf(',')),
  445. productCount:''
  446. }
  447. this.$api.navigateTo(`/market/pages/order/create-order?data=${JSON.stringify({data:cartPramsData})}`)
  448. }
  449. },
  450. showDelManager(){//显示删除商品管理
  451. this.isshowDelbtn = true;
  452. this.isNnder = true;
  453. if(this.isCheckAll) {
  454. this.updateBothCheckBtn();
  455. } else {
  456. this.updateCheckAllBtn();
  457. }
  458. },
  459. hideDelManage(){//隐藏删除商品管理
  460. this.isshowDelbtn = false;
  461. if(this.isCheckAll) {
  462. this.updateBothCheckBtn();
  463. } else {
  464. this.updateCheckAllBtn();
  465. }
  466. },
  467. deleteList(){//删除购物车商品
  468. this.delGoodsList=[];
  469. this.goodsList.forEach(delitem=>{
  470. let products = delitem.productsList
  471. products.forEach(pros=>{
  472. if(pros.productsChecked){
  473. this.delGoodsList += pros.sellerCartId+','
  474. }
  475. })
  476. })
  477. // console.log(this.delGoodsList);
  478. if(this.delGoodsList.length == 0){
  479. this.$util.msg("请选择要删除的商品~",2000);
  480. return
  481. }else{
  482. this.$util.modal('','确定删除选中的商品吗?','确定','取消',true,() =>{
  483. deleteSellerCart({sellerCartIds:this.delGoodsList}).then(response =>{
  484. console.log(response)
  485. this.$util.msg('删除成功',2000);
  486. setTimeout(()=>{
  487. this.isshowDelbtn = false;
  488. this.initGetCartGoodsList();
  489. },2000)
  490. }).catch(response =>{
  491. this.$util.msg(response.msg,2000)
  492. })
  493. })
  494. }
  495. },
  496. goNavto(url){
  497. uni.navigateTo ({
  498. url
  499. })
  500. },
  501. navToListPage(id){
  502. this.isModallayer = true;
  503. this.$api.navigateTo(`/pages/goods/product?id=${id}`)
  504. }
  505. },
  506. watch:{//深度监听所有数据,每次改变重新计算总价和总数
  507. goodsList:{
  508. deep:true,
  509. handler(val,oldval){
  510. this.totalPeice()
  511. this.totalCount()
  512. }
  513. }
  514. },
  515. onReachBottom() {
  516. if(this.hasNextPage){
  517. this.loadding = true
  518. this.pullUpOn = true
  519. this.getOnReachBottomData()
  520. }
  521. },
  522. onPullDownRefresh() {//下拉刷新
  523. this.initGetCartGoodsList()
  524. uni.stopPullDownRefresh()
  525. },
  526. onShow(){
  527. },
  528. }
  529. </script>
  530. <style lang="scss">
  531. page{
  532. background: #f7f7f7;
  533. }
  534. .cart-content{
  535. position: relative;
  536. padding-bottom:74rpx;
  537. }
  538. .container-cart-main.none{
  539. display: none;
  540. }
  541. .container-cart-main.show{
  542. display: block;
  543. }
  544. .cart-content.empty.none{
  545. display: none;
  546. }
  547. .cart-content.empty.show{
  548. display: block;
  549. }
  550. .container-cart.show{
  551. display: block;
  552. }
  553. .container-cart.none{
  554. display: none;
  555. }
  556. .empty-container.none{
  557. display: none;
  558. }
  559. .empty-container.show{
  560. display: flex;
  561. }
  562. .checkbox-box{
  563. display: flex;
  564. align-items: center;
  565. .checkbox{
  566. display: flex;
  567. margin: 0;
  568. padding: 0;
  569. display: flex;
  570. flex-direction: column;
  571. align-items: center;
  572. box-sizing: border-box;
  573. text-align: center;
  574. text-decoration: none;
  575. border-radius: 0;
  576. -webkit-tap-highlight-color: transparent;
  577. overflow: hidden;
  578. background-color:#FFFFFF;
  579. font-size: 36rpx;
  580. color:$color-system;
  581. }
  582. &.disabled{
  583. .checkbox{
  584. color:#999999
  585. }
  586. }
  587. .text{
  588. font-size: $font-size-24;
  589. margin-left: 10rpx;
  590. }
  591. }
  592. .goods-list{
  593. width: 100%;
  594. height: auto;
  595. border-top: 1px solid #EBEBEB;
  596. background-color: #F7F7F7;
  597. .goods-item{
  598. width: 702rpx;
  599. padding: 0 24rpx;
  600. background: #FFFFFF;
  601. margin-bottom: 24rpx;
  602. }
  603. .shoptitle{
  604. display: flex;
  605. align-items: center;
  606. height: 80rpx;
  607. // border-bottom: 1px solid #EBEBEB;
  608. line-height: 80rpx;
  609. .checkbox-box{
  610. margin-left: 18rpx;
  611. }
  612. .text{
  613. margin-left: 37rpx;
  614. font-size: $font-size-28;
  615. color: $text-color;
  616. text-align: left;
  617. font-weight: bold;
  618. }
  619. }
  620. .goods-pros{
  621. width: 100%;
  622. height: auto;
  623. }
  624. .goods-pros-t{
  625. display: flex;
  626. align-items: center;
  627. width: 100%;
  628. height: 217rpx;
  629. padding:0 0 26rpx 0;
  630. .checkbox-box{
  631. margin-left: 22rpx;
  632. }
  633. .pros-img{
  634. width: 210rpx;
  635. height: 100%;
  636. border-radius: 10rpx;
  637. margin:0 26rpx 0 38rpx;
  638. border:1px solid #f3f3f3;
  639. image{
  640. width: 100%;
  641. height: 100%;
  642. border-radius: 10rpx;
  643. }
  644. }
  645. }
  646. .goods-pros-b{
  647. width:622rpx;
  648. margin-left: 84rpx;
  649. height: 40rpx;
  650. padding:0 0 26rpx 0;
  651. // border-top: 1px solid #EBEBEB;
  652. &.show{
  653. display: block;
  654. }
  655. &.none{
  656. display: none;
  657. }
  658. .sum{
  659. font-size: $font-size-28;
  660. line-height: 40rpx;
  661. color: $text-color;
  662. display: flex;
  663. justify-content: flex-end;
  664. .money{
  665. color: #FF2A2A;
  666. font-size: $font-size-28;
  667. }
  668. .money-sign{
  669. font-size: $font-size-24;
  670. color: #FF2A2A;
  671. }
  672. }
  673. }
  674. .pros-product{
  675. width: 386rpx;
  676. height: 100%;
  677. line-height: 36rpx;
  678. font-size: $font-size-26;
  679. position: relative;
  680. .producttitle{
  681. width: 100%;
  682. display: inline-block;
  683. height: auto;
  684. text-overflow:ellipsis;
  685. display: -webkit-box;
  686. word-break: break-all;
  687. -webkit-box-orient: vertical;
  688. -webkit-line-clamp: 2;
  689. overflow: hidden;
  690. margin-bottom: 8rpx;
  691. .no-text{
  692. display: inline-block;
  693. height:36rpx;
  694. padding: 0 12rpx;
  695. line-height: 36rpx;
  696. background:linear-gradient(315deg,rgba(231,0,0,1) 0%,rgba(255,104,1,1) 100%);
  697. border-radius:18rpx;
  698. text-align: center;
  699. color: #FFFFFF;
  700. font-size: $font-size-24;
  701. margin-right: 24rpx;
  702. }
  703. }
  704. .productspec{
  705. height: 36rpx;
  706. color: #999999;
  707. }
  708. .productprice{
  709. height: 48rpx;
  710. position: absolute;
  711. width: 100%;
  712. bottom: 0;
  713. .price{
  714. line-height: 48rpx;
  715. font-size: $font-size-28;
  716. width: 48%;
  717. color: #FF2A2A;
  718. float: left;
  719. &.disabled{
  720. color: #999999;
  721. }
  722. .money-sign{
  723. font-size: $font-size-24;
  724. color: #FF2A2A;
  725. }
  726. }
  727. .count{
  728. height: 100%;
  729. float: right;
  730. position: relative;
  731. &.show{
  732. display: block;
  733. }
  734. &.none{
  735. display: none;
  736. }
  737. .number-box{
  738. display: flex;
  739. justify-content: center;
  740. align-items: center;
  741. .iconfont{
  742. font-size: $font-size-24;
  743. padding:0 20rpx;
  744. color: $text-color;
  745. text-align: center;
  746. line-height: 48rpx;
  747. font-weight: bold;
  748. }
  749. .btn-input{
  750. width: 62rpx;
  751. height: 48rpx;
  752. line-height: 48rpx;
  753. background: #F8F8F8;
  754. border-radius: 4rpx;
  755. text-align: center;
  756. font-size: $font-size-24;
  757. }
  758. }
  759. .uni-numbox{
  760. position: absolute;
  761. left: 45rpx;
  762. bottom: 0;
  763. .uni-numbox-minus, .uni-numbox-plus{
  764. width: 50rpx;
  765. line-height: 40rpx;
  766. }
  767. .uni-numbox-value {
  768. font-size: $font-size-28;
  769. width: 60rpx;
  770. }
  771. }
  772. }
  773. }
  774. }
  775. }
  776. .footer{
  777. width: 100%;
  778. background-color: #FFFFFF;
  779. height: 110rpx;
  780. position: fixed;
  781. bottom: 0rpx;
  782. z-index: 10;
  783. .footer-le{
  784. width: 490rpx;
  785. height: 100%;
  786. padding:0 30rpx;
  787. float: left;
  788. .text{
  789. font-weight: bold;
  790. }
  791. .foot-check{
  792. width: 100rpx;
  793. float: left;
  794. line-height: 110rpx;
  795. font-size: $font-size-24;
  796. .checkbox{
  797. width: 40rpx;
  798. text-align: center;
  799. }
  800. .text{
  801. width: 60rpx;
  802. float: right;
  803. }
  804. }
  805. .foot-check-delbtn{
  806. float: left;
  807. .delBtn{
  808. margin: 0;
  809. padding: 0;
  810. display: flex;
  811. flex-direction: column;
  812. align-items: center;
  813. box-sizing: border-box;
  814. font-size: $font-size-24;
  815. text-align: center;
  816. text-decoration: none;
  817. border-radius: 0;
  818. -webkit-tap-highlight-color: transparent;
  819. overflow: hidden;
  820. background-color:#FFFFFF;
  821. color: #FF2A2A;
  822. padding: 0 24rpx;
  823. display: flex;
  824. justify-content: center;
  825. align-items: center;
  826. line-height: 110rpx;
  827. font-weight: bold;
  828. &.none{
  829. display: none;
  830. }
  831. }
  832. }
  833. .sum{
  834. font-size: $font-size-28;
  835. line-height: 110rpx;
  836. color: $text-color;
  837. display: flex;
  838. justify-content: flex-end;
  839. .money{
  840. color: #FF2A2A;
  841. }
  842. .money-sign{
  843. font-size: $font-size-24;
  844. color: #FF2A2A;
  845. }
  846. }
  847. }
  848. .footer-ri{
  849. width: 200rpx;
  850. height: 100%;
  851. background:linear-gradient(135deg,rgba(242,143,49,1) 0%,rgba(225,86,22,1) 100%);
  852. float: right;
  853. display: flex;
  854. justify-content: space-between;
  855. align-items: center;
  856. z-index: 999;
  857. &.none{
  858. display: none;
  859. }
  860. .btn{
  861. width: 200rpx;
  862. height: 100%;
  863. font-size: $font-size-28;
  864. line-height: 110rpx;
  865. color: #FFFFFF;
  866. display: flex;
  867. justify-content: center;
  868. align-items: center;
  869. }
  870. }
  871. .footer-del{
  872. width: 400rpx;
  873. height: 100%;
  874. position: absolute;
  875. padding-left: 200rpx;
  876. background: #FFFFFF;
  877. right: 0;
  878. top: 0;
  879. z-index: 1000;
  880. &.show{
  881. animation: showDelbtn 0s linear both;
  882. }
  883. &.none{
  884. animation: hideDelbtn 0s linear both;
  885. }
  886. .btn{
  887. width: 50%;
  888. height: 100%;
  889. line-height: 110rpx;
  890. font-size: $font-size-28;
  891. color: #FFFFFF;
  892. text-align: center;
  893. float: left;
  894. }
  895. .btn.btn-cancel{
  896. background:#EEC1AB;
  897. }
  898. .btn.btn-confirm{
  899. background:#FF2A2A;
  900. }
  901. @keyframes showDelbtn {
  902. 0% {
  903. transform: translateX(0);
  904. }
  905. 100% {
  906. transform: translateX(-100%);
  907. }
  908. }
  909. @keyframes hideDelbtn {
  910. 0% {
  911. transform: translateX(-100%);
  912. }
  913. 100% {
  914. transform: translateX(0);
  915. }
  916. }
  917. }
  918. }
  919. </style>