cart.vue 44 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714
  1. <template>
  2. <view class="container cart clearfix">
  3. <tui-skeleton
  4. v-if="skeletonShow"
  5. backgroundColor="#fafafa"
  6. borderRadius="10rpx"
  7. :isLoading="true"
  8. :loadingType="5"
  9. ></tui-skeleton>
  10. <view class="foot-check-delbtn" v-if="!isshowDelbtn && goodsList.length > 0" :style="{ top: CustomBar + 'px' }">
  11. <view class="foot-text"
  12. >共<text>{{ kindCount }}</text
  13. >件商品</view
  14. >
  15. <view class="delBtn" @tap.stop="showDelManager">删除</view>
  16. </view>
  17. <view class="container-cart-main tui-skeleton" :style="{ paddingTop: isshowDelbtn ? '0rpx' : '80rpx' }">
  18. <view v-if="!isEmpty" class="container-cart">
  19. <scroll-view class="cart-content" scroll-y @scrolltolower="toLower">
  20. <view class="goods-list">
  21. <view v-for="(item, index) in goodsList" :key="index" class="goods-item">
  22. <view class="shoptitle">
  23. <!--选择商店的全部商品 :disabled="isNnder"-->
  24. <view class="checkbox-box" @click.stop="checkShop(item)">
  25. <view
  26. class="checkbox iconfont"
  27. :class="[item.isChecked ? 'icon-yixuanze' : 'icon-weixuanze']"
  28. ></view>
  29. </view>
  30. <view v-if="item.promotions" class="floor-item-act">
  31. <view class="floor-tags" @click.stop="clickPopupShow(item, 2)">{{
  32. item.promotions.name
  33. }}</view>
  34. </view>
  35. <view class="text">{{ item.shopName }}</view>
  36. </view>
  37. <view class="productlist">
  38. <view class="goods-pros" v-for="(pros, idx) in item.cartList" :key="idx">
  39. <view class="goods-pros-t">
  40. <!--选择商品-->
  41. <view class="checkbox-box" @click.stop="ischeck(item, pros, idx)">
  42. <view
  43. class="checkbox iconfont"
  44. :class="[pros.isChecked ? 'icon-yixuanze' : 'icon-weixuanze']"
  45. ></view>
  46. </view>
  47. <view class="pros-img" @click.stop="navToListPage(pros.productId)">
  48. <image :src="pros.image ? pros.image : ''" alt="" />
  49. </view>
  50. <view class="pros-product">
  51. <view class="producttitle" @click.stop="navToListPage(pros.productId)">
  52. {{ pros.name }}
  53. </view>
  54. <view class="productspec">规格:{{ pros.unit ? pros.unit : '' }}</view>
  55. <view
  56. class="productspec"
  57. v-if="pros.productCode != '' && pros.productCode != null"
  58. >
  59. <view bgcolor="#666666">商品编码:{{ pros.productCode }}</view>
  60. </view>
  61. <view class="productprice">
  62. <!--使用过滤器对总价改变-->
  63. <view
  64. class="price"
  65. :class="PromotionsFormat(pros.promotions) ? 'disabled' : ''"
  66. >
  67. <text>¥</text>
  68. {{
  69. (PromotionsFormat(pros.promotions)
  70. ? pros.originalPrice
  71. : pros.price) | NumFormat
  72. }}
  73. </view>
  74. <view class="count" :class="[isshowDelbtn ? 'none' : 'show']">
  75. <text class="count-tips" v-if="pros.number < pros.min"
  76. >起订量:{{ pros.min }}</text
  77. >
  78. <text class="count-tips step" v-if="pros.isStep"
  79. >购买量必须为起订量的整数倍</text
  80. >
  81. <view class="number-box">
  82. <view
  83. class="iconfont icon-jianhao"
  84. @click="changeCountSub(item, pros)"
  85. ></view>
  86. <input
  87. class="btn-input"
  88. type="number"
  89. maxlength="6"
  90. v-model="pros.number"
  91. @blur="changeNnmber($event, item, pros)"
  92. />
  93. <view
  94. class="iconfont icon-jiahao"
  95. @click="changeCountAdd(item, pros)"
  96. ></view>
  97. </view>
  98. </view>
  99. </view>
  100. <view v-show="pros.actStatus == 1" class="floor-item-act">
  101. <view
  102. v-if="PromotionsFormat(pros.promotions)"
  103. class="floor-tags"
  104. @click.stop="clickPopupShow(pros, 1)"
  105. >
  106. {{ pros.promotions.name }}
  107. <text v-if="pros.promotions != null && pros.promotions.type != 3">
  108. :¥{{
  109. pros.promotions == null
  110. ? '0.00'
  111. : pros.promotions.touchPrice | NumFormat
  112. }}
  113. </text>
  114. </view>
  115. <view
  116. v-else-if="pros.promotions.type != 3"
  117. class="floor-tags"
  118. @click.stop="clickPopupShow(pros, 2)"
  119. >
  120. {{ pros.promotions.name }}
  121. </view>
  122. </view>
  123. <view
  124. v-if="pros.actStatus == null && pros.ladderFlag == 1"
  125. class="floor-item-act"
  126. >
  127. <view class="floor-tags" @click.stop="clickPopupShow(pros, 2)"
  128. >阶梯价格</view
  129. >
  130. </view>
  131. </view>
  132. </view>
  133. </view>
  134. </view>
  135. <view class="goods-pros-b clearfix" :class="[isshowDelbtn ? 'none' : 'show']">
  136. <view class="sum-none" v-if="item.reducedPrice > 0">
  137. <text class="money-sign">¥</text>
  138. <text class="money">{{ item.totalOriginalPrice | NumFormat }}</text>
  139. <text class="money-reduced"
  140. >减<text>¥{{ item.reducedPrice | NumFormat }}</text></text
  141. >
  142. </view>
  143. <view class="sum"
  144. >合计:<text class="money"
  145. ><text class="money-sign">¥</text>{{ item.totalPrice | NumFormat }}</text
  146. ></view
  147. >
  148. </view>
  149. </view>
  150. </view>
  151. <view class="failure-list" v-if="failureList.length > 0">
  152. <view class="failure-title">
  153. <view class="title-txt"
  154. >失效商品<text>{{ failureList.length }}件</text></view
  155. >
  156. <view class="title-btn" @click.stop="deletefailureList"
  157. ><text class="butto">清空失效商品</text></view
  158. >
  159. </view>
  160. <view class="productlist">
  161. <view class="goods-pros" v-for="(failure, failureIdx) in failureList" :key="failureIdx">
  162. <view class="goods-pros-t" @click.stop="failureToProduct(failure)">
  163. <!--选择商品-->
  164. <view
  165. class="checkbox-box"
  166. @click.stop="ischeckFailure(failure)"
  167. v-if="isshowDelbtn"
  168. >
  169. <button
  170. class="checkbox iconfont"
  171. :class="[failure.isChecked ? 'icon-yixuanze' : 'icon-weixuanze']"
  172. ></button>
  173. </view>
  174. <text class="img-tip">失效</text>
  175. <view class="pros-img">
  176. <image :src="failure.mainImage ? failure.mainImage : ''" alt="" />
  177. </view>
  178. <view class="pros-product">
  179. <view class="producttitle">{{ failure.name }}</view>
  180. <view class="productspec">规格:{{ failure.unit ? failure.unit : '' }}</view>
  181. <view class="productstate">{{ failureStateText(failure.validFlag) }}</view>
  182. </view>
  183. <view class="pros-marks" v-if="failure.isFailureLayer"></view>
  184. <!--</view>-->
  185. </view>
  186. </view>
  187. </view>
  188. </view>
  189. <!--加载loadding-->
  190. <tui-loadmore :visible="loadding" :index="3" type="black"></tui-loadmore>
  191. <tui-nomore :visible="!pullUpOn" :backgroundColor="'#ffffff'" :text="nomoreText"></tui-nomore>
  192. <!--加载loadding-->
  193. </scroll-view>
  194. <!-- 脚部菜单 -->
  195. <view class="footer" :style="{ paddingBottom: isIphoneX ? '68rpx' : '0rpx' }">
  196. <view class="footer-le">
  197. <view class="foot-check checkbox-box" @tap.stop="checkAll()">
  198. <button
  199. class="checkbox iconfont"
  200. :class="[isCheckAll ? 'icon-yixuanze' : 'icon-weixuanze']"
  201. ></button>
  202. <view class="text">全选</view>
  203. </view>
  204. <view class="sum">
  205. <view class="sum-none" v-if="reducedPrice > 0">
  206. <text class="money-sign">¥</text>
  207. <text class="money">{{ totalOriginalPrice | NumFormat }}</text>
  208. <text class="money-reduced"
  209. >减<text>¥{{ reducedPrice | NumFormat }}</text></text
  210. >
  211. </view>
  212. <view class="sum-price" :class="reducedPrice == 0 ? 'none' : ''">
  213. 总价:<text class="money-sign">¥</text
  214. ><text class="money">{{ allPrice | NumFormat }}</text>
  215. </view>
  216. </view>
  217. </view>
  218. <view v-if="!isshowDelbtn" class="footer-ri">
  219. <view class="btn hanld-btn" @tap="toConfirmation">去结算({{ allCount }})</view>
  220. </view>
  221. <view v-else class="footer-del">
  222. <view class="btn btn-cancel" @tap.stop="hideDelManage">取消</view>
  223. <view class="btn btn-confirm" @tap.stop="deleteList">删除</view>
  224. </view>
  225. </view>
  226. </view>
  227. <view v-if="isEmpty" class="cart-content empty">
  228. <view class="empty-container">
  229. <image
  230. class="empty-container-image"
  231. src="https://img.caimei365.com/group1/M00/03/71/Cmis2F3wna6AWdWzAAGlgAP0das422.png"
  232. mode="aspectFit"
  233. ></image>
  234. <text class="error-text">购物车空空如也~</text>
  235. </view>
  236. </view>
  237. </view>
  238. <!-- 促销活动弹窗 -->
  239. <activi-popup :product="handlerPros" :popupShow="popupShow"></activi-popup>
  240. <!-- 透明模态层 -->
  241. <modal-layer v-if="modallayer"></modal-layer>
  242. </view>
  243. </template>
  244. <script>
  245. import tuiSkeleton from '@/components/tui-skeleton/tui-skeleton'
  246. import tuiLoadmore from '@/components/tui-components/loadmore/loadmore'
  247. import tuiNomore from '@/components/tui-components/nomore/nomore'
  248. import activiPopup from '@/components/cm-module/productDetails/cm-activipopu'
  249. import modalLayer from '@/components/modal-layer'
  250. import { mapState, mapMutations } from 'vuex'
  251. const defaultListQuery = {
  252. clubId: 0, // 机构Id
  253. serviceProviderId: 0, //协销Id
  254. againBuyProductIds: '', // 再次购买商品ids
  255. pageNum: 1, // 页码
  256. pageSize: 10 // 条数
  257. }
  258. export default {
  259. components: {
  260. tuiSkeleton,
  261. tuiLoadmore,
  262. tuiNomore,
  263. activiPopup,
  264. modalLayer
  265. },
  266. data() {
  267. return {
  268. kindCount: 0,
  269. isStock: '',
  270. popupShow: false,
  271. listQuery: Object.assign({}, defaultListQuery), // 购物车立即结算确认订单参数
  272. handlerPros: {}, //监听单挑促销商品
  273. promotionsList: [], //促销活动列表
  274. failureList: [], //失效商品列表
  275. goodsList: [], //购物车的商品
  276. delGoodsList: '', //要删除的商品
  277. setGoodData: '', //确认订单的商品
  278. isCheckAll: false, //是否全选
  279. totalOriginalPrice: 0, //所有原价价
  280. reducedPrice: 0, //满减
  281. allPrice: 0, //所有价格
  282. allCount: 0, //被选中的产品数量
  283. isModallayer: false,
  284. skeletonShow: true,
  285. isshowDelbtn: false,
  286. isDisabled: false, // 供应商/店铺全选是否禁用状态
  287. isEmpty: false, //显示空购物车
  288. scrollHeight: 'auto',
  289. nomoreText: '上拉显示更多',
  290. hasNextPage: false,
  291. loadding: false,
  292. pullUpOn: true,
  293. pullFlag: true,
  294. submitIds: [],
  295. depositIds: [6060, 6061, 6062, 6063, 6064], //定金商品ID
  296. rechargeIds: [6065, 6066, 6067, 6068, 6069], //充值余额商品ID
  297. isIphoneX: this.$store.state.isIphoneX
  298. }
  299. },
  300. onLoad() {
  301. this.setScrollHeight()
  302. },
  303. computed: {
  304. ...mapState(['hasLogin', 'userInfo'])
  305. },
  306. watch: {
  307. //深度监听所有数据,每次改变重新计算总价和总数
  308. goodsList: {
  309. deep: true,
  310. handler(val, oldval) {
  311. this.totalPeice()
  312. this.totalCount()
  313. }
  314. }
  315. },
  316. filters: {
  317. NumFormat(value) {
  318. //处理金额
  319. return Number(value).toFixed(2)
  320. },
  321. totalprice(val, count) {
  322. //单件商品的价格 × 数量
  323. return (val * count).toFixed(2)
  324. }
  325. },
  326. methods: {
  327. initData() {
  328. this.isModallayer = false //遮罩层 防止多次点击
  329. this.skeletonShow = true //预加载圆圈
  330. this.isCheckAll = false //是否全选
  331. this.submitIds = []
  332. this.$api.getStorage().then(resolve => {
  333. this.listQuery.serviceProviderId = resolve.serviceProviderId ? resolve.serviceProviderId : 0
  334. this.initGetCartGoodsList()
  335. this.getClubProductNum()
  336. })
  337. },
  338. initLogin() {
  339. this.$api.redirectTo('/pages/login/login?type=4')
  340. },
  341. clickPopupShow(pros, type) {
  342. //显示活动弹窗
  343. this.popupShow = true
  344. this.handlerPros = pros
  345. },
  346. failureToProduct(failure) {
  347. if (failure.status == 1) {
  348. this.$util.msg('商品已丢失,不能查看', 2000)
  349. return
  350. } else if (failure.status == 2) {
  351. this.$util.msg('商品已停售,不能查看', 2000)
  352. return
  353. } else {
  354. this.isModallayer = true
  355. this.$api.navigateTo(`/pages/goods/product?id=${failure.productId}`)
  356. }
  357. },
  358. failureStateText(state) {
  359. let stateText = '',
  360. stateTextObject = {
  361. 0: '商品已停售',
  362. 10: '商品已丢失'
  363. }
  364. Object.keys(stateTextObject).forEach(key => {
  365. if (key == state) {
  366. stateText = stateTextObject[key]
  367. }
  368. })
  369. return stateText
  370. },
  371. deletefailureList() {
  372. this.failureList.forEach(failure => {
  373. this.delGoodsList += failure.sellerCartId + ','
  374. })
  375. this.$util.modal('', '确定清空全部失效商品吗?', '确定', '取消', true, () => {
  376. console.log(this.delGoodsList)
  377. this.SellerService.SellerCartdelete({ sellerCartIds: this.delGoodsList })
  378. .then(response => {
  379. console.log(response)
  380. this.$util.msg('删除成功', 2000)
  381. setTimeout(() => {
  382. this.isshowDelbtn = false
  383. this.initGetCartGoodsList()
  384. }, 2000)
  385. })
  386. .catch(error => {
  387. this.$util.msg(error.msg, 2000)
  388. })
  389. })
  390. },
  391. setScrollHeight() {
  392. // 窗口高度-footer高度
  393. const { windowHeight, pixelRatio } = uni.getSystemInfoSync()
  394. setTimeout(() => {
  395. const query = uni.createSelectorQuery().in(this)
  396. query.selectAll('.footer').boundingClientRect()
  397. query.exec(res => {
  398. this.windowHeight = windowHeight
  399. if (res[0][0]) {
  400. this.scrollHeight = windowHeight - res[0][0].height
  401. }
  402. })
  403. }, 500)
  404. },
  405. initGetCartGoodsList() {
  406. //初始化购物车 index:1
  407. this.SellerService.GetSellerShoppingInfo(this.listQuery)
  408. .then(response => {
  409. this.skeletonShow = false
  410. let data = response.data
  411. let dataPage = data.pageDate
  412. this.promotionsList = data.promotionsList
  413. if (dataPage.list.length > 0 || data.invalidProductList.length > 0) {
  414. this.isEmpty = false
  415. } else {
  416. this.isEmpty = true
  417. }
  418. if (dataPage.list && dataPage.list.length > 0) {
  419. this.hasNextPage = dataPage.hasNextPage
  420. this.goodsList = dataPage.list
  421. this.goodsList.forEach((item, index) => {
  422. let cartListLength = item.cartList.length,
  423. invalidLength = 0
  424. item.cartList.forEach(pros => {
  425. pros.shopId = item.shopId
  426. pros.isStep = false
  427. if (pros.step === 2) {
  428. if (pros.number % pros.min != 0) {
  429. pros.number = pros.min
  430. this.totalShopPeice()
  431. this.updateShoppogNum(pros)
  432. }
  433. }
  434. })
  435. })
  436. this.totalShopPeice()
  437. this.pullFlag = false
  438. setTimeout(() => {
  439. this.pullFlag = true
  440. }, 500)
  441. if (this.hasNextPage) {
  442. this.pullUpOn = false
  443. this.nomoreText = '上拉显示更多'
  444. } else {
  445. if (this.goodsList.length < 4) {
  446. this.pullUpOn = true
  447. } else {
  448. this.pullUpOn = false
  449. this.nomoreText = '已至底部'
  450. }
  451. }
  452. } else {
  453. this.goodsList = []
  454. }
  455. if (response.data.invalidProductList && response.data.invalidProductList.length > 0) {
  456. let newFailureList = [],
  457. isFailureLayer
  458. response.data.invalidProductList.forEach((failure, index) => {
  459. if (failure.validFlag == 0 || failure.validFlag == 10) {
  460. isFailureLayer = true
  461. } else {
  462. isFailureLayer = false
  463. }
  464. newFailureList.push(Object.assign({}, failure, { isFailureLayer: isFailureLayer }))
  465. })
  466. this.failureList = newFailureList
  467. console.log(this.failureList)
  468. } else {
  469. this.failureList = []
  470. }
  471. })
  472. .catch(error => {
  473. this.$util.msg(error.msg, 2000)
  474. })
  475. },
  476. getOnReachBottomData() {
  477. //上拉加载
  478. this.listQuery.pageNum += 1
  479. this.SellerService.GetSellerShoppingInfo(this.listQuery)
  480. .then(response => {
  481. let resultsData = response.data.pageDate
  482. this.promotionsList = response.data.promotionsList
  483. this.hasNextPage = resultsData.hasNextPage
  484. this.goodsList = this.goodsList.concat(resultsData.results)
  485. this.goodsList.forEach((item, index) => {
  486. let productsListLength = item.cartList.length,
  487. invalidLength = 0
  488. item.cartList.forEach(pros => {
  489. pros.shopId = item.shopId
  490. pros.isStep = false
  491. if (pros.step === 2) {
  492. if (pros.number % pros.min != 0) {
  493. pros.number = pros.min
  494. this.totalShopPeice()
  495. this.updateShoppogNum(pros)
  496. }
  497. }
  498. })
  499. })
  500. this.totalShopPeice()
  501. this.pullFlag = false // 防上拉暴滑
  502. setTimeout(() => {
  503. this.pullFlag = true
  504. }, 500)
  505. if (this.hasNextPage) {
  506. this.pullUpOn = false
  507. this.nomoreText = '上拉显示更多'
  508. } else {
  509. this.loadding = false
  510. this.pullUpOn = false
  511. this.nomoreText = '已至底部'
  512. }
  513. })
  514. .catch(error => {
  515. this.$util.msg(error.msg, 2000)
  516. })
  517. },
  518. getClubProductNum() {
  519. // 获取协销下机构购物车数量
  520. this.SellerService.GetSellerProductNum({
  521. clubId: this.listQuery.clubId,
  522. serviceProviderId: this.listQuery.serviceProviderId
  523. }).then(response => {
  524. this.kindCount = response.data
  525. })
  526. },
  527. ischeck(item, pro) {
  528. //为未选中的时候改变为true,反之为true
  529. pro.isChecked = !pro.isChecked
  530. if (pro.isChecked) {
  531. if (!this.submitIds.includes(pro.productId * 1)) {
  532. this.submitIds.push(pro.productId)
  533. }
  534. } else {
  535. var lent = this.submitIds.indexOf(pro.productId * 1)
  536. if (lent >= 0) {
  537. this.submitIds.splice(lent, 1)
  538. }
  539. }
  540. this.updateProductCheckedAllBtn(item)
  541. this.updateCheckAllBtn()
  542. },
  543. updateProductCheckedAllBtn(item) {
  544. // 单独每个供应商的勾选判断
  545. let productsList = item.cartList,
  546. productsCheckedLength = 0,
  547. disabledLength = 0
  548. if (this.isshowDelbtn) {
  549. productsList.forEach(pros => {
  550. if (pros.isChecked) {
  551. productsCheckedLength++
  552. }
  553. })
  554. } else {
  555. productsList.forEach(pros => {
  556. if (pros.isChecked) {
  557. productsCheckedLength++
  558. }
  559. })
  560. }
  561. item.isChecked = productsCheckedLength === productsList.length - disabledLength
  562. },
  563. updateCheckAllBtn() {
  564. // 全选勾选判断
  565. let goodsCheckedLength = 0,
  566. disabledListLength = 0,
  567. goodsList = this.goodsList
  568. goodsList.forEach(item => {
  569. if (item.isChecked) {
  570. goodsCheckedLength++
  571. }
  572. })
  573. this.isCheckAll = goodsCheckedLength === goodsList.length - disabledListLength
  574. },
  575. checkShop(item) {
  576. //与单选商品类似
  577. item.isChecked = !item.isChecked
  578. this.setProductChecked(item)
  579. this.updateCheckAllBtn()
  580. },
  581. setProductChecked(item) {
  582. item.cartList.forEach(pros => {
  583. if (item.isChecked) {
  584. pros.isChecked = true
  585. if (!this.submitIds.includes(pros.productId * 1)) {
  586. this.submitIds.push(pros.productId)
  587. }
  588. } else {
  589. pros.isChecked = false
  590. var lent = this.submitIds.indexOf(pros.productId * 1)
  591. if (lent >= 0) {
  592. this.submitIds.splice(lent, 1)
  593. }
  594. }
  595. })
  596. },
  597. updateBothCheckBtn() {
  598. if (this.isshowDelbtn) {
  599. // 当管理删除按钮出现时,失效的商品可被选择
  600. this.goodsList.forEach(item => {
  601. item.isChecked = this.isCheckAll
  602. this.setProductChecked(item)
  603. })
  604. } else {
  605. this.goodsList.forEach(item => {
  606. item.isChecked = this.isCheckAll
  607. this.setProductChecked(item)
  608. })
  609. }
  610. },
  611. checkAll() {
  612. //全选方法内调用方法
  613. this.isCheckAll = !this.isCheckAll
  614. this.updateBothCheckBtn()
  615. },
  616. totalShopPeice() {
  617. //每次所属会所下的商品增减重新计算合计价格&减去含有下架的商品
  618. let touchPrice = 0
  619. let reducedPrice = 0 //商铺合计满减价
  620. this.goodsList.map((item, index) => {
  621. //计算店铺满减后店铺合计
  622. if (item.promotions && item.promotions.mode == 2) {
  623. let prosPrice = 0
  624. let totalOriginalPrice = 0 //商铺合计原价
  625. item.cartList.forEach(pros => {
  626. prosPrice += pros.price * pros.number
  627. totalOriginalPrice += pros.price * pros.number
  628. })
  629. if (prosPrice >= item.promotions.touchPrice) {
  630. item.totalPrice = prosPrice - item.promotions.reducedPrice
  631. item.reducedPrice = item.promotions.reducedPrice
  632. item.totalOriginalPrice = totalOriginalPrice
  633. } else {
  634. item.reducedPrice = 0 //统计合计价格
  635. item.totalPrice = prosPrice
  636. }
  637. } else {
  638. //以下为计算除店铺满减以外的单品满减以及正常商品合计
  639. let _totalPrice = 0
  640. let _reducedPrice = 0
  641. let _totalOriginalPrice = 0
  642. item.cartList.forEach(pros => {
  643. let _price = pros.price * pros.number
  644. _totalOriginalPrice += pros.price * pros.number
  645. if (pros.promotions && pros.promotions.type != 2 && pros.promotions.mode == 2) {
  646. if (_price >= pros.promotions.touchPrice) {
  647. _price = _price - pros.promotions.reducedPrice
  648. _reducedPrice += pros.promotions.reducedPrice
  649. }
  650. _totalPrice += _price
  651. } else {
  652. _reducedPrice = 0
  653. _totalPrice += pros.price * pros.number
  654. }
  655. })
  656. item.reducedPrice = _reducedPrice
  657. item.totalOriginalPrice = _totalOriginalPrice
  658. item.totalPrice = _totalPrice
  659. }
  660. })
  661. },
  662. totalPeice() {
  663. //计算总价格,每次调用此方法,将初始值为0,遍历价格并累加
  664. let totalPrice = 0
  665. let reducedPrice = 0
  666. let originalPrice = 0
  667. this.goodsList.forEach((item, index) => {
  668. let supplierPrice = 0
  669. let supplierReducedPrice = 0
  670. item.totalprice = 0
  671. item.reducedprice = 0
  672. item.originalprice = 0
  673. item.cartList.forEach(pros => {
  674. debugger
  675. if (pros.isChecked) {
  676. supplierPrice += pros.price * pros.number
  677. // 单品满减
  678. if (pros.promotions && pros.promotions.type * 1 === 1 && pros.promotions.mode * 1 === 2) {
  679. // 单品满减-重新计算供应商总价/满减金额
  680. if (pros.price * pros.number >= pros.promotions.touchPrice) {
  681. supplierPrice -= pros.promotions.reducedPrice
  682. supplierReducedPrice += pros.promotions.reducedPrice
  683. }
  684. }
  685. }
  686. })
  687. // 店铺满减
  688. if (item.promotions && item.promotions.mode * 1 === 2) {
  689. // 店铺满减-计算供应商总价/满减金额
  690. if (supplierPrice >= item.promotions.touchPrice) {
  691. supplierPrice -= item.promotions.reducedPrice
  692. supplierReducedPrice += item.promotions.reducedPrice
  693. }
  694. }
  695. item.totalprice = supplierPrice
  696. item.reducedprice = supplierReducedPrice
  697. item.originalprice = supplierPrice + supplierReducedPrice
  698. totalPrice += item.totalprice
  699. reducedPrice += item.reducedprice
  700. originalPrice += item.originalprice
  701. })
  702. //总促销计算
  703. this.promotionsList.forEach(promotions => {
  704. // 凑单满减
  705. if (promotions.mode * 1 === 2 && promotions.type * 1 === 2) {
  706. let total = 0
  707. promotions.productList.forEach(pros => {
  708. if (this.submitIds.includes(pros.productId * 1)) {
  709. total += pros.number * pros.price
  710. }
  711. })
  712. if (total >= promotions.touchPrice) {
  713. totalPrice -= promotions.reducedPrice
  714. reducedPrice += promotions.reducedPrice
  715. }
  716. }
  717. })
  718. //最后统计商品原价
  719. this.totalOriginalPrice = originalPrice
  720. //最后满减金额 = 店铺减去金额 + 单品减去金额 + 凑单减去金额
  721. this.reducedPrice = reducedPrice
  722. //最终合计价格 = 店铺满减合计 + 单品满减 + 正常合计 + 凑单满减
  723. this.allPrice = totalPrice
  724. },
  725. totalCount() {
  726. //计算总数量
  727. this.allCount = 0
  728. let prosAllCount = 0
  729. let validCount = 0
  730. let validList = []
  731. let productsList = []
  732. this.goodsList.forEach(item => {
  733. productsList = item.cartList
  734. productsList.forEach(pros => {
  735. if (pros.isChecked) {
  736. prosAllCount += parseInt(pros.number)
  737. this.allCount = prosAllCount
  738. }
  739. })
  740. })
  741. },
  742. changeCountAdd(item, pros) {
  743. //商品数量加加
  744. if (pros.step === 2) {
  745. pros.isStep = false
  746. pros.number += pros.min
  747. this.processActivityPrice(pros)
  748. this.isStock = false
  749. } else {
  750. pros.number++
  751. this.processActivityPrice(pros)
  752. this.isStock = false
  753. }
  754. this.updateShoppogNum(pros)
  755. this.totalShopPeice()
  756. },
  757. changeCountSub(item, pros) {
  758. //商品数量减减
  759. if (pros.number <= pros.min) {
  760. pros.number = pros.min
  761. this.$util.msg(`该商品最小起订量为${pros.min}`, 2000)
  762. return
  763. } else {
  764. if (pros.step === 2) {
  765. pros.isStep = false
  766. pros.number -= pros.min
  767. } else {
  768. pros.number--
  769. }
  770. this.processActivityPrice(pros)
  771. }
  772. this.updateShoppogNum(pros)
  773. this.totalShopPeice()
  774. },
  775. changeNnmber(e, item, pros) {
  776. //输入商品数量更新
  777. let _value = e.detail.value
  778. if (!this.$api.isNumber(_value)) {
  779. pros.number = pros.min
  780. } else if (_value < pros.min) {
  781. this.$util.msg(`该商品最小起订量为${pros.min}`, 2000)
  782. pros.number = pros.min
  783. } else if (_value % pros.min != 0) {
  784. pros.isStep = true
  785. pros.number = pros.min
  786. } else {
  787. pros.isStep = false
  788. pros.number = e.detail.value
  789. this.processActivityPrice(pros)
  790. }
  791. this.updateShoppogNum(pros)
  792. this.totalShopPeice()
  793. },
  794. processActivityPrice(pros) {
  795. //单独处理活动价格和阶梯价格
  796. let ladderPriceList = pros.ladderPrices
  797. if (pros.ladderFlag == 0 || pros.actStatus == 1) {
  798. pros.price = pros.price
  799. } else {
  800. ladderPriceList.forEach((item, index) => {
  801. if (pros.number >= item.buyNum) {
  802. pros.price = item.buyPrice
  803. }
  804. })
  805. }
  806. },
  807. updateShoppogNum(pros) {
  808. //加减购物车商品更新到后台
  809. this.SellerService.SellerAddProductNum({
  810. id: pros.id,
  811. productCount: pros.number,
  812. serviceProviderId: this.listQuery.serviceProviderId
  813. })
  814. .then(response => {
  815. this.isshowDelbtn = false
  816. this.isCheckAll = false
  817. this.initGetCartGoodsList()
  818. })
  819. .catch(error => {
  820. this.$util.msg(error.msg, 2000)
  821. })
  822. },
  823. toConfirmation() {
  824. //跳转确认订单页面
  825. let setGoodsList = []
  826. let productIdList = []
  827. let productIds = ''
  828. this.goodsList.forEach(res => {
  829. let products = res.cartList
  830. products.forEach(pros => {
  831. if (pros.isChecked) {
  832. setGoodsList.push(pros.productId)
  833. }
  834. })
  835. })
  836. if (setGoodsList == '') {
  837. this.$util.msg('请先选择结算商品~', 2000)
  838. return
  839. } else {
  840. /**
  841. * @获取勾选的商品ID拼接字符串逗号隔开,最后一个逗号去掉
  842. * @获取勾选的商品分类ID拼接字符串格式逗号隔开,最后一个逗号去掉
  843. */
  844. this.goodsList.forEach(el => {
  845. el.cartList.forEach(pros => {
  846. if (pros.isChecked) {
  847. productIdList.push(pros.productId)
  848. }
  849. })
  850. })
  851. //判断勾选的商品是否为充值商品或者为定金商品的一些处理逻辑
  852. const isHasDepositlds = productIdList.filter(item => this.depositIds.includes(item))
  853. const isHasRechargeIds = productIdList.filter(item => this.rechargeIds.includes(item))
  854. const isGoods = productIdList.every(item => {
  855. ;[...this.depositIds, ...this.rechargeIds].includes(item)
  856. })
  857. if (productIdList.length == 1 && isHasDepositlds.length === 1 && isHasRechargeIds.length === 0) {
  858. console.log('定金商品')
  859. productIdList.forEach(item => {
  860. productIds += item + ','
  861. })
  862. } else if (productIdList.length == 1 && isHasRechargeIds.length === 1 && isHasDepositlds.length === 0) {
  863. console.log('充值余额商品')
  864. productIdList.forEach(item => {
  865. productIds += item + ','
  866. })
  867. } else if (!isGoods && isHasRechargeIds.length === 0 && isHasDepositlds.length === 0) {
  868. console.log('正常商品')
  869. productIdList.forEach(item => {
  870. productIds += item + ','
  871. })
  872. } else {
  873. this.$util.modal('提示', '缴纳订金商品或余额充值商品请单独下单!', '确定', '', false, () => {})
  874. return
  875. }
  876. let cartPramsData = { productIds: productIds.substring(0, productIds.lastIndexOf(',')) }
  877. this.$api.navigateTo(`/pages/seller/order/create-order?data=${JSON.stringify({ data: cartPramsData })}`)
  878. }
  879. },
  880. showDelManager() {
  881. //显示删除商品管理
  882. this.isshowDelbtn = true
  883. if (this.isCheckAll) {
  884. this.updateBothCheckBtn()
  885. } else {
  886. this.updateCheckAllBtn()
  887. }
  888. },
  889. hideDelManage() {
  890. //隐藏删除商品管理
  891. this.isshowDelbtn = false
  892. if (this.isCheckAll) {
  893. this.updateBothCheckBtn()
  894. } else {
  895. this.updateCheckAllBtn()
  896. }
  897. },
  898. deleteList() {
  899. //删除购物车商品
  900. this.delGoodsList = []
  901. this.goodsList.forEach(delitem => {
  902. let products = delitem.cartList
  903. products.forEach(pros => {
  904. if (pros.isChecked) {
  905. this.delGoodsList += pros.id + ','
  906. }
  907. })
  908. })
  909. this.failureList.forEach(failure => {
  910. if (failure.isChecked) {
  911. this.delGoodsList += failure.id + ','
  912. }
  913. })
  914. if (this.delGoodsList.length == 0) {
  915. this.$util.msg('请选择要删除的商品~', 2000)
  916. return
  917. } else {
  918. this.$util.modal('', '确定删除选中的商品吗?', '确定', '取消', true, () => {
  919. this.SellerService.DeleteSellerCart({
  920. cartIds: this.delGoodsList,
  921. serviceProviderId: this.listQuery.serviceProviderId
  922. })
  923. .then(response => {
  924. this.$util.msg('删除成功', 2000)
  925. setTimeout(() => {
  926. this.isshowDelbtn = false
  927. this.initGetCartGoodsList()
  928. }, 2000)
  929. })
  930. .catch(error => {
  931. this.$util.msg(error.msg, 2000)
  932. })
  933. })
  934. }
  935. },
  936. goNavto(url) {
  937. uni.navigateTo({
  938. url
  939. })
  940. },
  941. PromotionsFormat(promo) {
  942. //促销活动类型数据处理
  943. if (promo != null) {
  944. if (promo.type == 1 && promo.mode == 1) {
  945. return true
  946. } else {
  947. return false
  948. }
  949. }
  950. return false
  951. },
  952. navToListPage(id) {
  953. this.isModallayer = true
  954. this.$api.navigateTo(`/pages/goods/product?id=${id}`)
  955. }
  956. },
  957. onReachBottom() {
  958. if (this.hasNextPage) {
  959. this.loadding = true
  960. this.pullUpOn = true
  961. this.getOnReachBottomData()
  962. }
  963. },
  964. onPullDownRefresh() {
  965. //下拉刷新
  966. this.initGetCartGoodsList()
  967. uni.stopPullDownRefresh()
  968. },
  969. onShow() {
  970. this.$api.getComStorage('orderUserInfo').then(resolve => {
  971. console.log(resolve)
  972. this.listQuery.clubId = resolve.clubID ? resolve.clubID : 0
  973. this.listQuery.againBuyProductIds = resolve.againBuyProductIds ? resolve.againBuyProductIds : ''
  974. this.initData()
  975. })
  976. }
  977. }
  978. </script>
  979. <style lang="scss">
  980. page {
  981. background: #f7f7f7;
  982. }
  983. .cart-content {
  984. position: relative;
  985. padding-bottom: 74rpx;
  986. }
  987. .container-cart-main.none {
  988. display: none;
  989. }
  990. .container-cart-main.show {
  991. display: block;
  992. }
  993. .cart-content.empty.none {
  994. display: none;
  995. }
  996. .cart-content.empty.show {
  997. display: block;
  998. }
  999. .container-cart.show {
  1000. display: block;
  1001. }
  1002. .container-cart.none {
  1003. display: none;
  1004. }
  1005. .empty-container.none {
  1006. display: none;
  1007. }
  1008. .empty-container.show {
  1009. display: flex;
  1010. }
  1011. .foot-check-delbtn {
  1012. width: 100%;
  1013. height: 80rpx;
  1014. position: fixed;
  1015. top: 0;
  1016. left: 0;
  1017. box-sizing: border-box;
  1018. padding: 15rpx 24rpx;
  1019. background-color: #f7f7f7;
  1020. z-index: 990;
  1021. .foot-text {
  1022. font-size: $font-size-26;
  1023. height: 50rpx;
  1024. line-height: 50rpx;
  1025. color: #666666;
  1026. float: left;
  1027. padding-left: 10rpx;
  1028. text {
  1029. // color: $color-system;
  1030. margin: 0 6rpx;
  1031. }
  1032. }
  1033. .delBtn {
  1034. width: 100rpx;
  1035. display: inline-block;
  1036. padding: 0 15rpx;
  1037. font-size: $font-size-26;
  1038. height: 50rpx;
  1039. line-height: 50rpx;
  1040. border-radius: 30rpx;
  1041. background: #ffffff;
  1042. border: 1px solid #e15616;
  1043. color: $color-system;
  1044. float: right;
  1045. text-align: center;
  1046. &.none {
  1047. display: none;
  1048. }
  1049. }
  1050. }
  1051. .checkbox-box {
  1052. display: flex;
  1053. align-items: center;
  1054. .checkbox {
  1055. display: flex;
  1056. margin: 0;
  1057. padding: 0;
  1058. display: flex;
  1059. flex-direction: column;
  1060. align-items: center;
  1061. box-sizing: border-box;
  1062. text-align: center;
  1063. text-decoration: none;
  1064. border-radius: 0;
  1065. -webkit-tap-highlight-color: transparent;
  1066. overflow: hidden;
  1067. background-color: #ffffff;
  1068. font-size: 36rpx;
  1069. color: $color-system;
  1070. padding: 5rpx;
  1071. &.icon-weixuanze {
  1072. color: #b2b2b2;
  1073. }
  1074. }
  1075. &.disabled {
  1076. .checkbox {
  1077. color: #999999;
  1078. }
  1079. }
  1080. .text {
  1081. font-size: $font-size-24;
  1082. margin-left: 10rpx;
  1083. }
  1084. }
  1085. .goods-list {
  1086. width: 100%;
  1087. height: auto;
  1088. border-top: 1px solid #ebebeb;
  1089. background-color: #f7f7f7;
  1090. .goods-item {
  1091. width: 702rpx;
  1092. padding: 0 24rpx;
  1093. background: #ffffff;
  1094. margin-bottom: 24rpx;
  1095. }
  1096. .shoptitle {
  1097. display: flex;
  1098. align-items: center;
  1099. height: 80rpx;
  1100. line-height: 80rpx;
  1101. .checkbox-box {
  1102. padding: 10rpx;
  1103. }
  1104. .text {
  1105. width: 450rpx;
  1106. display: block;
  1107. overflow: hidden;
  1108. text-overflow: ellipsis;
  1109. white-space: nowrap;
  1110. margin-left: 20rpx;
  1111. font-size: $font-size-28;
  1112. color: $text-color;
  1113. text-align: left;
  1114. font-weight: bold;
  1115. }
  1116. .floor-item-act {
  1117. height: 56rpx;
  1118. text-align: center;
  1119. box-sizing: border-box;
  1120. float: left;
  1121. padding: 10rpx 0;
  1122. margin-left: 20rpx;
  1123. .floor-tags {
  1124. height: 28rpx;
  1125. border-radius: 6rpx;
  1126. background-color: #ffffff;
  1127. line-height: 28rpx;
  1128. color: $color-system;
  1129. text-align: center;
  1130. display: inline-block;
  1131. padding: 0 16rpx;
  1132. font-size: $font-size-20;
  1133. border: 1px solid #e15616;
  1134. float: right;
  1135. }
  1136. }
  1137. }
  1138. .goods-pros {
  1139. width: 100%;
  1140. height: auto;
  1141. }
  1142. .goods-pros-t {
  1143. display: flex;
  1144. align-items: center;
  1145. width: 100%;
  1146. height: auto;
  1147. padding: 0 0 20rpx 0;
  1148. .checkbox-box {
  1149. padding: 10rpx;
  1150. }
  1151. .pros-img {
  1152. width: 210rpx;
  1153. height: 210rpx;
  1154. border-radius: 10rpx;
  1155. margin: 0 20rpx;
  1156. border: 1px solid #f3f3f3;
  1157. image {
  1158. width: 210rpx;
  1159. height: 210rpx;
  1160. border-radius: 10rpx;
  1161. }
  1162. }
  1163. }
  1164. .goods-pros-b {
  1165. width: 100%;
  1166. height: auto;
  1167. padding: 0 0 24rpx 0;
  1168. box-sizing: border-box;
  1169. &.show {
  1170. display: block;
  1171. }
  1172. &.none {
  1173. display: none;
  1174. }
  1175. .sum-none {
  1176. width: 100%;
  1177. height: 48rpx;
  1178. line-height: 48rpx;
  1179. color: $text-color;
  1180. float: left;
  1181. text-align: right;
  1182. .money {
  1183. font-size: $font-size-26;
  1184. color: #999999;
  1185. text-decoration: line-through;
  1186. }
  1187. .money-sign {
  1188. font-size: $font-size-26;
  1189. color: #999999;
  1190. text-decoration: line-through;
  1191. }
  1192. .money-reduced {
  1193. margin-left: 10rpx;
  1194. font-size: $font-size-26;
  1195. color: $color-system;
  1196. .iconfont {
  1197. font-size: $font-size-34;
  1198. }
  1199. }
  1200. }
  1201. .sum {
  1202. width: 100%;
  1203. height: 40rpx;
  1204. font-size: $font-size-28;
  1205. line-height: 40rpx;
  1206. color: $text-color;
  1207. float: left;
  1208. display: flex;
  1209. justify-content: flex-end;
  1210. .money {
  1211. color: #ff2a2a;
  1212. font-size: $font-size-28;
  1213. }
  1214. .money-sign {
  1215. font-size: $font-size-24;
  1216. color: #ff2a2a;
  1217. }
  1218. }
  1219. }
  1220. .pros-product {
  1221. width: 386rpx;
  1222. height: 100%;
  1223. line-height: 36rpx;
  1224. font-size: $font-size-26;
  1225. position: relative;
  1226. .producttitle {
  1227. width: 100%;
  1228. display: inline-block;
  1229. height: auto;
  1230. text-overflow: ellipsis;
  1231. display: -webkit-box;
  1232. word-break: break-all;
  1233. -webkit-box-orient: vertical;
  1234. -webkit-line-clamp: 2;
  1235. overflow: hidden;
  1236. margin-bottom: 8rpx;
  1237. .no-text {
  1238. display: inline-block;
  1239. height: 36rpx;
  1240. padding: 0 12rpx;
  1241. line-height: 36rpx;
  1242. background: linear-gradient(315deg, rgba(231, 0, 0, 1) 0%, rgba(255, 104, 1, 1) 100%);
  1243. border-radius: 18rpx;
  1244. text-align: center;
  1245. color: #ffffff;
  1246. font-size: $font-size-24;
  1247. margin-right: 24rpx;
  1248. }
  1249. }
  1250. .productspec {
  1251. height: 36rpx;
  1252. color: #999999;
  1253. text-overflow: ellipsis;
  1254. display: -webkit-box;
  1255. word-break: break-all;
  1256. -webkit-box-orient: vertical;
  1257. -webkit-line-clamp: 2;
  1258. overflow: hidden;
  1259. margin-top: 10rpx;
  1260. }
  1261. .productCode {
  1262. color: #666666;
  1263. }
  1264. .productprice {
  1265. width: 100%;
  1266. height: 48rpx;
  1267. margin: 10rpx 0 0 0;
  1268. .price {
  1269. line-height: 48rpx;
  1270. font-size: $font-size-28;
  1271. width: 48%;
  1272. color: #ff2a2a;
  1273. float: left;
  1274. &.disabled {
  1275. color: #999999;
  1276. text-decoration: line-through;
  1277. }
  1278. .money-sign {
  1279. font-size: $font-size-24;
  1280. color: #ff2a2a;
  1281. }
  1282. }
  1283. .count {
  1284. height: 100%;
  1285. float: right;
  1286. position: relative;
  1287. &.show {
  1288. display: block;
  1289. }
  1290. &.none {
  1291. display: none;
  1292. }
  1293. .count-tips {
  1294. width: auto;
  1295. display: inline-block;
  1296. padding: 0 15rpx;
  1297. line-height: 44rpx;
  1298. height: 44rpx;
  1299. border-radius: 22rpx;
  1300. background: $btn-confirm;
  1301. font-size: $font-size-24;
  1302. text-align: center;
  1303. color: #ffffff;
  1304. position: absolute;
  1305. top: -60rpx;
  1306. left: -5rpx;
  1307. z-index: 5;
  1308. &.step {
  1309. left: -217rpx;
  1310. }
  1311. &::before {
  1312. content: '';
  1313. position: absolute;
  1314. bottom: -30rpx;
  1315. right: 15rpx;
  1316. z-index: 1;
  1317. width: 0;
  1318. height: 0;
  1319. border-width: 18rpx;
  1320. border-style: solid;
  1321. border-color: $color-system transparent transparent transparent;
  1322. }
  1323. }
  1324. .number-box {
  1325. display: flex;
  1326. justify-content: center;
  1327. align-items: center;
  1328. border: 2rpx solid #ffe6dc;
  1329. border-radius: 30rpx;
  1330. height: 48rpx;
  1331. .iconfont {
  1332. font-size: $font-size-24;
  1333. padding: 0 18rpx;
  1334. color: #999999;
  1335. text-align: center;
  1336. line-height: 48rpx;
  1337. font-weight: bold;
  1338. background: #fef6f3;
  1339. &.icon-jianhao {
  1340. border-radius: 30rpx 0 0 30rpx;
  1341. }
  1342. &.icon-jiahao {
  1343. border-radius: 0 30rpx 30rpx 0;
  1344. }
  1345. }
  1346. .btn-input {
  1347. width: 62rpx;
  1348. height: 44rpx;
  1349. line-height: 44rpx;
  1350. border-radius: 4rpx;
  1351. text-align: center;
  1352. font-size: $font-size-24;
  1353. border-bottom: 2rpx solid #ffe6dc;
  1354. border-top: 2rpx solid #ffe6dc;
  1355. }
  1356. }
  1357. .uni-numbox {
  1358. position: absolute;
  1359. left: 45rpx;
  1360. bottom: 0;
  1361. .uni-numbox-minus,
  1362. .uni-numbox-plus {
  1363. width: 50rpx;
  1364. line-height: 40rpx;
  1365. }
  1366. .uni-numbox-value {
  1367. font-size: $font-size-28;
  1368. width: 60rpx;
  1369. }
  1370. }
  1371. }
  1372. }
  1373. .floor-item-act {
  1374. width: 100%;
  1375. height: 56rpx;
  1376. text-align: center;
  1377. box-sizing: border-box;
  1378. float: left;
  1379. padding: 0 0 10rpx 0;
  1380. margin-left: 10rpx;
  1381. .floor-tags {
  1382. height: 28rpx;
  1383. border-radius: 6rpx;
  1384. background-color: #ffffff;
  1385. line-height: 28rpx;
  1386. color: $color-system;
  1387. text-align: center;
  1388. display: inline-block;
  1389. padding: 0 16rpx;
  1390. font-size: $font-size-20;
  1391. border: 1px solid #e15616;
  1392. float: left;
  1393. }
  1394. }
  1395. }
  1396. }
  1397. .footer {
  1398. width: 100%;
  1399. background-color: #ffffff;
  1400. height: 110rpx;
  1401. position: fixed;
  1402. bottom: 0rpx;
  1403. z-index: 100;
  1404. .footer-le {
  1405. width: 510rpx;
  1406. height: 100%;
  1407. padding: 0 24rpx;
  1408. float: left;
  1409. .foot-check {
  1410. width: 100rpx;
  1411. float: left;
  1412. line-height: 110rpx;
  1413. font-size: $font-size-24;
  1414. .checkbox {
  1415. width: 40rpx;
  1416. text-align: center;
  1417. }
  1418. .text {
  1419. width: 60rpx;
  1420. float: right;
  1421. }
  1422. }
  1423. .sum {
  1424. width: 380rpx;
  1425. height: 110rpx;
  1426. float: right;
  1427. box-sizing: border-box;
  1428. padding: 10rpx;
  1429. .sum-none {
  1430. width: 100%;
  1431. height: 45rpx;
  1432. line-height: 45rpx;
  1433. color: $text-color;
  1434. float: left;
  1435. text-align: right;
  1436. .money {
  1437. font-size: $font-size-24;
  1438. color: #999999;
  1439. text-decoration: line-through;
  1440. }
  1441. .money-sign {
  1442. font-size: $font-size-24;
  1443. color: #999999;
  1444. text-decoration: line-through;
  1445. }
  1446. .money-reduced {
  1447. margin-left: 10rpx;
  1448. font-size: $font-size-24;
  1449. color: $color-system;
  1450. }
  1451. }
  1452. .sum-price {
  1453. text-align: right;
  1454. width: 100%;
  1455. height: 45rpx;
  1456. line-height: 45rpx;
  1457. font-size: $font-size-30;
  1458. color: $text-color;
  1459. float: left;
  1460. font-weight: normal;
  1461. &.none {
  1462. height: 90rpx;
  1463. line-height: 90rpx;
  1464. }
  1465. .money {
  1466. color: #ff2a2a;
  1467. }
  1468. .money-sign {
  1469. font-size: $font-size-24;
  1470. color: #ff2a2a;
  1471. }
  1472. }
  1473. }
  1474. }
  1475. .footer-ri {
  1476. width: 180rpx;
  1477. height: 84rpx;
  1478. background: linear-gradient(135deg, rgba(242, 143, 49, 1) 0%, rgba(225, 86, 22, 1) 100%);
  1479. float: right;
  1480. display: flex;
  1481. justify-content: space-between;
  1482. align-items: center;
  1483. z-index: 999;
  1484. border-radius: 49rpx;
  1485. margin-top: 15rpx;
  1486. margin-right: 10rpx;
  1487. &.none {
  1488. display: none;
  1489. }
  1490. .btn {
  1491. width: 200rpx;
  1492. height: 100%;
  1493. font-size: $font-size-28;
  1494. line-height: 110rpx;
  1495. color: #ffffff;
  1496. display: flex;
  1497. justify-content: center;
  1498. align-items: center;
  1499. }
  1500. }
  1501. .footer-del {
  1502. width: 400rpx;
  1503. height: 110rpx;
  1504. position: absolute;
  1505. padding-left: 200rpx;
  1506. background: #ffffff;
  1507. right: 0;
  1508. top: 0;
  1509. z-index: 1000;
  1510. &.show {
  1511. animation: showDelbtn 0s linear both;
  1512. }
  1513. &.none {
  1514. animation: hideDelbtn 0s linear both;
  1515. }
  1516. .btn {
  1517. width: 50%;
  1518. height: 100%;
  1519. line-height: 110rpx;
  1520. font-size: $font-size-28;
  1521. color: #ffffff;
  1522. text-align: center;
  1523. float: left;
  1524. }
  1525. .btn.btn-cancel {
  1526. background: #eec1ab;
  1527. }
  1528. .btn.btn-confirm {
  1529. background: #ff2a2a;
  1530. }
  1531. @keyframes showDelbtn {
  1532. 0% {
  1533. transform: translateX(0);
  1534. }
  1535. 100% {
  1536. transform: translateX(-100%);
  1537. }
  1538. }
  1539. @keyframes hideDelbtn {
  1540. 0% {
  1541. transform: translateX(-100%);
  1542. }
  1543. 100% {
  1544. transform: translateX(0);
  1545. }
  1546. }
  1547. }
  1548. }
  1549. .failure-list {
  1550. width: 702rpx;
  1551. height: auto;
  1552. padding: 0 24rpx;
  1553. margin-top: 20rpx;
  1554. background: #ffffff;
  1555. .failure-title {
  1556. width: 100%;
  1557. height: 82rpx;
  1558. line-height: 82rpx;
  1559. font-size: $font-size-28;
  1560. .title-txt {
  1561. float: left;
  1562. color: #666666;
  1563. text-align: left;
  1564. }
  1565. .title-btn {
  1566. float: right;
  1567. color: $color-system;
  1568. text-align: right;
  1569. line-height: 80rpx;
  1570. .butto {
  1571. display: inline-block;
  1572. padding: 0 15rpx;
  1573. font-size: $font-size-26;
  1574. height: 50rpx;
  1575. line-height: 50rpx;
  1576. border-radius: 30rpx;
  1577. background: #ffffff;
  1578. // border: 1px solid #C9C9C9;
  1579. // color: #999999;
  1580. margin-top: 15rpx;
  1581. }
  1582. }
  1583. }
  1584. .productlist {
  1585. padding-top: 10rpx;
  1586. .goods-pros {
  1587. width: 100%;
  1588. height: auto;
  1589. padding: 20rpx 0;
  1590. }
  1591. .goods-pros-t {
  1592. display: flex;
  1593. align-items: center;
  1594. width: 100%;
  1595. height: 210rpx;
  1596. position: relative;
  1597. .img-tip {
  1598. display: block;
  1599. width: 72rpx;
  1600. height: 36rpx;
  1601. line-height: 36rpx;
  1602. font-size: $font-size-24;
  1603. text-align: center;
  1604. color: #ffffff;
  1605. border-radius: 24rpx;
  1606. background: rgba(51, 51, 51, 0.3);
  1607. // position: absolute;
  1608. // left: 0;
  1609. // top: 0;
  1610. }
  1611. .checkbox-box {
  1612. padding: 10rpx;
  1613. }
  1614. .pros-img {
  1615. width: 180rpx;
  1616. height: 100%;
  1617. border-radius: 10rpx;
  1618. margin: 0 20rpx;
  1619. border: 1px solid #f3f3f3;
  1620. position: relative;
  1621. image {
  1622. width: 100%;
  1623. height: 100%;
  1624. border-radius: 10rpx;
  1625. }
  1626. }
  1627. .pros-marks {
  1628. width: 750rpx;
  1629. height: 250rpx;
  1630. z-index: 90;
  1631. background: rgba(0, 0, 0, 0.05);
  1632. position: absolute;
  1633. left: -20rpx;
  1634. top: -20rpx;
  1635. }
  1636. }
  1637. .goods-pros-b {
  1638. width: 622rpx;
  1639. margin-left: 84rpx;
  1640. height: 40rpx;
  1641. padding: 0 0 26rpx 0;
  1642. // border-top: 1px solid #EBEBEB;
  1643. &.show {
  1644. display: block;
  1645. }
  1646. &.none {
  1647. display: none;
  1648. }
  1649. .sum {
  1650. font-size: $font-size-28;
  1651. line-height: 40rpx;
  1652. color: $text-color;
  1653. display: flex;
  1654. justify-content: flex-end;
  1655. .money {
  1656. color: #ff2a2a;
  1657. font-size: $font-size-28;
  1658. }
  1659. .money-sign {
  1660. font-size: $font-size-24;
  1661. color: #ff2a2a;
  1662. }
  1663. }
  1664. }
  1665. .pros-product {
  1666. width: 402rpx;
  1667. height: 100%;
  1668. line-height: 36rpx;
  1669. font-size: $font-size-28;
  1670. position: relative;
  1671. .producttitle {
  1672. width: 100%;
  1673. display: inline-block;
  1674. height: auto;
  1675. text-overflow: ellipsis;
  1676. display: -webkit-box;
  1677. word-break: break-all;
  1678. -webkit-box-orient: vertical;
  1679. -webkit-line-clamp: 2;
  1680. overflow: hidden;
  1681. margin-bottom: 8rpx;
  1682. .no-text {
  1683. display: inline-block;
  1684. height: 36rpx;
  1685. padding: 0 12rpx;
  1686. line-height: 36rpx;
  1687. background: linear-gradient(315deg, rgba(231, 0, 0, 1) 0%, rgba(255, 104, 1, 1) 100%);
  1688. border-radius: 18rpx;
  1689. text-align: center;
  1690. color: #ffffff;
  1691. font-size: $font-size-28;
  1692. margin-right: 24rpx;
  1693. }
  1694. }
  1695. .productspec {
  1696. height: 36rpx;
  1697. color: #999999;
  1698. font-size: $font-size-26;
  1699. margin-top: 20rpx;
  1700. }
  1701. .productstate {
  1702. font-size: $font-size-28;
  1703. height: 44rpx;
  1704. color: #ff2a2a;
  1705. position: absolute;
  1706. bottom: 0;
  1707. left: 0;
  1708. }
  1709. }
  1710. }
  1711. }
  1712. </style>