order_addcart.vue 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955
  1. <template>
  2. <view>
  3. <view class='shoppingCart'>
  4. <view class='labelNav acea-row row-around row-middle'>
  5. <view class='item'><text class='iconfont icon-xuanzhong'></text>100%正品保证</view>
  6. <view class='item'><text class='iconfont icon-xuanzhong'></text>所有商品精挑细选</view>
  7. <view class='item'><text class='iconfont icon-xuanzhong'></text>售后无忧</view>
  8. </view>
  9. <view class='nav acea-row row-between-wrapper'>
  10. <view>购物数量 <text class='num font-color'>{{cartTotalCount}}</text></view>
  11. <view v-if="cartList.valid.length > 0 || cartList.invalid.length > 0" class='administrate acea-row row-center-wrapper'
  12. @click='manage'>{{ footerswitch ? '管理' : '取消'}}</view>
  13. </view>
  14. <view v-if="cartList.valid.length > 0 || cartList.invalid.length > 0">
  15. <view class='list'>
  16. <block v-for="(item,index) in cartList.valid" :key="index">
  17. <view class='item acea-row row-between-wrapper'>
  18. <view class="store-title">
  19. <view class="checkbox" @click="storeAllCheck(item,index)">
  20. <text v-if="!item.allCheck" class="iconfont icon-weixuanzhong"></text>
  21. <text v-else class="iconfont icon-xuanzhong1"></text>
  22. </view>
  23. <navigator :url="hide_mer_status == 0 ? '/pages/store/home/index?id='+item.mer_id : '#'" class="info">
  24. <text class="iconfont icon-shangjiadingdan"></text>
  25. <view class="name">{{item.mer_name}}</view>
  26. <text class="iconfont icon-xiangyou"></text>
  27. </navigator>
  28. <view class="coupon-btn" v-if="item.hasCoupon>0" @click="giveCoupon(item)">优惠券</view>
  29. </view>
  30. <navigator v-for="goods in item.list" :key="goods.cart_id" :url='"/pages/goods_details/index?id="+goods.product.product_id'
  31. hover-class='none' class='picTxt acea-row'>
  32. <view class="checkbox" @click.stop="goodsCheck(goods,index)">
  33. <text v-if="!goods.check" class="iconfont icon-weixuanzhong"></text>
  34. <text v-else class="iconfont icon-xuanzhong1"></text>
  35. </view>
  36. <view class='pictrue'>
  37. <image :src='(goods.productAttr && goods.productAttr.image) || goods.product.image'></image>
  38. <!-- <image v-else :src='item.productInfo.image'></image> -->
  39. </view>
  40. <view class='text'>
  41. <view class='line1'>{{goods.product.store_name}}</view>
  42. <view class='infor line1' v-if="goods.productAttr.sku">属性:{{goods.productAttr.sku}}</view>
  43. <view class='money'>¥{{goods.productAttr.price}}</view>
  44. </view>
  45. <view class='carnum acea-row row-center-wrapper'>
  46. <view class="reduce" :class="goods.numSub ? 'on' : ''" @click.stop='subCart(goods)'>-</view>
  47. <view class='num'>{{goods.cart_num}}</view>
  48. <!-- <view class="num">
  49. <input type="number" v-model="item.cart_num" @click.stop @input="iptCartNum(index)" @blur="blurInput(index)"/>
  50. </view> -->
  51. <view class="plus" :class="goods.numAdd ? 'on' : ''" @click.stop='addCart(goods)'>+</view>
  52. </view>
  53. </navigator>
  54. </view>
  55. </block>
  56. </view>
  57. <view class='invalidGoods' v-if="cartList.invalid.length > 0">
  58. <view class='goodsNav acea-row row-between-wrapper'>
  59. <view @click='goodsOpen'><text class='iconfont' :class='goodsHidden==true?"icon-xiangxia":"icon-xiangshang"'></text>失效商品</view>
  60. <view class='del' @click='unsetCart'><text class='iconfont icon-shanchu1'></text>清空</view>
  61. </view>
  62. <view class='goodsList' :hidden='goodsHidden'>
  63. <block v-for="(item,index) in cartList.invalid" :key='index'>
  64. <view class='item acea-row row-between-wrapper'>
  65. <view class='invalid'>失效</view>
  66. <view class='pictrue'>
  67. <image :src='(item.productAttr && item.productAttr.image) || item.product.image'></image>
  68. </view>
  69. <view class='text acea-row row-column-between'>
  70. <view class='line1 name'>{{item.product.store_name}}</view>
  71. <!-- <view class='infor line1' v-if="item.productInfo.attrInfo">属性:{{item.productInfo.attrInfo.suk}}</view> -->
  72. <view class='acea-row row-between-wrapper'>
  73. <!-- <view>¥{{item.truePrice}}</view> -->
  74. <view class='end'>该商品已失效</view>
  75. </view>
  76. </view>
  77. </view>
  78. </block>
  79. </view>
  80. </view>
  81. </view>
  82. <view class='noCart' v-if="recommend" :style="{marginTop:cartList.invalid.length ==0 && cartList.invalid.length ==0?'170rpx':'' }">
  83. <view class='pictrue'>
  84. <image src='../../static/images/noCart.png'></image>
  85. </view>
  86. <recommend :hostProduct='hostProduct' :isLogin="isLogin "></recommend>
  87. <view class='loadingicon acea-row row-center-wrapper' v-if="hostProduct.length>5">
  88. <text class='loading iconfont icon-jiazai' :hidden='loading==false'></text>{{loadTitle}}
  89. </view>
  90. </view>
  91. <view style='height:120rpx;'></view>
  92. <view class='footer acea-row row-between-wrapper' v-if="cartList.valid.length > 0">
  93. <view>
  94. <!-- <checkbox-group @change="checkboxAllChange">
  95. <checkbox value="all" :checked="!!isAllSelect" /><text class='checkAll'>全选 ({{cartCount}})</text>
  96. </checkbox-group> -->
  97. <view class="allcheckbox" @click.stop="checkboxAllChange">
  98. <text v-if="!isAllSelect" class="iconfont icon-weixuanzhong"></text>
  99. <text v-else class="iconfont icon-xuanzhong1"></text>
  100. 全选 ({{cartCount}})
  101. </view>
  102. </view>
  103. <view class='money acea-row row-middle' v-if="footerswitch==true">
  104. <text class='font-color'>¥{{selectCountPrice}}</text>
  105. <form @submit="subOrder" report-submit='true'>
  106. <button class='placeOrder bg-color' formType="submit">立即下单</button>
  107. </form>
  108. </view>
  109. <view class='button acea-row row-middle' v-else>
  110. <form @submit="subCollect" report-submit='true'>
  111. <button class='bnt cart-color' formType="submit">收藏</button>
  112. </form>
  113. <form @submit="subDel" report-submit='true'>
  114. <button class='bnt' formType="submit">删除</button>
  115. </form>
  116. </view>
  117. </view>
  118. </view>
  119. <!-- 优惠券弹窗 -->
  120. <block v-if="coupon.coupon">
  121. <couponListWindow
  122. :coupon='coupon'
  123. @ChangCouponsClone="ChangCouponsClone"
  124. @ChangCouponsUseState="ChangCouponsUseState"
  125. ></couponListWindow>
  126. </block>
  127. <!-- #ifdef MP -->
  128. <authorize :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse" @onLoadFun="onLoadFun"></authorize>
  129. <!-- #endif -->
  130. </view>
  131. </template>
  132. <script>
  133. import couponListWindow from '@/components/couponListWindow';
  134. import {
  135. getCartList,
  136. getCartCounts,
  137. changeCartNum,
  138. cartDel
  139. } from '@/api/order.js';
  140. import {
  141. getCoupons,
  142. getShopCoupons
  143. } from '@/api/api.js';
  144. import {
  145. getProductHot,
  146. collectAll
  147. } from '@/api/store.js';
  148. import {
  149. toLogin
  150. } from '@/libs/login.js';
  151. import {
  152. mapGetters
  153. } from "vuex";
  154. import recommend from '@/components/recommend';
  155. // #ifdef MP
  156. import authorize from '@/components/Authorize';
  157. // #endif
  158. const app = getApp();
  159. export default {
  160. components: {
  161. recommend,
  162. couponListWindow,
  163. // #ifdef MP
  164. authorize
  165. // #endif
  166. },
  167. data() {
  168. return {
  169. loading: false, //是否加载中
  170. loadend: false, //是否加载完毕
  171. loadTitle: '加载更多', //提示语
  172. cartCount: 0,
  173. goodsHidden: true,
  174. footerswitch: true,
  175. hostProduct: [],
  176. cartList: {
  177. valid: [],
  178. invalid: []
  179. },
  180. isAllSelect: false, //全选
  181. selectValue: [], //选中的数据
  182. selectCountPrice: 0.00,
  183. isAuto: false, //没有授权的不会自动授权
  184. isShowAuth: false, //是否隐藏授权
  185. hotScroll: false,
  186. hotPage: 1,
  187. hotLimit: 10,
  188. //属性是否打开
  189. coupon: {
  190. 'coupon': false,
  191. list: [],
  192. },
  193. // 购物车总数
  194. cartTotalCount:0,
  195. recommend: false,
  196. hide_mer_status: 1
  197. };
  198. },
  199. computed: mapGetters(['isLogin']),
  200. onReady(){
  201. uni.$on('update',(data)=>{
  202. this.hide_mer_status = data.hide_mer_status
  203. })
  204. },
  205. mounted: function() {
  206. const app = getApp();
  207. this.$nextTick(() => {
  208. this.hide_mer_status = app.globalData.hide_mer_status
  209. });
  210. },
  211. onLoad: function(options) {
  212. let that = this;
  213. if (that.isLogin == false) {
  214. // #ifdef H5 || APP-PLUS
  215. toLogin();
  216. // #endif
  217. // #ifdef MP
  218. that.isAuto = true;
  219. that.$set(that, 'isShowAuth', true);
  220. // #endif
  221. }
  222. },
  223. onShow: function() {
  224. uni.showTabBar();
  225. if (this.isLogin == true) {
  226. this.hostProduct = [];
  227. this.hotScroll = false;
  228. this.hotLimit = 10;
  229. this.hotPage = 1;
  230. this.getHostProduct();
  231. this.getCartList();
  232. this.getCartNum();
  233. this.goodsHidden = true;
  234. this.footerswitch = true;
  235. this.cartList = {
  236. valid: [],
  237. invalid: []
  238. },
  239. this.isAllSelect = false; //全选
  240. this.selectValue = []; //选中的数据
  241. this.selectCountPrice = 0.00;
  242. this.cartCount = 0;
  243. this.isShowAuth = false;
  244. uni.setStorage({
  245. key:'invoice_Data',
  246. data:{},
  247. success: function(){
  248. }
  249. })
  250. }
  251. },
  252. methods: {
  253. // 授权关闭
  254. authColse: function(e) {
  255. console.log(e,'authColse')
  256. this.isShowAuth = e;
  257. },
  258. onLoadFun(){
  259. this.isShowAuth = false;
  260. },
  261. // 删除
  262. subDel: function(event) {
  263. let that = this
  264. let type_id = []
  265. this.cartList.valid.forEach(el=>{
  266. el.list.forEach(goods=>{
  267. if(goods.check){
  268. type_id.push(goods.cart_id)
  269. }
  270. })
  271. })
  272. if(type_id.length == 0){
  273. return that.$util.Tips({
  274. title: '请选择产品'
  275. });
  276. }else{
  277. cartDel({
  278. cart_id:type_id,
  279. }).then(res=>{
  280. this.getCartList();
  281. this.getCartNum();
  282. return that.$util.Tips({
  283. title: res.message,
  284. icon: 'success'
  285. });
  286. }).catch(err => {
  287. return that.$util.Tips({
  288. title: err
  289. });
  290. });
  291. }
  292. },
  293. // 收藏
  294. subCollect: function(event) {
  295. let that = this
  296. let type_id = []
  297. this.cartList.valid.forEach(el=>{
  298. el.list.forEach(goods=>{
  299. if(goods.check){
  300. type_id.push(goods.product.product_id)
  301. }
  302. })
  303. })
  304. if(type_id.length == 0){
  305. return that.$util.Tips({
  306. title: '请选择产品'
  307. });
  308. }else{
  309. collectAll({
  310. type_id:type_id,
  311. type:1
  312. }).then(res=>{
  313. return that.$util.Tips({
  314. title: res.message,
  315. icon: 'success'
  316. });
  317. }).catch(err => {
  318. return that.$util.Tips({
  319. title: err
  320. });
  321. });
  322. }
  323. },
  324. // 立即下单
  325. subOrder: function(event) {
  326. let selectValue = []
  327. this.cartList.valid.forEach(el=>{
  328. el.list.forEach(goods=>{
  329. if(goods.check){
  330. selectValue.push(goods.cart_id)
  331. }
  332. })
  333. })
  334. if (selectValue.length > 0) {
  335. uni.navigateTo({
  336. url: '/pages/users/order_confirm/index?cartId=' + selectValue.join(',')
  337. });
  338. } else {
  339. return that.$util.Tips({
  340. title: '请选择产品'
  341. });
  342. }
  343. },
  344. // 购物车增加
  345. addCart: function(goods, index) {
  346. let that = this;
  347. goods.cart_num = Number(goods.cart_num) + 1
  348. this.cartTotalCount = Number(this.cartTotalCount) + 1;
  349. if (goods.hasOwnProperty('productAttr') && goods.cart_num > goods.productAttr.stock) {
  350. goods.cart_num = goods.productAttr.stock;
  351. goods.numAdd = true;
  352. goods.numSub = false;
  353. return
  354. } else {
  355. goods.numAdd = false;
  356. goods.numSub = false;
  357. }
  358. changeCartNum(goods.cart_id, {
  359. cart_num: goods.cart_num
  360. }).then(res => {}).catch(error => {
  361. goods.cart_num = Number(goods.cart_num) - 1
  362. })
  363. this.cartAllCheck('goodsCheck')
  364. },
  365. // 购物车递减
  366. subCart(goods) {
  367. let status = false;
  368. if (goods.cart_num < 1) status = true;
  369. if (goods.cart_num <= 1) {
  370. goods.cart_num = 1;
  371. goods.numSub = true;
  372. status = true;
  373. } else {
  374. goods.cart_num = Number(goods.cart_num) - 1
  375. this.cartTotalCount = Number(this.cartTotalCount) - 1;
  376. goods.numSub = false;
  377. goods.numAdd = false;
  378. if(goods.cart_num <= 1){
  379. goods.numSub = true;
  380. }
  381. }
  382. if (false == status) {
  383. changeCartNum(goods.cart_id, {
  384. cart_num: goods.cart_num
  385. }).then(res => {}).catch(error => {
  386. goods.cart_num = Number(goods.cart_num) - 1
  387. })
  388. this.cartAllCheck('goodsCheck')
  389. }
  390. },
  391. getCartNum: function() {
  392. let that = this;
  393. getCartCounts().then(res => {
  394. console.log(res);
  395. that.cartTotalCount = res.data[0].count || 0;
  396. });
  397. },
  398. // 购物车列表
  399. getCartList: function() {
  400. let that = this;
  401. getCartList().then(res => {
  402. res.data.list.forEach((item, index) => {
  403. item.allCheck = true
  404. item.list.forEach((goods, j) => {
  405. goods.check = true
  406. if (goods.cart_num == 1) {
  407. goods.numSub = true;
  408. } else {
  409. goods.numSub = false;
  410. }
  411. if (goods.cart_num == goods.productAttr.stock) {
  412. goods.numAdd = true;
  413. } else {
  414. goods.numAdd = false;
  415. }
  416. })
  417. })
  418. this.cartList.valid = res.data.list
  419. this.cartList.invalid = res.data.fail
  420. if(res.data.list.length == 0 && res.data.list.length == 0){
  421. this.recommend = true
  422. }else{
  423. this.recommend = false
  424. }
  425. this.checkboxAllChange()
  426. });
  427. },
  428. // 商铺全选
  429. storeAllCheck(item, index) {
  430. // 店铺取消
  431. if (item.allCheck) {
  432. item.allCheck = false
  433. item.list.forEach((el, index) => {
  434. el.check = false
  435. })
  436. } else {
  437. item.allCheck = true
  438. item.list.forEach((el, index) => {
  439. el.check = true
  440. })
  441. }
  442. this.cartAllCheck('goodsCheck')
  443. },
  444. // 商品选中
  445. goodsCheck(goods) {
  446. goods.check = !goods.check
  447. // console.log(parentIndex,'parentIndex')
  448. this.cartAllCheck('goodsCheck')
  449. },
  450. // 全选判断
  451. cartAllCheck(type) {
  452. let allArr = [];
  453. let totalMoney = 0
  454. let totalNum = 0
  455. this.cartList.valid.forEach((el, index) => {
  456. if (type == 'goodsCheck') {
  457. let tempArr = el.list.filter(goods => {
  458. return goods.check == true
  459. })
  460. if (el.list.length == tempArr.length) {
  461. el.allCheck = true
  462. allArr.push(el)
  463. } else {
  464. el.allCheck = false
  465. }
  466. } else {
  467. el.list.forEach((goods) => {
  468. goods.check = this.isAllSelect
  469. })
  470. el.allCheck = this.isAllSelect
  471. if (el.allCheck) allArr.push(el)
  472. }
  473. // 总金额 //总数
  474. el.list.forEach(e => {
  475. if (e.check) {
  476. totalMoney = this.$util.$h.Add(totalMoney, this.$util.$h.Mul(e.productAttr.price, e.cart_num))
  477. totalNum += e.cart_num
  478. }
  479. })
  480. })
  481. this.cartCount = totalNum
  482. this.selectCountPrice = totalMoney
  483. // 全选
  484. this.isAllSelect = allArr.length == this.cartList.valid.length ? true : false
  485. },
  486. // 购物车全选
  487. checkboxAllChange() {
  488. this.isAllSelect = !this.isAllSelect
  489. this.cartAllCheck('cartCheck')
  490. },
  491. // 推荐列表
  492. getHostProduct: function() {
  493. let that = this;
  494. if (that.loadend) return;
  495. if (that.hotScroll) return;
  496. that.loading = true;
  497. that.loadTitle = "加载更多";
  498. getProductHot(
  499. that.hotPage,
  500. that.hotLimit,
  501. ).then(res => {
  502. let list = res.data.list || [];
  503. that.hotPage++
  504. that.hotScroll = res.data.list.length < that.hotLimit
  505. that.hostProduct = that.hostProduct.concat(res.data.list)
  506. that.loading = false;
  507. that.loadTitle = that.hotScroll ? "我也是有底线的" : '加载更多';
  508. });
  509. },
  510. // 失效商品展开
  511. goodsOpen: function() {
  512. let that = this;
  513. that.goodsHidden = !that.goodsHidden;
  514. },
  515. // 管理
  516. manage: function() {
  517. let that = this;
  518. that.footerswitch = !that.footerswitch;
  519. },
  520. // 清空
  521. unsetCart: function() {
  522. let that = this,
  523. ids = [];
  524. for (let i = 0, len = that.cartList.invalid.length; i < len; i++) {
  525. ids.push(that.cartList.invalid[i].cart_id);
  526. }
  527. cartDel({
  528. cart_id:ids
  529. }).then(res => {
  530. that.$util.Tips({
  531. title: '清除成功'
  532. });
  533. that.$set(that.cartList, 'invalid', []);
  534. }).catch(res => {
  535. });
  536. },
  537. // 店铺优惠券
  538. giveCoupon(item){
  539. let that = this;
  540. let goodsArr = []
  541. let couponList = [];
  542. let activeList = [];
  543. let ids = []
  544. item.list.map(el=>{
  545. ids.push(el.product_id)
  546. })
  547. getCoupons({
  548. ids:ids.join(',')
  549. }).then(res => {
  550. goodsArr = res.data
  551. getShopCoupons(item.mer_id).then(({data})=>{
  552. uni.hideTabBar();
  553. couponList = goodsArr.concat(data)
  554. this.$set(this.coupon, 'list', couponList);
  555. this.$set(this.coupon, 'coupon', true);
  556. }).catch(error=>{
  557. uni.showTabBar();
  558. })
  559. });
  560. },
  561. ChangCouponsClone: function() {
  562. uni.showTabBar();
  563. this.$set(this.coupon, 'coupon', false)
  564. },
  565. ChangCouponsUseState(index) {
  566. uni.showTabBar();
  567. let that = this;
  568. that.coupon.list[index].issue = true;
  569. console.log(that.coupon.list[index])
  570. // that.$set(that.coupon, 'list', that.coupon.list);
  571. // that.$set(that.coupon, 'coupon', false);
  572. },
  573. },
  574. onReachBottom() {
  575. this.getHostProduct();
  576. }
  577. }
  578. </script>
  579. <style scoped lang="scss">
  580. .shoppingCart .labelNav {
  581. height: 76rpx;
  582. padding: 0 30rpx;
  583. font-size: 22rpx;
  584. color: #8c8c8c;
  585. position: fixed;
  586. left: 0;
  587. width: 100%;
  588. box-sizing: border-box;
  589. background-color: #f5f5f5;
  590. z-index: 5;
  591. top: 0;
  592. }
  593. .shoppingCart .labelNav .item .iconfont {
  594. font-size: 25rpx;
  595. margin-right: 10rpx;
  596. }
  597. .shoppingCart .nav {
  598. width: 100%;
  599. height: 80rpx;
  600. background-color: #fff;
  601. padding: 0 30rpx;
  602. box-sizing: border-box;
  603. font-size: 28rpx;
  604. color: #282828;
  605. position: fixed;
  606. left: 0;
  607. z-index: 5;
  608. top: 76rpx;
  609. }
  610. .shoppingCart .nav .administrate {
  611. font-size: 26rpx;
  612. color: #282828;
  613. width: 110rpx;
  614. height: 46rpx;
  615. border-radius: 6rpx;
  616. border: 1px solid #868686;
  617. }
  618. .shoppingCart .noCart {
  619. margin-top: 20rpx;
  620. margin-bottom: 20rpx;
  621. background-color: #fff;
  622. padding-top: 0.1rpx;
  623. }
  624. .shoppingCart .noCart .pictrue {
  625. width: 414rpx;
  626. height: 336rpx;
  627. margin: 78rpx auto 56rpx auto;
  628. }
  629. .shoppingCart .noCart .pictrue image {
  630. width: 100%;
  631. height: 100%;
  632. }
  633. .shoppingCart .list {
  634. margin-top: 171rpx;
  635. }
  636. .shoppingCart .list .item {
  637. background-color: #fff;
  638. margin-bottom: 15rpx;
  639. .store-title {
  640. display: flex;
  641. align-items: center;
  642. width: 100%;
  643. padding: 0 30rpx;
  644. height: 85rpx;
  645. border-bottom: 1px solid #f0f0f0;
  646. .checkbox {
  647. width: 60rpx;
  648. .iconfont {
  649. font-size: 40rpx;
  650. color: #CCCCCC;
  651. }
  652. .icon-xuanzhong1 {
  653. color: $theme-color;
  654. }
  655. }
  656. .info {
  657. flex: 1;
  658. display: flex;
  659. align-items: center;
  660. .iconfont {
  661. font-size: 36rpx;
  662. }
  663. .name {
  664. margin: 0 0 0 10rpx;
  665. font-size: 28rpx;
  666. color: #282828;
  667. font-weight: bold;
  668. }
  669. .icon-xiangyou {
  670. margin-top: 6rpx;
  671. font-size: 22rpx;
  672. color: #999;
  673. }
  674. }
  675. .coupon-btn {
  676. color: $theme-color;
  677. font-size: 22rpx;
  678. width: 100rpx;
  679. height: 36rpx;
  680. line-height: 36rpx;
  681. background: #FFEDEB;
  682. border-radius: 18rpx;
  683. text-align: center;
  684. }
  685. }
  686. }
  687. .shoppingCart .list .item .picTxt {
  688. width: 100%;
  689. padding: 25rpx 30rpx;
  690. position: relative;
  691. align-items: center;
  692. border-bottom: 1px solid #f0f0f0;
  693. .checkbox {
  694. width: 60rpx;
  695. .iconfont {
  696. font-size: 40rpx;
  697. color: #CCCCCC;
  698. }
  699. .icon-xuanzhong1 {
  700. color: $theme-color;
  701. }
  702. }
  703. }
  704. .shoppingCart .list .item .picTxt .pictrue {
  705. width: 160rpx;
  706. height: 160rpx;
  707. }
  708. .shoppingCart .list .item .picTxt .pictrue image {
  709. width: 100%;
  710. height: 100%;
  711. border-radius: 6rpx;
  712. }
  713. .shoppingCart .list .item .picTxt .text {
  714. width: 444rpx;
  715. margin-left: 20rpx;
  716. font-size: 28rpx;
  717. color: #282828;
  718. }
  719. .shoppingCart .list .item .picTxt .text .infor {
  720. font-size: 24rpx;
  721. color: #868686;
  722. margin-top: 16rpx;
  723. }
  724. .shoppingCart .list .item .picTxt .text .money {
  725. font-size: 32rpx;
  726. color: #282828;
  727. margin-top: 28rpx;
  728. }
  729. .shoppingCart .list .item .picTxt .carnum {
  730. height: 47rpx;
  731. position: absolute;
  732. bottom: 30rpx;
  733. right: 30rpx;
  734. }
  735. .shoppingCart .list .item .picTxt .carnum view {
  736. border: 1rpx solid #a4a4a4;
  737. width: 66rpx;
  738. text-align: center;
  739. height: 100%;
  740. line-height: 40rpx;
  741. font-size: 28rpx;
  742. color: #a4a4a4;
  743. }
  744. .shoppingCart .list .item .picTxt .carnum .reduce {
  745. border-right: 0;
  746. border-radius: 3rpx 0 0 3rpx;
  747. }
  748. .shoppingCart .list .item .picTxt .carnum .reduce.on {
  749. border-color: #e3e3e3;
  750. color: #dedede;
  751. }
  752. .shoppingCart .list .item .picTxt .carnum .plus {
  753. border-left: 0;
  754. border-radius: 0 3rpx 3rpx 0;
  755. }
  756. .shoppingCart .list .item .picTxt .carnum .num {
  757. color: #282828;
  758. }
  759. .shoppingCart .invalidGoods {
  760. background-color: #fff;
  761. }
  762. .shoppingCart .invalidGoods .goodsNav {
  763. width: 100%;
  764. height: 66rpx;
  765. padding: 0 30rpx;
  766. box-sizing: border-box;
  767. font-size: 28rpx;
  768. color: #282828;
  769. }
  770. .shoppingCart .invalidGoods .goodsNav .iconfont {
  771. color: #424242;
  772. font-size: 28rpx;
  773. margin-right: 17rpx;
  774. }
  775. .shoppingCart .invalidGoods .goodsNav .del {
  776. font-size: 26rpx;
  777. color: #999;
  778. }
  779. .shoppingCart .invalidGoods .goodsNav .del .icon-shanchu1 {
  780. color: #999;
  781. font-size: 33rpx;
  782. vertical-align: -2rpx;
  783. margin-right: 8rpx;
  784. }
  785. .shoppingCart .invalidGoods .goodsList .item {
  786. padding: 20rpx 30rpx;
  787. border-top: 1rpx solid #f5f5f5;
  788. }
  789. .shoppingCart .invalidGoods .goodsList .item .invalid {
  790. font-size: 22rpx;
  791. color: #fff;
  792. width: 70rpx;
  793. height: 36rpx;
  794. background-color: #aaa;
  795. border-radius: 3rpx;
  796. text-align: center;
  797. line-height: 36rpx;
  798. }
  799. .shoppingCart .invalidGoods .goodsList .item .pictrue {
  800. width: 140rpx;
  801. height: 140rpx;
  802. }
  803. .shoppingCart .invalidGoods .goodsList .item .pictrue image {
  804. width: 100%;
  805. height: 100%;
  806. border-radius: 6rpx;
  807. }
  808. .shoppingCart .invalidGoods .goodsList .item .text {
  809. width: 433rpx;
  810. font-size: 28rpx;
  811. color: #999;
  812. height: 140rpx;
  813. }
  814. .shoppingCart .invalidGoods .goodsList .item .text .name {
  815. width: 100%;
  816. }
  817. .shoppingCart .invalidGoods .goodsList .item .text .infor {
  818. font-size: 24rpx;
  819. }
  820. .shoppingCart .invalidGoods .goodsList .item .text .end {
  821. font-size: 26rpx;
  822. color: #bbb;
  823. }
  824. .shoppingCart .footer {
  825. z-index: 9;
  826. width: 100%;
  827. height: 96rpx;
  828. background-color: #fafafa;
  829. position: fixed;
  830. padding: 0 30rpx;
  831. box-sizing: border-box;
  832. border-top: 1rpx solid #eee;
  833. bottom: var(--window-bottom);
  834. }
  835. .shoppingCart .footer .checkAll {
  836. font-size: 28rpx;
  837. color: #282828;
  838. margin-left: 16rpx;
  839. }
  840. // .shoppingCart .footer checkbox .wx-checkbox-input{background-color:#fafafa;}
  841. .shoppingCart .footer .money {
  842. font-size: 30rpx;
  843. }
  844. .shoppingCart .footer .placeOrder {
  845. color: #fff;
  846. font-size: 30rpx;
  847. width: 226rpx;
  848. height: 70rpx;
  849. border-radius: 50rpx;
  850. text-align: center;
  851. line-height: 70rpx;
  852. margin-left: 22rpx;
  853. }
  854. .shoppingCart .footer .button .bnt {
  855. font-size: 28rpx;
  856. color: #999;
  857. border-radius: 50rpx;
  858. border: 1px solid #999;
  859. width: 160rpx;
  860. height: 60rpx;
  861. text-align: center;
  862. line-height: 60rpx;
  863. }
  864. .shoppingCart .footer .button form~form {
  865. margin-left: 17rpx;
  866. }
  867. .allcheckbox {
  868. display: flex;
  869. align-items: center;
  870. width: 260rpx;
  871. .iconfont {
  872. margin-right: 20rpx;
  873. font-size: 40rpx;
  874. color: #CCCCCC;
  875. }
  876. .icon-xuanzhong1 {
  877. color: $theme-color;
  878. }
  879. }
  880. </style>
  881. <style>
  882. @supports (bottom: constant(safe-area-inset-bottom)) or (bottom: env(safe-area-inset-bottom)){
  883. .shoppingCart .footer{
  884. bottom: calc(var(--window-bottom) + constant(safe-area-inset-bottom));
  885. bottom: calc(var(--window-bottom) + env(safe-area-inset-bottom));
  886. }
  887. }
  888. </style>