index.vue 41 KB

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