product.vue 26 KB

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