productDetails.vue 29 KB

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