productDetails.vue 28 KB

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