intProduct.vue 24 KB

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