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">{{$getDictLabelNames("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="https://cqtyt-2025.oss-cn-beijing.aliyuncs.com/shop/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="https://cqtyt-2025.oss-cn-beijing.aliyuncs.com/shop/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="https://cqtyt-2025.oss-cn-beijing.aliyuncs.com/shop/images/back_home.png" mode=""></image>
  86. <text class="label">首页</text>
  87. </view>
  88. <view class="item" style="position: relative;">
  89. <image src="https://cqtyt-2025.oss-cn-beijing.aliyuncs.com/shop/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. <u-badge max="99" :value="cartCount" :max="99" :absolute='true' :offset="[-11,-1]"></u-badge>
  95. <image src="https://cqtyt-2025.oss-cn-beijing.aliyuncs.com/shop/images/cart36.png" mode=""></image>
  96. <text class="label">购物车</text>
  97. </view>
  98. </view>
  99. <view class="btn-box">
  100. <view class="btn cart" @click="addCart('cart')">加入购物车</view>
  101. <!-- <view class="btn buy" @click="addCart('buy')">{{buyText}}</view> -->
  102. </view>
  103. </view>
  104. <!-- 选择药品规格弹窗 -->
  105. <popupBottom ref="popup" :visible.sync="specVisible" title=" " radius="32" maxHeight="1024">
  106. <view class="product-spec">
  107. <!-- 商品信息 -->
  108. <view class="pro-info">
  109. <view class="img-box">
  110. <image :src="productValueSelect.image==null||productValueSelect.image==''?product.image:productValueSelect.image" mode="aspectFill"></image>
  111. </view>
  112. <view class="info-text">
  113. <view class="price">
  114. <text class="unit">¥</text>
  115. <text class="num">{{ productValueSelect.price.toFixed(2) }}</text>
  116. </view>
  117. <view class="desc-box">
  118. <text class="text">已选:{{ productValueSelect.sku }}</text>
  119. <text class="text">库存{{ productValueSelect.stock?'充足':'售罄' }}</text>
  120. </view>
  121. </view>
  122. </view>
  123. <!-- 规格 -->
  124. <view class="spec-box">
  125. <view v-for="(item,index) in attrs" :key="index">
  126. <view class="title">{{item.attrName}}</view>
  127. <view class="spec-list">
  128. <view
  129. v-for="(subItem,subindex) in item.values"
  130. :key="subindex"
  131. :class="subindex==item.index?'item active':'item'"
  132. @click="choseSpec(index,subindex)">
  133. {{ subItem }}
  134. </view>
  135. </view>
  136. </view>
  137. </view>
  138. <!-- 数量 -->
  139. <view class="price-num">
  140. <view class="label">数量</view>
  141. <view class="num-box">
  142. <view class="img-box" @click="lessNum()">
  143. <image v-if="specNum <= 1" src="https://cqtyt-2025.oss-cn-beijing.aliyuncs.com/shop/images/jian.png" mode=""></image>
  144. <image v-else src="https://cqtyt-2025.oss-cn-beijing.aliyuncs.com/shop/images/jian2.png" mode=""></image>
  145. </view>
  146. <input type="text" @change="changeNum" v-model="specNum" />
  147. <view class="img-box" @click="addNum()">
  148. <image src="https://cqtyt-2025.oss-cn-beijing.aliyuncs.com/shop/images/add.png" mode=""></image>
  149. </view>
  150. </view>
  151. </view>
  152. <view class="sub-btn" @click="submit">确定</view>
  153. </view>
  154. </popupBottom>
  155. <view class="loadding" v-if="loadding==true">
  156. <image src="../../static/logo.jpg"></image>
  157. <text class="text">加载中...</text>
  158. </view>
  159. </view>
  160. </template>
  161. <script>
  162. import {getDicts} from '@/api/product'
  163. import {getProductDetails,getCartCount,addCart} from '@/api/shopCompany.js'
  164. import popupBottom from '../components/px-popup-bottom/px-popup-bottom.vue'
  165. export default {
  166. components: {
  167. item:{},
  168. popupBottom
  169. },
  170. data() {
  171. return {
  172. buyText:"立即购买",
  173. type:null,
  174. productValueSelect:{
  175. price:0,
  176. },
  177. banner:[],
  178. productId:null,
  179. attrs:[],
  180. values:[],
  181. product:{
  182. price:0,
  183. otPrice:0,
  184. },
  185. // 当前轮播的图片
  186. activeBanner: 1,
  187. // 购物车数量
  188. cartCount: 0,
  189. // 规格弹窗
  190. specVisible: false,
  191. // 规格数量
  192. specNum: 1,
  193. loadding:true,
  194. };
  195. },
  196. onLoad(options) {
  197. this.getDicts();
  198. this.productId = options.productId;
  199. if(this.$isLogin()){
  200. this.getCartCount();
  201. }
  202. },
  203. onShow() {
  204. this.getProductDetails();
  205. },
  206. methods: {
  207. getDicts:function(){
  208. getDicts().then(
  209. res => {
  210. if(res.code==200){
  211. uni.setStorageSync('dicts',JSON.stringify(res));
  212. }
  213. },
  214. rej => {}
  215. );
  216. },
  217. showImg() {
  218. //预览图片
  219. uni.previewImage({
  220. urls: this.banner,
  221. current: this.banner[0]
  222. });
  223. },
  224. doAddCart(type){
  225. if(this.specNum==0){
  226. uni.showToast({
  227. icon:'none',
  228. title: "库存不足",
  229. });
  230. return;
  231. }
  232. var isBuy=type=="buy"?1:0;
  233. let data = {isBuy:isBuy,cartNum:this.specNum,productId:this.productValueSelect.productId,attrValueId:this.productValueSelect.id};
  234. addCart(data).then(
  235. res => {
  236. if(res.code==200){
  237. if(type=="buy"){
  238. uni.navigateTo({
  239. url: '/pages/shopping/confirmOrder?type='+this.type+"&cartIds="+res.id
  240. })
  241. }
  242. else
  243. {
  244. this.getCartCount()
  245. uni.showToast({
  246. icon:'success',
  247. title: "添加成功",
  248. });
  249. }
  250. }else{
  251. uni.showToast({
  252. icon:'none',
  253. title: res.msg,
  254. });
  255. this.getProductDetails()
  256. }
  257. },
  258. rej => {}
  259. );
  260. },
  261. getProductDetails(){
  262. let data = {productId:this.productId};
  263. //uni.showLoading({title:""});
  264. getProductDetails(data).then(res => {
  265. this.loadding=false
  266. if(res.code==200){
  267. this.product=res.product;
  268. if(this.product.productType==1){
  269. this.buyText="立即购买"
  270. }
  271. else if(this.product.productType==2){
  272. this.buyText="提交需求"
  273. }
  274. this.product.otPrice=this.product.otPrice.toFixed(2);
  275. this.product.price=this.product.price.toFixed(2);
  276. if(this.product.sliderImage!=null){
  277. this.banner=this.product.sliderImage.split(',');
  278. }
  279. else{
  280. this.banner=[]
  281. }
  282. this.attrs=res.productAttr;
  283. this.attrs.forEach((item,index,arr)=>{
  284. item.values=item.attrValues.split(',');
  285. item.index=0
  286. })
  287. this.values=res.productValues;
  288. this.choseSpec(0,0)
  289. }else{
  290. uni.showToast({
  291. icon:'none',
  292. title: res.msg,
  293. });
  294. setTimeout(function(){
  295. uni.reLaunch({
  296. url: '/pages/home/index',
  297. })
  298. },2000)
  299. }
  300. },
  301. rej => {}
  302. );
  303. },
  304. getCartCount(){
  305. let data = {productId:this.productId};
  306. getCartCount(data).then(
  307. cartRes => {
  308. if(cartRes.code==200){
  309. this.cartCount=cartRes.data;
  310. }
  311. },
  312. rej => {}
  313. );
  314. },
  315. // swiper变化事件
  316. swiperChange(event) {
  317. this.activeBanner = event.detail.current + 1
  318. },
  319. // 回到首页
  320. goHome() {
  321. uni.switchTab({
  322. url: '/pages/index/index'
  323. })
  324. },
  325. // 跳转页面
  326. navgetTo(url) {
  327. this.$isLogin().then(res => {
  328. if(res){
  329. uni.navigateTo({
  330. url: url
  331. })
  332. }
  333. })
  334. },
  335. // 加入购物车
  336. addCart(type) {
  337. this.$isLogin().then(res => {
  338. if(res){
  339. this.type=type;
  340. this.specVisible = true
  341. }
  342. })
  343. },
  344. // 规格选择
  345. choseSpec(index,subIndex) {
  346. this.attrs[index].index = subIndex;
  347. this.$forceUpdate();
  348. let productAttr = this.attrs;
  349. let values = [];
  350. for (let i = 0; i < productAttr.length; i++) {
  351. for (let j = 0; j < productAttr[i].values.length; j++) {
  352. if (productAttr[i].index === j) {
  353. values.push(productAttr[i].values[j]);
  354. }
  355. }
  356. }
  357. var selectVal=values.sort().join(",");
  358. console.log(selectVal)
  359. var valueSelect=this.values.filter((item)=>{
  360. return item.sku==selectVal;
  361. })
  362. if(valueSelect!=null&&valueSelect.length==1){
  363. this.productValueSelect=valueSelect[0];
  364. }
  365. this.updateSpecNum();
  366. },
  367. changeNum(e) {
  368. this.specNum = e.detail.value.replace(/\D/g, '')
  369. if(this.specNum < 1) {
  370. this.specNum = 1
  371. }
  372. if(this.specNum>=this.productValueSelect.stock){
  373. this.specNum=this.productValueSelect.stock
  374. }
  375. },
  376. //更新数量
  377. updateSpecNum(){
  378. if(this.productValueSelect.stock==0){
  379. this.specNum=0;
  380. }
  381. else{
  382. this.specNum=1;
  383. }
  384. },
  385. // 数量减法
  386. lessNum(index) {
  387. this.specNum--
  388. if(this.specNum < 1) {
  389. this.specNum = 1
  390. }
  391. if(this.specNum>=this.productValueSelect.stock){
  392. this.specNum=this.productValueSelect.stock
  393. }
  394. },
  395. // 数量加法
  396. addNum(index) {
  397. this.specNum++
  398. if(this.specNum>=this.productValueSelect.stock){
  399. this.specNum=this.productValueSelect.stock
  400. }
  401. },
  402. // 确定选择该规格
  403. submit() {
  404. this.specVisible = false
  405. this.doAddCart(this.type);
  406. }
  407. }
  408. }
  409. </script>
  410. <style lang="scss">
  411. .shop-banner{
  412. height: 756upx;
  413. background-color: #FFFFFF;
  414. position: relative;
  415. .swiper-item{
  416. box-sizing: border-box;
  417. }
  418. .swiper,
  419. .swiper-item,
  420. .swiper-item image{
  421. width: 100%;
  422. height: 100%;
  423. }
  424. .banner-mask{
  425. width: 100%;
  426. height: 44upx;
  427. // background: linear-gradient(0deg, rgba(0, 0, 0, 0.04), rgba(0, 0, 0, 0));
  428. // opacity: 0.8;
  429. position: absolute;
  430. left: 0;
  431. bottom: 0;
  432. z-index: 9;
  433. background-image: url(https://cqtyt-2025.oss-cn-beijing.aliyuncs.com/shop/images/black_mask.png);
  434. background-size: 20upx 44upx;
  435. background-repeat: repeat-x;
  436. }
  437. .num-box{
  438. width: 80upx;
  439. height: 44upx;
  440. line-height: 44upx;
  441. text-align: center;
  442. font-size: 24upx;
  443. font-family: PingFang SC;
  444. font-weight: 500;
  445. color: #FFFFFF;
  446. background: rgba(0, 0, 0, .3);
  447. border-radius: 22upx;
  448. position: absolute;
  449. right: 30upx;
  450. bottom: 30upx;
  451. z-index: 10;
  452. }
  453. }
  454. .det-info{
  455. background: #FFFFFF;
  456. padding: 36upx 30upx 25upx;
  457. .price-box{
  458. display: flex;
  459. align-items: center;
  460. justify-content: space-between;
  461. .price{
  462. display: flex;
  463. align-items: flex-end;
  464. .label{
  465. color: #333;
  466. font-size: 28upx;
  467. font-family: PingFang SC;
  468. line-height: 1.3;
  469. margin-right: 5upx;
  470. }
  471. .unit{
  472. font-size: 28upx;
  473. font-family: PingFang SC;
  474. font-weight: bold;
  475. color: #FF6633;
  476. line-height: 1.3;
  477. }
  478. .num{
  479. font-size: 40upx;
  480. font-family: PingFang SC;
  481. font-weight: bold;
  482. color: #FF6633;
  483. margin: 0 20upx 0 10upx;
  484. line-height: 1;
  485. }
  486. .old{
  487. font-size: 28upx;
  488. font-family: PingFang SC;
  489. font-weight: 500;
  490. text-decoration: line-through;
  491. color: #BBBBBB;
  492. line-height: 1.3;
  493. }
  494. }
  495. .share-box{
  496. width: 120upx;
  497. height: 46upx;
  498. border: 1px solid #2BC7B9;
  499. border-radius: 23upx;
  500. display: flex;
  501. align-items: center;
  502. justify-content: center;
  503. position: relative;
  504. .text{
  505. font-size: 26upx;
  506. font-family: PingFang SC;
  507. font-weight: 500;
  508. color: #2BC7B9;
  509. }
  510. image{
  511. margin-left: 2rpx;
  512. width: 25upx;
  513. height: 24upx;
  514. }
  515. .share{
  516. display: inline-block;
  517. position: absolute;
  518. top: 0;
  519. left: 0;
  520. width: 100%;
  521. height: 100%rpx;
  522. opacity: 0;
  523. }
  524. }
  525. .spec{
  526. font-size: 24upx;
  527. font-family: PingFang SC;
  528. font-weight: 500;
  529. color: #999999;
  530. line-height: 36upx;
  531. }
  532. }
  533. .name-box{
  534. font-size: 32upx;
  535. font-family: PingFang SC;
  536. font-weight: bold;
  537. color: #111111;
  538. line-height: 44upx;
  539. margin-top: 32upx;
  540. .tag{
  541. display: inline-block;
  542. padding: 0 6upx;
  543. height: 30upx;
  544. background: linear-gradient(90deg, #2BC7B9 0%, #2BC7A4 100%);
  545. border-radius: 4upx;
  546. margin-right: 10upx;
  547. font-size: 22upx;
  548. font-family: PingFang SC;
  549. font-weight: bold;
  550. color: #FFFFFF;
  551. line-height: 30upx;
  552. float: left;
  553. margin-top: 7upx;
  554. }
  555. }
  556. .intro{
  557. font-size: 26upx;
  558. font-family: PingFang SC;
  559. font-weight: 500;
  560. color: #999999;
  561. line-height: 36upx;
  562. padding: 18upx 0 23upx;
  563. border-bottom: 1px solid #f7f7f7;
  564. }
  565. .safe-box{
  566. display: flex;
  567. align-items: center;
  568. padding-top: 24upx;
  569. image{
  570. width: 20upx;
  571. height: 24upx;
  572. margin-right: 20upx;
  573. }
  574. .text{
  575. font-size: 22upx;
  576. font-family: PingFang SC;
  577. font-weight: 500;
  578. color: #999999;
  579. line-height: 1;
  580. }
  581. .line{
  582. width: 1px;
  583. height: 23upx;
  584. background: #EDEEEF;
  585. margin: 0 20upx;
  586. }
  587. }
  588. }
  589. .inventor{
  590. height: 88upx;
  591. padding: 0 39upx 0 30upx;
  592. margin-top: 10upx;
  593. background: #FFFFFF;
  594. display: flex;
  595. align-items: center;
  596. justify-content: space-between;
  597. .left{
  598. display: flex;
  599. align-items: center;
  600. .head-box{
  601. margin-right: 27upx;
  602. display: flex;
  603. align-items: center;
  604. .head{
  605. width: 48upx;
  606. height: 48upx;
  607. border-radius: 50%;
  608. overflow: hidden;
  609. box-shadow: 0 0 0 1px #fff;
  610. margin-right: -10upx;
  611. image{
  612. width: 100%;
  613. height: 100%;
  614. }
  615. }
  616. }
  617. .num-box{
  618. font-size: 24upx;
  619. font-family: PingFang SC;
  620. font-weight: 500;
  621. color: #999999;
  622. .text{
  623. font-size: 24upx;
  624. font-family: PingFang SC;
  625. font-weight: 500;
  626. color: #999999;
  627. }
  628. }
  629. }
  630. .right{
  631. font-size: 24upx;
  632. font-family: PingFang SC;
  633. font-weight: 500;
  634. color: #999999;
  635. .text{
  636. font-size: 24upx;
  637. font-family: PingFang SC;
  638. font-weight: 500;
  639. color: #666666;
  640. }
  641. }
  642. }
  643. .effect{
  644. box-sizing: border-box;
  645. padding: 20upx 30upx;
  646. background: #FFFFFF;
  647. font-size: 28upx;
  648. font-family: PingFang SC;
  649. font-weight: 500;
  650. color: #666666;
  651. line-height: 1.8;
  652. margin-top: 10upx;
  653. display: flex;
  654. flex-direction: row;
  655. align-items: center;
  656. justify-content: space-between;
  657. .label{
  658. font-size: 28upx;
  659. font-family: PingFang SC;
  660. font-weight: 500;
  661. color: #111111;
  662. line-height: 1.8;
  663. }
  664. }
  665. .det-box{
  666. margin-top: 10upx;
  667. padding: 40upx 30upx 130upx 30upx;
  668. background-color: #FFFFFF;
  669. .title{
  670. font-size: 30upx;
  671. font-family: PingFang SC;
  672. font-weight: bold;
  673. color: #333333;
  674. line-height: 1;
  675. margin-bottom: 25upx;
  676. }
  677. }
  678. .btn-foot{
  679. box-sizing: border-box;
  680. width: 100%;
  681. height: 121upx;
  682. background: #FFFFFF;
  683. padding: 0 32upx 0 28upx;
  684. display: flex;
  685. align-items: center;
  686. justify-content: space-between;
  687. position: fixed;
  688. left: 0;
  689. bottom: 0;
  690. z-index: 99;
  691. .menu-box{
  692. display: flex;
  693. align-items: center;
  694. .item{
  695. display: flex;
  696. align-items: center;
  697. flex-direction: column;
  698. margin-right: 48upx;
  699. position: relative;
  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: #2BC7B9;
  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: #2BC7B9;
  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: #2BC7B9;
  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>