productDetails.vue 29 KB

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