productDuhuan.vue 22 KB

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