product.vue 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821
  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. obj.many = 2;
  365. obj.specList = data.productAttr; //保存产品属性
  366. obj.productValue = data.productValue; //保存属性值
  367. obj.specSelected = []; //初始化默认选择对象
  368. for (let i = 0; i < obj.specList.length; i++) {
  369. // 设置默认数据
  370. let attrValue = obj.specList[i].attr_value[0];
  371. attrValue.check = true;
  372. obj.specSelected.push(attrValue.attr);
  373. }
  374. let str = obj.specSelected.join(',');
  375. console.log(str, 'str');
  376. // 设置默认值
  377. obj.actionPrice = obj.productValue[str].price;
  378. obj.goodsNumberMax = obj.productValue[str].stock;
  379. obj.actionImage = obj.productValue[str].image;
  380. obj.uniqueId = obj.productValue[str].unique;
  381. obj.goodsStore = obj.productValue[str].stock;
  382. } else {
  383. obj.many = 1;
  384. }
  385. obj.productValue = data.productValue; //保存分类查询数据
  386. obj.actionPrice = goods.price; //保存默认选中商品价格
  387. obj.actionImage = goods.image_base; //保存默认选中商品图片
  388. obj.goodsNumberMax = goods.stock; //保存默认选中最大可购买商品数量
  389. obj.shopId = data.mer_id; //保存商店id
  390. });
  391. }
  392. // 获取秒杀商品信息
  393. if (obj.goodsType == 1) {
  394. obj.showAdd = false;
  395. seckillGoods({}, this.goodsid).then(function({ data }) {
  396. obj.list = data;
  397. console.log(obj.list, '秒杀商品数据++++++++++');
  398. obj.reply = data.reply; //保存评论列表
  399. let goods = data.storeInfo;
  400. if (goods.is_drop == 1) {
  401. obj.showDrop = true;
  402. }
  403. obj.goodsNumberMax = goods.num;
  404. console.log(obj.seckillObj, '数据');
  405. obj.goodsObjact = goods;
  406. if (obj.goodsObjact.description != null) {
  407. obj.description = obj.goodsObjact.description.replace(/\<img/gi, '<img class="rich-img"');
  408. } //小程序商品详情图超出屏幕问题
  409. obj.imgList = goods.images; //保存轮播图
  410. obj.specList = data.productAttr; //保存分类列表
  411. if (Array.isArray(data.productValue) != true) {
  412. console.log('多规格+++++++++++++');
  413. obj.many = 2;
  414. obj.specList = data.productAttr; //保存产品属性
  415. obj.productValue = data.productValue; //保存属性值
  416. obj.specSelected = []; //初始化默认选择对象
  417. for (let i = 0; i < obj.specList.length; i++) {
  418. // 设置默认数据
  419. let attrValue = obj.specList[i].attr_value[0];
  420. attrValue.check = true;
  421. obj.specSelected.push(attrValue.attr);
  422. }
  423. let str = obj.specSelected.join(',');
  424. console.log(str, 'str');
  425. // 设置默认值
  426. obj.actionPrice = obj.productValue[str].price;
  427. // obj.goodsNumberMax = obj.productValue[str].quota;
  428. // console.log(obj.goodsNumberMax,'obj.goodsNumberMax++++++++++++')
  429. obj.actionImage = obj.productValue[str].image;
  430. obj.uniqueId = obj.productValue[str].unique;
  431. obj.goodsStore = obj.productValue[str].stock;
  432. } else {
  433. console.log('单规格+++++++++++++');
  434. obj.many = 1;
  435. obj.productValue = data.productValue; //保存分类查询数据
  436. obj.actionPrice = goods.price; //保存默认选中商品价格
  437. obj.actionImage = goods.image_base; //保存默认选中商品图片
  438. // obj.goodsNumberMax = goods.quota; //保存默认选中最大可购买商品数量
  439. console.log(obj.goodsNumberMax, 'obj.goodsNumberMax---------------');
  440. obj.shopId = data.mer_id; //保存商店id
  441. }
  442. });
  443. }
  444. },
  445. // 立即购买
  446. buy() {
  447. let obj = this;
  448. // 创建传值对象
  449. let data = {
  450. cartNum: obj.goodsNumber, //商品数量
  451. new: 1,
  452. productId: obj.goodsid, //商品编号
  453. uniqueId: obj.uniqueId,
  454. is_drop: obj.is_drop ? 1 : 0
  455. };
  456. if (obj.type == 2) {
  457. data.new = 0;
  458. }
  459. cartAdd(data)
  460. .then(function(e) {
  461. let da = e.data;
  462. if (obj.type == 1) {
  463. // 跳转到支付页
  464. let a = obj.is_drop ? 1 : 0;
  465. console.log(a);
  466. uni.navigateTo({
  467. url: '/pages/order/createOrder?id=' + da.cartId + '&isdrop=' + a
  468. });
  469. }
  470. if (obj.type == 2) {
  471. uni.showToast({
  472. title: '成功加入购物车',
  473. type: 'top',
  474. duration: 2000,
  475. icon: 'none'
  476. });
  477. obj.goodsDetail();
  478. }
  479. obj.toggleSpec();
  480. })
  481. .catch(e => {
  482. console.log(e);
  483. });
  484. },
  485. // 阻止触发上级事件
  486. stopPrevent() {},
  487. callf() {
  488. console.log('dianj');
  489. this.show = true;
  490. },
  491. onTap() {
  492. console.log(this.callf);
  493. if (!this.callf) return;
  494. this.closess();
  495. },
  496. closess() {
  497. this.show = false;
  498. }
  499. }
  500. };
  501. </script>
  502. <style lang="scss">
  503. /* 弹出层 */
  504. .popup {
  505. position: fixed;
  506. left: 0;
  507. top: 0;
  508. right: 0;
  509. bottom: 0;
  510. z-index: 99;
  511. &.show {
  512. display: block;
  513. .mask {
  514. animation: showPopup 0.2s linear both;
  515. }
  516. .layer {
  517. animation: showLayer 0.2s linear both;
  518. }
  519. }
  520. &.hide {
  521. .mask {
  522. animation: hidePopup 0.2s linear both;
  523. }
  524. .layer {
  525. animation: hideLayer 0.2s linear both;
  526. }
  527. }
  528. &.none {
  529. display: none;
  530. }
  531. .mask {
  532. position: fixed;
  533. top: 0;
  534. width: 100%;
  535. height: 100%;
  536. z-index: 1;
  537. background-color: rgba(0, 0, 0, 0.4);
  538. }
  539. .layer {
  540. position: fixed;
  541. z-index: 99;
  542. bottom: 0;
  543. width: 100%;
  544. min-height: 20vh;
  545. border-radius: 10rpx 10rpx 0 0;
  546. background-color: #fff;
  547. .btn {
  548. height: 66rpx;
  549. line-height: 66rpx;
  550. border-radius: 100rpx;
  551. background: $uni-color-primary;
  552. font-size: $font-base + 2rpx;
  553. color: #fff;
  554. margin: 30rpx auto 20rpx;
  555. }
  556. }
  557. @keyframes showPopup {
  558. 0% {
  559. opacity: 0;
  560. }
  561. 100% {
  562. opacity: 1;
  563. }
  564. }
  565. @keyframes hidePopup {
  566. 0% {
  567. opacity: 1;
  568. }
  569. 100% {
  570. opacity: 0;
  571. }
  572. }
  573. @keyframes showLayer {
  574. 0% {
  575. transform: translateY(120%);
  576. }
  577. 100% {
  578. transform: translateY(0%);
  579. }
  580. }
  581. @keyframes hideLayer {
  582. 0% {
  583. transform: translateY(0);
  584. }
  585. 100% {
  586. transform: translateY(120%);
  587. }
  588. }
  589. }
  590. /* 规格选择弹窗 */
  591. .attr-content {
  592. padding: 25rpx 30rpx;
  593. .a-t {
  594. display: flex;
  595. image {
  596. width: 170rpx;
  597. height: 170rpx;
  598. flex-shrink: 0;
  599. border-radius: 8rpx;
  600. }
  601. .right {
  602. display: flex;
  603. flex-direction: column;
  604. padding-left: 24rpx;
  605. font-size: $font-sm + 2rpx;
  606. color: $font-color-base;
  607. line-height: 42rpx;
  608. width: 75%;
  609. position: relative;
  610. .right-img {
  611. width: 37rpx;
  612. height: 37rpx;
  613. position: absolute;
  614. right: 0;
  615. top: 20rpx;
  616. // background-color: red;
  617. }
  618. .price {
  619. position: absolute;
  620. bottom: 0;
  621. font-size: $font-lg;
  622. color: $uni-color-primary;
  623. margin: 10rpx 0rpx;
  624. font-size: 60rpx;
  625. font-family: PingFang SC;
  626. font-weight: bold;
  627. color: #ef041f;
  628. text {
  629. font-size: 30rpx;
  630. }
  631. }
  632. .name {
  633. width: 350rpx;
  634. font-size: 32rpx;
  635. color: $font-color-dark;
  636. height: 50rpx;
  637. overflow: hidden;
  638. text-overflow: ellipsis;
  639. white-space: nowrap;
  640. display: block;
  641. font-size: 30rpx;
  642. font-family: PingFang SC;
  643. font-weight: bold;
  644. color: #1d2023;
  645. }
  646. .selected-text {
  647. margin-right: 10rpx;
  648. }
  649. }
  650. }
  651. .attr-list {
  652. display: flex;
  653. flex-direction: column;
  654. font-size: $font-base + 2rpx;
  655. color: $font-color-base;
  656. padding-top: 30rpx;
  657. padding-left: 10rpx;
  658. }
  659. .item-list {
  660. padding: 20rpx 0 0;
  661. display: flex;
  662. flex-wrap: wrap;
  663. text {
  664. display: flex;
  665. align-items: center;
  666. justify-content: center;
  667. background: #eee;
  668. margin-right: 20rpx;
  669. margin-bottom: 20rpx;
  670. border-radius: 10rpx;
  671. min-width: 60rpx;
  672. height: 60rpx;
  673. padding: 0 20rpx;
  674. font-size: $font-base;
  675. color: $font-color-dark;
  676. }
  677. .selected {
  678. background: #fceff1;
  679. color: #f35768;
  680. border: 1px solid #f35768;
  681. }
  682. }
  683. }
  684. //默认商品底部高度
  685. .goodsBottom {
  686. height: 160rpx;
  687. }
  688. page {
  689. background: #f0f0f0;
  690. }
  691. //秒杀、拼团底部高度
  692. .contentBottomHeight {
  693. background-color: #f8f8f8;
  694. height: 130rpx;
  695. }
  696. //默认商品底部高度
  697. .goodsBottom {
  698. height: 160rpx;
  699. }
  700. /deep/ .iconenter {
  701. font-size: $font-base + 2rpx;
  702. color: #888;
  703. }
  704. /deep/ .con_image {
  705. width: 130rpx;
  706. height: 130rpx;
  707. display: inline-block;
  708. padding: 15rpx;
  709. image {
  710. width: 100%;
  711. height: 100%;
  712. }
  713. }
  714. /* 商品详情中限制图片大小 */
  715. /deep/ .rich-img {
  716. width: 100% !important;
  717. height: auto;
  718. }
  719. .mun-box {
  720. display: flex;
  721. justify-content: space-between;
  722. align-items: center;
  723. }
  724. .sckill-top {
  725. width: 750rpx;
  726. height: 165rpx;
  727. background-image: url(../../static/img/base-sckill.png);
  728. background-size: 100% 100%;
  729. position: relative;
  730. top: -40rpx;
  731. margin-bottom: -40rpx;
  732. display: flex;
  733. justify-content: space-between;
  734. .top-left {
  735. line-height: 1;
  736. .left-top {
  737. padding: 35rpx 0 23rpx 22rpx;
  738. font-size: 44rpx;
  739. font-weight: 500;
  740. color: #ffffff;
  741. line-height: 1;
  742. }
  743. .left-btm {
  744. line-height: 1;
  745. font-size: 30rpx;
  746. font-weight: 500;
  747. padding-left: 25rpx;
  748. // text-decoration: line-through;
  749. color: #ffffff;
  750. .now-pri {
  751. display: inline-block;
  752. padding-right: 8rpx;
  753. font-size: 44rpx;
  754. font-weight: 800;
  755. color: #ffffff;
  756. }
  757. .old-pri {
  758. text-decoration: line-through;
  759. }
  760. }
  761. }
  762. .top-right {
  763. padding: 67rpx 40rpx 18rpx 0;
  764. .right-top {
  765. text-align: center;
  766. font-size: 22rpx;
  767. font-weight: 400;
  768. color: #ffffff;
  769. line-height: 1;
  770. padding-bottom: 8rpx;
  771. }
  772. }
  773. }
  774. .mask {
  775. position: fixed;
  776. top: 0;
  777. left: 0;
  778. width: 100%;
  779. height: 100%;
  780. z-index: 999;
  781. background-color: rgba(0, 0, 0, 0.4);
  782. image {
  783. width: 100%;
  784. height: 100%;
  785. opacity: 0.8;
  786. }
  787. }
  788. </style>