goods.vue 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908
  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. isSubmitting: false, // 是否正在提交订单(防重复点击)
  169. isGettingKey: false // 是否正在获取订单key(防重复调用接口)
  170. };
  171. },
  172. onLoad(options) {
  173. // console.log("商品详情options", options)
  174. if (options.productId) {
  175. this.productId = options.productId;
  176. }
  177. this.liveId = options.liveId
  178. this.goodsId = options.goodsId
  179. if (options.storeId) {
  180. this.storeId = options.storeId || ""
  181. } else {
  182. uni.showToast({
  183. title: "storeId不存在~",
  184. icon: "none"
  185. })
  186. }
  187. this.getliveGoods()
  188. },
  189. onShow() {
  190. // 页面显示时重置标志位,允许从确认订单页面返回后再次购买
  191. this.isSubmitting = false;
  192. this.isGettingKey = false;
  193. },
  194. methods: {
  195. // swiper变化事件
  196. swiperChange(event) {
  197. this.activeBanner = event.detail.current + 1
  198. },
  199. doAddCart(type) {
  200. // 防止重复提交:如果正在处理中,直接返回
  201. if (this.isSubmitting) {
  202. uni.showToast({
  203. icon: 'none',
  204. title: '订单正在处理中,请勿重复点击'
  205. });
  206. return;
  207. }
  208. // 检查限购数量
  209. if (this.remainingPurchaseLimit !== null && typeof this.remainingPurchaseLimit === 'number') {
  210. // 如果限购数量为0,提示库存不足
  211. if (this.remainingPurchaseLimit === 0) {
  212. this.$refs.customToast.show({
  213. title:`该商品限购:${this.purchaseLimit}件\n已达购买上限`,
  214. duration: 2000
  215. });
  216. return;
  217. }
  218. // 如果购买数量超过限购数量,提示
  219. if (this.totalNum > this.remainingPurchaseLimit) {
  220. this.$refs.customToast.show({
  221. title: "购买数量不能超过限购数量:" + this.remainingPurchaseLimit,
  222. duration: 2000
  223. });
  224. return;
  225. }
  226. }
  227. if (this.totalNum == 0) {
  228. uni.showToast({
  229. icon: 'none',
  230. title: "购买商品数量必须大于0",
  231. });
  232. return;
  233. }
  234. var isBuy = type == "buy" ? 1 : 0;
  235. if (type == "buy") {
  236. // 标记正在提交
  237. this.isSubmitting = true;
  238. this.getKey();
  239. } else {
  240. // 标记正在提交
  241. this.isSubmitting = true;
  242. setTimeout(() => {
  243. uni.showToast({
  244. icon: 'success',
  245. title: "添加成功",
  246. });
  247. // 延迟清除标志位
  248. this.isSubmitting = false;
  249. }, 300);
  250. }
  251. },
  252. // 获得key
  253. getKey() {
  254. // 防止重复调用:如果正在获取key,直接返回
  255. if (this.isGettingKey) {
  256. console.log('正在获取订单key,请勿重复点击');
  257. return;
  258. }
  259. // 标记正在获取key
  260. this.isGettingKey = true;
  261. liveOrderKey().then(res => {
  262. if (res.code == 200) {
  263. // console.log("下订单的key>>>>", res)
  264. this.orderKey = res.orderKey
  265. // 跳转前清除标志位
  266. this.isSubmitting = false;
  267. this.isGettingKey = false;
  268. uni.navigateTo({
  269. url: '/pages_shopping/live/confirmCreateOrder?&orderKey=' + this.orderKey +
  270. '&liveId=' + this.liveId + '&goodsId=' + this.goodsId +
  271. '&productId=' + this.productId + '&totalNum=' + this.totalNum +
  272. "&productValueSelect=" + this.productValueSelect.id
  273. })
  274. } else {
  275. // 错误时清除标志位
  276. this.isSubmitting = false;
  277. this.isGettingKey = false;
  278. uni.showToast({
  279. title: res.msg,
  280. icon: 'none'
  281. });
  282. }
  283. },
  284. rej => {
  285. // 请求失败时清除标志位
  286. this.isSubmitting = false;
  287. this.isGettingKey = false;
  288. console.error('获取订单key失败:', rej);
  289. }
  290. );
  291. },
  292. // // 选择商品数量
  293. // goodsNumChange(e) {
  294. // console.log('当前选择商品数量为: ' + e.value)
  295. // this.totalNum = e.value
  296. // if (this.totalNum < 1) {
  297. // this.totalNum = 1
  298. // }
  299. // if (this.totalNum >= this.productValueSelect.stock) {
  300. // this.totalNum = this.productValueSelect.stock
  301. // }
  302. // if(this.totalNum > this.remainingPurchaseLimit){
  303. // this.totalNum = this.remainingPurchaseLimit
  304. // uni.showToast({
  305. // icon: 'none',
  306. // title: "该商品限购:"+this.remainingPurchaseLimit+"次"+",已达购买上限",
  307. // });
  308. // }
  309. // },
  310. // 提交
  311. submit() {
  312. this.specVisible = false
  313. this.doAddCart(this.type);
  314. },
  315. // 加入购物车
  316. addCart(type) {
  317. if (type == 'buy') {
  318. let userInfoStr = uni.getStorageSync('userInfo');
  319. if(Object.prototype.toString.call(userInfoStr) == '[object String]'){
  320. userInfoStr = JSON.parse(userInfoStr)
  321. }
  322. if (!userInfoStr || userInfoStr && !userInfoStr.maOpenId) {
  323. uni.navigateTo({
  324. url: '/pages/auth/login'
  325. });
  326. return;
  327. }
  328. }
  329. this.type = type;
  330. this.specVisible = true
  331. },
  332. //商品详情
  333. getliveGoods() {
  334. if (!this.productId) return;
  335. uni.showLoading({
  336. title: '加载中'
  337. });
  338. liveGoodsDetail(this.productId).then(res => {
  339. uni.hideLoading()
  340. if (res.code == 200) {
  341. this.goosDetail = res.product
  342. this.banner = res.product.sliderImage.split(',');
  343. this.remainingPurchaseLimit=res.remainingPurchaseLimit
  344. // 如果接口返回了总限购数量,也保存
  345. if (res.product.purchaseLimit !== null) {
  346. this.purchaseLimit = res.product.purchaseLimit;
  347. }
  348. this.attrs = res.productAttr;
  349. this.attrs.forEach((item, index, arr) => {
  350. item.values = item.attrValues.split(',');
  351. item.index = 0
  352. });
  353. this.values = res.productValues;
  354. this.choseSpec(0, 0)
  355. } else {
  356. uni.showToast({
  357. title: res.msg,
  358. icon: 'none'
  359. });
  360. }
  361. },
  362. rej => {}
  363. );
  364. },
  365. getValueSelect() {
  366. var valueSelect = this.values.filter((item) => {
  367. return item.sku == this.selectVal;
  368. });
  369. return valueSelect;
  370. },
  371. // 规格选择
  372. choseSpec(index, subIndex) {
  373. this.attrs[index].index = subIndex;
  374. this.$forceUpdate();
  375. let productAttr = this.attrs;
  376. let values = [];
  377. for (let i = 0; i < productAttr.length; i++) {
  378. for (let j = 0; j < productAttr[i].values.length; j++) {
  379. if (productAttr[i].index === j) { //筛选出默认规格
  380. values.push(productAttr[i].values[j]);
  381. }
  382. }
  383. }
  384. let selectVal = values.sort().join(","); //返回值:默认
  385. this.selectVal = selectVal;
  386. // var valueSelect=this.values.filter((item)=>{
  387. // return item.sku==selectVal;
  388. // });
  389. var valueSelect = this.getValueSelect();
  390. console.log("qxj valueSelect:" + valueSelect);
  391. if (valueSelect != null && valueSelect.length > 0) {
  392. this.productValueSelect = valueSelect[0];
  393. }
  394. console.log("qxj productValueSelect:" + JSON.stringify(this.productValueSelect));
  395. this.updateSpecNum();
  396. },
  397. //更新数量
  398. updateSpecNum() {
  399. if (this.productValueSelect.stock == 0) {
  400. this.totalNum = 0;
  401. } else {
  402. this.totalNum = 1;
  403. }
  404. },
  405. changeNum(e) {
  406. this.totalNum = e.detail.value.replace(/\D/g, '')
  407. if (this.totalNum < 1) {
  408. this.totalNum = 1
  409. }
  410. if (this.totalNum >= this.productValueSelect.stock) {
  411. this.totalNum = this.productValueSelect.stock
  412. }
  413. if(this.totalNum > this.remainingPurchaseLimit && this.remainingPurchaseLimit!==null){
  414. this.totalNum = this.remainingPurchaseLimit;
  415. this.$refs.customToast.show({
  416. title: `该商品限购:${this.remainingPurchaseLimit}件\n已达购买上限`,
  417. duration: 2000
  418. });
  419. // uni.showToast({
  420. // icon: 'none',
  421. // title: "该商品限购:"+this.remainingPurchaseLimit+"次"+",已达购买上限",
  422. // });
  423. }
  424. },
  425. // 数量减法
  426. lessNum() {
  427. this.totalNum--
  428. if (this.totalNum < 1) {
  429. this.totalNum = 1
  430. }
  431. if (this.totalNum >= this.productValueSelect.stock) {
  432. this.totalNum = this.productValueSelect.stock
  433. }
  434. },
  435. // 数量加法
  436. addNum() {
  437. this.totalNum++
  438. if (this.totalNum >= this.productValueSelect.stock) {
  439. this.totalNum = this.productValueSelect.stock
  440. }
  441. if(this.totalNum > this.remainingPurchaseLimit && this.remainingPurchaseLimit!==null){
  442. this.totalNum = this.remainingPurchaseLimit;
  443. this.$refs.customToast.show({
  444. title: `该商品限购:${this.remainingPurchaseLimit}件\n已达购买上限`,
  445. duration: 2000
  446. });
  447. // uni.showToast({
  448. // icon: 'none',
  449. // title: "该商品限购:"+this.remainingPurchaseLimit+"次"+",已达购买上限",
  450. // });
  451. }
  452. }
  453. }
  454. }
  455. </script>
  456. <style lang="scss">
  457. [v-cloak] {
  458. display: none;
  459. }
  460. .content {
  461. font-family: PingFang SC;
  462. }
  463. .shop-banner {
  464. height: 756rpx;
  465. background-color: #FFFFFF;
  466. position: relative;
  467. .swiper-item {
  468. box-sizing: border-box;
  469. position: relative;
  470. }
  471. .swiper,
  472. .swiper-item,
  473. .swiper-item image {
  474. width: 100%;
  475. height: 100%;
  476. }
  477. .banner-mask {
  478. width: 100%;
  479. height: 44rpx;
  480. position: absolute;
  481. left: 0;
  482. bottom: 0;
  483. z-index: 9;
  484. background-size: 20rpx 44rpx;
  485. background-repeat: repeat-x;
  486. }
  487. .num-box {
  488. width: 80rpx;
  489. height: 40rpx;
  490. line-height: 40rpx;
  491. text-align: center;
  492. font-size: 24rpx;
  493. color: #FFFFFF;
  494. background: rgba(0, 0, 0, .7);
  495. border-radius: 20rpx;
  496. position: absolute;
  497. right: 40rpx;
  498. bottom: 34rpx;
  499. z-index: 10;
  500. }
  501. }
  502. .guige {
  503. padding: 24rpx;
  504. border-radius: 16rpx;
  505. background: #fff;
  506. width: auto;
  507. font-size: 24rpx;
  508. color: #222426;
  509. margin: 24rpx;
  510. .safe-box {
  511. display: flex;
  512. align-items: center;
  513. padding-top: 24rpx;
  514. font-size: 24rpx;
  515. color: #222426;
  516. .text {
  517. color: #999999;
  518. margin-right: 40rpx;
  519. }
  520. .box {
  521. display: flex;
  522. align-items: center;
  523. image {
  524. width: 28rpx;
  525. height: 28rpx;
  526. margin-right: 10rpx;
  527. }
  528. view {
  529. display: flex;
  530. align-items: center;
  531. margin-right: 40rpx;
  532. &:last-child {
  533. margin-right: 0;
  534. image {
  535. margin-right: 0;
  536. }
  537. }
  538. }
  539. }
  540. }
  541. }
  542. .det-info {
  543. background: #FFFFFF;
  544. padding: 24rpx;
  545. margin: 24rpx;
  546. border-radius: 16rpx;
  547. .price-box {
  548. display: flex;
  549. align-items: flex-end;
  550. justify-content: space-between;
  551. .price {
  552. display: flex;
  553. align-items: flex-end;
  554. .label {
  555. font-weight: 500;
  556. font-size: 24rpx;
  557. color: #FF5030;
  558. line-height: 1.3;
  559. margin-right: 10rpx;
  560. }
  561. .unit {
  562. font-size: 26rpx;
  563. font-weight: bold;
  564. color: #FF6633;
  565. line-height: 1.3;
  566. }
  567. .num {
  568. font-size: 48rpx;
  569. font-weight: bold;
  570. color: #FF5030;
  571. margin-right: 20rpx;
  572. line-height: 1;
  573. }
  574. .old {
  575. font-size: 24rpx;
  576. font-family: PingFang SC;
  577. font-weight: 400;
  578. text-decoration: line-through;
  579. color: #898E91;
  580. margin-left: 10rpx;
  581. line-height: 1.3;
  582. }
  583. }
  584. }
  585. .name-box {
  586. font-size: 32rpx;
  587. font-weight: bold;
  588. color: #111111;
  589. line-height: 44rpx;
  590. margin-top: 32rpx;
  591. .tag {
  592. display: inline-block;
  593. padding: 2rpx 8rpx;
  594. height: 32rpx;
  595. background: #F5A623;
  596. border-radius: 4rpx;
  597. margin-right: 10rpx;
  598. font-weight: 400;
  599. font-size: 20rpx;
  600. color: #FFFFFF;
  601. line-height: 30rpx;
  602. float: left;
  603. margin-top: 7rpx;
  604. }
  605. .limit-info {
  606. font-size: 32rpx;
  607. font-weight: 500;
  608. color: #FF6633;
  609. margin-top: 16rpx;
  610. line-height: 1;
  611. }
  612. }
  613. }
  614. .det-box {
  615. margin-top: 10rpx;
  616. background-color: #FFFFFF;
  617. padding: 24rpx;
  618. margin: 24rpx 24rpx 175rpx 24rpx;
  619. border-radius: 16rpx;
  620. .title {
  621. font-size: 32rpx;
  622. font-weight: bold;
  623. color: #333333;
  624. line-height: 60rpx;
  625. margin-bottom: 30rpx;
  626. padding-bottom: 24rpx;
  627. border-bottom: 1px solid #ECECEC;
  628. }
  629. .inner {
  630. margin-bottom: 100rpx;
  631. }
  632. }
  633. .btn-foot {
  634. box-sizing: border-box;
  635. width: 100%;
  636. height: 151rpx;
  637. background: #FFFFFF;
  638. padding: 0 24rpx;
  639. display: flex;
  640. align-items: center;
  641. justify-content: space-between;
  642. position: fixed;
  643. left: 0;
  644. bottom: 0;
  645. z-index: 99;
  646. .menu-box {
  647. display: flex;
  648. align-items: center;
  649. }
  650. .btn-box {
  651. display: flex;
  652. align-items: center;
  653. .btn {
  654. width: 200rpx;
  655. height: 88rpx;
  656. line-height: 88rpx;
  657. text-align: center;
  658. border-radius: 44rpx;
  659. margin-left: 20rpx;
  660. font-size: 28rpx;
  661. font-weight: bold;
  662. color: #FFFFFF;
  663. &:first-child {
  664. margin-left: 0;
  665. }
  666. &.buy {
  667. background: #2bc7b9;
  668. }
  669. }
  670. }
  671. }
  672. .product-spec {
  673. padding-bottom: 30rpx;
  674. .pro-info {
  675. display: flex;
  676. align-items: center;
  677. .img-box {
  678. width: 200rpx;
  679. height: 200rpx;
  680. background: #FFFFFF;
  681. border-radius: 16rpx;
  682. overflow: hidden;
  683. margin-right: 30rpx;
  684. image {
  685. width: 100%;
  686. height: 100%;
  687. }
  688. }
  689. .info-text {
  690. height: 200rpx;
  691. display: flex;
  692. flex-direction: column;
  693. justify-content: space-between;
  694. .info-title {
  695. font-family: PingFang SC;
  696. font-weight: 600;
  697. font-size: 28rpx;
  698. color: #222426;
  699. text-align: left;
  700. }
  701. .price {
  702. display: flex;
  703. align-items: flex-end;
  704. .label {
  705. font-weight: 500;
  706. font-size: 24rpx;
  707. color: #FF5030;
  708. line-height: 1.3;
  709. margin-right: 10rpx;
  710. }
  711. .unit {
  712. font-size: 32rpx;
  713. font-weight: bold;
  714. color: #FF6633;
  715. line-height: 1.2;
  716. margin-right: 10rpx;
  717. }
  718. .num {
  719. font-size: 50rpx;
  720. font-weight: bold;
  721. color: #FF6633;
  722. line-height: 1;
  723. }
  724. }
  725. .desc-box {
  726. display: flex;
  727. flex-direction: column;
  728. padding-bottom: 9rpx;
  729. .text {
  730. font-size: 26rpx;
  731. font-weight: 500;
  732. color: #999999;
  733. margin-top: 27rpx;
  734. line-height: 1;
  735. &:first-child {
  736. margin-top: 0;
  737. }
  738. }
  739. }
  740. }
  741. }
  742. .spec-box {
  743. padding-top: 50upx;
  744. .title {
  745. font-size: 34upx;
  746. font-family: PingFang SC;
  747. font-weight: bold;
  748. color: #111111;
  749. line-height: 1;
  750. }
  751. .spec-list {
  752. display: flex;
  753. flex-wrap: wrap;
  754. margin-top: 30upx;
  755. .item {
  756. box-sizing: border-box;
  757. height: 64upx;
  758. padding: 0 30upx;
  759. line-height: 64upx;
  760. font-size: 28upx;
  761. font-family: PingFang SC;
  762. font-weight: 500;
  763. color: #111111;
  764. background: #F7F7F7;
  765. border: 1px solid #F7F7F7;
  766. border-radius: 32upx;
  767. margin-right: 20upx;
  768. margin-bottom: 30upx;
  769. &.active {
  770. background: #F1FFFE;
  771. border: 1px solid #8AD5CE;
  772. color: #2BC7B9;
  773. }
  774. }
  775. }
  776. }
  777. .price-num {
  778. display: flex;
  779. align-items: center;
  780. justify-content: space-between;
  781. margin-top: 30rpx;
  782. .label {
  783. font-size: 36rpx;
  784. font-weight: bold;
  785. color: #111111;
  786. }
  787. .num-box {
  788. display: flex;
  789. align-items: center;
  790. .img-box {
  791. width: 60upx;
  792. height: 60upx;
  793. // border-radius: 4upx;
  794. border: 1px solid #dddddd;
  795. display: flex;
  796. align-items: center;
  797. justify-content: center;
  798. image {
  799. width: 25rpx;
  800. height: 25rpx;
  801. }
  802. }
  803. input {
  804. width: 60upx;
  805. height: 60upx;
  806. line-height: 60upx;
  807. font-size: 28upx;
  808. font-family: PingFang SC;
  809. font-weight: 500;
  810. color: #111111;
  811. // border-radius: 4upx;
  812. border-top: 1px solid #dddddd;
  813. border-bottom: 1px solid #dddddd;
  814. text-align: center;
  815. // margin: 0 16upx;
  816. }
  817. }
  818. }
  819. .sub-btn {
  820. width: 100%;
  821. height: 88rpx;
  822. line-height: 88rpx;
  823. text-align: center;
  824. font-size: 32rpx;
  825. font-weight: bold;
  826. color: #FFFFFF;
  827. background: #2BC7B9;
  828. border-radius: 44rpx;
  829. margin-top: 30rpx;
  830. }
  831. }
  832. </style>