product.vue 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770
  1. <template>
  2. <view class="container">
  3. <!-- 轮播图 -->
  4. <top-swiper :imgList="imgList"></top-swiper>
  5. <!-- 标题 -->
  6. <product-content :goodsObjact="goodsObjact" @callf="callf"></product-content>
  7. <!-- 拼货时间及优惠 -->
  8. <!-- <discounts @clickCoupon="Getcoupon" :Info="goodsObjact.store_info" :showCoupon="true"></discounts> -->
  9. <!-- 猜你喜欢 -->
  10. <!-- <guess-like @Addcar='Addcar' @clickNavTo='navToDetailPage' :goodList = 'good_list||[]'></guess-like> -->
  11. <!-- 评价 -->
  12. <estimate @navTo="navTo('/pages/product/reply?id=' + goodsid)" v-if="reply" :reply="reply" :list="list"></estimate>
  13. <!-- 规格信息 -->
  14. <fresh-detail :goodsObjact="goodsObjact"></fresh-detail>
  15. <!-- 图文详情 -->
  16. <content-text :description="description"></content-text>
  17. <!-- 底部高度撑开 -->
  18. <view class="contentBottomHeight"></view>
  19. <!-- 底部操作菜单 -->
  20. <product-bottom @buy="buy" :goodsObjact="goodsObjact" :goodsid="goodsid" @specOPne="specOPne" :showAdd="showAdd"></product-bottom>
  21. <!-- 规格-模态层弹窗 -->
  22. <view class="popup spec" :class="specClass" @touchmove.stop.prevent="stopPrevent" @click="toggleSpec">
  23. <!-- 遮罩层 -->
  24. <view class="mask"></view>
  25. <view class="layer attr-content" @click.stop="stopPrevent">
  26. <view class="a-t">
  27. <image :src="actionImage"></image>
  28. <view class="right">
  29. <text class="name clamp">{{ goodsObjact.store_name }}</text>
  30. <view class="price">
  31. <text>¥</text>
  32. {{ actionPrice * goodsNumber }}
  33. </view>
  34. <image src="../../static/icon/del.png" mode="" class="right-img" @click="close()"></image>
  35. </view>
  36. </view>
  37. <view v-for="(item, index) in specList" :key="index" class="attr-list">
  38. <text>选择{{ item.attr_name }}分类</text>
  39. <view class="item-list">
  40. <text
  41. v-for="(childItem, childIndex) in item.attr_value"
  42. :key="childIndex"
  43. class="tit"
  44. :class="{ selected: childItem.check }"
  45. @click="selectSpec(childItem, item, index)"
  46. >
  47. {{ childItem.attr }}
  48. </text>
  49. </view>
  50. </view>
  51. <view class="mun-box">
  52. <text>购买数量</text>
  53. <view class="num">
  54. <uni-number-box class="step" :isMin="true" :value="goodsNumber" :min="1" :max="goodsNumberMax" @eventChange="numberChange"></uni-number-box>
  55. </view>
  56. </view>
  57. <button class="btn" @click.stop="buy" v-show="buys_show">完成</button>
  58. <button class="btn" style="background-color: #999999;" v-show="buys_shows">售罄</button>
  59. </view>
  60. </view>
  61. <view class="mask" v-if="show"><image @click="onTap" src="../../static/img/shareimg.png"></image></view>
  62. </view>
  63. </template>
  64. <script>
  65. import uniListItem from '@/components/uni-list-item/uni-list-item.vue';
  66. import { goodsDetail, cartAdd, seckillGoods } from '@/api/product.js';
  67. import { mapState } from 'vuex';
  68. import store from '@/store/index.js';
  69. import { saveUrl } from '@/utils/loginUtils.js';
  70. // #ifdef H5
  71. import { weixindata } from '@/utils/wxAuthorized';
  72. // #endif
  73. // 头部轮播图
  74. import topSwiper from './common/topSwiper.vue';
  75. // 标题
  76. import productContent from './common/productContent.vue';
  77. // 到货时间及优惠
  78. import discounts from './common/discounts.vue';
  79. // 规格信息
  80. import freshDetail from './common/freshDetail.vue';
  81. // 图文详情
  82. import contentText from './common/contentText.vue';
  83. // 底部按钮
  84. import productBottom from './common/productBottom.vue';
  85. // 猜你喜欢
  86. import guessLike from './common/guessLike.vue';
  87. // 评价
  88. import estimate from './common/estimate.vue';
  89. //增减数量
  90. import uniNumberBox from '@/components/uni-number-box.vue';
  91. export default {
  92. components: {
  93. guessLike,
  94. topSwiper,
  95. productContent,
  96. discounts,
  97. freshDetail,
  98. contentText,
  99. productBottom,
  100. estimate,
  101. uniNumberBox
  102. },
  103. data() {
  104. return {
  105. show: false,
  106. showAdd: true,
  107. isShare: false,
  108. goodsStore: 0, //选中库存
  109. specList: [],
  110. buys_show: true,
  111. buys_shows: false,
  112. specSelected: [], //选中的分类
  113. specClass: 'none', //显示隐藏弹窗
  114. many: 1, //1是单规格 2是多规格
  115. reply: '', //评论
  116. list: '', //商品详情的数据
  117. type: 1, //默认支付方式add为
  118. goodsType: 0,
  119. goodsNumber: 1, //购买数量
  120. goodsid: '', //商品id
  121. description: '', //商品描述
  122. goodsObjact: {
  123. percent: 1
  124. }, //保存商品数据
  125. //图片循环
  126. imgList: [],
  127. // 对比对象
  128. actionPrice: 0, //默认选中商品价格
  129. actionImage: '', //默认选中图片
  130. good_list: '', //猜你喜欢列表
  131. goodsNumberMax: 0, //最大可购买数量
  132. // 倒计时数据保存
  133. seckillObj: {
  134. stopTime: 0, //结束时间
  135. stop: false, //是否结束
  136. stopTimeH: 0, //小时
  137. stopTimeM: 0, //分钟
  138. stopTimeS: 0, //秒钟
  139. stopTimeD: 0, //天
  140. upTime: 0 //更新组件内部组件用
  141. },
  142. // 拼团数据保存
  143. pink: {
  144. id: '', //拼团编号
  145. uid: '', //用户编号
  146. people: '', //拼团人数
  147. price: '', //拼团价格
  148. stop_time: '', //拼团结束时间
  149. nickname: '', //团长昵称
  150. avatar: '', //团长头像
  151. count: '', //拼团剩余人数
  152. h: '', //时
  153. i: '', //分
  154. s: '' //秒
  155. },
  156. userInfo: '',
  157. is_drop: false, //是否上门安装
  158. showDrop: false //商品是否具有安装属性
  159. };
  160. },
  161. filters: {
  162. parseIntTo(percent) {
  163. percent = +percent * 100;
  164. if (percent % 1 === 0) {
  165. return percent;
  166. } else {
  167. percent = percent.toFixed(1);
  168. return percent;
  169. }
  170. }
  171. },
  172. async onLoad(options) {
  173. let obj = this;
  174. obj.userInfo = uni.getStorageSync('userInfo');
  175. //保存商品id
  176. this.goodsid = options.id;
  177. if (options.type) {
  178. this.goodsType = options.type;
  179. }
  180. // 判断有无人邀请
  181. if (options.spread) {
  182. // 存储邀请人
  183. uni.setStorageSync('spread', options.spread);
  184. }
  185. saveUrl();
  186. this.goodsDetail();
  187. // 注册邀请信息
  188. // #ifdef H5
  189. let bool = uni.getStorageSync('weichatBrowser') || '';
  190. if (bool) {
  191. weixindata();
  192. }
  193. // #endif
  194. },
  195. computed: {
  196. ...mapState(['weichatObj', 'baseURL', 'urlFile'])
  197. },
  198. // 分享
  199. onShareAppMessage(options) {
  200. // 设置菜单中的转发按钮触发转发事件时的转发内容
  201. let pages = getCurrentPages(); //获取加载的页面
  202. let currentPage = pages[pages.length - 1]; //获取当前页面的对象
  203. let url = currentPage.route; //当前页面url
  204. let item = currentPage.options; //如果要获取url中所带的参数可以查看options
  205. let shareObj = {
  206. title: this.goodsObjact.store_name + ' 价格:' + this.goodsObjact.price, // 默认是小程序的名称(可以写slogan等)
  207. path: url + '?id=' + item.id + '&spread=' + this.userInfo.uid, // 默认是当前页面,必须是以‘/’开头的完整路径
  208. imageUrl: this.goodsObjact.image,
  209. success: function(res) {
  210. // 转发成功之后的回调
  211. if (res.errMsg == 'shareAppMessage:ok') {
  212. }
  213. },
  214. fail: function() {
  215. // 转发失败之后的回调
  216. if (res.errMsg == 'shareAppMessage:fail cancel') {
  217. // 用户取消转发
  218. } else if (res.errMsg == 'shareAppMessage:fail') {
  219. // 转发失败,其中 detail message 为详细失败信息
  220. }
  221. }
  222. };
  223. return shareObj;
  224. },
  225. methods: {
  226. //选择是否上门安装
  227. dropClick(val) {
  228. if (val == 1) {
  229. this.is_drop = true;
  230. } else {
  231. this.is_drop = false;
  232. }
  233. },
  234. //选择数量
  235. numberChange(e) {
  236. console.log(e);
  237. this.goodsNumber = e.number;
  238. },
  239. close() {
  240. this.specClass = 'none';
  241. },
  242. //选择规格
  243. selectSpec(item, arr, ind) {
  244. arr.attr_value.forEach(function(e) {
  245. e.check = false;
  246. });
  247. item.check = true;
  248. let obj = this;
  249. obj.specSelected[ind] = item.attr;
  250. let str = obj.specSelected.join(',');
  251. // 获取当前选中的对象
  252. if (obj.productValue[str]) {
  253. obj.buys_show = true;
  254. obj.buys_shows = false;
  255. obj.actionPrice = obj.productValue[str].price;
  256. obj.goodsNumberMax = obj.productValue[str].stock;
  257. obj.actionImage = obj.productValue[str].image;
  258. obj.uniqueId = obj.productValue[str].unique;
  259. obj.goodsStore = obj.productValue[str].stock;
  260. } else {
  261. (obj.buys_show = false), (obj.buys_shows = true);
  262. }
  263. if (obj.goodsStore == 0) {
  264. obj.buys_show = false;
  265. obj.buys_shows = true;
  266. }
  267. obj.specSelected[ind] = item.attr;
  268. },
  269. // 打開彈窗
  270. specOPne(type = 1) {
  271. let obj = this;
  272. obj.specClass = 'show';
  273. obj.type = type;
  274. },
  275. //规格弹窗开关
  276. toggleSpec(str) {
  277. if (this.specClass === 'show') {
  278. this.specClass = 'hide';
  279. setTimeout(() => {
  280. this.specClass = 'none';
  281. }, 250);
  282. } else if (this.specClass === 'none') {
  283. this.specClass = 'show';
  284. }
  285. // 保存当前购买类型
  286. this.type = str;
  287. },
  288. //领取优惠券
  289. Getcoupon() {
  290. uni.navigateTo({
  291. url: '/pages/coupon/getcoupon'
  292. });
  293. },
  294. //详情页
  295. navToDetailPage(item) {
  296. let id = item.id;
  297. uni.navigateTo({
  298. url: '/pages/product/product?id=' + id
  299. });
  300. },
  301. // 跳转页面
  302. navTo(url) {
  303. uni.navigateTo({
  304. url: '/pages/product/reply?id=' + this.goodsid
  305. });
  306. },
  307. //加入购物车
  308. Addcar(item) {
  309. let obj = this;
  310. cartAdd({
  311. cartNum: '1', //商品数量
  312. uniqueId: '', //商品标签
  313. new: 0, //商品是否新增加到购物车1为不加入0为加入
  314. mer_id: '',
  315. productId: item.id //商品编号
  316. })
  317. .then(function(e) {
  318. uni.showToast({
  319. title: '成功加入购物车',
  320. type: 'top',
  321. duration: 500,
  322. icon: 'none'
  323. });
  324. obj.goodsDetail();
  325. })
  326. .catch(e => {
  327. console.log(e);
  328. });
  329. },
  330. goodsDetail() {
  331. let obj = this;
  332. // 获取普通商品信息
  333. if (obj.goodsType == 0) {
  334. goodsDetail({}, this.goodsid).then(function({ data }) {
  335. obj.list = data;
  336. console.log(obj.list, '普通商品数据');
  337. obj.good_list = data.good_list; //保存猜你喜欢列表
  338. obj.reply = data.reply; //保存评论列表
  339. let goods = data.storeInfo;
  340. if (goods.is_drop == 1) {
  341. obj.showAdd = false;
  342. obj.showDrop = true;
  343. obj.is_drop = true;
  344. }
  345. obj.goodsObjact = goods;
  346. if (obj.goodsObjact.description != null) {
  347. obj.description = obj.goodsObjact.description.replace(/\<img/gi, '<img class="rich-img"');
  348. } //小程序商品详情图超出屏幕问题
  349. obj.imgList = goods.slider_image; //保存轮播图
  350. obj.specList = data.productAttr; //保存分类列表
  351. if (Array.isArray(data.productValue) != true) {
  352. console.log('开始处理数据');
  353. obj.many = 2;
  354. obj.specList = data.productAttr; //保存产品属性
  355. obj.productValue = data.productValue; //保存属性值
  356. obj.specSelected = []; //初始化默认选择对象
  357. for (let i = 0; i < obj.specList.length; i++) {
  358. console.log('数据处理');
  359. // 设置默认数据
  360. const ls = obj.specList[i].attr_value;
  361. ls[0].check = true;
  362. obj.specSelected.push(ls[0].attr);
  363. // console.log('数据处理对象',ls);
  364. // for (let s = 0; s < ls.length; s++) {
  365. // console.log(s);
  366. // console.log('数据处理对象2',ls[s]);
  367. // if (ls[s].check) {
  368. // }
  369. // }
  370. }
  371. const str = obj.specSelected.join(','); //保存当前选中的默认对象
  372. console.log(str, 'str');
  373. // 设置默认值
  374. obj.actionPrice = obj.productValue[str].price;
  375. obj.goodsNumberMax = obj.productValue[str].stock;
  376. obj.actionImage = obj.productValue[str].image;
  377. obj.uniqueId = obj.productValue[str].unique;
  378. obj.goodsStore = obj.productValue[str].stock;
  379. } else {
  380. obj.many = 1;
  381. obj.productValue = data.productValue; //保存分类查询数据
  382. obj.actionPrice = goods.price; //保存默认选中商品价格
  383. obj.actionImage = goods.image_base; //保存默认选中商品图片
  384. obj.goodsNumberMax = goods.stock; //保存默认选中最大可购买商品数量
  385. }
  386. obj.shopId = data.mer_id; //保存商店id
  387. console.log('数据处理完毕');
  388. });
  389. }
  390. // 获取秒杀商品信息
  391. if (obj.goodsType == 1) {
  392. obj.showAdd = false;
  393. seckillGoods({}, this.goodsid).then(function({ data }) {
  394. obj.list = data;
  395. console.log(obj.list, '秒杀商品数据++++++++++');
  396. obj.reply = data.reply; //保存评论列表
  397. let goods = data.storeInfo;
  398. if (goods.is_drop == 1) {
  399. obj.showDrop = true;
  400. }
  401. obj.goodsNumberMax = goods.num;
  402. console.log(obj.seckillObj, '数据');
  403. obj.goodsObjact = goods;
  404. if (obj.goodsObjact.description != null) {
  405. obj.description = obj.goodsObjact.description.replace(/\<img/gi, '<img class="rich-img"');
  406. } //小程序商品详情图超出屏幕问题
  407. obj.imgList = goods.images; //保存轮播图
  408. obj.specList = data.productAttr; //保存分类列表
  409. if (Array.isArray(data.productValue) != true) {
  410. console.log('多规格+++++++++++++');
  411. obj.many = 2;
  412. obj.specList = data.productAttr; //保存产品属性
  413. obj.productValue = data.productValue; //保存属性值
  414. obj.specSelected = []; //初始化默认选择对象
  415. for (let i = 0; i < obj.specList.length; i++) {
  416. // 设置默认数据
  417. let attrValue = obj.specList[i].attr_value[0];
  418. attrValue.check = true;
  419. obj.specSelected.push(attrValue.attr);
  420. }
  421. let str = obj.specSelected.join(',');
  422. console.log(str, 'str');
  423. // 设置默认值
  424. obj.actionPrice = obj.productValue[str].price;
  425. // obj.goodsNumberMax = obj.productValue[str].quota;
  426. // console.log(obj.goodsNumberMax,'obj.goodsNumberMax++++++++++++')
  427. obj.actionImage = obj.productValue[str].image;
  428. obj.uniqueId = obj.productValue[str].unique;
  429. obj.goodsStore = obj.productValue[str].stock;
  430. } else {
  431. console.log('单规格+++++++++++++');
  432. obj.many = 1;
  433. obj.productValue = data.productValue; //保存分类查询数据
  434. obj.actionPrice = goods.price; //保存默认选中商品价格
  435. obj.actionImage = goods.image_base; //保存默认选中商品图片
  436. // obj.goodsNumberMax = goods.quota; //保存默认选中最大可购买商品数量
  437. console.log(obj.goodsNumberMax, 'obj.goodsNumberMax---------------');
  438. obj.shopId = data.mer_id; //保存商店id
  439. }
  440. });
  441. }
  442. },
  443. // 立即购买
  444. buy() {
  445. let obj = this;
  446. // 创建传值对象
  447. let data = {
  448. cartNum: obj.goodsNumber, //商品数量
  449. new: 1,
  450. productId: obj.goodsid, //商品编号
  451. uniqueId: obj.uniqueId,
  452. is_drop: obj.is_drop ? 1 : 0
  453. };
  454. if (obj.type == 2) {
  455. data.new = 0;
  456. }
  457. cartAdd(data)
  458. .then(function(e) {
  459. let da = e.data;
  460. if (obj.type == 1) {
  461. // 跳转到支付页
  462. let a = obj.is_drop ? 1 : 0;
  463. console.log(a);
  464. uni.navigateTo({
  465. url: '/pages/order/createOrder?id=' + da.cartId + '&isdrop=' + a
  466. });
  467. }
  468. if (obj.type == 2) {
  469. uni.showToast({
  470. title: '成功加入购物车',
  471. type: 'top',
  472. duration: 2000,
  473. icon: 'none'
  474. });
  475. obj.goodsDetail();
  476. }
  477. obj.toggleSpec();
  478. })
  479. .catch(e => {
  480. console.log(e);
  481. });
  482. },
  483. // 阻止触发上级事件
  484. stopPrevent() {},
  485. callf() {
  486. console.log('dianj');
  487. this.show = true;
  488. },
  489. onTap() {
  490. console.log(this.callf);
  491. if (!this.callf) return;
  492. this.closess();
  493. },
  494. closess() {
  495. this.show = false;
  496. }
  497. }
  498. };
  499. </script>
  500. <style lang="scss">
  501. /* 弹出层 */
  502. .popup {
  503. position: fixed;
  504. left: 0;
  505. top: 0;
  506. right: 0;
  507. bottom: 0;
  508. z-index: 99;
  509. &.show {
  510. display: block;
  511. .mask {
  512. animation: showPopup 0.2s linear both;
  513. }
  514. .layer {
  515. animation: showLayer 0.2s linear both;
  516. }
  517. }
  518. &.hide {
  519. .mask {
  520. animation: hidePopup 0.2s linear both;
  521. }
  522. .layer {
  523. animation: hideLayer 0.2s linear both;
  524. }
  525. }
  526. &.none {
  527. display: none;
  528. }
  529. .mask {
  530. position: fixed;
  531. top: 0;
  532. width: 100%;
  533. height: 100%;
  534. z-index: 1;
  535. background-color: rgba(0, 0, 0, 0.4);
  536. }
  537. .layer {
  538. position: fixed;
  539. z-index: 99;
  540. bottom: 0;
  541. width: 100%;
  542. min-height: 20vh;
  543. border-radius: 10rpx 10rpx 0 0;
  544. background-color: #fff;
  545. .btn {
  546. height: 66rpx;
  547. line-height: 66rpx;
  548. border-radius: 100rpx;
  549. background: $uni-color-primary;
  550. font-size: $font-base + 2rpx;
  551. color: #fff;
  552. margin: 30rpx auto 20rpx;
  553. }
  554. }
  555. @keyframes showPopup {
  556. 0% {
  557. opacity: 0;
  558. }
  559. 100% {
  560. opacity: 1;
  561. }
  562. }
  563. @keyframes hidePopup {
  564. 0% {
  565. opacity: 1;
  566. }
  567. 100% {
  568. opacity: 0;
  569. }
  570. }
  571. @keyframes showLayer {
  572. 0% {
  573. transform: translateY(120%);
  574. }
  575. 100% {
  576. transform: translateY(0%);
  577. }
  578. }
  579. @keyframes hideLayer {
  580. 0% {
  581. transform: translateY(0);
  582. }
  583. 100% {
  584. transform: translateY(120%);
  585. }
  586. }
  587. }
  588. /* 规格选择弹窗 */
  589. .attr-content {
  590. padding: 25rpx 30rpx;
  591. .a-t {
  592. display: flex;
  593. image {
  594. width: 170rpx;
  595. height: 170rpx;
  596. flex-shrink: 0;
  597. border-radius: 8rpx;
  598. }
  599. .right {
  600. display: flex;
  601. flex-direction: column;
  602. padding-left: 24rpx;
  603. font-size: $font-sm + 2rpx;
  604. color: $font-color-base;
  605. line-height: 42rpx;
  606. width: 75%;
  607. position: relative;
  608. .right-img {
  609. width: 37rpx;
  610. height: 37rpx;
  611. position: absolute;
  612. right: 0;
  613. top: 20rpx;
  614. // background-color: red;
  615. }
  616. .price {
  617. position: absolute;
  618. bottom: 0;
  619. font-size: $font-lg;
  620. color: $uni-color-primary;
  621. margin: 10rpx 0rpx;
  622. font-size: 60rpx;
  623. font-family: PingFang SC;
  624. font-weight: bold;
  625. color: #ef041f;
  626. text {
  627. font-size: 30rpx;
  628. }
  629. }
  630. .name {
  631. width: 350rpx;
  632. font-size: 32rpx;
  633. color: $font-color-dark;
  634. height: 50rpx;
  635. overflow: hidden;
  636. text-overflow: ellipsis;
  637. white-space: nowrap;
  638. display: block;
  639. font-size: 30rpx;
  640. font-family: PingFang SC;
  641. font-weight: bold;
  642. color: #1d2023;
  643. }
  644. .selected-text {
  645. margin-right: 10rpx;
  646. }
  647. }
  648. }
  649. .attr-list {
  650. display: flex;
  651. flex-direction: column;
  652. font-size: $font-base + 2rpx;
  653. color: $font-color-base;
  654. padding-top: 30rpx;
  655. padding-left: 10rpx;
  656. }
  657. .item-list {
  658. padding: 20rpx 0 0;
  659. display: flex;
  660. flex-wrap: wrap;
  661. text {
  662. display: flex;
  663. align-items: center;
  664. justify-content: center;
  665. background: #eee;
  666. margin-right: 20rpx;
  667. margin-bottom: 20rpx;
  668. border-radius: 10rpx;
  669. min-width: 60rpx;
  670. height: 60rpx;
  671. padding: 0 20rpx;
  672. font-size: $font-base;
  673. color: $font-color-dark;
  674. }
  675. .selected {
  676. background: #fceff1;
  677. color: #f35768;
  678. border: 1px solid #f35768;
  679. }
  680. }
  681. }
  682. //默认商品底部高度
  683. .goodsBottom {
  684. height: 160rpx;
  685. }
  686. page {
  687. background: #f0f0f0;
  688. }
  689. //秒杀、拼团底部高度
  690. .contentBottomHeight {
  691. background-color: #f8f8f8;
  692. height: 130rpx;
  693. }
  694. //默认商品底部高度
  695. .goodsBottom {
  696. height: 160rpx;
  697. }
  698. /deep/ .iconenter {
  699. font-size: $font-base + 2rpx;
  700. color: #888;
  701. }
  702. /deep/ .con_image {
  703. width: 130rpx;
  704. height: 130rpx;
  705. display: inline-block;
  706. padding: 15rpx;
  707. image {
  708. width: 100%;
  709. height: 100%;
  710. }
  711. }
  712. /* 商品详情中限制图片大小 */
  713. /deep/ .rich-img {
  714. width: 100% !important;
  715. height: auto;
  716. }
  717. .mun-box {
  718. display: flex;
  719. justify-content: space-between;
  720. align-items: center;
  721. }
  722. .mask {
  723. position: fixed;
  724. top: 0;
  725. left: 0;
  726. width: 100%;
  727. height: 100%;
  728. z-index: 999;
  729. background-color: rgba(0, 0, 0, 0.4);
  730. image {
  731. width: 100%;
  732. height: 100%;
  733. opacity: 0.8;
  734. }
  735. }
  736. </style>