cart.vue 48 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808
  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>
  50. <view class="pros-product">
  51. <view class="producttitle" @click.stop="navToListPage(pros.productId)">
  52. {{ pros.name }}
  53. </view>
  54. <view class="productspec">规格:{{ pros.unit ? pros.unit : '' }}</view>
  55. <view
  56. class="productspec"
  57. v-if="pros.productCode != '' && pros.productCode != null"
  58. >
  59. <view bgcolor="#666666">商品编码:{{ pros.productCode }}</view>
  60. </view>
  61. <view class="productprice">
  62. <!--使用过滤器对总价改变-->
  63. <view
  64. class="price"
  65. :class="
  66. PromotionsFormat(pros.promotions) ||
  67. (pros.svipProductFlag == 1 && vipFlag == 1)
  68. ? 'disabled'
  69. : ''
  70. "
  71. >
  72. <text>¥</text>
  73. {{
  74. (PromotionsFormat(pros.promotions) || pros.svipProductFlag == 1
  75. ? pros.originalPrice
  76. : pros.price) | NumFormat
  77. }}
  78. </view>
  79. <view class="count" :class="[isshowDelbtn ? 'none' : 'show']">
  80. <text class="count-tips" v-if="pros.number < pros.min"
  81. >起订量:{{ pros.min }}</text
  82. >
  83. <text class="count-tips step" v-if="pros.isStep"
  84. >购买量必须为起订量的整数倍</text
  85. >
  86. <view class="number-box">
  87. <view
  88. class="iconfont icon-jianhao"
  89. @click="changeCountSub(item, pros)"
  90. ></view>
  91. <input
  92. class="btn-input"
  93. type="number"
  94. maxlength="6"
  95. v-model="pros.number"
  96. @blur="changeNnmber($event, item, pros)"
  97. />
  98. <view
  99. class="iconfont icon-jiahao"
  100. @click="changeCountAdd(item, pros)"
  101. ></view>
  102. </view>
  103. </view>
  104. </view>
  105. <view class="floor-item-act">
  106. <template v-if="pros.actStatus == 1 && pros.promotions">
  107. <view
  108. v-if="PromotionsFormat(pros.promotions)"
  109. class="floor-tags"
  110. @click.stop="clickPopupShow(pros, 1)"
  111. >
  112. {{ pros.promotions.name }}
  113. <text
  114. v-if="pros.promotions != null && pros.promotions.type != 3"
  115. >
  116. :¥{{
  117. pros.promotions == null
  118. ? '0.00'
  119. : pros.promotions.touchPrice | NumFormat
  120. }}
  121. </text>
  122. </view>
  123. <view
  124. v-else-if="pros.promotions.type != 3"
  125. class="floor-tags"
  126. @click.stop="clickPopupShow(pros, 2)"
  127. >
  128. {{ pros.promotions.name }}
  129. </view>
  130. </template>
  131. <template v-if="pros.actStatus == null && pros.ladderFlag == 1">
  132. <view class="floor-tags" @click.stop="clickPopupShow(pros, 2)"
  133. >阶梯价格</view
  134. >
  135. </template>
  136. <template v-if="pros.svipProductFlag == 1">
  137. <view class="svip-tags">
  138. <view class="tags" :class="{ none: vipFlag != 1 }">SVIP</view>
  139. <view class="price" v-if="isShowVipFlag(pros)">{{
  140. pros.svipPriceTag
  141. }}</view>
  142. </view>
  143. </template>
  144. </view>
  145. </view>
  146. </view>
  147. </view>
  148. </view>
  149. <view class="goods-pros-b clearfix" :class="[isshowDelbtn ? 'none' : 'show']">
  150. <view class="sum-none" v-if="item.reducedPrice > 0">
  151. <text class="money-sign">¥</text>
  152. <text class="money">{{ item.totalOriginalPrice | NumFormat }}</text>
  153. <text class="money-reduced"
  154. >减<text>¥{{ item.reducedPrice | NumFormat }}</text></text
  155. >
  156. </view>
  157. <view class="sum"
  158. >合计:<text class="money"
  159. ><text class="money-sign">¥</text>{{ item.totalPrice | NumFormat }}</text
  160. ></view
  161. >
  162. </view>
  163. </view>
  164. </view>
  165. <view class="failure-list" v-if="failureList.length > 0">
  166. <view class="failure-title">
  167. <view class="title-txt"
  168. >失效商品<text>{{ failureList.length }}件</text></view
  169. >
  170. <view class="title-btn" @click.stop="deletefailureList"
  171. ><text class="butto">清空失效商品</text></view
  172. >
  173. </view>
  174. <view class="productlist">
  175. <view class="goods-pros" v-for="(failure, failureIdx) in failureList" :key="failureIdx">
  176. <view class="goods-pros-t" @click.stop="failureToProduct(failure)">
  177. <!--选择商品-->
  178. <view
  179. class="checkbox-box"
  180. @click.stop="ischeckFailure(failure)"
  181. v-if="isshowDelbtn"
  182. >
  183. <button
  184. class="checkbox iconfont"
  185. :class="[failure.isChecked ? 'icon-yixuanze' : 'icon-weixuanze']"
  186. ></button>
  187. </view>
  188. <text class="img-tip">失效</text>
  189. <view class="pros-img">
  190. <image :src="failure.mainImage ? failure.mainImage : ''" alt="" />
  191. </view>
  192. <view class="pros-product">
  193. <view class="producttitle">{{ failure.name }}</view>
  194. <view class="productspec">规格:{{ failure.unit ? failure.unit : '' }}</view>
  195. <view class="productstate">{{ failureStateText(failure.validFlag) }}</view>
  196. </view>
  197. <view class="pros-marks" v-if="failure.isFailureLayer"></view>
  198. <!--</view>-->
  199. </view>
  200. </view>
  201. </view>
  202. </view>
  203. <!--加载loadding-->
  204. <tui-loadmore :visible="loadding" :index="3" type="black"></tui-loadmore>
  205. <tui-nomore :visible="!pullUpOn" :backgroundColor="'#ffffff'" :text="nomoreText"></tui-nomore>
  206. <!--加载loadding-->
  207. </scroll-view>
  208. <!-- 脚部菜单 -->
  209. <view class="footer" :style="{ paddingBottom: isIphoneX ? '68rpx' : '0rpx' }">
  210. <view class="footer-le">
  211. <view class="foot-check checkbox-box" @tap.stop="checkAll()">
  212. <button
  213. class="checkbox iconfont"
  214. :class="[isCheckAll ? 'icon-yixuanze' : 'icon-weixuanze']"
  215. ></button>
  216. <view class="text">全选</view>
  217. </view>
  218. <view class="sum">
  219. <view class="sum-none" v-if="reducedPrice > 0">
  220. <text class="money-sign">¥</text>
  221. <text class="money">{{ totalOriginalPrice | NumFormat }}</text>
  222. <text class="money-reduced"
  223. >减<text>¥{{ reducedPrice | NumFormat }}</text></text
  224. >
  225. </view>
  226. <view class="sum-price" :class="reducedPrice == 0 ? 'none' : ''">
  227. 总价:<text class="money-sign">¥</text
  228. ><text class="money">{{ allPrice | NumFormat }}</text>
  229. </view>
  230. </view>
  231. </view>
  232. <view v-if="!isshowDelbtn" class="footer-ri">
  233. <view class="btn hanld-btn" @tap="toConfirmation">去结算({{ allCount }})</view>
  234. </view>
  235. <view v-else class="footer-del">
  236. <view class="btn btn-cancel" @tap.stop="hideDelManage">取消</view>
  237. <view class="btn btn-confirm" @tap.stop="deleteList">删除</view>
  238. </view>
  239. </view>
  240. </view>
  241. <view v-if="isEmpty" class="cart-content empty">
  242. <view class="empty-container">
  243. <image
  244. class="empty-container-image"
  245. src="https://img.caimei365.com/group1/M00/03/71/Cmis2F3wna6AWdWzAAGlgAP0das422.png"
  246. mode="aspectFit"
  247. ></image>
  248. <text class="error-text">购物车空空如也~</text>
  249. </view>
  250. </view>
  251. </view>
  252. <!-- 促销活动弹窗 -->
  253. <activi-popup :product="handlerPros" :popupShow="popupShow"></activi-popup>
  254. <!-- 透明模态层 -->
  255. <modal-layer v-if="modallayer"></modal-layer>
  256. </view>
  257. </template>
  258. <script>
  259. import tuiSkeleton from '@/components/tui-skeleton/tui-skeleton'
  260. import tuiLoadmore from '@/components/tui-components/loadmore/loadmore'
  261. import tuiNomore from '@/components/tui-components/nomore/nomore'
  262. import activiPopup from '@/components/cm-module/productDetails/cm-activipopu'
  263. import modalLayer from '@/components/modal-layer'
  264. import { mapState, mapMutations } from 'vuex'
  265. const defaultListQuery = {
  266. clubId: 0, // 机构Id
  267. serviceProviderId: 0, //协销Id
  268. againBuyProductIds: '', // 再次购买商品ids
  269. pageNum: 1, // 页码
  270. pageSize: 10 // 条数
  271. }
  272. export default {
  273. components: {
  274. tuiSkeleton,
  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. image {
  1265. width: 210rpx;
  1266. height: 210rpx;
  1267. border-radius: 10rpx;
  1268. }
  1269. }
  1270. }
  1271. .goods-pros-b {
  1272. width: 100%;
  1273. height: auto;
  1274. padding: 0 0 24rpx 0;
  1275. box-sizing: border-box;
  1276. &.show {
  1277. display: block;
  1278. }
  1279. &.none {
  1280. display: none;
  1281. }
  1282. .sum-none {
  1283. width: 100%;
  1284. height: 48rpx;
  1285. line-height: 48rpx;
  1286. color: $text-color;
  1287. float: left;
  1288. text-align: right;
  1289. .money {
  1290. font-size: $font-size-26;
  1291. color: #999999;
  1292. text-decoration: line-through;
  1293. }
  1294. .money-sign {
  1295. font-size: $font-size-26;
  1296. color: #999999;
  1297. text-decoration: line-through;
  1298. }
  1299. .money-reduced {
  1300. margin-left: 10rpx;
  1301. font-size: $font-size-26;
  1302. color: $color-system;
  1303. .iconfont {
  1304. font-size: $font-size-34;
  1305. }
  1306. }
  1307. }
  1308. .sum {
  1309. width: 100%;
  1310. height: 40rpx;
  1311. font-size: $font-size-28;
  1312. line-height: 40rpx;
  1313. color: $text-color;
  1314. float: left;
  1315. display: flex;
  1316. justify-content: flex-end;
  1317. .money {
  1318. color: #ff2a2a;
  1319. font-size: $font-size-28;
  1320. }
  1321. .money-sign {
  1322. font-size: $font-size-24;
  1323. color: #ff2a2a;
  1324. }
  1325. }
  1326. }
  1327. .pros-product {
  1328. width: 386rpx;
  1329. height: 100%;
  1330. line-height: 36rpx;
  1331. font-size: $font-size-26;
  1332. position: relative;
  1333. .producttitle {
  1334. width: 100%;
  1335. display: inline-block;
  1336. height: auto;
  1337. text-overflow: ellipsis;
  1338. display: -webkit-box;
  1339. word-break: break-all;
  1340. -webkit-box-orient: vertical;
  1341. -webkit-line-clamp: 2;
  1342. overflow: hidden;
  1343. margin-bottom: 8rpx;
  1344. .no-text {
  1345. display: inline-block;
  1346. height: 36rpx;
  1347. padding: 0 12rpx;
  1348. line-height: 36rpx;
  1349. background: linear-gradient(315deg, rgba(231, 0, 0, 1) 0%, rgba(255, 104, 1, 1) 100%);
  1350. border-radius: 18rpx;
  1351. text-align: center;
  1352. color: #ffffff;
  1353. font-size: $font-size-24;
  1354. margin-right: 24rpx;
  1355. }
  1356. }
  1357. .productspec {
  1358. height: 36rpx;
  1359. color: #999999;
  1360. text-overflow: ellipsis;
  1361. display: -webkit-box;
  1362. word-break: break-all;
  1363. -webkit-box-orient: vertical;
  1364. -webkit-line-clamp: 2;
  1365. overflow: hidden;
  1366. margin-top: 10rpx;
  1367. }
  1368. .productCode {
  1369. color: #666666;
  1370. }
  1371. .productprice {
  1372. width: 100%;
  1373. height: 48rpx;
  1374. margin: 10rpx 0 0 0;
  1375. .price {
  1376. line-height: 48rpx;
  1377. font-size: $font-size-28;
  1378. width: 48%;
  1379. color: #ff2a2a;
  1380. float: left;
  1381. &.disabled {
  1382. color: #999999;
  1383. text-decoration: line-through;
  1384. }
  1385. .money-sign {
  1386. font-size: $font-size-24;
  1387. color: #ff2a2a;
  1388. }
  1389. }
  1390. .count {
  1391. height: 100%;
  1392. float: right;
  1393. position: relative;
  1394. &.show {
  1395. display: block;
  1396. }
  1397. &.none {
  1398. display: none;
  1399. }
  1400. .count-tips {
  1401. width: auto;
  1402. display: inline-block;
  1403. padding: 0 15rpx;
  1404. line-height: 44rpx;
  1405. height: 44rpx;
  1406. border-radius: 22rpx;
  1407. background: $btn-confirm;
  1408. font-size: $font-size-24;
  1409. text-align: center;
  1410. color: #ffffff;
  1411. position: absolute;
  1412. top: -60rpx;
  1413. left: -5rpx;
  1414. z-index: 5;
  1415. &.step {
  1416. left: -217rpx;
  1417. }
  1418. &::before {
  1419. content: '';
  1420. position: absolute;
  1421. bottom: -30rpx;
  1422. right: 15rpx;
  1423. z-index: 1;
  1424. width: 0;
  1425. height: 0;
  1426. border-width: 18rpx;
  1427. border-style: solid;
  1428. border-color: $color-system transparent transparent transparent;
  1429. }
  1430. }
  1431. .number-box {
  1432. display: flex;
  1433. justify-content: center;
  1434. align-items: center;
  1435. border: 2rpx solid #ffe6dc;
  1436. border-radius: 30rpx;
  1437. height: 48rpx;
  1438. .iconfont {
  1439. font-size: $font-size-24;
  1440. padding: 0 18rpx;
  1441. color: #999999;
  1442. text-align: center;
  1443. line-height: 48rpx;
  1444. font-weight: bold;
  1445. background: #fef6f3;
  1446. &.icon-jianhao {
  1447. border-radius: 30rpx 0 0 30rpx;
  1448. }
  1449. &.icon-jiahao {
  1450. border-radius: 0 30rpx 30rpx 0;
  1451. }
  1452. }
  1453. .btn-input {
  1454. width: 62rpx;
  1455. height: 44rpx;
  1456. line-height: 44rpx;
  1457. border-radius: 4rpx;
  1458. text-align: center;
  1459. font-size: $font-size-24;
  1460. border-bottom: 2rpx solid #ffe6dc;
  1461. border-top: 2rpx solid #ffe6dc;
  1462. }
  1463. }
  1464. .uni-numbox {
  1465. position: absolute;
  1466. left: 45rpx;
  1467. bottom: 0;
  1468. .uni-numbox-minus,
  1469. .uni-numbox-plus {
  1470. width: 50rpx;
  1471. line-height: 40rpx;
  1472. }
  1473. .uni-numbox-value {
  1474. font-size: $font-size-28;
  1475. width: 60rpx;
  1476. }
  1477. }
  1478. }
  1479. }
  1480. .floor-item-act {
  1481. width: 100%;
  1482. height: 56rpx;
  1483. text-align: center;
  1484. box-sizing: border-box;
  1485. float: left;
  1486. padding: 0 0 10rpx 0;
  1487. margin-left: 10rpx;
  1488. }
  1489. }
  1490. }
  1491. .footer {
  1492. width: 100%;
  1493. background-color: #ffffff;
  1494. height: 110rpx;
  1495. position: fixed;
  1496. bottom: 0rpx;
  1497. z-index: 100;
  1498. .footer-le {
  1499. width: 510rpx;
  1500. height: 100%;
  1501. padding: 0 24rpx;
  1502. float: left;
  1503. .foot-check {
  1504. width: 100rpx;
  1505. float: left;
  1506. line-height: 110rpx;
  1507. font-size: $font-size-24;
  1508. .checkbox {
  1509. width: 40rpx;
  1510. text-align: center;
  1511. }
  1512. .text {
  1513. width: 60rpx;
  1514. float: right;
  1515. }
  1516. }
  1517. .sum {
  1518. width: 380rpx;
  1519. height: 110rpx;
  1520. float: right;
  1521. box-sizing: border-box;
  1522. padding: 10rpx;
  1523. .sum-none {
  1524. width: 100%;
  1525. height: 45rpx;
  1526. line-height: 45rpx;
  1527. color: $text-color;
  1528. float: left;
  1529. text-align: right;
  1530. .money {
  1531. font-size: $font-size-24;
  1532. color: #999999;
  1533. text-decoration: line-through;
  1534. }
  1535. .money-sign {
  1536. font-size: $font-size-24;
  1537. color: #999999;
  1538. text-decoration: line-through;
  1539. }
  1540. .money-reduced {
  1541. margin-left: 10rpx;
  1542. font-size: $font-size-24;
  1543. color: $color-system;
  1544. }
  1545. }
  1546. .sum-price {
  1547. text-align: right;
  1548. width: 100%;
  1549. height: 45rpx;
  1550. line-height: 45rpx;
  1551. font-size: $font-size-30;
  1552. color: $text-color;
  1553. float: left;
  1554. font-weight: normal;
  1555. &.none {
  1556. height: 90rpx;
  1557. line-height: 90rpx;
  1558. }
  1559. .money {
  1560. color: #ff2a2a;
  1561. }
  1562. .money-sign {
  1563. font-size: $font-size-24;
  1564. color: #ff2a2a;
  1565. }
  1566. }
  1567. }
  1568. }
  1569. .footer-ri {
  1570. width: 180rpx;
  1571. height: 84rpx;
  1572. background: linear-gradient(135deg, rgba(242, 143, 49, 1) 0%, rgba(225, 86, 22, 1) 100%);
  1573. float: right;
  1574. display: flex;
  1575. justify-content: space-between;
  1576. align-items: center;
  1577. z-index: 999;
  1578. border-radius: 49rpx;
  1579. margin-top: 15rpx;
  1580. margin-right: 10rpx;
  1581. &.none {
  1582. display: none;
  1583. }
  1584. .btn {
  1585. width: 200rpx;
  1586. height: 100%;
  1587. font-size: $font-size-28;
  1588. line-height: 110rpx;
  1589. color: #ffffff;
  1590. display: flex;
  1591. justify-content: center;
  1592. align-items: center;
  1593. }
  1594. }
  1595. .footer-del {
  1596. width: 400rpx;
  1597. height: 110rpx;
  1598. position: absolute;
  1599. padding-left: 200rpx;
  1600. background: #ffffff;
  1601. right: 0;
  1602. top: 0;
  1603. z-index: 1000;
  1604. &.show {
  1605. animation: showDelbtn 0s linear both;
  1606. }
  1607. &.none {
  1608. animation: hideDelbtn 0s linear both;
  1609. }
  1610. .btn {
  1611. width: 50%;
  1612. height: 100%;
  1613. line-height: 110rpx;
  1614. font-size: $font-size-28;
  1615. color: #ffffff;
  1616. text-align: center;
  1617. float: left;
  1618. }
  1619. .btn.btn-cancel {
  1620. background: #eec1ab;
  1621. }
  1622. .btn.btn-confirm {
  1623. background: #ff2a2a;
  1624. }
  1625. @keyframes showDelbtn {
  1626. 0% {
  1627. transform: translateX(0);
  1628. }
  1629. 100% {
  1630. transform: translateX(-100%);
  1631. }
  1632. }
  1633. @keyframes hideDelbtn {
  1634. 0% {
  1635. transform: translateX(-100%);
  1636. }
  1637. 100% {
  1638. transform: translateX(0);
  1639. }
  1640. }
  1641. }
  1642. }
  1643. .failure-list {
  1644. width: 702rpx;
  1645. height: auto;
  1646. padding: 0 24rpx;
  1647. margin-top: 20rpx;
  1648. background: #ffffff;
  1649. .failure-title {
  1650. width: 100%;
  1651. height: 82rpx;
  1652. line-height: 82rpx;
  1653. font-size: $font-size-28;
  1654. .title-txt {
  1655. float: left;
  1656. color: #666666;
  1657. text-align: left;
  1658. }
  1659. .title-btn {
  1660. float: right;
  1661. color: $color-system;
  1662. text-align: right;
  1663. line-height: 80rpx;
  1664. .butto {
  1665. display: inline-block;
  1666. padding: 0 15rpx;
  1667. font-size: $font-size-26;
  1668. height: 50rpx;
  1669. line-height: 50rpx;
  1670. border-radius: 30rpx;
  1671. background: #ffffff;
  1672. // border: 1px solid #C9C9C9;
  1673. // color: #999999;
  1674. margin-top: 15rpx;
  1675. }
  1676. }
  1677. }
  1678. .productlist {
  1679. padding-top: 10rpx;
  1680. .goods-pros {
  1681. width: 100%;
  1682. height: auto;
  1683. padding: 20rpx 0;
  1684. }
  1685. .goods-pros-t {
  1686. display: flex;
  1687. align-items: center;
  1688. width: 100%;
  1689. height: 210rpx;
  1690. position: relative;
  1691. .img-tip {
  1692. display: block;
  1693. width: 72rpx;
  1694. height: 36rpx;
  1695. line-height: 36rpx;
  1696. font-size: $font-size-24;
  1697. text-align: center;
  1698. color: #ffffff;
  1699. border-radius: 24rpx;
  1700. background: rgba(51, 51, 51, 0.3);
  1701. // position: absolute;
  1702. // left: 0;
  1703. // top: 0;
  1704. }
  1705. .checkbox-box {
  1706. padding: 10rpx;
  1707. }
  1708. .pros-img {
  1709. width: 180rpx;
  1710. height: 100%;
  1711. border-radius: 10rpx;
  1712. margin: 0 20rpx;
  1713. border: 1px solid #f3f3f3;
  1714. position: relative;
  1715. image {
  1716. width: 100%;
  1717. height: 100%;
  1718. border-radius: 10rpx;
  1719. }
  1720. }
  1721. .pros-marks {
  1722. width: 750rpx;
  1723. height: 250rpx;
  1724. z-index: 90;
  1725. background: rgba(0, 0, 0, 0.05);
  1726. position: absolute;
  1727. left: -20rpx;
  1728. top: -20rpx;
  1729. }
  1730. }
  1731. .goods-pros-b {
  1732. width: 622rpx;
  1733. margin-left: 84rpx;
  1734. height: 40rpx;
  1735. padding: 0 0 26rpx 0;
  1736. // border-top: 1px solid #EBEBEB;
  1737. &.show {
  1738. display: block;
  1739. }
  1740. &.none {
  1741. display: none;
  1742. }
  1743. .sum {
  1744. font-size: $font-size-28;
  1745. line-height: 40rpx;
  1746. color: $text-color;
  1747. display: flex;
  1748. justify-content: flex-end;
  1749. .money {
  1750. color: #ff2a2a;
  1751. font-size: $font-size-28;
  1752. }
  1753. .money-sign {
  1754. font-size: $font-size-24;
  1755. color: #ff2a2a;
  1756. }
  1757. }
  1758. }
  1759. .pros-product {
  1760. width: 402rpx;
  1761. height: 100%;
  1762. line-height: 36rpx;
  1763. font-size: $font-size-28;
  1764. position: relative;
  1765. .producttitle {
  1766. width: 100%;
  1767. display: inline-block;
  1768. height: auto;
  1769. text-overflow: ellipsis;
  1770. display: -webkit-box;
  1771. word-break: break-all;
  1772. -webkit-box-orient: vertical;
  1773. -webkit-line-clamp: 2;
  1774. overflow: hidden;
  1775. margin-bottom: 8rpx;
  1776. .no-text {
  1777. display: inline-block;
  1778. height: 36rpx;
  1779. padding: 0 12rpx;
  1780. line-height: 36rpx;
  1781. background: linear-gradient(315deg, rgba(231, 0, 0, 1) 0%, rgba(255, 104, 1, 1) 100%);
  1782. border-radius: 18rpx;
  1783. text-align: center;
  1784. color: #ffffff;
  1785. font-size: $font-size-28;
  1786. margin-right: 24rpx;
  1787. }
  1788. }
  1789. .productspec {
  1790. height: 36rpx;
  1791. color: #999999;
  1792. font-size: $font-size-26;
  1793. margin-top: 20rpx;
  1794. }
  1795. .productstate {
  1796. font-size: $font-size-28;
  1797. height: 44rpx;
  1798. color: #ff2a2a;
  1799. position: absolute;
  1800. bottom: 0;
  1801. left: 0;
  1802. }
  1803. }
  1804. }
  1805. }
  1806. </style>