product.vue 28 KB

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