product.vue 28 KB

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