productDetails.vue 28 KB

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