product.vue 26 KB

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