product.vue 27 KB

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