index.vue 41 KB

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