cart.vue 44 KB

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