product.vue 27 KB

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