product.vue 28 KB

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