productDetails.vue 23 KB

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