cart.vue 48 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833
  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. />
  276. <!-- 促销活动弹窗 -->
  277. <activi-popup :product="handlerPros" :popupShow="popupShow1" />
  278. <!-- 透明模态层 -->
  279. <modal-layer v-if="modallayer" />
  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: 50 // 条数
  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.productCount = pros.number
  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.productCount = pros.number
  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.productCount
  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.productCount
  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. setTimeout(()=>{
  958. pros.isStep = false
  959. this.$forceUpdate()
  960. },2000)
  961. },
  962. processActivityPrice(pros) {
  963. //单独处理活动价格和阶梯价格
  964. let ladderPriceList = pros.ladderPrices
  965. if (pros.ladderFlag == 0 || pros.actStatus == 1) {
  966. pros.price = pros.price
  967. } else {
  968. ladderPriceList.forEach((item, index) => {
  969. if (pros.number >= item.buyNum) {
  970. pros.price = item.buyPrice
  971. }
  972. })
  973. }
  974. },
  975. setCartisDisable(){// 删除取消设置不能选的商品
  976. this.goodsList = this.goodsList.map(suppler=>{
  977. suppler.isDisable = false
  978. suppler.cartList.forEach(pros => {
  979. pros.isDisable = false
  980. })
  981. return suppler
  982. })
  983. },
  984. clearCartisDisable(){// 取消删除设置不能选的商品
  985. this.goodsList = this.goodsList.map((supplier) => {
  986. supplier.cartList.forEach(pros => {
  987. if(pros.stock === 0 || pros.number > pros.stock ){
  988. supplier.isDisable = true
  989. pros.isDisable = true
  990. }else{
  991. pros.isDisable = false
  992. }
  993. })
  994. return supplier
  995. })
  996. },
  997. showDelManager() {
  998. //显示删除商品管理
  999. this.isshowDelbtn = true
  1000. this.setCartisDisable()
  1001. if (this.isCheckAll) {
  1002. this.updateBothCheckBtn()
  1003. } else {
  1004. this.updateCheckAllBtn()
  1005. }
  1006. },
  1007. hideDelManage() {
  1008. //隐藏删除商品管理
  1009. this.isshowDelbtn = false
  1010. this.isCheckAll = false
  1011. this.clearCartisDisable()
  1012. this.goodsList = this.goodsList.map(suppler=>{
  1013. suppler.isChecked = false
  1014. suppler.cartList.forEach(pros => {
  1015. pros.isChecked = false
  1016. })
  1017. return suppler
  1018. })
  1019. },
  1020. goNavto(url) {
  1021. uni.navigateTo({
  1022. url
  1023. })
  1024. },
  1025. PromotionsFormat(promo) {
  1026. //促销活动类型数据处理
  1027. if (promo != null) {
  1028. if (promo.type == 1 && promo.mode == 1) {
  1029. return true
  1030. } else {
  1031. return false
  1032. }
  1033. }
  1034. return false
  1035. },
  1036. navToListPage(id) {
  1037. this.isModallayer = true
  1038. this.$api.navigateTo(`/pages/goods/product?id=${id}`)
  1039. },
  1040. isShowVipFlag(pros) {
  1041. if (pros.priceFlag != 1) {
  1042. if (this.userIdentity == 4 && this.vipFlag == 1) {
  1043. return true
  1044. } else if (this.userIdentity == 2) {
  1045. return true
  1046. }
  1047. }
  1048. },
  1049. handleShouUnitPopup(pros) {
  1050. // 规格弹窗
  1051. this.popupShow = true
  1052. this.handlePros = pros
  1053. }
  1054. },
  1055. // onReachBottom() {
  1056. // if (this.hasNextPage) {
  1057. // this.loadding = true
  1058. // this.pullUpOn = true
  1059. // this.getOnReachBottomData()
  1060. // }
  1061. // },
  1062. onPullDownRefresh() {
  1063. //下拉刷新
  1064. this.initGetCartGoodsList()
  1065. uni.stopPullDownRefresh()
  1066. },
  1067. onShow() {
  1068. this.initGetStotage()
  1069. }
  1070. }
  1071. </script>
  1072. <style lang="scss">
  1073. page {
  1074. background: #f7f7f7;
  1075. }
  1076. .cart-content {
  1077. position: relative;
  1078. padding-bottom: 100rpx;
  1079. }
  1080. .container-cart-main.none {
  1081. display: none;
  1082. }
  1083. .container-cart-main.show {
  1084. display: block;
  1085. }
  1086. .cart-content.empty.none {
  1087. display: none;
  1088. }
  1089. .cart-content.empty.show {
  1090. display: block;
  1091. }
  1092. .container-cart.show {
  1093. display: block;
  1094. }
  1095. .container-cart.none {
  1096. display: none;
  1097. }
  1098. .empty-container.none {
  1099. display: none;
  1100. }
  1101. .empty-container.show {
  1102. display: flex;
  1103. }
  1104. .foot-check-delbtn {
  1105. width: 100%;
  1106. height: 80rpx;
  1107. position: fixed;
  1108. top: 0;
  1109. left: 0;
  1110. box-sizing: border-box;
  1111. padding: 15rpx 24rpx;
  1112. background-color: #f7f7f7;
  1113. z-index: 990;
  1114. .foot-text {
  1115. font-size: $font-size-26;
  1116. height: 50rpx;
  1117. line-height: 50rpx;
  1118. color: #666666;
  1119. float: left;
  1120. padding-left: 10rpx;
  1121. text {
  1122. // color: $color-system;
  1123. margin: 0 6rpx;
  1124. }
  1125. }
  1126. .delBtn {
  1127. width: 100rpx;
  1128. display: inline-block;
  1129. padding: 0 15rpx;
  1130. font-size: $font-size-26;
  1131. height: 50rpx;
  1132. line-height: 50rpx;
  1133. border-radius: 30rpx;
  1134. background: #ffffff;
  1135. border: 1px solid #FF5B00;
  1136. color: $color-system;
  1137. float: right;
  1138. text-align: center;
  1139. &.none {
  1140. display: none;
  1141. }
  1142. }
  1143. }
  1144. .checkbox-box {
  1145. display: flex;
  1146. align-items: center;
  1147. .checkbox {
  1148. display: flex;
  1149. margin: 0;
  1150. padding: 0;
  1151. display: flex;
  1152. flex-direction: column;
  1153. align-items: center;
  1154. box-sizing: border-box;
  1155. text-align: center;
  1156. text-decoration: none;
  1157. border-radius: 0;
  1158. -webkit-tap-highlight-color: transparent;
  1159. overflow: hidden;
  1160. background-color: #ffffff;
  1161. font-size: 36rpx;
  1162. color: $color-system;
  1163. padding: 5rpx;
  1164. &.icon-weixuanze {
  1165. color: #b2b2b2;
  1166. }
  1167. }
  1168. &.disabled {
  1169. .checkbox {
  1170. color: #999999;
  1171. }
  1172. }
  1173. .text {
  1174. font-size: $font-size-24;
  1175. margin-left: 10rpx;
  1176. }
  1177. }
  1178. .goods-list {
  1179. width: 100%;
  1180. height: auto;
  1181. border-top: 1px solid #ebebeb;
  1182. background-color: #f7f7f7;
  1183. .goods-item {
  1184. width: 702rpx;
  1185. padding: 0 24rpx;
  1186. background: #ffffff;
  1187. margin-bottom: 24rpx;
  1188. }
  1189. .shoptitle {
  1190. display: flex;
  1191. align-items: center;
  1192. height: 80rpx;
  1193. line-height: 80rpx;
  1194. .checkbox-box {
  1195. padding: 10rpx;
  1196. }
  1197. .text {
  1198. width: 450rpx;
  1199. display: block;
  1200. overflow: hidden;
  1201. text-overflow: ellipsis;
  1202. white-space: nowrap;
  1203. margin-left: 20rpx;
  1204. font-size: $font-size-28;
  1205. color: $text-color;
  1206. text-align: left;
  1207. font-weight: bold;
  1208. }
  1209. .floor-item-act {
  1210. height: 56rpx;
  1211. text-align: center;
  1212. box-sizing: border-box;
  1213. float: left;
  1214. padding: 10rpx 0;
  1215. margin-left: 20rpx;
  1216. .floor-tags {
  1217. height: 28rpx;
  1218. border-radius: 6rpx;
  1219. background-color: #ffffff;
  1220. line-height: 26rpx;
  1221. color: $color-system;
  1222. text-align: center;
  1223. display: inline-block;
  1224. padding: 0 6rpx;
  1225. font-size: $font-size-20;
  1226. border: 1px solid #FF5B00;
  1227. float: right;
  1228. }
  1229. }
  1230. }
  1231. .goods-pros {
  1232. width: 100%;
  1233. height: auto;
  1234. }
  1235. .goods-pros-t {
  1236. display: flex;
  1237. align-items: center;
  1238. width: 100%;
  1239. height: auto;
  1240. padding: 0 0 20rpx 0;
  1241. .checkbox-box {
  1242. padding: 10rpx;
  1243. }
  1244. .pros-img {
  1245. width: 210rpx;
  1246. height: 210rpx;
  1247. border-radius: 10rpx;
  1248. margin: 0 20rpx;
  1249. border: 1px solid #f3f3f3;
  1250. position: relative;
  1251. image {
  1252. width: 210rpx;
  1253. height: 210rpx;
  1254. border-radius: 10rpx;
  1255. }
  1256. .pros-type {
  1257. width: 64rpx;
  1258. height: 64rpx;
  1259. text-align: justify;
  1260. box-sizing: border-box;
  1261. padding: 10rpx;
  1262. border-radius: 0 0 8rpx 8rpx;
  1263. background-color: #33ccbf;
  1264. font-size: $font-size-22;
  1265. color: #ffffff;
  1266. line-height: 25rpx;
  1267. position: absolute;
  1268. top: 0;
  1269. right: 10rpx;
  1270. }
  1271. }
  1272. }
  1273. .goods-pros-b {
  1274. width: 100%;
  1275. height: auto;
  1276. padding: 0 0 24rpx 0;
  1277. box-sizing: border-box;
  1278. &.show {
  1279. display: block;
  1280. }
  1281. &.none {
  1282. display: none;
  1283. }
  1284. .sum-none {
  1285. width: 100%;
  1286. height: 48rpx;
  1287. line-height: 48rpx;
  1288. color: $text-color;
  1289. float: left;
  1290. text-align: right;
  1291. .money {
  1292. font-size: $font-size-26;
  1293. color: #999999;
  1294. text-decoration: line-through;
  1295. }
  1296. .money-sign {
  1297. font-size: $font-size-26;
  1298. color: #999999;
  1299. text-decoration: line-through;
  1300. }
  1301. .money-reduced {
  1302. margin-left: 10rpx;
  1303. font-size: $font-size-26;
  1304. color: $color-system;
  1305. .iconfont {
  1306. font-size: $font-size-34;
  1307. }
  1308. }
  1309. }
  1310. .sum {
  1311. width: 100%;
  1312. height: 40rpx;
  1313. font-size: $font-size-28;
  1314. line-height: 40rpx;
  1315. color: $text-color;
  1316. float: left;
  1317. display: flex;
  1318. justify-content: flex-end;
  1319. .money {
  1320. color: #ff2a2a;
  1321. font-size: $font-size-28;
  1322. }
  1323. .money-sign {
  1324. font-size: $font-size-24;
  1325. color: #ff2a2a;
  1326. }
  1327. }
  1328. }
  1329. .pros-product {
  1330. width: 386rpx;
  1331. height: 100%;
  1332. line-height: 36rpx;
  1333. font-size: $font-size-26;
  1334. position: relative;
  1335. .producttitle {
  1336. width: 100%;
  1337. display: inline-block;
  1338. height: auto;
  1339. text-overflow: ellipsis;
  1340. display: -webkit-box;
  1341. word-break: break-all;
  1342. -webkit-box-orient: vertical;
  1343. -webkit-line-clamp: 2;
  1344. overflow: hidden;
  1345. margin-bottom: 8rpx;
  1346. .no-text {
  1347. display: inline-block;
  1348. height: 36rpx;
  1349. padding: 0 12rpx;
  1350. line-height: 36rpx;
  1351. background: linear-gradient(315deg, rgba(231, 0, 0, 1) 0%, rgba(255, 104, 1, 1) 100%);
  1352. border-radius: 18rpx;
  1353. text-align: center;
  1354. color: #ffffff;
  1355. font-size: $font-size-24;
  1356. margin-right: 24rpx;
  1357. }
  1358. }
  1359. .productspec {
  1360. height: 36rpx;
  1361. color: #999999;
  1362. text-overflow: ellipsis;
  1363. display: -webkit-box;
  1364. word-break: break-all;
  1365. -webkit-box-orient: vertical;
  1366. -webkit-line-clamp: 2;
  1367. overflow: hidden;
  1368. margin-top: 10rpx;
  1369. }
  1370. .productCode {
  1371. color: #666666;
  1372. }
  1373. .cart-sku-temp {
  1374. width: 100%;
  1375. height: 48rpx;
  1376. margin: 30rpx 0 0 0;
  1377. .cart-sku-text {
  1378. font-size: 28rpx;
  1379. line-height: 48rpx;
  1380. color: #666666;
  1381. float: left;
  1382. }
  1383. .cart-sku-btn {
  1384. padding: 0 16rpx;
  1385. text-align: center;
  1386. line-height: 40rpx;
  1387. font-size: 24rpx;
  1388. box-sizing: border-box;
  1389. border: 1px solid #FF5B00;
  1390. color: #FF5B00;
  1391. float: left;
  1392. border-radius: 20rpx;
  1393. margin-left: 16rpx;
  1394. }
  1395. }
  1396. .productprice {
  1397. width: 100%;
  1398. height: 48rpx;
  1399. margin: 10rpx 0 0 0;
  1400. .price {
  1401. line-height: 48rpx;
  1402. font-size: $font-size-28;
  1403. width: 48%;
  1404. color: #ff2a2a;
  1405. float: left;
  1406. &.disabled {
  1407. color: #999999;
  1408. text-decoration: line-through;
  1409. }
  1410. .money-sign {
  1411. font-size: $font-size-24;
  1412. color: #ff2a2a;
  1413. }
  1414. }
  1415. .count {
  1416. height: 100%;
  1417. float: right;
  1418. position: relative;
  1419. &.show {
  1420. display: block;
  1421. }
  1422. &.none {
  1423. display: none;
  1424. }
  1425. .count-tips {
  1426. width: auto;
  1427. display: inline-block;
  1428. padding: 0 15rpx;
  1429. line-height: 44rpx;
  1430. height: 44rpx;
  1431. border-radius: 22rpx;
  1432. background: $btn-confirm;
  1433. font-size: $font-size-24;
  1434. text-align: center;
  1435. color: #ffffff;
  1436. position: absolute;
  1437. top: -60rpx;
  1438. left: -5rpx;
  1439. z-index: 5;
  1440. &.step {
  1441. left: -217rpx;
  1442. }
  1443. &::before {
  1444. content: '';
  1445. position: absolute;
  1446. bottom: -30rpx;
  1447. right: 15rpx;
  1448. z-index: 1;
  1449. width: 0;
  1450. height: 0;
  1451. border-width: 18rpx;
  1452. border-style: solid;
  1453. border-color: $color-system transparent transparent transparent;
  1454. }
  1455. }
  1456. .number-box {
  1457. display: flex;
  1458. justify-content: center;
  1459. align-items: center;
  1460. border: 2rpx solid #ffe6dc;
  1461. border-radius: 30rpx;
  1462. height: 48rpx;
  1463. .iconfont {
  1464. font-size: $font-size-24;
  1465. padding: 0 18rpx;
  1466. color: #999999;
  1467. text-align: center;
  1468. line-height: 48rpx;
  1469. font-weight: bold;
  1470. background: #fef6f3;
  1471. &.icon-jianhao {
  1472. border-radius: 30rpx 0 0 30rpx;
  1473. }
  1474. &.icon-jiahao {
  1475. border-radius: 0 30rpx 30rpx 0;
  1476. }
  1477. }
  1478. .btn-input {
  1479. width: 62rpx;
  1480. height: 44rpx;
  1481. line-height: 44rpx;
  1482. border-radius: 4rpx;
  1483. text-align: center;
  1484. font-size: $font-size-24;
  1485. border-bottom: 2rpx solid #ffe6dc;
  1486. border-top: 2rpx solid #ffe6dc;
  1487. }
  1488. }
  1489. .uni-numbox {
  1490. position: absolute;
  1491. left: 45rpx;
  1492. bottom: 0;
  1493. .uni-numbox-minus,
  1494. .uni-numbox-plus {
  1495. width: 50rpx;
  1496. line-height: 40rpx;
  1497. }
  1498. .uni-numbox-value {
  1499. font-size: $font-size-28;
  1500. width: 60rpx;
  1501. }
  1502. }
  1503. }
  1504. }
  1505. .floor-item-act {
  1506. width: 100%;
  1507. height: 56rpx;
  1508. text-align: center;
  1509. box-sizing: border-box;
  1510. float: left;
  1511. padding: 0 0 10rpx 0;
  1512. margin-left: 10rpx;
  1513. }
  1514. }
  1515. }
  1516. .footer {
  1517. width: 100%;
  1518. background-color: #ffffff;
  1519. height: 110rpx;
  1520. position: fixed;
  1521. bottom: 0rpx;
  1522. z-index: 100;
  1523. .footer-le {
  1524. width: 510rpx;
  1525. height: 100%;
  1526. padding: 0 24rpx;
  1527. float: left;
  1528. .foot-check {
  1529. width: 100rpx;
  1530. float: left;
  1531. line-height: 110rpx;
  1532. font-size: $font-size-24;
  1533. .checkbox {
  1534. width: 40rpx;
  1535. text-align: center;
  1536. }
  1537. .text {
  1538. width: 60rpx;
  1539. float: right;
  1540. }
  1541. }
  1542. .sum {
  1543. width: 380rpx;
  1544. height: 110rpx;
  1545. float: right;
  1546. box-sizing: border-box;
  1547. padding: 10rpx;
  1548. .sum-none {
  1549. width: 100%;
  1550. height: 45rpx;
  1551. line-height: 45rpx;
  1552. color: $text-color;
  1553. float: left;
  1554. text-align: right;
  1555. .money {
  1556. font-size: $font-size-24;
  1557. color: #999999;
  1558. text-decoration: line-through;
  1559. }
  1560. .money-sign {
  1561. font-size: $font-size-24;
  1562. color: #999999;
  1563. text-decoration: line-through;
  1564. }
  1565. .money-reduced {
  1566. margin-left: 10rpx;
  1567. font-size: $font-size-24;
  1568. color: $color-system;
  1569. }
  1570. }
  1571. .sum-price {
  1572. text-align: right;
  1573. width: 100%;
  1574. height: 45rpx;
  1575. line-height: 45rpx;
  1576. font-size: $font-size-30;
  1577. color: $text-color;
  1578. float: left;
  1579. font-weight: normal;
  1580. &.none {
  1581. height: 90rpx;
  1582. line-height: 90rpx;
  1583. }
  1584. .money {
  1585. color: #ff2a2a;
  1586. }
  1587. .money-sign {
  1588. font-size: $font-size-24;
  1589. color: #ff2a2a;
  1590. }
  1591. }
  1592. }
  1593. }
  1594. .footer-ri {
  1595. width: 180rpx;
  1596. height: 84rpx;
  1597. background: linear-gradient(135deg, rgba(242, 143, 49, 1) 0%, rgba(225, 86, 22, 1) 100%);
  1598. float: right;
  1599. display: flex;
  1600. justify-content: space-between;
  1601. align-items: center;
  1602. z-index: 999;
  1603. border-radius: 49rpx;
  1604. margin-top: 15rpx;
  1605. margin-right: 10rpx;
  1606. &.none {
  1607. display: none;
  1608. }
  1609. .btn {
  1610. width: 200rpx;
  1611. height: 100%;
  1612. font-size: $font-size-28;
  1613. line-height: 110rpx;
  1614. color: #ffffff;
  1615. display: flex;
  1616. justify-content: center;
  1617. align-items: center;
  1618. }
  1619. }
  1620. .footer-del {
  1621. width: 400rpx;
  1622. height: 110rpx;
  1623. position: absolute;
  1624. padding-left: 200rpx;
  1625. background: #ffffff;
  1626. right: 0;
  1627. top: 0;
  1628. z-index: 1000;
  1629. &.show {
  1630. animation: showDelbtn 0s linear both;
  1631. }
  1632. &.none {
  1633. animation: hideDelbtn 0s linear both;
  1634. }
  1635. .btn {
  1636. width: 50%;
  1637. height: 100%;
  1638. line-height: 110rpx;
  1639. font-size: $font-size-28;
  1640. color: #ffffff;
  1641. text-align: center;
  1642. float: left;
  1643. }
  1644. .btn.btn-cancel {
  1645. background: #eec1ab;
  1646. }
  1647. .btn.btn-confirm {
  1648. background: #ff2a2a;
  1649. }
  1650. @keyframes showDelbtn {
  1651. 0% {
  1652. transform: translateX(0);
  1653. }
  1654. 100% {
  1655. transform: translateX(-100%);
  1656. }
  1657. }
  1658. @keyframes hideDelbtn {
  1659. 0% {
  1660. transform: translateX(-100%);
  1661. }
  1662. 100% {
  1663. transform: translateX(0);
  1664. }
  1665. }
  1666. }
  1667. }
  1668. .failure-list {
  1669. width: 702rpx;
  1670. height: auto;
  1671. padding: 0 24rpx;
  1672. margin-top: 20rpx;
  1673. background: #ffffff;
  1674. .failure-title {
  1675. width: 100%;
  1676. height: 82rpx;
  1677. line-height: 82rpx;
  1678. font-size: $font-size-28;
  1679. .title-txt {
  1680. float: left;
  1681. color: #666666;
  1682. text-align: left;
  1683. }
  1684. .title-btn {
  1685. float: right;
  1686. color: $color-system;
  1687. text-align: right;
  1688. line-height: 80rpx;
  1689. .butto {
  1690. display: inline-block;
  1691. padding: 0 15rpx;
  1692. font-size: $font-size-26;
  1693. height: 50rpx;
  1694. line-height: 50rpx;
  1695. border-radius: 30rpx;
  1696. background: #ffffff;
  1697. // border: 1px solid #C9C9C9;
  1698. // color: #999999;
  1699. margin-top: 15rpx;
  1700. }
  1701. }
  1702. }
  1703. .productlist {
  1704. padding-top: 10rpx;
  1705. .goods-pros {
  1706. width: 100%;
  1707. height: auto;
  1708. padding: 20rpx 0;
  1709. }
  1710. .goods-pros-t {
  1711. display: flex;
  1712. align-items: center;
  1713. width: 100%;
  1714. height: 210rpx;
  1715. position: relative;
  1716. .img-tip {
  1717. display: block;
  1718. width: 72rpx;
  1719. height: 36rpx;
  1720. line-height: 36rpx;
  1721. font-size: $font-size-24;
  1722. text-align: center;
  1723. color: #ffffff;
  1724. border-radius: 24rpx;
  1725. background: rgba(51, 51, 51, 0.3);
  1726. // position: absolute;
  1727. // left: 0;
  1728. // top: 0;
  1729. }
  1730. .checkbox-box {
  1731. padding: 10rpx;
  1732. }
  1733. .pros-img {
  1734. width: 180rpx;
  1735. height: 100%;
  1736. border-radius: 10rpx;
  1737. margin: 0 20rpx;
  1738. border: 1px solid #f3f3f3;
  1739. position: relative;
  1740. image {
  1741. width: 100%;
  1742. height: 100%;
  1743. border-radius: 10rpx;
  1744. }
  1745. }
  1746. .pros-marks {
  1747. width: 750rpx;
  1748. height: 250rpx;
  1749. z-index: 90;
  1750. background: rgba(0, 0, 0, 0.05);
  1751. position: absolute;
  1752. left: -20rpx;
  1753. top: -20rpx;
  1754. }
  1755. }
  1756. .goods-pros-b {
  1757. width: 622rpx;
  1758. margin-left: 84rpx;
  1759. height: 40rpx;
  1760. padding: 0 0 26rpx 0;
  1761. // border-top: 1px solid #EBEBEB;
  1762. &.show {
  1763. display: block;
  1764. }
  1765. &.none {
  1766. display: none;
  1767. }
  1768. .sum {
  1769. font-size: $font-size-28;
  1770. line-height: 40rpx;
  1771. color: $text-color;
  1772. display: flex;
  1773. justify-content: flex-end;
  1774. .money {
  1775. color: #ff2a2a;
  1776. font-size: $font-size-28;
  1777. }
  1778. .money-sign {
  1779. font-size: $font-size-24;
  1780. color: #ff2a2a;
  1781. }
  1782. }
  1783. }
  1784. .pros-product {
  1785. width: 402rpx;
  1786. height: 100%;
  1787. line-height: 36rpx;
  1788. font-size: $font-size-28;
  1789. position: relative;
  1790. .producttitle {
  1791. width: 100%;
  1792. display: inline-block;
  1793. height: auto;
  1794. text-overflow: ellipsis;
  1795. display: -webkit-box;
  1796. word-break: break-all;
  1797. -webkit-box-orient: vertical;
  1798. -webkit-line-clamp: 2;
  1799. overflow: hidden;
  1800. margin-bottom: 8rpx;
  1801. .no-text {
  1802. display: inline-block;
  1803. height: 36rpx;
  1804. padding: 0 12rpx;
  1805. line-height: 36rpx;
  1806. background: linear-gradient(315deg, rgba(231, 0, 0, 1) 0%, rgba(255, 104, 1, 1) 100%);
  1807. border-radius: 18rpx;
  1808. text-align: center;
  1809. color: #ffffff;
  1810. font-size: $font-size-28;
  1811. margin-right: 24rpx;
  1812. }
  1813. }
  1814. .productspec {
  1815. height: 36rpx;
  1816. color: #999999;
  1817. font-size: $font-size-26;
  1818. margin-top: 20rpx;
  1819. }
  1820. .productstate {
  1821. font-size: $font-size-28;
  1822. height: 44rpx;
  1823. color: #ff2a2a;
  1824. position: absolute;
  1825. bottom: 0;
  1826. left: 0;
  1827. }
  1828. }
  1829. }
  1830. }
  1831. </style>