productDetails.vue 27 KB

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