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

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