product.vue 22 KB

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