productDetails.vue 28 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208
  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='contain'
  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. this.banner=this.product.sliderImage.split(',');
  403. // 使用正则表达式过滤MP4文件
  404. const mp4Files = this.banner.filter(fileName => fileName.split('.').pop() != "mp4");
  405. const mp4Files2 = this.banner.filter(fileName => fileName.split('.').pop() === "mp4");
  406. this.banner = mp4Files.map(item => {
  407. return {
  408. type: 'image',
  409. url:item
  410. }
  411. })
  412. if(mp4Files2.length!=0){
  413. this.banner.unshift( {
  414. type: 'video',
  415. url:mp4Files2[0]
  416. })
  417. }
  418. }
  419. else{
  420. this.banner=[]
  421. }
  422. this.attrs=res.productAttr;
  423. this.attrs.forEach((item,index,arr)=>{
  424. item.values=item.attrValues.split(',');
  425. item.index=0
  426. });
  427. this.values=res.productValues;
  428. this.choseSpec(0,0)
  429. // this.stores=res.stores;
  430. // this.storeNames=this.stores.map(store => store.storeName);
  431. // if(this.stores.length>0){
  432. // this.storeName=this.storeNames[this.storeIdx];
  433. // this.storeId=this.stores[this.storeIdx].storeId;
  434. // }
  435. }else{
  436. uni.showToast({
  437. icon:'none',
  438. title: res.msg,
  439. });
  440. setTimeout(function(){
  441. uni.reLaunch({
  442. url: '/pages/home/index',
  443. })
  444. },2000)
  445. }
  446. },
  447. rej => {}
  448. );
  449. },
  450. getCartCount(){
  451. let data = {productId:this.productId};
  452. getCartCount(data).then(
  453. cartRes => {
  454. if(cartRes.code==200){
  455. this.cartCount=cartRes.data;
  456. }
  457. },
  458. rej => {}
  459. );
  460. },
  461. // swiper变化事件
  462. swiperChange(event) {
  463. this.activeBanner = event.detail.current + 1
  464. },
  465. // 回到首页
  466. goHome() {
  467. uni.switchTab({
  468. url: '/pages/home/index'
  469. })
  470. },
  471. // 跳转页面
  472. navgetTo(url) {
  473. this.utils.isLogin().then(res => {
  474. if(res){
  475. uni.navigateTo({
  476. url: url
  477. })
  478. }
  479. })
  480. },
  481. // 加入购物车
  482. addCart(type) {
  483. this.utils.isLogin().then(res => {
  484. if(res){
  485. this.type=type;
  486. this.specVisible = true
  487. }
  488. })
  489. },
  490. // 规格选择
  491. choseSpec(index,subIndex) {
  492. this.attrs[index].index = subIndex;
  493. this.$forceUpdate();
  494. let productAttr = this.attrs;
  495. let values = [];
  496. for (let i = 0; i < productAttr.length; i++) {
  497. for (let j = 0; j < productAttr[i].values.length; j++) {
  498. if (productAttr[i].index === j) { //筛选出默认规格
  499. values.push(productAttr[i].values[j]);
  500. }
  501. }
  502. }
  503. let selectVal=values.sort().join(","); //返回值:默认
  504. this.selectVal=selectVal;
  505. // var valueSelect=this.values.filter((item)=>{
  506. // return item.sku==selectVal;
  507. // });
  508. var valueSelect=this.getValueSelect();
  509. console.log("qxj valueSelect:"+valueSelect);
  510. if(valueSelect!=null&&valueSelect.length>0){
  511. this.productValueSelect=valueSelect[0];
  512. }
  513. console.log("qxj productValueSelect:"+JSON.stringify(this.productValueSelect));
  514. this.updateSpecNum();
  515. },
  516. //更新数量
  517. updateSpecNum(){
  518. if(this.productValueSelect.stock==0){
  519. this.specNum=0;
  520. }
  521. else{
  522. this.specNum=1;
  523. }
  524. },
  525. changeNum(e) {
  526. this.specNum = e.detail.value.replace(/\D/g, '')
  527. if(this.specNum < 1) {
  528. this.specNum = 1
  529. }
  530. if(this.specNum>=this.productValueSelect.stock){
  531. this.specNum=this.productValueSelect.stock
  532. }
  533. },
  534. // 数量减法
  535. lessNum() {
  536. this.specNum--
  537. if(this.specNum < 1) {
  538. this.specNum = 1
  539. }
  540. if(this.specNum>=this.productValueSelect.stock){
  541. this.specNum=this.productValueSelect.stock
  542. }
  543. },
  544. // 数量加法
  545. addNum() {
  546. this.specNum++
  547. if(this.specNum>=this.productValueSelect.stock){
  548. this.specNum=this.productValueSelect.stock
  549. }
  550. },
  551. // 确定选择该规格
  552. submit() {
  553. this.specVisible = false
  554. this.doAddCart(this.type);
  555. },
  556. hideModal(){
  557. this.showModal=false;
  558. },
  559. getValueSelect(){
  560. var valueSelect=this.values.filter((item)=>{
  561. return item.sku==this.selectVal;
  562. });
  563. return valueSelect;
  564. },
  565. pickerChange(e) {
  566. console.log("pickerChange index:"+e.detail.value);
  567. var valueSelect=this.getValueSelect();
  568. this.productValueSelect=valueSelect[0];
  569. },
  570. pickerColumnchange(e){
  571. }
  572. }
  573. }
  574. </script>
  575. <style lang="scss">
  576. .videotop{
  577. height: 100%;
  578. width: 100%;
  579. }
  580. .shop-banner{
  581. height: 756upx;
  582. background-color: #FFFFFF;
  583. position: relative;
  584. .swiper-item{
  585. box-sizing: border-box;
  586. position: relative;
  587. }
  588. .swiper,
  589. .swiper-item,
  590. .swiper-item image{
  591. width: 100%;
  592. height: 100%;
  593. }
  594. .banner-mask{
  595. width: 100%;
  596. height: 44upx;
  597. // background: linear-gradient(0deg, rgba(0, 0, 0, 0.04), rgba(0, 0, 0, 0));
  598. // opacity: 0.8;
  599. position: absolute;
  600. left: 0;
  601. bottom: 0;
  602. z-index: 9;
  603. background-image: url(../../static/images/black_mask.png);
  604. background-size: 20upx 44upx;
  605. background-repeat: repeat-x;
  606. }
  607. .num-box{
  608. width: 80upx;
  609. height: 44upx;
  610. line-height: 44upx;
  611. text-align: center;
  612. font-size: 24upx;
  613. font-family: PingFang SC;
  614. font-weight: 500;
  615. color: #FFFFFF;
  616. background: rgba(0, 0, 0, .3);
  617. border-radius: 22upx;
  618. position: absolute;
  619. right: 30upx;
  620. bottom: 30upx;
  621. z-index: 10;
  622. }
  623. .cf-box{
  624. position: absolute;
  625. z-index: 10;
  626. left: 0;
  627. right:0;
  628. top: calc(50% - 200rpx);
  629. bottom: calc(50% - 200rpx);
  630. background-color: rgba(0,0,0, 0.3);
  631. backdrop-filter: blur(2rpx); /* 背景模糊度 */
  632. display: flex;
  633. flex-direction: column;
  634. flex: 1;
  635. justify-content: center;
  636. align-items: center;
  637. color: #EDEEEF;
  638. .title{
  639. font-size: 40rpx;
  640. font-weight: bold;
  641. }
  642. .subTitle{
  643. font-size: 28rpx;
  644. font-weight: bold;
  645. margin-top: 10rpx;
  646. }
  647. }
  648. }
  649. .det-info{
  650. background: #FFFFFF;
  651. padding: 36upx 30upx 25upx;
  652. .price-box{
  653. display: flex;
  654. align-items: center;
  655. justify-content: space-between;
  656. .price{
  657. display: flex;
  658. align-items: flex-end;
  659. .label{
  660. color: #333;
  661. font-size: 28upx;
  662. font-family: PingFang SC;
  663. line-height: 1.3;
  664. margin-right: 5upx;
  665. }
  666. .unit{
  667. font-size: 28upx;
  668. font-family: PingFang SC;
  669. font-weight: bold;
  670. color: #FF6633;
  671. line-height: 1.3;
  672. }
  673. .num{
  674. font-size: 40upx;
  675. font-family: PingFang SC;
  676. font-weight: bold;
  677. color: #FF6633;
  678. margin: 0 20upx 0 10upx;
  679. line-height: 1;
  680. }
  681. .old{
  682. font-size: 28upx;
  683. font-family: PingFang SC;
  684. font-weight: 500;
  685. text-decoration: line-through;
  686. color: #BBBBBB;
  687. line-height: 1.3;
  688. }
  689. }
  690. .share-box{
  691. width: 120upx;
  692. height: 46upx;
  693. border: 1px solid#018C39;
  694. border-radius: 23upx;
  695. display: flex;
  696. align-items: center;
  697. justify-content: center;
  698. position: relative;
  699. .text{
  700. font-size: 26upx;
  701. font-family: PingFang SC;
  702. font-weight: 500;
  703. color:#018C39;
  704. }
  705. image{
  706. margin-left: 2rpx;
  707. width: 25upx;
  708. height: 24upx;
  709. }
  710. .share{
  711. display: inline-block;
  712. position: absolute;
  713. top: 0;
  714. left: 0;
  715. width: 100%;
  716. height: 100%;
  717. opacity: 0;
  718. }
  719. }
  720. .spec{
  721. font-size: 24upx;
  722. font-family: PingFang SC;
  723. font-weight: 500;
  724. color: #999999;
  725. line-height: 36upx;
  726. }
  727. }
  728. .name-box{
  729. font-size: 32upx;
  730. font-family: PingFang SC;
  731. font-weight: bold;
  732. color: #111111;
  733. line-height: 44upx;
  734. margin-top: 32upx;
  735. .tag{
  736. display: inline-block;
  737. padding: 0 6upx;
  738. height: 30upx;
  739. background: linear-gradient(90deg, #66b2ef 0%,#018C39 100%);
  740. border-radius: 4upx;
  741. margin-right: 10upx;
  742. font-size: 22upx;
  743. font-family: PingFang SC;
  744. font-weight: bold;
  745. color: #FFFFFF;
  746. line-height: 30upx;
  747. float: left;
  748. margin-top: 7upx;
  749. }
  750. }
  751. .intro{
  752. font-size: 26upx;
  753. font-family: PingFang SC;
  754. font-weight: 500;
  755. color: #999999;
  756. line-height: 36upx;
  757. padding: 18upx 0 23upx;
  758. border-bottom: 1px solid #f7f7f7;
  759. }
  760. .safe-box{
  761. display: flex;
  762. align-items: center;
  763. padding-top: 24upx;
  764. image{
  765. width: 20upx;
  766. height: 24upx;
  767. margin-right: 20upx;
  768. }
  769. .text{
  770. font-size: 22upx;
  771. font-family: PingFang SC;
  772. font-weight: 500;
  773. color: #999999;
  774. line-height: 1;
  775. }
  776. .line{
  777. width: 1px;
  778. height: 23upx;
  779. background: #EDEEEF;
  780. margin: 0 20upx;
  781. }
  782. }
  783. }
  784. .inventor{
  785. height: 88upx;
  786. padding: 0 39upx 0 30upx;
  787. margin-top: 10upx;
  788. background: #FFFFFF;
  789. display: flex;
  790. align-items: center;
  791. justify-content: space-between;
  792. .left{
  793. display: flex;
  794. align-items: center;
  795. .head-box{
  796. margin-right: 27upx;
  797. display: flex;
  798. align-items: center;
  799. .head{
  800. width: 48upx;
  801. height: 48upx;
  802. border-radius: 50%;
  803. overflow: hidden;
  804. box-shadow: 0 0 0 1px #fff;
  805. margin-right: -10upx;
  806. image{
  807. width: 100%;
  808. height: 100%;
  809. }
  810. }
  811. }
  812. .num-box{
  813. font-size: 24upx;
  814. font-family: PingFang SC;
  815. font-weight: 500;
  816. color: #999999;
  817. .text{
  818. font-size: 24upx;
  819. font-family: PingFang SC;
  820. font-weight: 500;
  821. color: #999999;
  822. }
  823. }
  824. }
  825. .right{
  826. font-size: 24upx;
  827. font-family: PingFang SC;
  828. font-weight: 500;
  829. color: #999999;
  830. .text{
  831. font-size: 24upx;
  832. font-family: PingFang SC;
  833. font-weight: 500;
  834. color: #666666;
  835. }
  836. }
  837. }
  838. .effect{
  839. box-sizing: border-box;
  840. padding: 20upx 30upx;
  841. background: #FFFFFF;
  842. font-size: 28upx;
  843. font-family: PingFang SC;
  844. font-weight: 500;
  845. color: #666666;
  846. line-height: 1.8;
  847. margin-top: 10upx;
  848. display: flex;
  849. flex-direction: row;
  850. align-items: center;
  851. justify-content: space-between;
  852. .label{
  853. font-size: 28upx;
  854. font-family: PingFang SC;
  855. font-weight: 500;
  856. color: #111111;
  857. line-height: 1.8;
  858. }
  859. }
  860. .det-box{
  861. margin-top: 10upx;
  862. padding: 40upx 30upx 130upx 30upx;
  863. background-color: #FFFFFF;
  864. .title{
  865. font-size: 30upx;
  866. font-family: PingFang SC;
  867. font-weight: bold;
  868. color: #333333;
  869. line-height: 1;
  870. margin-bottom: 25upx;
  871. }
  872. }
  873. .btn-foot{
  874. box-sizing: border-box;
  875. width: 100%;
  876. height: 121upx;
  877. background: #FFFFFF;
  878. padding: 0 32upx 0 28upx;
  879. display: flex;
  880. align-items: center;
  881. justify-content: space-between;
  882. position: fixed;
  883. left: 0;
  884. bottom: 0;
  885. z-index: 99;
  886. .menu-box{
  887. display: flex;
  888. align-items: center;
  889. .item{
  890. display: flex;
  891. align-items: center;
  892. flex-direction: column;
  893. margin-right: 48upx;
  894. &:last-child{
  895. margin-right: 0;
  896. }
  897. image{
  898. width: 36upx;
  899. height: 36upx;
  900. margin-bottom: 10upx;
  901. }
  902. .label{
  903. font-size: 20upx;
  904. font-family: PingFang SC;
  905. font-weight: 500;
  906. color: #666666;
  907. text-align: center;
  908. }
  909. }
  910. /deep/.uni-badge--x{
  911. display: flex;
  912. align-items: center;
  913. justify-content: center;
  914. }
  915. /deep/.uni-badge{
  916. border: none;
  917. background-color: #FF3636;
  918. font-family: Roboto;
  919. }
  920. }
  921. .btn-box{
  922. display: flex;
  923. align-items: center;
  924. .btn{
  925. width: 200upx;
  926. height: 88upx;
  927. line-height: 88upx;
  928. text-align: center;
  929. border-radius: 44upx;
  930. margin-left: 20upx;
  931. font-size: 30upx;
  932. font-family: PingFang SC;
  933. font-weight: bold;
  934. color: #FFFFFF;
  935. &:first-child{
  936. margin-left: 0;
  937. }
  938. &.cart{
  939. background: #FF6633;
  940. }
  941. &.buy{
  942. background:#018C39;
  943. }
  944. }
  945. }
  946. }
  947. .product-spec{
  948. .pro-info{
  949. display: flex;
  950. align-items: center;
  951. .img-box{
  952. width: 200upx;
  953. height: 200upx;
  954. background: #FFFFFF;
  955. border-radius: 16upx;
  956. overflow: hidden;
  957. margin-right: 30upx;
  958. image{
  959. width: 100%;
  960. height: 100%;
  961. }
  962. }
  963. .info-text{
  964. height: 200upx;
  965. display: flex;
  966. flex-direction: column;
  967. justify-content: space-between;
  968. .price{
  969. display: flex;
  970. align-items: flex-end;
  971. .unit{
  972. font-size: 32upx;
  973. font-family: PingFang SC;
  974. font-weight: bold;
  975. color: #FF6633;
  976. line-height: 1.2;
  977. margin-right: 10upx;
  978. }
  979. .num{
  980. font-size: 50upx;
  981. font-family: PingFang SC;
  982. font-weight: bold;
  983. color: #FF6633;
  984. line-height: 1;
  985. }
  986. }
  987. .desc-box{
  988. display: flex;
  989. flex-direction: column;
  990. padding-bottom: 9upx;
  991. .text{
  992. font-size: 26upx;
  993. font-family: PingFang SC;
  994. font-weight: 500;
  995. color: #999999;
  996. margin-top: 27upx;
  997. line-height: 1;
  998. &:first-child{
  999. margin-top: 0;
  1000. }
  1001. }
  1002. }
  1003. }
  1004. }
  1005. .spec-box{
  1006. padding-top: 50upx;
  1007. .title{
  1008. font-size: 34upx;
  1009. font-family: PingFang SC;
  1010. font-weight: bold;
  1011. color: #111111;
  1012. line-height: 1;
  1013. }
  1014. .spec-list{
  1015. display: flex;
  1016. flex-wrap: wrap;
  1017. margin-top: 30upx;
  1018. .item{
  1019. box-sizing: border-box;
  1020. height: 64upx;
  1021. padding: 0 30upx;
  1022. line-height: 64upx;
  1023. font-size: 28upx;
  1024. font-family: PingFang SC;
  1025. font-weight: 500;
  1026. color: #111111;
  1027. background: #F7F7F7;
  1028. border: 1px solid #F7F7F7;
  1029. border-radius: 32upx;
  1030. margin-right: 20upx;
  1031. margin-bottom: 30upx;
  1032. &.active{
  1033. background: #F1FFFE;
  1034. border: 1px solid #8AD5CE;
  1035. color:#018C39;
  1036. }
  1037. }
  1038. }
  1039. }
  1040. .price-num{
  1041. display: flex;
  1042. align-items: center;
  1043. justify-content: space-between;
  1044. margin-top: 14upx;
  1045. .label{
  1046. font-size: 34upx;
  1047. font-family: PingFang SC;
  1048. font-weight: bold;
  1049. color: #111111;
  1050. }
  1051. .num-box{
  1052. display: flex;
  1053. align-items: center;
  1054. .img-box{
  1055. width: 60upx;
  1056. height: 60upx;
  1057. // border-radius: 4upx;
  1058. border: 1px solid #dddddd;
  1059. display: flex;
  1060. align-items: center;
  1061. justify-content: center;
  1062. image{
  1063. width: 25rpx;
  1064. height: 25rpx;
  1065. }
  1066. }
  1067. input{
  1068. width: 60upx;
  1069. height: 60upx;
  1070. line-height: 60upx;
  1071. font-size: 28upx;
  1072. font-family: PingFang SC;
  1073. font-weight: 500;
  1074. color: #111111;
  1075. // border-radius: 4upx;
  1076. border-top: 1px solid #dddddd;
  1077. border-bottom: 1px solid #dddddd;
  1078. text-align: center;
  1079. // margin: 0 16upx;
  1080. }
  1081. }
  1082. }
  1083. .sub-btn{
  1084. width: 100%;
  1085. height: 88upx;
  1086. line-height: 88upx;
  1087. text-align: center;
  1088. font-size: 30upx;
  1089. font-family: PingFang SC;
  1090. font-weight: bold;
  1091. color: #FFFFFF;
  1092. background:#018C39;
  1093. border-radius: 44upx;
  1094. margin-top: 30upx;
  1095. // margin-bottom: 30upx;
  1096. }
  1097. }
  1098. .contact-btn{
  1099. display: inline-block;
  1100. position: absolute;
  1101. top: 0;
  1102. left: 0;
  1103. width: 100%;
  1104. height: 100%;
  1105. opacity: 0;
  1106. z-index: 9999;
  1107. }
  1108. .loadding{
  1109. background-color: #fff;
  1110. display: flex;
  1111. flex-direction: column;
  1112. align-items: center;
  1113. justify-content: center;
  1114. position: absolute;
  1115. top: 0;
  1116. left: 0;
  1117. width: 100%;
  1118. height: 100%;
  1119. z-index: 9999;
  1120. image{
  1121. border-radius: 50%;
  1122. animation: load linear 1s infinite;
  1123. width: 120rpx;
  1124. height:120rpx;
  1125. }
  1126. .text{
  1127. font-size: 28rpx;
  1128. margin-top: 20rpx;
  1129. }
  1130. }
  1131. .form-item{
  1132. padding: 30upx 0;
  1133. display: flex;
  1134. align-items: flex-start;
  1135. border-bottom: 1px solid #F1F1F1;
  1136. &:last-child{
  1137. border-bottom: none;
  1138. }
  1139. .label{
  1140. width: 180upx;
  1141. text-align: left;
  1142. font-size: 30upx;
  1143. line-height: 44upx;
  1144. font-family: PingFang SC;
  1145. font-weight: 500;
  1146. color: #222222;
  1147. flex-shrink: 0;
  1148. }
  1149. input{
  1150. text-align: left;
  1151. }
  1152. .form-input{
  1153. font-size: 30upx;
  1154. font-family: PingFang SC;
  1155. font-weight: 500;
  1156. color: #999999;
  1157. text-align: left;
  1158. }
  1159. .form-textarea{
  1160. font-size: 30upx;
  1161. color: #999999;
  1162. height: 100upx;
  1163. padding: 4upx 0;
  1164. }
  1165. .birth-picker {
  1166. flex: 1;
  1167. display: flex;
  1168. align-items: center;
  1169. .right-box{
  1170. width: 100%;
  1171. display: flex;
  1172. align-items: center;
  1173. .input-box{
  1174. width: 470upx;
  1175. }
  1176. .arrow{
  1177. width: 13upx;
  1178. height: 23upx;
  1179. margin-left: 20upx;
  1180. }
  1181. }
  1182. }
  1183. }
  1184. </style>