product.vue 25 KB

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