productDetails.vue 28 KB

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