productDetails.vue 29 KB

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