product.vue 28 KB

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