cart.vue 48 KB

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