productDetails.vue 28 KB

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