productDetails.vue 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926
  1. <template>
  2. <view class="content">
  3. <!-- 商品轮播图片 -->
  4. <view class="shop-banner" @click="showImg()">
  5. <swiper
  6. class="swiper"
  7. :indicator-dots="false"
  8. :circular="true"
  9. :autoplay="true"
  10. :interval="3000"
  11. :duration="1000"
  12. indicator-color="rgba(255, 255, 255, 0.6)"
  13. indicator-active-color="#ffffff"
  14. @change="swiperChange"
  15. >
  16. <swiper-item class="swiper-item" v-for="(item,index) in banner" :key="index">
  17. <image :src="item" mode="aspectFill"></image>
  18. </swiper-item>
  19. </swiper>
  20. <!-- 底部遮罩 -->
  21. <view class="banner-mask"></view>
  22. <!-- 数量 -->
  23. <view class="num-box">{{ activeBanner }}/{{ banner.length }}</view>
  24. </view>
  25. <!-- 详细信息 -->
  26. <view class="det-info">
  27. <view class="price-box">
  28. <view class="price">
  29. <text class="label">会员价</text>
  30. <text class="unit">¥</text>
  31. <text class="num" >{{product.price}}</text>
  32. <text class="label">零售价</text>
  33. <text class="old" >¥{{product.otPrice}}</text>
  34. </view>
  35. </view>
  36. <view class="name-box">
  37. <view class="tag">{{utils.getDictLabelName("storeProductType",product.productType)}}</view>{{product.productName}}
  38. </view>
  39. <view class="intro">
  40. {{product.productInfo}}
  41. </view>
  42. <view class="safe-box">
  43. <image src="../../static/images/safe.png" mode=""></image>
  44. <text class="text">品质保障</text>
  45. <view class="line"></view>
  46. <text class="text">药师服务</text>
  47. <view class="line"></view>
  48. <text class="text">隐私保护</text>
  49. </view>
  50. </view>
  51. <!-- 购买人数、库存 -->
  52. <view class="inventor">
  53. <view class="left">
  54. <!-- <view class="head-box">
  55. <view class="head" v-for="(item,j) in 5" :key="j">
  56. <image src="../../static/images/head.jpg" mode=""></image>
  57. </view>
  58. </view> -->
  59. <view class="num-box">
  60. 已有 <text class="text">{{product.sales}}</text> 人购买
  61. </view>
  62. </view>
  63. <!-- <view class="right">
  64. 库存 <text class="text">{{product.stock}}{{product.unitName}}</text>
  65. </view> -->
  66. <!-- <view class="right">
  67. <text class="text">库存{{product.stock>0?'充足':'售罄'}} </text>
  68. </view> -->
  69. </view>
  70. <!-- 功效 -->
  71. <!-- <view class="effect">
  72. <view class="label">药品说明书</view>
  73. <view class="label">查看</view>
  74. </view> -->
  75. <!-- 图文详情 -->
  76. <view class="det-box">
  77. <view class="title">图文详情</view>
  78. <view class="inner">
  79. <view v-html="product.description" style="font-size:0"></view>
  80. </view>
  81. </view>
  82. <!-- 底部按钮 -->
  83. <view class="btn-foot">
  84. <view class="menu-box">
  85. <view class="item" @click="goHome">
  86. <image src="../../static/images/back_home.png" mode=""></image>
  87. <text class="label">首页</text>
  88. </view>
  89. <view class="item" style="position: relative;">
  90. <image src="../../static/images/consult_small.png" mode=""></image>
  91. <text class="label">咨询</text>
  92. <button class="contact-btn" open-type="contact"></button>
  93. </view>
  94. <view class="item" @click="navgetTo('./cart')">
  95. <uni-badge size="small" :text="cartCount" absolute="rightTop" type="error">
  96. <image src="../../static/images/cart36.png" mode=""></image>
  97. </uni-badge>
  98. <text class="label">购物车</text>
  99. </view>
  100. </view>
  101. <view class="btn-box">
  102. <view class="btn cart" @click="addCart('cart')">加入购物车</view>
  103. <!-- <view class="btn buy" @click="addCart('buy')">{{buyText}}</view> -->
  104. </view>
  105. </view>
  106. <!-- 选择药品规格弹窗 -->
  107. <popupBottom ref="popup" :visible.sync="specVisible" title=" " radius="32" maxHeight="1024">
  108. <view class="product-spec">
  109. <!-- 商品信息 -->
  110. <view class="pro-info">
  111. <view class="img-box">
  112. <image :src="productValueSelect.image==null||productValueSelect.image==''?product.image:productValueSelect.image" mode="aspectFill"></image>
  113. </view>
  114. <view class="info-text">
  115. <view class="price">
  116. <text class="unit">¥</text>
  117. <text class="num">{{ productValueSelect.price.toFixed(2) }}</text>
  118. </view>
  119. <view class="desc-box">
  120. <text class="text">已选:{{ productValueSelect.sku }}</text>
  121. <text class="text">库存{{ productValueSelect.stock?'充足':'售罄' }}</text>
  122. </view>
  123. </view>
  124. </view>
  125. <!-- 规格 -->
  126. <view class="spec-box">
  127. <view v-for="(item,index) in attrs">
  128. <view class="title">{{item.attrName}}</view>
  129. <view class="spec-list">
  130. <view
  131. v-for="(subItem,subindex) in item.values"
  132. :key="subindex"
  133. :class="subindex==item.index?'item active':'item'"
  134. @click="choseSpec(index,subindex)"
  135. >
  136. {{ subItem }}
  137. </view>
  138. </view>
  139. </view>
  140. </view>
  141. <!-- 数量 -->
  142. <view class="price-num">
  143. <view class="label">数量</view>
  144. <view class="num-box">
  145. <view class="img-box" @click="lessNum()">
  146. <image v-if="specNum <= 1" src="../../static/images/jian.png" mode=""></image>
  147. <image v-else src="../../static/images/jian2.png" mode=""></image>
  148. </view>
  149. <input type="text" @change="changeNum" v-model="specNum" />
  150. <view class="img-box" @click="addNum()">
  151. <image src="../../static/images/add.png" mode=""></image>
  152. </view>
  153. </view>
  154. </view>
  155. <view class="sub-btn" @click="submit">确定</view>
  156. </view>
  157. </popupBottom>
  158. </view>
  159. </template>
  160. <script>
  161. import {getDicts} from '@/api/index'
  162. import {getProductDetails,getCartCount,addCart} from '@/api/product'
  163. import popupBottom from '@/components/px-popup-bottom/px-popup-bottom.vue'
  164. export default {
  165. components: {
  166. item:{},
  167. popupBottom
  168. },
  169. data() {
  170. return {
  171. buyText:"立即购买",
  172. type:null,
  173. productValueSelect:{
  174. price:0,
  175. },
  176. banner:[],
  177. productId:null,
  178. attrs:[],
  179. values:[],
  180. product:{
  181. price:0,
  182. otPrice:0,
  183. },
  184. // 当前轮播的图片
  185. activeBanner: 0,
  186. // 购物车数量
  187. cartCount: 0,
  188. // 规格弹窗
  189. specVisible: false,
  190. // 规格数量
  191. specNum: 1,
  192. };
  193. },
  194. onLoad(options) {
  195. this.getDicts();
  196. this.productId = options.productId;
  197. if(this.utils.checkToken()){
  198. this.getCartCount();
  199. }
  200. },
  201. onShow() {
  202. this.getProductDetails();
  203. },
  204. methods: {
  205. getDicts:function(){
  206. getDicts().then(
  207. res => {
  208. if(res.code==200){
  209. uni.setStorageSync('dicts',JSON.stringify(res));
  210. }
  211. },
  212. rej => {}
  213. );
  214. },
  215. showImg() {
  216. //预览图片
  217. uni.previewImage({
  218. urls: this.banner,
  219. current: this.banner[0]
  220. });
  221. },
  222. doAddCart(type){
  223. if(this.specNum==0){
  224. uni.showToast({
  225. icon:'none',
  226. title: "库存不足",
  227. });
  228. return;
  229. }
  230. var isBuy=type=="buy"?1:0;
  231. let data = {isBuy:isBuy,cartNum:this.specNum,productId:this.productValueSelect.productId,attrValueId:this.productValueSelect.id};
  232. addCart(data).then(
  233. res => {
  234. if(res.code==200){
  235. if(type=="buy"){
  236. uni.navigateTo({
  237. url: '/pages/shopping/confirmOrder?type='+this.type+"&cartIds="+res.id
  238. })
  239. }
  240. else
  241. {
  242. this.getCartCount()
  243. uni.showToast({
  244. icon:'success',
  245. title: "添加成功",
  246. });
  247. }
  248. }else{
  249. uni.showToast({
  250. icon:'none',
  251. title: res.msg,
  252. });
  253. this.getProductDetails()
  254. }
  255. },
  256. rej => {}
  257. );
  258. },
  259. getProductDetails(){
  260. let data = {productId:this.productId};
  261. getProductDetails(data).then(
  262. res => {
  263. if(res.code==200){
  264. this.product=res.product;
  265. if(this.product.productType==1){
  266. this.buyText="立即购买"
  267. }
  268. else if(this.product.productType==2){
  269. this.buyText="提交需求"
  270. }
  271. this.product.otPrice=this.product.otPrice.toFixed(2);
  272. this.product.price=this.product.price.toFixed(2);
  273. if(this.product.sliderImage!=null){
  274. this.banner=this.product.sliderImage.split(',');
  275. }
  276. else{
  277. this.banner=[]
  278. }
  279. this.attrs=res.productAttr;
  280. this.attrs.forEach((item,index,arr)=>{
  281. item.values=item.attrValues.split(',');
  282. item.index=0
  283. })
  284. this.values=res.productValues;
  285. console.log(this.values)
  286. this.choseSpec(0,0)
  287. }else{
  288. uni.showToast({
  289. icon:'none',
  290. title: res.msg,
  291. });
  292. setTimeout(function(){
  293. uni.reLaunch({
  294. url: '/pages/home/index',
  295. })
  296. },2000)
  297. }
  298. },
  299. rej => {}
  300. );
  301. },
  302. getCartCount(){
  303. let data = {productId:this.productId};
  304. getCartCount(data).then(
  305. cartRes => {
  306. if(cartRes.code==200){
  307. this.cartCount=cartRes.data;
  308. }
  309. },
  310. rej => {}
  311. );
  312. },
  313. // swiper变化事件
  314. swiperChange(event) {
  315. this.activeBanner = event.detail.current + 1
  316. },
  317. // 回到首页
  318. goHome() {
  319. uni.switchTab({
  320. url: '/pages/home/index'
  321. })
  322. },
  323. // 跳转页面
  324. navgetTo(url) {
  325. this.utils.isLogin().then(res => {
  326. if(res){
  327. uni.navigateTo({
  328. url: url
  329. })
  330. }
  331. })
  332. },
  333. // 加入购物车
  334. addCart(type) {
  335. this.utils.isLogin().then(res => {
  336. if(res){
  337. this.type=type;
  338. this.specVisible = true
  339. }
  340. })
  341. },
  342. // 规格选择
  343. choseSpec(index,subIndex) {
  344. this.attrs[index].index = subIndex;
  345. this.$forceUpdate();
  346. let productAttr = this.attrs;
  347. let values = [];
  348. for (let i = 0; i < productAttr.length; i++) {
  349. for (let j = 0; j < productAttr[i].values.length; j++) {
  350. if (productAttr[i].index === j) {
  351. values.push(productAttr[i].values[j]);
  352. }
  353. }
  354. }
  355. var selectVal=values.sort().join(",");
  356. console.log(selectVal)
  357. var valueSelect=this.values.filter((item)=>{
  358. return item.sku==selectVal;
  359. })
  360. if(valueSelect!=null&&valueSelect.length==1){
  361. this.productValueSelect=valueSelect[0];
  362. }
  363. this.updateSpecNum();
  364. },
  365. changeNum(e) {
  366. this.specNum = e.detail.value.replace(/\D/g, '')
  367. if(this.specNum < 1) {
  368. this.specNum = 1
  369. }
  370. if(this.specNum>=this.productValueSelect.stock){
  371. this.specNum=this.productValueSelect.stock
  372. }
  373. },
  374. //更新数量
  375. updateSpecNum(){
  376. if(this.productValueSelect.stock==0){
  377. this.specNum=0;
  378. }
  379. else{
  380. this.specNum=1;
  381. }
  382. },
  383. // 数量减法
  384. lessNum(index) {
  385. this.specNum--
  386. if(this.specNum < 1) {
  387. this.specNum = 1
  388. }
  389. if(this.specNum>=this.productValueSelect.stock){
  390. this.specNum=this.productValueSelect.stock
  391. }
  392. },
  393. // 数量加法
  394. addNum(index) {
  395. this.specNum++
  396. if(this.specNum>=this.productValueSelect.stock){
  397. this.specNum=this.productValueSelect.stock
  398. }
  399. },
  400. // 确定选择该规格
  401. submit() {
  402. this.specVisible = false
  403. this.doAddCart(this.type);
  404. }
  405. }
  406. }
  407. </script>
  408. <style lang="scss">
  409. .shop-banner{
  410. height: 756upx;
  411. background-color: #FFFFFF;
  412. position: relative;
  413. .swiper-item{
  414. box-sizing: border-box;
  415. }
  416. .swiper,
  417. .swiper-item,
  418. .swiper-item image{
  419. width: 100%;
  420. height: 100%;
  421. }
  422. .banner-mask{
  423. width: 100%;
  424. height: 44upx;
  425. // background: linear-gradient(0deg, rgba(0, 0, 0, 0.04), rgba(0, 0, 0, 0));
  426. // opacity: 0.8;
  427. position: absolute;
  428. left: 0;
  429. bottom: 0;
  430. z-index: 9;
  431. background-image: url(../../static/images/black_mask.png);
  432. background-size: 20upx 44upx;
  433. background-repeat: repeat-x;
  434. }
  435. .num-box{
  436. width: 80upx;
  437. height: 44upx;
  438. line-height: 44upx;
  439. text-align: center;
  440. font-size: 24upx;
  441. font-family: PingFang SC;
  442. font-weight: 500;
  443. color: #FFFFFF;
  444. background: rgba(0, 0, 0, .3);
  445. border-radius: 22upx;
  446. position: absolute;
  447. right: 30upx;
  448. bottom: 30upx;
  449. z-index: 10;
  450. }
  451. }
  452. .det-info{
  453. background: #FFFFFF;
  454. padding: 36upx 30upx 25upx;
  455. .price-box{
  456. display: flex;
  457. align-items: center;
  458. justify-content: space-between;
  459. .price{
  460. display: flex;
  461. align-items: flex-end;
  462. .label{
  463. color: #333;
  464. font-size: 28upx;
  465. font-family: PingFang SC;
  466. line-height: 1.3;
  467. margin-right: 5upx;
  468. }
  469. .unit{
  470. font-size: 28upx;
  471. font-family: PingFang SC;
  472. font-weight: bold;
  473. color: #FF6633;
  474. line-height: 1.3;
  475. }
  476. .num{
  477. font-size: 40upx;
  478. font-family: PingFang SC;
  479. font-weight: bold;
  480. color: #FF6633;
  481. margin: 0 20upx 0 10upx;
  482. line-height: 1;
  483. }
  484. .old{
  485. font-size: 28upx;
  486. font-family: PingFang SC;
  487. font-weight: 500;
  488. text-decoration: line-through;
  489. color: #BBBBBB;
  490. line-height: 1.3;
  491. }
  492. }
  493. .share-box{
  494. width: 120upx;
  495. height: 46upx;
  496. border: 1px solid #2BC7B9;
  497. border-radius: 23upx;
  498. display: flex;
  499. align-items: center;
  500. justify-content: center;
  501. position: relative;
  502. .text{
  503. font-size: 26upx;
  504. font-family: PingFang SC;
  505. font-weight: 500;
  506. color: #2BC7B9;
  507. }
  508. image{
  509. margin-left: 2rpx;
  510. width: 25upx;
  511. height: 24upx;
  512. }
  513. .share{
  514. display: inline-block;
  515. position: absolute;
  516. top: 0;
  517. left: 0;
  518. width: 100%;
  519. height: 100%rpx;
  520. opacity: 0;
  521. }
  522. }
  523. .spec{
  524. font-size: 24upx;
  525. font-family: PingFang SC;
  526. font-weight: 500;
  527. color: #999999;
  528. line-height: 36upx;
  529. }
  530. }
  531. .name-box{
  532. font-size: 32upx;
  533. font-family: PingFang SC;
  534. font-weight: bold;
  535. color: #111111;
  536. line-height: 44upx;
  537. margin-top: 32upx;
  538. .tag{
  539. display: inline-block;
  540. padding: 0 6upx;
  541. height: 30upx;
  542. background: linear-gradient(90deg, #2BC7B9 0%, #2BC7A4 100%);
  543. border-radius: 4upx;
  544. margin-right: 10upx;
  545. font-size: 22upx;
  546. font-family: PingFang SC;
  547. font-weight: bold;
  548. color: #FFFFFF;
  549. line-height: 30upx;
  550. float: left;
  551. margin-top: 7upx;
  552. }
  553. }
  554. .intro{
  555. font-size: 26upx;
  556. font-family: PingFang SC;
  557. font-weight: 500;
  558. color: #999999;
  559. line-height: 36upx;
  560. padding: 18upx 0 23upx;
  561. border-bottom: 1px solid #f7f7f7;
  562. }
  563. .safe-box{
  564. display: flex;
  565. align-items: center;
  566. padding-top: 24upx;
  567. image{
  568. width: 20upx;
  569. height: 24upx;
  570. margin-right: 20upx;
  571. }
  572. .text{
  573. font-size: 22upx;
  574. font-family: PingFang SC;
  575. font-weight: 500;
  576. color: #999999;
  577. line-height: 1;
  578. }
  579. .line{
  580. width: 1px;
  581. height: 23upx;
  582. background: #EDEEEF;
  583. margin: 0 20upx;
  584. }
  585. }
  586. }
  587. .inventor{
  588. height: 88upx;
  589. padding: 0 39upx 0 30upx;
  590. margin-top: 10upx;
  591. background: #FFFFFF;
  592. display: flex;
  593. align-items: center;
  594. justify-content: space-between;
  595. .left{
  596. display: flex;
  597. align-items: center;
  598. .head-box{
  599. margin-right: 27upx;
  600. display: flex;
  601. align-items: center;
  602. .head{
  603. width: 48upx;
  604. height: 48upx;
  605. border-radius: 50%;
  606. overflow: hidden;
  607. box-shadow: 0 0 0 1px #fff;
  608. margin-right: -10upx;
  609. image{
  610. width: 100%;
  611. height: 100%;
  612. }
  613. }
  614. }
  615. .num-box{
  616. font-size: 24upx;
  617. font-family: PingFang SC;
  618. font-weight: 500;
  619. color: #999999;
  620. .text{
  621. font-size: 24upx;
  622. font-family: PingFang SC;
  623. font-weight: 500;
  624. color: #999999;
  625. }
  626. }
  627. }
  628. .right{
  629. font-size: 24upx;
  630. font-family: PingFang SC;
  631. font-weight: 500;
  632. color: #999999;
  633. .text{
  634. font-size: 24upx;
  635. font-family: PingFang SC;
  636. font-weight: 500;
  637. color: #666666;
  638. }
  639. }
  640. }
  641. .effect{
  642. box-sizing: border-box;
  643. padding: 20upx 30upx;
  644. background: #FFFFFF;
  645. font-size: 28upx;
  646. font-family: PingFang SC;
  647. font-weight: 500;
  648. color: #666666;
  649. line-height: 1.8;
  650. margin-top: 10upx;
  651. display: flex;
  652. flex-direction: row;
  653. align-items: center;
  654. justify-content: space-between;
  655. .label{
  656. font-size: 28upx;
  657. font-family: PingFang SC;
  658. font-weight: 500;
  659. color: #111111;
  660. line-height: 1.8;
  661. }
  662. }
  663. .det-box{
  664. margin-top: 10upx;
  665. padding: 40upx 30upx 130upx 30upx;
  666. background-color: #FFFFFF;
  667. .title{
  668. font-size: 30upx;
  669. font-family: PingFang SC;
  670. font-weight: bold;
  671. color: #333333;
  672. line-height: 1;
  673. margin-bottom: 25upx;
  674. }
  675. }
  676. .btn-foot{
  677. box-sizing: border-box;
  678. width: 100%;
  679. height: 121upx;
  680. background: #FFFFFF;
  681. padding: 0 32upx 0 28upx;
  682. display: flex;
  683. align-items: center;
  684. justify-content: space-between;
  685. position: fixed;
  686. left: 0;
  687. bottom: 0;
  688. z-index: 99;
  689. .menu-box{
  690. display: flex;
  691. align-items: center;
  692. .item{
  693. display: flex;
  694. align-items: center;
  695. flex-direction: column;
  696. margin-right: 48upx;
  697. &:last-child{
  698. margin-right: 0;
  699. }
  700. image{
  701. width: 36upx;
  702. height: 36upx;
  703. margin-bottom: 10upx;
  704. }
  705. .label{
  706. font-size: 20upx;
  707. font-family: PingFang SC;
  708. font-weight: 500;
  709. color: #666666;
  710. text-align: center;
  711. }
  712. }
  713. /deep/.uni-badge--x{
  714. display: flex;
  715. align-items: center;
  716. justify-content: center;
  717. }
  718. /deep/.uni-badge{
  719. border: none;
  720. background-color: #FF3636;
  721. font-family: Roboto;
  722. }
  723. }
  724. .btn-box{
  725. display: flex;
  726. align-items: center;
  727. .btn{
  728. width: 200upx;
  729. height: 88upx;
  730. line-height: 88upx;
  731. text-align: center;
  732. border-radius: 44upx;
  733. margin-left: 20upx;
  734. font-size: 30upx;
  735. font-family: PingFang SC;
  736. font-weight: bold;
  737. color: #FFFFFF;
  738. &:first-child{
  739. margin-left: 0;
  740. }
  741. &.cart{
  742. background: #FF6633;
  743. }
  744. &.buy{
  745. background: #2BC7B9;
  746. }
  747. }
  748. }
  749. }
  750. .product-spec{
  751. .pro-info{
  752. display: flex;
  753. align-items: center;
  754. .img-box{
  755. width: 200upx;
  756. height: 200upx;
  757. background: #FFFFFF;
  758. border-radius: 16upx;
  759. overflow: hidden;
  760. margin-right: 30upx;
  761. image{
  762. width: 100%;
  763. height: 100%;
  764. }
  765. }
  766. .info-text{
  767. height: 200upx;
  768. display: flex;
  769. flex-direction: column;
  770. justify-content: space-between;
  771. .price{
  772. display: flex;
  773. align-items: flex-end;
  774. .unit{
  775. font-size: 32upx;
  776. font-family: PingFang SC;
  777. font-weight: bold;
  778. color: #FF6633;
  779. line-height: 1.2;
  780. margin-right: 10upx;
  781. }
  782. .num{
  783. font-size: 50upx;
  784. font-family: PingFang SC;
  785. font-weight: bold;
  786. color: #FF6633;
  787. line-height: 1;
  788. }
  789. }
  790. .desc-box{
  791. display: flex;
  792. flex-direction: column;
  793. padding-bottom: 9upx;
  794. .text{
  795. font-size: 26upx;
  796. font-family: PingFang SC;
  797. font-weight: 500;
  798. color: #999999;
  799. margin-top: 27upx;
  800. line-height: 1;
  801. &:first-child{
  802. margin-top: 0;
  803. }
  804. }
  805. }
  806. }
  807. }
  808. .spec-box{
  809. padding-top: 50upx;
  810. .title{
  811. font-size: 34upx;
  812. font-family: PingFang SC;
  813. font-weight: bold;
  814. color: #111111;
  815. line-height: 1;
  816. }
  817. .spec-list{
  818. display: flex;
  819. flex-wrap: wrap;
  820. margin-top: 30upx;
  821. .item{
  822. box-sizing: border-box;
  823. height: 64upx;
  824. padding: 0 30upx;
  825. line-height: 64upx;
  826. font-size: 28upx;
  827. font-family: PingFang SC;
  828. font-weight: 500;
  829. color: #111111;
  830. background: #F7F7F7;
  831. border: 1px solid #F7F7F7;
  832. border-radius: 32upx;
  833. margin-right: 20upx;
  834. margin-bottom: 30upx;
  835. &.active{
  836. background: #F1FFFE;
  837. border: 1px solid #8AD5CE;
  838. color: #2BC7B9;
  839. }
  840. }
  841. }
  842. }
  843. .price-num{
  844. display: flex;
  845. align-items: center;
  846. justify-content: space-between;
  847. margin-top: 14upx;
  848. .label{
  849. font-size: 34upx;
  850. font-family: PingFang SC;
  851. font-weight: bold;
  852. color: #111111;
  853. }
  854. .num-box{
  855. display: flex;
  856. align-items: center;
  857. .img-box{
  858. width: 60upx;
  859. height: 60upx;
  860. // border-radius: 4upx;
  861. border: 1px solid #dddddd;
  862. display: flex;
  863. align-items: center;
  864. justify-content: center;
  865. image{
  866. width: 25rpx;
  867. height: 25rpx;
  868. }
  869. }
  870. input{
  871. width: 60upx;
  872. height: 60upx;
  873. line-height: 60upx;
  874. font-size: 28upx;
  875. font-family: PingFang SC;
  876. font-weight: 500;
  877. color: #111111;
  878. // border-radius: 4upx;
  879. border-top: 1px solid #dddddd;
  880. border-bottom: 1px solid #dddddd;
  881. text-align: center;
  882. // margin: 0 16upx;
  883. }
  884. }
  885. }
  886. .sub-btn{
  887. width: 100%;
  888. height: 88upx;
  889. line-height: 88upx;
  890. text-align: center;
  891. font-size: 30upx;
  892. font-family: PingFang SC;
  893. font-weight: bold;
  894. color: #FFFFFF;
  895. background: #2BC7B9;
  896. border-radius: 44upx;
  897. margin-top: 30upx;
  898. // margin-bottom: 30upx;
  899. }
  900. }
  901. .contact-btn{
  902. display: inline-block;
  903. position: absolute;
  904. top: 0;
  905. left: 0;
  906. width: 100%;
  907. height: 100%;
  908. opacity: 0;
  909. z-index: 9999;
  910. }
  911. </style>