productDetails.vue 24 KB

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