product.vue 28 KB

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