product.vue 28 KB

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