productDetails.vue 22 KB

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