order_addcart.vue 35 KB

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