productDetails.vue 26 KB

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