cart.vue 26 KB

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