goodProduct.vue 23 KB

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