index.vue 46 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657
  1. <template>
  2. <view class="content">
  3. <!-- 购物车 -->
  4. <view v-if="dataList.length !== 0">
  5. <view class="cart-bg">
  6. <view class="cart-num-box">
  7. <image src="https://ceres.zkthink.com/static/images/logoTop.png"></image>
  8. <text class="btn-box"
  9. @click="btnTypeClick(1)"
  10. v-if="btnType == 0">管理
  11. </text>
  12. <text class="btn-box"
  13. @click="btnTypeClick(0)"
  14. v-if="btnType == 1">完成
  15. </text>
  16. </view>
  17. <view>
  18. <text class="num-box">共
  19. <text class="num">{{ allNum }}</text>
  20. 件宝贝
  21. </text>
  22. </view>
  23. </view>
  24. <view class="cart-list-box">
  25. <view class="itemBox"
  26. v-for="(item, index) in dataList"
  27. :key="item.shopId">
  28. <view class="item"
  29. v-if="item.skus.length !== 0">
  30. <view class="shop-box">
  31. <image mode="aspectFill"
  32. v-if="item.selected === 1"
  33. src="https://ceres.zkthink.com/static/images/selectActive.png"
  34. class="cart-select-img"
  35. @click.stop="updateShopSel(index,0)"></image>
  36. <image mode="aspectFill"
  37. v-else
  38. src="https://ceres.zkthink.com/static/images/selectEmpty.png"
  39. class="cart-select-img"
  40. @click.stop="updateShopSel(index,1)"></image>
  41. <view class="shop-name-box"
  42. @click="goStore(index)">
  43. <image src="https://ceres.zkthink.com/static/images/orderStoreIcon.png"
  44. class="shop-img"></image>
  45. <text class="shop-name">{{ item.shopName }}</text>
  46. <image src="https://ceres.zkthink.com/static/images/arrowRight.png"
  47. class="arrow-right-img"></image>
  48. </view>
  49. </view>
  50. <view class="rulesBox flex-items"
  51. v-if="item.currentRules.number">
  52. <image class="mar-right-20"
  53. src="https://ceres.zkthink.com/static/images/zuheIcon.png"></image>
  54. <view class="fs24 font-color-C83732">
  55. 已满足【{{ item.currentRules.price }}元任选{{ item.currentRules.number }}件】!
  56. </view>
  57. </view>
  58. <view v-for="(skuItem, cIndex) in dataList[index].skus"
  59. class="product-list-box">
  60. <view class="pro-item"
  61. @click="goodsDateils(item.shopId,skuItem.productId,skuItem.skuId)">
  62. <image mode="aspectFill"
  63. v-if="skuItem.selected == 1"
  64. src="https://ceres.zkthink.com/static/images/selectActive.png"
  65. @click.stop="cartItemSel(index,cIndex,0)"
  66. class="cart-select-img"></image>
  67. <image mode="aspectFill"
  68. v-else
  69. src="https://ceres.zkthink.com/static/images/selectEmpty.png"
  70. @click.stop="cartItemSel(index,cIndex,1)"
  71. class="cart-select-img"></image>
  72. <view class="pro-r">
  73. <image :src="skuItem.image"
  74. class="pro-img default-img"></image>
  75. <view class="pro-r-r">
  76. <view class="pro-name">{{ skuItem.productName }}</view>
  77. <view class="sku-box">
  78. <text v-if="skuItem.value">{{ skuItem.value }}</text>
  79. <text v-else>默认规格</text>
  80. <!-- <text></text> -->
  81. </view>
  82. <view class="pro-price-num-box">
  83. <view class="pro-price-box">
  84. <text class="fuhao">¥</text>
  85. <text>{{ skuItem.price }}</text>
  86. </view>
  87. <view class="pro-num-box">
  88. <text class="num-btn r"
  89. @click.stop="numSub(index,cIndex)">-
  90. </text>
  91. <text class="num">{{ skuItem.number }}</text>
  92. <text class="num-btn l"
  93. @click.stop="numAdd(index,cIndex)">+
  94. </text>
  95. </view>
  96. </view>
  97. </view>
  98. </view>
  99. </view>
  100. </view>
  101. </view>
  102. </view>
  103. </view>
  104. <!-- 商品详情 -->
  105. <u-popup v-model="goodsDetailShowFlag"
  106. mode="bottom"
  107. border-radius="14">
  108. <view class="goosDetailshow-box">
  109. <view class="detailImg-box flex-row-plus">
  110. <image class="detailImg"
  111. :src="selectedSku.image"></image>
  112. <view class="flex-column-plus mar-left-40">
  113. <view class="font-color-C5AA7B">
  114. <label class="fs24">¥</label>
  115. <label class="fs36 mar-left-10"
  116. v-text="selectedSku.activityType === 1 && btnType === 4 ? selectedSku.originalPrice : selectedSku.price"></label>
  117. </view>
  118. <label class="fs24 font-color-999 mar-top-20">库存 {{ selectedSku.stockNumber }} 件</label>
  119. <label class="fs24 mar-top-20">已选</label>
  120. </view>
  121. </view>
  122. <view class="color-box flex-column-plus">
  123. <view v-for="(attritem,index) in productData.names"
  124. :key="index"
  125. class="skuStyle">
  126. <label class="fs24 font-color-999">{{ attritem.skuName }}</label>
  127. <view class="colorName-box">
  128. <view class="pad-bot-30"
  129. v-for="(attrRes, resIndex) in attritem.values"
  130. :key="resIndex">
  131. <view class="colorName"
  132. :class="{'colorName-on' : selectedAttr[attritem.nameCode] == attrRes.valueCode}"
  133. @click="nameCodeValueCodeClick(attritem.nameCode, attrRes.valueCode, true)">
  134. {{ attrRes.skuValue }}
  135. </view>
  136. </view>
  137. </view>
  138. </view>
  139. </view>
  140. <view class="goodsNum-box flex-row-plus flex-sp-between"
  141. :class="{'bottom-line' :supportHuabei}">
  142. <label class="font-color-999 fs24">数量</label>
  143. <view class="goodsNum">
  144. <text class="subtract"
  145. @click="updateNumSub()">-
  146. </text>
  147. <text class="goodsNumber"
  148. v-model="buyNum">{{ buyNum }}
  149. </text>
  150. <text class="add"
  151. @click.stop="updateNumAdd()">+
  152. </text>
  153. </view>
  154. </view>
  155. <view class="goosDetailbut-box flex-items-plus">
  156. <button type="default"
  157. @click="goodsDateils(shopId,productId,skuId)">查看详情
  158. </button>
  159. <button type="default"
  160. class="submitBtn"
  161. @click="submitBtn()">确认
  162. </button>
  163. </view>
  164. </view>
  165. </u-popup>
  166. <!-- #ifdef H5 -->
  167. <view class="cart-bottom-box-h5">
  168. <!-- #endif -->
  169. <!-- #ifndef H5 -->
  170. <view class="cart-bottom-box-app">
  171. <!-- #endif -->
  172. <view class="cart-bottom">
  173. <view class="left">
  174. <image mode="aspectFill"
  175. v-if="isAllCheck"
  176. src="https://ceres.zkthink.com/static/images/selectActive.png"
  177. class="cart-select-img"
  178. @click="allSel(0)"></image>
  179. <image mode="aspectFill"
  180. v-else
  181. src="https://ceres.zkthink.com/static/images/selectEmpty.png"
  182. class="cart-select-img"
  183. @click="allSel(1)"></image>
  184. <text>全选</text>
  185. </view>
  186. <view class="right"
  187. v-if="btnType == 0">
  188. <view class="price-box">
  189. <text>合计:</text>
  190. <text class="price">¥{{ checkMoney }}</text>
  191. </view>
  192. <view class="btn-confirm"
  193. @click="settlementTap">结算({{ checkNum }})
  194. </view>
  195. </view>
  196. <view class="right"
  197. v-if="btnType == 1">
  198. <view class="btn-delete"
  199. @click="cartDel">删除
  200. </view>
  201. </view>
  202. </view>
  203. </view>
  204. </view>
  205. <!-- 购物车为空 -->
  206. <view v-if="isEmpty"
  207. class="emptyCart-box flex-items-plus flex-column">
  208. <image class="emptyCart-img"
  209. src="https://ceres.zkthink.com/static/images/cartEmpty.png"></image>
  210. <label class="font-color-999 fs26 mar-top-30">你的购物车还没有宝贝哦</label>
  211. <label class="font-color-999 fs26 mar-top-10">快去首页选一个吧~</label>
  212. <view class="goToShopping"
  213. @click="goToShopping">去购物
  214. </view>
  215. </view>
  216. <!-- 热门推荐 -->
  217. <HotTemplate/>
  218. <view style="width: 100%;height: 100rpx;background-color:#efefef;"></view>
  219. <!-- 删除确认弹窗 -->
  220. <tui-modal :show="cardModal"
  221. :custom="true"
  222. :fadein="true">
  223. <view class="Put-box1">
  224. <view class="text-align fs34 fs-bold">
  225. 温馨提示
  226. </view>
  227. <view class="mar-top-40 text-align">
  228. 您确定删除选中的商品吗?
  229. </view>
  230. <view class="flex-display flex-sp-between">
  231. <view class="btn"
  232. @click="cardModal = false">
  233. 点错了
  234. </view>
  235. <view class="btn submit"
  236. @click="doDelete">
  237. 确认删除
  238. </view>
  239. </view>
  240. </view>
  241. </tui-modal>
  242. </view>
  243. </view>
  244. </template>
  245. <script>
  246. import tuiModal from "@/components/modal/modal";
  247. import HotTemplate from '@/components/hoteRecommed/index.vue'
  248. import api from "../../../components/canvasShow/config/api";
  249. const NET = require('../../../utils/request')
  250. const API = require('../../../config/api')
  251. export default {
  252. components: {
  253. tuiModal,
  254. HotTemplate
  255. },
  256. data() {
  257. return {
  258. goodsDetailShowFlag: false,
  259. OriginalSelectedSku: {},
  260. selectedSku: {},
  261. productData: [],
  262. shopId: 0,
  263. productId: 0,
  264. skuId: 0,
  265. selectedAttr: {},
  266. supportHuabei: false,
  267. title: 'Hello',
  268. btnType: 0,
  269. dataList: [],
  270. goosDetailshowFlag: false,
  271. colorActiveId: 1,
  272. colorList: [{
  273. id: 1,
  274. color: '复古蓝色'
  275. }, {
  276. id: 2,
  277. color: '马卡龙粉色'
  278. }],
  279. modelNumActiveId: 1,
  280. modelNumList: [{
  281. id: 1,
  282. modelNum: '小号'
  283. }, {
  284. id: 2,
  285. modelNum: '中号'
  286. }, {
  287. id: 3,
  288. modelNum: '大号'
  289. }],
  290. skuItemList: [],
  291. buyNum: 1,
  292. allNum: 0,
  293. checkNum: 0,
  294. checkMoney: 0,
  295. isAllCheck: true,
  296. skuProdList: {},
  297. item: {},
  298. cardModal: false,
  299. isEmpty: false
  300. }
  301. },
  302. computed: {
  303. // 计算显示tabBar购物车数量
  304. getCartNum() {
  305. let cartNum = 0
  306. this.updateMoneyAndNum()
  307. cartNum = this.allNum
  308. if (cartNum > 0) {
  309. uni.setTabBarBadge({
  310. index: 2,
  311. text: cartNum.toString()
  312. })
  313. } else {
  314. uni.removeTabBarBadge({
  315. index: 2
  316. })
  317. }
  318. uni.setStorageSync('allCartNum', cartNum)
  319. console.log(uni.getStorageSync('allCartNum'), '1111')
  320. }
  321. },
  322. onLoad() {
  323. },
  324. onShow() {
  325. //判断是否登录
  326. /* let item = {}
  327. if(uni.getStorageSync('storage_key')){
  328. item = uni.getStorageSync('storage_key');
  329. }
  330. console.dir(item) */
  331. /* if(JSON.stringify(item) == '{}'){
  332. uni.navigateTo({
  333. url:'../../../pages_category_page2/userModule/login'
  334. })
  335. }else{ */
  336. this.isEmpty = false
  337. this.dataList = []
  338. this.getDataList()
  339. /* } */
  340. },
  341. methods: {
  342. // 提交更换商品规格
  343. submitBtn() {
  344. console.log(this.selectedSku.skuId, 'this.selectedSku.skuId')
  345. console.log(this.skuId, 'this.skuId')
  346. NET.request(API.UpdateSkuCart, {
  347. skuId: this.skuId,
  348. newSkuId: this.selectedSku.skuId,
  349. number: this.buyNum
  350. },
  351. "POST").then(res => {
  352. this.goodsDetailShowFlag = false
  353. this.getDataList()
  354. })
  355. },
  356. // 购物车修改属性样式时:数量减
  357. updateNumSub() {
  358. if (this.buyNum > 1) {
  359. this.buyNum = this.buyNum - 1
  360. } else {
  361. uni.showToast({
  362. title: '亲!至少一件哦!',
  363. icon: "none"
  364. })
  365. }
  366. },
  367. // 获取匹配组合定价价格
  368. getData(item) {
  369. return new Promise(((resolve, reject) => {
  370. if (item.ids) {
  371. NET.request(api.getPrices, {
  372. shopId: item.shopId,
  373. ids: item.ids,
  374. page: 1,
  375. pageSize: 10
  376. }, 'GET').then(res => {
  377. resolve(res)
  378. })
  379. } else {
  380. resolve([])
  381. }
  382. }))
  383. },
  384. // 购物车修改属性样式时:数量加
  385. updateNumAdd() {
  386. if (this.buyNum < this.selectedSku.stockNumber) {
  387. this.buyNum = this.buyNum + 1
  388. } else {
  389. uni.showToast({
  390. title: '库存不足!',
  391. icon: "none"
  392. })
  393. }
  394. },
  395. //获取商品详情
  396. queryProductDetail() {
  397. uni.showLoading({
  398. mask: true,
  399. title: '加载中...'
  400. })
  401. NET.request(API.QueryProductDetail, {
  402. shopId: this.shopId,
  403. productId: this.productId,
  404. skuId: this.skuId,
  405. terminal: 1
  406. },
  407. "GET").then(res => {
  408. uni.hideLoading()
  409. this.productData = res.data
  410. this.markTools = res.data.markTools //平台优惠券
  411. this.shopMarkTools = res.data.shopMarkTools //店铺优惠券
  412. //如果是单款式商品,需要特殊处理productData.names
  413. const mapKeys = Object.keys(this.productData.map)
  414. if (mapKeys.length === 1 && mapKeys[0] === '单款项') {
  415. this.productData.names[0].values.push({
  416. skuValue: '单款项',
  417. valueCode: '单款项'
  418. })
  419. }
  420. //如果sku的图像为空,设置为商品的图像
  421. for (var key in this.productData.map) {
  422. let skuImage = this.productData.map[key].image
  423. if (!skuImage) {
  424. this.productData.map[key].image = this.productData.images[0]
  425. }
  426. }
  427. //评价
  428. this.commentList = res.data.comments
  429. this.commentListLength = this.commentList.length
  430. this.sellDescList = res.data.text.replace(/\<img/gi,
  431. '<img style="max-width:100%;height:auto" ')
  432. this.couponListLength = res.data.couponImages.length
  433. this.showVOList = res.data.couponImages
  434. this.couponList = res.data.markTools
  435. //渲染商详之后,如果参数传了skuId,则选中该skuId,否则选中第一个规格
  436. if (this.skuId) {
  437. this.selectBySkuId(this.skuId)
  438. console.log(this.skuId, 'this.skuId2222')
  439. } else {
  440. for (var attr in this.productData.names) {
  441. this.nameCodeValueCodeClick(attr.nameCode, attr.values[0].valueCode, true)
  442. }
  443. }
  444. this.beginTimer();
  445. }).catch(res => {
  446. uni.hideLoading()
  447. })
  448. },
  449. selectBySkuId(skuId) {
  450. if (skuId) {
  451. let mapinfo = this.productData.map
  452. for (var key in mapinfo) {
  453. if (parseInt(mapinfo[key].skuId) === parseInt(skuId)) {
  454. this.selectedSku = mapinfo[key]
  455. // 选中sku对应的规格
  456. const valueCodeList = key.split(',')
  457. this.productData.names.forEach(attr => {
  458. for (var index in attr.values) {
  459. let valueCode = attr.values[index].valueCode
  460. if (valueCodeList.includes(valueCode)) {
  461. this.nameCodeValueCodeClick(attr.nameCode, valueCode, false)
  462. break
  463. }
  464. }
  465. })
  466. break
  467. }
  468. }
  469. }
  470. },
  471. nameCodeValueCodeClick(nameCode, valueCode, reSelectSku) {
  472. this.selectedAttr[nameCode] = valueCode
  473. if (reSelectSku) {
  474. let attrList = []
  475. for (var key in this.selectedAttr) {
  476. attrList.push(this.selectedAttr[key])
  477. }
  478. const attrkey = attrList.join(',')
  479. let mapinfo = this.productData.map
  480. for (var key in mapinfo) {
  481. if (attrkey === key) {
  482. this.selectedSku = mapinfo[key]
  483. }
  484. }
  485. }
  486. // 选中sku之后,做一些相应的操作
  487. // this.selectSkuPostProcessor()
  488. this.$forceUpdate(); // 重绘
  489. },
  490. selectSkuPostProcessor() {
  491. const ifEnable = this.selectedSku.ifEnable
  492. if (this.selectedSku.activityType === 1 && ifEnable === 0) {
  493. this.topThreeCollageOrders = this.selectedSku.collageOrders.slice(0, 3)
  494. }
  495. if ([1, 2, 3, 4, 5].includes(this.selectedSku.activityType) && ifEnable === 0) {
  496. this.dateformat(this.selectedSku.endTime)
  497. this.countDown();
  498. }
  499. this.timeActivetype = ifEnable === 0;
  500. this.shopDiscountId = this.selectedSku.shopDiscountId
  501. this.shopSeckillId = this.selectedSku.shopSeckillId
  502. },
  503. // 更换商品样式
  504. changeSkuItemValue(skuItem, shopId) {
  505. this.OriginalSelectedSku = skuItem
  506. this.shopId = shopId
  507. this.productId = skuItem.productId
  508. this.skuId = skuItem.skuId
  509. this.buyNum = this.OriginalSelectedSku.number
  510. this.queryProductDetail()
  511. setTimeout(() => {
  512. this.goodsDetailShowFlag = true
  513. }, 1000)
  514. },
  515. //逛店铺
  516. goStore(index) {
  517. uni.navigateTo({
  518. url: '../../../pages_category_page1/store/index?storeId=' + this.dataList[index].shopId
  519. })
  520. },
  521. //商品详情
  522. goodsDateils(shopId, productId, skuId) {
  523. uni.navigateTo({
  524. url: '../../../pages_category_page1/goodsModule/goodsDetails?shopId=' + shopId +
  525. '&productId=' + productId + '&skuId=' + skuId
  526. })
  527. },
  528. // 去首页
  529. goToShopping() {
  530. uni.switchTab({
  531. url: '../../../pages/tabbar/index/index'
  532. })
  533. },
  534. btnTypeClick(type) {
  535. this.btnType = type
  536. },
  537. getDataList() {
  538. uni.showLoading({
  539. mask: true,
  540. title: '加载中...',
  541. })
  542. NET.request(API.ShoppingCart, {}, 'GET').then(res => {
  543. uni.hideLoading()
  544. this.dataList = res.data
  545. this.allNum = this.dataList.length
  546. if (this.dataList.length === 0) {
  547. this.isEmpty = true
  548. uni.setStorageSync('allCartNum', 0)
  549. uni.removeTabBarBadge({
  550. index: 2
  551. })
  552. }
  553. let recheck = false
  554. this.dataList.forEach((item, index) => {
  555. item['currentIds'] = []
  556. item['priceNumber'] = 0
  557. item['rules'] = []
  558. item['currentRules'] = {}
  559. item['ids'] = 0
  560. for (let i = item.skus.length - 1; i >= 0; i--) {
  561. if (item.skus[i].shelveState === 0) {
  562. item.skus.splice(i, 1)
  563. if (item.skus.length === 0) {
  564. recheck = true
  565. }
  566. } else {
  567. if (item.skus[i].activityType === 6 && item.skus[i].selected === 1) {
  568. item.currentIds.push(item.skus[i].priceId)
  569. item.priceNumber += item.skus[i].number
  570. }
  571. }
  572. }
  573. for (let i = 0; i < item.skus.length; i++) {
  574. if (item.skus[i].activityType === 6) {
  575. item.ids = item.skus[i].priceId
  576. break
  577. }
  578. }
  579. this.getData(item).then(res => {
  580. let rules = []
  581. rules = res.data
  582. this.dataList[index].rules = rules ? rules[0].rules : {}
  583. for (let i = 0; i < this.dataList[index].rules.length; i++) {
  584. // console.log(this.dataList[index].rules[i].number, this.dataList[index].priceNumber, 'fsdfsdfsdfs')
  585. if (this.dataList[index].rules[i].number === this.dataList[index].priceNumber) {
  586. this.dataList[index].currentRules = this.dataList[index].rules[i]
  587. console.log(this.dataList[index].currentRules, '==', this.dataList[index].rules[i])
  588. this.$forceUpdate()
  589. break
  590. } else if (this.dataList[index].rules[this.dataList[index].rules.length - 1].number < this.dataList[index].priceNumber) {
  591. this.dataList[index].currentRules = this.dataList[index].rules[this.dataList[index].rules.length - 1]
  592. this.$forceUpdate()
  593. break
  594. }
  595. }
  596. // 重新检查是不是全为空
  597. if (recheck) {
  598. let isEmpty = true
  599. this.dataList.forEach((item, index) => {
  600. if (item.skus.length !== 0) {
  601. isEmpty = false
  602. }
  603. })
  604. this.isEmpty = isEmpty
  605. }
  606. this.updateMoneyAndNum()
  607. })
  608. })
  609. }).catch(res => {
  610. uni.hideLoading()
  611. })
  612. },
  613. // 数量减
  614. numSub(index, cIndex) {
  615. this.dataList[index].priceNumber = 0
  616. if (this.dataList[index].skus[cIndex].number > 1) {
  617. this.dataList[index].skus[cIndex].number = this.dataList[index].skus[cIndex].number - 1
  618. this.dataList[index].priceNumber = 0
  619. this.priceFn(index)
  620. this.updateCart(this.dataList[index].skus[cIndex].skuId, this.dataList[index].skus[cIndex].number)
  621. } else {
  622. uni.showToast({
  623. title: '亲!至少一件哦!',
  624. icon: "none"
  625. })
  626. }
  627. },
  628. // 数量加
  629. numAdd(index, cIndex) {
  630. this.dataList[index].priceNumber = 0
  631. if (this.dataList[index].skus[cIndex].number >= this.dataList[index].skus[cIndex].stockNumber) {
  632. this.dataList[index].skus[cIndex].number = this.dataList[index].skus[cIndex].stockNumber
  633. wx.showToast({
  634. title: '库存不足!',
  635. icon: 'none'
  636. })
  637. return;
  638. }
  639. if (this.dataList[index].skus[cIndex].number <= this.dataList[index].skus[cIndex].stockNumber) {
  640. this.dataList[index].skus[cIndex].number = this.dataList[index].skus[cIndex].number + 1
  641. this.dataList[index].priceNumber = 0
  642. this.priceFn(index)
  643. this.updateCart(this.dataList[index].skus[cIndex].skuId, this.dataList[index].skus[cIndex].number)
  644. }
  645. },
  646. updateMoneyAndNum() {
  647. this.isAllCheck = true
  648. this.allNum = 0
  649. this.checkNum = 0
  650. // this.checkMoney = 0
  651. for (let i = 0; i < this.dataList.length; i++) {
  652. /** 判断是否存在组合促销*/
  653. // 当前店铺
  654. let shopObj = this.dataList[i]
  655. // 当前店铺的组合优惠ID
  656. let groupPriceId = shopObj.currentIds
  657. // 当前店铺的组合优惠规则
  658. let groupRule = shopObj.currentRules
  659. let selectGroupSku = []
  660. for (let j = 0; j < this.dataList[i].skus.length; j++) {
  661. let item = this.dataList[i].skus[j]
  662. this.allNum += item.number
  663. if (item.selected == 1) {
  664. // 是否在组合商品中
  665. if (groupPriceId.includes(item.priceId)) {
  666. selectGroupSku.push(item)
  667. }
  668. this.checkNum = this.checkNum + item.number
  669. // this.checkMoney += parseFloat(item.price * item.number)
  670. } else {
  671. if (this.isAllCheck) {
  672. this.isAllCheck = false
  673. }
  674. }
  675. }
  676. }
  677. // 算钱
  678. this.getPriceBySelect()
  679. uni.setStorageSync('allCartNum', this.allNum)
  680. if (this.allNum > 0) {
  681. uni.setTabBarBadge({
  682. index: 2,
  683. text: (this.allNum).toString()
  684. })
  685. } else {
  686. uni.removeTabBarBadge({
  687. index: 2
  688. })
  689. }
  690. },
  691. updateShopSel(index, type) {
  692. this.dataList[index].currentRules = {}
  693. this.dataList[index].priceNumber = null
  694. console.log(index, 'index', type, 'type')
  695. let shopCarts = [{
  696. shopId: '',
  697. skus: []
  698. }]
  699. this.dataList[index].selected = type
  700. let len = this.dataList[index].skus.length
  701. for (let i = 0; i < len; i++) {
  702. this.dataList[index].skus[i].selected = type
  703. var skusobj = {};
  704. skusobj["skuId"] = this.dataList[index].skus[i].skuId;
  705. skusobj["selected"] = this.dataList[index].skus[i].selected
  706. shopCarts[0].skus.push(skusobj);
  707. }
  708. shopCarts[0].shopId = this.dataList[index].shopId
  709. this.priceFn(index)
  710. this.updateSelected(shopCarts)
  711. this.$forceUpdate()
  712. },
  713. //选中商品
  714. updateSelected(shopCarts) {
  715. this.updateMoneyAndNum()
  716. NET.request(API.SelectedCart, {
  717. shopCarts
  718. }, 'POST').then(res => {
  719. }).catch(res => {
  720. })
  721. },
  722. updateCart(skuId, number) {
  723. NET.request(API.UpdateNumberCart, {
  724. skuId: skuId,
  725. number: number
  726. }, 'POST').then(res => {
  727. this.updateMoneyAndNum()
  728. }).catch(res => {
  729. })
  730. },
  731. cartItemSel(index, cIndex, type) {
  732. console.log(this.dataList)
  733. this.dataList[index].currentRules = {}
  734. this.dataList[index].priceNumber = 0
  735. let shopCarts = [{
  736. shopId: 0,
  737. skus: []
  738. }]
  739. this.dataList[index].skus[cIndex].selected = type
  740. if (type == 1) {
  741. let len = this.dataList[index].skus.length
  742. let shopType = 1
  743. for (let i = 0; i < len; i++) {
  744. if (this.dataList[index].skus[i].selected == 0) {
  745. shopType = 0
  746. break
  747. }
  748. }
  749. this.dataList[index].selected = shopType
  750. } else {
  751. this.dataList[index].selected = type
  752. }
  753. this.priceFn(index)
  754. shopCarts[0].shopId = this.dataList[index].shopId
  755. var skusobj = {};
  756. skusobj["skuId"] = this.dataList[index].skus[cIndex].skuId;
  757. skusobj["selected"] = this.dataList[index].skus[cIndex].selected;
  758. shopCarts[0].skus.push(skusobj);
  759. this.updateSelected(shopCarts)
  760. },
  761. // 组合定价
  762. priceFn(shopIndex) {
  763. this.dataList[shopIndex].currentRules = {}
  764. this.dataList[shopIndex].skus.forEach((item) => {
  765. if (item.activityType === 6 && item.selected === 1) {
  766. this.dataList[shopIndex].priceNumber += item.number
  767. }
  768. })
  769. for (let i = 0; i < this.dataList[shopIndex].rules.length; i++) {
  770. if (this.dataList[shopIndex].rules[i].number === this.dataList[shopIndex].priceNumber) {
  771. this.dataList[shopIndex].currentRules = this.dataList[shopIndex].rules[i]
  772. console.log(this.dataList[shopIndex].currentRules, '==', this.dataList[shopIndex].rules[i])
  773. this.$forceUpdate()
  774. break
  775. } else if (this.dataList[shopIndex].rules[this.dataList[shopIndex].rules.length - 1].number < this.dataList[shopIndex].priceNumber) {
  776. this.dataList[shopIndex].currentRules = this.dataList[shopIndex].rules[this.dataList[shopIndex].rules.length - 1]
  777. this.$forceUpdate()
  778. break
  779. }
  780. }
  781. },
  782. //全选
  783. allSel(type) {
  784. this.updateAllSel(type)
  785. },
  786. updateAllSel(type) {
  787. console.log(type, 'type')
  788. let len = this.dataList.length
  789. for (let i = 0; i < len; i++) {
  790. let len2 = this.dataList[i].skus.length
  791. this.dataList[i].selected = type
  792. let priceNum = 0
  793. for (let j = 0; j < len2; j++) {
  794. this.dataList[i].skus[j].selected = type
  795. if (this.dataList[i].skus[j].selected === 1 && this.dataList[i].skus[j].activityType === 6) {
  796. priceNum += this.dataList[i].skus[j].number
  797. }
  798. }
  799. this.dataList[i].priceNumber = priceNum
  800. if (JSON.stringify(this.dataList[i].rules) !== "{}" && this.dataList[i].rules.length > 0) {
  801. this.dataList[i].rules.forEach((item => {
  802. if (item.number <= this.dataList[i].priceNumber) {
  803. this.dataList[i].currentRules = item
  804. }
  805. }))
  806. }
  807. }
  808. if (type === 0) {
  809. this.dataList.forEach((item) => {
  810. item.currentRules = {}
  811. })
  812. }
  813. let shopCarts = []
  814. this.updateSelected(shopCarts)
  815. },
  816. //点击删除
  817. cartDel() {
  818. if (!this.checkNum) {
  819. uni.showToast({
  820. title: '请先选择对应商品',
  821. icon: 'none'
  822. })
  823. return;
  824. }
  825. this.cardModal = true
  826. },
  827. //删除购物车
  828. doDelete() {
  829. this.cardModal = false
  830. let cartList = []
  831. let n = 0
  832. let skus = []
  833. let len = this.dataList.length
  834. for (let i = 0; i < len; i++) {
  835. let item = {}
  836. let len2 = this.dataList[i].skus.length
  837. for (let j = 0; j < len2; j++) {
  838. let itemGoods = this.dataList[i].skus[j]
  839. if (itemGoods.selected == 1) {
  840. skus[n] = itemGoods.skuId
  841. n = n + 1
  842. }
  843. }
  844. }
  845. NET.request(API.DeleteCart, {
  846. ids: skus
  847. }, 'POST').then(res => {
  848. this.getDataList()
  849. }).catch(res => {
  850. })
  851. },
  852. /**
  853. * 获取结算数组(计算价格)
  854. * @param needReturn 是否需要返回数组
  855. * @returns {*[]}
  856. */
  857. getPriceBySelect(needReturn=false){
  858. uni.showLoading({
  859. title:"计算中..."
  860. })
  861. let addCart = []
  862. let len = this.dataList.length
  863. for (let i = 0; i < len; i++) {
  864. let shopObj = {}
  865. shopObj["shopId"] = this.dataList[i].shopId
  866. shopObj["skus"] = []
  867. let len2 = this.dataList[i].skus.length
  868. for (let j = 0; j < len2; j++) {
  869. let skusObj = {}
  870. skusObj["ifLogistics"] = this.dataList[i].skus[j].ifLogistics
  871. skusObj["number"] = this.dataList[i].skus[j].number
  872. skusObj["selected"] = this.dataList[i].skus[j].selected
  873. skusObj["skuId"] = this.dataList[i].skus[j].skuId
  874. shopObj.skus.push(skusObj)
  875. }
  876. addCart.push(shopObj)
  877. }
  878. let newArray = []
  879. addCart.forEach((item, index) => {
  880. newArray[index] = item
  881. newArray[index].skus = item.skus.filter((item) => {
  882. return item.selected == 1
  883. })
  884. if (item.skus.length == 0) {
  885. newArray.splice(index, 1);
  886. }
  887. })
  888. newArray = newArray.filter(d => d)
  889. let postData = {
  890. type: 2,
  891. shops: newArray
  892. }
  893. if(!needReturn){
  894. NET.request(API.Settlement, postData, 'POST').then(res => {
  895. let money = 0;
  896. res.data.shops.forEach(item=>{
  897. money+=item.total
  898. })
  899. this.checkMoney = money.toFixed(2)
  900. uni.hideLoading()
  901. })
  902. }else{
  903. return newArray
  904. }
  905. },
  906. //结算购物车
  907. settlementTap() {
  908. let newArray = this.getPriceBySelect(true)
  909. uni.setStorageSync('skuItemDTOList', newArray)
  910. uni.navigateTo({
  911. url: '../../../pages_category_page1/orderModule/orderConfirm?type=2'
  912. })
  913. },
  914. //商品尺寸弹窗
  915. goosDetailshowClick(storeId, skuItemId) {
  916. this.goosDetailshowFlag = true
  917. this.colorActiveClick(storeId, skuItemId)
  918. },
  919. //颜色选中事件
  920. colorActiveClick(storeId, attrItemId) {
  921. this.colorActiveId = attrItemId
  922. NET.request(API.QueryProductSku, {
  923. productId: storeId,
  924. skuValueIdList: [attrItemId]
  925. }, 'POST').then(res => {
  926. if (res.code === 0) {
  927. this.skuProdList = res.data
  928. this.skuProdId = res.data.id
  929. this.skuImg = res.data.skuImg
  930. this.skuNameStr = res.data.skuNameStr
  931. this.skuPrice = res.data.skuPrice
  932. }
  933. }).catch(res => {
  934. })
  935. },
  936. }
  937. }
  938. </script>
  939. <style lang="scss"
  940. scoped>
  941. page {
  942. // background: #f7f7f7;
  943. }
  944. .content {
  945. overflow: hidden;
  946. .goosDetailshow-box {
  947. .detailImg-box {
  948. margin-top: 30upx;
  949. margin-left: 30upx;
  950. border-radius: 10upx;
  951. border-bottom: 1upx solid #EDEDED;
  952. padding-bottom: 20upx;
  953. width: 690upx;
  954. .detailImg {
  955. width: 180upx;
  956. height: 180upx;
  957. }
  958. }
  959. .color-box {
  960. padding: 30upx 30upx;
  961. border-bottom: 1upx solid #EDEDED;
  962. width: 690upx;
  963. .colorName-box {
  964. display: flex;
  965. flex-wrap: wrap;
  966. flex-direction: row;
  967. justify-content: flex-start;
  968. align-items: center;
  969. margin-top: 30upx;
  970. margin-left: -30upx;
  971. .colorName {
  972. background-color: #FFFFFF;
  973. margin-left: 30upx;
  974. padding: 10upx 32upx;
  975. font-size: 26upx;
  976. border: 2rpx solid #E4E5E6;
  977. z-index: 2;
  978. color: #333333;
  979. }
  980. .colorName-on {
  981. box-shadow: 0 0 20rpx rgba(0, 0, 0, 0.1);
  982. color: #C5AA7B;
  983. margin-left: 30upx;
  984. padding: 10upx 32upx;
  985. font-size: 26upx;
  986. text-align: center;
  987. z-index: 1;
  988. border: none;
  989. }
  990. }
  991. }
  992. .modelNum-box {
  993. padding: 30upx 30upx;
  994. border-bottom: 1upx solid #EDEDED;
  995. width: 690upx;
  996. .modelNumName-box {
  997. display: flex;
  998. flex-wrap: wrap;
  999. flex-direction: row;
  1000. justify-content: flex-start;
  1001. align-items: center;
  1002. margin-top: 30upx;
  1003. margin-left: -30upx;
  1004. .modelNumName-on {
  1005. background-color: #FFE4D0;
  1006. color: #FF7800;
  1007. margin-left: 30upx;
  1008. padding: 10upx 32upx;
  1009. border-radius: 28upx;
  1010. border: 1upx solid #FF7800;
  1011. font-size: 26upx;
  1012. text-align: center;
  1013. }
  1014. .modelNumName {
  1015. background-color: #F5F5F5;
  1016. margin-left: 30upx;
  1017. padding: 10upx 32upx;
  1018. border-radius: 28upx;
  1019. font-size: 26upx;
  1020. }
  1021. }
  1022. }
  1023. .goodsNum-box {
  1024. padding: 30upx 30upx;
  1025. width: 100%;
  1026. padding-bottom: 140upx;
  1027. .goodsNum {
  1028. height: 50upx;
  1029. text {
  1030. display: inline-block;
  1031. width: 50upx;
  1032. height: 50upx;
  1033. border: 1upx solid #999999;
  1034. text-align: center;
  1035. // line-height: 50upx;
  1036. }
  1037. .subtract {
  1038. border-right: 0upx;
  1039. }
  1040. .add {
  1041. border-left: 0upx;
  1042. }
  1043. }
  1044. }
  1045. .bottom-line {
  1046. border-bottom: 1upx solid #EDEDED;
  1047. }
  1048. .huabei-box {
  1049. padding: 30upx 30upx;
  1050. width: 690upx;
  1051. .fenqi-box {
  1052. margin-top: 15upx;
  1053. width: 120%;
  1054. .huabei-item {
  1055. display: inline-block;
  1056. background: #f3f3f3;
  1057. padding: 16upx 24upx;
  1058. margin: 5upx 10upx;
  1059. border-radius: 15upx;
  1060. text-align: center;
  1061. font-size: 7upx;
  1062. .huabei-period {
  1063. display: block;
  1064. }
  1065. }
  1066. .fenqi-on {
  1067. border: 1px solid #EF7F93;
  1068. color: #EF7F93;
  1069. }
  1070. .disabled {
  1071. color: #cacaca;
  1072. }
  1073. }
  1074. }
  1075. .goosDetailbut-box {
  1076. justify-content: center;
  1077. margin-bottom: 48rpx;
  1078. button {
  1079. width: 342rpx;
  1080. height: 100rpx;
  1081. line-height: 100rpx;
  1082. font-size: 28rpx;
  1083. border: 1px solid;
  1084. border-radius: 0;
  1085. }
  1086. .submitBtn {
  1087. color: #FFEBC4;
  1088. background: #333333;
  1089. }
  1090. }
  1091. }
  1092. .Put-box1 {
  1093. .btn {
  1094. text-align: center;
  1095. margin-top: 40rpx;
  1096. border: 1px solid #333333;
  1097. height: 80upx;
  1098. line-height: 80upx;
  1099. width: 240upx;
  1100. color: #333333;
  1101. }
  1102. .submit {
  1103. background-color: #333333;
  1104. color: #FFEBC4;
  1105. }
  1106. }
  1107. .cart-bg {
  1108. width: 100%;
  1109. height: 180rpx;
  1110. .cart-num-box {
  1111. display: flex;
  1112. flex-direction: row;
  1113. align-items: center;
  1114. justify-content: space-between;
  1115. image {
  1116. width: 286rpx;
  1117. height: 72rpx;
  1118. }
  1119. .btn-box {
  1120. font-size: 30rpx;
  1121. color: #333333;
  1122. padding: 30rpx;
  1123. box-sizing: border-box;
  1124. display: inline-block;
  1125. }
  1126. }
  1127. .num-box {
  1128. padding: 30rpx 0 30rpx 30rpx;
  1129. box-sizing: border-box;
  1130. font-size: 30rpx;
  1131. color: #C5CACF;
  1132. }
  1133. }
  1134. .cart-list-box {
  1135. box-sizing: border-box;
  1136. .itemBox {
  1137. .item {
  1138. background: #fff;
  1139. border-bottom: 16rpx solid #F8F9FA;
  1140. .shop-box {
  1141. display: flex;
  1142. flex-direction: row;
  1143. align-items: center;
  1144. border-bottom: 1px solid #eee;
  1145. position: relative;
  1146. .cart-select-img {
  1147. width: 40rpx;
  1148. height: 40rpx;
  1149. margin: 30rpx;
  1150. box-sizing: border-box;
  1151. }
  1152. .shop-name-box {
  1153. display: flex;
  1154. flex-direction: row;
  1155. align-items: center;
  1156. .shop-img {
  1157. width: 36rpx;
  1158. height: 36rpx;
  1159. margin-right: 10rpx;
  1160. }
  1161. .shop-name {
  1162. font-size: 30rpx;
  1163. color: #333;
  1164. font-weight: bold;
  1165. display: inline-block;
  1166. margin-left: 10rpx;
  1167. }
  1168. .arrow-right-img {
  1169. width: 30rpx;
  1170. height: 30rpx;
  1171. box-sizing: border-box;
  1172. margin-left: 30rpx;
  1173. position: absolute;
  1174. right: 30rpx;
  1175. }
  1176. }
  1177. }
  1178. .rulesBox {
  1179. height: 86rpx;
  1180. background: #F9F6F1;
  1181. padding: 0 20rpx;
  1182. image {
  1183. width: 126rpx;
  1184. height: 46rpx;
  1185. }
  1186. }
  1187. .product-list-box {
  1188. .pro-item {
  1189. display: flex;
  1190. flex-direction: row;
  1191. align-items: center;
  1192. .cart-select-img {
  1193. width: 40rpx;
  1194. height: 40rpx;
  1195. margin: 30rpx;
  1196. box-sizing: border-box;
  1197. }
  1198. .pro-r {
  1199. flex: 1;
  1200. border-bottom: 1px solid #eee;
  1201. display: flex;
  1202. flex-direction: row;
  1203. padding: 30rpx 30rpx 30rpx 0;
  1204. box-sizing: border-box;
  1205. overflow: hidden;
  1206. .pro-img {
  1207. width: 180rpx;
  1208. height: 180rpx;
  1209. border-radius: 10rpx;
  1210. margin-right: 30rpx;
  1211. }
  1212. .pro-r-r {
  1213. flex: 1;
  1214. font-size: 26rpx;
  1215. color: #333;
  1216. overflow: hidden;
  1217. display: flex;
  1218. flex-direction: column;
  1219. justify-content: space-between;
  1220. .pro-name {
  1221. height: 66rpx;
  1222. line-height: 33rpx;
  1223. display: -webkit-box;
  1224. overflow: hidden;
  1225. text-overflow: ellipsis;
  1226. word-break: break-all;
  1227. -webkit-box-orient: vertical;
  1228. -webkit-line-clamp: 2;
  1229. }
  1230. .sku-box {
  1231. width: auto;
  1232. display: inline;
  1233. height: 40rpx;
  1234. border-radius: 4rpx;
  1235. padding: 0 0 0 10rpx;
  1236. box-sizing: border-box;
  1237. font-size: 24rpx;
  1238. color: #999;
  1239. text {
  1240. border: 2rpx solid #E4E5E6;
  1241. padding: 2rpx 10rpx;
  1242. }
  1243. }
  1244. .pro-price-num-box {
  1245. display: flex;
  1246. flex-direction: row;
  1247. align-items: center;
  1248. justify-content: space-between;
  1249. .pro-price-box {
  1250. font-size: 36rpx;
  1251. color: #333333;
  1252. font-weight: 400;
  1253. .fuhao {
  1254. font-size: 24rpx;
  1255. }
  1256. }
  1257. .pro-num-box {
  1258. width: 140rpx;
  1259. height: 40rpx;
  1260. border: 1px solid #ddd;
  1261. border-radius: 4rpx;
  1262. display: flex;
  1263. flex-direction: row;
  1264. justify-content: space-between;
  1265. overflow: hidden;
  1266. .num-btn {
  1267. font-size: 34rpx;
  1268. color: #999999;
  1269. display: inline-block;
  1270. width: 40rpx;
  1271. text-align: center;
  1272. line-height: 32rpx;
  1273. height: 40rpx;
  1274. }
  1275. .num-btn.r {
  1276. border-right: 1px solid #ddd;
  1277. }
  1278. .num-btn.l {
  1279. border-left: 1px solid #ddd;
  1280. }
  1281. .num {
  1282. font-size: 26rpx;
  1283. color: #333;
  1284. }
  1285. }
  1286. }
  1287. }
  1288. }
  1289. }
  1290. .pro-item:last-of-type .pro-r {
  1291. border-bottom: none;
  1292. }
  1293. }
  1294. }
  1295. }
  1296. .itemBox:first-child {
  1297. .shop-box {
  1298. border-top: 2rpx solid #eee;
  1299. }
  1300. }
  1301. .itemBox:last-child {
  1302. .item {
  1303. border-bottom: none;
  1304. }
  1305. }
  1306. }
  1307. .emptyCart-box {
  1308. margin: 100rpx 0;
  1309. .emptyCart-img {
  1310. width: 216rpx;
  1311. height: 156rpx;
  1312. }
  1313. .goToShopping {
  1314. width: 282rpx;
  1315. height: 84rpx;
  1316. line-height: 84rpx;
  1317. text-align: center;
  1318. background: #333333;
  1319. margin-top: 40rpx;
  1320. color: #FFEBC4;
  1321. font-size: 28rpx;
  1322. }
  1323. }
  1324. .cart-bottom-box-h5 {
  1325. position: fixed;
  1326. bottom: 74rpx;
  1327. width: 100%;
  1328. z-index: 99;
  1329. }
  1330. .cart-bottom-box-app {
  1331. position: fixed;
  1332. bottom: 0rpx;
  1333. width: 100%;
  1334. z-index: 99;
  1335. }
  1336. .cart-bottom {
  1337. height: 120rpx;
  1338. background: #fff;
  1339. display: flex;
  1340. flex-direction: row;
  1341. align-items: center;
  1342. justify-content: space-between;
  1343. border-top: 1rpx solid #eee;
  1344. }
  1345. .left {
  1346. display: flex;
  1347. flex-direction: row;
  1348. align-items: center;
  1349. font-size: 28rpx;
  1350. color: #666;
  1351. .cart-select-img {
  1352. width: 40rpx;
  1353. height: 40rpx;
  1354. margin: 30rpx;
  1355. box-sizing: border-box;
  1356. }
  1357. }
  1358. .right {
  1359. display: flex;
  1360. flex-direction: row;
  1361. align-items: center;
  1362. box-sizing: border-box;
  1363. .price-box {
  1364. font-size: 30rpx;
  1365. color: #333;
  1366. .price {
  1367. font-size: 40rpx;
  1368. color: #C83732;
  1369. font-weight: bold;
  1370. }
  1371. }
  1372. .btn-confirm {
  1373. width: 232rpx;
  1374. height: 120rpx;
  1375. background: #333333;
  1376. margin-left: 18rpx;
  1377. text-align: center;
  1378. line-height: 120rpx;
  1379. font-size: 28rpx;
  1380. color: #FFEBC4;
  1381. }
  1382. .btn-delete {
  1383. width: 232rpx;
  1384. height: 120rpx;
  1385. line-height: 120rpx;
  1386. text-align: center;
  1387. font-size: 28rpx;
  1388. color: #FFFFFF;
  1389. background: #C83732;
  1390. }
  1391. }
  1392. .goosDetailshow-box {
  1393. .detailImg-box {
  1394. margin-top: 30rpx;
  1395. margin-left: 30rpx;
  1396. border-radius: 10rpx;
  1397. border-bottom: 1rpx solid #EDEDED;
  1398. padding-bottom: 20rpx;
  1399. width: 690rpx;
  1400. .detailImg {
  1401. width: 180rpx;
  1402. height: 180rpx;
  1403. }
  1404. }
  1405. .color-box {
  1406. padding: 30rpx 30rpx;
  1407. border-bottom: 1rpx solid #EDEDED;
  1408. width: 690rpx;
  1409. .skuStyle {
  1410. padding: 20rpx 0;
  1411. }
  1412. .skuStyle:nth-child(2) {
  1413. border-top: 1px solid #F3F4F5;
  1414. }
  1415. .colorName-box {
  1416. display: flex;
  1417. flex-wrap: wrap;
  1418. flex-direction: row;
  1419. justify-content: flex-start;
  1420. align-items: center;
  1421. margin-top: 30rpx;
  1422. margin-left: -30rpx;
  1423. .colorName-on {
  1424. background-color: #FFE5D0;
  1425. color: #C5AA7B;
  1426. margin-left: 30rpx;
  1427. padding: 10rpx 32rpx;
  1428. border-radius: 28rpx;
  1429. border: 1rpx solid #C5AA7B;
  1430. font-size: 26rpx;
  1431. text-align: center;
  1432. z-index: 1;
  1433. }
  1434. .colorName {
  1435. background-color: #F5F5F5;
  1436. margin-left: 30rpx;
  1437. padding: 10rpx 32rpx;
  1438. border-radius: 28rpx;
  1439. font-size: 26rpx;
  1440. z-index: 2;
  1441. }
  1442. }
  1443. }
  1444. .modelNum-box {
  1445. padding: 30rpx 30rpx;
  1446. border-bottom: 1rpx solid #EDEDED;
  1447. width: 690rpx;
  1448. .modelNumName-box {
  1449. display: flex;
  1450. flex-wrap: wrap;
  1451. flex-direction: row;
  1452. justify-content: flex-start;
  1453. align-items: center;
  1454. margin-top: 30rpx;
  1455. margin-left: -30rpx;
  1456. .modelNumName-on {
  1457. background-color: #FFE4D0;
  1458. color: #C5AA7B;
  1459. margin-left: 30rpx;
  1460. padding: 10rpx 32rpx;
  1461. border-radius: 28rpx;
  1462. border: 1rpx solid #C5AA7B;
  1463. font-size: 26rpx;
  1464. text-align: center;
  1465. }
  1466. .modelNumName {
  1467. background-color: #F5F5F5;
  1468. margin-left: 30rpx;
  1469. padding: 10rpx 32rpx;
  1470. border-radius: 28rpx;
  1471. font-size: 26rpx;
  1472. }
  1473. }
  1474. }
  1475. .goodsNum-box {
  1476. padding: 30rpx 30rpx;
  1477. width: 690rpx;
  1478. padding-bottom: 140rpx;
  1479. .goodsNumber {
  1480. text-align: center;
  1481. border: 1rpx solid #999999;
  1482. padding: 3rpx 20rpx;
  1483. }
  1484. .subtract {
  1485. border: 1rpx solid #999999;
  1486. padding: 3rpx 20rpx;
  1487. margin-right: -1rpx;
  1488. }
  1489. .add {
  1490. border: 1rpx solid #999999;
  1491. padding: 3rpx 20rpx;
  1492. margin-left: -1rpx;
  1493. }
  1494. }
  1495. .goosDetailbut-box {
  1496. .joinShopCartBut {
  1497. width: 343rpx;
  1498. height: 80rpx;
  1499. background-color: #FFC300;
  1500. color: #FFFEFE;
  1501. font-size: 28rpx;
  1502. line-height: 80rpx;
  1503. text-align: center;
  1504. margin-left: 30rpx;
  1505. }
  1506. .buyNowBut {
  1507. width: 343rpx;
  1508. height: 80rpx;
  1509. border-radius: 0 40rpx 40rpx 0;
  1510. background-color: #FF6F00;
  1511. color: #FFFEFE;
  1512. font-size: 28rpx;
  1513. line-height: 80rpx;
  1514. text-align: center;
  1515. }
  1516. }
  1517. }
  1518. }
  1519. </style>