金诚优选前端代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

860 lines
23 KiB

  1. <template>
  2. <view>
  3. <lf-nav title="商品详情" titleColor="#fff" :spreadOut="false" :showIcon="true" bgColor="transparent"></lf-nav>
  4. <skeleton :loading="skeletonLoading" :row="12" :showAvatar="false" :showTitle="true">
  5. <block>
  6. <!-- 商品图片轮播 -->
  7. <swiper :current="current" :indicator-dots="2 > 1 ? false : true" :circular="true" class="swiper-box" indicator-active-color="#1998FE">
  8. <swiper-item v-for="(item, index) in pictures" :key="index">
  9. <image mode="aspectFill" :src="item" style="width: 100%; height: 100%;" @click="lookImg(index)"></image>
  10. <view class="seckill-box" v-if="type == 'seckill'">
  11. <view>距离结束还剩余</view>
  12. <view>
  13. <countdown-timer :time="time" :autoStart="true">
  14. <template v-slot="{hour, minute, second}">
  15. <view class="lf-flex">
  16. <view>{{ hour >= 10 ? hour : "0" + hour }}</view>
  17. <view></view>
  18. <view>{{ minute >= 10 ? minute : "0" + minute }}</view>
  19. <view></view>
  20. <view>{{ second >= 10 ? second : "0" + second }}</view>
  21. <view></view>
  22. </view>
  23. </template>
  24. </countdown-timer>
  25. </view>
  26. </view>
  27. </swiper-item>
  28. </swiper>
  29. <!-- 商品主要信息 -->
  30. <view class="head-info">
  31. <view class="lf-row-between">
  32. <view v-if="type == 'point'">
  33. <text class="lf-font-48 lf-color-primary lf-font-bold">{{ goods_detail.redeem_point }}</text>
  34. <text class="lf-font-28 lf-color-777 lf-m-l-10">个兑换</text>
  35. </view>
  36. <lf-price :iftext="false" :price="goods_detail.sell_price || 0" v-else></lf-price>
  37. <text class="lf-iconfont icon-fenxiang lf-font-40" @click="shareGraphic()"></text>
  38. </view>
  39. <view class="lf-row-between lf-font-24 lf-m-t-20 lf-p-b-20">
  40. <view class="lf-font-bold lf-font-32 lf-color-222">{{ goods_detail.name }}</view>
  41. </view>
  42. <view class="lf-row-between lf-font-24 lf-p-b-30">
  43. <view class="lf-font-28 lf-color-777 lf-row-between">可自提/可邮寄</view>
  44. </view>
  45. </view>
  46. <!-- 商品优惠 -->
  47. <block v-if="coupons && coupons.length">
  48. <self-line></self-line>
  49. <view class="bg-white" >
  50. <view class="cu-bar padding-lr">
  51. <view class="lf-flex">
  52. <text class="lf-color-777 lf-font-28">优惠</text>
  53. <view style="width: 580rpx;">
  54. <view class="lf-color-222 lf-font-26 lf-m-l-30"
  55. v-for="(item, index) in coupons" :key="index">{{ item.title }}
  56. </view>
  57. </view>
  58. </view>
  59. <view>
  60. <text class="lf-font-24 lf-color-777 lf-iconfont icon-xiangyou"></text>
  61. </view>
  62. </view>
  63. </view>
  64. </block>
  65. <self-line></self-line>
  66. <!-- 服务tags -->
  67. <block v-if="goods_detail.tags.length">
  68. <view class="bg-white">
  69. <view class="cu-bar padding-lr">
  70. <view class="lf-flex">
  71. <text class="lf-color-777 lf-font-28">服务</text>
  72. <view style="width: 600rpx;flex-wrap: wrap;display: flex;margin-top: 32rpx;">
  73. <view class="lf-m-l-30" v-for="(tagItem, tagIndex) in goods_detail.tags" :key="tagIndex">
  74. <text class="lf-iconfont icon-xuanzhong lf-font-30" style="color: #15716E;"></text>
  75. <text class="lf-m-l-10 lf-font-26 lf-color-black">{{ tagItem }}</text>
  76. </view>
  77. </view>
  78. </view>
  79. <view>
  80. <text class="lf-font-24 lf-color-777 lf-iconfont icon-xiangyou"></text>
  81. </view>
  82. </view>
  83. </view>
  84. </block>
  85. <!-- 商品选择规格 -->
  86. <view class="bg-white">
  87. <!-- todo 选择后显示 -->
  88. <view class="cu-bar padding-lr" @click="shoot(2)">
  89. <view class="lf-flex">
  90. <text class="lf-color-777 lf-font-28">选择</text>
  91. <text class="lf-color-222 lf-font-26 lf-m-l-30">选中的商品规格TODO</text>
  92. </view>
  93. <view>
  94. <text class="lf-font-24 lf-color-777 lf-iconfont icon-xiangyou"></text>
  95. </view>
  96. </view>
  97. </view>
  98. <self-line></self-line>
  99. <!-- 店铺信息 -->
  100. <view>
  101. <view class="user-top">
  102. <view class="lf-row-between lf-w-100">
  103. <view class="lf-flex" @click="$url('/pages/shop/shopdetail?id='+ brand_detail.id)">
  104. <view class="tag-father">
  105. <image :src="brand_detail.logo" mode="aspectFill" class="head-img"></image>
  106. </view>
  107. <view class="lf-flex-column lf-m-l-20">
  108. <text class="lf-font-28 lf-color-black lf-font-bold">{{ brand_detail.name }}</text>
  109. <view class="lf-font-24 lf-color-777">
  110. <text class="lf-iconfont icon-dizhi lf-font-24 lf-color-primary"></text>
  111. <text class="lf-m-l-10">{{ brand_detail.floor }}</text>
  112. </view>
  113. </view>
  114. </view>
  115. <!-- <view>
  116. <button class="head-btn" @click="$url('/pages/user/my/chatonline')">
  117. <text class="lf-iconfont icon-kefuhdpi lf-font-24"></text>
  118. <text class="lf-m-l-10">客服</text>
  119. </button>
  120. </view> -->
  121. </view>
  122. </view>
  123. <scroll-view class="scroll-view" :scroll-x="true">
  124. <view class="scroll-content">
  125. <view class="goods-item"
  126. v-for="(item, index) in brand_detail.goods"
  127. :key="index"
  128. @click="$url('/pages/shop/goodsdetail?id='+ item.id)">
  129. <image class="goods-img" :src="item.img"></image>
  130. <view class="goods-info">
  131. <view class="lf-line-1">{{ item.name }}</view>
  132. <view>{{ item.sell_price }}</view>
  133. </view>
  134. </view>
  135. <view class="goods-item" @click="$url('/pages/shop/shopdetail?id='+ brand_detail.id)">
  136. <view class="more-box">
  137. <text>查看更多</text>
  138. <text class="lf-iconfont icon--2 lf-text-vertical"></text>
  139. </view>
  140. </view>
  141. </view>
  142. </scroll-view>
  143. </view>
  144. <!-- 商品详情 -->
  145. <view class="goods-detail">
  146. <view class="lf-font-32 lf-font-bold lf-m-b-20">商品详情</view>
  147. <rich-text :nodes="formatRichText(goods_detail.content)"></rich-text>
  148. <!-- <image class="goods-img" :src="item" v-for="(item, index) in goods_detail.content" :key="index" v-if="goods_detail.content_type == 'img'"></image> -->
  149. </view>
  150. <!-- 修饰专用 -->
  151. <view class="extra"></view>
  152. <!-- 吸底操作按钮 -->
  153. <view class="lf-row-between fixed-bottom">
  154. <view class="lf-flex lf-p-t-10 lf-p-b-10">
  155. <!-- <view class="lf-flex-column lf-row-center icon-item" open-type="contact">
  156. <text class="lf-iconfont icon-pinglun- icon-img"></text>
  157. <view class="lf-m-t-1">客服</view>
  158. </view> -->
  159. <view class="lf-flex-column lf-row-center icon-item" @click="switchCollect">
  160. <text class="lf-iconfont icon-shoucang2 icon-img lf-color-price" v-if="is_collect"></text>
  161. <text class="lf-iconfont icon-shoucang11 icon-img" v-else></text>
  162. <view class="lf-m-t-1">{{ is_collect ? '已收藏' : '收藏' }}</view>
  163. </view>
  164. <button class="lf-flex-column lf-row-center icon-item" @click="$url('/pages/store/cart/cart')">
  165. <text class="lf-iconfont icon-gouwulan icon-img"></text>
  166. <view class="lf-m-t-1">购物车</view>
  167. </button>
  168. </view>
  169. <view v-if="type == 'seckill'">
  170. <button class="btn" style="width: 349rpx;">立即秒杀</button>
  171. </view>
  172. <view v-else-if="type == 'point'">
  173. <button class="btn" style="width: 349rpx;">立即兑换</button>
  174. </view>
  175. <view class="lf-flex" v-else>
  176. <button class="btn1" @click="shoot(1)">加入购物车</button>
  177. <button class="btn lf-m-l-15" @click="shoot(2)">立即购买</button>
  178. </view>
  179. </view>
  180. <!-- 加入购物车立即购买模态框选规格 -->
  181. <u-popup v-model="show_popup" mode="bottom" :round="true" borderRadius="20">
  182. <!-- todo 高度问题优化 -->
  183. <view class="popup-content">
  184. <!-- 商品信息及关闭按钮 -->
  185. <view class="popup-head">
  186. <view class="lf-flex">
  187. <image class="goods-img" :src="goods_detail.img"></image>
  188. <view class="goods-info">
  189. <view class="price">¥{{ goods_detail.min_price }}-¥{{ goods_detail.max_price }}</view>
  190. <view class="goods-name">{{ goods_detail.name }}</view>
  191. </view>
  192. </view>
  193. <view @click="show_popup = false">
  194. <text class="lf-iconfont icon-cuo lf-font-50"></text>
  195. </view>
  196. </view>
  197. <!-- 规格 -->
  198. <view v-for="(value, key) in goods_stock.specs" :key="key">
  199. <view class="spec-title">{{ value.label }}</view>
  200. <view class="lf-flex-wrap">
  201. <view :class="{
  202. 'spec-item': true,
  203. 'spec-active': item.spec_current === index}"
  204. @click="activeSpec(key, index)"
  205. v-for="(item, index) in value.list"
  206. :key="index">{{ item.value }}
  207. </view>
  208. </view>
  209. </view>
  210. <!-- 数量 -->
  211. <view class="lf-row-between lf-m-t-40">
  212. <view class="lf-font-28 lf-color-555">数量</view>
  213. <view class="lf-flex">
  214. <view class="num-btn" @click="changeNum('less')">
  215. <text class="lf-iconfont icon-jian1 lf-font-30"></text>
  216. </view>
  217. <view>
  218. <input class="input" :value="goods_num" :disabled="true" />
  219. </view>
  220. <view class="num-btn lf-text-right" @click="changeNum('add')">
  221. <text class="lf-iconfont icon-jia lf-font-30"></text>
  222. </view>
  223. </view>
  224. </view>
  225. <!-- 操作按钮 -->
  226. <button class="comfirm-btn" @click="confirm">{{ click_type == 1 ? '加入购物车' : '立即购买' }}</button>
  227. </view>
  228. </u-popup>
  229. <!-- 回到顶部 -->
  230. <u-back-top :scroll-top="pageScrollTop"></u-back-top>
  231. </block>
  232. </skeleton>
  233. </view>
  234. </template>
  235. <script>
  236. import countdownTimer from '@/components/countdown-timer/countdown-timer';
  237. export default {
  238. components: {
  239. countdownTimer
  240. },
  241. data(){
  242. return {
  243. current: 0, // 轮播下标
  244. goods_id: 0,
  245. goods_detail: {},
  246. is_collect: false, // 1为当前收藏商品了,0为否
  247. skeletonLoading: false,
  248. pictures: [],
  249. show_popup: false, // 是否显示选规格模态框
  250. spec_current: null, // 规格下标
  251. click_type: null, // 当前点击的是加入购物车[1]还是立即购买[2]
  252. type: 'mail', // 页面显示类型,mail普通可邮寄商品,point积分商品,seckill秒杀商品
  253. time: new Date('2021/09/8 14:15:00').getTime() - new Date('2021/09/8 13:10:00').getTime(),
  254. goods_stock: {
  255. specs: {},
  256. stores: {}
  257. },
  258. seckill: {}, // 秒杀商品的信息
  259. brand_detail: {},
  260. token: '',
  261. coupons: [], // 优惠
  262. goods_num: 1
  263. }
  264. },
  265. onLoad(options){
  266. console.log("options", options)
  267. this.token = this.$cookieStorage.get('user_token');
  268. this.goods_id = options.id;
  269. // this.type = options.type || 'mail'; // TODO 改变思路,不是由外界控制
  270. this.getNewdetail();
  271. this.getGoodsStock(); // 获取商品库存、规格信息
  272. },
  273. methods: {
  274. // 切换商品收藏
  275. switchCollect(){
  276. if(!this.token){
  277. this.$url('/pages/login/index');
  278. return;
  279. }
  280. this.addCollcet()
  281. },
  282. //收藏
  283. addCollcet() {
  284. this.$http.post({
  285. api: 'api/collect/create',
  286. data: {
  287. type:'jc_goods',
  288. collect_id: this.goods_detail.id,
  289. },
  290. header: {
  291. Authorization: this.token
  292. }
  293. }).then(res => {
  294. this.$msg(res.data.data);
  295. this.getNewdetail();
  296. }).catch(err => {
  297. console.log("====", err);
  298. })
  299. },
  300. // 加入购物车和立即购买
  301. shoot(type){
  302. this.click_type = type;
  303. if(this.$isRight(this.goods_stock.specs)){
  304. this.show_popup = true;
  305. }else{
  306. this.confirm();
  307. }
  308. },
  309. // 商品选规格
  310. activeSpec(key, index){
  311. let obj = this.goods_stock.specs;
  312. if(obj[key].spec_current == index){
  313. obj[key].spec_current = null;
  314. }else{
  315. obj[key].spec_current = index;
  316. }
  317. this.$set(this.goods_stock, 'specs', obj);
  318. },
  319. // 商品加减
  320. changeNum(type){
  321. if(type == 'add'){
  322. if(this.goods_num < 10){
  323. this.goods_num++;
  324. }
  325. }else if(type == 'less'){
  326. if(this.goods_num > 1){
  327. this.goods_num--;
  328. }
  329. }
  330. },
  331. // 跳转至下单页TODO
  332. confirm(){
  333. if(this.click_type == 2){
  334. this.$url('/pages/order/confirm/confirm');
  335. }
  336. },
  337. // 点击页面分享按钮
  338. shareGraphic(){
  339. this.getCreateShareImg();
  340. },
  341. //请求h5的图片接口
  342. getCreateShareImg(){
  343. wx.showLoading({
  344. title:"生成中",
  345. mask:true
  346. })
  347. let origin = window.location.origin;
  348. let share_url = origin+'/pages/store/detail/detail';
  349. this.$http.get({
  350. api:'api/distribution/createH5ShareImg',
  351. data:{
  352. goods_id:this.id,
  353. share_url:share_url
  354. }
  355. }).then(res=>{
  356. res = res.data;
  357. if(res.status){
  358. this.qr_code_image = res.data.image;
  359. if(this.qr_code_image){
  360. this.share_gaphic =!this.share_gaphic;
  361. this.is_toggle_share = false;
  362. }
  363. } else{
  364. wx.showModal({
  365. content: res.message || '请求失败,请重试',
  366. showCancel: false
  367. });
  368. }
  369. wx.hideLoading()
  370. }).catch(rej=>{
  371. wx.hideLoading()
  372. wx.showModal({
  373. content: rej.message || '内部错误,请重试',
  374. showCancel: false
  375. });
  376. })
  377. },
  378. // 商品详情
  379. getNewdetail(){
  380. this.$http.get({
  381. api: 'api/store/detail/'+ this.goods_id,
  382. header: {
  383. Authorization: this.token
  384. }
  385. }).then(res => {
  386. console.log("===---", res);
  387. let meta = res.data.meta;
  388. let goods_detail = res.data.data;
  389. this.goods_detail = goods_detail;
  390. this.pictures = [res.data.data.img];
  391. this.is_collect = Boolean(res.data.data.is_collect) || false;
  392. let type = 'mail';
  393. if(this.$isRight(goods_detail.is_largess)){
  394. type = 'point';
  395. }
  396. if(this.$isRight(meta.seckill)){
  397. type = 'seckill';
  398. this.seckill = meta.seckill;
  399. }
  400. if(type != 'point'){
  401. this.getBrandDetail(goods_detail.brand_id);
  402. }
  403. if(this.$isRight(meta.discounts)){
  404. this.coupons = meta.discounts.coupons;
  405. }
  406. this.type = type;
  407. }).catch(err => {
  408. console.log("====", err);
  409. })
  410. },
  411. // 获取商家信息
  412. getBrandDetail(brand_id){
  413. this.$http.get({
  414. api: 'api/brand/detail',
  415. data: {
  416. brand_id: brand_id
  417. },
  418. header: {
  419. Authorization: this.token
  420. }
  421. }).then(res => {
  422. this.brand_detail = res.data.data;
  423. })
  424. },
  425. // 获取商品库存信息
  426. getGoodsStock(){
  427. this.$http.get({
  428. api: `api/store/detail/${this.goods_id}/stock`
  429. }).then(res => {
  430. this.goods_stock = res.data.data;
  431. })
  432. },
  433. // 拨打电话
  434. makePhoneCall(phoneStr){
  435. uni.makePhoneCall({
  436. phoneNumber: String(phoneStr)
  437. })
  438. },
  439. // 打开地图 PS.暂时用不到
  440. openMap(){
  441. let { address, lat, lng } = this.goods_detail?.store || {};
  442. uni.openLocation({
  443. longitude: Number(lat),
  444. latitude: Number(lng),
  445. scale: 20,
  446. name: address
  447. });
  448. },
  449. // 预览图片
  450. lookImg(index){
  451. this.$u.throttle(() => {
  452. let banners = this.pictures;
  453. uni.previewImage({
  454. urls: banners,
  455. current: index
  456. })
  457. }, 200);
  458. },
  459. // 富文本处理
  460. formatRichText(richText){
  461. if(richText != null){
  462. let newRichText= richText.replace(/<img[^>]*>/gi, function(match, capture){
  463. match = match.replace(/style="[^"]+"/gi, '').replace(/style='[^']+'/gi, '');
  464. match = match.replace(/width="[^"]+"/gi, '').replace(/width='[^']+'/gi, '');
  465. match = match.replace(/height="[^"]+"/gi, '').replace(/height='[^']+'/gi, '');
  466. return match;
  467. });
  468. newRichText = newRichText.replace(/style="[^"]+"/gi,function(match, capture){
  469. match = match.replace(/width:[^;]+;/gi, 'width:100%;').replace(/width:[^;]+;/gi, 'width:100%;');
  470. return match;
  471. });
  472. newRichText = newRichText.replace(/<br[^>]*\/>/gi, '');
  473. newRichText = newRichText.replace(/\<img/gi, '<img style="width:100%;height:auto;display:block;margin:10px 0;"');
  474. return newRichText;
  475. }else{
  476. return null;
  477. }
  478. }
  479. },
  480. onShareAppMessage(){
  481. let goods = this.goods_detail;
  482. let title = goods.name;
  483. let imageUrl = goods.share_cover || goods.cover || goods.img;
  484. let path = '/pages/route/index?route=detail&id='+ goods.id;
  485. return {
  486. title,
  487. path,
  488. imageUrl
  489. }
  490. }
  491. }
  492. </script>
  493. <style>
  494. page{
  495. background-color: #f5f5f5;
  496. overflow-x: hidden;
  497. }
  498. </style>
  499. <style lang="scss" scoped="scoped">
  500. //商品上去scrollview部分
  501. .scroll-view{
  502. height: 310rpx;
  503. width: 100%;
  504. // margin-top: 20rpx;
  505. padding: 0 30rpx 30rpx 30rpx;
  506. background-color: white;
  507. .scroll-content{
  508. display: flex;
  509. width: 100%;
  510. .goods-item{
  511. margin-right: 15rpx;
  512. width: 180rpx;
  513. }
  514. .goods-img{
  515. width: 180rpx;
  516. height: 180rpx;
  517. background-color: #EEEEEE;
  518. }
  519. .goods-info{
  520. text-align: center;
  521. color: #222222;
  522. &>view:nth-child(1n){
  523. font-size: 24rpx;
  524. }
  525. &>view:nth-child(2n){
  526. font-size: 28rpx;
  527. font-weight: bold;
  528. text-align: left;
  529. color: #F63434;
  530. }
  531. }
  532. .more-box{
  533. width: 180rpx;
  534. height: 180rpx;
  535. background-color: #EEEEEE;
  536. text-align: center;
  537. line-height: 180rpx;
  538. font-size: 24rpx;
  539. }
  540. }
  541. }
  542. //scrollview结束
  543. .tag-father {
  544. position: relative;
  545. }
  546. .head-tag {
  547. color: white;
  548. display: flex;
  549. align-items: center;
  550. justify-content: center;
  551. text-align: center;
  552. font-size: 24rpx;
  553. width: 36rpx;
  554. height: 36rpx;
  555. border-radius: 50%;
  556. background-color: #15716E;
  557. border: 1rpx solid #FFFFFF;
  558. position: absolute;
  559. left: 76rpx;
  560. top: 86rpx;
  561. z-index: 99;
  562. }
  563. .qzone-img {
  564. width: 220rpx;
  565. height: 220rpx;
  566. border-radius: 10rpx;
  567. margin-right: 12rpx;
  568. &:nth-child(3n) {
  569. margin-right: 0;
  570. }
  571. &:nth-child(n + 4) {
  572. margin-top: 12rpx;
  573. }
  574. }
  575. .user-top {
  576. background-color: #F3F8F8;
  577. padding: 30rpx;
  578. display: flex;
  579. align-items: center;
  580. background-color: white;
  581. }
  582. .head-img {
  583. width: 80rpx;
  584. height: 80rpx;
  585. border-radius: 50%;
  586. }
  587. .head-btn {
  588. display: flex;
  589. width: max-content;
  590. height: 45rpx;
  591. background: white;
  592. border: 2rpx solid #15716E;
  593. align-items: center;
  594. font-size: 22rpx;
  595. color: #15716E;
  596. justify-content: space-between;
  597. border-radius: 35rpx;
  598. padding: 10rpx!important;
  599. }
  600. .swiper-box{
  601. width: 750rpx;
  602. height: 750rpx;
  603. background-color: #FFFFFF;
  604. position: relative;
  605. .seckill-box{
  606. position: absolute;
  607. bottom: 0;
  608. left: 0;
  609. display: flex;
  610. justify-content: space-between;
  611. align-items: center;
  612. padding: 0 32rpx;
  613. width: 100%;
  614. height: 77rpx;
  615. background-color: #15716E;
  616. color: #FFFFFF;
  617. font-size: 26rpx;
  618. }
  619. }
  620. .head-info{
  621. width: 750rpx;
  622. height: auto;
  623. box-sizing: border-box;
  624. padding: 0 32rpx;
  625. padding-top: 20rpx;
  626. background-color: #FFFFFF;
  627. // .price>view:nth-of-type(1){
  628. // color: #FF0000;
  629. // margin-right: 22rpx;
  630. // font-weight: bold;
  631. // }
  632. .price>view:nth-of-type(1){
  633. text-decoration: line-through;
  634. color: #777777;
  635. margin-right: 22rpx;
  636. }
  637. .price>view:nth-of-type(2){
  638. width: max-content;
  639. padding: 0 18rpx;
  640. height: 46rpx;
  641. background-color: #1998FE;
  642. border-radius: 10rpx;
  643. display: flex;
  644. justify-content: center;
  645. align-items: center;
  646. color: #FFFFFF;
  647. }
  648. .label-box{
  649. min-height: 130rpx;
  650. width: 100%;
  651. border-top: 1rpx solid #E5E5E5;
  652. display: flex;
  653. flex-wrap: wrap;
  654. padding: 30rpx 0 10rpx 0;
  655. .label-item{
  656. width: max-content;
  657. padding: 20rpx;
  658. height: 70rpx;
  659. border-radius: 10rpx;
  660. border: 2rpx solid #1998FE;
  661. display: flex;
  662. justify-content: center;
  663. align-items: center;
  664. font-size: 28rpx;
  665. color: #1998FE;
  666. margin-right: 20rpx;
  667. margin-bottom: 20rpx;
  668. }
  669. }
  670. }
  671. .address-box{
  672. width: 750rpx;
  673. height: auto;
  674. box-sizing: border-box;
  675. background-color: #FFFFFF;
  676. padding: 32rpx;
  677. margin-top: 20rpx;
  678. .shop-img{
  679. width: 60rpx;
  680. height: 60rpx;
  681. border-radius: 50%;
  682. }
  683. }
  684. .goods-detail{
  685. width: 750rpx;
  686. height: auto;
  687. background-color: #FFFFFF;
  688. padding: 32rpx;
  689. box-sizing: border-box;
  690. margin-top: 20rpx;
  691. .goods-img{
  692. width: 100%;
  693. }
  694. }
  695. .extra{
  696. width: 100%;
  697. height: 110rpx;
  698. padding-bottom: constant(safe-area-inset-bottom);
  699. padding-bottom: env(safe-area-inset-bottom);
  700. box-sizing: content-box;
  701. }
  702. .fixed-bottom{
  703. position: fixed;
  704. bottom: 0;
  705. left: 0;
  706. background-color: #FFFFFF;
  707. width: 100%;
  708. height: auto;
  709. padding: 0 32rpx;
  710. border-top: 1rpx solid #e5e5e5;
  711. padding-bottom: constant(safe-area-inset-bottom);
  712. padding-bottom: env(safe-area-inset-bottom);
  713. .icon-item{
  714. text-align: center;
  715. margin-right: 16rpx;
  716. background-color: transparent;
  717. margin: 0;
  718. line-height: initial;
  719. font-size: 28rpx;
  720. font-weight: inherit;
  721. margin-right: 10rpx;
  722. padding: 0;
  723. width: 88rpx;
  724. position: relative;
  725. &:first-child{
  726. padding-left: 0;
  727. }
  728. .icon-img{
  729. height: 50rpx;
  730. width: 50rpx;
  731. font-size: 40rpx;
  732. line-height: 1;
  733. }
  734. }
  735. .btn1{
  736. margin: 0;
  737. width: max-content;
  738. height: 80rpx;
  739. background-color: rgba(21, 113, 110, 0.1);
  740. color: #15716E;
  741. line-height: 80rpx;
  742. font-size: 32rpx;
  743. padding: 0 20rpx;
  744. border-radius: 42rpx;
  745. font-size: 26rpx;
  746. border: 2rpx solid #15716E;
  747. }
  748. .btn{
  749. margin: 0;
  750. padding: 0 20rpx;
  751. width: max-content;
  752. height: 80rpx;
  753. background-color: #15716E;
  754. color: #FFFFFF;
  755. line-height: 80rpx;
  756. font-size: 26rpx;
  757. border-radius: 42rpx;
  758. }
  759. }
  760. .popup-content{
  761. height: max-content;
  762. width: 750rpx;
  763. background: #FFFFFF;
  764. border-radius: 20rpx 20rpx 0rpx 0rpx !important;
  765. padding: 40rpx 32rpx;
  766. .popup-head{
  767. display: flex;
  768. justify-content: space-between;
  769. .goods-img{
  770. width: 150rpx;
  771. height: 150rpx;
  772. border-radius: 2rpx;
  773. margin-right: 20rpx;
  774. }
  775. .goods-info{
  776. width: 400rpx;
  777. height: 150rpx;
  778. display: flex;
  779. flex-direction: column;
  780. justify-content: space-around;
  781. .price{
  782. font-size: 48rpx;
  783. font-weight: bold;
  784. color: #F63434;
  785. line-height: 1;
  786. }
  787. .goods-name{
  788. font-size: 32rpx;
  789. color: #222222;
  790. line-height: 1.4;
  791. }
  792. }
  793. }
  794. .spec-title{
  795. font-size: 28rpx;
  796. color: #555555;
  797. margin-top: 40rpx;
  798. margin-bottom: 20rpx;
  799. }
  800. .spec-item{
  801. width: 142rpx;
  802. height: 64rpx;
  803. border-radius: 33rpx;
  804. border: 2rpx solid #555555;
  805. font-size: 28rpx;
  806. color: #555555;
  807. display: flex;
  808. justify-content: center;
  809. align-items: center;
  810. margin-right: 20rpx;
  811. &:nth-child(4n){
  812. margin-right: 0rpx;
  813. }
  814. &:nth-child(n+5){
  815. margin-top: 20rpx;
  816. }
  817. }
  818. .spec-active{
  819. border: none;
  820. background-color: #15716E;
  821. color: #FFFFFF;
  822. }
  823. .input{
  824. width: 40rpx;
  825. height: 45rpx;
  826. border-radius: 2rpx;
  827. background-color: #F3F8F7;
  828. text-align: center;
  829. }
  830. .num-btn{
  831. width: 36rpx;
  832. }
  833. .comfirm-btn{
  834. width: 550rpx;
  835. height: 100rpx;
  836. background: #15716E;
  837. border-radius: 50rpx;
  838. color: #FFFFFF;
  839. line-height: 100rpx;
  840. margin-top: 62rpx;
  841. }
  842. }
  843. </style>