productDetails.vue 24 KB

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