product.vue 26 KB

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