productDetails.vue 28 KB

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