productDetails.vue 28 KB

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