product.vue 27 KB

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