cart.vue 47 KB

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