product.vue 27 KB

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