shop.vue 26 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105
  1. <template>
  2. <view class="container">
  3. <scroll-view style="height: 100vh;" class="floor-list"
  4. :scroll-top="scrollTop" scroll-y="true" @scroll="scroll" @scrolltoupper="upper" @scrolltolower="lower"
  5. refresher-enabled="true">
  6. <view class="carousel">
  7. <swiper indicator-dots circular=true duration="400">
  8. <swiper-item class="swiper-item" v-for="(item,index) in datalist.images" :key="index">
  9. <view class="image-wrapper">
  10. <image
  11. :src="pictureUrl+'/uploads/home/adv/'+item.goodsimage_url"
  12. class="loaded"
  13. mode="aspectFill"
  14. ></image>
  15. </view>
  16. </swiper-item>
  17. </swiper>
  18. </view>
  19. <view class="introduce-section">
  20. <view class="titleLayout" >
  21. <view class="title">{{datalist.goods_name}}</view>
  22. <view @tap="shopDetail" style="display: flex;flex-direction: row;">
  23. <view class="titleRight">
  24. <view style="font-size: 36upx;color: #D9332E;text-align: right;">{{datalist.praise}}%</view>
  25. <view style="color: #606266;font-size: 28upx;">好评率</view>
  26. </view>
  27. <view style="display: flex;align-items: center;">
  28. <uni-icon size="18" type="arrowright"></uni-icon>
  29. </view>
  30. </view>
  31. </view>
  32. <view style="color: #909399;padding: 10upx 0 15upx 0;" v-if="datalist.points>0">购买得{{datalist.points}}圈币</view>
  33. <view class="titleLayout price-box">
  34. <view>
  35. <text class="price-tip">¥</text>
  36. <text class="price">{{datalist.goods_price}}</text>
  37. <text class="m-price">¥{{datalist.goods_marketprice}}</text>
  38. <text class="price-tip" v-if="datalist.goods_storage == 0">已下架</text>
  39. </view>
  40. <view>
  41. <text style="color: #909399">月销售{{datalist.sale_number}}</text>
  42. </view>
  43. </view>
  44. </view>
  45. <view class="c-list">
  46. <view style="display: flex;justify-content: space-between;" class="c-row b-b" @click="toggleSpec">
  47. <view style="font-size: 32upx;color: #909399;">规则数量选择</view>
  48. <view>
  49. <uni-icon size="20" type="arrowright"></uni-icon>
  50. </view>
  51. </view>
  52. </view>
  53. <!-- 评价 -->
  54. <view @tap="shopDetail" style="border-bottom: 20rpx solid #F5F5F5;" class="eva-section">
  55. <view style="display: flex;justify-content: space-between;" class="c-row b-b">
  56. <view style="font-size: 32upx;color: #909399;">评价</view>
  57. <view>
  58. <uni-icon size="20" type="arrowright"></uni-icon>
  59. </view>
  60. </view>
  61. <assess />
  62. </view>
  63. <!-- :class="iScrolltop == 2?'activeColor' : ''" -->
  64. <view class="detail-desc" >
  65. <van-tabs v-model="active" @click="onChange">
  66. <van-tab :name="0" title="详情">
  67. <view style="padding: 0 32upx;">
  68. <rich-text :nodes="datalist.goods_body"></rich-text>
  69. </view>
  70. </van-tab>
  71. <van-tab :name="1" title="常见问题">
  72. <view style="padding: 0 32upx;">
  73. <rich-text :nodes="datalist.issue"></rich-text>
  74. </view>
  75. </van-tab>
  76. </van-tabs>
  77. </view>
  78. <!-- 底部操作菜单 -->
  79. <!-- <view class="page-bottom">
  80. <navigator url="/pages/index/index" open-type="switchTab" class="p-b-btn">
  81. <text class="yticon icon-xiatubiao--copy"></text>
  82. <text>首页</text>
  83. </navigator>
  84. <navigator url="/pages/index/cart" open-type="navigate" class="p-b-btn">
  85. <text class="yticon icon-gouwuche"></text>
  86. <text>购物车</text>
  87. </navigator>
  88. <view class="p-b-btn" :class="{active: favorite}" @click="toFavorite">
  89. <text class="yticon icon-shoucang"></text>
  90. <text>收藏</text>
  91. </view>
  92. <view class="action-btn-group">
  93. <button type="primary" @click="openCar" class=" action-btn no-border add-cart-btn">加入购物车</button>
  94. <button type="primary" class=" action-btn no-border buy-now-btn" @click="buy">立即购买</button>
  95. </view>
  96. </view> -->
  97. <View class="page-bottom">
  98. <van-goods-action>
  99. <van-goods-action-icon @click="goIndex" icon="bag-o" />
  100. <van-goods-action-icon icon="cart-o" @click="openCar" :info="cartnumber" />
  101. <van-goods-action-icon icon="star-o" v-if="has_collected == 0" @click="toFavorite"/>
  102. <van-goods-action-icon icon="star" v-if="has_collected == 1" icon-class="colored" @click="toFavorite"/>
  103. <van-goods-action-button @click="addCar" text="加入购物车" type="warning" />
  104. <van-goods-action-button text="立即购买" @click="buynow" />
  105. </van-goods-action>
  106. </View>
  107. <!-- 规格-模态层弹窗 -->
  108. <view
  109. class="popup spec"
  110. :class="specClass"
  111. @touchmove.stop.prevent="stopPrevent"
  112. @click="toggleSpec"
  113. >
  114. <!-- 遮罩层 -->
  115. <view class="mask"></view>
  116. <view class="layer attr-content" @click.stop="stopPrevent">
  117. <view class="a-t">
  118. <image :src="nuberImg"></image>
  119. <view class="right">
  120. <text class="price" style="font-size: 36upx;color: #303133">{{datalist.goods_price}}</text>
  121. <view v-if="datalist.spec_list.length > 0 ">
  122. <view class="selected" v-if="specSelected.length > 0 ">
  123. <text class="selected-text" v-for="(sItem, sIndex) in specSelected" :key="sIndex">
  124. {{sItem.value_name}}X {{shopnumber}}
  125. </text>
  126. </view>
  127. <view class="selected" v-else>
  128. <text class="selected-text">
  129. 请选择规格数量
  130. </text>
  131. </view>
  132. </view>
  133. <view v-else>
  134. X {{shopnumber}}
  135. </view>
  136. </view>
  137. <view @click="closeCar" style="position: absolute;right: 10%;">
  138. <uni-icon size="20" type="close"></uni-icon>
  139. </view>
  140. </view>
  141. <view v-for="(item,index) in datalist.spec_list" :key="index" class="attr-list">
  142. <text>{{item.spec_name}}</text>
  143. <view class="item-list">
  144. <!-- v-if="childItem.pid === item.id" -->
  145. <text
  146. v-for="(childItem, childIndex) in item.value_list"
  147. :key="childIndex" class="tit"
  148. :class="{selected: childItem.selected, disabled: childItem.goods_storage==0}"
  149. @click="selectSpec(index, childItem.value_id, childItem.value_name, childItem.goods_storage)"
  150. >
  151. {{childItem.value_name}}
  152. </text>
  153. </view>
  154. </view>
  155. <view class="numberchange">
  156. <span>数量</span>
  157. <uninumberbox :max="goods_storage" :min="1" @change="changestorage"/>
  158. </view>
  159. </view>
  160. </view>
  161. <!-- 分享 -->
  162. <!-- <share
  163. ref="share"
  164. :contentHeight="580"
  165. :shareList="shareList"
  166. ></share> -->
  167. </scroll-view>
  168. <logionDialog @confirmDiaolog="confirmDiaolog" @cancelDiaolog="cancelDiaolog" :showdialog="showdialog"/>
  169. </view>
  170. </template>
  171. <script>
  172. import {
  173. mapMutations,mapState
  174. } from 'vuex'
  175. import logionDialog from '@/component/loginDialog.vue'
  176. import uninumberbox from '@/component/uinNumber.vue'
  177. import assess from '@/component/assess.vue' // 评价列表
  178. import uniIcon from '@/component/uni-icon/uni-icon.vue'
  179. export default{
  180. components: {
  181. uniIcon,
  182. assess,
  183. uninumberbox,
  184. logionDialog
  185. },
  186. data() {
  187. return {
  188. arrayId:[],
  189. scopemapId: 0,
  190. showdialog: false,
  191. has_collected: false, // 是否收藏
  192. cartnumber: 0, // 购物车数量
  193. changnumber: 100,
  194. ismax: false, // 输入狂禁止数量
  195. goods_storage: '', // 规格商品参数
  196. nuberImg:'',
  197. shopnumber: 1,
  198. pictureUrl: this.pictureUrl,
  199. datalist: {},
  200. store_id: 0, // 酒店id
  201. goodId: 0, // 商品公共id
  202. goods_id: 0, // 商品规格id
  203. windowHeight: 0, // 窗口高度
  204. iScrolltop: 1,
  205. active: 0,
  206. scrollTop: 0,
  207. old: {
  208. scrollTop: 0
  209. },
  210. specClass: 'none',
  211. specSelected:[],
  212. favorite: true,
  213. shareList: [],
  214. imgList: [
  215. ],
  216. desc: `
  217. `,
  218. specList: [
  219. ]
  220. };
  221. },
  222. onLaunch: function(){
  223. this.active = 1;
  224. },
  225. computed:{
  226. ...mapState([
  227. 'hasLogin',
  228. 'userInfo'
  229. ]),
  230. },
  231. onShow: function() {
  232. let _this = this;
  233. uni.getSystemInfo({
  234. success: function (res) {
  235. _this.windowHeight = res.screenHeight;
  236. // console.log("屏幕宽度:"+res.screenWidth);
  237. // console.log("屏幕高度:"+res.screenHeight);
  238. // console.log("可使用窗口宽度:"+res.windowWidth);
  239. // console.log("可使用窗口高度:"+res.windowHeight);
  240. }
  241. });
  242. },
  243. async onLoad(options){
  244. this.goodId = options.id; // 商品Id
  245. this.store_id = options.store_id;
  246. this.getshopdetail(); // 获取商品详情
  247. //规格 默认选中第一条
  248. // this.datalist.spec_list[0].value_list.forEach(item=>{
  249. // for(let cItem of this.specChildList){
  250. // if(cItem.pid === item.id){
  251. // this.$set(cItem, 'selected', true);
  252. // this.specSelected.push(cItem);
  253. // break; //forEach不能使用break
  254. // }
  255. // }
  256. // })
  257. //this.shareList = await this.$api.json('shareList');
  258. },
  259. methods:{
  260. // 跳转到首页
  261. goIndex() {
  262. uni.switchTab({
  263. url:'./index'
  264. })
  265. },
  266. // 更改商品数量
  267. changestorage(e) {
  268. this.shopnumber = e;
  269. },
  270. // 获取商品详情
  271. getshopdetail() {
  272. let params = {};
  273. params.goods_commonid =this.goodId;
  274. params.store_id = this.store_id;
  275. this.request({
  276. url:'/v2/goods/detail',
  277. method:'POST',
  278. data: params,
  279. success: (res)=> {
  280. let { data } = res.data;
  281. this.cartnumber = data.cart;
  282. this.has_collected = data.has_collected;
  283. let array = data;
  284. if(array.spec_list.length == 0) {
  285. this.datalist = data;
  286. this.goods_id = data.goods_list[0].goods_id;
  287. this.goods_storage = data.goods_storage;
  288. //this.specSelected = data.goods_list;
  289. }else {
  290. array.spec_list[0].value_list.forEach( (item,idx) => {
  291. item.goods_storage = data.goods_list[idx].goods_storage;
  292. })
  293. this.datalist = array;
  294. }
  295. }
  296. })
  297. },
  298. shopDetail() {
  299. // url: `/pages/index/shop?id=${id}&store_id=${store_id}`
  300. let goodId = this.goodId; // 商品Id
  301. let store_id = this.store_id;
  302. uni.navigateTo({
  303. url: `/pages/index/commemt?goodId=${goodId}&store_id=${store_id}`
  304. });
  305. },
  306. onChange(event) {
  307. this.active = event.detail.name;
  308. console.log(this.active)
  309. },
  310. //规格弹窗开关
  311. toggleSpec() {
  312. this.specClass = 'show';
  313. //this.specSelected = [];
  314. // if(this.specClass === 'show'){
  315. // this.specClass = 'hide';
  316. // setTimeout(() => {
  317. // this.specClass = 'none';
  318. // }, 250);
  319. // }else if(this.specClass === 'none'){
  320. // this.specClass = 'show';
  321. // }
  322. },
  323. // 关闭弹窗
  324. cancelDiaolog() {
  325. this.showdialog = false;
  326. },
  327. // 确定
  328. confirmDiaolog() {
  329. this.showdialog = false;
  330. uni.navigateTo({
  331. url: '../myCenter/information' // 我的收藏
  332. })
  333. },
  334. openCar() {
  335. if(this.hasLogin) {
  336. let store_id = this.store_id;
  337. uni.navigateTo({
  338. url:`/pages/index/cart?store_id=${store_id}`
  339. })
  340. }else {
  341. this.showdialog = true;
  342. }
  343. },
  344. // 立即购买
  345. buynow() {
  346. if(this.hasLogin) {
  347. if(this.datalist.store_id == 1 || this.datalist.goods_state != 1 || this.datalist.goods_storage < 1) {
  348. this.$msg("商品已下架");
  349. return;
  350. }
  351. if(this.specSelected.length == 0&&this.datalist.spec_list.length != 0) {
  352. this.$msg("请选择规格数量");
  353. this.specClass = 'show';
  354. return;
  355. }
  356. if(this.specSelected.length == 0&&this.datalist.spec_list.length == 0) {
  357. this.specClass = 'show';
  358. this.specSelected = this.datalist.goods_list;
  359. return;
  360. }
  361. console.log( this.datalist);
  362. let goods = [];
  363. goods.push({});
  364. goods[0].goods_id = this.goods_id;
  365. goods[0].buy_num = this.shopnumber;
  366. let prices = this.datalist.goods_price*this.shopnumber;
  367. this.request({
  368. url:'/v1/order/save_og',
  369. method: 'post',
  370. data: {
  371. store_id: this.store_id,
  372. goods: JSON.stringify(goods)
  373. },
  374. success:(res) => {
  375. console.log(res);
  376. let store = this.store_id;
  377. let order_id = res.data.data.order_id;
  378. uni.navigateTo({
  379. url: `/pages/index/sureBuy?store=${store}&prices=${prices}&order_id=${order_id}`
  380. });
  381. }
  382. })
  383. }else {
  384. this.showdialog = true;
  385. }
  386. },
  387. // 加入购物车
  388. addCar() {
  389. if(this.hasLogin) {
  390. if(this.datalist.store_id == 1 || this.datalist.goods_state != 1 || this.datalist.goods_storage < 1) {
  391. this.$msg("商品已下架");
  392. return;
  393. }
  394. if(this.specSelected.length == 0&&this.datalist.spec_list.length == 0) {
  395. this.specClass = 'show';
  396. this.specSelected = this.datalist.goods_list;
  397. return;
  398. }
  399. if(this.specSelected.length == 0&&this.datalist.spec_list.length != 0) {
  400. this.specClass = 'show';
  401. this.$msg("请选择规格数量");
  402. return;
  403. }else {
  404. this.request({
  405. url:'/v2/order/add_cart',
  406. method:'POST',
  407. data: {
  408. goods_id: this.goods_id,
  409. goods_num: this.shopnumber
  410. },
  411. success: () => {
  412. this.$msg("商品添加成功");
  413. this.specClass = 'none';
  414. this.getshopdetail();
  415. }
  416. })
  417. }
  418. }else {
  419. this.showdialog = true;
  420. }
  421. },
  422. closeCar() {
  423. this.specClass = 'none';
  424. },
  425. //选择规格
  426. selectSpec(index, pid,value_name,goods_storage){
  427. this.specSelected = [];
  428. if(goods_storage == 0) {
  429. return;
  430. }
  431. let list = this.datalist.spec_list[index].value_list;
  432. this.datalist.spec_list[index].value_list.forEach(item=>{
  433. if(item.value_id === pid){
  434. this.$set(item, 'selected', true);
  435. }else {
  436. this.$set(item, 'selected', false);
  437. }
  438. })
  439. let array = [];
  440. for(let i = 0; i < this.datalist.spec_list.length; i++) {
  441. for(let j = 0; j<this.datalist.spec_list[i].value_list.length;j++) {
  442. if(this.datalist.spec_list[i].value_list[j].selected) {
  443. array.push(this.datalist.spec_list[i].value_list[j].value_id);
  444. }
  445. }
  446. }
  447. this.arrayId = array;
  448. if(this.arrayId.length == this.datalist.spec_list.length) {
  449. this.scopemapId = array.join("_");
  450. let goodId = this.datalist.spec_map[this.scopemapId]; //
  451. let items = this.datalist.goods_list[goodId]
  452. items.value_name = value_name;
  453. this.nuberImg = items.spec_img;
  454. this.specSelected.push(items)
  455. this.goods_storage = items.goods_storage;
  456. this.goods_id = items.goods_id;
  457. }
  458. // if(this.arrayId.length == this.datalist.spec_list.length) {
  459. // }
  460. // let obj = {};
  461. // obj.firstId = index;
  462. // obj.pid = pid;
  463. // this.arrayId.push(obj);
  464. // console.log(this.arrayId)
  465. // let arr = this.arrayId;
  466. // for(var i=0; i<arr.length; i++){
  467. // for(var j=i+1; j<arr.length; j++){
  468. // if(arr[i].firstId==arr[j].firstId){
  469. // arr.splice(j,1);
  470. // j--;
  471. // }
  472. // }
  473. // }
  474. // let newarray = []
  475. // arr.forEach(item => {
  476. // newarray.push(item.pid);
  477. // })
  478. // this.arrayId = arr;
  479. // if(this.arrayId.length == 0) {
  480. // this.scopemapId = newarray.toString(); ;
  481. // }else {
  482. // this.scopemapId = newarray.join("_");
  483. // }
  484. // console.log(this.scopemapId);
  485. //this.datalist.spec_list[index].value_list = list;
  486. },
  487. // 滚动到顶部
  488. upper(e) {
  489. console.log(e)
  490. console.log("顶部")
  491. },
  492. // 滚到底部
  493. lower(e) {
  494. console.log("底部")
  495. },
  496. // 滚动时触发
  497. scroll(e) {
  498. this.old.scrollTop = e.detail.scrollTop
  499. if(e.detail.scrollTop > this.windowHeight) {
  500. this.iScrolltop = 2;
  501. }else {
  502. this.iScrolltop = 1;
  503. }
  504. },
  505. //收藏
  506. toFavorite(){
  507. if(this.hasLogin) {
  508. this.request({
  509. url: '/v1/favorites/collect',
  510. method: 'post',
  511. data: {
  512. type:'goods',
  513. fav_id: this.goodId
  514. },
  515. success: () => {
  516. this.getshopdetail()
  517. }
  518. })
  519. }else {
  520. this.showdialog = true;
  521. }
  522. //this.favorite = !this.favorite;
  523. },
  524. buy(){
  525. uni.navigateTo({
  526. url: './sureBuy'
  527. })
  528. },
  529. stopPrevent(){}
  530. },
  531. }
  532. </script>
  533. <style lang='scss'>
  534. page{
  535. /* background: $page-color-base; */
  536. /* padding-bottom: 160upx; */
  537. position: relative;
  538. }
  539. .icon-you{
  540. font-size: 28upx + 2upx;
  541. color: #888;
  542. }
  543. .carousel {
  544. height: 722upx;
  545. position:relative;
  546. swiper{
  547. height: 100%;
  548. }
  549. .image-wrapper{
  550. width: 100%;
  551. height: 100%;
  552. }
  553. .swiper-item {
  554. display: flex;
  555. justify-content: center;
  556. align-content: center;
  557. height: 750upx;
  558. overflow: hidden;
  559. image {
  560. width: 100%;
  561. height: 100%;
  562. }
  563. }
  564. }
  565. .titleLayout {
  566. display: flex;
  567. justify-content: space-between;
  568. padding-bottom: 20upx;
  569. }
  570. /* 标题简介 */
  571. .introduce-section{
  572. background: #fff;
  573. padding: 20upx 30upx;
  574. .title{
  575. font-size: 36upx;
  576. color: #303133;
  577. height: 50upx;
  578. line-height: 50upx;
  579. width: 70%;
  580. white-space:nowrap;
  581. overflow:hidden;
  582. text-overflow:ellipsis;
  583. }
  584. .titleRight {
  585. border-left: 1px solid #F5F5F5;
  586. padding-left: 32upx;
  587. }
  588. .price-box{
  589. display:flex;
  590. align-items:baseline;
  591. height: 64upx;
  592. padding: 10upx 0;
  593. font-size: 26upx;
  594. color:#fa436a;
  595. }
  596. .price{
  597. font-size: $font-lg + 2upx;
  598. }
  599. .m-price{
  600. margin:0 12upx;
  601. color: #909399;
  602. text-decoration: line-through;
  603. }
  604. .coupon-tip{
  605. align-items: center;
  606. padding: 4upx 10upx;
  607. background: #fa436a;
  608. font-size: 24upx;
  609. color: #fff;
  610. border-radius: 6upx;
  611. line-height: 1;
  612. transform: translateY(-4upx);
  613. }
  614. .bot-row{
  615. display:flex;
  616. align-items:center;
  617. height: 50upx;
  618. font-size: 24upx;
  619. color: #909399;
  620. text{
  621. flex: 1;
  622. }
  623. }
  624. }
  625. /* 分享 */
  626. .share-section{
  627. display:flex;
  628. align-items:center;
  629. color: #606266;
  630. background: linear-gradient(left, #fdf5f6, #fbebf6);
  631. padding: 12upx 30upx;
  632. .share-icon{
  633. display:flex;
  634. align-items:center;
  635. width: 70upx;
  636. height: 30upx;
  637. line-height: 1;
  638. border: 1px solid #fa436a;
  639. border-radius: 4upx;
  640. position:relative;
  641. overflow: hidden;
  642. font-size: 22upx;
  643. color: #fa436a;
  644. &:after{
  645. content: '';
  646. width: 50upx;
  647. height: 50upx;
  648. border-radius: 50%;
  649. left: -20upx;
  650. top: -12upx;
  651. position:absolute;
  652. background: #fa436a;
  653. }
  654. }
  655. .icon-xingxing{
  656. position:relative;
  657. z-index: 1;
  658. font-size: 24upx;
  659. margin-left: 2upx;
  660. margin-right: 10upx;
  661. color: #fff;
  662. line-height: 1;
  663. }
  664. .tit{
  665. font-size: 28upx;
  666. margin-left:10upx;
  667. }
  668. .icon-bangzhu1{
  669. padding: 10upx;
  670. font-size: 30upx;
  671. line-height: 1;
  672. }
  673. .share-btn{
  674. flex: 1;
  675. text-align:right;
  676. font-size: 24upx;
  677. color: #fa436a;
  678. }
  679. .icon-you{
  680. font-size: 24upx;
  681. margin-left: 4upx;
  682. color: #fa436a;
  683. }
  684. }
  685. .c-list{
  686. font-size: 24upx + 2upx;
  687. color: #606266;
  688. background: #fff;
  689. border-top: 20upx solid #F5F5F5;
  690. border-bottom: 20upx solid #F5F5F5;
  691. .c-row{
  692. display:flex;
  693. align-items:center;
  694. padding: 20upx 30upx;
  695. position:relative;
  696. }
  697. .tit{
  698. width: 140upx;
  699. }
  700. .con{
  701. flex: 1;
  702. color: #303133;
  703. .selected-text{
  704. margin-right: 10upx;
  705. }
  706. }
  707. .bz-list{
  708. height: 40upx;
  709. font-size: 24upx+2upx;
  710. color: #303133;
  711. text{
  712. display: inline-block;
  713. margin-right: 30upx;
  714. }
  715. }
  716. .con-list{
  717. flex: 1;
  718. display:flex;
  719. flex-direction: column;
  720. color: #303133;
  721. line-height: 40upx;
  722. }
  723. .red{
  724. color: #fa436a;
  725. }
  726. }
  727. /* 评价 */
  728. .eva-section{
  729. display: flex;
  730. flex-direction: column;
  731. padding: 20upx 30upx;
  732. background: #fff;
  733. margin-top: 16upx;
  734. .e-header{
  735. display: flex;
  736. align-items: center;
  737. height: 70upx;
  738. font-size: 24upx + 2upx;
  739. color: #909399;
  740. .tit{
  741. font-size: 28upx + 2upx;
  742. color: #303133;
  743. margin-right: 4upx;
  744. }
  745. .tip{
  746. flex: 1;
  747. text-align: right;
  748. }
  749. .icon-you{
  750. margin-left: 10upx;
  751. }
  752. }
  753. }
  754. .eva-box{
  755. display: flex;
  756. padding: 20upx 0;
  757. .portrait{
  758. flex-shrink: 0;
  759. width: 80upx;
  760. height: 80upx;
  761. border-radius: 100px;
  762. }
  763. .right{
  764. flex: 1;
  765. display: flex;
  766. flex-direction: column;
  767. font-size: 28upx;
  768. color: #606266;
  769. padding-left: 26upx;
  770. .con{
  771. font-size: 28upx;
  772. color: #303133;
  773. padding: 20upx 0;
  774. }
  775. .bot{
  776. display: flex;
  777. justify-content: space-between;
  778. font-size: 24upx;
  779. color:#909399;
  780. }
  781. }
  782. }
  783. /* 详情 */
  784. .detail-desc{
  785. background: #fff;
  786. margin-top: 16upx;
  787. margin-bottom: 150rpx;
  788. width: 100%;
  789. .d-header{
  790. display: flex;
  791. justify-content: center;
  792. align-items: center;
  793. height: 80upx;
  794. font-size: 28upx + 2upx;
  795. color: #303133;
  796. position: relative;
  797. text{
  798. padding: 0 20upx;
  799. background: #fff;
  800. position: relative;
  801. z-index: 1;
  802. }
  803. &:after{
  804. position: absolute;
  805. left: 50%;
  806. top: 50%;
  807. transform: translateX(-50%);
  808. width: 300upx;
  809. height: 0;
  810. content: '';
  811. border-bottom: 1px solid #ccc;
  812. }
  813. }
  814. }
  815. /* 规格选择弹窗 */
  816. .attr-content{
  817. padding: 10upx 30upx;
  818. .a-t{
  819. display: flex;
  820. image{
  821. width: 170upx;
  822. height: 170upx;
  823. flex-shrink: 0;
  824. margin-top: -40upx;
  825. border-radius: 8upx;;
  826. }
  827. .right{
  828. display: flex;
  829. flex-direction: column;
  830. padding-left: 24upx;
  831. font-size: 24upx + 2upx;
  832. color: #606266;
  833. line-height: 42upx;
  834. justify-content: space-around;
  835. .price{
  836. font-size: $font-lg;
  837. color: #fa436a;
  838. margin-bottom: 10upx;
  839. }
  840. .selected-text{
  841. margin-right: 10upx;
  842. }
  843. }
  844. }
  845. .attr-list{
  846. display: flex;
  847. flex-direction: column;
  848. font-size: 28upx + 2upx;
  849. color: #606266;
  850. padding-top: 30upx;
  851. padding-left: 10upx;
  852. }
  853. .item-list{
  854. padding: 20upx 0 0;
  855. display: flex;
  856. flex-wrap: wrap;
  857. text{
  858. display: flex;
  859. align-items: center;
  860. justify-content: center;
  861. background: #eee;
  862. margin-right: 20upx;
  863. margin-bottom: 20upx;
  864. border-radius: 100upx;
  865. min-width: 60upx;
  866. height: 60upx;
  867. padding: 0 20upx;
  868. font-size: 28upx;
  869. color: #303133;
  870. }
  871. .selected{
  872. background: #fbebee;
  873. color: #fa436a;
  874. }
  875. .disabled {
  876. color:#fbebee;
  877. background: rgba(245,245,245, 0.5);
  878. }
  879. }
  880. }
  881. /* 弹出层 */
  882. .popup {
  883. position: fixed;
  884. left: 0;
  885. top: 0;
  886. right: 0;
  887. bottom: 100upx;
  888. z-index: 99;
  889. &.show {
  890. display: block;
  891. .mask{
  892. animation: showPopup 0.2s linear both;
  893. }
  894. .layer {
  895. animation: showLayer 0.2s linear both;
  896. }
  897. }
  898. &.hide {
  899. .mask{
  900. animation: hidePopup 0.2s linear both;
  901. }
  902. .layer {
  903. animation: hideLayer 0.2s linear both;
  904. }
  905. }
  906. &.none {
  907. display: none;
  908. }
  909. .mask{
  910. position: fixed;
  911. top: 0;
  912. width: 100%;
  913. height: 90%;
  914. z-index: 1;
  915. background-color: rgba(0, 0, 0, 0.4);
  916. }
  917. .layer {
  918. position: fixed;
  919. z-index: 99;
  920. bottom: 100upx;
  921. width: 100%;
  922. min-height: 40vh;
  923. border-radius: 10upx 10upx 0 0;
  924. background-color: #fff;
  925. .btn{
  926. height: 66upx;
  927. line-height: 66upx;
  928. border-radius: 100upx;
  929. background: #fa436a;
  930. font-size: 28upx + 2upx;
  931. color: #fff;
  932. margin: 30upx auto 20upx;
  933. }
  934. }
  935. @keyframes showPopup {
  936. 0% {
  937. opacity: 0;
  938. }
  939. 100% {
  940. opacity: 1;
  941. }
  942. }
  943. @keyframes hidePopup {
  944. 0% {
  945. opacity: 1;
  946. }
  947. 90% {
  948. opacity: 0;
  949. }
  950. }
  951. @keyframes showLayer {
  952. 0% {
  953. transform: translateY(120%);
  954. }
  955. 100% {
  956. transform: translateY(0%);
  957. }
  958. }
  959. @keyframes hideLayer {
  960. 0% {
  961. transform: translateY(0);
  962. }
  963. 100% {
  964. transform: translateY(120%);
  965. }
  966. }
  967. }
  968. .colored {
  969. color: red;
  970. }
  971. .van-sticky {
  972. /* z-index: 0!important; */
  973. }
  974. /* 详情固定 */
  975. .activeColor {
  976. /* background: #fff!important; */
  977. position: fixed;
  978. background-color: #fff;
  979. top: 0upx;
  980. z-index: 99;
  981. margin-top: 0;
  982. }
  983. .numberchange {
  984. padding-top: 48px;
  985. overflow: hidden;
  986. clear: both;
  987. padding-right: 59rpx;
  988. }
  989. .uni-numbox {
  990. float: right;
  991. }
  992. /* 底部操作菜单 */
  993. .page-bottom{
  994. position: fixed;
  995. left: 0;
  996. bottom: 0;
  997. display: flex;
  998. justify-content: center;
  999. align-items: center;
  1000. width: 100vw;
  1001. height: 100upx;
  1002. z-index: 99;
  1003. background: rgba(255,255,255,.9);
  1004. .p-b-btn{
  1005. display:flex;
  1006. flex-direction: column;
  1007. align-items: center;
  1008. justify-content: center;
  1009. font-size: 24upx;
  1010. color: #606266;
  1011. width: 96upx;
  1012. height: 80upx;
  1013. .yticon{
  1014. font-size: 40upx;
  1015. line-height: 48upx;
  1016. color: #909399;
  1017. }
  1018. &.active, &.active .yticon{
  1019. color: #fa436a;
  1020. }
  1021. .icon-fenxiang2{
  1022. font-size: 42upx;
  1023. transform: translateY(-2upx);
  1024. }
  1025. .icon-shoucang{
  1026. font-size: 46upx;
  1027. }
  1028. }
  1029. .action-btn-group{
  1030. display: flex;
  1031. height: 76upx;
  1032. border-radius: 100px;
  1033. overflow: hidden;
  1034. box-shadow: 0 20upx 40upx -16upx #fa436a;
  1035. box-shadow: 1px 2px 5px rgba(219, 63, 96, 0.4);
  1036. background: linear-gradient(to right, #ffac30,#fa436a,#F56C6C);
  1037. margin-left: 20upx;
  1038. position:relative;
  1039. &:after{
  1040. content: '';
  1041. position:absolute;
  1042. top: 50%;
  1043. right: 50%;
  1044. transform: translateY(-50%);
  1045. height: 28upx;
  1046. width: 0;
  1047. border-right: 1px solid rgba(255,255,255,.5);
  1048. }
  1049. .action-btn{
  1050. display:flex;
  1051. align-items: center;
  1052. justify-content: center;
  1053. width: 180upx;
  1054. height: 100%;
  1055. font-size: 28upx ;
  1056. padding: 0;
  1057. border-radius: 0;
  1058. background: transparent;
  1059. }
  1060. }
  1061. }
  1062. </style>