productDuhuan.vue 21 KB

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