product.vue 20 KB

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