productDetails.vue 21 KB

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