product.vue 21 KB

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