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