cart.vue 49 KB

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