shop.vue 23 KB

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