cart.vue 44 KB

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