shop.vue 25 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084
  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. }else {
  289. array.spec_list[0].value_list.forEach( (item,idx) => {
  290. item.goods_storage = data.goods_list[idx].goods_storage;
  291. })
  292. this.datalist = array;
  293. }
  294. }
  295. })
  296. },
  297. shopDetail() {
  298. // url: `/pages/index/shop?id=${id}&store_id=${store_id}`
  299. let goodId = this.goodId; // 商品Id
  300. let store_id = this.store_id;
  301. uni.navigateTo({
  302. url: `/pages/index/commemt?goodId=${goodId}&store_id=${store_id}`
  303. });
  304. },
  305. onChange(event) {
  306. this.active = event.detail.name;
  307. console.log(this.active)
  308. },
  309. //规格弹窗开关
  310. toggleSpec() {
  311. this.specClass = 'show';
  312. //this.specSelected = [];
  313. // if(this.specClass === 'show'){
  314. // this.specClass = 'hide';
  315. // setTimeout(() => {
  316. // this.specClass = 'none';
  317. // }, 250);
  318. // }else if(this.specClass === 'none'){
  319. // this.specClass = 'show';
  320. // }
  321. },
  322. // 关闭弹窗
  323. cancelDiaolog() {
  324. this.showdialog = false;
  325. },
  326. // 确定
  327. confirmDiaolog() {
  328. this.showdialog = false;
  329. uni.navigateTo({
  330. url: '../myCenter/information' // 我的收藏
  331. })
  332. },
  333. openCar() {
  334. if(this.hasLogin) {
  335. let store_id = this.store_id;
  336. uni.navigateTo({
  337. url:`/pages/index/cart?store_id=${store_id}`
  338. })
  339. }else {
  340. this.showdialog = true;
  341. }
  342. },
  343. // 立即购买
  344. buynow() {
  345. if(this.hasLogin) {
  346. if(this.specSelected.length == 0) {
  347. this.$msg("请选择规格数量");
  348. this.specClass = 'show';
  349. return;
  350. }
  351. let goods = [];
  352. this.specSelected.forEach((item,index) => {
  353. goods.push({});
  354. goods[0].goods_id = item.goods_id;
  355. goods[0].buy_num = this.shopnumber;
  356. })
  357. console.log(goods)
  358. this.request({
  359. url:'/v1/order/save_og',
  360. method: 'post',
  361. data: {
  362. store_id: this.store_id,
  363. goods: JSON.stringify(goods)
  364. },
  365. success:(res) => {
  366. console.log(res);
  367. let order_id = res.data.data.order_id;
  368. uni.navigateTo({
  369. url: `/pages/index/sureBuy?store=${store}&pricelist=${pricelist}&prices=${prices}&order_id=${order_id}`
  370. });
  371. }
  372. })
  373. }else {
  374. this.showdialog = true;
  375. }
  376. },
  377. // 加入购物车
  378. addCar() {
  379. if(this.hasLogin) {
  380. if(this.specSelected.length == 0 && this.datalist.spec_list.length != 0) {
  381. this.specClass = 'show';
  382. this.$msg("请选择规格数量");
  383. return;
  384. }else {
  385. this.request({
  386. url:'/v2/order/add_cart',
  387. method:'POST',
  388. data: {
  389. goods_id: this.goods_id,
  390. goods_num: this.shopnumber
  391. },
  392. success: () => {
  393. this.$msg("商品添加成功");
  394. this.specClass = 'none';
  395. this.getshopdetail();
  396. }
  397. })
  398. }
  399. }else {
  400. this.showdialog = true;
  401. }
  402. },
  403. closeCar() {
  404. this.specClass = 'none';
  405. },
  406. //选择规格
  407. selectSpec(index, pid,value_name,goods_storage){
  408. this.specSelected = [];
  409. if(goods_storage == 0) {
  410. return;
  411. }
  412. let list = this.datalist.spec_list[index].value_list;
  413. this.datalist.spec_list[index].value_list.forEach(item=>{
  414. if(item.value_id === pid){
  415. this.$set(item, 'selected', true);
  416. }else {
  417. this.$set(item, 'selected', false);
  418. }
  419. })
  420. let array = [];
  421. for(let i = 0; i < this.datalist.spec_list.length; i++) {
  422. for(let j = 0; j<this.datalist.spec_list[i].value_list.length;j++) {
  423. if(this.datalist.spec_list[i].value_list[j].selected) {
  424. array.push(this.datalist.spec_list[i].value_list[j].value_id);
  425. }
  426. }
  427. }
  428. this.arrayId = array;
  429. if(this.arrayId.length == this.datalist.spec_list.length) {
  430. this.scopemapId = array.join("_");
  431. let goodId = this.datalist.spec_map[this.scopemapId]; //
  432. let items = this.datalist.goods_list[goodId]
  433. items.value_name = value_name;
  434. this.nuberImg = items.spec_img;
  435. this.specSelected.push(items)
  436. this.goods_storage = items.goods_storage;
  437. this.goods_id = items.goods_id;
  438. }
  439. // if(this.arrayId.length == this.datalist.spec_list.length) {
  440. // }
  441. // let obj = {};
  442. // obj.firstId = index;
  443. // obj.pid = pid;
  444. // this.arrayId.push(obj);
  445. // console.log(this.arrayId)
  446. // let arr = this.arrayId;
  447. // for(var i=0; i<arr.length; i++){
  448. // for(var j=i+1; j<arr.length; j++){
  449. // if(arr[i].firstId==arr[j].firstId){
  450. // arr.splice(j,1);
  451. // j--;
  452. // }
  453. // }
  454. // }
  455. // let newarray = []
  456. // arr.forEach(item => {
  457. // newarray.push(item.pid);
  458. // })
  459. // this.arrayId = arr;
  460. // if(this.arrayId.length == 0) {
  461. // this.scopemapId = newarray.toString(); ;
  462. // }else {
  463. // this.scopemapId = newarray.join("_");
  464. // }
  465. // console.log(this.scopemapId);
  466. //this.datalist.spec_list[index].value_list = list;
  467. },
  468. // 滚动到顶部
  469. upper(e) {
  470. console.log(e)
  471. console.log("顶部")
  472. },
  473. // 滚到底部
  474. lower(e) {
  475. console.log("底部")
  476. },
  477. // 滚动时触发
  478. scroll(e) {
  479. this.old.scrollTop = e.detail.scrollTop
  480. if(e.detail.scrollTop > this.windowHeight) {
  481. this.iScrolltop = 2;
  482. }else {
  483. this.iScrolltop = 1;
  484. }
  485. },
  486. //收藏
  487. toFavorite(){
  488. if(this.hasLogin) {
  489. this.request({
  490. url: '/v1/favorites/collect',
  491. method: 'post',
  492. data: {
  493. type:'goods',
  494. fav_id: this.goodId
  495. },
  496. success: () => {
  497. this.getshopdetail()
  498. }
  499. })
  500. }else {
  501. this.showdialog = true;
  502. }
  503. //this.favorite = !this.favorite;
  504. },
  505. buy(){
  506. uni.navigateTo({
  507. url: './sureBuy'
  508. })
  509. },
  510. stopPrevent(){}
  511. },
  512. }
  513. </script>
  514. <style lang='scss'>
  515. page{
  516. /* background: $page-color-base; */
  517. /* padding-bottom: 160upx; */
  518. position: relative;
  519. }
  520. .icon-you{
  521. font-size: 28upx + 2upx;
  522. color: #888;
  523. }
  524. .carousel {
  525. height: 722upx;
  526. position:relative;
  527. swiper{
  528. height: 100%;
  529. }
  530. .image-wrapper{
  531. width: 100%;
  532. height: 100%;
  533. }
  534. .swiper-item {
  535. display: flex;
  536. justify-content: center;
  537. align-content: center;
  538. height: 750upx;
  539. overflow: hidden;
  540. image {
  541. width: 100%;
  542. height: 100%;
  543. }
  544. }
  545. }
  546. .titleLayout {
  547. display: flex;
  548. justify-content: space-between;
  549. padding-bottom: 20upx;
  550. }
  551. /* 标题简介 */
  552. .introduce-section{
  553. background: #fff;
  554. padding: 20upx 30upx;
  555. .title{
  556. font-size: 36upx;
  557. color: #303133;
  558. height: 50upx;
  559. line-height: 50upx;
  560. width: 70%;
  561. white-space:nowrap;
  562. overflow:hidden;
  563. text-overflow:ellipsis;
  564. }
  565. .titleRight {
  566. border-left: 1px solid #F5F5F5;
  567. padding-left: 32upx;
  568. }
  569. .price-box{
  570. display:flex;
  571. align-items:baseline;
  572. height: 64upx;
  573. padding: 10upx 0;
  574. font-size: 26upx;
  575. color:#fa436a;
  576. }
  577. .price{
  578. font-size: $font-lg + 2upx;
  579. }
  580. .m-price{
  581. margin:0 12upx;
  582. color: #909399;
  583. text-decoration: line-through;
  584. }
  585. .coupon-tip{
  586. align-items: center;
  587. padding: 4upx 10upx;
  588. background: #fa436a;
  589. font-size: 24upx;
  590. color: #fff;
  591. border-radius: 6upx;
  592. line-height: 1;
  593. transform: translateY(-4upx);
  594. }
  595. .bot-row{
  596. display:flex;
  597. align-items:center;
  598. height: 50upx;
  599. font-size: 24upx;
  600. color: #909399;
  601. text{
  602. flex: 1;
  603. }
  604. }
  605. }
  606. /* 分享 */
  607. .share-section{
  608. display:flex;
  609. align-items:center;
  610. color: #606266;
  611. background: linear-gradient(left, #fdf5f6, #fbebf6);
  612. padding: 12upx 30upx;
  613. .share-icon{
  614. display:flex;
  615. align-items:center;
  616. width: 70upx;
  617. height: 30upx;
  618. line-height: 1;
  619. border: 1px solid #fa436a;
  620. border-radius: 4upx;
  621. position:relative;
  622. overflow: hidden;
  623. font-size: 22upx;
  624. color: #fa436a;
  625. &:after{
  626. content: '';
  627. width: 50upx;
  628. height: 50upx;
  629. border-radius: 50%;
  630. left: -20upx;
  631. top: -12upx;
  632. position:absolute;
  633. background: #fa436a;
  634. }
  635. }
  636. .icon-xingxing{
  637. position:relative;
  638. z-index: 1;
  639. font-size: 24upx;
  640. margin-left: 2upx;
  641. margin-right: 10upx;
  642. color: #fff;
  643. line-height: 1;
  644. }
  645. .tit{
  646. font-size: 28upx;
  647. margin-left:10upx;
  648. }
  649. .icon-bangzhu1{
  650. padding: 10upx;
  651. font-size: 30upx;
  652. line-height: 1;
  653. }
  654. .share-btn{
  655. flex: 1;
  656. text-align:right;
  657. font-size: 24upx;
  658. color: #fa436a;
  659. }
  660. .icon-you{
  661. font-size: 24upx;
  662. margin-left: 4upx;
  663. color: #fa436a;
  664. }
  665. }
  666. .c-list{
  667. font-size: 24upx + 2upx;
  668. color: #606266;
  669. background: #fff;
  670. border-top: 20upx solid #F5F5F5;
  671. border-bottom: 20upx solid #F5F5F5;
  672. .c-row{
  673. display:flex;
  674. align-items:center;
  675. padding: 20upx 30upx;
  676. position:relative;
  677. }
  678. .tit{
  679. width: 140upx;
  680. }
  681. .con{
  682. flex: 1;
  683. color: #303133;
  684. .selected-text{
  685. margin-right: 10upx;
  686. }
  687. }
  688. .bz-list{
  689. height: 40upx;
  690. font-size: 24upx+2upx;
  691. color: #303133;
  692. text{
  693. display: inline-block;
  694. margin-right: 30upx;
  695. }
  696. }
  697. .con-list{
  698. flex: 1;
  699. display:flex;
  700. flex-direction: column;
  701. color: #303133;
  702. line-height: 40upx;
  703. }
  704. .red{
  705. color: #fa436a;
  706. }
  707. }
  708. /* 评价 */
  709. .eva-section{
  710. display: flex;
  711. flex-direction: column;
  712. padding: 20upx 30upx;
  713. background: #fff;
  714. margin-top: 16upx;
  715. .e-header{
  716. display: flex;
  717. align-items: center;
  718. height: 70upx;
  719. font-size: 24upx + 2upx;
  720. color: #909399;
  721. .tit{
  722. font-size: 28upx + 2upx;
  723. color: #303133;
  724. margin-right: 4upx;
  725. }
  726. .tip{
  727. flex: 1;
  728. text-align: right;
  729. }
  730. .icon-you{
  731. margin-left: 10upx;
  732. }
  733. }
  734. }
  735. .eva-box{
  736. display: flex;
  737. padding: 20upx 0;
  738. .portrait{
  739. flex-shrink: 0;
  740. width: 80upx;
  741. height: 80upx;
  742. border-radius: 100px;
  743. }
  744. .right{
  745. flex: 1;
  746. display: flex;
  747. flex-direction: column;
  748. font-size: 28upx;
  749. color: #606266;
  750. padding-left: 26upx;
  751. .con{
  752. font-size: 28upx;
  753. color: #303133;
  754. padding: 20upx 0;
  755. }
  756. .bot{
  757. display: flex;
  758. justify-content: space-between;
  759. font-size: 24upx;
  760. color:#909399;
  761. }
  762. }
  763. }
  764. /* 详情 */
  765. .detail-desc{
  766. background: #fff;
  767. margin-top: 16upx;
  768. margin-bottom: 150rpx;
  769. width: 100%;
  770. .d-header{
  771. display: flex;
  772. justify-content: center;
  773. align-items: center;
  774. height: 80upx;
  775. font-size: 28upx + 2upx;
  776. color: #303133;
  777. position: relative;
  778. text{
  779. padding: 0 20upx;
  780. background: #fff;
  781. position: relative;
  782. z-index: 1;
  783. }
  784. &:after{
  785. position: absolute;
  786. left: 50%;
  787. top: 50%;
  788. transform: translateX(-50%);
  789. width: 300upx;
  790. height: 0;
  791. content: '';
  792. border-bottom: 1px solid #ccc;
  793. }
  794. }
  795. }
  796. /* 规格选择弹窗 */
  797. .attr-content{
  798. padding: 10upx 30upx;
  799. .a-t{
  800. display: flex;
  801. image{
  802. width: 170upx;
  803. height: 170upx;
  804. flex-shrink: 0;
  805. margin-top: -40upx;
  806. border-radius: 8upx;;
  807. }
  808. .right{
  809. display: flex;
  810. flex-direction: column;
  811. padding-left: 24upx;
  812. font-size: 24upx + 2upx;
  813. color: #606266;
  814. line-height: 42upx;
  815. justify-content: space-around;
  816. .price{
  817. font-size: $font-lg;
  818. color: #fa436a;
  819. margin-bottom: 10upx;
  820. }
  821. .selected-text{
  822. margin-right: 10upx;
  823. }
  824. }
  825. }
  826. .attr-list{
  827. display: flex;
  828. flex-direction: column;
  829. font-size: 28upx + 2upx;
  830. color: #606266;
  831. padding-top: 30upx;
  832. padding-left: 10upx;
  833. }
  834. .item-list{
  835. padding: 20upx 0 0;
  836. display: flex;
  837. flex-wrap: wrap;
  838. text{
  839. display: flex;
  840. align-items: center;
  841. justify-content: center;
  842. background: #eee;
  843. margin-right: 20upx;
  844. margin-bottom: 20upx;
  845. border-radius: 100upx;
  846. min-width: 60upx;
  847. height: 60upx;
  848. padding: 0 20upx;
  849. font-size: 28upx;
  850. color: #303133;
  851. }
  852. .selected{
  853. background: #fbebee;
  854. color: #fa436a;
  855. }
  856. .disabled {
  857. color:#fbebee;
  858. background: rgba(245,245,245, 0.5);
  859. }
  860. }
  861. }
  862. /* 弹出层 */
  863. .popup {
  864. position: fixed;
  865. left: 0;
  866. top: 0;
  867. right: 0;
  868. bottom: 100upx;
  869. z-index: 99;
  870. &.show {
  871. display: block;
  872. .mask{
  873. animation: showPopup 0.2s linear both;
  874. }
  875. .layer {
  876. animation: showLayer 0.2s linear both;
  877. }
  878. }
  879. &.hide {
  880. .mask{
  881. animation: hidePopup 0.2s linear both;
  882. }
  883. .layer {
  884. animation: hideLayer 0.2s linear both;
  885. }
  886. }
  887. &.none {
  888. display: none;
  889. }
  890. .mask{
  891. position: fixed;
  892. top: 0;
  893. width: 100%;
  894. height: 90%;
  895. z-index: 1;
  896. background-color: rgba(0, 0, 0, 0.4);
  897. }
  898. .layer {
  899. position: fixed;
  900. z-index: 99;
  901. bottom: 100upx;
  902. width: 100%;
  903. min-height: 40vh;
  904. border-radius: 10upx 10upx 0 0;
  905. background-color: #fff;
  906. .btn{
  907. height: 66upx;
  908. line-height: 66upx;
  909. border-radius: 100upx;
  910. background: #fa436a;
  911. font-size: 28upx + 2upx;
  912. color: #fff;
  913. margin: 30upx auto 20upx;
  914. }
  915. }
  916. @keyframes showPopup {
  917. 0% {
  918. opacity: 0;
  919. }
  920. 100% {
  921. opacity: 1;
  922. }
  923. }
  924. @keyframes hidePopup {
  925. 0% {
  926. opacity: 1;
  927. }
  928. 90% {
  929. opacity: 0;
  930. }
  931. }
  932. @keyframes showLayer {
  933. 0% {
  934. transform: translateY(120%);
  935. }
  936. 100% {
  937. transform: translateY(0%);
  938. }
  939. }
  940. @keyframes hideLayer {
  941. 0% {
  942. transform: translateY(0);
  943. }
  944. 100% {
  945. transform: translateY(120%);
  946. }
  947. }
  948. }
  949. .colored {
  950. color: red;
  951. }
  952. .van-sticky {
  953. /* z-index: 0!important; */
  954. }
  955. /* 详情固定 */
  956. .activeColor {
  957. /* background: #fff!important; */
  958. position: fixed;
  959. background-color: #fff;
  960. top: 0upx;
  961. z-index: 99;
  962. margin-top: 0;
  963. }
  964. .numberchange {
  965. padding-top: 48px;
  966. overflow: hidden;
  967. clear: both;
  968. padding-right: 59rpx;
  969. }
  970. .uni-numbox {
  971. float: right;
  972. }
  973. /* 底部操作菜单 */
  974. .page-bottom{
  975. position: fixed;
  976. left: 0;
  977. bottom: 0;
  978. display: flex;
  979. justify-content: center;
  980. align-items: center;
  981. width: 100%;
  982. height: 100upx;
  983. z-index: 99;
  984. background: rgba(255,255,255,.9);
  985. .p-b-btn{
  986. display:flex;
  987. flex-direction: column;
  988. align-items: center;
  989. justify-content: center;
  990. font-size: 24upx;
  991. color: #606266;
  992. width: 96upx;
  993. height: 80upx;
  994. .yticon{
  995. font-size: 40upx;
  996. line-height: 48upx;
  997. color: #909399;
  998. }
  999. &.active, &.active .yticon{
  1000. color: #fa436a;
  1001. }
  1002. .icon-fenxiang2{
  1003. font-size: 42upx;
  1004. transform: translateY(-2upx);
  1005. }
  1006. .icon-shoucang{
  1007. font-size: 46upx;
  1008. }
  1009. }
  1010. .action-btn-group{
  1011. display: flex;
  1012. height: 76upx;
  1013. border-radius: 100px;
  1014. overflow: hidden;
  1015. box-shadow: 0 20upx 40upx -16upx #fa436a;
  1016. box-shadow: 1px 2px 5px rgba(219, 63, 96, 0.4);
  1017. background: linear-gradient(to right, #ffac30,#fa436a,#F56C6C);
  1018. margin-left: 20upx;
  1019. position:relative;
  1020. &:after{
  1021. content: '';
  1022. position:absolute;
  1023. top: 50%;
  1024. right: 50%;
  1025. transform: translateY(-50%);
  1026. height: 28upx;
  1027. width: 0;
  1028. border-right: 1px solid rgba(255,255,255,.5);
  1029. }
  1030. .action-btn{
  1031. display:flex;
  1032. align-items: center;
  1033. justify-content: center;
  1034. width: 180upx;
  1035. height: 100%;
  1036. font-size: 28upx ;
  1037. padding: 0;
  1038. border-radius: 0;
  1039. background: transparent;
  1040. }
  1041. }
  1042. }
  1043. </style>