product.vue 21 KB

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