product.vue 27 KB

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