detail.vue 28 KB

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