product.vue 27 KB

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