product.vue 28 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336
  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. // #ifdef H5
  364. obj.shareDate();
  365. // #endif
  366. });
  367. },
  368. // #ifdef H5
  369. // 加载微信html5页面分享方法
  370. shareDate() {
  371. let obj = this;
  372. // 保存分享人id链接
  373. let url = window.location.href + '&spread=' + this.userInfo.uid;
  374. // 判断是否微信浏览器
  375. let bool = uni.getStorageSync('weichatBrowser') || '';
  376. if (bool) {
  377. // 过滤微信强制添加的链接地址
  378. url = url.replace(/[\?,&]from=singlemessage/g, '');
  379. let data = {
  380. link: url, // 分享链接
  381. imgUrl: obj.goodsObjact.image, // 分享图标
  382. desc: obj.goodsObjact.store_info,
  383. title: obj.goodsObjact.store_name,
  384. success: function(e) {
  385. console.log(e);
  386. }
  387. };
  388. shareLoad(data);
  389. }
  390. },
  391. // #endif
  392. // 购买数量变化
  393. numberChange(e) {
  394. this.goodsNumber = e.number;
  395. },
  396. //规格弹窗开关
  397. toggleSpec(str) {
  398. if (this.specClass === 'show') {
  399. this.specClass = 'hide';
  400. setTimeout(() => {
  401. this.specClass = 'none';
  402. }, 250);
  403. } else if (this.specClass === 'none') {
  404. this.specClass = 'show';
  405. }
  406. // 保存当前购买类型
  407. this.type = str;
  408. },
  409. //选择规格
  410. selectSpec(item, arr, ind) {
  411. let obj = this
  412. arr.attr_value.forEach(function(e) {
  413. e.check = false;
  414. });
  415. item.check = true;
  416. this.specSelected[ind] = item.attr;
  417. let str = this.specSelected.join(',');
  418. this.specSelectedName = this.specSelected.join(' ');
  419. if (this.productValue[str]) {
  420. let data = this.productValue[str];
  421. this.actionPrice = data.price;
  422. // if(obj.userInfo && obj.userInfo.level == 1) {
  423. // obj.actionPrice = obj.goodsObjact.vip_repurchase
  424. // }else if(obj.userInfo && obj.userInfo.level == 2) {
  425. // obj.actionPrice = obj.goodsObjact.agent_repurchase
  426. // }else {
  427. // obj.actionPrice = goods.price;
  428. // }
  429. this.goodsNumberMax = data.stock;
  430. this.actionImage = data.image;
  431. this.uniqueId = data.unique;
  432. this.goodIntegral = data.integral
  433. console.log(this.goodIntegral, 'xuanz')
  434. }
  435. if (this.is_xf == 1) {
  436. this.goodsNumberMax = 1
  437. }
  438. },
  439. //分享
  440. share() {
  441. this.$refs.share.toggleMask();
  442. },
  443. //收藏
  444. toFavorite(item) {
  445. let obj = this;
  446. item.userCollect = !item.userCollect;
  447. if (!item.userCollect) {
  448. collectDel({
  449. id: obj.goodsid,
  450. category: 'product'
  451. }).then(function(e) {
  452. uni.showToast({
  453. title: '成功取消收藏',
  454. type: 'top',
  455. duration: 1500
  456. });
  457. });
  458. } else {
  459. collectAdd({
  460. id: obj.goodsid,
  461. category: 'product'
  462. }).then(function(e) {
  463. uni.showToast({
  464. title: '成功加入收藏',
  465. type: 'top',
  466. duration: 1500
  467. });
  468. });
  469. }
  470. },
  471. // 立即购买
  472. buy() {
  473. let obj = this;
  474. let data = {
  475. cartNum: obj.goodsNumber, //商品数量
  476. uniqueId: obj.uniqueId, //商品标签
  477. new: '1', //商品是否新增加到购物车1为不加入0为加入
  478. mer_id: obj.shopId
  479. // type: 0,//0为余额支付 1为消费券支付 2为积分支付
  480. };
  481. if (obj.type == 2) {
  482. data.new = 0;
  483. }
  484. if (obj.goodsType == 0) {
  485. data.productId = obj.goodsid; //商品编号
  486. }
  487. // 判断是否为秒杀商品
  488. if (obj.goodsType == 1) {
  489. data.secKillId = obj.goodsid; //秒杀商品编号
  490. data.productId = obj.goodsObjact.product_id; //商品编号
  491. // 判断是否秒杀已经结束
  492. if (obj.seckillObj.stop) {
  493. uni.showModal({
  494. title: '提示',
  495. content: '当前活动已经结束',
  496. showCancel: false
  497. });
  498. return;
  499. }
  500. }
  501. // 判断是否为拼团商品
  502. if (obj.goodsType == 2) {
  503. data.combinationId = obj.goodsid; //拼团编号
  504. data.productId = obj.goodsObjact.product_id; //商品编号
  505. }
  506. cartAdd(data)
  507. .then(function({
  508. data
  509. }) {
  510. if (obj.type == 1) {
  511. // 跳转到支付页
  512. uni.navigateTo({
  513. url: '/pages/order/createOrder?id=' + data.cartId + '&goodsType=' + obj
  514. .goodsType + '&isbao=' + obj.isbao
  515. });
  516. }
  517. if (obj.type == 2) {
  518. uni.showToast({
  519. title: '成功加入购物车',
  520. type: 'top',
  521. duration: 2000
  522. });
  523. obj.toggleSpec();
  524. }
  525. })
  526. .catch(e => {
  527. console.log(e);
  528. });
  529. },
  530. stopPrevent() {}
  531. }
  532. };
  533. </script>
  534. <style lang="scss">
  535. page {
  536. background: $page-color-base;
  537. }
  538. //秒杀底部高度
  539. .seckillBottom {
  540. height: 110rpx;
  541. }
  542. // 文章页底部高度撑开
  543. .contentBottomHeight {
  544. height: 110rpx;
  545. }
  546. //默认商品底部高度
  547. .goodsBottom {
  548. height: 100rpx;
  549. }
  550. .iconenter {
  551. font-size: $font-base + 2rpx;
  552. color: #888;
  553. }
  554. .carousel {
  555. /* #ifdef APP-PLUS */
  556. padding-top: var(--status-bar-height);
  557. /* #endif */
  558. height: 722rpx;
  559. position: relative;
  560. swiper {
  561. height: 100%;
  562. }
  563. .image-wrapper {
  564. width: 100%;
  565. height: 100%;
  566. }
  567. .swiper-item {
  568. display: flex;
  569. justify-content: center;
  570. align-content: center;
  571. // height: 750rpx;
  572. height: 710rpx;
  573. overflow: hidden;
  574. image {
  575. width: 100%;
  576. height: 100%;
  577. }
  578. }
  579. }
  580. // 秒杀
  581. .seckill-box-title {
  582. background: linear-gradient(90deg, rgba(239, 78, 81, 1) 0%, rgba(244, 113, 59, 1) 100%) !important;
  583. .price,
  584. .price-tip,
  585. .timeStop,
  586. .m-price {
  587. color: #ffffff !important;
  588. }
  589. .price-tip {
  590. font-size: $font-base;
  591. }
  592. .price {
  593. font-size: 45rpx !important;
  594. font-weight: bold;
  595. }
  596. .timeStop {}
  597. }
  598. // 底部拼团、秒杀支付按钮
  599. .goods-pay-box {
  600. position: fixed;
  601. left: 0;
  602. bottom: 0;
  603. z-index: 95;
  604. width: 750rpx;
  605. height: 100rpx;
  606. line-height: 1;
  607. color: #ffffff;
  608. text-align: center;
  609. font-size: $font-lg;
  610. .bgLine {
  611. background: linear-gradient(90deg, rgba(239, 78, 81, 1) 0%, rgba(244, 113, 59, 1) 100%);
  612. }
  613. // 拼团支付按钮
  614. .goods-pay {
  615. display: flex;
  616. align-content: center;
  617. flex-wrap: wrap;
  618. justify-content: center;
  619. .goods-buttom,
  620. .goods-buttom-money {
  621. width: 100%;
  622. }
  623. .goods-buttom-money {
  624. font-size: $font-base;
  625. }
  626. }
  627. .goods-pay-stop,
  628. .goods-pay {
  629. padding: 15rpx 0;
  630. height: 100%;
  631. width: 100%;
  632. }
  633. .goods-pay-stop {
  634. background: $color-gray;
  635. line-height: 70rpx;
  636. }
  637. }
  638. /* 标题简介 */
  639. .introduce-section {
  640. background: #fff;
  641. padding: 20rpx 30rpx;
  642. .title {
  643. font-size: 32rpx;
  644. color: $font-color-dark;
  645. height: 50rpx;
  646. line-height: 50rpx;
  647. }
  648. .price-box {
  649. display: flex;
  650. align-items: baseline;
  651. height: 64rpx;
  652. padding: 10rpx 0;
  653. font-size: 26rpx;
  654. color: #FD3B39;
  655. }
  656. .give-jf {
  657. display: inline-block;
  658. padding: 8rpx;
  659. background: linear-gradient(90deg, #65B2E9, #CA57DC);
  660. border-radius: 10rpx 0px 10rpx 0px;
  661. font-size: 22rpx;
  662. font-weight: 500;
  663. color: #FFFFFF;
  664. }
  665. .price {
  666. font-size: $font-lg + 2rpx;
  667. }
  668. .m-price {
  669. margin: 0 12rpx;
  670. color: $font-color-light;
  671. text-decoration: line-through;
  672. }
  673. .pt {
  674. text-decoration: none;
  675. }
  676. .coupon-tip {
  677. align-items: center;
  678. padding: 4rpx 10rpx;
  679. background: $uni-color-primary;
  680. font-size: $font-sm;
  681. color: #fff;
  682. border-radius: 6rpx;
  683. line-height: 1;
  684. transform: translateY(-4rpx);
  685. }
  686. .bot-row {
  687. display: flex;
  688. align-items: center;
  689. height: 50rpx;
  690. font-size: $font-sm;
  691. color: $font-color-light;
  692. text {
  693. flex: 1;
  694. }
  695. }
  696. }
  697. /* 分享 */
  698. .share-section {
  699. display: flex;
  700. align-items: center;
  701. color: $font-color-base;
  702. background: linear-gradient(left, #fdf5f6, #fbebf6);
  703. padding: 12rpx 30rpx;
  704. .share-icon {
  705. display: flex;
  706. align-items: center;
  707. width: 70rpx;
  708. height: 30rpx;
  709. line-height: 1;
  710. border: 1px solid $uni-color-primary;
  711. border-radius: 4rpx;
  712. position: relative;
  713. overflow: hidden;
  714. font-size: 22rpx;
  715. color: $uni-color-primary;
  716. &:after {
  717. content: '';
  718. width: 50rpx;
  719. height: 50rpx;
  720. border-radius: 50%;
  721. left: -20rpx;
  722. top: -12rpx;
  723. position: absolute;
  724. background: $uni-color-primary;
  725. }
  726. }
  727. .iconfavorfill {
  728. position: relative;
  729. z-index: 1;
  730. font-size: 24rpx;
  731. margin-left: 2rpx;
  732. margin-right: 10rpx;
  733. color: #fff;
  734. line-height: 1;
  735. }
  736. .tit {
  737. font-size: $font-base;
  738. margin-left: 10rpx;
  739. }
  740. .iconprompt {
  741. padding: 10rpx;
  742. font-size: 30rpx;
  743. line-height: 1;
  744. }
  745. .share-btn {
  746. flex: 1;
  747. text-align: right;
  748. font-size: $font-sm;
  749. color: $uni-color-primary;
  750. }
  751. .iconenter {
  752. font-size: $font-sm;
  753. margin-left: 4rpx;
  754. color: $uni-color-primary;
  755. }
  756. }
  757. .c-list {
  758. margin-top: 20rpx;
  759. font-size: $font-sm + 2rpx;
  760. color: $font-color-base;
  761. background: #fff;
  762. .c-row {
  763. display: flex;
  764. align-items: center;
  765. padding: 20rpx 30rpx;
  766. position: relative;
  767. }
  768. .tit {
  769. width: 140rpx;
  770. }
  771. .con {
  772. flex: 1;
  773. color: $font-color-dark;
  774. .selected-text {
  775. margin-right: 10rpx;
  776. .num {
  777. color: #FD3B39;
  778. }
  779. }
  780. }
  781. .bz-list {
  782. height: 40rpx;
  783. font-size: $font-sm + 2rpx;
  784. color: $font-color-dark;
  785. text {
  786. display: inline-block;
  787. margin-right: 30rpx;
  788. }
  789. }
  790. .con-list {
  791. flex: 1;
  792. display: flex;
  793. flex-direction: column;
  794. color: $font-color-dark;
  795. line-height: 40rpx;
  796. }
  797. .red {
  798. color: $uni-color-primary;
  799. }
  800. }
  801. /* 评价 */
  802. .eva-section {
  803. display: flex;
  804. flex-direction: column;
  805. padding: 20rpx 30rpx;
  806. background: #fff;
  807. margin-top: 16rpx;
  808. .e-header {
  809. display: flex;
  810. align-items: center;
  811. height: 70rpx;
  812. font-size: $font-sm + 2rpx;
  813. color: $font-color-light;
  814. .tit {
  815. font-size: $font-base + 2rpx;
  816. color: $font-color-dark;
  817. margin-right: 4rpx;
  818. }
  819. .tip {
  820. flex: 1;
  821. text-align: right;
  822. }
  823. .iconenter {
  824. margin-left: 10rpx;
  825. }
  826. }
  827. }
  828. .eva-box {
  829. display: flex;
  830. padding: 20rpx 0;
  831. .portrait {
  832. flex-shrink: 0;
  833. width: 80rpx;
  834. height: 80rpx;
  835. border-radius: 100px;
  836. }
  837. .right {
  838. flex: 1;
  839. display: flex;
  840. flex-direction: column;
  841. font-size: $font-base;
  842. color: $font-color-base;
  843. padding-left: 26rpx;
  844. .con {
  845. font-size: $font-base;
  846. color: $font-color-dark;
  847. padding: 20rpx 0;
  848. }
  849. .bot {
  850. display: flex;
  851. justify-content: space-between;
  852. font-size: $font-sm;
  853. color: $font-color-light;
  854. }
  855. }
  856. }
  857. .eva-boxs {
  858. width: 100%;
  859. overflow: hidden;
  860. padding: 10px 28rpx;
  861. background: #f4f4f4;
  862. border-radius: 12rpx;
  863. font-size: $font-sm + 2rpx;
  864. color: #333;
  865. .portrait {
  866. flex-shrink: 0;
  867. width: 80rpx;
  868. height: 80rpx;
  869. border-radius: 100px;
  870. }
  871. .right {
  872. flex: 1;
  873. display: flex;
  874. flex-direction: column;
  875. font-size: $font-base;
  876. color: $font-color-base;
  877. .con {
  878. font-size: $font-base;
  879. color: $font-color-dark;
  880. }
  881. .bot {
  882. display: flex;
  883. justify-content: space-between;
  884. font-size: $font-sm;
  885. color: $font-color-light;
  886. }
  887. }
  888. }
  889. /* 详情 */
  890. .detail-desc {
  891. background: #fff;
  892. margin-top: 16rpx;
  893. /deep/ img {
  894. max-width: 100% !important;
  895. display: inline !important;
  896. }
  897. /deep/ div {
  898. max-width: 100% !important;
  899. }
  900. .d-header {
  901. display: flex;
  902. justify-content: center;
  903. align-items: center;
  904. height: 80rpx;
  905. font-size: $font-base + 2rpx;
  906. color: $font-color-dark;
  907. position: relative;
  908. text {
  909. padding: 0 20rpx;
  910. background: #fff;
  911. position: relative;
  912. z-index: 1;
  913. }
  914. &:after {
  915. position: absolute;
  916. left: 50%;
  917. top: 50%;
  918. transform: translateX(-50%);
  919. width: 300rpx;
  920. height: 0;
  921. content: '';
  922. border-bottom: 1px solid #ccc;
  923. }
  924. }
  925. }
  926. /* 规格选择弹窗 */
  927. .attr-content {
  928. padding: 10rpx 0 0;
  929. .a-t {
  930. padding: 0 30rpx;
  931. display: flex;
  932. image {
  933. width: 170rpx;
  934. height: 170rpx;
  935. flex-shrink: 0;
  936. border-radius: 8rpx;
  937. }
  938. .right {
  939. display: flex;
  940. flex-direction: column;
  941. padding-left: 24rpx;
  942. font-size: $font-sm + 2rpx;
  943. color: $font-color-base;
  944. line-height: 42rpx;
  945. .good-name {
  946. padding-top: 20rpx;
  947. max-width: 320rpx;
  948. font-size: 30rpx;
  949. font-family: PingFang SC;
  950. font-weight: bold;
  951. color: #1d2023;
  952. line-height: 42rpx;
  953. margin-bottom: 15rpx;
  954. }
  955. .price {
  956. font-size: 60rpx;
  957. font-family: PingFang SC;
  958. font-weight: bold;
  959. color: #ff6f0f;
  960. // font-size: $font-lg;
  961. // color: $uni-color-primary;
  962. // margin-bottom: 10rpx;
  963. }
  964. .selected-text {
  965. margin-right: 10rpx;
  966. }
  967. }
  968. }
  969. .attr-list {
  970. display: flex;
  971. flex-direction: column;
  972. font-size: $font-base + 2rpx;
  973. color: $font-color-base;
  974. padding-top: 30rpx;
  975. padding-left: 40rpx;
  976. padding-right: 30rpx;
  977. }
  978. .item-list {
  979. padding: 20rpx 0 0;
  980. display: flex;
  981. flex-wrap: wrap;
  982. .tit {
  983. display: flex;
  984. align-items: center;
  985. justify-content: center;
  986. background: #eee;
  987. // margin-left: 10rpx;
  988. margin-right: 20rpx;
  989. margin-bottom: 20rpx;
  990. border-radius: 100rpx;
  991. min-width: 60rpx;
  992. height: 60rpx;
  993. padding: 0 20rpx;
  994. font-size: $font-base;
  995. color: $font-color-dark;
  996. }
  997. .selected {
  998. background: #fbebee;
  999. color: $uni-color-primary;
  1000. }
  1001. }
  1002. }
  1003. /* 弹出层 */
  1004. .popup {
  1005. position: fixed;
  1006. left: 0;
  1007. top: 0;
  1008. right: 0;
  1009. bottom: 0;
  1010. z-index: 99;
  1011. &.show {
  1012. display: block;
  1013. .mask {
  1014. animation: showPopup 0.2s linear both;
  1015. }
  1016. .layer {
  1017. animation: showLayer 0.2s linear both;
  1018. }
  1019. }
  1020. &.hide {
  1021. .mask {
  1022. animation: hidePopup 0.2s linear both;
  1023. }
  1024. .layer {
  1025. animation: hideLayer 0.2s linear both;
  1026. }
  1027. }
  1028. &.none {
  1029. display: none;
  1030. }
  1031. .mask {
  1032. position: fixed;
  1033. top: 0;
  1034. width: 100%;
  1035. height: 100%;
  1036. z-index: 1;
  1037. background-color: rgba(0, 0, 0, 0.4);
  1038. }
  1039. .layer {
  1040. position: fixed;
  1041. z-index: 99;
  1042. bottom: 0;
  1043. width: 100%;
  1044. min-height: 30vh;
  1045. border-radius: 10rpx 10rpx 0 0;
  1046. background-color: #fff;
  1047. .btn {
  1048. position: absolute;
  1049. bottom: 0;
  1050. width: 750rpx;
  1051. height: 98rpx;
  1052. background: #FE5B38;
  1053. line-height: 98rpx;
  1054. // background: $uni-color-primary;
  1055. font-size: $font-base + 2rpx;
  1056. color: #fff;
  1057. }
  1058. }
  1059. @keyframes showPopup {
  1060. 0% {
  1061. opacity: 0;
  1062. }
  1063. 100% {
  1064. opacity: 1;
  1065. }
  1066. }
  1067. @keyframes hidePopup {
  1068. 0% {
  1069. opacity: 1;
  1070. }
  1071. 100% {
  1072. opacity: 0;
  1073. }
  1074. }
  1075. @keyframes showLayer {
  1076. 0% {
  1077. transform: translateY(120%);
  1078. }
  1079. 100% {
  1080. transform: translateY(0%);
  1081. }
  1082. }
  1083. @keyframes hideLayer {
  1084. 0% {
  1085. transform: translateY(0);
  1086. }
  1087. 100% {
  1088. transform: translateY(120%);
  1089. }
  1090. }
  1091. }
  1092. /* 底部操作菜单 */
  1093. .page-bottom {
  1094. position: fixed;
  1095. left: 0rpx;
  1096. bottom: 0rpx;
  1097. z-index: 95;
  1098. display: flex;
  1099. justify-content: center;
  1100. align-items: center;
  1101. width: 750rpx;
  1102. height: 98rpx;
  1103. background: rgba(255, 255, 255, 0.9);
  1104. box-shadow: 0 0 20rpx 0 rgba(0, 0, 0, 0.5);
  1105. // border-radius: 16rpx;
  1106. .p-b-btn {
  1107. display: flex;
  1108. flex-direction: column;
  1109. align-items: center;
  1110. justify-content: center;
  1111. font-size: $font-sm;
  1112. color: $font-color-base;
  1113. width: 100rpx;
  1114. height: 98rpx;
  1115. .iconfont {
  1116. font-size: 40rpx;
  1117. line-height: 48rpx;
  1118. color: $font-color-light;
  1119. }
  1120. &.active,
  1121. &.active .iconfont {
  1122. color: $uni-color-primary;
  1123. }
  1124. .icon-fenxiang2 {
  1125. font-size: 42rpx;
  1126. transform: translateY(-2rpx);
  1127. }
  1128. .iconlikefill {
  1129. font-size: 46rpx;
  1130. }
  1131. }
  1132. .action-btn-group {
  1133. display: flex;
  1134. height: 98rpx;
  1135. overflow: hidden;
  1136. position: relative;
  1137. .shoucang {
  1138. width: 100rpx;
  1139. height: 100rpx;
  1140. background: #FFFFFF;
  1141. flex-direction: column;
  1142. justify-content: center;
  1143. font-size: 20rpx;
  1144. image {
  1145. width: 36rpx;
  1146. height: 35rpx;
  1147. margin-bottom: 10rpx;
  1148. }
  1149. }
  1150. .buy-now {
  1151. flex-grow: 1;
  1152. width: 650rpx;
  1153. display: flex;
  1154. }
  1155. .action-btn {
  1156. flex-shrink: 0;
  1157. flex-grow: 1;
  1158. display: flex;
  1159. align-items: center;
  1160. justify-content: center;
  1161. // width: 580rpx;
  1162. flex-grow: 1;
  1163. height: 100%;
  1164. font-size: 34rpx;
  1165. padding: 0;
  1166. border-radius: 0;
  1167. // background: transparent;
  1168. background: #ffb238;
  1169. &.buy-now-btn {
  1170. background-color: #ffb238;
  1171. }
  1172. &.add-cart-btn {
  1173. background: #FD3B39;
  1174. }
  1175. }
  1176. }
  1177. }
  1178. // 商店头
  1179. .shop-box {
  1180. background-color: #ffffff;
  1181. margin-top: 20rpx;
  1182. margin-bottom: 10rpx;
  1183. padding: 20rpx;
  1184. .shop-img {
  1185. border-radius: 300rpx;
  1186. height: 80rpx;
  1187. width: 80rpx;
  1188. margin-right: 20rpx;
  1189. }
  1190. .shop-button {
  1191. border-radius: 100rpx;
  1192. padding: 10rpx 20rpx;
  1193. color: $color-red;
  1194. border: 1px solid $color-red;
  1195. font-size: $font-lg;
  1196. line-height: 1;
  1197. }
  1198. }
  1199. .detail-centent {
  1200. img {
  1201. vertical-align: top;
  1202. }
  1203. }
  1204. /* 商品详情中限制图片大小 */
  1205. /deep/ .rich-img {
  1206. width: 100% !important;
  1207. height: auto;
  1208. vertical-align: top;
  1209. }
  1210. </style>