cart.vue 48 KB

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