product.vue 28 KB

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