cart.vue 48 KB

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