goods.vue 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872
  1. <template>
  2. <view class="">
  3. <view class="content" v-cloak>
  4. <view class="shop-banner">
  5. <swiper class="swiper" :indicator-dots="false" :circular="true" :autoplay="true" :interval="3000"
  6. :duration="1000" indicator-color="rgba(255, 255, 255, 0.6)" indicator-active-color="#ffffff"
  7. @change="swiperChange">
  8. <swiper-item class="swiper-item" v-for="(item,index) in banner" :key="index">
  9. <image :src="item" mode="aspectFill"></image>
  10. </swiper-item>
  11. </swiper>
  12. <!-- 底部遮罩 -->
  13. <view class="banner-mask"></view>
  14. <!-- 数量 -->
  15. <view class="num-box">{{ activeBanner }}/{{ banner.length }}</view>
  16. </view>
  17. <!-- 详细信息 -->
  18. <view class="det-info" v-if="!!goosDetail">
  19. <view class="price-box">
  20. <view class="price">
  21. <text class="label">会员价</text>
  22. <text class="unit">¥</text>
  23. <text class="num">{{goosDetail.price||0}}</text>
  24. <text class="fs24 color-text2">零售价</text>
  25. <text class="old">¥{{goosDetail.otPrice||0}}</text>
  26. </view>
  27. <!-- <text class="fs24 color-text2">月售{{goosDetail.sales||0}}件</text> -->
  28. </view>
  29. <view class="name-box">
  30. {{goosDetail.productName||0}}
  31. <view v-if="purchaseLimit > 0" class="limit-info">
  32. 限购{{purchaseLimit}}件<text v-if="remainingPurchaseLimit !== null && remainingPurchaseLimit >= 0">,已购{{purchaseLimit - remainingPurchaseLimit}}件</text>
  33. </view>
  34. </view>
  35. </view>
  36. </view>
  37. <view class="guige">
  38. <view class="safe-box">
  39. <text class="text">服务</text>
  40. <view class="box">
  41. <image class="mr20"
  42. src="https://bjzmky-1323137866.cos.ap-chongqing.myqcloud.com/userapp/images/safe.png" mode="">
  43. </image>
  44. <view class="mr30" v-for="(item,index) in serviceList" :key="index">
  45. <text>{{item}}</text>
  46. </view>
  47. </view>
  48. </view>
  49. </view>
  50. <!-- 购买人数、库存 -->
  51. <view class="det-box">
  52. <view class="title">图文详情</view>
  53. <view class="inner">
  54. <view v-html="goosDetail.description" style="font-size:0"></view>
  55. </view>
  56. </view>
  57. <!-- 底部按钮 -->
  58. <view class="btn-foot">
  59. <view class="menu-box">
  60. </view>
  61. <view class="btn-box">
  62. <view class="btn buy" @click="addCart('buy')">{{buyText}}</view>
  63. </view>
  64. </view>
  65. <!-- 选择产品规格弹窗 -->
  66. <popupBottom ref="popup" :visible.sync="specVisible" title=" " radius="32" maxHeight="800">
  67. <view class="product-spec">
  68. <view class="pro-info">
  69. <view class="img-box">
  70. <!-- 这里应该显示当前选择规格的图片 -->
  71. <image
  72. :src="(productValueSelect && productValueSelect.image) || goosDetail.image || 'https://bjzmky-1323137866.cos.ap-chongqing.myqcloud.com/userapp/images/img.png'"
  73. mode="aspectFill"></image>
  74. </view>
  75. <view class="info-text">
  76. <!-- 商品名称不变 -->
  77. <view class="info-title">{{goosDetail.productName}}</view>
  78. <!-- 这里应该显示当前选择规格的价格 -->
  79. <view class="price">
  80. <view class="label">会员价</view>
  81. <text class="unit">¥</text>
  82. <text class="num">{{ productValueSelect ? productValueSelect.price : goosDetail.price}}</text>
  83. </view>
  84. <view class="desc-box">
  85. <!-- 这里可以显示当前选择规格的库存 -->
  86. <text class="text" v-if="productValueSelect">库存:{{productValueSelect.stock}}件</text>
  87. <text class="text" v-else>月售{{goosDetail.sales}}件</text>
  88. </view>
  89. </view>
  90. </view>
  91. <!-- 规格 -->
  92. <view class="spec-box">
  93. <view v-for="(item,index) in attrs" :key="index">
  94. <view class="title">{{item.attrName}}</view>
  95. <view class="spec-list">
  96. <view v-for="(subItem,subindex) in item.values" :key="subindex"
  97. :class="subindex==item.index?'item active':'item'" @click="choseSpec(index,subindex)">
  98. {{ subItem }}
  99. </view>
  100. </view>
  101. </view>
  102. </view>
  103. <!-- <view class="price-num">
  104. <view class="label">数量</view>
  105. <u-number-box bgColor="#f3f3f3" v-model="totalNum" @change="goodsNumChange"></u-number-box>
  106. </view> -->
  107. <view class="price-num">
  108. <view class="label">数量</view>
  109. <view class="num-box">
  110. <view class="img-box" @click="lessNum()">
  111. <image v-if="totalNum <= 1"
  112. src="https://jnlzjk-1323137866.cos.ap-chongqing.myqcloud.com/shop/images/jian.png"
  113. mode=""></image>
  114. <image v-else
  115. src="https://jnlzjk-1323137866.cos.ap-chongqing.myqcloud.com/shop/images/jian2.png"
  116. mode=""></image>
  117. </view>
  118. <input type="number" @change="changeNum" v-model="totalNum" />
  119. <view class="img-box" @click="addNum()">
  120. <image src="https://jnlzjk-1323137866.cos.ap-chongqing.myqcloud.com/shop/images/add.png"
  121. mode=""></image>
  122. </view>
  123. </view>
  124. </view>
  125. <view class="sub-btn" @click="submit">确定</view>
  126. </view>
  127. </popupBottom>
  128. <CustomToast ref="customToast">
  129. </CustomToast>
  130. </view>
  131. </template>
  132. <script>
  133. import {
  134. liveGoodsDetail
  135. } from '@/api/living'
  136. import {
  137. liveOrderKey, // 生成订单key
  138. } from "@/api/order.js"
  139. import popupBottom from '@/components/px-popup-bottom/px-popup-bottom.vue'
  140. import {CustomToast} from '@/components/custom-toast.vue';
  141. export default {
  142. components: {
  143. popupBottom,CustomToast
  144. },
  145. data() {
  146. return {
  147. attrs: [],
  148. banner: [],
  149. goodsId: null,
  150. totalNum: 1,
  151. orderKey: null,
  152. type: null,
  153. liveId: null,
  154. storeId: null,
  155. selectVal: '', // 当前选择的规格值
  156. productValueSelect: null, // 当前选择的规格对象
  157. serviceList: ['品质保障', '隐私保护'],
  158. productId: null,
  159. goosDetail: null, //商品详情
  160. buyText: "立即购买",
  161. goodsNum: 0, //商品选择数量
  162. // 当前轮播的图片
  163. activeBanner: 1,
  164. // 规格弹窗
  165. specVisible: false,
  166. remainingPurchaseLimit:null,
  167. purchaseLimit:0 // 总限购数量
  168. };
  169. },
  170. onLoad(options) {
  171. // console.log("商品详情options", options)
  172. if (options.productId) {
  173. this.productId = options.productId;
  174. }
  175. this.liveId = options.liveId
  176. this.goodsId = options.goodsId
  177. if (options.storeId) {
  178. this.storeId = options.storeId || ""
  179. } else {
  180. uni.showToast({
  181. title: "storeId不存在~",
  182. icon: "none"
  183. })
  184. }
  185. this.getliveGoods()
  186. },
  187. methods: {
  188. // swiper变化事件
  189. swiperChange(event) {
  190. this.activeBanner = event.detail.current + 1
  191. },
  192. doAddCart(type) {
  193. // 检查限购数量
  194. if (this.remainingPurchaseLimit !== null && typeof this.remainingPurchaseLimit === 'number') {
  195. // 如果限购数量为0,提示库存不足
  196. if (this.remainingPurchaseLimit === 0) {
  197. this.$refs.customToast.show({
  198. title:`该商品限购:${this.purchaseLimit}件\n已达购买上限`,
  199. duration: 2000
  200. });
  201. // uni.showToast({
  202. // icon: 'none',
  203. // title: "该商品限购:" + this.purchaseLimit +",已达到购买上限",
  204. // });
  205. return;
  206. }
  207. // 如果购买数量超过限购数量,提示
  208. if (this.totalNum > this.remainingPurchaseLimit) {
  209. this.$refs.customToast.show({
  210. title: "购买数量不能超过限购数量:" + this.remainingPurchaseLimit,
  211. duration: 2000
  212. });
  213. // uni.showToast({
  214. // icon: 'none',
  215. // title: "购买数量不能超过限购数量:" + this.remainingPurchaseLimit,
  216. // });
  217. return;
  218. }
  219. }
  220. if (this.totalNum == 0) {
  221. uni.showToast({
  222. icon: 'none',
  223. title: "购买商品数量必须大于0",
  224. });
  225. return;
  226. }
  227. var isBuy = type == "buy" ? 1 : 0;
  228. if (type == "buy") {
  229. this.getKey()
  230. } else {
  231. uni.showToast({
  232. icon: 'success',
  233. title: "添加成功",
  234. });
  235. }
  236. },
  237. // 获得key
  238. getKey() {
  239. liveOrderKey().then(res => {
  240. if (res.code == 200) {
  241. // console.log("下订单的key>>>>", res)
  242. this.orderKey = res.orderKey
  243. uni.navigateTo({
  244. url: '/pages_shopping/live/confirmCreateOrder?&orderKey=' + this.orderKey +
  245. '&liveId=' + this.liveId + '&goodsId=' + this.goodsId +
  246. '&productId=' + this.productId + '&totalNum=' + this.totalNum +
  247. "&productValueSelect=" + this.productValueSelect.id
  248. })
  249. } else {
  250. uni.showToast({
  251. title: res.msg,
  252. icon: 'none'
  253. });
  254. }
  255. },
  256. rej => {}
  257. );
  258. },
  259. // // 选择商品数量
  260. // goodsNumChange(e) {
  261. // console.log('当前选择商品数量为: ' + e.value)
  262. // this.totalNum = e.value
  263. // if (this.totalNum < 1) {
  264. // this.totalNum = 1
  265. // }
  266. // if (this.totalNum >= this.productValueSelect.stock) {
  267. // this.totalNum = this.productValueSelect.stock
  268. // }
  269. // if(this.totalNum > this.remainingPurchaseLimit){
  270. // this.totalNum = this.remainingPurchaseLimit
  271. // uni.showToast({
  272. // icon: 'none',
  273. // title: "该商品限购:"+this.remainingPurchaseLimit+"次"+",已达购买上限",
  274. // });
  275. // }
  276. // },
  277. // 提交
  278. submit() {
  279. this.specVisible = false
  280. this.doAddCart(this.type);
  281. },
  282. // 加入购物车
  283. addCart(type) {
  284. if (type == 'buy') {
  285. let userInfoStr = uni.getStorageSync('userInfo');
  286. if(Object.prototype.toString.call(userInfoStr) == '[object String]'){
  287. userInfoStr = JSON.parse(userInfoStr)
  288. }
  289. if (!userInfoStr || userInfoStr && !userInfoStr.maOpenId) {
  290. uni.navigateTo({
  291. url: '/pages/auth/login'
  292. });
  293. return;
  294. }
  295. }
  296. this.type = type;
  297. this.specVisible = true
  298. },
  299. //商品详情
  300. getliveGoods() {
  301. if (!this.productId) return;
  302. uni.showLoading({
  303. title: '加载中'
  304. });
  305. liveGoodsDetail(this.productId).then(res => {
  306. uni.hideLoading()
  307. if (res.code == 200) {
  308. this.goosDetail = res.product
  309. this.banner = res.product.sliderImage.split(',');
  310. this.remainingPurchaseLimit=res.remainingPurchaseLimit
  311. // 如果接口返回了总限购数量,也保存
  312. if (res.product.purchaseLimit !== null) {
  313. this.purchaseLimit = res.product.purchaseLimit;
  314. }
  315. this.attrs = res.productAttr;
  316. this.attrs.forEach((item, index, arr) => {
  317. item.values = item.attrValues.split(',');
  318. item.index = 0
  319. });
  320. this.values = res.productValues;
  321. this.choseSpec(0, 0)
  322. } else {
  323. uni.showToast({
  324. title: res.msg,
  325. icon: 'none'
  326. });
  327. }
  328. },
  329. rej => {}
  330. );
  331. },
  332. getValueSelect() {
  333. var valueSelect = this.values.filter((item) => {
  334. return item.sku == this.selectVal;
  335. });
  336. return valueSelect;
  337. },
  338. // 规格选择
  339. choseSpec(index, subIndex) {
  340. this.attrs[index].index = subIndex;
  341. this.$forceUpdate();
  342. let productAttr = this.attrs;
  343. let values = [];
  344. for (let i = 0; i < productAttr.length; i++) {
  345. for (let j = 0; j < productAttr[i].values.length; j++) {
  346. if (productAttr[i].index === j) { //筛选出默认规格
  347. values.push(productAttr[i].values[j]);
  348. }
  349. }
  350. }
  351. let selectVal = values.sort().join(","); //返回值:默认
  352. this.selectVal = selectVal;
  353. // var valueSelect=this.values.filter((item)=>{
  354. // return item.sku==selectVal;
  355. // });
  356. var valueSelect = this.getValueSelect();
  357. console.log("qxj valueSelect:" + valueSelect);
  358. if (valueSelect != null && valueSelect.length > 0) {
  359. this.productValueSelect = valueSelect[0];
  360. }
  361. console.log("qxj productValueSelect:" + JSON.stringify(this.productValueSelect));
  362. this.updateSpecNum();
  363. },
  364. //更新数量
  365. updateSpecNum() {
  366. if (this.productValueSelect.stock == 0) {
  367. this.totalNum = 0;
  368. } else {
  369. this.totalNum = 1;
  370. }
  371. },
  372. changeNum(e) {
  373. this.totalNum = e.detail.value.replace(/\D/g, '')
  374. if (this.totalNum < 1) {
  375. this.totalNum = 1
  376. }
  377. if (this.totalNum >= this.productValueSelect.stock) {
  378. this.totalNum = this.productValueSelect.stock
  379. }
  380. if(this.totalNum > this.remainingPurchaseLimit && this.remainingPurchaseLimit!==null){
  381. this.totalNum = this.remainingPurchaseLimit;
  382. this.$refs.customToast.show({
  383. title: `该商品限购:${this.remainingPurchaseLimit}件\n已达购买上限`,
  384. duration: 2000
  385. });
  386. // uni.showToast({
  387. // icon: 'none',
  388. // title: "该商品限购:"+this.remainingPurchaseLimit+"次"+",已达购买上限",
  389. // });
  390. }
  391. },
  392. // 数量减法
  393. lessNum() {
  394. this.totalNum--
  395. if (this.totalNum < 1) {
  396. this.totalNum = 1
  397. }
  398. if (this.totalNum >= this.productValueSelect.stock) {
  399. this.totalNum = this.productValueSelect.stock
  400. }
  401. },
  402. // 数量加法
  403. addNum() {
  404. this.totalNum++
  405. if (this.totalNum >= this.productValueSelect.stock) {
  406. this.totalNum = this.productValueSelect.stock
  407. }
  408. if(this.totalNum > this.remainingPurchaseLimit && this.remainingPurchaseLimit!==null){
  409. this.totalNum = this.remainingPurchaseLimit;
  410. this.$refs.customToast.show({
  411. title: `该商品限购:${this.remainingPurchaseLimit}件\n已达购买上限`,
  412. duration: 2000
  413. });
  414. // uni.showToast({
  415. // icon: 'none',
  416. // title: "该商品限购:"+this.remainingPurchaseLimit+"次"+",已达购买上限",
  417. // });
  418. }
  419. }
  420. }
  421. }
  422. </script>
  423. <style lang="scss">
  424. [v-cloak] {
  425. display: none;
  426. }
  427. .content {
  428. font-family: PingFang SC;
  429. }
  430. .shop-banner {
  431. height: 756rpx;
  432. background-color: #FFFFFF;
  433. position: relative;
  434. .swiper-item {
  435. box-sizing: border-box;
  436. position: relative;
  437. }
  438. .swiper,
  439. .swiper-item,
  440. .swiper-item image {
  441. width: 100%;
  442. height: 100%;
  443. }
  444. .banner-mask {
  445. width: 100%;
  446. height: 44rpx;
  447. position: absolute;
  448. left: 0;
  449. bottom: 0;
  450. z-index: 9;
  451. background-size: 20rpx 44rpx;
  452. background-repeat: repeat-x;
  453. }
  454. .num-box {
  455. width: 80rpx;
  456. height: 40rpx;
  457. line-height: 40rpx;
  458. text-align: center;
  459. font-size: 24rpx;
  460. color: #FFFFFF;
  461. background: rgba(0, 0, 0, .7);
  462. border-radius: 20rpx;
  463. position: absolute;
  464. right: 40rpx;
  465. bottom: 34rpx;
  466. z-index: 10;
  467. }
  468. }
  469. .guige {
  470. padding: 24rpx;
  471. border-radius: 16rpx;
  472. background: #fff;
  473. width: auto;
  474. font-size: 24rpx;
  475. color: #222426;
  476. margin: 24rpx;
  477. .safe-box {
  478. display: flex;
  479. align-items: center;
  480. padding-top: 24rpx;
  481. font-size: 24rpx;
  482. color: #222426;
  483. .text {
  484. color: #999999;
  485. margin-right: 40rpx;
  486. }
  487. .box {
  488. display: flex;
  489. align-items: center;
  490. image {
  491. width: 28rpx;
  492. height: 28rpx;
  493. margin-right: 10rpx;
  494. }
  495. view {
  496. display: flex;
  497. align-items: center;
  498. margin-right: 40rpx;
  499. &:last-child {
  500. margin-right: 0;
  501. image {
  502. margin-right: 0;
  503. }
  504. }
  505. }
  506. }
  507. }
  508. }
  509. .det-info {
  510. background: #FFFFFF;
  511. padding: 24rpx;
  512. margin: 24rpx;
  513. border-radius: 16rpx;
  514. .price-box {
  515. display: flex;
  516. align-items: flex-end;
  517. justify-content: space-between;
  518. .price {
  519. display: flex;
  520. align-items: flex-end;
  521. .label {
  522. font-weight: 500;
  523. font-size: 24rpx;
  524. color: #FF5030;
  525. line-height: 1.3;
  526. margin-right: 10rpx;
  527. }
  528. .unit {
  529. font-size: 26rpx;
  530. font-weight: bold;
  531. color: #FF6633;
  532. line-height: 1.3;
  533. }
  534. .num {
  535. font-size: 48rpx;
  536. font-weight: bold;
  537. color: #FF5030;
  538. margin-right: 20rpx;
  539. line-height: 1;
  540. }
  541. .old {
  542. font-size: 24rpx;
  543. font-family: PingFang SC;
  544. font-weight: 400;
  545. text-decoration: line-through;
  546. color: #898E91;
  547. margin-left: 10rpx;
  548. line-height: 1.3;
  549. }
  550. }
  551. }
  552. .name-box {
  553. font-size: 32rpx;
  554. font-weight: bold;
  555. color: #111111;
  556. line-height: 44rpx;
  557. margin-top: 32rpx;
  558. .tag {
  559. display: inline-block;
  560. padding: 2rpx 8rpx;
  561. height: 32rpx;
  562. background: #F5A623;
  563. border-radius: 4rpx;
  564. margin-right: 10rpx;
  565. font-weight: 400;
  566. font-size: 20rpx;
  567. color: #FFFFFF;
  568. line-height: 30rpx;
  569. float: left;
  570. margin-top: 7rpx;
  571. }
  572. .limit-info {
  573. font-size: 32rpx;
  574. font-weight: 500;
  575. color: #FF6633;
  576. margin-top: 16rpx;
  577. line-height: 1;
  578. }
  579. }
  580. }
  581. .det-box {
  582. margin-top: 10rpx;
  583. background-color: #FFFFFF;
  584. padding: 24rpx;
  585. margin: 24rpx 24rpx 175rpx 24rpx;
  586. border-radius: 16rpx;
  587. .title {
  588. font-size: 32rpx;
  589. font-weight: bold;
  590. color: #333333;
  591. line-height: 60rpx;
  592. margin-bottom: 30rpx;
  593. padding-bottom: 24rpx;
  594. border-bottom: 1px solid #ECECEC;
  595. }
  596. .inner {
  597. margin-bottom: 100rpx;
  598. }
  599. }
  600. .btn-foot {
  601. box-sizing: border-box;
  602. width: 100%;
  603. height: 151rpx;
  604. background: #FFFFFF;
  605. padding: 0 24rpx;
  606. display: flex;
  607. align-items: center;
  608. justify-content: space-between;
  609. position: fixed;
  610. left: 0;
  611. bottom: 0;
  612. z-index: 99;
  613. .menu-box {
  614. display: flex;
  615. align-items: center;
  616. }
  617. .btn-box {
  618. display: flex;
  619. align-items: center;
  620. .btn {
  621. width: 200rpx;
  622. height: 88rpx;
  623. line-height: 88rpx;
  624. text-align: center;
  625. border-radius: 44rpx;
  626. margin-left: 20rpx;
  627. font-size: 28rpx;
  628. font-weight: bold;
  629. color: #FFFFFF;
  630. &:first-child {
  631. margin-left: 0;
  632. }
  633. &.buy {
  634. background: #2bc7b9;
  635. }
  636. }
  637. }
  638. }
  639. .product-spec {
  640. padding-bottom: 30rpx;
  641. .pro-info {
  642. display: flex;
  643. align-items: center;
  644. .img-box {
  645. width: 200rpx;
  646. height: 200rpx;
  647. background: #FFFFFF;
  648. border-radius: 16rpx;
  649. overflow: hidden;
  650. margin-right: 30rpx;
  651. image {
  652. width: 100%;
  653. height: 100%;
  654. }
  655. }
  656. .info-text {
  657. height: 200rpx;
  658. display: flex;
  659. flex-direction: column;
  660. justify-content: space-between;
  661. .info-title {
  662. font-family: PingFang SC;
  663. font-weight: 600;
  664. font-size: 28rpx;
  665. color: #222426;
  666. text-align: left;
  667. }
  668. .price {
  669. display: flex;
  670. align-items: flex-end;
  671. .label {
  672. font-weight: 500;
  673. font-size: 24rpx;
  674. color: #FF5030;
  675. line-height: 1.3;
  676. margin-right: 10rpx;
  677. }
  678. .unit {
  679. font-size: 32rpx;
  680. font-weight: bold;
  681. color: #FF6633;
  682. line-height: 1.2;
  683. margin-right: 10rpx;
  684. }
  685. .num {
  686. font-size: 50rpx;
  687. font-weight: bold;
  688. color: #FF6633;
  689. line-height: 1;
  690. }
  691. }
  692. .desc-box {
  693. display: flex;
  694. flex-direction: column;
  695. padding-bottom: 9rpx;
  696. .text {
  697. font-size: 26rpx;
  698. font-weight: 500;
  699. color: #999999;
  700. margin-top: 27rpx;
  701. line-height: 1;
  702. &:first-child {
  703. margin-top: 0;
  704. }
  705. }
  706. }
  707. }
  708. }
  709. .spec-box {
  710. padding-top: 50upx;
  711. .title {
  712. font-size: 34upx;
  713. font-family: PingFang SC;
  714. font-weight: bold;
  715. color: #111111;
  716. line-height: 1;
  717. }
  718. .spec-list {
  719. display: flex;
  720. flex-wrap: wrap;
  721. margin-top: 30upx;
  722. .item {
  723. box-sizing: border-box;
  724. height: 64upx;
  725. padding: 0 30upx;
  726. line-height: 64upx;
  727. font-size: 28upx;
  728. font-family: PingFang SC;
  729. font-weight: 500;
  730. color: #111111;
  731. background: #F7F7F7;
  732. border: 1px solid #F7F7F7;
  733. border-radius: 32upx;
  734. margin-right: 20upx;
  735. margin-bottom: 30upx;
  736. &.active {
  737. background: #F1FFFE;
  738. border: 1px solid #8AD5CE;
  739. color: #2BC7B9;
  740. }
  741. }
  742. }
  743. }
  744. .price-num {
  745. display: flex;
  746. align-items: center;
  747. justify-content: space-between;
  748. margin-top: 30rpx;
  749. .label {
  750. font-size: 36rpx;
  751. font-weight: bold;
  752. color: #111111;
  753. }
  754. .num-box {
  755. display: flex;
  756. align-items: center;
  757. .img-box {
  758. width: 60upx;
  759. height: 60upx;
  760. // border-radius: 4upx;
  761. border: 1px solid #dddddd;
  762. display: flex;
  763. align-items: center;
  764. justify-content: center;
  765. image {
  766. width: 25rpx;
  767. height: 25rpx;
  768. }
  769. }
  770. input {
  771. width: 60upx;
  772. height: 60upx;
  773. line-height: 60upx;
  774. font-size: 28upx;
  775. font-family: PingFang SC;
  776. font-weight: 500;
  777. color: #111111;
  778. // border-radius: 4upx;
  779. border-top: 1px solid #dddddd;
  780. border-bottom: 1px solid #dddddd;
  781. text-align: center;
  782. // margin: 0 16upx;
  783. }
  784. }
  785. }
  786. .sub-btn {
  787. width: 100%;
  788. height: 88rpx;
  789. line-height: 88rpx;
  790. text-align: center;
  791. font-size: 32rpx;
  792. font-weight: bold;
  793. color: #FFFFFF;
  794. background: #2BC7B9;
  795. border-radius: 44rpx;
  796. margin-top: 30rpx;
  797. }
  798. }
  799. </style>