productDetails.vue 23 KB

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