miaosha.vue 21 KB

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