productDetails.vue 27 KB

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