product.vue 21 KB

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