index.vue 41 KB

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