cart.vue 46 KB

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