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