productDetails.vue 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011
  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 buy" @click="addCart('cart',1)">立即制单</view>
  102. <view class="btn cart" @click="addCart('cart')">加入购物车</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. voucherPreparation:0
  203. };
  204. },
  205. onLoad(options) {
  206. this.getDicts();
  207. this.productId = options.productId;
  208. if(this.utils.checkToken()){
  209. this.getCartCount();
  210. }
  211. },
  212. onShow() {
  213. this.getProductDetails();
  214. },
  215. computed: {
  216. ...mapGetters(['logoimg']),
  217. },
  218. watch: {
  219. logoimg: {
  220. immediate: true, // 页面一进入就检查一次
  221. handler(val) {
  222. return val
  223. }
  224. },
  225. },
  226. methods: {
  227. submitgoods(cateIds){
  228. //选择后提交制单
  229. let data={
  230. token:uni.getStorageSync('CompanyUserToken'),
  231. cateIds:cateIds,
  232. }
  233. createSalesOrder(data).then(
  234. res => {
  235. uni.hideLoading()
  236. if(res.code==200){
  237. uni.navigateTo({
  238. url: '/pages_company/order/confirmCompanyOrder?orderKey='+res.orderKey
  239. })
  240. }else{
  241. uni.showToast({
  242. icon:'none',
  243. title: "请求失败",
  244. });
  245. }
  246. },
  247. rej => {}
  248. ).catch(()=>{
  249. uni.hideLoading()
  250. });
  251. },
  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() {
  263. //预览图片
  264. uni.previewImage({
  265. urls: this.banner,
  266. current: this.banner[0]
  267. });
  268. },
  269. doAddCart(type){
  270. if(this.specNum==0){
  271. uni.showToast({
  272. icon:'none',
  273. title: "库存不足",
  274. });
  275. return;
  276. }
  277. var isBuy=type=="buy"?1:0;
  278. let data = {isBuy:isBuy,cartNum:this.specNum,productId:this.productValueSelect.productId,attrValueId:this.productValueSelect.id};
  279. if(this.voucherPreparation==1){
  280. uni.showLoading({
  281. title: '提交中'
  282. })
  283. }
  284. addCart(data).then(
  285. res => {
  286. if(res.code==200){
  287. if(type=="buy"){
  288. uni.navigateTo({
  289. url: '/pages/shopping/confirmOrder?type='+this.type+"&cartIds="+res.id
  290. })
  291. }else{
  292. this.getCartCount()
  293. if(this.voucherPreparation==1) {
  294. this.submitgoods(res.id)
  295. }else {
  296. uni.hideLoading()
  297. uni.showToast({
  298. icon:'success',
  299. title: "添加成功",
  300. });
  301. }
  302. }
  303. }else{
  304. uni.hideLoading()
  305. uni.showToast({
  306. icon:'none',
  307. title: res.msg,
  308. });
  309. this.getProductDetails()
  310. }
  311. },
  312. rej => {}
  313. ).catch(()=>{
  314. uni.hideLoading()
  315. });
  316. },
  317. getProductDetails(){
  318. let data = {productId:this.productId};
  319. //uni.showLoading({title:""});
  320. getProductDetails(data).then(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. this.values=res.productValues;
  344. this.choseSpec(0,0)
  345. }else{
  346. uni.showToast({
  347. icon:'none',
  348. title: res.msg,
  349. });
  350. setTimeout(function(){
  351. uni.reLaunch({
  352. url: '/pages/home/index',
  353. })
  354. },2000)
  355. }
  356. },
  357. rej => {}
  358. );
  359. },
  360. getCartCount(){
  361. let data = {productId:this.productId};
  362. getCartCount(data).then(
  363. cartRes => {
  364. if(cartRes.code==200){
  365. this.cartCount=cartRes.data;
  366. }
  367. },
  368. rej => {}
  369. );
  370. },
  371. // swiper变化事件
  372. swiperChange(event) {
  373. this.activeBanner = event.detail.current + 1
  374. },
  375. // 回到首页
  376. goHome() {
  377. uni.switchTab({
  378. url: '/pages/home/index'
  379. })
  380. },
  381. // 跳转页面
  382. navgetTo(url) {
  383. this.utils.isLogin().then(res => {
  384. if(res){
  385. uni.navigateTo({
  386. url: url
  387. })
  388. }
  389. })
  390. },
  391. // 加入购物车
  392. addCart(type,voucherPreparation) {
  393. this.voucherPreparation = voucherPreparation==1?1:0
  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. changeNum(e) {
  425. this.specNum = e.detail.value.replace(/\D/g, '')
  426. if(this.specNum < 1) {
  427. this.specNum = 1
  428. }
  429. if(this.specNum>=this.productValueSelect.stock){
  430. this.specNum=this.productValueSelect.stock
  431. }
  432. },
  433. //更新数量
  434. updateSpecNum(){
  435. if(this.productValueSelect.stock==0){
  436. this.specNum=0;
  437. }
  438. else{
  439. this.specNum=1;
  440. }
  441. },
  442. // 数量减法
  443. lessNum(index) {
  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(index) {
  454. this.specNum++
  455. if(this.specNum>=this.productValueSelect.stock){
  456. this.specNum=this.productValueSelect.stock
  457. }
  458. },
  459. // 确定选择该规格
  460. submit() {
  461. this.specVisible = false
  462. this.doAddCart(this.type);
  463. }
  464. }
  465. }
  466. </script>
  467. <style lang="scss">
  468. .shop-banner{
  469. height: 756upx;
  470. background-color: #FFFFFF;
  471. position: relative;
  472. .swiper-item{
  473. box-sizing: border-box;
  474. }
  475. .swiper,
  476. .swiper-item,
  477. .swiper-item image{
  478. width: 100%;
  479. height: 100%;
  480. }
  481. .banner-mask{
  482. width: 100%;
  483. height: 44upx;
  484. // background: linear-gradient(0deg, rgba(0, 0, 0, 0.04), rgba(0, 0, 0, 0));
  485. // opacity: 0.8;
  486. position: absolute;
  487. left: 0;
  488. bottom: 0;
  489. z-index: 9;
  490. background-image: url(https://kntobs.jnmyunl.com/shop/images/black_mask.png);
  491. background-size: 20upx 44upx;
  492. background-repeat: repeat-x;
  493. }
  494. .num-box{
  495. width: 80upx;
  496. height: 44upx;
  497. line-height: 44upx;
  498. text-align: center;
  499. font-size: 24upx;
  500. font-family: PingFang SC;
  501. font-weight: 500;
  502. color: #FFFFFF;
  503. background: rgba(0, 0, 0, .3);
  504. border-radius: 22upx;
  505. position: absolute;
  506. right: 30upx;
  507. bottom: 30upx;
  508. z-index: 10;
  509. }
  510. }
  511. .det-info{
  512. background: #FFFFFF;
  513. padding: 36upx 30upx 25upx;
  514. .price-box{
  515. display: flex;
  516. align-items: center;
  517. justify-content: space-between;
  518. .price{
  519. display: flex;
  520. align-items: flex-end;
  521. .label{
  522. color: #333;
  523. font-size: 28upx;
  524. font-family: PingFang SC;
  525. line-height: 1.3;
  526. margin-right: 5upx;
  527. }
  528. .unit{
  529. font-size: 28upx;
  530. font-family: PingFang SC;
  531. font-weight: bold;
  532. color: #FF6633;
  533. line-height: 1.3;
  534. }
  535. .num{
  536. font-size: 40upx;
  537. font-family: PingFang SC;
  538. font-weight: bold;
  539. color: #FF6633;
  540. margin: 0 20upx 0 10upx;
  541. line-height: 1;
  542. }
  543. .old{
  544. font-size: 28upx;
  545. font-family: PingFang SC;
  546. font-weight: 500;
  547. text-decoration: line-through;
  548. color: #BBBBBB;
  549. line-height: 1.3;
  550. }
  551. }
  552. .share-box{
  553. width: 120upx;
  554. height: 46upx;
  555. border: 1px solid #2BC7B9;
  556. border-radius: 23upx;
  557. display: flex;
  558. align-items: center;
  559. justify-content: center;
  560. position: relative;
  561. .text{
  562. font-size: 26upx;
  563. font-family: PingFang SC;
  564. font-weight: 500;
  565. color: #2BC7B9;
  566. }
  567. image{
  568. margin-left: 2rpx;
  569. width: 25upx;
  570. height: 24upx;
  571. }
  572. .share{
  573. display: inline-block;
  574. position: absolute;
  575. top: 0;
  576. left: 0;
  577. width: 100%;
  578. height: 100%rpx;
  579. opacity: 0;
  580. }
  581. }
  582. .spec{
  583. font-size: 24upx;
  584. font-family: PingFang SC;
  585. font-weight: 500;
  586. color: #999999;
  587. line-height: 36upx;
  588. }
  589. }
  590. .name-box{
  591. font-size: 32upx;
  592. font-family: PingFang SC;
  593. font-weight: bold;
  594. color: #111111;
  595. line-height: 44upx;
  596. margin-top: 32upx;
  597. .tag{
  598. display: inline-block;
  599. padding: 0 6upx;
  600. height: 30upx;
  601. background: linear-gradient(90deg, #2BC7B9 0%, #2BC7A4 100%);
  602. border-radius: 4upx;
  603. margin-right: 10upx;
  604. font-size: 22upx;
  605. font-family: PingFang SC;
  606. font-weight: bold;
  607. color: #FFFFFF;
  608. line-height: 30upx;
  609. float: left;
  610. margin-top: 7upx;
  611. }
  612. }
  613. .intro{
  614. font-size: 26upx;
  615. font-family: PingFang SC;
  616. font-weight: 500;
  617. color: #999999;
  618. line-height: 36upx;
  619. padding: 18upx 0 23upx;
  620. border-bottom: 1px solid #f7f7f7;
  621. }
  622. .safe-box{
  623. display: flex;
  624. align-items: center;
  625. padding-top: 24upx;
  626. image{
  627. width: 20upx;
  628. height: 24upx;
  629. margin-right: 20upx;
  630. }
  631. .text{
  632. font-size: 22upx;
  633. font-family: PingFang SC;
  634. font-weight: 500;
  635. color: #999999;
  636. line-height: 1;
  637. }
  638. .line{
  639. width: 1px;
  640. height: 23upx;
  641. background: #EDEEEF;
  642. margin: 0 20upx;
  643. }
  644. }
  645. }
  646. .inventor{
  647. height: 88upx;
  648. padding: 0 39upx 0 30upx;
  649. margin-top: 10upx;
  650. background: #FFFFFF;
  651. display: flex;
  652. align-items: center;
  653. justify-content: space-between;
  654. .left{
  655. display: flex;
  656. align-items: center;
  657. .head-box{
  658. margin-right: 27upx;
  659. display: flex;
  660. align-items: center;
  661. .head{
  662. width: 48upx;
  663. height: 48upx;
  664. border-radius: 50%;
  665. overflow: hidden;
  666. box-shadow: 0 0 0 1px #fff;
  667. margin-right: -10upx;
  668. image{
  669. width: 100%;
  670. height: 100%;
  671. }
  672. }
  673. }
  674. .num-box{
  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: #999999;
  684. }
  685. }
  686. }
  687. .right{
  688. font-size: 24upx;
  689. font-family: PingFang SC;
  690. font-weight: 500;
  691. color: #999999;
  692. .text{
  693. font-size: 24upx;
  694. font-family: PingFang SC;
  695. font-weight: 500;
  696. color: #666666;
  697. }
  698. }
  699. }
  700. .effect{
  701. box-sizing: border-box;
  702. padding: 20upx 30upx;
  703. background: #FFFFFF;
  704. font-size: 28upx;
  705. font-family: PingFang SC;
  706. font-weight: 500;
  707. color: #666666;
  708. line-height: 1.8;
  709. margin-top: 10upx;
  710. display: flex;
  711. flex-direction: row;
  712. align-items: center;
  713. justify-content: space-between;
  714. .label{
  715. font-size: 28upx;
  716. font-family: PingFang SC;
  717. font-weight: 500;
  718. color: #111111;
  719. line-height: 1.8;
  720. }
  721. }
  722. .det-box{
  723. margin-top: 10upx;
  724. padding: 40upx 30upx 130upx 30upx;
  725. background-color: #FFFFFF;
  726. .title{
  727. font-size: 30upx;
  728. font-family: PingFang SC;
  729. font-weight: bold;
  730. color: #333333;
  731. line-height: 1;
  732. margin-bottom: 25upx;
  733. }
  734. }
  735. .btn-foot{
  736. box-sizing: border-box;
  737. width: 100%;
  738. height: 121upx;
  739. background: #FFFFFF;
  740. padding: 0 32upx 0 28upx;
  741. display: flex;
  742. align-items: center;
  743. justify-content: space-between;
  744. position: fixed;
  745. left: 0;
  746. bottom: 0;
  747. z-index: 99;
  748. .menu-box{
  749. display: flex;
  750. align-items: center;
  751. .item{
  752. display: flex;
  753. align-items: center;
  754. flex-direction: column;
  755. margin-right: 48upx;
  756. &:last-child{
  757. margin-right: 0;
  758. }
  759. image{
  760. width: 36upx;
  761. height: 36upx;
  762. margin-bottom: 10upx;
  763. }
  764. .label{
  765. font-size: 20upx;
  766. font-family: PingFang SC;
  767. font-weight: 500;
  768. color: #666666;
  769. text-align: center;
  770. }
  771. }
  772. :deep(.uni-badge--x){
  773. display: flex;
  774. align-items: center;
  775. justify-content: center;
  776. }
  777. :deep(.uni-badge){
  778. border: none;
  779. background-color: #FF3636;
  780. font-family: Roboto;
  781. }
  782. }
  783. .btn-box{
  784. display: flex;
  785. align-items: center;
  786. .btn{
  787. width: 200upx;
  788. height: 88upx;
  789. line-height: 88upx;
  790. text-align: center;
  791. border-radius: 44upx;
  792. margin-left: 20upx;
  793. font-size: 30upx;
  794. font-family: PingFang SC;
  795. font-weight: bold;
  796. color: #FFFFFF;
  797. &:first-child{
  798. margin-left: 0;
  799. }
  800. &.cart{
  801. background: #FF6633;
  802. }
  803. &.buy{
  804. background: #2BC7B9;
  805. }
  806. }
  807. }
  808. }
  809. .product-spec{
  810. .pro-info{
  811. display: flex;
  812. align-items: center;
  813. .img-box{
  814. width: 200upx;
  815. height: 200upx;
  816. background: #FFFFFF;
  817. border-radius: 16upx;
  818. overflow: hidden;
  819. margin-right: 30upx;
  820. image{
  821. width: 100%;
  822. height: 100%;
  823. }
  824. }
  825. .info-text{
  826. height: 200upx;
  827. display: flex;
  828. flex-direction: column;
  829. justify-content: space-between;
  830. .price{
  831. display: flex;
  832. align-items: flex-end;
  833. .unit{
  834. font-size: 32upx;
  835. font-family: PingFang SC;
  836. font-weight: bold;
  837. color: #FF6633;
  838. line-height: 1.2;
  839. margin-right: 10upx;
  840. }
  841. .num{
  842. font-size: 50upx;
  843. font-family: PingFang SC;
  844. font-weight: bold;
  845. color: #FF6633;
  846. line-height: 1;
  847. }
  848. }
  849. .desc-box{
  850. display: flex;
  851. flex-direction: column;
  852. padding-bottom: 9upx;
  853. .text{
  854. font-size: 26upx;
  855. font-family: PingFang SC;
  856. font-weight: 500;
  857. color: #999999;
  858. margin-top: 27upx;
  859. line-height: 1;
  860. &:first-child{
  861. margin-top: 0;
  862. }
  863. }
  864. }
  865. }
  866. }
  867. .spec-box{
  868. padding-top: 50upx;
  869. .title{
  870. font-size: 34upx;
  871. font-family: PingFang SC;
  872. font-weight: bold;
  873. color: #111111;
  874. line-height: 1;
  875. }
  876. .spec-list{
  877. display: flex;
  878. flex-wrap: wrap;
  879. margin-top: 30upx;
  880. .item{
  881. box-sizing: border-box;
  882. height: 64upx;
  883. padding: 0 30upx;
  884. line-height: 64upx;
  885. font-size: 28upx;
  886. font-family: PingFang SC;
  887. font-weight: 500;
  888. color: #111111;
  889. background: #F7F7F7;
  890. border: 1px solid #F7F7F7;
  891. border-radius: 32upx;
  892. margin-right: 20upx;
  893. margin-bottom: 30upx;
  894. &.active{
  895. background: #F1FFFE;
  896. border: 1px solid #8AD5CE;
  897. color: #2BC7B9;
  898. }
  899. }
  900. }
  901. }
  902. .price-num{
  903. display: flex;
  904. align-items: center;
  905. justify-content: space-between;
  906. margin-top: 14upx;
  907. .label{
  908. font-size: 34upx;
  909. font-family: PingFang SC;
  910. font-weight: bold;
  911. color: #111111;
  912. }
  913. .num-box{
  914. display: flex;
  915. align-items: center;
  916. .img-box{
  917. width: 60upx;
  918. height: 60upx;
  919. // border-radius: 4upx;
  920. border: 1px solid #dddddd;
  921. display: flex;
  922. align-items: center;
  923. justify-content: center;
  924. image{
  925. width: 25rpx;
  926. height: 25rpx;
  927. }
  928. }
  929. input{
  930. width: 60upx;
  931. height: 60upx;
  932. line-height: 60upx;
  933. font-size: 28upx;
  934. font-family: PingFang SC;
  935. font-weight: 500;
  936. color: #111111;
  937. // border-radius: 4upx;
  938. border-top: 1px solid #dddddd;
  939. border-bottom: 1px solid #dddddd;
  940. text-align: center;
  941. // margin: 0 16upx;
  942. }
  943. }
  944. }
  945. .sub-btn{
  946. width: 100%;
  947. height: 88upx;
  948. line-height: 88upx;
  949. text-align: center;
  950. font-size: 30upx;
  951. font-family: PingFang SC;
  952. font-weight: bold;
  953. color: #FFFFFF;
  954. background: #2BC7B9;
  955. border-radius: 44upx;
  956. margin-top: 30upx;
  957. // margin-bottom: 30upx;
  958. }
  959. }
  960. .contact-btn{
  961. display: inline-block;
  962. position: absolute;
  963. top: 0;
  964. left: 0;
  965. width: 100%;
  966. height: 100%;
  967. opacity: 0;
  968. z-index: 9999;
  969. }
  970. .loadding{
  971. background-color: #fff;
  972. display: flex;
  973. flex-direction: column;
  974. align-items: center;
  975. justify-content: center;
  976. position: absolute;
  977. top: 0;
  978. left: 0;
  979. width: 100%;
  980. height: 100%;
  981. z-index: 9999;
  982. image{
  983. border-radius: 50%;
  984. animation: load linear 1s infinite;
  985. width: 120rpx;
  986. height:120rpx;
  987. }
  988. .text{
  989. font-size: 28rpx;
  990. margin-top: 20rpx;
  991. }
  992. }
  993. </style>