product.vue 29 KB

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