productDetails.vue 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957
  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. duration:2000
  231. });
  232. return;
  233. }
  234. var isBuy=type=="buy"?1:0;
  235. let data = {isBuy:isBuy,cartNum:this.specNum,productId:this.productValueSelect.productId,attrValueId:this.productValueSelect.id};
  236. addCart(data).then(
  237. res => {
  238. if(res.code==200){
  239. if(type=="buy"){
  240. uni.navigateTo({
  241. url: '/pages/shopping/confirmOrder?type='+this.type+"&cartIds="+res.id
  242. })
  243. }
  244. else
  245. {
  246. this.getCartCount()
  247. uni.showToast({
  248. icon:'success',
  249. title: "添加成功",
  250. });
  251. }
  252. }else{
  253. uni.showToast({
  254. icon:'none',
  255. title: res.msg,
  256. });
  257. this.getProductDetails()
  258. }
  259. },
  260. rej => {}
  261. );
  262. },
  263. getProductDetails(){
  264. let data = {productId:this.productId};
  265. //uni.showLoading({title:""});
  266. getProductDetails(data).then(res => {
  267. this.loadding=false
  268. if(res.code==200){
  269. this.product=res.product;
  270. if(this.product.productType==1){
  271. this.buyText="立即购买"
  272. }
  273. else if(this.product.productType==2){
  274. this.buyText="提交需求"
  275. }
  276. this.product.otPrice=this.product.otPrice.toFixed(2);
  277. this.product.price=this.product.price.toFixed(2);
  278. if(this.product.sliderImage!=null){
  279. this.banner=this.product.sliderImage.split(',');
  280. }
  281. else{
  282. this.banner=[]
  283. }
  284. this.attrs=res.productAttr;
  285. this.attrs.forEach((item,index,arr)=>{
  286. item.values=item.attrValues.split(',');
  287. item.index=0
  288. })
  289. this.values=res.productValues;
  290. this.choseSpec(0,0)
  291. }else{
  292. uni.showToast({
  293. icon:'none',
  294. title: res.msg,
  295. });
  296. setTimeout(function(){
  297. uni.reLaunch({
  298. url: '/pages/home/index',
  299. })
  300. },2000)
  301. }
  302. },
  303. rej => {}
  304. );
  305. },
  306. getCartCount(){
  307. let data = {productId:this.productId};
  308. getCartCount(data).then(
  309. cartRes => {
  310. if(cartRes.code==200){
  311. this.cartCount=cartRes.data;
  312. }
  313. },
  314. rej => {}
  315. );
  316. },
  317. // swiper变化事件
  318. swiperChange(event) {
  319. this.activeBanner = event.detail.current + 1
  320. },
  321. // 回到首页
  322. goHome() {
  323. uni.switchTab({
  324. url: '/pages/home/index'
  325. })
  326. },
  327. // 跳转页面
  328. navgetTo(url) {
  329. this.utils.isLogin().then(res => {
  330. if(res){
  331. uni.navigateTo({
  332. url: url
  333. })
  334. }
  335. })
  336. },
  337. // 加入购物车
  338. addCart(type) {
  339. this.utils.isLogin().then(res => {
  340. if(res){
  341. this.type=type;
  342. this.specVisible = true
  343. }
  344. })
  345. },
  346. // 规格选择
  347. choseSpec(index,subIndex) {
  348. this.attrs[index].index = subIndex;
  349. this.$forceUpdate();
  350. let productAttr = this.attrs;
  351. let values = [];
  352. for (let i = 0; i < productAttr.length; i++) {
  353. for (let j = 0; j < productAttr[i].values.length; j++) {
  354. if (productAttr[i].index === j) {
  355. values.push(productAttr[i].values[j]);
  356. }
  357. }
  358. }
  359. var selectVal=values.sort().join(",");
  360. console.log(selectVal)
  361. var valueSelect=this.values.filter((item)=>{
  362. return item.sku==selectVal;
  363. })
  364. if(valueSelect!=null&&valueSelect.length==1){
  365. this.productValueSelect=valueSelect[0];
  366. }
  367. this.updateSpecNum();
  368. },
  369. changeNum(e) {
  370. this.specNum = e.detail.value.replace(/\D/g, '')
  371. if(this.specNum < 1) {
  372. this.specNum = 1
  373. }
  374. if(this.specNum>=this.productValueSelect.stock){
  375. this.specNum=this.productValueSelect.stock
  376. }
  377. },
  378. //更新数量
  379. updateSpecNum(){
  380. if(this.productValueSelect.stock==0){
  381. this.specNum=0;
  382. }
  383. else{
  384. this.specNum=1;
  385. }
  386. },
  387. // 数量减法
  388. lessNum(index) {
  389. this.specNum--
  390. if(this.specNum < 1) {
  391. this.specNum = 1
  392. }
  393. if(this.specNum>=this.productValueSelect.stock){
  394. this.specNum=this.productValueSelect.stock
  395. }
  396. },
  397. // 数量加法
  398. addNum(index) {
  399. this.specNum++
  400. if(this.specNum>=this.productValueSelect.stock){
  401. this.specNum=this.productValueSelect.stock
  402. }
  403. },
  404. // 确定选择该规格
  405. submit() {
  406. this.specVisible = false
  407. this.doAddCart(this.type);
  408. }
  409. }
  410. }
  411. </script>
  412. <style lang="scss">
  413. .shop-banner{
  414. height: 756upx;
  415. background-color: #FFFFFF;
  416. position: relative;
  417. .swiper-item{
  418. box-sizing: border-box;
  419. }
  420. .swiper,
  421. .swiper-item,
  422. .swiper-item image{
  423. width: 100%;
  424. height: 100%;
  425. }
  426. .banner-mask{
  427. width: 100%;
  428. height: 44upx;
  429. // background: linear-gradient(0deg, rgba(0, 0, 0, 0.04), rgba(0, 0, 0, 0));
  430. // opacity: 0.8;
  431. position: absolute;
  432. left: 0;
  433. bottom: 0;
  434. z-index: 9;
  435. background-image: url(../../static/images/black_mask.png);
  436. background-size: 20upx 44upx;
  437. background-repeat: repeat-x;
  438. }
  439. .num-box{
  440. width: 80upx;
  441. height: 44upx;
  442. line-height: 44upx;
  443. text-align: center;
  444. font-size: 24upx;
  445. font-family: PingFang SC;
  446. font-weight: 500;
  447. color: #FFFFFF;
  448. background: rgba(0, 0, 0, .3);
  449. border-radius: 22upx;
  450. position: absolute;
  451. right: 30upx;
  452. bottom: 30upx;
  453. z-index: 10;
  454. }
  455. }
  456. .det-info{
  457. background: #FFFFFF;
  458. padding: 36upx 30upx 25upx;
  459. .price-box{
  460. display: flex;
  461. align-items: center;
  462. justify-content: space-between;
  463. .price{
  464. display: flex;
  465. align-items: flex-end;
  466. .label{
  467. color: #333;
  468. font-size: 28upx;
  469. font-family: PingFang SC;
  470. line-height: 1.3;
  471. margin-right: 5upx;
  472. }
  473. .unit{
  474. font-size: 28upx;
  475. font-family: PingFang SC;
  476. font-weight: bold;
  477. color: #FF6633;
  478. line-height: 1.3;
  479. }
  480. .num{
  481. font-size: 40upx;
  482. font-family: PingFang SC;
  483. font-weight: bold;
  484. color: #FF6633;
  485. margin: 0 20upx 0 10upx;
  486. line-height: 1;
  487. }
  488. .old{
  489. font-size: 28upx;
  490. font-family: PingFang SC;
  491. font-weight: 500;
  492. text-decoration: line-through;
  493. color: #BBBBBB;
  494. line-height: 1.3;
  495. }
  496. }
  497. .share-box{
  498. width: 120upx;
  499. height: 46upx;
  500. border: 1px solid#018C39;
  501. border-radius: 23upx;
  502. display: flex;
  503. align-items: center;
  504. justify-content: center;
  505. position: relative;
  506. .text{
  507. font-size: 26upx;
  508. font-family: PingFang SC;
  509. font-weight: 500;
  510. color:#018C39;
  511. }
  512. image{
  513. margin-left: 2rpx;
  514. width: 25upx;
  515. height: 24upx;
  516. }
  517. .share{
  518. display: inline-block;
  519. position: absolute;
  520. top: 0;
  521. left: 0;
  522. width: 100%;
  523. height: 100%rpx;
  524. opacity: 0;
  525. }
  526. }
  527. .spec{
  528. font-size: 24upx;
  529. font-family: PingFang SC;
  530. font-weight: 500;
  531. color: #999999;
  532. line-height: 36upx;
  533. }
  534. }
  535. .name-box{
  536. font-size: 32upx;
  537. font-family: PingFang SC;
  538. font-weight: bold;
  539. color: #111111;
  540. line-height: 44upx;
  541. margin-top: 32upx;
  542. .tag{
  543. display: inline-block;
  544. padding: 0 6upx;
  545. height: 30upx;
  546. background: linear-gradient(90deg,#018C39 0%, #2BC7A4 100%);
  547. border-radius: 4upx;
  548. margin-right: 10upx;
  549. font-size: 22upx;
  550. font-family: PingFang SC;
  551. font-weight: bold;
  552. color: #FFFFFF;
  553. line-height: 30upx;
  554. float: left;
  555. margin-top: 7upx;
  556. }
  557. }
  558. .intro{
  559. font-size: 26upx;
  560. font-family: PingFang SC;
  561. font-weight: 500;
  562. color: #999999;
  563. line-height: 36upx;
  564. padding: 18upx 0 23upx;
  565. border-bottom: 1px solid #f7f7f7;
  566. }
  567. .safe-box{
  568. display: flex;
  569. align-items: center;
  570. padding-top: 24upx;
  571. image{
  572. width: 20upx;
  573. height: 24upx;
  574. margin-right: 20upx;
  575. }
  576. .text{
  577. font-size: 22upx;
  578. font-family: PingFang SC;
  579. font-weight: 500;
  580. color: #999999;
  581. line-height: 1;
  582. }
  583. .line{
  584. width: 1px;
  585. height: 23upx;
  586. background: #EDEEEF;
  587. margin: 0 20upx;
  588. }
  589. }
  590. }
  591. .inventor{
  592. height: 88upx;
  593. padding: 0 39upx 0 30upx;
  594. margin-top: 10upx;
  595. background: #FFFFFF;
  596. display: flex;
  597. align-items: center;
  598. justify-content: space-between;
  599. .left{
  600. display: flex;
  601. align-items: center;
  602. .head-box{
  603. margin-right: 27upx;
  604. display: flex;
  605. align-items: center;
  606. .head{
  607. width: 48upx;
  608. height: 48upx;
  609. border-radius: 50%;
  610. overflow: hidden;
  611. box-shadow: 0 0 0 1px #fff;
  612. margin-right: -10upx;
  613. image{
  614. width: 100%;
  615. height: 100%;
  616. }
  617. }
  618. }
  619. .num-box{
  620. font-size: 24upx;
  621. font-family: PingFang SC;
  622. font-weight: 500;
  623. color: #999999;
  624. .text{
  625. font-size: 24upx;
  626. font-family: PingFang SC;
  627. font-weight: 500;
  628. color: #999999;
  629. }
  630. }
  631. }
  632. .right{
  633. font-size: 24upx;
  634. font-family: PingFang SC;
  635. font-weight: 500;
  636. color: #999999;
  637. .text{
  638. font-size: 24upx;
  639. font-family: PingFang SC;
  640. font-weight: 500;
  641. color: #666666;
  642. }
  643. }
  644. }
  645. .effect{
  646. box-sizing: border-box;
  647. padding: 20upx 30upx;
  648. background: #FFFFFF;
  649. font-size: 28upx;
  650. font-family: PingFang SC;
  651. font-weight: 500;
  652. color: #666666;
  653. line-height: 1.8;
  654. margin-top: 10upx;
  655. display: flex;
  656. flex-direction: row;
  657. align-items: center;
  658. justify-content: space-between;
  659. .label{
  660. font-size: 28upx;
  661. font-family: PingFang SC;
  662. font-weight: 500;
  663. color: #111111;
  664. line-height: 1.8;
  665. }
  666. }
  667. .det-box{
  668. margin-top: 10upx;
  669. padding: 40upx 30upx 130upx 30upx;
  670. background-color: #FFFFFF;
  671. .title{
  672. font-size: 30upx;
  673. font-family: PingFang SC;
  674. font-weight: bold;
  675. color: #333333;
  676. line-height: 1;
  677. margin-bottom: 25upx;
  678. }
  679. }
  680. .btn-foot{
  681. box-sizing: border-box;
  682. width: 100%;
  683. height: 121upx;
  684. background: #FFFFFF;
  685. padding: 0 32upx 0 28upx;
  686. display: flex;
  687. align-items: center;
  688. justify-content: space-between;
  689. position: fixed;
  690. left: 0;
  691. bottom: 0;
  692. z-index: 99;
  693. .menu-box{
  694. display: flex;
  695. align-items: center;
  696. .item{
  697. display: flex;
  698. align-items: center;
  699. flex-direction: column;
  700. margin-right: 48upx;
  701. &:last-child{
  702. margin-right: 0;
  703. }
  704. image{
  705. width: 36upx;
  706. height: 36upx;
  707. margin-bottom: 10upx;
  708. }
  709. .label{
  710. font-size: 20upx;
  711. font-family: PingFang SC;
  712. font-weight: 500;
  713. color: #666666;
  714. text-align: center;
  715. }
  716. }
  717. /deep/.uni-badge--x{
  718. display: flex;
  719. align-items: center;
  720. justify-content: center;
  721. }
  722. /deep/.uni-badge{
  723. border: none;
  724. background-color: #FF3636;
  725. font-family: Roboto;
  726. }
  727. }
  728. .btn-box{
  729. display: flex;
  730. align-items: center;
  731. .btn{
  732. width: 200upx;
  733. height: 88upx;
  734. line-height: 88upx;
  735. text-align: center;
  736. border-radius: 44upx;
  737. margin-left: 20upx;
  738. font-size: 30upx;
  739. font-family: PingFang SC;
  740. font-weight: bold;
  741. color: #FFFFFF;
  742. &:first-child{
  743. margin-left: 0;
  744. }
  745. &.cart{
  746. background: #FF6633;
  747. }
  748. &.buy{
  749. background:#018C39;
  750. }
  751. }
  752. }
  753. }
  754. .product-spec{
  755. .pro-info{
  756. display: flex;
  757. align-items: center;
  758. .img-box{
  759. width: 200upx;
  760. height: 200upx;
  761. background: #FFFFFF;
  762. border-radius: 16upx;
  763. overflow: hidden;
  764. margin-right: 30upx;
  765. image{
  766. width: 100%;
  767. height: 100%;
  768. }
  769. }
  770. .info-text{
  771. height: 200upx;
  772. display: flex;
  773. flex-direction: column;
  774. justify-content: space-between;
  775. .price{
  776. display: flex;
  777. align-items: flex-end;
  778. .unit{
  779. font-size: 32upx;
  780. font-family: PingFang SC;
  781. font-weight: bold;
  782. color: #FF6633;
  783. line-height: 1.2;
  784. margin-right: 10upx;
  785. }
  786. .num{
  787. font-size: 50upx;
  788. font-family: PingFang SC;
  789. font-weight: bold;
  790. color: #FF6633;
  791. line-height: 1;
  792. }
  793. }
  794. .desc-box{
  795. display: flex;
  796. flex-direction: column;
  797. padding-bottom: 9upx;
  798. .text{
  799. font-size: 26upx;
  800. font-family: PingFang SC;
  801. font-weight: 500;
  802. color: #999999;
  803. margin-top: 27upx;
  804. line-height: 1;
  805. &:first-child{
  806. margin-top: 0;
  807. }
  808. }
  809. }
  810. }
  811. }
  812. .spec-box{
  813. padding-top: 50upx;
  814. .title{
  815. font-size: 34upx;
  816. font-family: PingFang SC;
  817. font-weight: bold;
  818. color: #111111;
  819. line-height: 1;
  820. }
  821. .spec-list{
  822. display: flex;
  823. flex-wrap: wrap;
  824. margin-top: 30upx;
  825. .item{
  826. box-sizing: border-box;
  827. height: 64upx;
  828. padding: 0 30upx;
  829. line-height: 64upx;
  830. font-size: 28upx;
  831. font-family: PingFang SC;
  832. font-weight: 500;
  833. color: #111111;
  834. background: #F7F7F7;
  835. border: 1px solid #F7F7F7;
  836. border-radius: 32upx;
  837. margin-right: 20upx;
  838. margin-bottom: 30upx;
  839. &.active{
  840. background: #F1FFFE;
  841. border: 1px solid #8AD5CE;
  842. color:#018C39;
  843. }
  844. }
  845. }
  846. }
  847. .price-num{
  848. display: flex;
  849. align-items: center;
  850. justify-content: space-between;
  851. margin-top: 14upx;
  852. .label{
  853. font-size: 34upx;
  854. font-family: PingFang SC;
  855. font-weight: bold;
  856. color: #111111;
  857. }
  858. .num-box{
  859. display: flex;
  860. align-items: center;
  861. .img-box{
  862. width: 60upx;
  863. height: 60upx;
  864. // border-radius: 4upx;
  865. border: 1px solid #dddddd;
  866. display: flex;
  867. align-items: center;
  868. justify-content: center;
  869. image{
  870. width: 25rpx;
  871. height: 25rpx;
  872. }
  873. }
  874. input{
  875. width: 60upx;
  876. height: 60upx;
  877. line-height: 60upx;
  878. font-size: 28upx;
  879. font-family: PingFang SC;
  880. font-weight: 500;
  881. color: #111111;
  882. // border-radius: 4upx;
  883. border-top: 1px solid #dddddd;
  884. border-bottom: 1px solid #dddddd;
  885. text-align: center;
  886. // margin: 0 16upx;
  887. }
  888. }
  889. }
  890. .sub-btn{
  891. width: 100%;
  892. height: 88upx;
  893. line-height: 88upx;
  894. text-align: center;
  895. font-size: 30upx;
  896. font-family: PingFang SC;
  897. font-weight: bold;
  898. color: #FFFFFF;
  899. background:#018C39;
  900. border-radius: 44upx;
  901. margin-top: 30upx;
  902. // margin-bottom: 30upx;
  903. }
  904. }
  905. .contact-btn{
  906. display: inline-block;
  907. position: absolute;
  908. top: 0;
  909. left: 0;
  910. width: 100%;
  911. height: 100%;
  912. opacity: 0;
  913. z-index: 9999;
  914. }
  915. .loadding{
  916. background-color: #fff;
  917. display: flex;
  918. flex-direction: column;
  919. align-items: center;
  920. justify-content: center;
  921. position: absolute;
  922. top: 0;
  923. left: 0;
  924. width: 100%;
  925. height: 100%;
  926. z-index: 9999;
  927. image{
  928. border-radius: 50%;
  929. animation: load linear 1s infinite;
  930. width: 120rpx;
  931. height:120rpx;
  932. }
  933. .text{
  934. font-size: 28rpx;
  935. margin-top: 20rpx;
  936. }
  937. }
  938. </style>