vipProduct.vue 25 KB

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