金诚优选前端代码
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.

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