index.vue 42 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796
  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. if (failure.status == 1) {
  780. this.$util.msg('商品已丢失,不能查看', 2000)
  781. return
  782. } else if (failure.status == 2) {
  783. this.$util.msg('商品已停售,不能查看', 2000)
  784. return
  785. } else {
  786. this.$api.navigateTo(`/pages/goods/product?id=${failure.productId}`)
  787. }
  788. },
  789. handleShouUnitPopup(pros) {
  790. // 规格弹窗
  791. this.popupShow2 = true
  792. this.handlePros = pros
  793. },
  794. hideMobel() {
  795. this.modal = false
  796. },
  797. handleClick(e) {
  798. //个人机构跳转升级页面
  799. if (e.index == 1) {
  800. this.shoppingCartDelete({ userId: this.userId, skuIds: this.delSkuIds })
  801. }
  802. this.modal = false
  803. },
  804. setHeaderBtnPosi() {
  805. // 获得胶囊按钮位置信息
  806. let headerBtnPosi = uni.getMenuButtonBoundingClientRect()
  807. return headerBtnPosi
  808. },
  809. setSysteminfo() {
  810. let systeminfo
  811. uni.getSystemInfo({
  812. // 获取设备信息
  813. success: res => {
  814. systeminfo = res
  815. }
  816. })
  817. return systeminfo
  818. },
  819. setScrollHeight() {
  820. // 窗口高度-footer高度
  821. const { windowHeight, pixelRatio } = uni.getSystemInfoSync()
  822. setTimeout(() => {
  823. const query = uni.createSelectorQuery().in(this)
  824. query.selectAll('.footer').boundingClientRect()
  825. query.exec(res => {
  826. this.windowHeight = windowHeight
  827. if (res[0][0]) {
  828. this.scrollHeight = windowHeight - res[0][0].height
  829. }
  830. })
  831. }, 500)
  832. }
  833. }
  834. }
  835. </script>
  836. <style lang="scss">
  837. page {
  838. background: #f7f7f7;
  839. height: auto;
  840. }
  841. .cart-content {
  842. position: relative;
  843. }
  844. .container-cart-main.none {
  845. display: none;
  846. }
  847. .container-cart-main.show {
  848. display: block;
  849. }
  850. .cart-content.empty.none {
  851. display: none;
  852. }
  853. .cart-content.empty.show {
  854. display: block;
  855. }
  856. .container-cart.show {
  857. display: block;
  858. }
  859. .container-cart.none {
  860. display: none;
  861. }
  862. .empty-container.none {
  863. display: none;
  864. }
  865. .empty-container.show {
  866. display: flex;
  867. }
  868. .foot-check-delbtn {
  869. width: 100%;
  870. height: 80rpx;
  871. position: fixed;
  872. top: 0;
  873. left: 0;
  874. box-sizing: border-box;
  875. padding: 15rpx 24rpx;
  876. background-color: #f7f7f7;
  877. z-index: 990;
  878. .foot-text {
  879. font-size: $font-size-26;
  880. height: 50rpx;
  881. line-height: 50rpx;
  882. color: #666666;
  883. float: left;
  884. padding-left: 10rpx;
  885. text {
  886. margin: 0 6rpx;
  887. }
  888. }
  889. .delBtn {
  890. width: 100rpx;
  891. display: inline-block;
  892. padding: 0 15rpx;
  893. font-size: $font-size-26;
  894. height: 50rpx;
  895. line-height: 50rpx;
  896. border-radius: 30rpx;
  897. background: #ffffff;
  898. border: 1px solid #999999;
  899. color: #999999;
  900. float: right;
  901. text-align: center;
  902. &.none {
  903. display: none;
  904. }
  905. }
  906. }
  907. .checkbox-box {
  908. display: flex;
  909. align-items: center;
  910. .checkbox {
  911. display: flex;
  912. margin: 0;
  913. padding: 5rpx;
  914. display: flex;
  915. flex-direction: column;
  916. align-items: center;
  917. box-sizing: border-box;
  918. text-align: center;
  919. text-decoration: none;
  920. border-radius: 0;
  921. -webkit-tap-highlight-color: transparent;
  922. overflow: hidden;
  923. background-color: #ffffff;
  924. font-size: 36rpx;
  925. color: #999999;
  926. &.icon-yixuanze {
  927. color: $color-system;
  928. }
  929. }
  930. &.disabled {
  931. .checkbox {
  932. color: #999999;
  933. }
  934. }
  935. .text {
  936. font-size: $font-size-24;
  937. margin-left: 10rpx;
  938. }
  939. }
  940. .goods-list {
  941. width: 100%;
  942. height: auto;
  943. background-color: #f7f7f7;
  944. .goods-item {
  945. width: 702rpx;
  946. padding: 0 24rpx;
  947. background: #ffffff;
  948. margin-bottom: 24rpx;
  949. }
  950. .shoptitle {
  951. height: 80rpx;
  952. line-height: 80rpx;
  953. .checkbox-box {
  954. float: left;
  955. line-height: 80rpx;
  956. display: inline-block;
  957. box-sizing: border-box;
  958. }
  959. .text {
  960. width: 400rpx;
  961. float: left;
  962. display: block;
  963. overflow: hidden;
  964. text-overflow: ellipsis;
  965. white-space: nowrap;
  966. line-height: 80rpx;
  967. margin-left: 20rpx;
  968. font-size: $font-size-28;
  969. color: $text-color;
  970. text-align: left;
  971. font-weight: bold;
  972. }
  973. }
  974. .goods-pros {
  975. width: 100%;
  976. height: auto;
  977. margin-bottom: 20rpx;
  978. }
  979. .goods-pros-t {
  980. display: flex;
  981. align-items: center;
  982. width: 100%;
  983. height: 210rpx;
  984. padding: 0 0 26rpx 0;
  985. .checkbox-box {
  986. // padding: 10rpx;
  987. }
  988. .pros-img {
  989. width: 210rpx;
  990. height: 100%;
  991. border-radius: 10rpx;
  992. margin: 0 20rpx;
  993. border: 1px solid #f3f3f3;
  994. position: relative;
  995. image {
  996. width: 100%;
  997. height: 100%;
  998. border-radius: 10rpx;
  999. }
  1000. }
  1001. }
  1002. .goods-pros-b {
  1003. width: 100%;
  1004. height: auto;
  1005. padding: 0 0 24rpx 0;
  1006. box-sizing: border-box;
  1007. &.show {
  1008. display: block;
  1009. }
  1010. &.none {
  1011. display: none;
  1012. }
  1013. .sum-none {
  1014. width: 100%;
  1015. height: 48rpx;
  1016. line-height: 48rpx;
  1017. color: $text-color;
  1018. float: left;
  1019. text-align: right;
  1020. .money {
  1021. font-size: $font-size-26;
  1022. color: #999999;
  1023. text-decoration: line-through;
  1024. }
  1025. .money-sign {
  1026. font-size: $font-size-26;
  1027. color: #999999;
  1028. text-decoration: line-through;
  1029. }
  1030. .money-reduced {
  1031. margin-left: 10rpx;
  1032. font-size: $font-size-26;
  1033. color: $color-system;
  1034. .iconfont {
  1035. font-size: $font-size-34;
  1036. }
  1037. }
  1038. }
  1039. .sum {
  1040. width: 100%;
  1041. height: 40rpx;
  1042. font-size: $font-size-26;
  1043. line-height: 40rpx;
  1044. color: $text-color;
  1045. float: left;
  1046. display: flex;
  1047. justify-content: flex-end;
  1048. font-weight: bold;
  1049. .money {
  1050. color: #ff2a2a;
  1051. font-size: $font-size-26;
  1052. }
  1053. .money-sign {
  1054. font-size: $font-size-24;
  1055. color: #ff2a2a;
  1056. }
  1057. }
  1058. }
  1059. .pros-product {
  1060. width: 416rpx;
  1061. height: 100%;
  1062. line-height: 36rpx;
  1063. font-size: $font-size-28;
  1064. position: relative;
  1065. .producttitle {
  1066. width: 100%;
  1067. display: inline-block;
  1068. height: auto;
  1069. text-overflow: ellipsis;
  1070. display: -webkit-box;
  1071. word-break: break-all;
  1072. -webkit-box-orient: vertical;
  1073. -webkit-line-clamp: 2;
  1074. overflow: hidden;
  1075. margin-bottom: 15rpx;
  1076. .no-text {
  1077. display: inline-block;
  1078. height: 36rpx;
  1079. padding: 0 12rpx;
  1080. line-height: 36rpx;
  1081. background: linear-gradient(315deg, rgba(231, 0, 0, 1) 0%, rgba(255, 104, 1, 1) 100%);
  1082. border-radius: 18rpx;
  1083. text-align: center;
  1084. color: #ffffff;
  1085. font-size: $font-size-28;
  1086. margin-right: 24rpx;
  1087. }
  1088. }
  1089. .productspec {
  1090. height: 36rpx;
  1091. color: #999999;
  1092. font-size: $font-size-26;
  1093. }
  1094. .cart-sku-temp {
  1095. width: 100%;
  1096. height: 48rpx;
  1097. margin: 30rpx 0 0 0;
  1098. .cart-sku-text {
  1099. font-size: 28rpx;
  1100. line-height: 48rpx;
  1101. color: #666666;
  1102. float: left;
  1103. }
  1104. .cart-sku-btn {
  1105. padding: 0 16rpx;
  1106. text-align: center;
  1107. line-height: 40rpx;
  1108. font-size: 24rpx;
  1109. box-sizing: border-box;
  1110. border: 1px solid #ff5b00;
  1111. color: #ff5b00;
  1112. float: left;
  1113. border-radius: 20rpx;
  1114. margin-left: 16rpx;
  1115. }
  1116. }
  1117. .productprice {
  1118. width: 100%;
  1119. height: 48rpx;
  1120. margin: 30rpx 0 0 0;
  1121. .price {
  1122. line-height: 48rpx;
  1123. font-size: $font-size-26;
  1124. width: 48%;
  1125. color: #ff2a2a;
  1126. float: left;
  1127. font-weight: bold;
  1128. &.disabled {
  1129. color: #999999;
  1130. text-decoration: line-through;
  1131. }
  1132. .money-sign {
  1133. font-size: $font-size-24;
  1134. color: #ff2a2a;
  1135. }
  1136. }
  1137. .count {
  1138. height: 100%;
  1139. float: right;
  1140. position: relative;
  1141. &.show {
  1142. display: block;
  1143. }
  1144. &.none {
  1145. display: none;
  1146. }
  1147. .count-tips {
  1148. width: auto;
  1149. display: inline-block;
  1150. padding: 0 15rpx;
  1151. line-height: 44rpx;
  1152. height: 44rpx;
  1153. border-radius: 22rpx;
  1154. background: $btn-confirm;
  1155. font-size: $font-size-24;
  1156. text-align: center;
  1157. color: #ffffff;
  1158. position: absolute;
  1159. top: -60rpx;
  1160. left: -5rpx;
  1161. z-index: 5;
  1162. &.step {
  1163. left: -217rpx;
  1164. }
  1165. &::before {
  1166. content: '';
  1167. position: absolute;
  1168. bottom: -30rpx;
  1169. right: 15rpx;
  1170. z-index: 1;
  1171. width: 0;
  1172. height: 0;
  1173. border-width: 18rpx;
  1174. border-style: solid;
  1175. border-color: $color-system transparent transparent transparent;
  1176. }
  1177. }
  1178. .number-box {
  1179. display: flex;
  1180. justify-content: center;
  1181. align-items: center;
  1182. border: 2rpx solid #d5d5d5;
  1183. border-radius: 30rpx;
  1184. .iconfont {
  1185. font-size: $font-size-24;
  1186. padding: 0 18rpx;
  1187. color: #999999;
  1188. text-align: center;
  1189. line-height: 48rpx;
  1190. font-weight: bold;
  1191. background: #f7f7f7;
  1192. &.icon-jianhao {
  1193. border-radius: 30rpx 0 0 30rpx;
  1194. }
  1195. &.icon-jiahao {
  1196. border-radius: 0 30rpx 30rpx 0;
  1197. }
  1198. }
  1199. .btn-input {
  1200. width: 62rpx;
  1201. height: 48rpx;
  1202. line-height: 48rpx;
  1203. background: #fff;
  1204. border-radius: 4rpx;
  1205. text-align: center;
  1206. font-size: $font-size-24;
  1207. }
  1208. }
  1209. .uni-numbox {
  1210. position: absolute;
  1211. left: 45rpx;
  1212. bottom: 0;
  1213. .uni-numbox-minus,
  1214. .uni-numbox-plus {
  1215. width: 50rpx;
  1216. line-height: 40rpx;
  1217. }
  1218. .uni-numbox-value {
  1219. font-size: $font-size-28;
  1220. width: 60rpx;
  1221. }
  1222. }
  1223. }
  1224. }
  1225. }
  1226. }
  1227. .failure-list {
  1228. width: 702rpx;
  1229. height: auto;
  1230. padding: 0 24rpx;
  1231. margin-top: 20rpx;
  1232. background: #ffffff;
  1233. .failure-title {
  1234. width: 100%;
  1235. height: 82rpx;
  1236. line-height: 82rpx;
  1237. font-size: $font-size-28;
  1238. border-bottom: 1px solid #ebebeb;
  1239. .title-txt {
  1240. float: left;
  1241. color: #666666;
  1242. text-align: left;
  1243. }
  1244. .title-btn {
  1245. float: right;
  1246. color: $color-system;
  1247. text-align: right;
  1248. line-height: 80rpx;
  1249. .butto {
  1250. display: inline-block;
  1251. padding: 0 15rpx;
  1252. font-size: $font-size-26;
  1253. height: 50rpx;
  1254. line-height: 50rpx;
  1255. border-radius: 30rpx;
  1256. background: #ffffff;
  1257. // border: 1px solid #C9C9C9;
  1258. // color: #999999;
  1259. margin-top: 15rpx;
  1260. }
  1261. }
  1262. }
  1263. .productlist {
  1264. padding-top: 10rpx;
  1265. .goods-pros {
  1266. width: 100%;
  1267. height: auto;
  1268. padding: 20rpx 0;
  1269. }
  1270. .goods-pros-t {
  1271. display: flex;
  1272. align-items: center;
  1273. width: 100%;
  1274. height: 210rpx;
  1275. position: relative;
  1276. .img-tip {
  1277. display: block;
  1278. width: 72rpx;
  1279. height: 36rpx;
  1280. line-height: 36rpx;
  1281. font-size: $font-size-24;
  1282. text-align: center;
  1283. color: #ffffff;
  1284. border-radius: 24rpx;
  1285. background: rgba(51, 51, 51, 0.3);
  1286. // position: absolute;
  1287. // left: 0;
  1288. // top: 0;
  1289. }
  1290. .checkbox-box {
  1291. padding: 10rpx;
  1292. }
  1293. .pros-img {
  1294. width: 180rpx;
  1295. height: 100%;
  1296. border-radius: 10rpx;
  1297. margin: 0 20rpx;
  1298. border: 1px solid #f3f3f3;
  1299. position: relative;
  1300. image {
  1301. width: 100%;
  1302. height: 100%;
  1303. border-radius: 10rpx;
  1304. }
  1305. .pros-type {
  1306. width: 64rpx;
  1307. height: 64rpx;
  1308. text-align: justify;
  1309. box-sizing: border-box;
  1310. padding: 10rpx;
  1311. border-radius: 0 0 8rpx 8rpx;
  1312. background-color: #33ccbf;
  1313. font-size: $font-size-22;
  1314. color: #ffffff;
  1315. line-height: 25rpx;
  1316. position: absolute;
  1317. top: 0;
  1318. right: 10rpx;
  1319. }
  1320. }
  1321. .pros-marks {
  1322. width: 730rpx;
  1323. height: 250rpx;
  1324. z-index: 90;
  1325. background: rgba(0, 0, 0, 0.05);
  1326. position: absolute;
  1327. left: -20rpx;
  1328. top: -20rpx;
  1329. }
  1330. }
  1331. .goods-pros-b {
  1332. width: 622rpx;
  1333. margin-left: 84rpx;
  1334. height: 40rpx;
  1335. padding: 0 0 26rpx 0;
  1336. // border-top: 1px solid #EBEBEB;
  1337. &.show {
  1338. display: block;
  1339. }
  1340. &.none {
  1341. display: none;
  1342. }
  1343. .sum {
  1344. font-size: $font-size-28;
  1345. line-height: 40rpx;
  1346. color: $text-color;
  1347. display: flex;
  1348. justify-content: flex-end;
  1349. .money {
  1350. color: #ff2a2a;
  1351. font-size: $font-size-28;
  1352. }
  1353. .money-sign {
  1354. font-size: $font-size-24;
  1355. color: #ff2a2a;
  1356. }
  1357. }
  1358. }
  1359. .pros-product {
  1360. width: 402rpx;
  1361. height: 100%;
  1362. line-height: 36rpx;
  1363. font-size: $font-size-28;
  1364. position: relative;
  1365. .producttitle {
  1366. width: 100%;
  1367. display: inline-block;
  1368. height: auto;
  1369. text-overflow: ellipsis;
  1370. display: -webkit-box;
  1371. word-break: break-all;
  1372. -webkit-box-orient: vertical;
  1373. -webkit-line-clamp: 2;
  1374. overflow: hidden;
  1375. margin-bottom: 8rpx;
  1376. .no-text {
  1377. display: inline-block;
  1378. height: 36rpx;
  1379. padding: 0 12rpx;
  1380. line-height: 36rpx;
  1381. background: linear-gradient(315deg, rgba(231, 0, 0, 1) 0%, rgba(255, 104, 1, 1) 100%);
  1382. border-radius: 18rpx;
  1383. text-align: center;
  1384. color: #ffffff;
  1385. font-size: $font-size-28;
  1386. margin-right: 24rpx;
  1387. }
  1388. }
  1389. .productspec {
  1390. height: 36rpx;
  1391. color: #999999;
  1392. font-size: $font-size-26;
  1393. margin-top: 20rpx;
  1394. }
  1395. .productstate {
  1396. font-size: $font-size-28;
  1397. height: 44rpx;
  1398. color: #ff2a2a;
  1399. position: absolute;
  1400. bottom: 0;
  1401. left: 0;
  1402. }
  1403. }
  1404. }
  1405. }
  1406. .tui-popup-box {
  1407. position: relative;
  1408. box-sizing: border-box;
  1409. min-height: 220rpx;
  1410. padding: 24rpx 24rpx 0 24rpx;
  1411. .tui-popup-close {
  1412. width: 90rpx;
  1413. height: 90rpx;
  1414. position: absolute;
  1415. right: 0;
  1416. top: 24rpx;
  1417. line-height: 90rpx;
  1418. text-align: center;
  1419. color: #b2b2b2;
  1420. .icon-iconfontguanbi {
  1421. font-size: $font-size-40;
  1422. }
  1423. }
  1424. .title {
  1425. font-size: $font-size-34;
  1426. color: $text-color;
  1427. line-height: 88rpx;
  1428. text-align: center;
  1429. float: left;
  1430. width: 100%;
  1431. height: 88rpx;
  1432. font-weight: bold;
  1433. }
  1434. .tui-popup-main {
  1435. width: 100%;
  1436. float: left;
  1437. &.coupon {
  1438. padding-bottom: 40rpx;
  1439. .coupon-empty {
  1440. width: 100%;
  1441. height: 600rpx;
  1442. display: flex;
  1443. align-items: center;
  1444. justify-content: center;
  1445. flex-direction: column;
  1446. position: fixed;
  1447. background: $bg-color;
  1448. .empty-container-image {
  1449. width: 150rpx;
  1450. height: 150rpx;
  1451. margin-bottom: 0;
  1452. margin-top: 0;
  1453. }
  1454. .error-text {
  1455. font-size: $font-size-28;
  1456. color: #999999;
  1457. line-height: 88rpx;
  1458. }
  1459. }
  1460. }
  1461. .tui-popup-scroll {
  1462. width: 100%;
  1463. height: 600rpx;
  1464. .coupon-list {
  1465. width: 100%;
  1466. height: 200rpx;
  1467. margin-top: 24rpx;
  1468. box-sizing: border-box;
  1469. background: url(https://static.caimei365.com/app/img/icon/icon-coupon-uesb@2x.png);
  1470. background-size: cover;
  1471. &:last-child {
  1472. margin-bottom: 24rpx;
  1473. }
  1474. .list-cell-le {
  1475. width: 224rpx;
  1476. height: 100%;
  1477. box-sizing: border-box;
  1478. padding: 37rpx 0;
  1479. float: left;
  1480. .coupon-maxMoney {
  1481. width: 100%;
  1482. height: 78rpx;
  1483. line-height: 78rpx;
  1484. font-size: 56rpx;
  1485. color: #ffffff;
  1486. text-align: center;
  1487. .small {
  1488. font-size: $font-size-24;
  1489. }
  1490. }
  1491. .coupon-minMoney {
  1492. width: 100%;
  1493. height: 33rpx;
  1494. line-height: 33rpx;
  1495. font-size: $font-size-24;
  1496. color: #ffffff;
  1497. text-align: center;
  1498. }
  1499. }
  1500. .list-cell-ri {
  1501. width: 478rpx;
  1502. height: 100%;
  1503. box-sizing: border-box;
  1504. padding: 20rpx 24rpx 0 24rpx;
  1505. float: right;
  1506. .list-cell-top {
  1507. width: 100%;
  1508. height: 121rpx;
  1509. float: left;
  1510. border-bottom: 1px solid #e1e1e1;
  1511. .list-cell-type {
  1512. width: 286rpx;
  1513. height: 100%;
  1514. float: left;
  1515. .list-cell-tags {
  1516. width: 100%;
  1517. height: 32rpx;
  1518. margin-bottom: 7rpx;
  1519. .tags {
  1520. display: inline-block;
  1521. padding: 0 10rpx;
  1522. height: 32rpx;
  1523. line-height: 32rpx;
  1524. background-color: #ffdcce;
  1525. color: #f94b4b;
  1526. font-size: $font-size-20;
  1527. border-radius: 8rpx;
  1528. text-align: center;
  1529. float: left;
  1530. }
  1531. }
  1532. .list-cell-texts {
  1533. width: 100%;
  1534. height: auto;
  1535. line-height: 35rpx;
  1536. text-overflow: ellipsis;
  1537. display: -webkit-box;
  1538. word-break: break-all;
  1539. -webkit-box-orient: vertical;
  1540. -webkit-line-clamp: 2;
  1541. overflow: hidden;
  1542. font-size: 26rpx;
  1543. color: #333333;
  1544. }
  1545. }
  1546. .list-cell-btn {
  1547. width: 128rpx;
  1548. height: 100%;
  1549. float: right;
  1550. .icon-used {
  1551. width: 100%;
  1552. height: 100%;
  1553. box-sizing: border-box;
  1554. padding-top: 28rpx;
  1555. .icon-used-text {
  1556. width: 100%;
  1557. text-align: center;
  1558. line-height: 26rpx;
  1559. font-size: $font-size-20;
  1560. color: #f94b4b;
  1561. }
  1562. .icon-used-btn {
  1563. width: 128rpx;
  1564. height: 48rpx;
  1565. border-radius: 28rpx;
  1566. line-height: 48rpx;
  1567. font-size: $font-size-26;
  1568. text-align: center;
  1569. &.receive {
  1570. background-image: linear-gradient(270deg, #f94b4b 0%, #feb673 100%);
  1571. color: #ffffff;
  1572. }
  1573. &.make {
  1574. border: solid 1px #f94b4b;
  1575. color: #f94b4b;
  1576. }
  1577. }
  1578. }
  1579. }
  1580. }
  1581. .list-cell-time {
  1582. width: 100%;
  1583. height: 58rpx;
  1584. line-height: 58rpx;
  1585. text-align: left;
  1586. font-size: $font-size-20;
  1587. color: #999999;
  1588. }
  1589. }
  1590. }
  1591. }
  1592. .tui-popup-coupon {
  1593. width: 100%;
  1594. height: 500rpx;
  1595. box-sizing: border-box;
  1596. padding: 30rpx 20rpx;
  1597. .tui-popup-h1 {
  1598. width: 100%;
  1599. height: 66rpx;
  1600. display: flex;
  1601. align-items: center;
  1602. .tui-popup-text {
  1603. flex: 1;
  1604. height: 66rpx;
  1605. line-height: 66rpx;
  1606. font-size: $font-size-30;
  1607. color: #333333;
  1608. &.red {
  1609. color: #f94b4b;
  1610. }
  1611. &.bold {
  1612. font-weight: bold;
  1613. }
  1614. &.left {
  1615. text-align: left;
  1616. }
  1617. &.right {
  1618. text-align: right;
  1619. }
  1620. }
  1621. }
  1622. }
  1623. }
  1624. }
  1625. .footer {
  1626. width: 100%;
  1627. background-color: #ffffff;
  1628. height: 110rpx;
  1629. position: fixed;
  1630. bottom: 0rpx;
  1631. z-index: 990;
  1632. .footer-le {
  1633. width: 520rpx;
  1634. height: 100%;
  1635. padding-left: 24rpx;
  1636. float: left;
  1637. box-sizing: border-box;
  1638. .foot-check {
  1639. width: 100rpx;
  1640. float: left;
  1641. line-height: 110rpx;
  1642. font-size: $font-size-24;
  1643. .checkbox {
  1644. width: 40rpx;
  1645. text-align: center;
  1646. }
  1647. .text {
  1648. width: 60rpx;
  1649. float: right;
  1650. }
  1651. }
  1652. .sum {
  1653. width: 360rpx;
  1654. height: 110rpx;
  1655. float: right;
  1656. box-sizing: border-box;
  1657. padding: 10rpx;
  1658. .sum-none {
  1659. width: 100%;
  1660. height: 45rpx;
  1661. line-height: 45rpx;
  1662. color: $text-color;
  1663. float: left;
  1664. text-align: left;
  1665. .money {
  1666. font-size: $font-size-24;
  1667. color: #999999;
  1668. text-decoration: line-through;
  1669. }
  1670. .money-sign {
  1671. font-size: $font-size-24;
  1672. color: #999999;
  1673. text-decoration: line-through;
  1674. }
  1675. .money-reduced {
  1676. margin-left: 10rpx;
  1677. font-size: $font-size-24;
  1678. color: #ff2a2a;
  1679. }
  1680. .money-popup {
  1681. height: 45rpx;
  1682. line-height: 45rpx;
  1683. display: inline-block;
  1684. float: right;
  1685. font-size: $font-size-24;
  1686. color: #ff2a2a;
  1687. .icon-xiangshangjiantou {
  1688. font-size: $font-size-30;
  1689. margin-left: 5rpx;
  1690. }
  1691. }
  1692. }
  1693. .sum-price {
  1694. width: 100%;
  1695. height: 45rpx;
  1696. line-height: 45rpx;
  1697. font-size: $font-size-30;
  1698. color: $text-color;
  1699. float: left;
  1700. font-weight: normal;
  1701. text-align: left;
  1702. &.none {
  1703. height: 90rpx;
  1704. line-height: 90rpx;
  1705. }
  1706. .money {
  1707. color: #ff2a2a;
  1708. }
  1709. .money-sign {
  1710. font-size: $font-size-24;
  1711. color: #ff2a2a;
  1712. }
  1713. }
  1714. }
  1715. }
  1716. .footer-ri {
  1717. width: 230rpx;
  1718. height: 100%;
  1719. float: right;
  1720. display: flex;
  1721. justify-content: space-between;
  1722. align-items: center;
  1723. z-index: 999;
  1724. box-sizing: border-box;
  1725. padding: 13rpx 15rpx 13rpx 5rpx;
  1726. &.none {
  1727. display: none;
  1728. }
  1729. .btn {
  1730. width: 200rpx;
  1731. height: 100%;
  1732. background: $btn-confirm;
  1733. font-size: $font-size-26;
  1734. line-height: 84rpx;
  1735. color: #ffffff;
  1736. display: flex;
  1737. border-radius: 42rpx;
  1738. justify-content: center;
  1739. align-items: center;
  1740. }
  1741. }
  1742. .footer-del {
  1743. width: 460rpx;
  1744. height: 110rpx;
  1745. position: absolute;
  1746. padding-left: 140rpx;
  1747. background: #ffffff;
  1748. right: 0;
  1749. top: 0;
  1750. z-index: 1000;
  1751. &.show {
  1752. animation: showDelbtn 0s linear both;
  1753. }
  1754. &.none {
  1755. animation: hideDelbtn 0s linear both;
  1756. }
  1757. .btn {
  1758. width: 200rpx;
  1759. height: 80rpx;
  1760. line-height: 80rpx;
  1761. font-size: $font-size-28;
  1762. color: #ffffff;
  1763. text-align: center;
  1764. float: left;
  1765. margin: 10rpx;
  1766. border-radius: 40rpx;
  1767. }
  1768. .btn.btn-cancel {
  1769. background: #f7f7f7;
  1770. color: #b2b2b2;
  1771. }
  1772. .btn.btn-confirm {
  1773. background: #ff2a2a;
  1774. }
  1775. @keyframes showDelbtn {
  1776. 0% {
  1777. transform: translateX(0);
  1778. }
  1779. 100% {
  1780. transform: translateX(-100%);
  1781. }
  1782. }
  1783. @keyframes hideDelbtn {
  1784. 0% {
  1785. transform: translateX(-100%);
  1786. }
  1787. 100% {
  1788. transform: translateX(0);
  1789. }
  1790. }
  1791. }
  1792. }
  1793. </style>