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