cart.vue 45 KB

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