productDetails.vue 23 KB

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