order_addcart.vue 36 KB

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