product.vue 27 KB

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