product.vue 28 KB

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