product.vue 29 KB

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