productDetails.vue 21 KB

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