productDetails.vue 28 KB

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