index.vue 46 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951
  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 v-else>
  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">{{ failureStateText(failure.status) }}</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. popupShow0: false,
  306. popupShow1: false,
  307. popupShow2: false,
  308. currentTab: 1,
  309. navbar: [{ name: '未领取', num: 0 }, { name: '已领取', num: 0 }],
  310. couponParam: {
  311. // 获取弹窗优惠券领取参数
  312. userId: 0,
  313. shopId: 0,
  314. status: 1,
  315. source: 2
  316. },
  317. productCouponList: [], // 优惠券弹窗列表
  318. isCouponEmpty: false,
  319. contentModalText: '', //操作文字提示语句
  320. modal: false,
  321. modalButton: [
  322. {
  323. text: '取消',
  324. type: 'gray',
  325. plain: true //是否空心
  326. },
  327. {
  328. text: '去升级',
  329. customStyle: {
  330. color: '#fff',
  331. bgColor: 'linear-gradient(90deg, #F28F31 0%, #FF5B00 100%)'
  332. },
  333. plain: false
  334. }
  335. ],
  336. handlePros: {}
  337. }
  338. },
  339. created() {
  340. this.setScrollHeight()
  341. console.log('pathType', this.pathType)
  342. },
  343. computed: {
  344. ...mapState(['hasLogin', 'userInfo', 'isWxAuthorize'])
  345. },
  346. watch: {
  347. //深度监听所有数据,每次改变重新计算总价和总数
  348. goodsList: {
  349. deep: true,
  350. handler(val, oldval) {
  351. this.totalPeice()
  352. this.totalCount()
  353. }
  354. }
  355. },
  356. filters: {
  357. NumFormat(value) {
  358. //处理金额
  359. return Number(value).toFixed(2)
  360. },
  361. totalprice(val, count) {
  362. //单件商品的价格 × 数量
  363. return (val * count).toFixed(2)
  364. }
  365. },
  366. methods: {
  367. async initData() {
  368. const userInfo = await this.$api.getStorage()
  369. this.skeletonShow = true //预加载圆圈
  370. this.isCheckAll = false //是否全选
  371. this.submitIds = []
  372. this.checkenProsList = []
  373. this.eligibleCoupons = []
  374. this.userId = this.couponParam.userId = userInfo.userId ? userInfo.userId : 0
  375. this.userIdentity = userInfo.userIdentity ? userInfo.userIdentity : 0
  376. this.vipFlag = userInfo.vipFlag ? userInfo.vipFlag : 0
  377. this.initGetCartGoodsList()
  378. },
  379. isShowVipFlag(pros) {
  380. if (pros.priceFlag != 1) {
  381. if (this.userIdentity == 4 && this.vipFlag == 1) {
  382. return true
  383. } else if (this.userIdentity == 2) {
  384. return true
  385. }
  386. }
  387. },
  388. initLogin() {
  389. this.$api.redirectTo('/pages/login/login')
  390. },
  391. clickPopupShow(pros, type) {
  392. this.popupShow = true
  393. this.handlerPros = pros
  394. },
  395. setScrollHeight() {
  396. // 窗口高度-footer高度
  397. const { windowHeight, pixelRatio } = uni.getSystemInfoSync()
  398. setTimeout(() => {
  399. const query = uni.createSelectorQuery().in(this)
  400. query.selectAll('.footer').boundingClientRect()
  401. query.exec(res => {
  402. this.windowHeight = windowHeight
  403. if (res[0][0]) {
  404. this.scrollHeight = windowHeight - res[0][0].height
  405. }
  406. })
  407. }, 500)
  408. },
  409. initGetCartGoodsList() {
  410. //初始化购物车 index:1
  411. this.ProductService.QueryShoppingCartList({ userId: this.userId, source: 2 })
  412. .then(response => {
  413. this.skeletonShow = false
  414. let data = response.data
  415. this.kindCount = data.kindCount
  416. this.promotionsList = data.promotions
  417. this.totalCouponList = data.couponList
  418. this.$store.commit('updateAllNum', data.kindCount)
  419. if (data.list.length > 0 || data.invalid.length > 0) {
  420. this.isEmpty = false
  421. } else {
  422. this.isEmpty = true
  423. }
  424. if (data.list && data.list.length > 0) {
  425. this.goodsList = data.list
  426. this.goodsList.forEach((supplier, index) => {
  427. supplier.cartList.forEach(pros => {
  428. pros.shopId = supplier.shopId
  429. pros.isStep = false
  430. if (pros.stock === 0 || pros.number > pros.stock) {
  431. supplier.isDisable = true
  432. pros.isDisable = true
  433. } else {
  434. pros.isDisable = false
  435. }
  436. if (pros.step === 2) {
  437. if (pros.number % pros.min != 0) {
  438. pros.number = pros.min
  439. this.totalShopPeice()
  440. this.updateShoppogNum(pros)
  441. }
  442. }
  443. })
  444. })
  445. this.totalShopPeice()
  446. } else {
  447. this.goodsList = []
  448. }
  449. if (data.invalid && data.invalid.length > 0) {
  450. let newFailureList = [],
  451. isFailureLayer
  452. data.invalid.forEach((failure, index) => {
  453. if (failure.status == 1 || failure.status == 2) {
  454. isFailureLayer = true
  455. } else {
  456. isFailureLayer = false
  457. }
  458. newFailureList.push(Object.assign({}, failure, { isFailureLayer: isFailureLayer }))
  459. })
  460. this.failureList = newFailureList
  461. } else {
  462. this.failureList = []
  463. }
  464. })
  465. .catch(error => {
  466. this.$util.msg(error.msg, 2000)
  467. })
  468. },
  469. handleCheckFailure(failure) {
  470. // 选择失效商品
  471. failure.isChecked = !failure.isChecked
  472. this.updateCheckAllBtn()
  473. },
  474. handlsCkecdPros(item, pro) {
  475. //为未选中的时候改变为true,反之为true
  476. if (!this.isshowDelbtn) {
  477. if (pro.isDisable) {
  478. return
  479. }
  480. }
  481. pro.isChecked = !pro.isChecked
  482. if (pro.isChecked) {
  483. if (!this.submitIds.includes(pro.skuId * 1)) {
  484. this.submitIds.push(pro.skuId)
  485. this.checkenProsList.push(pro)
  486. }
  487. } else {
  488. var lent = this.submitIds.indexOf(pro.skuId * 1)
  489. if (lent >= 0) {
  490. this.submitIds.splice(lent, 1)
  491. this.checkenProsList.splice(lent, 1)
  492. }
  493. }
  494. this.updateProductCheckedAllBtn(item)
  495. this.updateCheckAllBtn()
  496. },
  497. updateProductCheckedAllBtn(item) {
  498. // 单独每个供应商的勾选判断
  499. let productsList = item.cartList,
  500. productsCheckedLength = 0,
  501. disabledLength = 0
  502. if (this.isshowDelbtn) {
  503. productsList.forEach(pros => {
  504. if (pros.isChecked) {
  505. productsCheckedLength++
  506. }
  507. })
  508. } else {
  509. productsList.forEach(pros => {
  510. if (pros.isChecked) {
  511. productsCheckedLength++
  512. }
  513. })
  514. }
  515. item.isChecked = productsCheckedLength === productsList.length
  516. },
  517. updateCheckAllBtn() {
  518. // 全选勾选判断
  519. let goodsCheckedLength = 0,
  520. goodsList = this.goodsList,
  521. failureList = this.failureList
  522. goodsList.forEach(item => {
  523. if (item.isChecked) {
  524. goodsCheckedLength++
  525. }
  526. })
  527. failureList.forEach(failureItem => {
  528. if (failureItem.isChecked) {
  529. goodsCheckedLength++
  530. }
  531. })
  532. if (this.isshowDelbtn) {
  533. this.isCheckAll = goodsCheckedLength === goodsList.length + failureList.length
  534. } else {
  535. this.isCheckAll = goodsCheckedLength === goodsList.length
  536. }
  537. },
  538. handleCheckShop(supplier) {
  539. //与单选商品类似
  540. if (!this.isshowDelbtn) {
  541. if (supplier.isDisable) {
  542. return
  543. }
  544. }
  545. supplier.isChecked = !supplier.isChecked
  546. this.setProductChecked(supplier)
  547. this.updateCheckAllBtn()
  548. },
  549. setProductChecked(supplier) {
  550. supplier.cartList.forEach(pros => {
  551. if (this.isshowDelbtn) {
  552. if (supplier.isChecked) {
  553. pros.isChecked = true
  554. if (!this.submitIds.includes(pros.skuId * 1)) {
  555. this.submitIds.push(pros.skuId)
  556. this.checkenProsList.push(pros)
  557. }
  558. } else {
  559. pros.isChecked = false
  560. let lent = this.submitIds.indexOf(pros.skuId * 1)
  561. if (lent >= 0) {
  562. this.submitIds.splice(lent, 1)
  563. this.checkenProsList.splice(lent, 1)
  564. }
  565. }
  566. } else {
  567. if (supplier.isChecked && (pros.stock !== 0 || pros.number < pros.stock)) {
  568. pros.isChecked = true
  569. if (!this.submitIds.includes(pros.skuId * 1)) {
  570. this.submitIds.push(pros.skuId)
  571. this.checkenProsList.push(pros)
  572. }
  573. } else {
  574. pros.isChecked = false
  575. let lent = this.submitIds.indexOf(pros.skuId * 1)
  576. if (lent >= 0) {
  577. this.submitIds.splice(lent, 1)
  578. this.checkenProsList.splice(lent, 1)
  579. }
  580. }
  581. }
  582. })
  583. },
  584. updateBothCheckBtn() {
  585. if (this.isshowDelbtn) {
  586. // 当管理删除按钮出现时,失效的商品可被选择
  587. this.goodsList.forEach(supplier => {
  588. supplier.isChecked = this.isCheckAll
  589. this.setProductChecked(supplier)
  590. })
  591. //删除按钮 全选包括失效商品勾选
  592. this.failureList.forEach(failureItem => {
  593. failureItem.isChecked = this.isCheckAll
  594. })
  595. } else {
  596. this.goodsList.forEach(supplier => {
  597. if (supplier.isDisable) {
  598. supplier.isChecked = false
  599. } else {
  600. supplier.isChecked = this.isCheckAll && !supplier.isDisabled
  601. }
  602. this.setProductChecked(supplier)
  603. })
  604. }
  605. },
  606. handleCheckAll() {
  607. //全选方法内调用方法
  608. this.isCheckAll = !this.isCheckAll
  609. if (!this.isCheckAll) {
  610. this.popupShow1 = false
  611. }
  612. this.updateBothCheckBtn()
  613. },
  614. totalShopPeice() {
  615. //每次所属会所下的商品增减重新计算合计价格&减去含有下架的商品
  616. this.goodsList.map((item, index) => {
  617. let _totalPrice = 0
  618. item.cartList.forEach(pros => {
  619. let _price = pros.price * pros.number
  620. _totalPrice += pros.price * pros.number
  621. })
  622. item.totalPrice = _totalPrice
  623. })
  624. },
  625. totalPeice() {
  626. //计算总价格,每次调用此方法,将初始值为0,遍历价格并累加
  627. let totalPrice = 0
  628. let totalAmount = 0
  629. this.goodsList.forEach((item, index) => {
  630. let supplierPrice = 0
  631. item.totalprice = 0
  632. item.cartList.forEach(pros => {
  633. if (pros.isChecked) {
  634. supplierPrice += pros.price * pros.number
  635. totalAmount += item.totalprice
  636. }
  637. })
  638. item.totalprice = supplierPrice
  639. totalPrice += item.totalprice
  640. this.totalAmount = totalAmount
  641. })
  642. // 最终合计价格 = 店铺满减合计 + 单品满减 + 正常合计 + 凑单满减
  643. this.allPrice = totalPrice
  644. console.log('最终合计价格', `${this.allPrice}元`)
  645. },
  646. totalCount() {
  647. //计算总数量
  648. this.allCount = 0
  649. let prosAllCount = 0
  650. let validCount = 0
  651. let validList = []
  652. let productsList = []
  653. this.goodsList.forEach(item => {
  654. productsList = item.cartList
  655. productsList.forEach(pros => {
  656. if (pros.isChecked) {
  657. prosAllCount += parseInt(pros.number)
  658. this.allCount = prosAllCount
  659. }
  660. })
  661. })
  662. },
  663. changeCountAdd(item, pros) {
  664. //商品数量加加
  665. if (pros.step === 2) {
  666. pros.isStep = false
  667. pros.number += pros.min
  668. this.processActivityPrice(pros)
  669. this.isStock = false
  670. } else {
  671. pros.number++
  672. this.processActivityPrice(pros)
  673. this.isStock = false
  674. }
  675. this.updateShoppogNum(pros)
  676. this.totalShopPeice()
  677. },
  678. changeCountSub(item, pros) {
  679. //商品数量减减
  680. if (pros.number <= pros.min) {
  681. pros.number = pros.min
  682. this.$util.msg(`该商品最小起订量为${pros.min}`, 2000)
  683. return
  684. } else {
  685. if (pros.step === 2) {
  686. pros.isStep = false
  687. pros.number -= pros.min
  688. } else {
  689. pros.number--
  690. }
  691. this.processActivityPrice(pros)
  692. }
  693. this.updateShoppogNum(pros)
  694. this.totalShopPeice()
  695. },
  696. changeInput(pros) {
  697. //输入商品数量更新
  698. pros.isStep = false
  699. },
  700. changeNnmber(e, item, pros) {
  701. //输入商品数量更新
  702. let _value = Number(e.detail.value)
  703. if (!this.$api.isNumber(_value)) {
  704. pros.number = pros.min
  705. } else if (_value < pros.min) {
  706. this.$util.msg(`该商品最小起订量为${pros.min}`, 2000)
  707. pros.number = pros.min
  708. } else if (_value % pros.min != 0) {
  709. pros.isStep = true
  710. pros.number = pros.min
  711. } else {
  712. pros.isStep = false
  713. pros.number = e.detail.value
  714. this.processActivityPrice(pros)
  715. }
  716. this.updateShoppogNum(pros)
  717. this.totalShopPeice()
  718. },
  719. processActivityPrice(pros) {
  720. //单独处理活动价格和阶梯价格
  721. let ladderPriceList = pros.ladderPrices
  722. if (pros.ladderFlag == 0 || pros.actStatus == 1) {
  723. pros.price = pros.price
  724. } else {
  725. ladderPriceList.forEach((item, index) => {
  726. if (pros.number >= item.buyNum) {
  727. pros.price = item.buyPrice
  728. }
  729. })
  730. }
  731. },
  732. setCartisDisable() {
  733. // 删除取消设置不能选的商品
  734. this.goodsList = this.goodsList.map(suppler => {
  735. suppler.isDisable = false
  736. suppler.cartList.forEach(pros => {
  737. pros.isDisable = false
  738. })
  739. return suppler
  740. })
  741. },
  742. clearCartisDisable() {
  743. // 取消删除设置不能选的商品
  744. this.goodsList = this.goodsList.map(supplier => {
  745. supplier.cartList.forEach(pros => {
  746. if (pros.stock === 0 || pros.number > pros.stock) {
  747. supplier.isDisable = true
  748. pros.isDisable = true
  749. } else {
  750. pros.isDisable = false
  751. }
  752. })
  753. return supplier
  754. })
  755. },
  756. showDelManager() {
  757. //显示删除商品管理
  758. this.isshowDelbtn = true
  759. this.setCartisDisable()
  760. if (this.isCheckAll) {
  761. this.updateBothCheckBtn()
  762. } else {
  763. this.goodsList = this.goodsList.map(suppler => {
  764. if (suppler.isChecked) {
  765. suppler.cartList.forEach(pros => {
  766. pros.isChecked = true
  767. })
  768. }
  769. return suppler
  770. })
  771. this.updateCheckAllBtn()
  772. }
  773. // 失效也被勾选
  774. this.failureList = this.failureList.map(el => {
  775. if (el.isFailureLayer) {
  776. el.isFailureLayer = false
  777. }
  778. return el
  779. })
  780. },
  781. hideDelManage() {
  782. //隐藏删除商品管理
  783. this.isshowDelbtn = false
  784. this.isCheckAll = false
  785. this.clearCartisDisable()
  786. this.goodsList = this.goodsList.map(suppler => {
  787. suppler.isChecked = false
  788. suppler.cartList.forEach(pros => {
  789. pros.isChecked = false
  790. })
  791. return suppler
  792. })
  793. this.failureList = this.failureList.map(el => {
  794. if (el.failureState == 1 || el.failureState == 2) {
  795. el.isFailureLayer = true
  796. } else {
  797. el.isFailureLayer = false
  798. }
  799. return el
  800. })
  801. },
  802. goIndex() {
  803. uni.switchTab({
  804. url: '/pages/tabBar/home/index'
  805. })
  806. },
  807. goSuppile(shop) {
  808. //跳转店铺
  809. if (shop.shopType === 2) {
  810. return
  811. }
  812. this.$api.navigateTo(`/pages/supplier/user/my-shop?shopId=${shop.shopId}`)
  813. },
  814. goNavto(url) {
  815. uni.navigateTo({
  816. url
  817. })
  818. },
  819. navToListPage(id) {
  820. this.$api.navigateTo(`/pages/goods/product?id=${id}`)
  821. },
  822. failureToProduct(failure) {
  823. if (failure.status == 1) {
  824. this.$util.msg('商品已丢失,不能查看', 2000)
  825. return
  826. } else if (failure.status == 2) {
  827. this.$util.msg('商品已停售,不能查看', 2000)
  828. return
  829. } else {
  830. this.$api.navigateTo(`/pages/goods/product?id=${failure.productId}`)
  831. }
  832. },
  833. failureStateText(state) {
  834. let stateText = '',
  835. stateTextObject = {
  836. 1: '商品已丢失',
  837. 2: '商品已停售',
  838. 3: '商品已下架',
  839. 4: '商品已售罄',
  840. 5: '价格仅会员可见,您不能购买',
  841. 6: '未公开价格',
  842. 7: '库存不足',
  843. 8: '价格仅医美机构可见'
  844. }
  845. Object.keys(stateTextObject).forEach(key => {
  846. if (key == state) {
  847. stateText = stateTextObject[key]
  848. }
  849. })
  850. return stateText
  851. },
  852. setHeaderBtnPosi() {
  853. // 获得胶囊按钮位置信息
  854. let headerBtnPosi = uni.getMenuButtonBoundingClientRect()
  855. return headerBtnPosi
  856. },
  857. setSysteminfo() {
  858. let systeminfo
  859. uni.getSystemInfo({
  860. // 获取设备信息
  861. success: res => {
  862. systeminfo = res
  863. }
  864. })
  865. return systeminfo
  866. },
  867. PromotionsFormat(promo) {
  868. //促销活动类型数据处理
  869. if (promo != null) {
  870. if (promo.type == 1 && promo.mode == 1) {
  871. return true
  872. } else {
  873. return false
  874. }
  875. }
  876. return false
  877. },
  878. queryPopupCoupons() {
  879. // 获取优惠券列表调用 apisMixins -> apiShoppingCartGetCoupon
  880. this.apiShoppingCartGetCoupon(this.couponParam)
  881. },
  882. receiveCoupon(coupon) {
  883. // 点击优惠券领取按钮,友盟埋点收集领取优惠券
  884. if (process.env.NODE_ENV != 'development') {
  885. this.$uma.trackEvent('Um_Event_cartCouponReceive', {
  886. Um_Key_PageName: '机构购物车',
  887. Um_Key_EvenName: '领取优惠券',
  888. Um_Key_CouponId: `${coupon.couponId}`
  889. })
  890. }
  891. // 领取优惠券调用 apisMixins -> apiReceiveCoupon
  892. this.apiReceiveCoupon({ userId: this.couponParam.userId, couponId: coupon.couponId, source: 1 })
  893. },
  894. handleToDeductCoupon(coupon) {
  895. // 点击采美豆抵扣优惠券
  896. if (process.env.NODE_ENV != 'development') {
  897. this.$uma.trackEvent('Um_Event_userCouponCollectionBuy', {
  898. Um_Key_PageName: '领券中心',
  899. Um_Key_EvenName: '抵扣优惠券',
  900. Um_Key_CouponId: `${coupon.couponId}`
  901. })
  902. }
  903. if (this.hasLogin) {
  904. if (this.userIdentity === 1 || this.userIdentity === 3) {
  905. this.$util.msg('您的身份暂不支持领取优惠券', 2000)
  906. return
  907. }
  908. // 调用 apisMixins -> apiWeChatPayCouponBeans
  909. this.apiWeChatPayCouponBeans({ source: 1, userId: this.couponParam.userId, couponId: coupon.couponId })
  910. } else {
  911. this.$api.navigateTo('/pages/login/login')
  912. }
  913. },
  914. handlePayCoupon(coupon) {
  915. // 点击购买优惠券,友盟埋点收集购买优惠券
  916. if (process.env.NODE_ENV != 'development') {
  917. this.$uma.trackEvent('Um_Event_cartCouponBuy', {
  918. Um_Key_PageName: '机构购物车',
  919. Um_Key_EvenName: '购买优惠券',
  920. Um_Key_CouponId: `${coupon.couponId}`
  921. })
  922. }
  923. // 生成购买优惠券记录Id调用 apisMixins -> apiReceiveCoupon
  924. this.apiWeChatCouponRecord({ userId: this.userId, couponId: coupon.couponId }, coupon)
  925. },
  926. hideMobel() {
  927. this.modal = false
  928. },
  929. handleClick(e) {
  930. //个人机构跳转升级页面
  931. if (e.index == 1) {
  932. this.$api.navigateTo('/pages/login/apply')
  933. }
  934. this.modal = false
  935. },
  936. showPopup(index, shop) {
  937. // 显示popup弹窗
  938. switch (index) {
  939. case 0:
  940. // 友盟埋点收集领券按钮
  941. if (process.env.NODE_ENV != 'development') {
  942. this.$uma.trackEvent('Um_Event_cartCouponButton', {
  943. Um_Key_PageName: '机构购物车',
  944. Um_Key_EvenName: '点击领券按钮',
  945. Um_Key_userId: `${this.userId}`
  946. })
  947. }
  948. this.currentTab = 0
  949. this.couponParam.status = 1
  950. this.couponParam.shopId = shop.shopId
  951. this.queryPopupCoupons()
  952. this.popupShow0 = true
  953. break
  954. case 1:
  955. this.popupShow1 = true
  956. break
  957. }
  958. },
  959. handleShouUnitPopup(pros) {
  960. // 规格弹窗
  961. this.popupShow2 = true
  962. this.handlePros = pros
  963. },
  964. hidePopup(index) {
  965. // 隐藏popup弹窗
  966. switch (index) {
  967. case 0:
  968. this.popupShow0 = false
  969. break
  970. case 1:
  971. this.popupShow1 = false
  972. break
  973. }
  974. },
  975. couponChange(e) {
  976. this.currentTab = e.index
  977. switch (this.currentTab) {
  978. case 0:
  979. this.couponParam.status = 1
  980. this.queryPopupCoupons()
  981. break
  982. case 1:
  983. this.couponParam.status = 2
  984. this.queryPopupCoupons()
  985. break
  986. }
  987. }
  988. }
  989. }
  990. </script>
  991. <style lang="scss">
  992. page {
  993. background: #f7f7f7;
  994. height: auto;
  995. }
  996. .cart-content {
  997. position: relative;
  998. }
  999. .container-cart-main.none {
  1000. display: none;
  1001. }
  1002. .container-cart-main.show {
  1003. display: block;
  1004. }
  1005. .cart-content.empty.none {
  1006. display: none;
  1007. }
  1008. .cart-content.empty.show {
  1009. display: block;
  1010. }
  1011. .container-cart.show {
  1012. display: block;
  1013. }
  1014. .container-cart.none {
  1015. display: none;
  1016. }
  1017. .empty-container.none {
  1018. display: none;
  1019. }
  1020. .empty-container.show {
  1021. display: flex;
  1022. }
  1023. .foot-check-delbtn {
  1024. width: 100%;
  1025. height: 80rpx;
  1026. position: fixed;
  1027. top: 0;
  1028. left: 0;
  1029. box-sizing: border-box;
  1030. padding: 15rpx 24rpx;
  1031. background-color: #f7f7f7;
  1032. z-index: 990;
  1033. .foot-text {
  1034. font-size: $font-size-26;
  1035. height: 50rpx;
  1036. line-height: 50rpx;
  1037. color: #666666;
  1038. float: left;
  1039. padding-left: 10rpx;
  1040. text {
  1041. margin: 0 6rpx;
  1042. }
  1043. }
  1044. .delBtn {
  1045. width: 100rpx;
  1046. display: inline-block;
  1047. padding: 0 15rpx;
  1048. font-size: $font-size-26;
  1049. height: 50rpx;
  1050. line-height: 50rpx;
  1051. border-radius: 30rpx;
  1052. background: #ffffff;
  1053. border: 1px solid #999999;
  1054. color: #999999;
  1055. float: right;
  1056. text-align: center;
  1057. &.none {
  1058. display: none;
  1059. }
  1060. }
  1061. }
  1062. .checkbox-box {
  1063. display: flex;
  1064. align-items: center;
  1065. .checkbox {
  1066. display: flex;
  1067. margin: 0;
  1068. padding: 5rpx;
  1069. display: flex;
  1070. flex-direction: column;
  1071. align-items: center;
  1072. box-sizing: border-box;
  1073. text-align: center;
  1074. text-decoration: none;
  1075. border-radius: 0;
  1076. -webkit-tap-highlight-color: transparent;
  1077. overflow: hidden;
  1078. background-color: #ffffff;
  1079. font-size: 36rpx;
  1080. color: #999999;
  1081. &.icon-yixuanze {
  1082. color: $color-system;
  1083. }
  1084. }
  1085. &.disabled {
  1086. .checkbox {
  1087. color: #999999;
  1088. }
  1089. }
  1090. .text {
  1091. font-size: $font-size-24;
  1092. margin-left: 10rpx;
  1093. }
  1094. }
  1095. .goods-list {
  1096. width: 100%;
  1097. height: auto;
  1098. background-color: #f7f7f7;
  1099. .goods-item {
  1100. width: 702rpx;
  1101. padding: 0 24rpx;
  1102. background: #ffffff;
  1103. margin-bottom: 24rpx;
  1104. }
  1105. .shoptitle {
  1106. height: 80rpx;
  1107. line-height: 80rpx;
  1108. .checkbox-box {
  1109. float: left;
  1110. line-height: 80rpx;
  1111. display: inline-block;
  1112. box-sizing: border-box;
  1113. }
  1114. .text {
  1115. width: 400rpx;
  1116. float: left;
  1117. display: block;
  1118. overflow: hidden;
  1119. text-overflow: ellipsis;
  1120. white-space: nowrap;
  1121. line-height: 80rpx;
  1122. margin-left: 20rpx;
  1123. font-size: $font-size-28;
  1124. color: $text-color;
  1125. text-align: left;
  1126. font-weight: bold;
  1127. }
  1128. }
  1129. .goods-pros {
  1130. width: 100%;
  1131. height: auto;
  1132. margin-bottom: 20rpx;
  1133. }
  1134. .goods-pros-t {
  1135. display: flex;
  1136. align-items: center;
  1137. width: 100%;
  1138. height: 210rpx;
  1139. padding: 0 0 26rpx 0;
  1140. .checkbox-box {
  1141. // padding: 10rpx;
  1142. }
  1143. .pros-img {
  1144. width: 210rpx;
  1145. height: 100%;
  1146. border-radius: 10rpx;
  1147. margin: 0 20rpx;
  1148. border: 1px solid #f3f3f3;
  1149. position: relative;
  1150. image {
  1151. width: 100%;
  1152. height: 100%;
  1153. border-radius: 10rpx;
  1154. }
  1155. }
  1156. }
  1157. .goods-pros-b {
  1158. width: 100%;
  1159. height: auto;
  1160. padding: 0 0 24rpx 0;
  1161. box-sizing: border-box;
  1162. &.show {
  1163. display: block;
  1164. }
  1165. &.none {
  1166. display: none;
  1167. }
  1168. .sum-none {
  1169. width: 100%;
  1170. height: 48rpx;
  1171. line-height: 48rpx;
  1172. color: $text-color;
  1173. float: left;
  1174. text-align: right;
  1175. .money {
  1176. font-size: $font-size-26;
  1177. color: #999999;
  1178. text-decoration: line-through;
  1179. }
  1180. .money-sign {
  1181. font-size: $font-size-26;
  1182. color: #999999;
  1183. text-decoration: line-through;
  1184. }
  1185. .money-reduced {
  1186. margin-left: 10rpx;
  1187. font-size: $font-size-26;
  1188. color: $color-system;
  1189. .iconfont {
  1190. font-size: $font-size-34;
  1191. }
  1192. }
  1193. }
  1194. .sum {
  1195. width: 100%;
  1196. height: 40rpx;
  1197. font-size: $font-size-26;
  1198. line-height: 40rpx;
  1199. color: $text-color;
  1200. float: left;
  1201. display: flex;
  1202. justify-content: flex-end;
  1203. font-weight: bold;
  1204. .money {
  1205. color: #ff2a2a;
  1206. font-size: $font-size-26;
  1207. }
  1208. .money-sign {
  1209. font-size: $font-size-24;
  1210. color: #ff2a2a;
  1211. }
  1212. }
  1213. }
  1214. .pros-product {
  1215. width: 416rpx;
  1216. height: 100%;
  1217. line-height: 36rpx;
  1218. font-size: $font-size-28;
  1219. position: relative;
  1220. .producttitle {
  1221. width: 100%;
  1222. display: inline-block;
  1223. height: auto;
  1224. text-overflow: ellipsis;
  1225. display: -webkit-box;
  1226. word-break: break-all;
  1227. -webkit-box-orient: vertical;
  1228. -webkit-line-clamp: 2;
  1229. overflow: hidden;
  1230. margin-bottom: 15rpx;
  1231. .no-text {
  1232. display: inline-block;
  1233. height: 36rpx;
  1234. padding: 0 12rpx;
  1235. line-height: 36rpx;
  1236. background: linear-gradient(315deg, rgba(231, 0, 0, 1) 0%, rgba(255, 104, 1, 1) 100%);
  1237. border-radius: 18rpx;
  1238. text-align: center;
  1239. color: #ffffff;
  1240. font-size: $font-size-28;
  1241. margin-right: 24rpx;
  1242. }
  1243. }
  1244. .productspec {
  1245. height: 36rpx;
  1246. color: #999999;
  1247. font-size: $font-size-26;
  1248. }
  1249. .cart-sku-temp {
  1250. width: 100%;
  1251. height: 48rpx;
  1252. margin: 30rpx 0 0 0;
  1253. .cart-sku-text {
  1254. font-size: 28rpx;
  1255. line-height: 48rpx;
  1256. color: #666666;
  1257. float: left;
  1258. }
  1259. .cart-sku-btn {
  1260. padding: 0 16rpx;
  1261. text-align: center;
  1262. line-height: 40rpx;
  1263. font-size: 24rpx;
  1264. box-sizing: border-box;
  1265. border: 1px solid #ff5b00;
  1266. color: #ff5b00;
  1267. float: left;
  1268. border-radius: 20rpx;
  1269. margin-left: 16rpx;
  1270. }
  1271. }
  1272. .productprice {
  1273. width: 100%;
  1274. height: 48rpx;
  1275. margin: 30rpx 0 0 0;
  1276. .price {
  1277. line-height: 48rpx;
  1278. font-size: $font-size-26;
  1279. width: 48%;
  1280. color: #ff2a2a;
  1281. float: left;
  1282. font-weight: bold;
  1283. &.disabled {
  1284. color: #999999;
  1285. text-decoration: line-through;
  1286. }
  1287. .money-sign {
  1288. font-size: $font-size-24;
  1289. color: #ff2a2a;
  1290. }
  1291. }
  1292. .count {
  1293. height: 100%;
  1294. float: right;
  1295. position: relative;
  1296. &.show {
  1297. display: block;
  1298. }
  1299. &.none {
  1300. display: none;
  1301. }
  1302. .count-tips {
  1303. width: auto;
  1304. display: inline-block;
  1305. padding: 0 15rpx;
  1306. line-height: 44rpx;
  1307. height: 44rpx;
  1308. border-radius: 22rpx;
  1309. background: $btn-confirm;
  1310. font-size: $font-size-24;
  1311. text-align: center;
  1312. color: #ffffff;
  1313. position: absolute;
  1314. top: -60rpx;
  1315. left: -5rpx;
  1316. z-index: 5;
  1317. &.step {
  1318. left: -217rpx;
  1319. }
  1320. &::before {
  1321. content: '';
  1322. position: absolute;
  1323. bottom: -30rpx;
  1324. right: 15rpx;
  1325. z-index: 1;
  1326. width: 0;
  1327. height: 0;
  1328. border-width: 18rpx;
  1329. border-style: solid;
  1330. border-color: $color-system transparent transparent transparent;
  1331. }
  1332. }
  1333. .number-box {
  1334. display: flex;
  1335. justify-content: center;
  1336. align-items: center;
  1337. border: 2rpx solid #d5d5d5;
  1338. border-radius: 30rpx;
  1339. .iconfont {
  1340. font-size: $font-size-24;
  1341. padding: 0 18rpx;
  1342. color: #999999;
  1343. text-align: center;
  1344. line-height: 48rpx;
  1345. font-weight: bold;
  1346. background: #f7f7f7;
  1347. &.icon-jianhao {
  1348. border-radius: 30rpx 0 0 30rpx;
  1349. }
  1350. &.icon-jiahao {
  1351. border-radius: 0 30rpx 30rpx 0;
  1352. }
  1353. }
  1354. .btn-input {
  1355. width: 62rpx;
  1356. height: 48rpx;
  1357. line-height: 48rpx;
  1358. background: #fff;
  1359. border-radius: 4rpx;
  1360. text-align: center;
  1361. font-size: $font-size-24;
  1362. }
  1363. }
  1364. .uni-numbox {
  1365. position: absolute;
  1366. left: 45rpx;
  1367. bottom: 0;
  1368. .uni-numbox-minus,
  1369. .uni-numbox-plus {
  1370. width: 50rpx;
  1371. line-height: 40rpx;
  1372. }
  1373. .uni-numbox-value {
  1374. font-size: $font-size-28;
  1375. width: 60rpx;
  1376. }
  1377. }
  1378. }
  1379. }
  1380. }
  1381. }
  1382. .failure-list {
  1383. width: 702rpx;
  1384. height: auto;
  1385. padding: 0 24rpx;
  1386. margin-top: 20rpx;
  1387. background: #ffffff;
  1388. .failure-title {
  1389. width: 100%;
  1390. height: 82rpx;
  1391. line-height: 82rpx;
  1392. font-size: $font-size-28;
  1393. border-bottom: 1px solid #ebebeb;
  1394. .title-txt {
  1395. float: left;
  1396. color: #666666;
  1397. text-align: left;
  1398. }
  1399. .title-btn {
  1400. float: right;
  1401. color: $color-system;
  1402. text-align: right;
  1403. line-height: 80rpx;
  1404. .butto {
  1405. display: inline-block;
  1406. padding: 0 15rpx;
  1407. font-size: $font-size-26;
  1408. height: 50rpx;
  1409. line-height: 50rpx;
  1410. border-radius: 30rpx;
  1411. background: #ffffff;
  1412. // border: 1px solid #C9C9C9;
  1413. // color: #999999;
  1414. margin-top: 15rpx;
  1415. }
  1416. }
  1417. }
  1418. .productlist {
  1419. padding-top: 10rpx;
  1420. .goods-pros {
  1421. width: 100%;
  1422. height: auto;
  1423. padding: 20rpx 0;
  1424. }
  1425. .goods-pros-t {
  1426. display: flex;
  1427. align-items: center;
  1428. width: 100%;
  1429. height: 210rpx;
  1430. position: relative;
  1431. .img-tip {
  1432. display: block;
  1433. width: 72rpx;
  1434. height: 36rpx;
  1435. line-height: 36rpx;
  1436. font-size: $font-size-24;
  1437. text-align: center;
  1438. color: #ffffff;
  1439. border-radius: 24rpx;
  1440. background: rgba(51, 51, 51, 0.3);
  1441. // position: absolute;
  1442. // left: 0;
  1443. // top: 0;
  1444. }
  1445. .checkbox-box {
  1446. padding: 10rpx;
  1447. }
  1448. .pros-img {
  1449. width: 180rpx;
  1450. height: 100%;
  1451. border-radius: 10rpx;
  1452. margin: 0 20rpx;
  1453. border: 1px solid #f3f3f3;
  1454. position: relative;
  1455. image {
  1456. width: 100%;
  1457. height: 100%;
  1458. border-radius: 10rpx;
  1459. }
  1460. .pros-type {
  1461. width: 64rpx;
  1462. height: 64rpx;
  1463. text-align: justify;
  1464. box-sizing: border-box;
  1465. padding: 10rpx;
  1466. border-radius: 0 0 8rpx 8rpx;
  1467. background-color: #33ccbf;
  1468. font-size: $font-size-22;
  1469. color: #ffffff;
  1470. line-height: 25rpx;
  1471. position: absolute;
  1472. top: 0;
  1473. right: 10rpx;
  1474. }
  1475. }
  1476. .pros-marks {
  1477. width: 730rpx;
  1478. height: 250rpx;
  1479. z-index: 90;
  1480. background: rgba(0, 0, 0, 0.05);
  1481. position: absolute;
  1482. left: -20rpx;
  1483. top: -20rpx;
  1484. }
  1485. }
  1486. .goods-pros-b {
  1487. width: 622rpx;
  1488. margin-left: 84rpx;
  1489. height: 40rpx;
  1490. padding: 0 0 26rpx 0;
  1491. // border-top: 1px solid #EBEBEB;
  1492. &.show {
  1493. display: block;
  1494. }
  1495. &.none {
  1496. display: none;
  1497. }
  1498. .sum {
  1499. font-size: $font-size-28;
  1500. line-height: 40rpx;
  1501. color: $text-color;
  1502. display: flex;
  1503. justify-content: flex-end;
  1504. .money {
  1505. color: #ff2a2a;
  1506. font-size: $font-size-28;
  1507. }
  1508. .money-sign {
  1509. font-size: $font-size-24;
  1510. color: #ff2a2a;
  1511. }
  1512. }
  1513. }
  1514. .pros-product {
  1515. width: 402rpx;
  1516. height: 100%;
  1517. line-height: 36rpx;
  1518. font-size: $font-size-28;
  1519. position: relative;
  1520. .producttitle {
  1521. width: 100%;
  1522. display: inline-block;
  1523. height: auto;
  1524. text-overflow: ellipsis;
  1525. display: -webkit-box;
  1526. word-break: break-all;
  1527. -webkit-box-orient: vertical;
  1528. -webkit-line-clamp: 2;
  1529. overflow: hidden;
  1530. margin-bottom: 8rpx;
  1531. .no-text {
  1532. display: inline-block;
  1533. height: 36rpx;
  1534. padding: 0 12rpx;
  1535. line-height: 36rpx;
  1536. background: linear-gradient(315deg, rgba(231, 0, 0, 1) 0%, rgba(255, 104, 1, 1) 100%);
  1537. border-radius: 18rpx;
  1538. text-align: center;
  1539. color: #ffffff;
  1540. font-size: $font-size-28;
  1541. margin-right: 24rpx;
  1542. }
  1543. }
  1544. .productspec {
  1545. height: 36rpx;
  1546. color: #999999;
  1547. font-size: $font-size-26;
  1548. margin-top: 20rpx;
  1549. }
  1550. .productstate {
  1551. font-size: $font-size-28;
  1552. height: 44rpx;
  1553. color: #ff2a2a;
  1554. position: absolute;
  1555. bottom: 0;
  1556. left: 0;
  1557. }
  1558. }
  1559. }
  1560. }
  1561. .tui-popup-box {
  1562. position: relative;
  1563. box-sizing: border-box;
  1564. min-height: 220rpx;
  1565. padding: 24rpx 24rpx 0 24rpx;
  1566. .tui-popup-close {
  1567. width: 90rpx;
  1568. height: 90rpx;
  1569. position: absolute;
  1570. right: 0;
  1571. top: 24rpx;
  1572. line-height: 90rpx;
  1573. text-align: center;
  1574. color: #b2b2b2;
  1575. .icon-iconfontguanbi {
  1576. font-size: $font-size-40;
  1577. }
  1578. }
  1579. .title {
  1580. font-size: $font-size-34;
  1581. color: $text-color;
  1582. line-height: 88rpx;
  1583. text-align: center;
  1584. float: left;
  1585. width: 100%;
  1586. height: 88rpx;
  1587. font-weight: bold;
  1588. }
  1589. .tui-popup-main {
  1590. width: 100%;
  1591. float: left;
  1592. &.coupon {
  1593. padding-bottom: 40rpx;
  1594. .coupon-empty {
  1595. width: 100%;
  1596. height: 600rpx;
  1597. display: flex;
  1598. align-items: center;
  1599. justify-content: center;
  1600. flex-direction: column;
  1601. position: fixed;
  1602. background: $bg-color;
  1603. .empty-container-image {
  1604. width: 150rpx;
  1605. height: 150rpx;
  1606. margin-bottom: 0;
  1607. margin-top: 0;
  1608. }
  1609. .error-text {
  1610. font-size: $font-size-28;
  1611. color: #999999;
  1612. line-height: 88rpx;
  1613. }
  1614. }
  1615. }
  1616. .tui-popup-scroll {
  1617. width: 100%;
  1618. height: 600rpx;
  1619. .coupon-list {
  1620. width: 100%;
  1621. height: 200rpx;
  1622. margin-top: 24rpx;
  1623. box-sizing: border-box;
  1624. background: url(https://static.caimei365.com/app/img/icon/icon-coupon-uesb@2x.png);
  1625. background-size: cover;
  1626. &:last-child {
  1627. margin-bottom: 24rpx;
  1628. }
  1629. .list-cell-le {
  1630. width: 224rpx;
  1631. height: 100%;
  1632. box-sizing: border-box;
  1633. padding: 37rpx 0;
  1634. float: left;
  1635. .coupon-maxMoney {
  1636. width: 100%;
  1637. height: 78rpx;
  1638. line-height: 78rpx;
  1639. font-size: 56rpx;
  1640. color: #ffffff;
  1641. text-align: center;
  1642. .small {
  1643. font-size: $font-size-24;
  1644. }
  1645. }
  1646. .coupon-minMoney {
  1647. width: 100%;
  1648. height: 33rpx;
  1649. line-height: 33rpx;
  1650. font-size: $font-size-24;
  1651. color: #ffffff;
  1652. text-align: center;
  1653. }
  1654. }
  1655. .list-cell-ri {
  1656. width: 478rpx;
  1657. height: 100%;
  1658. box-sizing: border-box;
  1659. padding: 20rpx 24rpx 0 24rpx;
  1660. float: right;
  1661. .list-cell-top {
  1662. width: 100%;
  1663. height: 121rpx;
  1664. float: left;
  1665. border-bottom: 1px solid #e1e1e1;
  1666. .list-cell-type {
  1667. width: 286rpx;
  1668. height: 100%;
  1669. float: left;
  1670. .list-cell-tags {
  1671. width: 100%;
  1672. height: 32rpx;
  1673. margin-bottom: 7rpx;
  1674. .tags {
  1675. display: inline-block;
  1676. padding: 0 10rpx;
  1677. height: 32rpx;
  1678. line-height: 32rpx;
  1679. background-color: #ffdcce;
  1680. color: #f94b4b;
  1681. font-size: $font-size-20;
  1682. border-radius: 8rpx;
  1683. text-align: center;
  1684. float: left;
  1685. }
  1686. }
  1687. .list-cell-texts {
  1688. width: 100%;
  1689. height: auto;
  1690. line-height: 35rpx;
  1691. text-overflow: ellipsis;
  1692. display: -webkit-box;
  1693. word-break: break-all;
  1694. -webkit-box-orient: vertical;
  1695. -webkit-line-clamp: 2;
  1696. overflow: hidden;
  1697. font-size: 26rpx;
  1698. color: #333333;
  1699. }
  1700. }
  1701. .list-cell-btn {
  1702. width: 128rpx;
  1703. height: 100%;
  1704. float: right;
  1705. .icon-used {
  1706. width: 100%;
  1707. height: 100%;
  1708. box-sizing: border-box;
  1709. padding-top: 28rpx;
  1710. .icon-used-text {
  1711. width: 100%;
  1712. text-align: center;
  1713. line-height: 26rpx;
  1714. font-size: $font-size-20;
  1715. color: #f94b4b;
  1716. }
  1717. .icon-used-btn {
  1718. width: 128rpx;
  1719. height: 48rpx;
  1720. border-radius: 28rpx;
  1721. line-height: 48rpx;
  1722. font-size: $font-size-26;
  1723. text-align: center;
  1724. &.receive {
  1725. background-image: linear-gradient(270deg, #f94b4b 0%, #feb673 100%);
  1726. color: #ffffff;
  1727. }
  1728. &.make {
  1729. border: solid 1px #f94b4b;
  1730. color: #f94b4b;
  1731. }
  1732. }
  1733. }
  1734. }
  1735. }
  1736. .list-cell-time {
  1737. width: 100%;
  1738. height: 58rpx;
  1739. line-height: 58rpx;
  1740. text-align: left;
  1741. font-size: $font-size-20;
  1742. color: #999999;
  1743. }
  1744. }
  1745. }
  1746. }
  1747. .tui-popup-coupon {
  1748. width: 100%;
  1749. height: 500rpx;
  1750. box-sizing: border-box;
  1751. padding: 30rpx 20rpx;
  1752. .tui-popup-h1 {
  1753. width: 100%;
  1754. height: 66rpx;
  1755. display: flex;
  1756. align-items: center;
  1757. .tui-popup-text {
  1758. flex: 1;
  1759. height: 66rpx;
  1760. line-height: 66rpx;
  1761. font-size: $font-size-30;
  1762. color: #333333;
  1763. &.red {
  1764. color: #f94b4b;
  1765. }
  1766. &.bold {
  1767. font-weight: bold;
  1768. }
  1769. &.left {
  1770. text-align: left;
  1771. }
  1772. &.right {
  1773. text-align: right;
  1774. }
  1775. }
  1776. }
  1777. }
  1778. }
  1779. }
  1780. .footer {
  1781. width: 100%;
  1782. background-color: #ffffff;
  1783. height: 110rpx;
  1784. position: fixed;
  1785. bottom: 0rpx;
  1786. z-index: 990;
  1787. .footer-le {
  1788. width: 520rpx;
  1789. height: 100%;
  1790. padding-left: 24rpx;
  1791. float: left;
  1792. box-sizing: border-box;
  1793. .foot-check {
  1794. width: 100rpx;
  1795. float: left;
  1796. line-height: 110rpx;
  1797. font-size: $font-size-24;
  1798. .checkbox {
  1799. width: 40rpx;
  1800. text-align: center;
  1801. }
  1802. .text {
  1803. width: 60rpx;
  1804. float: right;
  1805. }
  1806. }
  1807. .sum {
  1808. width: 360rpx;
  1809. height: 110rpx;
  1810. float: right;
  1811. box-sizing: border-box;
  1812. padding: 10rpx;
  1813. .sum-none {
  1814. width: 100%;
  1815. height: 45rpx;
  1816. line-height: 45rpx;
  1817. color: $text-color;
  1818. float: left;
  1819. text-align: left;
  1820. .money {
  1821. font-size: $font-size-24;
  1822. color: #999999;
  1823. text-decoration: line-through;
  1824. }
  1825. .money-sign {
  1826. font-size: $font-size-24;
  1827. color: #999999;
  1828. text-decoration: line-through;
  1829. }
  1830. .money-reduced {
  1831. margin-left: 10rpx;
  1832. font-size: $font-size-24;
  1833. color: #ff2a2a;
  1834. }
  1835. .money-popup {
  1836. height: 45rpx;
  1837. line-height: 45rpx;
  1838. display: inline-block;
  1839. float: right;
  1840. font-size: $font-size-24;
  1841. color: #ff2a2a;
  1842. .icon-xiangshangjiantou {
  1843. font-size: $font-size-30;
  1844. margin-left: 5rpx;
  1845. }
  1846. }
  1847. }
  1848. .sum-price {
  1849. width: 100%;
  1850. height: 45rpx;
  1851. line-height: 45rpx;
  1852. font-size: $font-size-30;
  1853. color: $text-color;
  1854. float: left;
  1855. font-weight: normal;
  1856. text-align: left;
  1857. &.none {
  1858. height: 90rpx;
  1859. line-height: 90rpx;
  1860. }
  1861. .money {
  1862. color: #ff2a2a;
  1863. }
  1864. .money-sign {
  1865. font-size: $font-size-24;
  1866. color: #ff2a2a;
  1867. }
  1868. }
  1869. }
  1870. }
  1871. .footer-ri {
  1872. width: 230rpx;
  1873. height: 100%;
  1874. float: right;
  1875. display: flex;
  1876. justify-content: space-between;
  1877. align-items: center;
  1878. z-index: 999;
  1879. box-sizing: border-box;
  1880. padding: 13rpx 15rpx 13rpx 5rpx;
  1881. &.none {
  1882. display: none;
  1883. }
  1884. .btn {
  1885. width: 200rpx;
  1886. height: 100%;
  1887. background: $btn-confirm;
  1888. font-size: $font-size-28;
  1889. line-height: 84rpx;
  1890. color: #ffffff;
  1891. display: flex;
  1892. border-radius: 42rpx;
  1893. justify-content: center;
  1894. align-items: center;
  1895. }
  1896. }
  1897. .footer-del {
  1898. width: 460rpx;
  1899. height: 110rpx;
  1900. position: absolute;
  1901. padding-left: 140rpx;
  1902. background: #ffffff;
  1903. right: 0;
  1904. top: 0;
  1905. z-index: 1000;
  1906. &.show {
  1907. animation: showDelbtn 0s linear both;
  1908. }
  1909. &.none {
  1910. animation: hideDelbtn 0s linear both;
  1911. }
  1912. .btn {
  1913. width: 200rpx;
  1914. height: 80rpx;
  1915. line-height: 80rpx;
  1916. font-size: $font-size-28;
  1917. color: #ffffff;
  1918. text-align: center;
  1919. float: left;
  1920. margin: 10rpx;
  1921. border-radius: 40rpx;
  1922. }
  1923. .btn.btn-cancel {
  1924. background: #F7F7F7;
  1925. color: #B2B2B2;
  1926. }
  1927. .btn.btn-confirm {
  1928. background: #ff2a2a;
  1929. }
  1930. @keyframes showDelbtn {
  1931. 0% {
  1932. transform: translateX(0);
  1933. }
  1934. 100% {
  1935. transform: translateX(-100%);
  1936. }
  1937. }
  1938. @keyframes hideDelbtn {
  1939. 0% {
  1940. transform: translateX(-100%);
  1941. }
  1942. 100% {
  1943. transform: translateX(0);
  1944. }
  1945. }
  1946. }
  1947. }
  1948. </style>