product.vue 26 KB

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