product.vue 26 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168
  1. <template>
  2. <view class="container">
  3. <view class="carousel">
  4. <swiper indicator-dots :circular="true" duration="400">
  5. <swiper-item class="swiper-item" v-for="(item, index) in imgList" :key="index">
  6. <view class="image-wrapper"><image :src="item" class="loaded" mode="scaleToFill"></image></view>
  7. </swiper-item>
  8. </swiper>
  9. </view>
  10. <view class="introduce-section seckill-box-title" v-if="goodsType == 1">
  11. <view class="title flex">
  12. <view class="title-box">
  13. <text class="price-tip">¥</text>
  14. <text class="price" v-if="userInfo && userInfo.level == 1">{{ goodsObjact.vip_repurchase*1 || ''}}</text>
  15. <text class="price" v-if="userInfo && userInfo.level == 2">{{ goodsObjact.agent_repurchase*1 || ''}}</text>
  16. <text class="price" v-if="(!hasLogin || userInfo.level == 0)">{{ goodsObjact.price*1 }}</text>
  17. <text class="m-price" v-if="goodsObjact.ot_price > goodsObjact.price">¥{{ goodsObjact.ot_price }}</text>
  18. <!-- <text class="coupon-tip">7折</text> -->
  19. </view>
  20. <view class="flex timeStop">
  21. <view>距离结束</view>
  22. <uni-countdown
  23. color="#ffffff"
  24. background-color="#D65B3F"
  25. splitor-color="#FFFFFF"
  26. :show-day="false"
  27. :hour="seckillObj.stopTimeH"
  28. :minute="seckillObj.stopTimeM"
  29. :second="seckillObj.stopTimeS"
  30. ></uni-countdown>
  31. </view>
  32. </view>
  33. </view>
  34. <view class="introduce-section">
  35. <view class="price-box" v-if="goodsType == 0">
  36. <text class="price-tip">¥</text>
  37. <text class="price">{{ goodsObjact.price}}</text>
  38. <text class="m-price" v-if="goodsObjact.ot_price > goodsObjact.price">¥{{ goodsObjact.ot_price }}</text>
  39. </view>
  40. <text class="title" v-if="goodsType == 0">{{ goodsObjact.store_name }}</text>
  41. </view>
  42. <view class="c-list">
  43. <view class="c-row b-b" @click="toggleSpec">
  44. <text class="tit">购买数量</text>
  45. <view class="con">
  46. <text class="selected-text">{{ goodsNumber }}</text>
  47. </view>
  48. <text class="iconfont iconenter"></text>
  49. </view>
  50. <view class="c-row b-b" v-if="goodsType == 1">
  51. <text class="tit">限购数量</text>
  52. <view class="con">
  53. <text class="selected-text">{{ goodsObjact.num + goodsObjact.unit_name }}</text>
  54. </view>
  55. </view>
  56. <!-- <view class="c-row b-b" v-if="goodsObjact.is_integral == 1 && goodsType == 0">
  57. <text class="tit">积分</text>
  58. <view class="bz-list con">
  59. <text>最高抵扣¥{{ moneyNum(goodsObjact.use_max_integral) == 0 ? moneyNum(goodsObjact.price) : moneyNum(goodsObjact.use_max_integral) }}</text>
  60. </view>
  61. </view> -->
  62. </view>
  63. <view class="detail-desc">
  64. <view class="d-header"><text>商品详情</text></view>
  65. <rich-text class="detail-centent" :nodes="goodsObjact.description"></rich-text>
  66. <view :class="{ contentBottomHeight: goodsType == 1 || goodsType == 2, goodsBottom: goodsType == 0 }"></view>
  67. </view>
  68. <!-- 底部操作菜单 -->
  69. <view class="page-bottom" v-if="goodsType == 0">
  70. <view class="action-btn-group">
  71. <view class="buy-now">
  72. <button type="primary" class=" action-btn no-border buy-now-btn" @click.stop="toggleSpec(2)" v-if="goodsObjact.is_pack == 0">加入购物车</button>
  73. <button type="primary" class=" action-btn no-border add-cart-btn" @click.stop="toggleSpec(1)">立即购买</button>
  74. </view>
  75. </view>
  76. </view>
  77. <!-- 规格-模态层弹窗 -->
  78. <view class="popup spec" :class="specClass" @touchmove.stop.prevent="stopPrevent" @click="toggleSpec">
  79. <!-- 遮罩层 -->
  80. <view class="mask"></view>
  81. <view class="layer attr-content" @click.stop="stopPrevent">
  82. <view class="a-t">
  83. <image :src="actionImage"></image>
  84. <view class="right">
  85. <view class="good-name clamp">{{ goodsObjact.store_name }}</view>
  86. <text class="price">¥{{ actionPrice * goodsNumber }}</text>
  87. <!-- <text class="price jf">{{ goodIntegral }}</text> -->
  88. <!-- <text class="stock">库存:{{ goodsObjact.stock }}件</text> -->
  89. <!-- <view class="selected" v-if="goodsType == 0">
  90. 已选:
  91. <text class="selected-text" v-for="(sItem, sIndex) in specSelected" :key="sIndex">{{ sItem }}</text>
  92. </view> -->
  93. </view>
  94. </view>
  95. <view v-for="(item, index) in specList" :key="index" class="attr-list">
  96. <text>{{ item.attr_name }}</text>
  97. <view class="item-list">
  98. <text
  99. v-for="(childItem, childIndex) in item.attr_value"
  100. :key="childIndex"
  101. class="tit"
  102. :class="{ selected: childItem.check }"
  103. @click="selectSpec(childItem, item, index)"
  104. >
  105. {{ childItem.attr }}
  106. </text>
  107. </view>
  108. </view>
  109. <view class="attr-list" style="padding-bottom: 120rpx;">
  110. <text>购买数量</text>
  111. <view class="item-list">
  112. <uni-number-box class="step" :isMin="true" :value="goodsNumber" :min="1" :max="goodsNumberMax" @eventChange="numberChange"></uni-number-box>
  113. </view>
  114. </view>
  115. <button class="btn" @click.stop="buy">确定</button>
  116. </view>
  117. </view>
  118. <!-- <view :class="{ seckillBottom: goodsType == 1, goodsBottom: goodsType == 0 }"></view> -->
  119. <!-- 分享 -->
  120. <!-- <share ref="share" :contentHeight="580" :shareList="shareList"></share> -->
  121. </view>
  122. </template>
  123. <script>
  124. // import share from '@/components/share';
  125. import uniNumberBox from '@/components/uni-number-box.vue';
  126. import uniCountdown from '@/components/uni-countdown/uni-countdown.vue';
  127. import { goodsDetail, cartAdd, collectAdd, collectDel, seckillGoods, groupGoods } from '@/api/product.js';
  128. // #ifdef H5
  129. import { weixindata,shareLoad } from '@/utils/wxAuthorized';
  130. import weixinObj from "@/plugin/jweixin-module/index.js";
  131. import { userInfo } from 'os';
  132. // #endif
  133. import {
  134. mapState,
  135. mapMutations
  136. } from 'vuex';
  137. export default {
  138. components: {
  139. uniNumberBox,
  140. uniCountdown
  141. },
  142. filters: {
  143. address(val) {
  144. let str = '';
  145. if (val) {
  146. str = val[0] + ' ' + val[1];
  147. }
  148. return str;
  149. }
  150. },
  151. data() {
  152. return {
  153. isfg: 0,
  154. details: '',
  155. reply: '', //评论
  156. type: 1, //默认支付方式add为
  157. goodsNumber: 1, //购买数量
  158. goodsid: '', //商品id
  159. specClass: 'none', //显示隐藏弹窗
  160. shareList: [], //分享列表
  161. goodsObjact: {}, //保存商品数据
  162. storeObjact: {}, //保存店铺数据
  163. //图片循环
  164. imgList: [],
  165. specList: [],
  166. // 对比对象
  167. productValue: [],
  168. actionPrice: 0, //默认选中商品价格
  169. actionImage: '', //默认选中图片
  170. uniqueId: '', //选中的商品分类
  171. specSelected: [], //选中的分类
  172. specSelectedName: '', //选中分类名称
  173. goodsNumberMax: 0, //最大可购买数量
  174. shopId: '', //商店id
  175. //商店信息
  176. shopInfo: {
  177. logo: '',
  178. title: ''
  179. }, //商店信息
  180. goodsType: 0, //商品类型1秒杀商品0为普通商品2为拼团商品
  181. // 秒杀数据保存
  182. seckillObj: {
  183. stopTime: 0, //结束时间
  184. stop: false, //是否结束
  185. stopTimeH: 0, //小时
  186. stopTimeM: 0, //分钟
  187. stopTimeS: 0 //秒钟
  188. },
  189. // 拼团数据保存
  190. pink: {
  191. id: '', //拼团编号
  192. uid: '', //用户编号
  193. people: '', //拼团人数
  194. price: '', //拼团价格
  195. stop_time: '', //拼团结束时间
  196. nickname: '', //团长昵称
  197. avatar: '', //团长头像
  198. count: '', //拼团剩余人数
  199. h: '', //时
  200. i: '', //分
  201. s: '' //秒
  202. },
  203. is_bk: 0,
  204. is_xf: 0,
  205. goodIntegral: 0,//需要使用的积分
  206. };
  207. },
  208. async onLoad(options) {
  209. let obj = this;
  210. if(options.isfg) {
  211. this.isfg = options.isfg
  212. }
  213. if(options.is_bk) {
  214. obj.is_bk = options.is_bk
  215. }
  216. if(options.is_xf) {
  217. obj.is_xf = options.is_xf
  218. }
  219. //保存商品id
  220. this.goodsid = options.id;
  221. // 判断有无人邀请
  222. if (options.spread) {
  223. // 存储邀请人
  224. uni.setStorageSync('spread', options.spread);
  225. }
  226. // 判断是否为秒杀商品
  227. if (options.type == 1) {
  228. // 保存商品类型
  229. this.goodsType = 1;
  230. // 保存结束时间
  231. this.seckillObj.stopTime = options.stoptime;
  232. // 获取当前时间毫秒数
  233. let stoptime = options.stoptime * 1000;
  234. // 获取当前时间
  235. let acitonTime = new Date();
  236. // 判断当前时间是否大于结束时间
  237. if (acitonTime.getTime() > stoptime) {
  238. // 当前秒杀时间已经结束
  239. this.seckillObj.stop = true;
  240. } else {
  241. // 计算倒计时
  242. this.timeComputed(stoptime, this.seckillObj);
  243. }
  244. this.seckillGoods();
  245. return;
  246. }
  247. if (options.type == 2) {
  248. // 保存当前拼团商品类型
  249. this.goodsType = 2;
  250. // 家在数据
  251. this.groupGoods();
  252. return;
  253. }
  254. if (this.goodsType == 0) {
  255. // 加载普通商品详情
  256. this.goodsDetail();
  257. }
  258. },
  259. computed: {
  260. // #ifdef H5
  261. ...mapState(['weichatObj', 'baseURL', 'urlFile']),
  262. // #endif
  263. ...mapState('user', ['userInfo','hasLogin'])
  264. },
  265. methods: {
  266. navTo(url) {
  267. uni.navigateTo({
  268. url
  269. });
  270. },
  271. // 转换字符串为数字
  272. moneyNum: function(value) {
  273. return +value;
  274. },
  275. navToProductGoods() {
  276. uni.redirectTo({
  277. url: '/pages/product/product?id=' + this.goodsObjact.product_id
  278. });
  279. },
  280. // 获取商品信息
  281. goodsDetail() {
  282. let obj = this;
  283. goodsDetail({}, this.goodsid).then(function({ data }) {
  284. obj.details = data;
  285. let goods = data.storeInfo;
  286. let store_info = data.system_store; // 保存店铺信息
  287. console.log(store_info);
  288. obj.storeObjact = store_info;
  289. obj.goodsObjact = goods;
  290. if (obj.goodsObjact.description != null) {
  291. obj.goodsObjact.description = obj.goodsObjact.description.replace(/\<img/gi, '<img class="rich-img"');
  292. } //小程序商品详情图超出屏幕问题
  293. // console.log()
  294. obj.reply = data.reply; //保存评论列表
  295. obj.imgList = goods.slider_image; //保存轮播图
  296. obj.specList = data.productAttr; //保存分类列表
  297. console.log(data.productAttr);
  298. obj.productValue = data.productValue; //保存分类查询数据
  299. //保存默认选中商品价格
  300. obj.actionPrice = goods.price;
  301. obj.actionImage = goods.image_base; //保存默认选中商品价格
  302. obj.goodsNumberMax = goods.stock; //保存默认选中最大可购买商品数量
  303. obj.shopId = data.mer_id; //保存商店id
  304. console.log(obj.goodsObjact.is_pack,'v');
  305. if(obj.goodsObjact.is_pack == 1) {
  306. obj.goodsNumberMax = 4
  307. }
  308. // 保存默认选中的对象
  309. obj.specSelected = []; //初始化默认选择对象
  310. for (let i = 0; i < obj.specList.length; i++) {
  311. // 设置默认数据
  312. let attrValue = obj.specList[i].attr_value[0];
  313. attrValue.check = true;
  314. obj.specSelected.push(attrValue.attr);
  315. }
  316. //保存默认选中的对象字符串名称
  317. let str = obj.specSelected.join(',');
  318. // 设置默认值
  319. obj.actionImage = obj.productValue[str].image;
  320. obj.uniqueId = obj.productValue[str].unique;
  321. obj.goodIntegral = obj.productValue[str].integral
  322. // #ifdef H5
  323. obj.shareDate();
  324. // #endif
  325. });
  326. },
  327. // #ifdef H5
  328. // 加载微信html5页面分享方法
  329. shareDate() {
  330. let obj = this;
  331. // 保存分享人id链接
  332. let url = window.location.href + '&spread=' + this.userInfo.uid;
  333. // 判断是否微信浏览器
  334. let bool = uni.getStorageSync('weichatBrowser') || '';
  335. if (bool) {
  336. // 过滤微信强制添加的链接地址
  337. url = url.replace(/[\?,&]from=singlemessage/g, '');
  338. let data = {
  339. link: url, // 分享链接
  340. imgUrl: obj.goodsObjact.image, // 分享图标
  341. desc: obj.goodsObjact.store_info,
  342. title: obj.goodsObjact.store_name,
  343. success: function(e) {
  344. console.log(e);
  345. }
  346. };
  347. shareLoad(data);
  348. }
  349. },
  350. // #endif
  351. // 购买数量变化
  352. numberChange(e) {
  353. this.goodsNumber = e.number;
  354. },
  355. //规格弹窗开关
  356. toggleSpec(str) {
  357. if (this.specClass === 'show') {
  358. this.specClass = 'hide';
  359. setTimeout(() => {
  360. this.specClass = 'none';
  361. }, 250);
  362. } else if (this.specClass === 'none') {
  363. this.specClass = 'show';
  364. }
  365. // 保存当前购买类型
  366. this.type = str;
  367. },
  368. //选择规格
  369. selectSpec(item, arr, ind) {
  370. let obj = this
  371. arr.attr_value.forEach(function(e) {
  372. e.check = false;
  373. });
  374. item.check = true;
  375. this.specSelected[ind] = item.attr;
  376. let str = this.specSelected.join(',');
  377. this.specSelectedName = this.specSelected.join(' ');
  378. if (this.productValue[str]) {
  379. let data = this.productValue[str];
  380. this.actionPrice = data.price;
  381. if(obj.goodsObjact.is_pack == 1) {
  382. this.goodsNumberMax = 4;
  383. }else {
  384. this.goodsNumberMax = data.stock;
  385. }
  386. this.actionImage = data.image;
  387. this.uniqueId = data.unique;
  388. this.goodIntegral = data.integral
  389. console.log(this.goodIntegral,'xuanz')
  390. }
  391. if(obj.goodsObjact.is_pack == 1) {
  392. console.log('dddddddddddddddddddddd');
  393. this.goodsNumberMax = 4;
  394. }
  395. },
  396. //分享
  397. share() {
  398. this.$refs.share.toggleMask();
  399. },
  400. //收藏
  401. toFavorite(item) {
  402. let obj = this;
  403. item.userCollect = !item.userCollect;
  404. if (!item.userCollect) {
  405. collectDel({ id: obj.goodsid, category: 'product' }).then(function(e) {
  406. uni.showToast({
  407. title: '成功取消收藏',
  408. type: 'top',
  409. duration: 1500
  410. });
  411. });
  412. } else {
  413. collectAdd({ id: obj.goodsid, category: 'product' }).then(function(e) {
  414. uni.showToast({
  415. title: '成功加入收藏',
  416. type: 'top',
  417. duration: 1500
  418. });
  419. });
  420. }
  421. },
  422. // 立即购买
  423. buy() {
  424. let obj = this;
  425. let data = {
  426. cartNum: obj.goodsNumber, //商品数量
  427. uniqueId: obj.uniqueId, //商品标签
  428. new: '1', //商品是否新增加到购物车1为不加入0为加入
  429. mer_id: obj.shopId,
  430. is_pack: obj.goodsObjact.is_pack
  431. // type: 0,//0为余额支付 1为消费券支付 2为积分支付
  432. };
  433. if (obj.type == 2) {
  434. data.new = 0;
  435. }
  436. if (obj.goodsType == 0) {
  437. data.productId = obj.goodsid; //商品编号
  438. }
  439. // 判断是否为秒杀商品
  440. if (obj.goodsType == 1) {
  441. data.secKillId = obj.goodsid; //秒杀商品编号
  442. data.productId = obj.goodsObjact.product_id; //商品编号
  443. // 判断是否秒杀已经结束
  444. if (obj.seckillObj.stop) {
  445. uni.showModal({
  446. title: '提示',
  447. content: '当前活动已经结束',
  448. showCancel: false
  449. });
  450. return;
  451. }
  452. }
  453. // 判断是否为拼团商品
  454. if (obj.goodsType == 2) {
  455. data.combinationId = obj.goodsid; //拼团编号
  456. data.productId = obj.goodsObjact.product_id; //商品编号
  457. }
  458. cartAdd(data)
  459. .then(function({ data }) {
  460. if (obj.type == 1) {
  461. // 跳转到支付页
  462. uni.navigateTo({
  463. url: '/pages/order/createOrder?id=' + data.cartId + '&goodsType=' + obj.goodsType + '&is_pack=' + obj.goodsObjact.is_pack
  464. });
  465. }
  466. if (obj.type == 2) {
  467. uni.showToast({
  468. title: '成功加入购物车',
  469. type: 'top',
  470. duration: 2000
  471. });
  472. obj.toggleSpec();
  473. }
  474. })
  475. .catch(e => {
  476. console.log(e);
  477. });
  478. },
  479. stopPrevent() {}
  480. }
  481. };
  482. </script>
  483. <style lang="scss">
  484. page {
  485. background: $page-color-base;
  486. }
  487. //秒杀底部高度
  488. .seckillBottom {
  489. height: 110rpx;
  490. }
  491. // 文章页底部高度撑开
  492. .contentBottomHeight {
  493. height: 110rpx;
  494. }
  495. //默认商品底部高度
  496. .goodsBottom {
  497. height: 100rpx;
  498. }
  499. .iconenter {
  500. font-size: $font-base + 2rpx;
  501. color: #888;
  502. }
  503. .carousel {
  504. /* #ifdef APP-PLUS */
  505. padding-top: var(--status-bar-height);
  506. /* #endif */
  507. height: 722rpx;
  508. position: relative;
  509. swiper {
  510. height: 100%;
  511. }
  512. .image-wrapper {
  513. width: 100%;
  514. height: 100%;
  515. }
  516. .swiper-item {
  517. display: flex;
  518. justify-content: center;
  519. align-content: center;
  520. // height: 750rpx;
  521. height: 710rpx;
  522. overflow: hidden;
  523. image {
  524. width: 100%;
  525. height: 100%;
  526. }
  527. }
  528. }
  529. // 秒杀
  530. .seckill-box-title {
  531. background: linear-gradient(90deg, rgba(239, 78, 81, 1) 0%, rgba(244, 113, 59, 1) 100%) !important;
  532. .price,
  533. .price-tip,
  534. .timeStop,
  535. .m-price {
  536. color: #ffffff !important;
  537. }
  538. .price-tip {
  539. font-size: $font-base;
  540. }
  541. .price {
  542. font-size: 45rpx !important;
  543. font-weight: bold;
  544. }
  545. .timeStop {
  546. }
  547. }
  548. // 底部拼团、秒杀支付按钮
  549. .goods-pay-box {
  550. position: fixed;
  551. left: 0;
  552. bottom: 0;
  553. z-index: 95;
  554. width: 750rpx;
  555. height: 100rpx;
  556. line-height: 1;
  557. color: #ffffff;
  558. text-align: center;
  559. font-size: $font-lg;
  560. .bgLine {
  561. background: linear-gradient(90deg, rgba(239, 78, 81, 1) 0%, rgba(244, 113, 59, 1) 100%);
  562. }
  563. // 拼团支付按钮
  564. .goods-pay {
  565. display: flex;
  566. align-content: center;
  567. flex-wrap: wrap;
  568. justify-content: center;
  569. .goods-buttom,
  570. .goods-buttom-money {
  571. width: 100%;
  572. }
  573. .goods-buttom-money {
  574. font-size: $font-base;
  575. }
  576. }
  577. .goods-pay-stop,
  578. .goods-pay {
  579. padding: 15rpx 0;
  580. height: 100%;
  581. width: 100%;
  582. }
  583. .goods-pay-stop {
  584. background: $color-gray;
  585. line-height: 70rpx;
  586. }
  587. }
  588. /* 标题简介 */
  589. .introduce-section {
  590. background: #fff;
  591. padding: 20rpx 30rpx;
  592. .title {
  593. font-size: 32rpx;
  594. color: $font-color-dark;
  595. height: 50rpx;
  596. line-height: 50rpx;
  597. }
  598. .price-box {
  599. display: flex;
  600. align-items: baseline;
  601. height: 64rpx;
  602. padding: 10rpx 0;
  603. font-size: 26rpx;
  604. color: #FD3B39;
  605. }
  606. .price {
  607. font-size: $font-lg + 2rpx;
  608. }
  609. .m-price {
  610. margin: 0 12rpx;
  611. color: $font-color-light;
  612. text-decoration: line-through;
  613. }
  614. .pt {
  615. text-decoration:none;
  616. }
  617. .coupon-tip {
  618. align-items: center;
  619. padding: 4rpx 10rpx;
  620. background: $uni-color-primary;
  621. font-size: $font-sm;
  622. color: #fff;
  623. border-radius: 6rpx;
  624. line-height: 1;
  625. transform: translateY(-4rpx);
  626. }
  627. .bot-row {
  628. display: flex;
  629. align-items: center;
  630. height: 50rpx;
  631. font-size: $font-sm;
  632. color: $font-color-light;
  633. text {
  634. flex: 1;
  635. }
  636. }
  637. }
  638. /* 分享 */
  639. .share-section {
  640. display: flex;
  641. align-items: center;
  642. color: $font-color-base;
  643. background: linear-gradient(left, #fdf5f6, #fbebf6);
  644. padding: 12rpx 30rpx;
  645. .share-icon {
  646. display: flex;
  647. align-items: center;
  648. width: 70rpx;
  649. height: 30rpx;
  650. line-height: 1;
  651. border: 1px solid $uni-color-primary;
  652. border-radius: 4rpx;
  653. position: relative;
  654. overflow: hidden;
  655. font-size: 22rpx;
  656. color: $uni-color-primary;
  657. &:after {
  658. content: '';
  659. width: 50rpx;
  660. height: 50rpx;
  661. border-radius: 50%;
  662. left: -20rpx;
  663. top: -12rpx;
  664. position: absolute;
  665. background: $uni-color-primary;
  666. }
  667. }
  668. .iconfavorfill {
  669. position: relative;
  670. z-index: 1;
  671. font-size: 24rpx;
  672. margin-left: 2rpx;
  673. margin-right: 10rpx;
  674. color: #fff;
  675. line-height: 1;
  676. }
  677. .tit {
  678. font-size: $font-base;
  679. margin-left: 10rpx;
  680. }
  681. .iconprompt {
  682. padding: 10rpx;
  683. font-size: 30rpx;
  684. line-height: 1;
  685. }
  686. .share-btn {
  687. flex: 1;
  688. text-align: right;
  689. font-size: $font-sm;
  690. color: $uni-color-primary;
  691. }
  692. .iconenter {
  693. font-size: $font-sm;
  694. margin-left: 4rpx;
  695. color: $uni-color-primary;
  696. }
  697. }
  698. .c-list {
  699. margin-top: 20rpx;
  700. font-size: $font-sm + 2rpx;
  701. color: $font-color-base;
  702. background: #fff;
  703. .c-row {
  704. display: flex;
  705. align-items: center;
  706. padding: 20rpx 30rpx;
  707. position: relative;
  708. }
  709. .tit {
  710. width: 140rpx;
  711. }
  712. .con {
  713. flex: 1;
  714. color: $font-color-dark;
  715. .selected-text {
  716. margin-right: 10rpx;
  717. .num {
  718. color: #FD3B39;
  719. }
  720. }
  721. }
  722. .bz-list {
  723. height: 40rpx;
  724. font-size: $font-sm + 2rpx;
  725. color: $font-color-dark;
  726. text {
  727. display: inline-block;
  728. margin-right: 30rpx;
  729. }
  730. }
  731. .con-list {
  732. flex: 1;
  733. display: flex;
  734. flex-direction: column;
  735. color: $font-color-dark;
  736. line-height: 40rpx;
  737. }
  738. .red {
  739. color: $uni-color-primary;
  740. }
  741. }
  742. /* 评价 */
  743. .eva-section {
  744. display: flex;
  745. flex-direction: column;
  746. padding: 20rpx 30rpx;
  747. background: #fff;
  748. margin-top: 16rpx;
  749. .e-header {
  750. display: flex;
  751. align-items: center;
  752. height: 70rpx;
  753. font-size: $font-sm + 2rpx;
  754. color: $font-color-light;
  755. .tit {
  756. font-size: $font-base + 2rpx;
  757. color: $font-color-dark;
  758. margin-right: 4rpx;
  759. }
  760. .tip {
  761. flex: 1;
  762. text-align: right;
  763. }
  764. .iconenter {
  765. margin-left: 10rpx;
  766. }
  767. }
  768. }
  769. .eva-box {
  770. display: flex;
  771. padding: 20rpx 0;
  772. .portrait {
  773. flex-shrink: 0;
  774. width: 80rpx;
  775. height: 80rpx;
  776. border-radius: 100px;
  777. }
  778. .right {
  779. flex: 1;
  780. display: flex;
  781. flex-direction: column;
  782. font-size: $font-base;
  783. color: $font-color-base;
  784. padding-left: 26rpx;
  785. .con {
  786. font-size: $font-base;
  787. color: $font-color-dark;
  788. padding: 20rpx 0;
  789. }
  790. .bot {
  791. display: flex;
  792. justify-content: space-between;
  793. font-size: $font-sm;
  794. color: $font-color-light;
  795. }
  796. }
  797. }
  798. .eva-boxs {
  799. width: 100%;
  800. overflow: hidden;
  801. padding: 10px 28rpx;
  802. background: #f4f4f4;
  803. border-radius: 12rpx;
  804. font-size: $font-sm + 2rpx;
  805. color: #333;
  806. .portrait {
  807. flex-shrink: 0;
  808. width: 80rpx;
  809. height: 80rpx;
  810. border-radius: 100px;
  811. }
  812. .right {
  813. flex: 1;
  814. display: flex;
  815. flex-direction: column;
  816. font-size: $font-base;
  817. color: $font-color-base;
  818. .con {
  819. font-size: $font-base;
  820. color: $font-color-dark;
  821. }
  822. .bot {
  823. display: flex;
  824. justify-content: space-between;
  825. font-size: $font-sm;
  826. color: $font-color-light;
  827. }
  828. }
  829. }
  830. /* 详情 */
  831. .detail-desc {
  832. background: #fff;
  833. margin-top: 16rpx;
  834. /deep/ img {
  835. max-width: 100% !important;
  836. display: inline !important;
  837. }
  838. /deep/ div {
  839. max-width: 100% !important;
  840. }
  841. .d-header {
  842. display: flex;
  843. justify-content: center;
  844. align-items: center;
  845. height: 80rpx;
  846. font-size: $font-base + 2rpx;
  847. color: $font-color-dark;
  848. position: relative;
  849. text {
  850. padding: 0 20rpx;
  851. background: #fff;
  852. position: relative;
  853. z-index: 1;
  854. }
  855. &:after {
  856. position: absolute;
  857. left: 50%;
  858. top: 50%;
  859. transform: translateX(-50%);
  860. width: 300rpx;
  861. height: 0;
  862. content: '';
  863. border-bottom: 1px solid #ccc;
  864. }
  865. }
  866. }
  867. /* 规格选择弹窗 */
  868. .attr-content {
  869. padding: 10rpx 0 0;
  870. .a-t {
  871. padding: 0 30rpx;
  872. display: flex;
  873. image {
  874. width: 170rpx;
  875. height: 170rpx;
  876. flex-shrink: 0;
  877. border-radius: 8rpx;
  878. }
  879. .right {
  880. display: flex;
  881. flex-direction: column;
  882. padding-left: 24rpx;
  883. font-size: $font-sm + 2rpx;
  884. color: $font-color-base;
  885. line-height: 42rpx;
  886. .good-name {
  887. padding-top: 20rpx;
  888. max-width: 320rpx;
  889. font-size: 30rpx;
  890. font-family: PingFang SC;
  891. font-weight: bold;
  892. color: #1d2023;
  893. line-height: 42rpx;
  894. margin-bottom: 15rpx;
  895. }
  896. .price {
  897. font-size: 60rpx;
  898. font-family: PingFang SC;
  899. font-weight: bold;
  900. color: #ff6f0f;
  901. // font-size: $font-lg;
  902. // color: $uni-color-primary;
  903. // margin-bottom: 10rpx;
  904. }
  905. .selected-text {
  906. margin-right: 10rpx;
  907. }
  908. }
  909. }
  910. .attr-list {
  911. display: flex;
  912. flex-direction: column;
  913. font-size: $font-base + 2rpx;
  914. color: $font-color-base;
  915. padding-top: 30rpx;
  916. padding-left: 40rpx;
  917. padding-right: 30rpx;
  918. }
  919. .item-list {
  920. padding: 20rpx 0 0;
  921. display: flex;
  922. flex-wrap: wrap;
  923. .tit {
  924. display: flex;
  925. align-items: center;
  926. justify-content: center;
  927. background: #eee;
  928. // margin-left: 10rpx;
  929. margin-right: 20rpx;
  930. margin-bottom: 20rpx;
  931. border-radius: 100rpx;
  932. min-width: 60rpx;
  933. height: 60rpx;
  934. padding: 0 20rpx;
  935. font-size: $font-base;
  936. color: $font-color-dark;
  937. }
  938. .selected {
  939. background: #fbebee;
  940. color: $uni-color-primary;
  941. }
  942. }
  943. }
  944. /* 弹出层 */
  945. .popup {
  946. position: fixed;
  947. left: 0;
  948. top: 0;
  949. right: 0;
  950. bottom: 0;
  951. z-index: 99;
  952. &.show {
  953. display: block;
  954. .mask {
  955. animation: showPopup 0.2s linear both;
  956. }
  957. .layer {
  958. animation: showLayer 0.2s linear both;
  959. }
  960. }
  961. &.hide {
  962. .mask {
  963. animation: hidePopup 0.2s linear both;
  964. }
  965. .layer {
  966. animation: hideLayer 0.2s linear both;
  967. }
  968. }
  969. &.none {
  970. display: none;
  971. }
  972. .mask {
  973. position: fixed;
  974. top: 0;
  975. width: 100%;
  976. height: 100%;
  977. z-index: 1;
  978. background-color: rgba(0, 0, 0, 0.4);
  979. }
  980. .layer {
  981. position: fixed;
  982. z-index: 99;
  983. bottom: 0;
  984. width: 100%;
  985. min-height: 30vh;
  986. border-radius: 10rpx 10rpx 0 0;
  987. background-color: #fff;
  988. .btn {
  989. position: absolute;
  990. bottom: 0;
  991. width: 750rpx;
  992. height: 98rpx;
  993. background: #FE5B38;
  994. line-height: 98rpx;
  995. // background: $uni-color-primary;
  996. font-size: $font-base + 2rpx;
  997. color: #fff;
  998. }
  999. }
  1000. @keyframes showPopup {
  1001. 0% {
  1002. opacity: 0;
  1003. }
  1004. 100% {
  1005. opacity: 1;
  1006. }
  1007. }
  1008. @keyframes hidePopup {
  1009. 0% {
  1010. opacity: 1;
  1011. }
  1012. 100% {
  1013. opacity: 0;
  1014. }
  1015. }
  1016. @keyframes showLayer {
  1017. 0% {
  1018. transform: translateY(120%);
  1019. }
  1020. 100% {
  1021. transform: translateY(0%);
  1022. }
  1023. }
  1024. @keyframes hideLayer {
  1025. 0% {
  1026. transform: translateY(0);
  1027. }
  1028. 100% {
  1029. transform: translateY(120%);
  1030. }
  1031. }
  1032. }
  1033. /* 底部操作菜单 */
  1034. .page-bottom {
  1035. position: fixed;
  1036. left: 0rpx;
  1037. bottom: 0rpx;
  1038. z-index: 95;
  1039. display: flex;
  1040. justify-content: center;
  1041. align-items: center;
  1042. width: 750rpx;
  1043. height: 98rpx;
  1044. background: rgba(255, 255, 255, 0.9);
  1045. box-shadow: 0 0 20rpx 0 rgba(0, 0, 0, 0.5);
  1046. // border-radius: 16rpx;
  1047. .p-b-btn {
  1048. display: flex;
  1049. flex-direction: column;
  1050. align-items: center;
  1051. justify-content: center;
  1052. font-size: $font-sm;
  1053. color: $font-color-base;
  1054. width: 100rpx;
  1055. height: 98rpx;
  1056. .iconfont {
  1057. font-size: 40rpx;
  1058. line-height: 48rpx;
  1059. color: $font-color-light;
  1060. }
  1061. &.active,
  1062. &.active .iconfont {
  1063. color: $uni-color-primary;
  1064. }
  1065. .icon-fenxiang2 {
  1066. font-size: 42rpx;
  1067. transform: translateY(-2rpx);
  1068. }
  1069. .iconlikefill {
  1070. font-size: 46rpx;
  1071. }
  1072. }
  1073. .action-btn-group {
  1074. display: flex;
  1075. height: 98rpx;
  1076. overflow: hidden;
  1077. position: relative;
  1078. .shoucang {
  1079. width: 100rpx;
  1080. height: 100rpx;
  1081. background: #FFFFFF;
  1082. flex-direction: column;
  1083. justify-content: center;
  1084. font-size: 20rpx;
  1085. image {
  1086. width: 36rpx;
  1087. height: 35rpx;
  1088. margin-bottom: 10rpx;
  1089. }
  1090. }
  1091. .buy-now {
  1092. flex-grow: 1;
  1093. // width: 650rpx;
  1094. width: 750rpx;
  1095. display: flex;
  1096. }
  1097. .action-btn {
  1098. flex-shrink: 0;
  1099. flex-grow: 1;
  1100. display: flex;
  1101. align-items: center;
  1102. justify-content: center;
  1103. // width: 580rpx;
  1104. flex-grow: 1;
  1105. height: 100%;
  1106. font-size: 34rpx;
  1107. padding: 0;
  1108. border-radius: 0;
  1109. // background: transparent;
  1110. background: #ffb238;
  1111. &.buy-now-btn {
  1112. background-color: #ffb238;
  1113. }
  1114. &.add-cart-btn {
  1115. background: #FD3B39;
  1116. }
  1117. }
  1118. }
  1119. }
  1120. // 商店头
  1121. .shop-box {
  1122. background-color: #ffffff;
  1123. margin-top: 20rpx;
  1124. margin-bottom: 10rpx;
  1125. padding: 20rpx;
  1126. .shop-img {
  1127. border-radius: 300rpx;
  1128. height: 80rpx;
  1129. width: 80rpx;
  1130. margin-right: 20rpx;
  1131. }
  1132. .shop-button {
  1133. border-radius: 100rpx;
  1134. padding: 10rpx 20rpx;
  1135. color: $color-red;
  1136. border: 1px solid $color-red;
  1137. font-size: $font-lg;
  1138. line-height: 1;
  1139. }
  1140. }
  1141. .detail-centent {
  1142. img {
  1143. vertical-align: top;
  1144. }
  1145. }
  1146. /* 商品详情中限制图片大小 */
  1147. /deep/ .rich-img {
  1148. width: 100% !important;
  1149. height: auto;
  1150. }
  1151. </style>