product.vue 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308
  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">加入购物车</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. is_zero: obj.goodsObjact.is_zero
  459. // type: 0,//0为余额支付 1为消费券支付 2为积分支付
  460. };
  461. if (obj.type == 2) {
  462. data.new = 0;
  463. }
  464. if (obj.goodsType == 0) {
  465. data.productId = obj.goodsid; //商品编号
  466. }
  467. // 判断是否为秒杀商品
  468. if (obj.goodsType == 1) {
  469. data.secKillId = obj.goodsid; //秒杀商品编号
  470. data.productId = obj.goodsObjact.product_id; //商品编号
  471. // 判断是否秒杀已经结束
  472. if (obj.seckillObj.stop) {
  473. uni.showModal({
  474. title: '提示',
  475. content: '当前活动已经结束',
  476. showCancel: false
  477. });
  478. return;
  479. }
  480. }
  481. // 判断是否为拼团商品
  482. if (obj.goodsType == 2) {
  483. data.combinationId = obj.goodsid; //拼团编号
  484. data.productId = obj.goodsObjact.product_id; //商品编号
  485. }
  486. cartAdd(data)
  487. .then(function({
  488. data
  489. }) {
  490. if (obj.type == 1) {
  491. // 跳转到支付页
  492. uni.navigateTo({
  493. url: '/pages/order/createOrder?id=' + data.cartId + '&goodsType=' + obj
  494. .goodsType + '&is_pack=' + obj.goodsObjact.is_pack + '&affiliation_uid=' +
  495. obj.goodsObjact.affiliation_uid + '&is_zero=' + obj.goodsObjact.is_zero
  496. });
  497. }
  498. if (obj.type == 2) {
  499. uni.showToast({
  500. title: '成功加入购物车',
  501. type: 'top',
  502. duration: 2000
  503. });
  504. obj.toggleSpec();
  505. }
  506. })
  507. .catch(e => {
  508. console.log(e);
  509. });
  510. },
  511. stopPrevent() {}
  512. }
  513. };
  514. </script>
  515. <style lang="scss">
  516. page {
  517. background: $page-color-base;
  518. }
  519. //秒杀底部高度
  520. .seckillBottom {
  521. height: 110rpx;
  522. }
  523. // 文章页底部高度撑开
  524. .contentBottomHeight {
  525. height: 110rpx;
  526. }
  527. //默认商品底部高度
  528. .goodsBottom {
  529. height: 100rpx;
  530. }
  531. .iconenter {
  532. font-size: $font-base + 2rpx;
  533. color: #888;
  534. }
  535. .carousel {
  536. /* #ifdef APP-PLUS */
  537. padding-top: var(--status-bar-height);
  538. /* #endif */
  539. height: 722rpx;
  540. position: relative;
  541. swiper {
  542. height: 100%;
  543. }
  544. .image-wrapper {
  545. width: 100%;
  546. height: 100%;
  547. }
  548. .swiper-item {
  549. display: flex;
  550. justify-content: center;
  551. align-content: center;
  552. // height: 750rpx;
  553. height: 710rpx;
  554. overflow: hidden;
  555. image {
  556. width: 100%;
  557. height: 100%;
  558. }
  559. }
  560. }
  561. // 秒杀
  562. .seckill-box-title {
  563. background: linear-gradient(90deg, rgba(239, 78, 81, 1) 0%, rgba(244, 113, 59, 1) 100%) !important;
  564. .price,
  565. .price-tip,
  566. .timeStop,
  567. .m-price {
  568. color: #ffffff !important;
  569. }
  570. .price-tip {
  571. font-size: $font-base;
  572. }
  573. .price {
  574. font-size: 45rpx !important;
  575. font-weight: bold;
  576. }
  577. .timeStop {}
  578. }
  579. // 底部拼团、秒杀支付按钮
  580. .goods-pay-box {
  581. position: fixed;
  582. left: 0;
  583. bottom: 0;
  584. z-index: 95;
  585. width: 750rpx;
  586. height: 100rpx;
  587. line-height: 1;
  588. color: #ffffff;
  589. text-align: center;
  590. font-size: $font-lg;
  591. .bgLine {
  592. background: linear-gradient(90deg, rgba(239, 78, 81, 1) 0%, rgba(244, 113, 59, 1) 100%);
  593. }
  594. // 拼团支付按钮
  595. .goods-pay {
  596. display: flex;
  597. align-content: center;
  598. flex-wrap: wrap;
  599. justify-content: center;
  600. .goods-buttom,
  601. .goods-buttom-money {
  602. width: 100%;
  603. }
  604. .goods-buttom-money {
  605. font-size: $font-base;
  606. }
  607. }
  608. .goods-pay-stop,
  609. .goods-pay {
  610. padding: 15rpx 0;
  611. height: 100%;
  612. width: 100%;
  613. }
  614. .goods-pay-stop {
  615. background: $color-gray;
  616. line-height: 70rpx;
  617. }
  618. }
  619. /* 标题简介 */
  620. .introduce-section {
  621. background: #fff;
  622. padding: 20rpx 30rpx;
  623. .title {
  624. font-size: 32rpx;
  625. color: $font-color-dark;
  626. height: 50rpx;
  627. line-height: 50rpx;
  628. }
  629. .price-box {
  630. display: flex;
  631. align-items: baseline;
  632. height: 64rpx;
  633. padding: 10rpx 0;
  634. font-size: 26rpx;
  635. color: #FD3B39;
  636. }
  637. .price {
  638. font-size: $font-lg + 2rpx;
  639. }
  640. .m-price {
  641. margin: 0 12rpx;
  642. color: $font-color-light;
  643. // text-decoration: line-through;
  644. }
  645. .pt {
  646. text-decoration: none;
  647. }
  648. .coupon-tip {
  649. align-items: center;
  650. padding: 4rpx 10rpx;
  651. background: $uni-color-primary;
  652. font-size: $font-sm;
  653. color: #fff;
  654. border-radius: 6rpx;
  655. line-height: 1;
  656. transform: translateY(-4rpx);
  657. }
  658. .bot-row {
  659. display: flex;
  660. align-items: center;
  661. height: 50rpx;
  662. font-size: $font-sm;
  663. color: $font-color-light;
  664. text {
  665. flex: 1;
  666. }
  667. }
  668. }
  669. /* 分享 */
  670. .share-section {
  671. display: flex;
  672. align-items: center;
  673. color: $font-color-base;
  674. background: linear-gradient(left, #fdf5f6, #fbebf6);
  675. padding: 12rpx 30rpx;
  676. .share-icon {
  677. display: flex;
  678. align-items: center;
  679. width: 70rpx;
  680. height: 30rpx;
  681. line-height: 1;
  682. border: 1px solid $uni-color-primary;
  683. border-radius: 4rpx;
  684. position: relative;
  685. overflow: hidden;
  686. font-size: 22rpx;
  687. color: $uni-color-primary;
  688. &:after {
  689. content: '';
  690. width: 50rpx;
  691. height: 50rpx;
  692. border-radius: 50%;
  693. left: -20rpx;
  694. top: -12rpx;
  695. position: absolute;
  696. background: $uni-color-primary;
  697. }
  698. }
  699. .iconfavorfill {
  700. position: relative;
  701. z-index: 1;
  702. font-size: 24rpx;
  703. margin-left: 2rpx;
  704. margin-right: 10rpx;
  705. color: #fff;
  706. line-height: 1;
  707. }
  708. .tit {
  709. font-size: $font-base;
  710. margin-left: 10rpx;
  711. }
  712. .iconprompt {
  713. padding: 10rpx;
  714. font-size: 30rpx;
  715. line-height: 1;
  716. }
  717. .share-btn {
  718. flex: 1;
  719. text-align: right;
  720. font-size: $font-sm;
  721. color: $uni-color-primary;
  722. }
  723. .iconenter {
  724. font-size: $font-sm;
  725. margin-left: 4rpx;
  726. color: $uni-color-primary;
  727. }
  728. }
  729. .c-list {
  730. margin-top: 20rpx;
  731. font-size: $font-sm + 2rpx;
  732. color: $font-color-base;
  733. background: #fff;
  734. .c-row {
  735. display: flex;
  736. align-items: center;
  737. padding: 20rpx 30rpx;
  738. position: relative;
  739. }
  740. .tit {
  741. width: 140rpx;
  742. }
  743. .con {
  744. flex: 1;
  745. color: $font-color-dark;
  746. .selected-text {
  747. margin-right: 10rpx;
  748. .num {
  749. color: #FD3B39;
  750. }
  751. }
  752. }
  753. .bz-list {
  754. height: 40rpx;
  755. font-size: $font-sm + 2rpx;
  756. color: $font-color-dark;
  757. text {
  758. display: inline-block;
  759. margin-right: 30rpx;
  760. }
  761. }
  762. .con-list {
  763. flex: 1;
  764. display: flex;
  765. flex-direction: column;
  766. color: $font-color-dark;
  767. line-height: 40rpx;
  768. }
  769. .red {
  770. color: $uni-color-primary;
  771. }
  772. }
  773. /* 评价 */
  774. .eva-section {
  775. display: flex;
  776. flex-direction: column;
  777. padding: 20rpx 30rpx;
  778. background: #fff;
  779. margin-top: 16rpx;
  780. .e-header {
  781. display: flex;
  782. align-items: center;
  783. height: 70rpx;
  784. font-size: $font-sm + 2rpx;
  785. color: $font-color-light;
  786. .tit {
  787. font-size: $font-base + 2rpx;
  788. color: $font-color-dark;
  789. margin-right: 4rpx;
  790. }
  791. .tip {
  792. flex: 1;
  793. text-align: right;
  794. }
  795. .iconenter {
  796. margin-left: 10rpx;
  797. }
  798. }
  799. }
  800. .eva-box {
  801. display: flex;
  802. padding: 20rpx 0;
  803. .portrait {
  804. flex-shrink: 0;
  805. width: 80rpx;
  806. height: 80rpx;
  807. border-radius: 100px;
  808. }
  809. .right {
  810. flex: 1;
  811. display: flex;
  812. flex-direction: column;
  813. font-size: $font-base;
  814. color: $font-color-base;
  815. padding-left: 26rpx;
  816. .con {
  817. font-size: $font-base;
  818. color: $font-color-dark;
  819. padding: 20rpx 0;
  820. }
  821. .bot {
  822. display: flex;
  823. justify-content: space-between;
  824. font-size: $font-sm;
  825. color: $font-color-light;
  826. }
  827. }
  828. }
  829. .eva-boxs {
  830. width: 100%;
  831. overflow: hidden;
  832. padding: 10px 28rpx;
  833. background: #f4f4f4;
  834. border-radius: 12rpx;
  835. font-size: $font-sm + 2rpx;
  836. color: #333;
  837. .portrait {
  838. flex-shrink: 0;
  839. width: 80rpx;
  840. height: 80rpx;
  841. border-radius: 100px;
  842. }
  843. .right {
  844. flex: 1;
  845. display: flex;
  846. flex-direction: column;
  847. font-size: $font-base;
  848. color: $font-color-base;
  849. .con {
  850. font-size: $font-base;
  851. color: $font-color-dark;
  852. }
  853. .bot {
  854. display: flex;
  855. justify-content: space-between;
  856. font-size: $font-sm;
  857. color: $font-color-light;
  858. }
  859. }
  860. }
  861. /* 详情 */
  862. .detail-desc {
  863. background: #fff;
  864. margin-top: 16rpx;
  865. /deep/ img {
  866. max-width: 100% !important;
  867. display: inline !important;
  868. }
  869. /deep/ div {
  870. max-width: 100% !important;
  871. }
  872. .d-header {
  873. display: flex;
  874. justify-content: center;
  875. align-items: center;
  876. height: 80rpx;
  877. font-size: $font-base + 2rpx;
  878. color: $font-color-dark;
  879. position: relative;
  880. text {
  881. padding: 0 20rpx;
  882. background: #fff;
  883. position: relative;
  884. z-index: 1;
  885. }
  886. &:after {
  887. position: absolute;
  888. left: 50%;
  889. top: 50%;
  890. transform: translateX(-50%);
  891. width: 300rpx;
  892. height: 0;
  893. content: '';
  894. border-bottom: 1px solid #ccc;
  895. }
  896. }
  897. }
  898. /* 规格选择弹窗 */
  899. .attr-content {
  900. padding: 10rpx 0 0;
  901. .a-t {
  902. padding: 0 30rpx;
  903. display: flex;
  904. image {
  905. width: 170rpx;
  906. height: 170rpx;
  907. flex-shrink: 0;
  908. border-radius: 8rpx;
  909. }
  910. .right {
  911. display: flex;
  912. flex-direction: column;
  913. padding-left: 24rpx;
  914. font-size: $font-sm + 2rpx;
  915. color: $font-color-base;
  916. line-height: 42rpx;
  917. .good-name {
  918. padding-top: 20rpx;
  919. max-width: 320rpx;
  920. font-size: 30rpx;
  921. font-family: PingFang SC;
  922. font-weight: bold;
  923. color: #1d2023;
  924. line-height: 42rpx;
  925. margin-bottom: 15rpx;
  926. }
  927. .price {
  928. font-size: 60rpx;
  929. font-family: PingFang SC;
  930. font-weight: bold;
  931. color: #ff6f0f;
  932. // font-size: $font-lg;
  933. // color: $uni-color-primary;
  934. // margin-bottom: 10rpx;
  935. }
  936. .selected-text {
  937. margin-right: 10rpx;
  938. }
  939. }
  940. }
  941. .attr-list {
  942. display: flex;
  943. flex-direction: column;
  944. font-size: $font-base + 2rpx;
  945. color: $font-color-base;
  946. padding-top: 30rpx;
  947. padding-left: 40rpx;
  948. padding-right: 30rpx;
  949. }
  950. .item-list {
  951. padding: 20rpx 0 0;
  952. display: flex;
  953. flex-wrap: wrap;
  954. .tit {
  955. display: flex;
  956. align-items: center;
  957. justify-content: center;
  958. background: #eee;
  959. // margin-left: 10rpx;
  960. margin-right: 20rpx;
  961. margin-bottom: 20rpx;
  962. border-radius: 100rpx;
  963. min-width: 60rpx;
  964. height: 60rpx;
  965. padding: 0 20rpx;
  966. font-size: $font-base;
  967. color: $font-color-dark;
  968. }
  969. .selected {
  970. background: #fbebee;
  971. color: $uni-color-primary;
  972. }
  973. }
  974. }
  975. /* 弹出层 */
  976. .popup {
  977. position: fixed;
  978. left: 0;
  979. top: 0;
  980. right: 0;
  981. bottom: 0;
  982. z-index: 99;
  983. &.show {
  984. display: block;
  985. .mask {
  986. animation: showPopup 0.2s linear both;
  987. }
  988. .layer {
  989. animation: showLayer 0.2s linear both;
  990. }
  991. }
  992. &.hide {
  993. .mask {
  994. animation: hidePopup 0.2s linear both;
  995. }
  996. .layer {
  997. animation: hideLayer 0.2s linear both;
  998. }
  999. }
  1000. &.none {
  1001. display: none;
  1002. }
  1003. .mask {
  1004. position: fixed;
  1005. top: 0;
  1006. width: 100%;
  1007. height: 100%;
  1008. z-index: 1;
  1009. background-color: rgba(0, 0, 0, 0.4);
  1010. }
  1011. .layer {
  1012. position: fixed;
  1013. z-index: 99;
  1014. bottom: 0;
  1015. width: 100%;
  1016. min-height: 30vh;
  1017. border-radius: 10rpx 10rpx 0 0;
  1018. background-color: #fff;
  1019. .btn {
  1020. position: absolute;
  1021. bottom: 0;
  1022. width: 750rpx;
  1023. height: 98rpx;
  1024. background: #FE5B38;
  1025. line-height: 98rpx;
  1026. // background: $uni-color-primary;
  1027. font-size: $font-base + 2rpx;
  1028. color: #fff;
  1029. }
  1030. }
  1031. @keyframes showPopup {
  1032. 0% {
  1033. opacity: 0;
  1034. }
  1035. 100% {
  1036. opacity: 1;
  1037. }
  1038. }
  1039. @keyframes hidePopup {
  1040. 0% {
  1041. opacity: 1;
  1042. }
  1043. 100% {
  1044. opacity: 0;
  1045. }
  1046. }
  1047. @keyframes showLayer {
  1048. 0% {
  1049. transform: translateY(120%);
  1050. }
  1051. 100% {
  1052. transform: translateY(0%);
  1053. }
  1054. }
  1055. @keyframes hideLayer {
  1056. 0% {
  1057. transform: translateY(0);
  1058. }
  1059. 100% {
  1060. transform: translateY(120%);
  1061. }
  1062. }
  1063. }
  1064. /* 底部操作菜单 */
  1065. .page-bottom {
  1066. position: fixed;
  1067. left: 0rpx;
  1068. bottom: 0rpx;
  1069. z-index: 95;
  1070. display: flex;
  1071. justify-content: center;
  1072. align-items: center;
  1073. width: 750rpx;
  1074. height: 98rpx;
  1075. background: rgba(255, 255, 255, 0.9);
  1076. box-shadow: 0 0 20rpx 0 rgba(0, 0, 0, 0.5);
  1077. // border-radius: 16rpx;
  1078. .p-b-btn {
  1079. display: flex;
  1080. flex-direction: column;
  1081. align-items: center;
  1082. justify-content: center;
  1083. font-size: $font-sm;
  1084. color: $font-color-base;
  1085. width: 100rpx;
  1086. height: 98rpx;
  1087. .iconfont {
  1088. font-size: 40rpx;
  1089. line-height: 48rpx;
  1090. color: $font-color-light;
  1091. }
  1092. &.active,
  1093. &.active .iconfont {
  1094. color: $uni-color-primary;
  1095. }
  1096. .icon-fenxiang2 {
  1097. font-size: 42rpx;
  1098. transform: translateY(-2rpx);
  1099. }
  1100. .iconlikefill {
  1101. font-size: 46rpx;
  1102. }
  1103. }
  1104. .action-btn-group {
  1105. display: flex;
  1106. height: 98rpx;
  1107. overflow: hidden;
  1108. position: relative;
  1109. .shoucang {
  1110. width: 100rpx;
  1111. height: 100rpx;
  1112. background: #FFFFFF;
  1113. flex-direction: column;
  1114. justify-content: center;
  1115. font-size: 20rpx;
  1116. image {
  1117. width: 36rpx;
  1118. height: 35rpx;
  1119. margin-bottom: 10rpx;
  1120. }
  1121. }
  1122. .buy-now {
  1123. flex-grow: 1;
  1124. // width: 650rpx;
  1125. width: 750rpx;
  1126. display: flex;
  1127. }
  1128. .action-btn {
  1129. flex-shrink: 0;
  1130. flex-grow: 1;
  1131. display: flex;
  1132. align-items: center;
  1133. justify-content: center;
  1134. // width: 580rpx;
  1135. flex-grow: 1;
  1136. height: 100%;
  1137. font-size: 34rpx;
  1138. padding: 0;
  1139. border-radius: 0;
  1140. // background: transparent;
  1141. background: #ffb238;
  1142. &.buy-now-btn {
  1143. background-color: #ffb238;
  1144. }
  1145. &.add-cart-btn {
  1146. background: #FD3B39;
  1147. }
  1148. }
  1149. }
  1150. }
  1151. // 商店头
  1152. .shop-box {
  1153. background-color: #ffffff;
  1154. margin-top: 20rpx;
  1155. margin-bottom: 10rpx;
  1156. padding: 20rpx;
  1157. .shop-img {
  1158. border-radius: 300rpx;
  1159. height: 80rpx;
  1160. width: 80rpx;
  1161. margin-right: 20rpx;
  1162. }
  1163. .shop-button {
  1164. border-radius: 100rpx;
  1165. padding: 10rpx 20rpx;
  1166. color: $color-red;
  1167. border: 1px solid $color-red;
  1168. font-size: $font-lg;
  1169. line-height: 1;
  1170. }
  1171. }
  1172. .detail-centent {
  1173. img {
  1174. vertical-align: top;
  1175. }
  1176. }
  1177. /* 商品详情中限制图片大小 */
  1178. /deep/ .rich-img {
  1179. width: 100% !important;
  1180. height: auto;
  1181. }
  1182. </style>