product.vue 28 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193
  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. if(obj.is_xf == 1) {
  361. obj.goodsNumberMax = 1
  362. }
  363. console.log(obj.goodIntegral,'obj.goodIntegral')
  364. // #ifdef H5
  365. obj.shareDate();
  366. // #endif
  367. });
  368. },
  369. // #ifdef H5
  370. // 加载微信html5页面分享方法
  371. shareDate() {
  372. let obj = this;
  373. // 保存分享人id链接
  374. let url = window.location.href + '&spread=' + this.userInfo.uid;
  375. // 判断是否微信浏览器
  376. let bool = uni.getStorageSync('weichatBrowser') || '';
  377. if (bool) {
  378. // 过滤微信强制添加的链接地址
  379. url = url.replace(/[\?,&]from=singlemessage/g, '');
  380. let data = {
  381. link: url, // 分享链接
  382. imgUrl: obj.goodsObjact.image, // 分享图标
  383. desc: obj.goodsObjact.store_info,
  384. title: obj.goodsObjact.store_name,
  385. success: function(e) {
  386. console.log(e);
  387. }
  388. };
  389. shareLoad(data);
  390. }
  391. },
  392. // #endif
  393. // 购买数量变化
  394. numberChange(e) {
  395. this.goodsNumber = e.number;
  396. },
  397. //规格弹窗开关
  398. toggleSpec(str) {
  399. if (this.specClass === 'show') {
  400. this.specClass = 'hide';
  401. setTimeout(() => {
  402. this.specClass = 'none';
  403. }, 250);
  404. } else if (this.specClass === 'none') {
  405. this.specClass = 'show';
  406. }
  407. // 保存当前购买类型
  408. this.type = str;
  409. },
  410. //选择规格
  411. selectSpec(item, arr, ind) {
  412. arr.attr_value.forEach(function(e) {
  413. e.check = false;
  414. });
  415. item.check = true;
  416. this.specSelected[ind] = item.attr;
  417. let str = this.specSelected.join(',');
  418. this.specSelectedName = this.specSelected.join(' ');
  419. if (this.productValue[str]) {
  420. let data = this.productValue[str];
  421. this.actionPrice = data.price;
  422. this.goodsNumberMax = data.stock;
  423. this.actionImage = data.image;
  424. this.uniqueId = data.unique;
  425. this.goodIntegral = data.integral
  426. console.log(this.goodIntegral,'xuanz')
  427. }
  428. if(this.is_xf == 1) {
  429. this.goodsNumberMax = 1
  430. }
  431. },
  432. //分享
  433. share() {
  434. this.$refs.share.toggleMask();
  435. },
  436. //收藏
  437. toFavorite(item) {
  438. let obj = this;
  439. item.userCollect = !item.userCollect;
  440. if (!item.userCollect) {
  441. collectDel({ id: obj.goodsid, category: 'product' }).then(function(e) {
  442. uni.showToast({
  443. title: '成功取消收藏',
  444. type: 'top',
  445. duration: 1500
  446. });
  447. });
  448. } else {
  449. collectAdd({ id: obj.goodsid, category: 'product' }).then(function(e) {
  450. uni.showToast({
  451. title: '成功加入收藏',
  452. type: 'top',
  453. duration: 1500
  454. });
  455. });
  456. }
  457. },
  458. // 立即购买
  459. buy() {
  460. let obj = this;
  461. let data = {
  462. cartNum: obj.goodsNumber, //商品数量
  463. uniqueId: obj.uniqueId, //商品标签
  464. new: '1', //商品是否新增加到购物车1为不加入0为加入
  465. mer_id: obj.shopId
  466. // type: 0,//0为余额支付 1为消费券支付 2为积分支付
  467. };
  468. if (obj.type == 2) {
  469. data.new = 0;
  470. }
  471. if (obj.goodsType == 0) {
  472. data.productId = obj.goodsid; //商品编号
  473. }
  474. // 判断是否为秒杀商品
  475. if (obj.goodsType == 1) {
  476. data.secKillId = obj.goodsid; //秒杀商品编号
  477. data.productId = obj.goodsObjact.product_id; //商品编号
  478. // 判断是否秒杀已经结束
  479. if (obj.seckillObj.stop) {
  480. uni.showModal({
  481. title: '提示',
  482. content: '当前活动已经结束',
  483. showCancel: false
  484. });
  485. return;
  486. }
  487. }
  488. // 判断是否为拼团商品
  489. if (obj.goodsType == 2) {
  490. data.combinationId = obj.goodsid; //拼团编号
  491. data.productId = obj.goodsObjact.product_id; //商品编号
  492. }
  493. cartAdd(data)
  494. .then(function({ data }) {
  495. if (obj.type == 1) {
  496. // 跳转到支付页
  497. uni.navigateTo({
  498. url: '/pages/order/createOrder?id=' + data.cartId + '&goodsType=' + obj.goodsType + '&is_xf=' + obj.is_xf + '&is_bk=' + obj.is_bk
  499. });
  500. }
  501. if (obj.type == 2) {
  502. uni.showToast({
  503. title: '成功加入购物车',
  504. type: 'top',
  505. duration: 2000
  506. });
  507. obj.toggleSpec();
  508. }
  509. })
  510. .catch(e => {
  511. console.log(e);
  512. });
  513. },
  514. stopPrevent() {}
  515. }
  516. };
  517. </script>
  518. <style lang="scss">
  519. page {
  520. background: $page-color-base;
  521. }
  522. //秒杀底部高度
  523. .seckillBottom {
  524. height: 110rpx;
  525. }
  526. // 文章页底部高度撑开
  527. .contentBottomHeight {
  528. height: 110rpx;
  529. }
  530. //默认商品底部高度
  531. .goodsBottom {
  532. height: 100rpx;
  533. }
  534. .iconenter {
  535. font-size: $font-base + 2rpx;
  536. color: #888;
  537. }
  538. .carousel {
  539. /* #ifdef APP-PLUS */
  540. padding-top: var(--status-bar-height);
  541. /* #endif */
  542. height: 722rpx;
  543. position: relative;
  544. swiper {
  545. height: 100%;
  546. }
  547. .image-wrapper {
  548. width: 100%;
  549. height: 100%;
  550. }
  551. .swiper-item {
  552. display: flex;
  553. justify-content: center;
  554. align-content: center;
  555. // height: 750rpx;
  556. height: 710rpx;
  557. overflow: hidden;
  558. image {
  559. width: 100%;
  560. height: 100%;
  561. }
  562. }
  563. }
  564. // 秒杀
  565. .seckill-box-title {
  566. background: linear-gradient(90deg, rgba(239, 78, 81, 1) 0%, rgba(244, 113, 59, 1) 100%) !important;
  567. .price,
  568. .price-tip,
  569. .timeStop,
  570. .m-price {
  571. color: #ffffff !important;
  572. }
  573. .price-tip {
  574. font-size: $font-base;
  575. }
  576. .price {
  577. font-size: 45rpx !important;
  578. font-weight: bold;
  579. }
  580. .timeStop {
  581. }
  582. }
  583. // 底部拼团、秒杀支付按钮
  584. .goods-pay-box {
  585. position: fixed;
  586. left: 0;
  587. bottom: 0;
  588. z-index: 95;
  589. width: 750rpx;
  590. height: 100rpx;
  591. line-height: 1;
  592. color: #ffffff;
  593. text-align: center;
  594. font-size: $font-lg;
  595. .bgLine {
  596. background: linear-gradient(90deg, rgba(239, 78, 81, 1) 0%, rgba(244, 113, 59, 1) 100%);
  597. }
  598. // 拼团支付按钮
  599. .goods-pay {
  600. display: flex;
  601. align-content: center;
  602. flex-wrap: wrap;
  603. justify-content: center;
  604. .goods-buttom,
  605. .goods-buttom-money {
  606. width: 100%;
  607. }
  608. .goods-buttom-money {
  609. font-size: $font-base;
  610. }
  611. }
  612. .goods-pay-stop,
  613. .goods-pay {
  614. padding: 15rpx 0;
  615. height: 100%;
  616. width: 100%;
  617. }
  618. .goods-pay-stop {
  619. background: $color-gray;
  620. line-height: 70rpx;
  621. }
  622. }
  623. /* 标题简介 */
  624. .introduce-section {
  625. background: #fff;
  626. padding: 20rpx 30rpx;
  627. .title {
  628. font-size: 32rpx;
  629. color: $font-color-dark;
  630. height: 50rpx;
  631. line-height: 50rpx;
  632. }
  633. .price-box {
  634. display: flex;
  635. align-items: baseline;
  636. height: 64rpx;
  637. padding: 10rpx 0;
  638. font-size: 26rpx;
  639. color: #FD3B39;
  640. }
  641. .price {
  642. font-size: $font-lg + 2rpx;
  643. }
  644. .m-price {
  645. margin: 0 12rpx;
  646. color: $font-color-light;
  647. text-decoration: line-through;
  648. }
  649. .pt {
  650. text-decoration:none;
  651. }
  652. .coupon-tip {
  653. align-items: center;
  654. padding: 4rpx 10rpx;
  655. background: $uni-color-primary;
  656. font-size: $font-sm;
  657. color: #fff;
  658. border-radius: 6rpx;
  659. line-height: 1;
  660. transform: translateY(-4rpx);
  661. }
  662. .bot-row {
  663. display: flex;
  664. align-items: center;
  665. height: 50rpx;
  666. font-size: $font-sm;
  667. color: $font-color-light;
  668. text {
  669. flex: 1;
  670. }
  671. }
  672. }
  673. /* 分享 */
  674. .share-section {
  675. display: flex;
  676. align-items: center;
  677. color: $font-color-base;
  678. background: linear-gradient(left, #fdf5f6, #fbebf6);
  679. padding: 12rpx 30rpx;
  680. .share-icon {
  681. display: flex;
  682. align-items: center;
  683. width: 70rpx;
  684. height: 30rpx;
  685. line-height: 1;
  686. border: 1px solid $uni-color-primary;
  687. border-radius: 4rpx;
  688. position: relative;
  689. overflow: hidden;
  690. font-size: 22rpx;
  691. color: $uni-color-primary;
  692. &:after {
  693. content: '';
  694. width: 50rpx;
  695. height: 50rpx;
  696. border-radius: 50%;
  697. left: -20rpx;
  698. top: -12rpx;
  699. position: absolute;
  700. background: $uni-color-primary;
  701. }
  702. }
  703. .iconfavorfill {
  704. position: relative;
  705. z-index: 1;
  706. font-size: 24rpx;
  707. margin-left: 2rpx;
  708. margin-right: 10rpx;
  709. color: #fff;
  710. line-height: 1;
  711. }
  712. .tit {
  713. font-size: $font-base;
  714. margin-left: 10rpx;
  715. }
  716. .iconprompt {
  717. padding: 10rpx;
  718. font-size: 30rpx;
  719. line-height: 1;
  720. }
  721. .share-btn {
  722. flex: 1;
  723. text-align: right;
  724. font-size: $font-sm;
  725. color: $uni-color-primary;
  726. }
  727. .iconenter {
  728. font-size: $font-sm;
  729. margin-left: 4rpx;
  730. color: $uni-color-primary;
  731. }
  732. }
  733. .c-list {
  734. margin-top: 20rpx;
  735. font-size: $font-sm + 2rpx;
  736. color: $font-color-base;
  737. background: #fff;
  738. .c-row {
  739. display: flex;
  740. align-items: center;
  741. padding: 20rpx 30rpx;
  742. position: relative;
  743. }
  744. .tit {
  745. width: 140rpx;
  746. }
  747. .con {
  748. flex: 1;
  749. color: $font-color-dark;
  750. .selected-text {
  751. margin-right: 10rpx;
  752. .num {
  753. color: #FD3B39;
  754. }
  755. }
  756. }
  757. .bz-list {
  758. height: 40rpx;
  759. font-size: $font-sm + 2rpx;
  760. color: $font-color-dark;
  761. text {
  762. display: inline-block;
  763. margin-right: 30rpx;
  764. }
  765. }
  766. .con-list {
  767. flex: 1;
  768. display: flex;
  769. flex-direction: column;
  770. color: $font-color-dark;
  771. line-height: 40rpx;
  772. }
  773. .red {
  774. color: $uni-color-primary;
  775. }
  776. }
  777. /* 评价 */
  778. .eva-section {
  779. display: flex;
  780. flex-direction: column;
  781. padding: 20rpx 30rpx;
  782. background: #fff;
  783. margin-top: 16rpx;
  784. .e-header {
  785. display: flex;
  786. align-items: center;
  787. height: 70rpx;
  788. font-size: $font-sm + 2rpx;
  789. color: $font-color-light;
  790. .tit {
  791. font-size: $font-base + 2rpx;
  792. color: $font-color-dark;
  793. margin-right: 4rpx;
  794. }
  795. .tip {
  796. flex: 1;
  797. text-align: right;
  798. }
  799. .iconenter {
  800. margin-left: 10rpx;
  801. }
  802. }
  803. }
  804. .eva-box {
  805. display: flex;
  806. padding: 20rpx 0;
  807. .portrait {
  808. flex-shrink: 0;
  809. width: 80rpx;
  810. height: 80rpx;
  811. border-radius: 100px;
  812. }
  813. .right {
  814. flex: 1;
  815. display: flex;
  816. flex-direction: column;
  817. font-size: $font-base;
  818. color: $font-color-base;
  819. padding-left: 26rpx;
  820. .con {
  821. font-size: $font-base;
  822. color: $font-color-dark;
  823. padding: 20rpx 0;
  824. }
  825. .bot {
  826. display: flex;
  827. justify-content: space-between;
  828. font-size: $font-sm;
  829. color: $font-color-light;
  830. }
  831. }
  832. }
  833. .eva-boxs {
  834. width: 100%;
  835. overflow: hidden;
  836. padding: 10px 28rpx;
  837. background: #f4f4f4;
  838. border-radius: 12rpx;
  839. font-size: $font-sm + 2rpx;
  840. color: #333;
  841. .portrait {
  842. flex-shrink: 0;
  843. width: 80rpx;
  844. height: 80rpx;
  845. border-radius: 100px;
  846. }
  847. .right {
  848. flex: 1;
  849. display: flex;
  850. flex-direction: column;
  851. font-size: $font-base;
  852. color: $font-color-base;
  853. .con {
  854. font-size: $font-base;
  855. color: $font-color-dark;
  856. }
  857. .bot {
  858. display: flex;
  859. justify-content: space-between;
  860. font-size: $font-sm;
  861. color: $font-color-light;
  862. }
  863. }
  864. }
  865. /* 详情 */
  866. .detail-desc {
  867. background: #fff;
  868. margin-top: 16rpx;
  869. /deep/ img {
  870. max-width: 100% !important;
  871. display: inline !important;
  872. }
  873. /deep/ div {
  874. max-width: 100% !important;
  875. }
  876. .d-header {
  877. display: flex;
  878. justify-content: center;
  879. align-items: center;
  880. height: 80rpx;
  881. font-size: $font-base + 2rpx;
  882. color: $font-color-dark;
  883. position: relative;
  884. text {
  885. padding: 0 20rpx;
  886. background: #fff;
  887. position: relative;
  888. z-index: 1;
  889. }
  890. &:after {
  891. position: absolute;
  892. left: 50%;
  893. top: 50%;
  894. transform: translateX(-50%);
  895. width: 300rpx;
  896. height: 0;
  897. content: '';
  898. border-bottom: 1px solid #ccc;
  899. }
  900. }
  901. }
  902. /* 规格选择弹窗 */
  903. .attr-content {
  904. padding: 10rpx 0 0;
  905. .a-t {
  906. padding: 0 30rpx;
  907. display: flex;
  908. image {
  909. width: 170rpx;
  910. height: 170rpx;
  911. flex-shrink: 0;
  912. border-radius: 8rpx;
  913. }
  914. .right {
  915. display: flex;
  916. flex-direction: column;
  917. padding-left: 24rpx;
  918. font-size: $font-sm + 2rpx;
  919. color: $font-color-base;
  920. line-height: 42rpx;
  921. .good-name {
  922. padding-top: 20rpx;
  923. max-width: 320rpx;
  924. font-size: 30rpx;
  925. font-family: PingFang SC;
  926. font-weight: bold;
  927. color: #1d2023;
  928. line-height: 42rpx;
  929. margin-bottom: 15rpx;
  930. }
  931. .price {
  932. font-size: 60rpx;
  933. font-family: PingFang SC;
  934. font-weight: bold;
  935. color: #ff6f0f;
  936. // font-size: $font-lg;
  937. // color: $uni-color-primary;
  938. // margin-bottom: 10rpx;
  939. }
  940. .selected-text {
  941. margin-right: 10rpx;
  942. }
  943. }
  944. }
  945. .attr-list {
  946. display: flex;
  947. flex-direction: column;
  948. font-size: $font-base + 2rpx;
  949. color: $font-color-base;
  950. padding-top: 30rpx;
  951. padding-left: 40rpx;
  952. padding-right: 30rpx;
  953. }
  954. .item-list {
  955. padding: 20rpx 0 0;
  956. display: flex;
  957. flex-wrap: wrap;
  958. .tit {
  959. display: flex;
  960. align-items: center;
  961. justify-content: center;
  962. background: #eee;
  963. // margin-left: 10rpx;
  964. margin-right: 20rpx;
  965. margin-bottom: 20rpx;
  966. border-radius: 100rpx;
  967. min-width: 60rpx;
  968. height: 60rpx;
  969. padding: 0 20rpx;
  970. font-size: $font-base;
  971. color: $font-color-dark;
  972. }
  973. .selected {
  974. background: #fbebee;
  975. color: $uni-color-primary;
  976. }
  977. }
  978. }
  979. /* 弹出层 */
  980. .popup {
  981. position: fixed;
  982. left: 0;
  983. top: 0;
  984. right: 0;
  985. bottom: 0;
  986. z-index: 99;
  987. &.show {
  988. display: block;
  989. .mask {
  990. animation: showPopup 0.2s linear both;
  991. }
  992. .layer {
  993. animation: showLayer 0.2s linear both;
  994. }
  995. }
  996. &.hide {
  997. .mask {
  998. animation: hidePopup 0.2s linear both;
  999. }
  1000. .layer {
  1001. animation: hideLayer 0.2s linear both;
  1002. }
  1003. }
  1004. &.none {
  1005. display: none;
  1006. }
  1007. .mask {
  1008. position: fixed;
  1009. top: 0;
  1010. width: 100%;
  1011. height: 100%;
  1012. z-index: 1;
  1013. background-color: rgba(0, 0, 0, 0.4);
  1014. }
  1015. .layer {
  1016. position: fixed;
  1017. z-index: 99;
  1018. bottom: 0;
  1019. width: 100%;
  1020. min-height: 30vh;
  1021. border-radius: 10rpx 10rpx 0 0;
  1022. background-color: #fff;
  1023. .btn {
  1024. position: absolute;
  1025. bottom: 0;
  1026. width: 750rpx;
  1027. height: 98rpx;
  1028. background: #FE5B38;
  1029. line-height: 98rpx;
  1030. // background: $uni-color-primary;
  1031. font-size: $font-base + 2rpx;
  1032. color: #fff;
  1033. }
  1034. }
  1035. @keyframes showPopup {
  1036. 0% {
  1037. opacity: 0;
  1038. }
  1039. 100% {
  1040. opacity: 1;
  1041. }
  1042. }
  1043. @keyframes hidePopup {
  1044. 0% {
  1045. opacity: 1;
  1046. }
  1047. 100% {
  1048. opacity: 0;
  1049. }
  1050. }
  1051. @keyframes showLayer {
  1052. 0% {
  1053. transform: translateY(120%);
  1054. }
  1055. 100% {
  1056. transform: translateY(0%);
  1057. }
  1058. }
  1059. @keyframes hideLayer {
  1060. 0% {
  1061. transform: translateY(0);
  1062. }
  1063. 100% {
  1064. transform: translateY(120%);
  1065. }
  1066. }
  1067. }
  1068. /* 底部操作菜单 */
  1069. .page-bottom {
  1070. position: fixed;
  1071. left: 0rpx;
  1072. bottom: 0rpx;
  1073. z-index: 95;
  1074. display: flex;
  1075. justify-content: center;
  1076. align-items: center;
  1077. width: 750rpx;
  1078. height: 98rpx;
  1079. background: rgba(255, 255, 255, 0.9);
  1080. box-shadow: 0 0 20rpx 0 rgba(0, 0, 0, 0.5);
  1081. // border-radius: 16rpx;
  1082. .p-b-btn {
  1083. display: flex;
  1084. flex-direction: column;
  1085. align-items: center;
  1086. justify-content: center;
  1087. font-size: $font-sm;
  1088. color: $font-color-base;
  1089. width: 100rpx;
  1090. height: 98rpx;
  1091. .iconfont {
  1092. font-size: 40rpx;
  1093. line-height: 48rpx;
  1094. color: $font-color-light;
  1095. }
  1096. &.active,
  1097. &.active .iconfont {
  1098. color: $uni-color-primary;
  1099. }
  1100. .icon-fenxiang2 {
  1101. font-size: 42rpx;
  1102. transform: translateY(-2rpx);
  1103. }
  1104. .iconlikefill {
  1105. font-size: 46rpx;
  1106. }
  1107. }
  1108. .action-btn-group {
  1109. display: flex;
  1110. height: 98rpx;
  1111. overflow: hidden;
  1112. position: relative;
  1113. .shoucang {
  1114. width: 170rpx;
  1115. height: 100rpx;
  1116. background: #FFFFFF;
  1117. flex-direction: column;
  1118. justify-content: center;
  1119. image {
  1120. width: 36rpx;
  1121. height: 35rpx;
  1122. }
  1123. }
  1124. .buy-now {
  1125. flex-grow: 1;
  1126. width: 580rpx;
  1127. display: flex;
  1128. }
  1129. .action-btn {
  1130. flex-shrink: 0;
  1131. flex-grow: 1;
  1132. display: flex;
  1133. align-items: center;
  1134. justify-content: center;
  1135. // width: 580rpx;
  1136. flex-grow: 1;
  1137. height: 100%;
  1138. font-size: 34rpx;
  1139. padding: 0;
  1140. border-radius: 0;
  1141. // background: transparent;
  1142. background: #ffb238;
  1143. &.buy-now-btn {
  1144. background-color: #ffb238;
  1145. }
  1146. &.add-cart-btn {
  1147. background: #FD3B39;
  1148. }
  1149. }
  1150. }
  1151. }
  1152. // 商店头
  1153. .shop-box {
  1154. background-color: #ffffff;
  1155. margin-top: 20rpx;
  1156. margin-bottom: 10rpx;
  1157. padding: 20rpx;
  1158. .shop-img {
  1159. border-radius: 300rpx;
  1160. height: 80rpx;
  1161. width: 80rpx;
  1162. margin-right: 20rpx;
  1163. }
  1164. .shop-button {
  1165. border-radius: 100rpx;
  1166. padding: 10rpx 20rpx;
  1167. color: $color-red;
  1168. border: 1px solid $color-red;
  1169. font-size: $font-lg;
  1170. line-height: 1;
  1171. }
  1172. }
  1173. .detail-centent {
  1174. img {
  1175. vertical-align: top;
  1176. }
  1177. }
  1178. </style>