product.vue 26 KB

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