productDetails.vue 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296
  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. let userInfoStr = uni.getStorageSync('userInfo');
  482. if(Object.prototype.toString.call(userInfoStr) == '[object String]'){
  483. userInfoStr = JSON.parse(userInfoStr)
  484. }
  485. if (!userInfoStr || userInfoStr && !userInfoStr.maOpenId) {
  486. uni.navigateTo({
  487. url: '/pages/auth/login'
  488. });
  489. return;
  490. }
  491. }
  492. this.utils.isLogin().then(res => {
  493. if (res) {
  494. this.type = type;
  495. this.specVisible = true
  496. }
  497. })
  498. },
  499. // 规格选择
  500. choseSpec(index, subIndex) {
  501. this.attrs[index].index = subIndex;
  502. this.$forceUpdate();
  503. let productAttr = this.attrs;
  504. let values = [];
  505. for (let i = 0; i < productAttr.length; i++) {
  506. for (let j = 0; j < productAttr[i].values.length; j++) {
  507. if (productAttr[i].index === j) { //筛选出默认规格
  508. values.push(productAttr[i].values[j]);
  509. }
  510. }
  511. }
  512. let selectVal = values.sort().join(","); //返回值:默认
  513. this.selectVal = selectVal;
  514. // var valueSelect=this.values.filter((item)=>{
  515. // return item.sku==selectVal;
  516. // });
  517. var valueSelect = this.getValueSelect();
  518. console.log("qxj valueSelect:" + valueSelect);
  519. if (valueSelect != null && valueSelect.length > 0) {
  520. this.productValueSelect = valueSelect[0];
  521. }
  522. console.log("qxj productValueSelect:" + JSON.stringify(this.productValueSelect));
  523. this.updateSpecNum();
  524. },
  525. //更新数量
  526. updateSpecNum() {
  527. if (this.productValueSelect.stock == 0) {
  528. this.specNum = 0;
  529. } else {
  530. this.specNum = 1;
  531. }
  532. },
  533. changeNum(e) {
  534. this.specNum = e.detail.value.replace(/\D/g, '')
  535. if (this.specNum < 1) {
  536. this.specNum = 1
  537. }
  538. if (this.specNum >= this.productValueSelect.stock) {
  539. this.specNum = this.productValueSelect.stock
  540. }
  541. },
  542. // 数量减法
  543. lessNum() {
  544. this.specNum--
  545. if (this.specNum < 1) {
  546. this.specNum = 1
  547. }
  548. if (this.specNum >= this.productValueSelect.stock) {
  549. this.specNum = this.productValueSelect.stock
  550. }
  551. },
  552. // 数量加法
  553. addNum() {
  554. this.specNum++
  555. if (this.specNum >= this.productValueSelect.stock) {
  556. this.specNum = this.productValueSelect.stock
  557. }
  558. },
  559. // 确定选择该规格
  560. submit() {
  561. this.specVisible = false
  562. this.doAddCart(this.type);
  563. },
  564. hideModal() {
  565. this.showModal = false;
  566. },
  567. getValueSelect() {
  568. var valueSelect = this.values.filter((item) => {
  569. return item.sku == this.selectVal;
  570. });
  571. return valueSelect;
  572. },
  573. pickerChange(e) {
  574. console.log("pickerChange index:" + e.detail.value);
  575. var valueSelect = this.getValueSelect();
  576. this.productValueSelect = valueSelect[0];
  577. },
  578. pickerColumnchange(e) {
  579. }
  580. }
  581. }
  582. </script>
  583. <style lang="scss">
  584. .shop-banner {
  585. height: 756upx;
  586. background-color: #FFFFFF;
  587. position: relative;
  588. .swiper-item {
  589. box-sizing: border-box;
  590. position: relative;
  591. }
  592. .swiper,
  593. .swiper-item,
  594. .swiper-item image {
  595. width: 100%;
  596. height: 100%;
  597. }
  598. .banner-mask {
  599. width: 100%;
  600. height: 44upx;
  601. // background: linear-gradient(0deg, rgba(0, 0, 0, 0.04), rgba(0, 0, 0, 0));
  602. // opacity: 0.8;
  603. position: absolute;
  604. left: 0;
  605. bottom: 0;
  606. z-index: 9;
  607. background-image: url(https://jnlzjk-1323137866.cos.ap-chongqing.myqcloud.com/shop/images/black_mask.png);
  608. background-size: 20upx 44upx;
  609. background-repeat: repeat-x;
  610. }
  611. .num-box {
  612. width: 80upx;
  613. height: 44upx;
  614. line-height: 44upx;
  615. text-align: center;
  616. font-size: 24upx;
  617. font-family: PingFang SC;
  618. font-weight: 500;
  619. color: #FFFFFF;
  620. background: rgba(0, 0, 0, .3);
  621. border-radius: 22upx;
  622. position: absolute;
  623. right: 30upx;
  624. bottom: 30upx;
  625. z-index: 10;
  626. }
  627. .cf-box {
  628. position: absolute;
  629. z-index: 10;
  630. left: 0;
  631. right: 0;
  632. top: calc(50% - 200rpx);
  633. bottom: calc(50% - 200rpx);
  634. background-color: rgba(0, 0, 0, 0.3);
  635. backdrop-filter: blur(2rpx);
  636. /* 背景模糊度 */
  637. display: flex;
  638. flex-direction: column;
  639. flex: 1;
  640. justify-content: center;
  641. align-items: center;
  642. color: #EDEEEF;
  643. .title {
  644. font-size: 40rpx;
  645. font-weight: bold;
  646. }
  647. .subTitle {
  648. font-size: 28rpx;
  649. font-weight: bold;
  650. margin-top: 10rpx;
  651. }
  652. }
  653. }
  654. .det-info {
  655. background: #FFFFFF;
  656. padding: 36upx 30upx 25upx;
  657. .price-box {
  658. display: flex;
  659. align-items: center;
  660. justify-content: space-between;
  661. .price {
  662. display: flex;
  663. align-items: flex-end;
  664. .label {
  665. color: #333;
  666. font-size: 28upx;
  667. font-family: PingFang SC;
  668. line-height: 1.3;
  669. margin-right: 5upx;
  670. }
  671. .unit {
  672. font-size: 28upx;
  673. font-family: PingFang SC;
  674. font-weight: bold;
  675. color: #FF6633;
  676. line-height: 1.3;
  677. }
  678. .num {
  679. font-size: 40upx;
  680. font-family: PingFang SC;
  681. font-weight: bold;
  682. color: #FF6633;
  683. margin: 0 20upx 0 10upx;
  684. line-height: 1;
  685. }
  686. .old {
  687. font-size: 28upx;
  688. font-family: PingFang SC;
  689. font-weight: 500;
  690. text-decoration: line-through;
  691. color: #BBBBBB;
  692. line-height: 1.3;
  693. }
  694. }
  695. .share-box {
  696. width: 120upx;
  697. height: 46upx;
  698. border: 1px solid #2BC7B9;
  699. border-radius: 23upx;
  700. display: flex;
  701. align-items: center;
  702. justify-content: center;
  703. position: relative;
  704. .text {
  705. font-size: 26upx;
  706. font-family: PingFang SC;
  707. font-weight: 500;
  708. color: #2BC7B9;
  709. }
  710. image {
  711. margin-left: 2rpx;
  712. width: 25upx;
  713. height: 24upx;
  714. }
  715. .share {
  716. display: inline-block;
  717. position: absolute;
  718. top: 0;
  719. left: 0;
  720. width: 100%;
  721. height: 100%;
  722. opacity: 0;
  723. }
  724. }
  725. .spec {
  726. font-size: 24upx;
  727. font-family: PingFang SC;
  728. font-weight: 500;
  729. color: #999999;
  730. line-height: 36upx;
  731. }
  732. }
  733. .name-box {
  734. font-size: 32upx;
  735. font-family: PingFang SC;
  736. font-weight: bold;
  737. color: #111111;
  738. line-height: 44upx;
  739. margin-top: 32upx;
  740. .tag {
  741. display: inline-block;
  742. padding: 0 6upx;
  743. height: 30upx;
  744. background: linear-gradient(90deg, #66b2ef 0%, #2BC7B9 100%);
  745. border-radius: 4upx;
  746. margin-right: 10upx;
  747. font-size: 22upx;
  748. font-family: PingFang SC;
  749. font-weight: bold;
  750. color: #FFFFFF;
  751. line-height: 30upx;
  752. float: left;
  753. margin-top: 7upx;
  754. }
  755. }
  756. .intro {
  757. font-size: 26upx;
  758. font-family: PingFang SC;
  759. font-weight: 500;
  760. color: #999999;
  761. line-height: 36upx;
  762. padding: 18upx 0 23upx;
  763. border-bottom: 1px solid #f7f7f7;
  764. }
  765. .safe-box {
  766. display: flex;
  767. align-items: center;
  768. padding-top: 24upx;
  769. image {
  770. width: 20upx;
  771. height: 24upx;
  772. margin-right: 20upx;
  773. }
  774. .text {
  775. font-size: 22upx;
  776. font-family: PingFang SC;
  777. font-weight: 500;
  778. color: #999999;
  779. line-height: 1;
  780. }
  781. .line {
  782. width: 1px;
  783. height: 23upx;
  784. background: #EDEEEF;
  785. margin: 0 20upx;
  786. }
  787. }
  788. }
  789. .inventor {
  790. height: 88upx;
  791. padding: 0 39upx 0 30upx;
  792. margin-top: 10upx;
  793. background: #FFFFFF;
  794. display: flex;
  795. align-items: center;
  796. justify-content: space-between;
  797. .left {
  798. display: flex;
  799. align-items: center;
  800. .head-box {
  801. margin-right: 27upx;
  802. display: flex;
  803. align-items: center;
  804. .head {
  805. width: 48upx;
  806. height: 48upx;
  807. border-radius: 50%;
  808. overflow: hidden;
  809. box-shadow: 0 0 0 1px #fff;
  810. margin-right: -10upx;
  811. image {
  812. width: 100%;
  813. height: 100%;
  814. }
  815. }
  816. }
  817. .num-box {
  818. font-size: 24upx;
  819. font-family: PingFang SC;
  820. font-weight: 500;
  821. color: #999999;
  822. .text {
  823. font-size: 24upx;
  824. font-family: PingFang SC;
  825. font-weight: 500;
  826. color: #999999;
  827. }
  828. }
  829. }
  830. .right {
  831. font-size: 24upx;
  832. font-family: PingFang SC;
  833. font-weight: 500;
  834. color: #999999;
  835. .text {
  836. font-size: 24upx;
  837. font-family: PingFang SC;
  838. font-weight: 500;
  839. color: #666666;
  840. }
  841. }
  842. }
  843. .effect {
  844. box-sizing: border-box;
  845. padding: 20upx 30upx;
  846. background: #FFFFFF;
  847. font-size: 28upx;
  848. font-family: PingFang SC;
  849. font-weight: 500;
  850. color: #666666;
  851. line-height: 1.8;
  852. margin-top: 10upx;
  853. display: flex;
  854. flex-direction: row;
  855. align-items: center;
  856. justify-content: space-between;
  857. .label {
  858. font-size: 28upx;
  859. font-family: PingFang SC;
  860. font-weight: 500;
  861. color: #111111;
  862. line-height: 1.8;
  863. }
  864. }
  865. .det-box {
  866. margin-top: 10upx;
  867. padding: 40upx 30upx 130upx 30upx;
  868. background-color: #FFFFFF;
  869. .title {
  870. font-size: 30upx;
  871. font-family: PingFang SC;
  872. font-weight: bold;
  873. color: #333333;
  874. line-height: 1;
  875. margin-bottom: 25upx;
  876. }
  877. }
  878. .btn-foot {
  879. box-sizing: border-box;
  880. width: 100%;
  881. height: 121upx;
  882. background: #FFFFFF;
  883. padding: 0 32upx 0 28upx;
  884. display: flex;
  885. align-items: center;
  886. justify-content: space-between;
  887. position: fixed;
  888. left: 0;
  889. bottom: 0;
  890. z-index: 99;
  891. .menu-box {
  892. display: flex;
  893. align-items: center;
  894. .item {
  895. display: flex;
  896. align-items: center;
  897. flex-direction: column;
  898. margin-right: 48upx;
  899. &:last-child {
  900. margin-right: 0;
  901. }
  902. image {
  903. width: 36upx;
  904. height: 36upx;
  905. margin-bottom: 10upx;
  906. }
  907. .label {
  908. font-size: 20upx;
  909. font-family: PingFang SC;
  910. font-weight: 500;
  911. color: #666666;
  912. text-align: center;
  913. }
  914. }
  915. :deep(.uni-badge--x) {
  916. display: flex;
  917. align-items: center;
  918. justify-content: center;
  919. }
  920. :deep(.uni-badge) {
  921. border: none;
  922. background-color: #FF3636;
  923. font-family: Roboto;
  924. }
  925. }
  926. .btn-box {
  927. display: flex;
  928. align-items: center;
  929. .btn {
  930. width: 200upx;
  931. height: 88upx;
  932. line-height: 88upx;
  933. text-align: center;
  934. border-radius: 44upx;
  935. margin-left: 20upx;
  936. font-size: 30upx;
  937. font-family: PingFang SC;
  938. font-weight: bold;
  939. color: #FFFFFF;
  940. &:first-child {
  941. margin-left: 0;
  942. }
  943. &.cart {
  944. background: #FF6633;
  945. }
  946. &.buy {
  947. background: #2BC7B9;
  948. }
  949. }
  950. }
  951. }
  952. .product-spec {
  953. .pro-info {
  954. display: flex;
  955. align-items: center;
  956. .img-box {
  957. width: 200upx;
  958. height: 200upx;
  959. background: #FFFFFF;
  960. border-radius: 16upx;
  961. overflow: hidden;
  962. margin-right: 30upx;
  963. image {
  964. width: 100%;
  965. height: 100%;
  966. }
  967. }
  968. .info-text {
  969. height: 200upx;
  970. display: flex;
  971. flex-direction: column;
  972. justify-content: space-between;
  973. .price {
  974. display: flex;
  975. align-items: flex-end;
  976. .unit {
  977. font-size: 32upx;
  978. font-family: PingFang SC;
  979. font-weight: bold;
  980. color: #FF6633;
  981. line-height: 1.2;
  982. margin-right: 10upx;
  983. }
  984. .num {
  985. font-size: 50upx;
  986. font-family: PingFang SC;
  987. font-weight: bold;
  988. color: #FF6633;
  989. line-height: 1;
  990. }
  991. }
  992. .desc-box {
  993. display: flex;
  994. flex-direction: column;
  995. padding-bottom: 9upx;
  996. .text {
  997. font-size: 26upx;
  998. font-family: PingFang SC;
  999. font-weight: 500;
  1000. color: #999999;
  1001. margin-top: 27upx;
  1002. line-height: 1;
  1003. &:first-child {
  1004. margin-top: 0;
  1005. }
  1006. }
  1007. }
  1008. }
  1009. }
  1010. .spec-box {
  1011. padding-top: 50upx;
  1012. .title {
  1013. font-size: 34upx;
  1014. font-family: PingFang SC;
  1015. font-weight: bold;
  1016. color: #111111;
  1017. line-height: 1;
  1018. }
  1019. .spec-list {
  1020. display: flex;
  1021. flex-wrap: wrap;
  1022. margin-top: 30upx;
  1023. .item {
  1024. box-sizing: border-box;
  1025. height: 64upx;
  1026. padding: 0 30upx;
  1027. line-height: 64upx;
  1028. font-size: 28upx;
  1029. font-family: PingFang SC;
  1030. font-weight: 500;
  1031. color: #111111;
  1032. background: #F7F7F7;
  1033. border: 1px solid #F7F7F7;
  1034. border-radius: 32upx;
  1035. margin-right: 20upx;
  1036. margin-bottom: 30upx;
  1037. &.active {
  1038. background: #F1FFFE;
  1039. border: 1px solid #8AD5CE;
  1040. color: #2BC7B9;
  1041. }
  1042. }
  1043. }
  1044. }
  1045. .price-num {
  1046. display: flex;
  1047. align-items: center;
  1048. justify-content: space-between;
  1049. margin-top: 14upx;
  1050. .label {
  1051. font-size: 34upx;
  1052. font-family: PingFang SC;
  1053. font-weight: bold;
  1054. color: #111111;
  1055. }
  1056. .num-box {
  1057. display: flex;
  1058. align-items: center;
  1059. .img-box {
  1060. width: 60upx;
  1061. height: 60upx;
  1062. // border-radius: 4upx;
  1063. border: 1px solid #dddddd;
  1064. display: flex;
  1065. align-items: center;
  1066. justify-content: center;
  1067. image {
  1068. width: 25rpx;
  1069. height: 25rpx;
  1070. }
  1071. }
  1072. input {
  1073. width: 60upx;
  1074. height: 60upx;
  1075. line-height: 60upx;
  1076. font-size: 28upx;
  1077. font-family: PingFang SC;
  1078. font-weight: 500;
  1079. color: #111111;
  1080. // border-radius: 4upx;
  1081. border-top: 1px solid #dddddd;
  1082. border-bottom: 1px solid #dddddd;
  1083. text-align: center;
  1084. // margin: 0 16upx;
  1085. }
  1086. }
  1087. }
  1088. .sub-btn {
  1089. width: 100%;
  1090. height: 88upx;
  1091. line-height: 88upx;
  1092. text-align: center;
  1093. font-size: 30upx;
  1094. font-family: PingFang SC;
  1095. font-weight: bold;
  1096. color: #FFFFFF;
  1097. background: #2BC7B9;
  1098. border-radius: 44upx;
  1099. margin-top: 30upx;
  1100. // margin-bottom: 30upx;
  1101. }
  1102. }
  1103. .contact-btn {
  1104. display: inline-block;
  1105. position: absolute;
  1106. top: 0;
  1107. left: 0;
  1108. width: 100%;
  1109. height: 100%;
  1110. opacity: 0;
  1111. z-index: 9999;
  1112. }
  1113. .loadding {
  1114. background-color: #fff;
  1115. display: flex;
  1116. flex-direction: column;
  1117. align-items: center;
  1118. justify-content: center;
  1119. position: absolute;
  1120. top: 0;
  1121. left: 0;
  1122. width: 100%;
  1123. height: 100%;
  1124. z-index: 9999;
  1125. image {
  1126. border-radius: 50%;
  1127. animation: load linear 1s infinite;
  1128. width: 120rpx;
  1129. height: 120rpx;
  1130. }
  1131. .text {
  1132. font-size: 28rpx;
  1133. margin-top: 20rpx;
  1134. }
  1135. }
  1136. .form-item {
  1137. padding: 30upx 0;
  1138. display: flex;
  1139. align-items: flex-start;
  1140. border-bottom: 1px solid #F1F1F1;
  1141. &:last-child {
  1142. border-bottom: none;
  1143. }
  1144. .label {
  1145. width: 180upx;
  1146. text-align: left;
  1147. font-size: 30upx;
  1148. line-height: 44upx;
  1149. font-family: PingFang SC;
  1150. font-weight: 500;
  1151. color: #222222;
  1152. flex-shrink: 0;
  1153. }
  1154. input {
  1155. text-align: left;
  1156. }
  1157. .form-input {
  1158. font-size: 30upx;
  1159. font-family: PingFang SC;
  1160. font-weight: 500;
  1161. color: #999999;
  1162. text-align: left;
  1163. }
  1164. .form-textarea {
  1165. font-size: 30upx;
  1166. color: #999999;
  1167. height: 100upx;
  1168. padding: 4upx 0;
  1169. }
  1170. .birth-picker {
  1171. flex: 1;
  1172. display: flex;
  1173. align-items: center;
  1174. .right-box {
  1175. width: 100%;
  1176. display: flex;
  1177. align-items: center;
  1178. .input-box {
  1179. width: 470upx;
  1180. }
  1181. .arrow {
  1182. width: 13upx;
  1183. height: 23upx;
  1184. margin-left: 20upx;
  1185. }
  1186. }
  1187. }
  1188. }
  1189. </style>