product.vue 21 KB

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