productDetails.vue 29 KB

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