index.vue 41 KB

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