order_addcart.vue 37 KB

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