You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1527 lines
40 KiB

3 months ago
  1. <template>
  2. <view :data-theme="theme">
  3. <view class="cart_nav" :style='"height:"+navH+"rpx;"'>
  4. <view class='navbarCon acea-row'>
  5. <!-- #ifdef MP -->
  6. <view class="select_nav flex justify-center align-center" id="home" :style="{ top: homeTop + 'rpx' }">
  7. <text class="iconfont icon-fanhui2 px-20" @tap="returns"></text>
  8. <text class="iconfont icon-gengduo5 px-20" @tap.stop="showNav"></text>
  9. <text class="nav_line"></text>
  10. </view>
  11. <!-- #endif -->
  12. <!-- #ifdef H5 -->
  13. <view id="home" class="home acea-row row-center-wrapper iconfont icon-shouye4 h5_back"
  14. :style="{ top: homeTop + 'rpx' }" @tap="returns">
  15. </view>
  16. <!-- #endif -->
  17. <!-- #ifndef APP-PLUS -->
  18. <view class="nav_title" :style="{ top: homeTop + 'rpx' }">购物车</view>
  19. <!-- #endif -->
  20. <!-- #ifdef H5 || APP-PLUS -->
  21. <view class="right_select" :style="{ top: homeTop + 'rpx' }" @tap="showNav">
  22. <text class="iconfont icon-gengduo2"></text>
  23. </view>
  24. <!-- #endif -->
  25. </view>
  26. </view>
  27. <view class="dialog_nav" :style='"top:"+navH+"rpx;"' v-show="currentPage">
  28. <view class="dialog_nav_item" v-for="(item,index) in selectNavList" :key="index" @click="linkPage(item.url)">
  29. <text class="iconfont" :class="item.icon"></text>
  30. <text class="pl-20">{{item.name}}</text>
  31. </view>
  32. </view>
  33. <view class='shoppingCart copy-data' :style='"top:"+navH+"rpx;"' @touchstart="touchStart">
  34. <view class='labelNav acea-row row-around'>
  35. <view class='item'><text class='iconfont icon-xuanzhong'></text>100%正品保证</view>
  36. <view class='item'><text class='iconfont icon-xuanzhong'></text>所有商品精挑细选</view>
  37. <view class='item'><text class='iconfont icon-xuanzhong'></text>售后无忧</view>
  38. </view>
  39. <view class="borRadius14 cartBox">
  40. <view
  41. v-if="(cartList.valid.length === 0 && cartList.invalid.length === 0) || (cartList.valid.length > 0)"
  42. class='nav acea-row row-between-wrapper'>
  43. <view>购物数量 <text class='num font_color'>{{cartCount}}</text></view>
  44. <view v-if="cartList.valid.length > 0 || cartList.invalid.length > 0"
  45. class='administrate acea-row row-center-wrapper' @click='manage'>{{ footerswitch ? '管理' : '取消'}}
  46. </view>
  47. </view>
  48. <view v-if="cartList.valid.length > 0 || cartList.invalid.length > 0" class="pad30">
  49. <view class='list'>
  50. <checkbox-group @change="checkboxChange">
  51. <block v-for="(item,index) in cartList.valid" :key="index">
  52. <view class='item acea-row row-between-wrapper'>
  53. <!-- #ifndef MP -->
  54. <checkbox :value="(item.id).toString()" :checked="item.checked"
  55. :disabled="!item.attrStatus && footerswitch" style="margin-right: 10rpx;" />
  56. <!-- #endif -->
  57. <!-- #ifdef MP -->
  58. <checkbox :value="item.id" :checked="item.checked"
  59. :disabled="!item.attrStatus && footerswitch" />
  60. <!-- #endif -->
  61. <navigator :url='"/pages/goods/goods_details/index?id="+item.productId' hover-class='none'
  62. class='picTxt acea-row row-between-wrapper'>
  63. <view class='pictrue'>
  64. <image :src='item.image'></image>
  65. </view>
  66. <view class='text'>
  67. <view class='line1' :class="item.attrStatus?'':'reColor'">{{item.storeName}}
  68. </view>
  69. <view class='infor line1' v-if="item.suk">属性{{item.suk}}</view>
  70. <view class='money mt-28' v-if="item.attrStatus">{{item.vipPrice ? item.vipPrice :item.price}}</view>
  71. <view class="reElection acea-row row-between-wrapper" v-else>
  72. <view class="title">请重新选择商品规格</view>
  73. <view class="reBnt cart-color acea-row row-center-wrapper"
  74. @click.stop="reElection(item)">重选</view>
  75. </view>
  76. </view>
  77. <view class='carnum acea-row row-center-wrapper' v-if="item.attrStatus">
  78. <view class="reduce" :class="item.numSub ? 'on' : ''"
  79. @click.stop='subCart(index)'>-</view>
  80. <view class='num'>{{item.cartNum}}</view>
  81. <view class="plus" :class="item.numAdd ? 'on' : ''"
  82. @click.stop='addCart(index)'>+</view>
  83. </view>
  84. </navigator>
  85. </view>
  86. </block>
  87. </checkbox-group>
  88. </view>
  89. <view v-if="cartList.invalid.length > 0" class='invalidGoods borRadius14'
  90. :style="cartList.valid.length===0 && cartList.invalid.length > 0 ? 'position: relative;z-index: 111;top: -120rpx;':'position: static;'">
  91. <view class='goodsNav acea-row row-between-wrapper'>
  92. <view v-if="cartList.invalid.length > 1 || cartList.valid.length > 0" @click='goodsOpen'>
  93. <text class='iconfont'
  94. :class='goodsHidden==true?"icon-xiangxia":"icon-xiangshang"'></text>失效商品
  95. </view>
  96. <view v-else>
  97. 失效商品
  98. </view>
  99. <view class='del' @click='unsetCart'><text class='iconfont icon-shanchu1'></text>清空</view>
  100. </view>
  101. <view class='goodsList' :hidden='goodsHidden'>
  102. <block v-for="(item,index) in cartList.invalid" :key='index'>
  103. <view class='item acea-row row-between-wrapper'>
  104. <view class='invalid'>失效</view>
  105. <view class='picTxt acea-row row-between-wrapper'>
  106. <view class='pictrue'>
  107. <image :src='item.image'></image>
  108. </view>
  109. <view class='text acea-row row-column-between'>
  110. <view class='line1 name'>{{item.storeName}}</view>
  111. <view class='infor line1' v-if="item.suk">属性{{item.suk}}</view>
  112. <view class='acea-row row-between-wrapper'>
  113. <view class='end'>该商品已失效</view>
  114. </view>
  115. </view>
  116. </view>
  117. </view>
  118. </block>
  119. </view>
  120. </view>
  121. <!-- #ifdef H5 -->
  122. <view style="height:240rpx;"></view>
  123. <!-- #endif -->
  124. <!-- #ifdef MP || APP-PLUS -->
  125. <view style="height:120rpx;"></view>
  126. <!-- #endif -->
  127. <view class='loadingicon acea-row row-center-wrapper' v-if="cartList.invalid.length&&loadend">
  128. <text class='loading iconfont icon-jiazai'
  129. :hidden='loadingInvalid==false'></text>{{loadTitleInvalid}}
  130. </view>
  131. </view>
  132. <view class='noCart' v-if="(cartList.valid.length == 0 && cartList.invalid.length == 0 && canShow) || !isLogin">
  133. <view class='pictrue'>
  134. <image :src="urlDomain+'crmebimage/perset/staticImg/noCart.png'"></image>
  135. </view>
  136. <!-- 推荐商品 -->
  137. <recommend ref="recommendIndex"></recommend>
  138. <!-- #ifdef H5 -->
  139. <view style="height:120rpx;"></view>
  140. <!-- #endif -->
  141. </view>
  142. </view>
  143. </view>
  144. <!-- <view style="height:260rpx;"></view> -->
  145. <view class='footer acea-row row-between-wrapper' v-if="cartList.valid.length > 0" :class="bottomNavigationIsCustom?'bottom-custom':''">
  146. <view>
  147. <checkbox-group @change="checkboxAllChange">
  148. <checkbox value="all" :checked="!!isAllSelect" />
  149. <text class='checkAll'>全选({{selectValue.length}})</text>
  150. </checkbox-group>
  151. </view>
  152. <view class='money acea-row row-middle' v-if="footerswitch==true">
  153. <text class='price-color'>{{selectCountPrice}}</text>
  154. <form @submit="subOrder" report-submit='true'>
  155. <button class='placeOrder bg_color' formType="submit">立即下单</button>
  156. </form>
  157. </view>
  158. <view class='button acea-row row-middle' v-else>
  159. <form @submit="subCollect" report-submit='true'>
  160. <button class='btn_cart_color' formType="submit">收藏</button>
  161. </form>
  162. <form @submit="subDel" report-submit='true'>
  163. <button class='bnt' formType="submit">删除</button>
  164. </form>
  165. </view>
  166. </view>
  167. <productWindow :attr="attr" :isShow='1' :iSplus='1' :iScart='1' @myevent="onMyEvent" @ChangeAttr="ChangeAttr"
  168. @ChangeCartNum="ChangeCartNum" @attrVal="attrVal" @iptCartNum="iptCartNum" @goCat="reGoCat"
  169. id='product-window'></productWindow>
  170. <view class="uni-p-b-96"></view>
  171. <view class="uni-p-b-98"></view>
  172. <pageFooter></pageFooter>
  173. </view>
  174. </template>
  175. <script>
  176. import pageFooter from '@/components/pageFooter/index.vue'
  177. // #ifdef APP-PLUS
  178. let sysHeight = uni.getSystemInfoSync().statusBarHeight + 'px';
  179. // #endif
  180. // #ifndef APP-PLUS
  181. let sysHeight = 0
  182. // #endif
  183. import {
  184. getCartList,
  185. getCartCounts,
  186. changeCartNum,
  187. cartDel,
  188. getResetCart
  189. } from '@/api/order.js';
  190. import {
  191. tokenIsExistApi
  192. } from '@/api/api.js';
  193. import {
  194. collectAll,
  195. getProductDetail
  196. } from '@/api/store.js';
  197. import {getShare} from '@/api/public.js';
  198. import {mapGetters} from "vuex";
  199. import recommend from '@/components/recommend';
  200. import productWindow from '@/components/productWindow';
  201. import animationType from '@/utils/animationType.js'
  202. import {
  203. Debounce
  204. } from '@/utils/validate.js'
  205. let app = getApp();
  206. export default {
  207. components: {
  208. recommend,
  209. productWindow,
  210. pageFooter
  211. },
  212. data() {
  213. return {
  214. urlDomain: this.$Cache.get("imgHost"),
  215. cartCount: 0,
  216. goodsHidden: false,
  217. footerswitch: true,
  218. hostProduct: [],
  219. cartList: {
  220. valid: [],
  221. invalid: []
  222. },
  223. isAllSelect: false, //全选
  224. selectValue: [], //选中的数据
  225. selectCountPrice: 0.00,
  226. isAuto: false, //没有授权的不会自动授权
  227. isShowAuth: false, //是否隐藏授权
  228. hotScroll: false,
  229. hotPage: 1,
  230. hotLimit: 10,
  231. loading: false,
  232. loadend: false,
  233. loadTitle: '加载更多', //提示语
  234. page: 1,
  235. limit: 20,
  236. loadingInvalid: false,
  237. loadendInvalid: false,
  238. loadTitleInvalid: '加载更多', //提示语
  239. pageInvalid: 1,
  240. limitInvalid: 20,
  241. attr: {
  242. cartAttr: false,
  243. productAttr: [],
  244. productSelect: {}
  245. },
  246. productValue: [], //系统属性
  247. productInfo: {},
  248. attrValue: '', //已选属性
  249. attrTxt: '请选择', //属性页面提示
  250. cartId: 0,
  251. product_id: 0,
  252. sysHeight: sysHeight,
  253. canShow: false,
  254. configApi: {}, //分享类容配置
  255. theme:app.globalData.theme,
  256. navH:"",
  257. homeTop: 20,
  258. currentPage:false,
  259. selectNavList:[
  260. {name:'首页',icon:'icon-shouye8',url:'/pages/index/index'},
  261. {name:'搜索',icon:'icon-sousuo6',url:'/pages/goods/goods_search/index'},
  262. {name:'我的收藏',icon:'icon-shoucang3',url:'/pages/users/user_goods_collection/index'},
  263. {name:'个人中心',icon:'icon-gerenzhongxin1',url:'/pages/user/index'},
  264. ],
  265. tokenIsExist: false, //校验token是否有效
  266. };
  267. },
  268. computed: mapGetters(['isLogin','bottomNavigationIsCustom']),
  269. onLoad: function(options) {
  270. //检查token是否有效
  271. this.getTokenIsExist();
  272. // #ifdef MP
  273. this.navH = app.globalData.navHeight;
  274. // #endif
  275. // #ifndef MP
  276. this.navH = 96;
  277. // #endif
  278. // #ifdef H5
  279. this.shareApi();
  280. // #endif
  281. },
  282. onReady() {
  283. this.$nextTick(function() {
  284. // #ifdef MP
  285. const menuButton = uni.getMenuButtonBoundingClientRect();
  286. const query = uni.createSelectorQuery().in(this);
  287. query
  288. .select('#home')
  289. .boundingClientRect(data => {
  290. this.homeTop = menuButton.top * 2 + menuButton.height - data.height;
  291. })
  292. .exec();
  293. // #endif
  294. });
  295. },
  296. onShow: function() {
  297. this.canShow = false
  298. if (this.isLogin && this.tokenIsExist) {
  299. this.getIndex();
  300. };
  301. },
  302. methods: {
  303. //校验token是否有效,true为有效,false为无效
  304. getTokenIsExist() {
  305. tokenIsExistApi().then(res => {
  306. this.tokenIsExist = res.data;
  307. this.canShow = true;
  308. if (this.isLogin && this.tokenIsExist) {
  309. this.getIndex();
  310. }
  311. })
  312. },
  313. //首次进入加载的接口
  314. getIndex(){
  315. this.hotPage = 1;
  316. this.hostProduct = [],
  317. this.hotScroll = false,
  318. this.loadend = false;
  319. this.page = 1;
  320. this.cartList.valid = [];
  321. this.getCartList();
  322. this.loadendInvalid = false;
  323. this.pageInvalid = 1;
  324. this.cartList.invalid = [];
  325. this.getInvalidList();
  326. this.footerswitch = true;
  327. this.hotScroll = false;
  328. this.hotPage = 1;
  329. this.hotLimit = 10;
  330. this.cartList = {
  331. valid: [],
  332. invalid: []
  333. },
  334. this.isAllSelect = false; //全选
  335. this.selectValue = []; //选中的数据
  336. this.selectCountPrice = 0.00;
  337. this.cartCount = 0;
  338. this.isShowAuth = false;
  339. },
  340. // 修改购物车
  341. reGoCat: function() {
  342. let that = this,
  343. productSelect = that.productValue[this.attrValue];
  344. //如果有属性,没有选择,提示用户选择
  345. if (
  346. that.attr.productAttr.length &&
  347. productSelect === undefined
  348. )
  349. return that.$util.Tips({
  350. title: "产品库存不足,请选择其它"
  351. });
  352. let q = {
  353. id: that.cartId,
  354. productId: that.product_id,
  355. num: that.attr.productSelect.cart_num,
  356. unique: that.attr.productSelect !== undefined ?
  357. that.attr.productSelect.unique : that.productInfo.id
  358. };
  359. getResetCart(q)
  360. .then(function(res) {
  361. that.attr.cartAttr = false;
  362. that.$util.Tips({
  363. title: "添加购物车成功",
  364. success: () => {
  365. that.loadend = false;
  366. that.page = 1;
  367. that.cartList.valid = [];
  368. that.getCartList();
  369. that.getCartNum();
  370. }
  371. });
  372. })
  373. .catch(res => {
  374. return that.$util.Tips({
  375. title: res
  376. });
  377. });
  378. },
  379. onMyEvent: function() {
  380. this.$set(this.attr, 'cartAttr', false);
  381. },
  382. reElection: function(item) {
  383. this.getGoodsDetails(item)
  384. },
  385. /**
  386. * 获取产品详情
  387. *
  388. */
  389. getGoodsDetails: function(item) {
  390. uni.showLoading({
  391. title: '加载中',
  392. mask: true
  393. });
  394. let that = this;
  395. that.cartId = item.id;
  396. that.product_id = item.productId;
  397. getProductDetail(item.productId).then(res => {
  398. uni.hideLoading();
  399. that.attr.cartAttr = true;
  400. let productInfo = res.data.productInfo;
  401. that.$set(that, 'productInfo', productInfo);
  402. // that.$set(that.attr, 'productAttr', res.data.productAttr);
  403. that.$set(that, 'productValue', res.data.productValue);
  404. let productAttr = res.data.productAttr.map(item => {
  405. return {
  406. attrName : item.attrName,
  407. attrValues: item.attrValues.split(','),
  408. id:item.id,
  409. isDel:item.isDel,
  410. productId:item.productId,
  411. type:item.type
  412. }
  413. });
  414. this.$set(that.attr,'productAttr',productAttr);
  415. that.DefaultSelect();
  416. }).catch(err => {
  417. uni.hideLoading();
  418. })
  419. },
  420. /**
  421. * 属性变动赋值
  422. *
  423. */
  424. ChangeAttr: function(res) {
  425. let productSelect = this.productValue[res];
  426. if (productSelect && productSelect.stock > 0) {
  427. this.$set(this.attr.productSelect, "image", productSelect.image);
  428. this.$set(this.attr.productSelect, "price", productSelect.price);
  429. this.$set(this.attr.productSelect, "stock", productSelect.stock);
  430. this.$set(this.attr.productSelect, "unique", productSelect.id);
  431. this.$set(this.attr.productSelect, "cart_num", 1);
  432. this.$set(this, "attrValue", res);
  433. this.$set(this, "attrTxt", "已选择");
  434. } else {
  435. this.$set(this.attr.productSelect, "image", this.productInfo.image);
  436. this.$set(this.attr.productSelect, "price", this.productInfo.price);
  437. this.$set(this.attr.productSelect, "stock", 0);
  438. this.$set(this.attr.productSelect, "unique", this.productInfo.id);
  439. this.$set(this.attr.productSelect, "cart_num", 0);
  440. this.$set(this, "attrValue", "");
  441. this.$set(this, "attrTxt", "请选择");
  442. }
  443. },
  444. /**
  445. * 默认选中属性
  446. *
  447. */
  448. DefaultSelect: function() {
  449. let productAttr = this.attr.productAttr;
  450. let value = [];
  451. for (let key in this.productValue) {
  452. if (this.productValue[key].stock > 0) {
  453. value = this.attr.productAttr.length ? key.split(",") : [];
  454. break;
  455. }
  456. }
  457. for (let i = 0; i < productAttr.length; i++) {
  458. this.$set(productAttr[i], "index", value[i]);
  459. }
  460. //sort();排序函数:数字-英文-汉字;
  461. let productSelect = this.productValue[value.sort().join(",")];
  462. if (productSelect && productAttr.length) {
  463. this.$set(
  464. this.attr.productSelect,
  465. "storeName",
  466. this.productInfo.storeName
  467. );
  468. this.$set(this.attr.productSelect, "image", productSelect.image);
  469. this.$set(this.attr.productSelect, "price", productSelect.price);
  470. this.$set(this.attr.productSelect, "stock", productSelect.stock);
  471. this.$set(this.attr.productSelect, "unique", productSelect.id);
  472. this.$set(this.attr.productSelect, "cart_num", 1);
  473. this.$set(this, "attrValue", value.sort().join(","));
  474. this.$set(this, "attrTxt", "已选择");
  475. } else if (!productSelect && productAttr.length) {
  476. this.$set(
  477. this.attr.productSelect,
  478. "storeName",
  479. this.productInfo.storeName
  480. );
  481. this.$set(this.attr.productSelect, "image", this.productInfo.image);
  482. this.$set(this.attr.productSelect, "price", this.productInfo.price);
  483. this.$set(this.attr.productSelect, "stock", 0);
  484. this.$set(this.attr.productSelect, "unique", this.productInfo.id);
  485. this.$set(this.attr.productSelect, "cart_num", 0);
  486. this.$set(this, "attrValue", "");
  487. this.$set(this, "attrTxt", "请选择");
  488. } else if (!productSelect && !productAttr.length) {
  489. this.$set(
  490. this.attr.productSelect,
  491. "storeName",
  492. this.productInfo.storeName
  493. );
  494. this.$set(this.attr.productSelect, "image", this.productInfo.image);
  495. this.$set(this.attr.productSelect, "price", this.productInfo.price);
  496. this.$set(this.attr.productSelect, "stock", this.productInfo.stock);
  497. this.$set(
  498. this.attr.productSelect,
  499. "unique",
  500. this.productInfo.id || ""
  501. );
  502. this.$set(this.attr.productSelect, "cart_num", 1);
  503. this.$set(this, "attrValue", "");
  504. this.$set(this, "attrTxt", "请选择");
  505. }
  506. },
  507. attrVal(val) {
  508. this.$set(this.attr.productAttr[val.indexw], 'index', this.attr.productAttr[val.indexw].attrValues[val
  509. .indexn]);
  510. },
  511. /**
  512. * 购物车数量加和数量减
  513. *
  514. */
  515. ChangeCartNum: function(changeValue) {
  516. //changeValue:是否 加|减
  517. //获取当前变动属性
  518. let productSelect = this.productValue[this.attrValue];
  519. //如果没有属性,赋值给商品默认库存
  520. if (productSelect === undefined && !this.attr.productAttr.length)
  521. productSelect = this.attr.productSelect;
  522. //无属性值即库存为0;不存在加减;
  523. if (productSelect === undefined) return;
  524. let stock = productSelect.stock || 0;
  525. let num = this.attr.productSelect;
  526. if (changeValue) {
  527. num.cart_num++;
  528. if (num.cart_num > stock) {
  529. this.$set(this.attr.productSelect, "cart_num", stock ? stock : 1);
  530. this.$set(this, "cart_num", stock ? stock : 1);
  531. }
  532. } else {
  533. num.cart_num--;
  534. if (num.cart_num < 1) {
  535. this.$set(this.attr.productSelect, "cart_num", 1);
  536. this.$set(this, "cart_num", 1);
  537. }
  538. }
  539. },
  540. /**
  541. * 购物车手动填写
  542. *
  543. */
  544. iptCartNum: function(e) {
  545. this.$set(this.attr.productSelect, 'cart_num', e);
  546. },
  547. subDel: function(event) {
  548. let that = this,
  549. selectValue = that.selectValue;
  550. if (selectValue.length > 0)
  551. cartDel(selectValue).then(res => {
  552. that.loadend = false;
  553. that.page = 1;
  554. that.cartList.valid = [];
  555. that.getCartList();
  556. that.getCartNum();
  557. });
  558. else
  559. return that.$util.Tips({
  560. title: '请选择产品'
  561. });
  562. },
  563. getSelectValueProductId: function() {
  564. let that = this;
  565. let validList = that.cartList.valid;
  566. let selectValue = that.selectValue;
  567. let productId = [];
  568. if (selectValue.length > 0) {
  569. for (let index in validList) {
  570. if (that.inArray(validList[index].id, selectValue)) {
  571. productId.push(validList[index].productId);
  572. }
  573. }
  574. };
  575. return productId;
  576. },
  577. subCollect: function(event) {
  578. let that = this,
  579. selectValue = that.selectValue;
  580. if (selectValue.length > 0) {
  581. let selectValueProductId = that.getSelectValueProductId();
  582. collectAll(that.getSelectValueProductId()).then(res => {
  583. return that.$util.Tips({
  584. title: '收藏成功',
  585. icon: 'success'
  586. });
  587. }).catch(err => {
  588. return that.$util.Tips({
  589. title: err
  590. });
  591. });
  592. } else {
  593. return that.$util.Tips({
  594. title: '请选择产品'
  595. });
  596. }
  597. },
  598. // 立即下单
  599. subOrder: Debounce(function(event) {
  600. let that = this,
  601. selectValue = that.selectValue;
  602. if (selectValue.length > 0) {
  603. that.getPreOrder();
  604. } else {
  605. return that.$util.Tips({
  606. title: '请选择产品'
  607. });
  608. }
  609. }),
  610. /**
  611. * 预下单
  612. */
  613. getPreOrder: function() {
  614. let shoppingCartId = this.selectValue.map(item => {
  615. return {
  616. "shoppingCartId": Number(item)
  617. }
  618. })
  619. this.$Order.getPreOrder("shoppingCart", shoppingCartId);
  620. },
  621. checkboxAllChange: function(event) {
  622. let value = event.detail.value;
  623. if (value.length > 0) {
  624. this.setAllSelectValue(1)
  625. } else {
  626. this.setAllSelectValue(0)
  627. }
  628. },
  629. setAllSelectValue: function(status) {
  630. let that = this;
  631. let selectValue = [];
  632. let valid = that.cartList.valid;
  633. if (valid.length > 0) {
  634. let newValid = valid.map(item => {
  635. if (status) {
  636. if (that.footerswitch) {
  637. if (item.attrStatus) {
  638. item.checked = true;
  639. selectValue.push(item.id);
  640. } else {
  641. item.checked = false;
  642. }
  643. } else {
  644. item.checked = true;
  645. selectValue.push(item.id);
  646. }
  647. that.isAllSelect = true;
  648. } else {
  649. item.checked = false;
  650. that.isAllSelect = false;
  651. }
  652. return item;
  653. });
  654. that.$set(that.cartList, 'valid', newValid);
  655. that.selectValue = selectValue;
  656. that.switchSelect();
  657. }
  658. },
  659. checkboxChange: function(event) {
  660. let that = this;
  661. let value = event.detail.value;
  662. let valid = that.cartList.valid;
  663. let arr1 = [];
  664. let arr2 = [];
  665. let arr3 = [];
  666. let newValid = valid.map(item => {
  667. if (that.inArray(item.id, value)) {
  668. if (that.footerswitch) {
  669. if (item.attrStatus) {
  670. item.checked = true;
  671. arr1.push(item);
  672. } else {
  673. item.checked = false;
  674. }
  675. } else {
  676. item.checked = true;
  677. arr1.push(item);
  678. }
  679. } else {
  680. item.checked = false;
  681. arr2.push(item);
  682. }
  683. return item;
  684. });
  685. if (that.footerswitch) {
  686. arr3 = arr2.filter(item => !item.attrStatus);
  687. }
  688. that.$set(that.cartList, 'valid', newValid);
  689. // let newArr = that.cartList.valid.filter(item => item.attrStatus);
  690. that.isAllSelect = newValid.length === arr1.length + arr3.length;
  691. that.selectValue = value;
  692. that.switchSelect();
  693. },
  694. inArray: function(search, array) {
  695. for (let i in array) {
  696. if (array[i] == search) {
  697. return true;
  698. }
  699. }
  700. return false;
  701. },
  702. switchSelect: function() {
  703. let that = this;
  704. let validList = that.cartList.valid;
  705. let selectValue = that.selectValue;
  706. let selectCountPrice = 0.00;
  707. if (selectValue.length < 1) {
  708. that.selectCountPrice = selectCountPrice;
  709. } else {
  710. for (let index in validList) {
  711. if (that.inArray(validList[index].id, selectValue)) {
  712. selectCountPrice = that.$util.$h.Add(selectCountPrice, that.$util.$h.Mul(validList[index]
  713. .cartNum, validList[index].vipPrice ? validList[index].vipPrice : validList[index].price))
  714. }
  715. }
  716. that.selectCountPrice = selectCountPrice;
  717. }
  718. },
  719. /**
  720. * 购物车手动填写
  721. *
  722. */
  723. iptCartNum: function(index) {
  724. let item = this.cartList.valid[index];
  725. if (item.cartNum) {
  726. this.setCartNum(item.id, item.cartNum);
  727. }
  728. this.switchSelect();
  729. },
  730. blurInput: function(index) {
  731. let item = this.cartList.valid[index];
  732. if (!item.cartNum) {
  733. item.cartNum = 1;
  734. this.$set(this.cartList, 'valid', this.cartList.valid)
  735. }
  736. },
  737. subCart: Debounce(function(index) {
  738. let that = this;
  739. let status = false;
  740. let item = that.cartList.valid[index];
  741. item.cartNum = Number(item.cartNum) - 1;
  742. if (item.cartNum < 1) status = true;
  743. if (item.cartNum <= 1) {
  744. item.cartNum = 1;
  745. item.numSub = true;
  746. } else {
  747. item.numSub = false;
  748. item.numAdd = false;
  749. }
  750. if (false == status) {
  751. that.setCartNum(item.id, item.cartNum, function(data) {
  752. that.cartList.valid[index] = item;
  753. that.switchSelect();
  754. that.getCartNum();
  755. });
  756. }
  757. }),
  758. addCart: Debounce(function(index) {
  759. let that = this;
  760. let item = that.cartList.valid[index];
  761. item.cartNum = Number(item.cartNum) + 1;
  762. if (item.cartNum < item.stock) {
  763. item.numAdd = false;
  764. item.numSub = false;
  765. that.setCartNum(item.id, item.cartNum, function(data) {
  766. that.cartList.valid[index] = item;
  767. that.switchSelect();
  768. that.getCartNum();
  769. });
  770. } else if (item.cartNum === item.stock) {
  771. item.numAdd = true;
  772. item.numSub = false;
  773. that.setCartNum(item.id, item.cartNum, function(data) {
  774. that.cartList.valid[index] = item;
  775. that.switchSelect();
  776. that.getCartNum();
  777. });
  778. } else {
  779. item.cartNum = item.stock;
  780. item.numAdd = true;
  781. item.numSub = false;
  782. }
  783. }),
  784. //购物车数量变化
  785. setCartNum(cartId, cartNum, successCallback) {
  786. let that = this;
  787. changeCartNum(cartId, cartNum).then(res => {
  788. successCallback && successCallback(res.data);
  789. });
  790. },
  791. getCartNum: function() {
  792. let that = this;
  793. getCartCounts(true, 'total').then(res => {
  794. that.cartCount = res.data.count;
  795. });
  796. },
  797. getCartData(data) {
  798. return new Promise((resolve, reject) => {
  799. getCartList(data).then((res) => {
  800. resolve(res.data);
  801. }).catch(function(err) {
  802. this.loading = false;
  803. this.canShow = true;
  804. this.$util.Tips({
  805. title: err
  806. });
  807. })
  808. });
  809. },
  810. async getCartList() {
  811. uni.showLoading({
  812. title: '加载中',
  813. mask: true
  814. });
  815. let that = this;
  816. let data = {
  817. page: that.page,
  818. limit: that.limit,
  819. isValid: true
  820. }
  821. getCartCounts(true, 'total').then(async c => {
  822. that.cartCount = c.data.count;
  823. for (let i = 0; i < Math.ceil(that.cartCount / that.limit); i++) {
  824. let cartList = await this.getCartData(data);
  825. let valid = cartList.list;
  826. let validList = that.$util.SplitArray(valid, that.cartList.valid);
  827. let numSub = [{
  828. numSub: true
  829. }, {
  830. numSub: false
  831. }];
  832. let numAdd = [{
  833. numAdd: true
  834. }, {
  835. numAdd: false
  836. }],
  837. selectValue = [];
  838. if (validList.length > 0) {
  839. for (let index in validList) {
  840. if (validList[index].cartNum == 1) {
  841. validList[index].numSub = true;
  842. } else {
  843. validList[index].numSub = false;
  844. }
  845. let productInfo = validList[index];
  846. let stock = validList[index].stock ? validList[index].stock : 0;
  847. if (validList[index].cartNum == stock) {
  848. validList[index].numAdd = true;
  849. } else if (validList[index].cartNum == validList[index].stock) {
  850. validList[index].numAdd = true;
  851. } else {
  852. validList[index].numAdd = false;
  853. }
  854. if (validList[index].attrStatus) {
  855. validList[index].checked = true;
  856. selectValue.push(validList[index].id);
  857. } else {
  858. validList[index].checked = false;
  859. }
  860. }
  861. }
  862. that.$set(that.cartList, 'valid', validList);
  863. data.page +=1;
  864. that.selectValue = selectValue;
  865. let newArr = validList.filter(item => item.attrStatus);
  866. that.isAllSelect = newArr.length == selectValue.length && newArr.length;
  867. that.switchSelect();
  868. }
  869. that.loading = false;
  870. that.canShow = true;
  871. uni.hideLoading();
  872. });
  873. },
  874. getInvalidList: function() {
  875. let that = this;
  876. if (this.loadendInvalid) return false;
  877. if (this.loadingInvalid) return false;
  878. let data = {
  879. page: that.pageInvalid,
  880. limit: that.limitInvalid,
  881. isValid: false
  882. }
  883. getCartList(data).then(res => {
  884. let invalid = res.data.list,
  885. loadendInvalid = invalid.length < that.limitInvalid;
  886. let invalidList = that.$util.SplitArray(invalid, that.cartList.invalid);
  887. that.$set(that.cartList, 'invalid', invalidList);
  888. that.loadendInvalid = loadendInvalid;
  889. that.loadTitleInvalid = loadendInvalid ? '我也是有底线的~' : '加载更多';
  890. that.pageInvalid = that.pageInvalid + 1;
  891. that.loadingInvalid = false;
  892. //if(invalid.length===0) that.getHostProduct();
  893. }).catch(res => {
  894. that.loadingInvalid = false;
  895. that.loadTitleInvalid = '加载更多';
  896. })
  897. },
  898. goodsOpen: function() {
  899. let that = this;
  900. that.goodsHidden = !that.goodsHidden;
  901. },
  902. manage: function() {
  903. let that = this;
  904. that.footerswitch = !that.footerswitch;
  905. let arr1 = [];
  906. let arr2 = [];
  907. let newValid = that.cartList.valid.map(item => {
  908. if (that.footerswitch) {
  909. if (item.attrStatus) {
  910. if (item.checked) {
  911. arr1.push(item.id);
  912. }
  913. } else {
  914. item.checked = false;
  915. arr2.push(item);
  916. }
  917. } else {
  918. if (item.checked) {
  919. arr1.push(item.id);
  920. }
  921. }
  922. return item;
  923. });
  924. that.cartList.valid = newValid;
  925. if (that.footerswitch) {
  926. that.isAllSelect = newValid.length === arr1.length + arr2.length;
  927. } else {
  928. that.isAllSelect = newValid.length === arr1.length;
  929. }
  930. that.selectValue = arr1;
  931. that.switchSelect();
  932. },
  933. unsetCart: function() {
  934. let that = this,
  935. ids = [];
  936. for (let i = 0, len = that.cartList.invalid.length; i < len; i++) {
  937. ids.push(that.cartList.invalid[i].id);
  938. }
  939. cartDel(ids).then(res => {
  940. that.$util.Tips({
  941. title: '清除成功'
  942. });
  943. that.$set(that.cartList, 'invalid', []);
  944. that.getHostProduct();
  945. }).catch(res => {
  946. });
  947. },
  948. shareApi: function() {
  949. getShare().then(res => {
  950. this.$set(this, 'configApi', res.data);
  951. // #ifdef H5
  952. this.setOpenShare(res.data);
  953. // #endif
  954. })
  955. },
  956. // 微信分享;
  957. setOpenShare: function(data) {
  958. let that = this;
  959. if (that.$wechat.isWeixin()) {
  960. let configAppMessage = {
  961. desc: data.synopsis,
  962. title: data.title,
  963. link: location.href,
  964. imgUrl: data.img
  965. };
  966. that.$wechat.wechatEvevt(["updateAppMessageShareData", "updateTimelineShareData"],
  967. configAppMessage);
  968. }
  969. },
  970. returns: function() {
  971. uni.switchTab({
  972. url:'/pages/index/index'
  973. })
  974. },
  975. showNav(){
  976. this.currentPage = !this.currentPage;
  977. },
  978. //下拉导航页面跳转
  979. linkPage(url){
  980. if(url == '/pages/index/index' || url == '/pages/user/index'){
  981. uni.switchTab({
  982. url
  983. })
  984. }else{
  985. uni.navigateTo({
  986. animationType: animationType.type, animationDuration: animationType.duration,
  987. url
  988. })
  989. }
  990. this.currentPage = false
  991. },
  992. touchStart(){
  993. this.currentPage = false;
  994. }
  995. },
  996. onReachBottom() {
  997. let that = this;
  998. if (that.loadend) {
  999. that.getInvalidList();
  1000. }
  1001. if (that.cartList.valid.length == 0 && that.cartList.invalid.length == 0) {
  1002. that.$refs.recommendIndex.get_host_product();
  1003. }
  1004. }
  1005. }
  1006. </script>
  1007. <style scoped lang="scss">
  1008. .invalidClas {
  1009. position: relative;
  1010. z-index: 111;
  1011. top: -120rpx;
  1012. }
  1013. .invalidClasNO {
  1014. position: static;
  1015. margin-top: 15px;
  1016. }
  1017. .cartBox {
  1018. // background-color: #fff;
  1019. }
  1020. .cart_nav{
  1021. position: fixed;
  1022. @include main_bg_color(theme);
  1023. top: 0;
  1024. left: 0;
  1025. z-index: 99;
  1026. width: 100%;
  1027. }
  1028. .navbarCon {
  1029. position: absolute;
  1030. bottom: 0;
  1031. height: 100rpx;
  1032. width: 100%;
  1033. }
  1034. .h5_back {
  1035. color: #fff;
  1036. position: fixed;
  1037. left:20rpx;
  1038. font-size: 32rpx;
  1039. text-align: center;
  1040. line-height: 58rpx;
  1041. }
  1042. .select_nav{
  1043. width: 170rpx !important;
  1044. height: 60rpx !important;
  1045. border-radius: 33rpx;
  1046. background: rgba(255, 255, 255, 0.6);
  1047. color: #000;
  1048. position: fixed;
  1049. font-size: 18px;
  1050. line-height: 58rpx;
  1051. z-index: 1000;
  1052. left: 14rpx;
  1053. }
  1054. .px-20{
  1055. padding: 0 20rpx 0;
  1056. }
  1057. .nav_line{
  1058. content: '';
  1059. display: inline-block;
  1060. width: 1px;
  1061. height: 34rpx;
  1062. background: #fff;
  1063. position: absolute;
  1064. left: 0;
  1065. right: 0;
  1066. margin: auto;
  1067. }
  1068. .container_detail{
  1069. /* #ifdef MP */
  1070. margin-top:32rpx;
  1071. /* #endif */
  1072. }
  1073. .tab_nav{
  1074. width: 100%;
  1075. height: 48px;
  1076. padding:0 30rpx 0;
  1077. }
  1078. .nav_title{
  1079. width: 200rpx;
  1080. height: 58rpx;
  1081. line-height: 58rpx;
  1082. color: #fff;
  1083. font-size: 36rpx;
  1084. position: fixed;
  1085. text-align: center;
  1086. left: 0;
  1087. right: 0;
  1088. margin: auto;
  1089. }
  1090. .right_select{
  1091. position: fixed;
  1092. right: 20rpx;
  1093. color: #fff;
  1094. text-align: center;
  1095. line-height: 58rpx;
  1096. }
  1097. .dialog_nav{
  1098. position: fixed;
  1099. /* #ifdef MP */
  1100. left: 14rpx;
  1101. /* #endif */
  1102. /* #ifdef H5 || APP-PLUS*/
  1103. right: 14rpx;
  1104. /* #endif */
  1105. width: 240rpx;
  1106. background: #FFFFFF;
  1107. box-shadow: 0px 0px 16rpx rgba(0, 0, 0, 0.08);
  1108. z-index: 999;
  1109. border-radius: 14rpx;
  1110. &::before{
  1111. content: '';
  1112. width: 0;
  1113. height: 0;
  1114. position: absolute;
  1115. /* #ifdef MP */
  1116. left: 0;
  1117. right: 0;
  1118. margin:auto;
  1119. /* #endif */
  1120. /* #ifdef H5 || APP-PLUS */
  1121. right: 8px;
  1122. /* #endif */
  1123. top:-9px;
  1124. border-bottom: 10px solid #fff;
  1125. border-left: 10px solid transparent; /*transparent 表示透明*/
  1126. border-right: 10px solid transparent;
  1127. }
  1128. }
  1129. .dialog_nav_item{
  1130. width: 100%;
  1131. height: 84rpx;
  1132. line-height: 84rpx;
  1133. padding: 0 20rpx 0;
  1134. box-sizing: border-box;
  1135. border-bottom: #eee;
  1136. font-size: 28rpx;
  1137. color: #333;
  1138. position: relative;
  1139. .iconfont{
  1140. font-size: 32rpx;
  1141. }
  1142. &::after{
  1143. content: '';
  1144. position: absolute;
  1145. width:86px;
  1146. height: 1px;
  1147. background-color: #EEEEEE;
  1148. bottom: 0;
  1149. right: 0;
  1150. }
  1151. }
  1152. .pl-20{
  1153. padding-left: 20rpx;
  1154. }
  1155. .px-20{
  1156. padding: 0 20rpx 0;
  1157. }
  1158. .justify-center{
  1159. justify-content: center;
  1160. }
  1161. .align-center {
  1162. align-items: center;
  1163. }
  1164. .shoppingCart {
  1165. /* #ifdef H5 */
  1166. // padding-bottom: 0;
  1167. // padding-bottom: constant(safe-area-inset-bottom);
  1168. // padding-bottom: env(safe-area-inset-bottom);
  1169. /* #endif */
  1170. position: absolute;
  1171. width: 100%;
  1172. }
  1173. .shoppingCart .labelNav {
  1174. height: 178rpx;
  1175. padding: 30rpx 30rpx 0 ;
  1176. font-size: 22rpx;
  1177. color: #fff;
  1178. width: 100%;
  1179. box-sizing: border-box;
  1180. @include main_bg_color(theme);
  1181. z-index: 5;
  1182. }
  1183. .shoppingCart .labelNav .item .iconfont {
  1184. font-size: 25rpx;
  1185. margin-right: 10rpx;
  1186. }
  1187. .shoppingCart .nav {
  1188. width: 92%;
  1189. height: 90rpx;
  1190. background-color: #fff;
  1191. padding: 0 24rpx;
  1192. -webkit-box-sizing: border-box;
  1193. box-sizing: border-box;
  1194. font-size: 28rpx;
  1195. color: #282828;
  1196. margin: -90rpx auto 0 ;
  1197. z-index: 6;
  1198. border-top-left-radius: 14rpx;
  1199. border-top-right-radius: 14rpx;
  1200. }
  1201. .shoppingCart .nav .num {
  1202. margin-left: 12rpx;
  1203. }
  1204. .shoppingCart .nav .administrate {
  1205. font-size: 28rpx;
  1206. color: #333333;
  1207. }
  1208. .shoppingCart .noCart {
  1209. // margin-top: 171rpx;
  1210. background-color: #fff;
  1211. padding-top: 0.1rpx;
  1212. }
  1213. .shoppingCart .noCart .pictrue {
  1214. width: 414rpx;
  1215. height: 336rpx;
  1216. margin: 78rpx auto 56rpx auto;
  1217. }
  1218. .shoppingCart .noCart .pictrue image {
  1219. width: 100%;
  1220. height: 100%;
  1221. }
  1222. .shoppingCart .list {
  1223. width: 100%;
  1224. // margin-top: 178rpx;
  1225. /* #ifdef MP */
  1226. // margin-bottom:120rpx;
  1227. /* #endif */
  1228. /* #ifndef MP */
  1229. // margin-bottom:240rpx;
  1230. /* #endif */
  1231. overflow: hidden;
  1232. border-bottom-left-radius: 14rpx;
  1233. border-bottom-right-radius: 14rpx;
  1234. }
  1235. .shoppingCart .list .item {
  1236. padding: 24rpx;
  1237. background-color: #fff;
  1238. }
  1239. .shoppingCart .list .item .picTxt {
  1240. width: 582rpx;
  1241. position: relative;
  1242. }
  1243. .shoppingCart .list .item .picTxt .pictrue {
  1244. width: 160rpx;
  1245. height: 160rpx;
  1246. }
  1247. .shoppingCart .list .item .picTxt .pictrue image {
  1248. width: 100%;
  1249. height: 100%;
  1250. border-radius: 6rpx;
  1251. }
  1252. .shoppingCart .list .item .picTxt .text {
  1253. width: 396rpx;
  1254. font-size: 28rpx;
  1255. color: #282828;
  1256. }
  1257. .shoppingCart .list .item .picTxt .text .reColor {
  1258. color: #999;
  1259. }
  1260. .shoppingCart .list .item .picTxt .text .reElection {
  1261. margin-top: 20rpx;
  1262. }
  1263. .shoppingCart .list .item .picTxt .text .reElection .title {
  1264. font-size: 24rpx;
  1265. }
  1266. .shoppingCart .list .item .picTxt .text .reElection .reBnt {
  1267. width: 120rpx;
  1268. height: 46rpx;
  1269. border-radius: 23rpx;
  1270. font-size: 26rpx;
  1271. }
  1272. .shoppingCart .list .item .picTxt .text .infor {
  1273. font-size: 24rpx;
  1274. color: #999999;
  1275. margin-top: 16rpx;
  1276. }
  1277. .money {
  1278. font-size: 32rpx;
  1279. font-weight: 600;
  1280. @include price_color(theme);
  1281. .price-color{
  1282. @include price_color(theme);
  1283. }
  1284. }
  1285. .mt-28{
  1286. margin-top: 28rpx;
  1287. }
  1288. .bg_color{
  1289. @include main_bg_color(theme);
  1290. }
  1291. .font_color{
  1292. @include main_color(theme);
  1293. }
  1294. .shoppingCart .list .item .picTxt .carnum {
  1295. height: 47rpx;
  1296. position: absolute;
  1297. bottom: 7rpx;
  1298. right: 0;
  1299. }
  1300. .shoppingCart .list .item .picTxt .carnum view {
  1301. border: 1rpx solid #a4a4a4;
  1302. width: 66rpx;
  1303. text-align: center;
  1304. height: 100%;
  1305. line-height: 44rpx;
  1306. font-size: 28rpx;
  1307. color: #a4a4a4;
  1308. }
  1309. .shoppingCart .list .item .picTxt .carnum .reduce {
  1310. border-right: 0;
  1311. border-radius: 3rpx 0 0 3rpx;
  1312. border-radius: 22rpx 0rpx 0rpx 22rpx;
  1313. font-size: 34rpx;
  1314. line-height: 40rpx;
  1315. }
  1316. .on {
  1317. border-color: #e3e3e3 !important;
  1318. color: #dedede !important;
  1319. }
  1320. .shoppingCart .list .item .picTxt .carnum .plus {
  1321. border-left: 0;
  1322. border-radius: 0 3rpx 3rpx 0;
  1323. border-radius: 0rpx 22rpx 22rpx 0rpx;
  1324. font-size: 34rpx;
  1325. line-height: 40rpx;
  1326. }
  1327. .shoppingCart .list .item .picTxt .carnum .num {
  1328. color: #282828;
  1329. }
  1330. .shoppingCart .invalidGoods {
  1331. background-color: #fff;
  1332. margin-top: 30rpx;
  1333. }
  1334. .shoppingCart .invalidGoods .goodsNav {
  1335. width: 100%;
  1336. height: 90rpx;
  1337. padding: 0 24rpx;
  1338. box-sizing: border-box;
  1339. font-size: 28rpx;
  1340. color: #333333;
  1341. }
  1342. .shoppingCart .invalidGoods .goodsNav .iconfont {
  1343. color: #424242;
  1344. font-size: 28rpx;
  1345. margin-right: 17rpx;
  1346. }
  1347. .shoppingCart .invalidGoods .goodsNav .del {
  1348. font-size: 26rpx;
  1349. color: #333;
  1350. }
  1351. .shoppingCart .invalidGoods .goodsNav .del .icon-shanchu1 {
  1352. color: #333;
  1353. font-size: 33rpx;
  1354. vertical-align: -2rpx;
  1355. margin-right: 8rpx;
  1356. }
  1357. .shoppingCart .invalidGoods .goodsList .item {
  1358. padding: 24rpx;
  1359. }
  1360. .shoppingCart .invalidGoods .goodsList .picTxt {
  1361. width: 576rpx;
  1362. }
  1363. .shoppingCart .invalidGoods .goodsList .item .invalid {
  1364. font-size: 22rpx;
  1365. color: #CCCCCC;
  1366. height: 36rpx;
  1367. border-radius: 3rpx;
  1368. text-align: center;
  1369. line-height: 36rpx;
  1370. }
  1371. .shoppingCart .invalidGoods .goodsList .item .pictrue {
  1372. width: 160rpx;
  1373. height: 160rpx;
  1374. }
  1375. .shoppingCart .invalidGoods .goodsList .item .pictrue image {
  1376. width: 100%;
  1377. height: 100%;
  1378. border-radius: 6rpx;
  1379. }
  1380. .shoppingCart .invalidGoods .goodsList .item .text {
  1381. width: 396rpx;
  1382. font-size: 28rpx;
  1383. color: #999;
  1384. height: 140rpx;
  1385. }
  1386. .shoppingCart .invalidGoods .goodsList .item .text .name {
  1387. width: 100%;
  1388. }
  1389. .shoppingCart .invalidGoods .goodsList .item .text .infor {
  1390. font-size: 24rpx;
  1391. }
  1392. .shoppingCart .invalidGoods .goodsList .item .text .end {
  1393. font-size: 26rpx;
  1394. color: #bbb;
  1395. }
  1396. .footer {
  1397. z-index: 999;
  1398. width: 100%;
  1399. height: 100rpx;
  1400. background-color: #fff;
  1401. position: fixed;
  1402. padding: 0 24rpx;
  1403. box-sizing: border-box;
  1404. border-top: 1rpx solid #eee;
  1405. bottom: var(--window-bottom);
  1406. }
  1407. .footer .checkAll {
  1408. font-size: 28rpx;
  1409. color: #282828;
  1410. margin-left: 14rpx;
  1411. }
  1412. .footer .money {
  1413. font-size: 30rpx;
  1414. .font-color {
  1415. font-weight: 600;
  1416. }
  1417. }
  1418. .footer .placeOrder {
  1419. color: #fff;
  1420. font-size: 30rpx;
  1421. width: 226rpx;
  1422. height: 70rpx;
  1423. border-radius: 50rpx;
  1424. text-align: center;
  1425. line-height: 70rpx;
  1426. margin-left: 22rpx;
  1427. }
  1428. .footer .button .bnt {
  1429. font-size: 28rpx;
  1430. color: #999;
  1431. border-radius: 50rpx;
  1432. border: 1px solid #999;
  1433. width: 160rpx;
  1434. height: 60rpx;
  1435. text-align: center;
  1436. line-height: 60rpx;
  1437. }
  1438. .btn_cart_color{
  1439. font-size: 14px;
  1440. border-radius: 25px;
  1441. width: 80px;
  1442. height: 30px;
  1443. text-align: center;
  1444. line-height: 30px;
  1445. @include coupons_border_color(theme);
  1446. @include main_color(theme);
  1447. }
  1448. .footer .button form~form {
  1449. margin-left: 17rpx;
  1450. }
  1451. .uni-p-b-96 {
  1452. height: 96rpx;
  1453. }
  1454. /deep/ checkbox .uni-checkbox-input.uni-checkbox-input-checked {
  1455. @include main_bg_color(theme);
  1456. border: none !important;
  1457. color: #fff!important
  1458. }
  1459. /deep/ checkbox .wx-checkbox-input.wx-checkbox-input-checked {
  1460. @include main_bg_color(theme);
  1461. border: none !important;
  1462. color: #fff!important;
  1463. margin-right: 0 !important;
  1464. }
  1465. .bottom-custom{
  1466. bottom: calc(98rpx+ constant(safe-area-inset-bottom)); ///兼容 IOS<11.2/
  1467. bottom: calc(98rpx + env(safe-area-inset-bottom)); ///兼容 IOS>11.2/
  1468. }
  1469. </style>