miaosha.vue 20 KB

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