index.vue 40 KB

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