productDetails.vue 26 KB

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