index.vue 42 KB

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