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

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