cart.vue 49 KB

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