detail.vue 25 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132
  1. <template>
  2. <view class="container">
  3. <view class="carousel">
  4. <swiper indicator-dots :circular="true" duration="400">
  5. <swiper-item class="swiper-item" v-for="(item, index) in imgList" :key="index">
  6. <view class="image-wrapper"><image :src="item" class="loaded" mode="aspectFill"></image></view>
  7. </swiper-item>
  8. </swiper>
  9. </view>
  10. <view class="introduce-section">
  11. <view class="price-box" v-if="goodsType == 0">
  12. <image src="../../static/icon/xfq.png" mode=""></image>
  13. <text class="price">{{ goodsObjact.price }}</text><text class="jftit"> 消费券</text>
  14. <text class="old-price">¥{{goodsObjact.ot_price}}</text>
  15. </view>
  16. <text class="title" v-if="goodsType == 0">{{ goodsObjact.store_name }}</text>
  17. <view class="bot-row">
  18. <text>快递: {{ goodsObjact.postage }}</text>
  19. <text style="text-align: center;">销量: {{ goodsObjact.sales }}</text>
  20. <text style="text-align: right;">{{ storeObjact.address | address}}</text>
  21. </view>
  22. </view>
  23. <!-- 评价 -->
  24. <view class="eva-section" v-if="reply" @click="navTo('/pages/product/reply?id=' + goodsid)">
  25. <view class="e-header">
  26. <text class="tit">评价</text>
  27. <text>({{ details.replyCount }})</text>
  28. <text class="tip">好评率 {{ details.replyChance }}%</text>
  29. <text class="iconfont iconenter"></text>
  30. </view>
  31. <view class="eva-box">
  32. <image class="portrait" :src="reply.avatar" mode="aspectFill"></image>
  33. <view class="right">
  34. <text class="name">{{ reply.nickname }}</text>
  35. <text class="con">{{ reply.comment }}</text>
  36. <view class="con_box">
  37. <view class="con_image" v-for="item in reply.pics"><image :src="item"></image></view>
  38. </view>
  39. <view class="bot">
  40. <text class="attr"></text>
  41. <text class="time">{{ reply.add_time }}</text>
  42. </view>
  43. </view>
  44. </view>
  45. <view class="eva-boxs" v-if="reply.merchant_reply_content">
  46. <view class="right">
  47. <text class="con">
  48. <text style="color: #FD5B23;margin-right: 8rpx;">商家回复 :</text>
  49. {{ reply.merchant_reply_content }}
  50. </text>
  51. <view class="bot">
  52. <text class="attr"></text>
  53. <text class="time">{{ reply.merchant_reply_time }}</text>
  54. </view>
  55. </view>
  56. </view>
  57. </view>
  58. <view class="c-list">
  59. <view class="c-row b-b" @click="toggleSpec">
  60. <text class="tit">购买数量</text>
  61. <view class="con">
  62. <text class="selected-text">{{ goodsNumber }}</text>
  63. </view>
  64. <text class="iconfont iconenter"></text>
  65. </view>
  66. <view class="c-row b-b" v-if="goodsType == 1">
  67. <text class="tit">限购数量</text>
  68. <view class="con">
  69. <text class="selected-text">{{ goodsObjact.num + goodsObjact.unit_name }}</text>
  70. </view>
  71. </view>
  72. </view>
  73. <view class="shop-box flex" v-if="goodsType == 0 && shopId > 0">
  74. <view class="flex">
  75. <image :src="shopInfo.logo" mode=" aspectFit" class="shop-img"></image>
  76. <text class="font-size-lg">{{ shopInfo.title }}</text>
  77. </view>
  78. <navigator :url="'/pages/shoping/index?merid=' + shopId"><view class="shop-button">进店逛逛</view></navigator>
  79. </view>
  80. <view class="detail-desc">
  81. <view class="d-header"><text>图文详情</text></view>
  82. <rich-text class="detail-centent" :nodes="goodsObjact.description"></rich-text>
  83. <view :class="{ contentBottomHeight: goodsType == 1 || goodsType == 2, goodsBottom: goodsType == 0 }"></view>
  84. </view>
  85. <!-- 底部操作菜单 -->
  86. <view class="page-bottom" v-if="goodsType == 0">
  87. <view class="action-btn-group">
  88. <button type="primary" class=" action-btn no-border add-cart-btn" @click="toggleSpec(1)">立即兑换</button>
  89. </view>
  90. </view>
  91. <!-- 规格-模态层弹窗 -->
  92. <view class="popup spec" :class="specClass" @touchmove.stop.prevent="stopPrevent" @click="toggleSpec">
  93. <!-- 遮罩层 -->
  94. <view class="mask"></view>
  95. <view class="layer attr-content" @click.stop="stopPrevent">
  96. <view class="a-t">
  97. <image :src="actionImage"></image>
  98. <view class="right">
  99. <view class="good-name clamp">{{goodsObjact.store_name}}</view>
  100. <text class="price"><image src="../../static/icon/xfq.png"></image>{{ actionPrice }}</text>
  101. <!-- <text class="stock">库存:{{ goodsObjact.stock }}件</text> -->
  102. <!-- <view class="selected" v-if="goodsType == 0">
  103. 已选:
  104. <text class="selected-text" v-for="(sItem, sIndex) in specSelected" :key="sIndex">{{ sItem }}</text>
  105. </view> -->
  106. </view>
  107. </view>
  108. <view v-for="(item, index) in specList" :key="index" class="attr-list">
  109. <text>{{ item.attr_name }}</text>
  110. <view class="item-list">
  111. <text
  112. v-for="(childItem, childIndex) in item.attr_value"
  113. :key="childIndex"
  114. class="tit"
  115. :class="{ selected: childItem.check }"
  116. @click="selectSpec(childItem, item, index)"
  117. >
  118. {{ childItem.attr }}
  119. </text>
  120. </view>
  121. </view>
  122. <view class="attr-list">
  123. <text>购买数量</text>
  124. <view class="item-list">
  125. <uni-number-box class="step" :isMin="true" :value="goodsNumber" :min="1" :max="goodsNumberMax" @eventChange="numberChange"></uni-number-box>
  126. </view>
  127. </view>
  128. <button class="btn" @click.stop="buy">完成</button>
  129. </view>
  130. </view>
  131. <view :class="{ seckillBottom: goodsType == 1, goodsBottom: goodsType == 0 }"></view>
  132. <!-- 分享 -->
  133. <!-- <share ref="share" :contentHeight="580" :shareList="shareList"></share> -->
  134. </view>
  135. </template>
  136. <script>
  137. import share from '@/components/share';
  138. import uniNumberBox from '@/components/uni-number-box.vue';
  139. import uniCountdown from '@/components/uni-countdown/uni-countdown.vue';
  140. import { goodsDetail, cartAdd, collectAdd, collectDel, seckillGoods, groupGoods } from '@/api/product.js';
  141. import { getShoping } from '@/api/shoping.js';
  142. // #ifdef H5
  143. import { weixindata } from '@/utils/wxAuthorized';
  144. import { mapState } from 'vuex';
  145. // #endif
  146. export default {
  147. components: {
  148. share,
  149. uniNumberBox,
  150. uniCountdown
  151. },
  152. filters: {
  153. address(val) {
  154. let str = ''
  155. if(val) {
  156. str = val[0] + ' ' + val[1]
  157. }
  158. return str
  159. }
  160. },
  161. data() {
  162. return {
  163. details: '',
  164. reply: '', //评论
  165. type: 1, //默认支付方式add为
  166. goodsNumber: 1, //购买数量
  167. goodsid: '', //商品id
  168. specClass: 'none', //显示隐藏弹窗
  169. shareList: [], //分享列表
  170. goodsObjact: {}, //保存商品数据
  171. storeObjact: {},//保存店铺数据
  172. //图片循环
  173. imgList: [],
  174. specList: [],
  175. // 对比对象
  176. productValue: [],
  177. actionPrice: 0, //默认选中商品价格
  178. actionImage: '', //默认选中图片
  179. uniqueId: '', //选中的商品分类
  180. specSelected: [], //选中的分类
  181. specSelectedName: '', //选中分类名称
  182. goodsNumberMax: 0, //最大可购买数量
  183. shopId: '', //商店id
  184. //商店信息
  185. shopInfo: {
  186. logo: '',
  187. title: ''
  188. }, //商店信息
  189. goodsType: 0, //商品类型1秒杀商品0为普通商品2为拼团商品
  190. // 秒杀数据保存
  191. seckillObj: {
  192. stopTime: 0, //结束时间
  193. stop: false, //是否结束
  194. stopTimeH: 0, //小时
  195. stopTimeM: 0, //分钟
  196. stopTimeS: 0 //秒钟
  197. },
  198. // 拼团数据保存
  199. pink: {
  200. id: '', //拼团编号
  201. uid: '', //用户编号
  202. people: '', //拼团人数
  203. price: '', //拼团价格
  204. stop_time: '', //拼团结束时间
  205. nickname: '', //团长昵称
  206. avatar: '', //团长头像
  207. count: '', //拼团剩余人数
  208. h: '', //时
  209. i: '', //分
  210. s: '' //秒
  211. },
  212. detype: '1',// 1为积分商品 2为兑换券商品
  213. };
  214. },
  215. async onLoad(options) {
  216. let obj = this;
  217. if(options.detype) {
  218. obj.detype = options.detype
  219. }
  220. //保存商品id
  221. this.goodsid = options.id;
  222. // 判断有无人邀请
  223. if (options.spread) {
  224. // 存储邀请人
  225. uni.setStorageSync('spread', options.spread);
  226. }
  227. // 判断是否为秒杀商品
  228. if (options.type == 1) {
  229. // 保存商品类型
  230. this.goodsType = 1;
  231. // 保存结束时间
  232. this.seckillObj.stopTime = options.stoptime;
  233. // 获取当前时间毫秒数
  234. let stoptime = options.stoptime * 1000;
  235. // 获取当前时间
  236. let acitonTime = new Date();
  237. // 判断当前时间是否大于结束时间
  238. if (acitonTime.getTime() > stoptime) {
  239. // 当前秒杀时间已经结束
  240. this.seckillObj.stop = true;
  241. } else {
  242. // 计算倒计时
  243. this.timeComputed(stoptime, this.seckillObj);
  244. }
  245. this.seckillGoods();
  246. return;
  247. }
  248. if (options.type == 2) {
  249. // 保存当前拼团商品类型
  250. this.goodsType = 2;
  251. // 家在数据
  252. this.groupGoods();
  253. return;
  254. }
  255. if (this.goodsType == 0) {
  256. // 加载普通商品详情
  257. this.goodsDetail();
  258. }
  259. },
  260. computed: {
  261. // #ifdef H5
  262. ...mapState(['weichatObj', 'baseURL', 'urlFile']),
  263. ...mapState('user', ['userInfo'])
  264. // #endif
  265. },
  266. methods: {
  267. navTo(url) {
  268. uni.navigateTo({
  269. url
  270. });
  271. },
  272. //获取商店信息
  273. getShoping() {
  274. let obj = this;
  275. getShoping({
  276. mer_id: this.shopId
  277. })
  278. .then(function({ data }) {
  279. console.log(data);
  280. obj.shopInfo = data;
  281. })
  282. .catch(e => {
  283. console.log(e);
  284. });
  285. },
  286. // 转换字符串为数字
  287. moneyNum: function(value) {
  288. return +value;
  289. },
  290. navToProductGoods() {
  291. uni.redirectTo({
  292. url: '/pages/product/product?id=' + this.goodsObjact.product_id
  293. });
  294. },
  295. // 获取商品信息
  296. goodsDetail() {
  297. let obj = this;
  298. goodsDetail({}, this.goodsid).then(function({ data }) {
  299. obj.details = data;
  300. let goods = data.storeInfo;
  301. let store_info = data.system_store// 保存店铺信息
  302. console.log(store_info)
  303. obj.storeObjact = store_info
  304. obj.goodsObjact = goods;
  305. obj.reply = data.reply; //保存评论列表
  306. obj.imgList = goods.slider_image; //保存轮播图
  307. obj.specList = data.productAttr; //保存分类列表
  308. obj.productValue = data.productValue; //保存分类查询数据
  309. obj.actionPrice = goods.price; //保存默认选中商品价格
  310. obj.actionImage = goods.image_base; //保存默认选中商品价格
  311. obj.goodsNumberMax = goods.stock; //保存默认选中最大可购买商品数量
  312. obj.shopId = data.mer_id; //保存商店id
  313. if (obj.shopId > 0) {
  314. obj.getShoping();
  315. }
  316. // #ifdef H5
  317. obj.shareDate();
  318. // #endif
  319. });
  320. },
  321. // #ifdef H5
  322. // 加载微信html5页面分享方法
  323. shareDate() {
  324. let obj = this;
  325. // 保存分享人id链接
  326. let url = window.location.href + '&spread=' + this.userInfo.uid;
  327. // 判断是否微信浏览器
  328. let bool = uni.getStorageSync('weichatBrowser') || '';
  329. if (bool) {
  330. // 过滤微信强制添加的链接地址
  331. url = url.replace(/[\?,&]from=singlemessage/g, '');
  332. let data = {
  333. link: url, // 分享链接
  334. imgUrl: obj.goodsObjact.image, // 分享图标
  335. desc: obj.goodsObjact.store_info,
  336. title: obj.goodsObjact.store_name,
  337. success: function(e) {
  338. console.log(e);
  339. }
  340. };
  341. weixindata(data);
  342. }
  343. },
  344. // #endif
  345. // 购买数量变化
  346. numberChange(e) {
  347. this.goodsNumber = e.number;
  348. },
  349. //规格弹窗开关
  350. toggleSpec(str) {
  351. if (this.specClass === 'show') {
  352. this.specClass = 'hide';
  353. setTimeout(() => {
  354. this.specClass = 'none';
  355. }, 250);
  356. } else if (this.specClass === 'none') {
  357. this.specClass = 'show';
  358. }
  359. // 保存当前购买类型
  360. this.type = str;
  361. },
  362. //选择规格
  363. selectSpec(item, arr, ind) {
  364. arr.attr_value.forEach(function(e) {
  365. e.check = false;
  366. });
  367. item.check = true;
  368. this.specSelected[ind] = item.attr;
  369. let str = this.specSelected.join(',');
  370. this.specSelectedName = this.specSelected.join(' ');
  371. if (this.productValue[str]) {
  372. let data = this.productValue[str];
  373. this.actionPrice = data.price;
  374. this.goodsNumberMax = data.stock;
  375. this.actionImage = data.image;
  376. this.uniqueId = data.unique;
  377. }
  378. },
  379. //分享
  380. share() {
  381. this.$refs.share.toggleMask();
  382. },
  383. //收藏
  384. toFavorite(item) {
  385. let obj = this;
  386. item.userCollect = !item.userCollect;
  387. if (!item.userCollect) {
  388. collectDel({ id: obj.goodsid, category: 'product' }).then(function(e) {
  389. uni.showToast({
  390. title: '成功取消收藏',
  391. type: 'top',
  392. duration: 1500
  393. });
  394. });
  395. } else {
  396. collectAdd({ id: obj.goodsid, category: 'product' }).then(function(e) {
  397. uni.showToast({
  398. title: '成功加入收藏',
  399. type: 'top',
  400. duration: 1500
  401. });
  402. });
  403. }
  404. },
  405. // 立即购买
  406. buy() {
  407. let obj = this;
  408. let data = {
  409. cartNum: obj.goodsNumber, //商品数量
  410. uniqueId: obj.uniqueId, //商品标签
  411. new: '1', //商品是否新增加到购物车1为不加入0为加入
  412. mer_id: obj.shopId,
  413. is_consumer: 1,
  414. };
  415. if (obj.type == 2) {
  416. data.new = 0;
  417. }
  418. if (obj.goodsType == 0) {
  419. data.productId = obj.goodsid; //商品编号
  420. }
  421. // 判断是否为秒杀商品
  422. if (obj.goodsType == 1) {
  423. data.secKillId = obj.goodsid; //秒杀商品编号
  424. data.productId = obj.goodsObjact.product_id; //商品编号
  425. // 判断是否秒杀已经结束
  426. if (obj.seckillObj.stop) {
  427. uni.showModal({
  428. title: '提示',
  429. content: '当前活动已经结束',
  430. showCancel: false
  431. });
  432. return;
  433. }
  434. }
  435. // 判断是否为拼团商品
  436. if (obj.goodsType == 2) {
  437. data.combinationId = obj.goodsid; //拼团编号
  438. data.productId = obj.goodsObjact.product_id; //商品编号
  439. }
  440. cartAdd(data)
  441. .then(function({ data }) {
  442. if (obj.type == 1) {
  443. // 跳转到支付页
  444. uni.navigateTo({
  445. url: '/pages/order/createOrder?id=' + data.cartId + '&goodsType=' + obj.goodsType + '&consumer=1'
  446. });
  447. }
  448. if (obj.type == 2) {
  449. uni.showToast({
  450. title: '成功加入购物车',
  451. type: 'top',
  452. duration: 2000
  453. });
  454. obj.toggleSpec();
  455. }
  456. })
  457. .catch(e => {
  458. console.log(e);
  459. });
  460. },
  461. stopPrevent() {}
  462. }
  463. };
  464. </script>
  465. <style lang="scss">
  466. page {
  467. background: $page-color-base;
  468. }
  469. //秒杀底部高度
  470. .seckillBottom {
  471. height: 110rpx;
  472. }
  473. // 文章页底部高度撑开
  474. .contentBottomHeight {
  475. height: 110rpx;
  476. }
  477. //默认商品底部高度
  478. .goodsBottom {
  479. height: 160rpx;
  480. }
  481. .iconenter {
  482. font-size: $font-base + 2rpx;
  483. color: #888;
  484. }
  485. .carousel {
  486. /* #ifdef APP-PLUS */
  487. padding-top: var(--status-bar-height);
  488. /* #endif */
  489. height: 722rpx;
  490. position: relative;
  491. swiper {
  492. height: 100%;
  493. }
  494. .image-wrapper {
  495. width: 100%;
  496. height: 100%;
  497. }
  498. .swiper-item {
  499. display: flex;
  500. justify-content: center;
  501. align-content: center;
  502. // height: 750rpx;
  503. height: 710rpx;
  504. overflow: hidden;
  505. image {
  506. width: 100%;
  507. height: 100%;
  508. }
  509. }
  510. }
  511. // 秒杀
  512. .seckill-box-title {
  513. background: linear-gradient(90deg, rgba(239, 78, 81, 1) 0%, rgba(244, 113, 59, 1) 100%) !important;
  514. .price,
  515. .price-tip,
  516. .timeStop,
  517. .m-price {
  518. color: #ffffff !important;
  519. }
  520. .price-tip {
  521. font-size: $font-base;
  522. }
  523. .price {
  524. font-size: 45rpx !important;
  525. font-weight: bold;
  526. }
  527. .timeStop {
  528. }
  529. }
  530. // 底部拼团、秒杀支付按钮
  531. .goods-pay-box {
  532. position: fixed;
  533. left: 0;
  534. bottom: 0;
  535. z-index: 95;
  536. width: 750rpx;
  537. height: 100rpx;
  538. line-height: 1;
  539. color: #ffffff;
  540. text-align: center;
  541. font-size: $font-lg;
  542. .bgLine {
  543. background: linear-gradient(90deg, rgba(239, 78, 81, 1) 0%, rgba(244, 113, 59, 1) 100%);
  544. }
  545. // 拼团支付按钮
  546. .goods-pay {
  547. display: flex;
  548. align-content: center;
  549. flex-wrap: wrap;
  550. justify-content: center;
  551. .goods-buttom,
  552. .goods-buttom-money {
  553. width: 100%;
  554. }
  555. .goods-buttom-money {
  556. font-size: $font-base;
  557. }
  558. }
  559. .goods-pay-stop,
  560. .goods-pay {
  561. padding: 15rpx 0;
  562. height: 100%;
  563. width: 100%;
  564. }
  565. .goods-pay-stop {
  566. background: $color-gray;
  567. line-height: 70rpx;
  568. }
  569. }
  570. /* 标题简介 */
  571. .introduce-section {
  572. background: #fff;
  573. padding: 20rpx 30rpx;
  574. .title {
  575. font-size: 32rpx;
  576. color: $font-color-dark;
  577. height: 50rpx;
  578. line-height: 50rpx;
  579. }
  580. .price-box {
  581. display: flex;
  582. align-items: baseline;
  583. height: 64rpx;
  584. padding: 10rpx 0;
  585. font-size: 26rpx;
  586. color: $uni-color-primary;
  587. image {
  588. width: 32rpx;
  589. height: 32rpx;
  590. margin-right: 8rpx;
  591. }
  592. .jftit {
  593. padding-left: 4rpx;
  594. font-size: 23rpx;
  595. font-family: PingFang SC;
  596. font-weight: bold;
  597. color: #FF6F0F;
  598. }
  599. .old-price {
  600. padding-left: 8rpx;
  601. font-size: 30rpx;
  602. font-family: PingFang SC;
  603. font-weight: 500;
  604. text-decoration: line-through;
  605. color: #999999;
  606. }
  607. }
  608. .price {
  609. font-size: 45rpx;
  610. font-family: PingFang SC;
  611. font-weight: bold;
  612. color: #FF6F0F;
  613. // font-size: $font-lg + 2rpx;
  614. }
  615. .m-price {
  616. margin: 0 12rpx;
  617. color: $font-color-light;
  618. text-decoration: line-through;
  619. }
  620. .coupon-tip {
  621. align-items: center;
  622. padding: 4rpx 10rpx;
  623. background: $uni-color-primary;
  624. font-size: $font-sm;
  625. color: #fff;
  626. border-radius: 6rpx;
  627. line-height: 1;
  628. transform: translateY(-4rpx);
  629. }
  630. .bot-row {
  631. display: flex;
  632. align-items: center;
  633. height: 50rpx;
  634. font-size: $font-sm;
  635. color: $font-color-light;
  636. text {
  637. flex: 1;
  638. }
  639. }
  640. }
  641. /* 分享 */
  642. .share-section {
  643. display: flex;
  644. align-items: center;
  645. color: $font-color-base;
  646. background: linear-gradient(left, #fdf5f6, #fbebf6);
  647. padding: 12rpx 30rpx;
  648. .share-icon {
  649. display: flex;
  650. align-items: center;
  651. width: 70rpx;
  652. height: 30rpx;
  653. line-height: 1;
  654. border: 1px solid $uni-color-primary;
  655. border-radius: 4rpx;
  656. position: relative;
  657. overflow: hidden;
  658. font-size: 22rpx;
  659. color: $uni-color-primary;
  660. &:after {
  661. content: '';
  662. width: 50rpx;
  663. height: 50rpx;
  664. border-radius: 50%;
  665. left: -20rpx;
  666. top: -12rpx;
  667. position: absolute;
  668. background: $uni-color-primary;
  669. }
  670. }
  671. .iconfavorfill {
  672. position: relative;
  673. z-index: 1;
  674. font-size: 24rpx;
  675. margin-left: 2rpx;
  676. margin-right: 10rpx;
  677. color: #fff;
  678. line-height: 1;
  679. }
  680. .tit {
  681. font-size: $font-base;
  682. margin-left: 10rpx;
  683. }
  684. .iconprompt {
  685. padding: 10rpx;
  686. font-size: 30rpx;
  687. line-height: 1;
  688. }
  689. .share-btn {
  690. flex: 1;
  691. text-align: right;
  692. font-size: $font-sm;
  693. color: $uni-color-primary;
  694. }
  695. .iconenter {
  696. font-size: $font-sm;
  697. margin-left: 4rpx;
  698. color: $uni-color-primary;
  699. }
  700. }
  701. .c-list {
  702. margin-top: 20rpx;
  703. font-size: $font-sm + 2rpx;
  704. color: $font-color-base;
  705. background: #fff;
  706. .c-row {
  707. display: flex;
  708. align-items: center;
  709. padding: 20rpx 30rpx;
  710. position: relative;
  711. }
  712. .tit {
  713. width: 140rpx;
  714. }
  715. .con {
  716. flex: 1;
  717. color: $font-color-dark;
  718. .selected-text {
  719. margin-right: 10rpx;
  720. }
  721. }
  722. .bz-list {
  723. height: 40rpx;
  724. font-size: $font-sm + 2rpx;
  725. color: $font-color-dark;
  726. text {
  727. display: inline-block;
  728. margin-right: 30rpx;
  729. }
  730. }
  731. .con-list {
  732. flex: 1;
  733. display: flex;
  734. flex-direction: column;
  735. color: $font-color-dark;
  736. line-height: 40rpx;
  737. }
  738. .red {
  739. color: $uni-color-primary;
  740. }
  741. }
  742. /* 评价 */
  743. .eva-section {
  744. display: flex;
  745. flex-direction: column;
  746. padding: 20rpx 30rpx;
  747. background: #fff;
  748. margin-top: 16rpx;
  749. .e-header {
  750. display: flex;
  751. align-items: center;
  752. height: 70rpx;
  753. font-size: $font-sm + 2rpx;
  754. color: $font-color-light;
  755. .tit {
  756. font-size: $font-base + 2rpx;
  757. color: $font-color-dark;
  758. margin-right: 4rpx;
  759. }
  760. .tip {
  761. flex: 1;
  762. text-align: right;
  763. }
  764. .iconenter {
  765. margin-left: 10rpx;
  766. }
  767. }
  768. }
  769. .eva-box {
  770. display: flex;
  771. padding: 20rpx 0;
  772. .portrait {
  773. flex-shrink: 0;
  774. width: 80rpx;
  775. height: 80rpx;
  776. border-radius: 100px;
  777. }
  778. .right {
  779. flex: 1;
  780. display: flex;
  781. flex-direction: column;
  782. font-size: $font-base;
  783. color: $font-color-base;
  784. padding-left: 26rpx;
  785. .con {
  786. font-size: $font-base;
  787. color: $font-color-dark;
  788. padding: 20rpx 0;
  789. }
  790. .bot {
  791. display: flex;
  792. justify-content: space-between;
  793. font-size: $font-sm;
  794. color: $font-color-light;
  795. }
  796. }
  797. }
  798. .eva-boxs {
  799. width: 100%;
  800. overflow: hidden;
  801. padding: 10px 28rpx;
  802. background: #f4f4f4;
  803. border-radius: 12rpx;
  804. font-size: $font-sm + 2rpx;
  805. color: #333;
  806. .portrait {
  807. flex-shrink: 0;
  808. width: 80rpx;
  809. height: 80rpx;
  810. border-radius: 100px;
  811. }
  812. .right {
  813. flex: 1;
  814. display: flex;
  815. flex-direction: column;
  816. font-size: $font-base;
  817. color: $font-color-base;
  818. .con {
  819. font-size: $font-base;
  820. color: $font-color-dark;
  821. }
  822. .bot {
  823. display: flex;
  824. justify-content: space-between;
  825. font-size: $font-sm;
  826. color: $font-color-light;
  827. }
  828. }
  829. }
  830. /* 详情 */
  831. .detail-desc {
  832. background: #fff;
  833. margin-top: 16rpx;
  834. /deep/ img {
  835. max-width: 100% !important;
  836. display: inline !important;
  837. }
  838. /deep/ div {
  839. max-width: 100% !important;
  840. }
  841. .d-header {
  842. display: flex;
  843. justify-content: center;
  844. align-items: center;
  845. height: 80rpx;
  846. font-size: $font-base + 2rpx;
  847. color: $font-color-dark;
  848. position: relative;
  849. text {
  850. padding: 0 20rpx;
  851. background: #fff;
  852. position: relative;
  853. z-index: 1;
  854. }
  855. &:after {
  856. position: absolute;
  857. left: 50%;
  858. top: 50%;
  859. transform: translateX(-50%);
  860. width: 300rpx;
  861. height: 0;
  862. content: '';
  863. border-bottom: 1px solid #ccc;
  864. }
  865. }
  866. }
  867. /* 规格选择弹窗 */
  868. .attr-content {
  869. padding: 10rpx 30rpx;
  870. .a-t {
  871. display: flex;
  872. image {
  873. width: 170rpx;
  874. height: 170rpx;
  875. flex-shrink: 0;
  876. margin-top: -40rpx;
  877. border-radius: 8rpx;
  878. }
  879. .right {
  880. display: flex;
  881. flex-direction: column;
  882. padding-left: 24rpx;
  883. font-size: $font-sm + 2rpx;
  884. color: $font-color-base;
  885. line-height: 42rpx;
  886. .good-name {
  887. padding-top: 20rpx;
  888. max-width: 320rpx;
  889. font-size: 30rpx;
  890. font-family: PingFang SC;
  891. font-weight: bold;
  892. color: #1D2023;
  893. line-height: 42rpx;
  894. margin-bottom: 15rpx;
  895. }
  896. .price {
  897. font-size: 60rpx;
  898. font-family: PingFang SC;
  899. font-weight: bold;
  900. color: #FF6F0F;
  901. // font-size: $font-lg;
  902. // color: $uni-color-primary;
  903. // margin-bottom: 10rpx;
  904. image {
  905. width: 48rpx;
  906. height: 48rpx;
  907. margin-right: 8rpx;
  908. }
  909. }
  910. .selected-text {
  911. margin-right: 10rpx;
  912. }
  913. }
  914. }
  915. .attr-list {
  916. display: flex;
  917. flex-direction: column;
  918. font-size: $font-base + 2rpx;
  919. color: $font-color-base;
  920. padding-top: 30rpx;
  921. padding-left: 10rpx;
  922. }
  923. .item-list {
  924. padding: 20rpx 0 0;
  925. display: flex;
  926. flex-wrap: wrap;
  927. text {
  928. display: flex;
  929. align-items: center;
  930. justify-content: center;
  931. background: #eee;
  932. margin-right: 20rpx;
  933. margin-bottom: 20rpx;
  934. border-radius: 100rpx;
  935. min-width: 60rpx;
  936. height: 60rpx;
  937. padding: 0 20rpx;
  938. font-size: $font-base;
  939. color: $font-color-dark;
  940. }
  941. .selected {
  942. background: #fbebee;
  943. color: $uni-color-primary;
  944. }
  945. }
  946. }
  947. /* 弹出层 */
  948. .popup {
  949. position: fixed;
  950. left: 0;
  951. top: 0;
  952. right: 0;
  953. bottom: 0;
  954. z-index: 99;
  955. &.show {
  956. display: block;
  957. .mask {
  958. animation: showPopup 0.2s linear both;
  959. }
  960. .layer {
  961. animation: showLayer 0.2s linear both;
  962. }
  963. }
  964. &.hide {
  965. .mask {
  966. animation: hidePopup 0.2s linear both;
  967. }
  968. .layer {
  969. animation: hideLayer 0.2s linear both;
  970. }
  971. }
  972. &.none {
  973. display: none;
  974. }
  975. .mask {
  976. position: fixed;
  977. top: 0;
  978. width: 100%;
  979. height: 100%;
  980. z-index: 1;
  981. background-color: rgba(0, 0, 0, 0.4);
  982. }
  983. .layer {
  984. position: fixed;
  985. z-index: 99;
  986. bottom: 0;
  987. width: 100%;
  988. min-height: 30vh;
  989. border-radius: 10rpx 10rpx 0 0;
  990. background-color: #fff;
  991. .btn {
  992. height: 66rpx;
  993. line-height: 66rpx;
  994. border-radius: 100rpx;
  995. // background: $uni-color-primary;
  996. background: $base-color;
  997. font-size: $font-base + 2rpx;
  998. color: #fff;
  999. margin: 30rpx auto 20rpx;
  1000. }
  1001. }
  1002. @keyframes showPopup {
  1003. 0% {
  1004. opacity: 0;
  1005. }
  1006. 100% {
  1007. opacity: 1;
  1008. }
  1009. }
  1010. @keyframes hidePopup {
  1011. 0% {
  1012. opacity: 1;
  1013. }
  1014. 100% {
  1015. opacity: 0;
  1016. }
  1017. }
  1018. @keyframes showLayer {
  1019. 0% {
  1020. transform: translateY(120%);
  1021. }
  1022. 100% {
  1023. transform: translateY(0%);
  1024. }
  1025. }
  1026. @keyframes hideLayer {
  1027. 0% {
  1028. transform: translateY(0);
  1029. }
  1030. 100% {
  1031. transform: translateY(120%);
  1032. }
  1033. }
  1034. }
  1035. /* 底部操作菜单 */
  1036. .page-bottom {
  1037. position: fixed;
  1038. left: 0rpx;
  1039. bottom: 0rpx;
  1040. z-index: 95;
  1041. display: flex;
  1042. justify-content: center;
  1043. align-items: center;
  1044. width: 750rpx;
  1045. height: 98rpx;
  1046. background: rgba(255, 255, 255, 0.9);
  1047. box-shadow: 0 0 20rpx 0 rgba(0, 0, 0, 0.5);
  1048. // border-radius: 16rpx;
  1049. .p-b-btn {
  1050. display: flex;
  1051. flex-direction: column;
  1052. align-items: center;
  1053. justify-content: center;
  1054. font-size: $font-sm;
  1055. color: $font-color-base;
  1056. width: 100rpx;
  1057. height: 98rpx;
  1058. .iconfont {
  1059. font-size: 40rpx;
  1060. line-height: 48rpx;
  1061. color: $font-color-light;
  1062. }
  1063. &.active,
  1064. &.active .iconfont {
  1065. color: $uni-color-primary;
  1066. }
  1067. .icon-fenxiang2 {
  1068. font-size: 42rpx;
  1069. transform: translateY(-2rpx);
  1070. }
  1071. .iconlikefill {
  1072. font-size: 46rpx;
  1073. }
  1074. }
  1075. .action-btn-group {
  1076. display: flex;
  1077. height: 98rpx;
  1078. overflow: hidden;
  1079. position: relative;
  1080. .action-btn {
  1081. display: flex;
  1082. align-items: center;
  1083. justify-content: center;
  1084. width: 750rpx;
  1085. height: 100%;
  1086. font-size: $font-base;
  1087. padding: 0;
  1088. border-radius: 0;
  1089. // background: transparent;
  1090. background: #31332D;
  1091. &.buy-now-btn {
  1092. background-color: #303e49;
  1093. }
  1094. &.add-cart-btn {
  1095. background-color: $base-color;
  1096. }
  1097. }
  1098. }
  1099. }
  1100. // 商店头
  1101. .shop-box {
  1102. background-color: #ffffff;
  1103. margin-top: 20rpx;
  1104. margin-bottom: 10rpx;
  1105. padding: 20rpx;
  1106. .shop-img {
  1107. border-radius: 300rpx;
  1108. height: 80rpx;
  1109. width: 80rpx;
  1110. margin-right: 20rpx;
  1111. }
  1112. .shop-button {
  1113. border-radius: 100rpx;
  1114. padding: 10rpx 20rpx;
  1115. color: $color-red;
  1116. border: 1px solid $color-red;
  1117. font-size: $font-lg;
  1118. line-height: 1;
  1119. }
  1120. }
  1121. </style>