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