product.vue 27 KB

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